tgrospic / rnode-client-js

Web example https://tgrospic.github.io/rnode-client-js
MIT License
19 stars 19 forks source link

doDeploy or DoDeploy? #4

Closed dckc closed 4 years ago

dckc commented 4 years ago

does this still work?

https://github.com/tgrospic/rnode-client-js/blob/8517a3532043648c577b5e08fd6b385bd1507c80/src/nodejs/client.js#L31

in the generated .js, I see:

const { getBlocks, listenForDataAtName, DoDeploy } = rnodeDeploy(options)

but when I try to use it that way, I get:

Error: 12 UNIMPLEMENTED: Method not found: coop.rchain.casper.protocol.DeployService/DoDeploy

context: https://github.com/rchain-community/rv2020/tree/m3g/m3g 6cc4731

npm install and then npm run init should reproduce the problem.

tgrospic commented 4 years ago

@dckc both are correct, depending for which RNode version you generate JS bindings. You can also find some info here https://github.com/tgrospic/rnode-grpc-js/issues/5.

rnode-grpc-js has --rnode-version parameter which you can use generate correct JS API. This repository is an example how to use it and it's currently using 0.9.22 version to generate API. https://github.com/tgrospic/rnode-client-js/blob/26e792aaa95e7d31550fbb2979cd998e866240fc/package.json#L14

dckc commented 4 years ago

The method name for deploying changed since 0.9.22?!?!?! Why?

So what version do I use to interoperate with testnet and mainnet? I just used the default.

dckc commented 4 years ago

https://node3.testnet.rchain-dev.tk/status says "version":"RChain Node 0.9.23-8-g0eb25aa (0eb25aa2455b7d59b94a6937755cc098b490131f)" but https://github.com/rchain/rchain/releases/tag/v0.9.23 says d6e2c31 so I tried --rnode-version 0eb25aa but I got 404. --rnode-version v0.9.23 seems to work.

I don't understand why the default doesn't work, but I suppose that should be a separate issue.

tgrospic commented 4 years ago

The method name for deploying changed since 0.9.22?!?!?! Why?

So what version do I use to interoperate with testnet and mainnet? I just used the default.

@dckc default value (when empty) is still 0.9.12 version. It needs to be updated, at least when protobuf definition is changed also. https://github.com/tgrospic/rnode-grpc-js/issues/7

This is the PR when RNode API is changed. It's published with 0.9.15 version. https://github.com/rchain/rchain/pull/2729

--rnode-version accepts whatever can be substituted for version to get list of files from GitHub. https://api.github.com/repos/rchain/rchain/contents/${dir}?ref=${version} https://github.com/tgrospic/rnode-grpc-js/blob/4d3bf4b/src/cli/index.js#L67-L69