npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rchain-api

v0.7.1-beta.2

Published

RChain client for node.js

Downloads

11

Readme

RChain-API

An API for dApp frontends to communicate with the RChain blockchain.

The RChain Cooperative 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.

Quickstart

Find an RChain node whose grpc endpoint you can use.

At the moment that likely means running your own RNode. We're working on a community node at rnode-test.rhobot.net

Make note of your RNode's hostname and gRPC port. If you're not sure, localhost and 40401 are good guesses.

Grab RChain-API

Clone this repository with eg git clone https://github.com/JoshOrndorff/RChain-API

And install dependencies with npm install

(Recommended) Run the integration test

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"

Deploy contract to RNode

There are not yet nice truffle-style build tools, so you will probably deploy your code directly using the rnode deploy thin client or using RChain-API itself.

const myNode = RNode('localhost', 40401);
rchain.doDeploy({
  term: '@"aliceUpdates"!("Having fun traveling!")',
  timestamp: clock().valueOf(),
  // from: '0x1',
  // nonce: 0,
})

Interact with the blockchain

TODO Better docs would be great.

For now see the integration test examples in rnodeAPI.js

Examples and Related Projects

  • Nth Caller a minimal RChain-based dApp game that uses RChain-API
  • Status a moderately complex dapp that uses more RChain-API features as well as RSign
  • Coin Faucet An advanced robust dApp that use raspberry PI to airdrop tokens to devices in physical proximity
  • RChain-dbr A web-of-trust based distributed budgeting and rewards dApp
  • RSign A chrome extension for generating client-side signatures akin to metamask
  • node-client A similar but less mature RChain API written in python

RChain Protocol Buffer Dependency

License

Copyright 2018 RChain Cooperative

Apache 2.0 License (See LICENSE.txt)

Contributions welcome (See CONTRIBUTING.md)