RChain client for node.js
npm install rchain-apiAn API for dApp frontends to communicate with the RChain blockchain.
The [RChain Cooperative][1] is developing a decentralized, economically sustainable public compute infrastructure. Decentralized applications or "dApps" will run their business logic as smart contracts on the blockchain. Their user interfaces will be more traditional programs that interact with the blockchain as a backend. This separation allows dApp developers to create nice abstract interfaces, and allows end users to create their own sovereign interfaces should they choose to do so.
[1]: https://www.rchain.coop/
Make note of your RNode's hostname and gRPC port. If you're not sure, localhost and 40401 are good guesses.
[2]: https://rchain.atlassian.net/wiki/spaces/CORE/pages/428376065/User+guide+for+running+RNode
git clone https://github.com/JoshOrndorff/RChain-APIAnd install dependencies with npm install
Run rnodeAPI.js with _host_ and _port_ arguments, as in: node rnodeAPI.js rnode-test.rhobot.net 50000.
You should see something like:
```
stuffToSign serialized {
"type": "Buffer",
"data": "0a300a110a0f2a031a01784a08000000000000000012112a051a036162634a0800000000000000002a0800000000000000004a080000000000000000"
}
...
doDeploy result: { success: true, message: 'Success!' }
@@createBlock(): {
"block": {
"blockHash": {
"type": "Buffer",
"data": "3c5d97e2627432026b6d4a17c8027afb95b72e8d08a936d785b58459eff5859e"
thin client or using RChain-API itself.`javascript
const myNode = RNode('localhost', 40401);
rchain.doDeploy({
term: '@"aliceUpdates"!("Having fun traveling!")',
timestamp: clock().valueOf(),
// from: '0x1',
// nonce: 0,
})
``For now see the integration test examples in rnodeAPI.js
Apache 2.0 License (See LICENSE.txt)
Contributions welcome (See CONTRIBUTING.md)