Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

rchain-toolkit

0.2.6 • Public • Published

rchain-toolkit

Up to date with rnode 0.9.22

rchain-toolkit is a general purpose javascript/typescript library to interact with the RChain blockchain, and play with rholang expressions in node JS or the browser. It is not ready for production, not stable and the development is not completed yet.

It includes utils for easily deploying rholang code (smart contract), sending REV transactions, retreiving blocks, listen for data at unforgeable names, public names etc... All of the methods, parameters, and returned values are typed using typescript so the developer can comfortably code.

rchain-toolkit provides some GRPC utils since rnode's main API is GRPC, but it does not strictly assume the transport. This library builds proto objects based on rnode's proto definition files and some user parameters. GRPC is not included in the library, making it potentially elligible for the browser, GRPC and GRPC's proto-loader libraries must be installed separatly in your own project.

The examples folder contains example for each GRPC interface that is currently supported, each one of them exists in typescript and javascript.

Examples

See examples/

Development

Compiling

typescript must be installed on your machine

npm install -g typescript

Compile the .ts files in src directory to the main dist directory.

npm run compile

Jest tests

The jest tests are all the tests that do not require proto-loader or GRPC, because it does not work under jest's runtime.

Run the jest tests

npm run test:jest

Full tests

The full tests are the tests that interact with the .proto files, and rnode. A local rnode instance must be running on localhost:40401.

Run the full tests

npm run compile:tests
npm run test:full -- --private-key AAA --public-key BBB

Install

npm i rchain-toolkit

DownloadsWeekly Downloads

11

Version

0.2.6

License

MIT

Unpacked Size

12.9 MB

Total Files

603

Last publish

Collaborators

  • avatar