rchain / rchain-api

Obsoleted in favor of https://github.com/rchain-community/rchain-api. Use at your own risk.
Other
8 stars 4 forks source link

WIP: Repl support #13

Closed justinmeiners closed 5 years ago

justinmeiners commented 5 years ago

This branch is in progress, but I want to create this PR for discussion.

Note that Rnode exposes both internal and external ports. The external is publicly accessibly while the internal may be available only to the node operator. The repl commands I am adding are only accessible internally. This means that we probably need two separate clients for each.

dckc commented 5 years ago

Tell me more about what this is for?

justinmeiners commented 5 years ago

@dckc Rnodes have commands for evaluating and running rholang contracts. This is important for testing as it provides a full node environment (unlike rholang CLI, which is stripped down to the language.) So this is to add support for those into the API.

dckc commented 5 years ago

OK, but does rnode eval xyz.rho not suffice? If not, can you give a more concrete example?

JoshOrndorff commented 5 years ago

@justinmeiners Could I use this to communicate with a plain rholangCLI with this? That would be awesome!

I could imagine this being useful for testing contracts without wanting to wait for casper? Just brainstorming.

I am curious if you had something specific in mind.

Also, I don't feel very strongly that a concrete use case is necessary to get correct code checked in at this point.

justinmeiners commented 5 years ago

@dckc Yes, Cryptofex uses it so you can run/eval from within the IDE when you are editing a contract and connected to a node. I could imagine other developers wanting to do something similar, for example provide a web page which interacted with their node.

@JoshOrndorff Not with rholang CLI. It doesn't have any GRPC stuff.

Yep, still lots of work to do. I'll let you know when its worth reviewing.

dckc commented 5 years ago

@justinmeiners writes:

Cryptofex uses it so you can run/eval from within the IDE ...

got it.

@JoshOrndorff writes:

I don't feel very strongly that a concrete use case is necessary to get correct code checked in at this point.

Yeah, well, you're wrong :)

JoshOrndorff commented 5 years ago

I believe @jimscarver wants this feature so his discord-based interpreter "rhobot" can use the repl/eval rather than go on-chain.

dckc commented 5 years ago

We're track issues and such using https://github.com/rchain-community/rchain-api/ now.

In particular, see https://github.com/rchain-community/rchain-api/issues/36

I suggest you close this PR.

I was going to close it, but I don't seem to have permission.

justinmeiners commented 5 years ago

@dckc Yup I filed that one. I'll close the PR.