Commands for calling rnode
With RNode running, use --help
to see available commands and subcommands.
The RNode API is a server side API. To access the local RNode server once you have RNode running, open a new window and invoke the RNode api with:
rnode <API call>
You can call the API of a remote RNode server by specifying the host server and host server port.
Option | Description | Syntax | Argument Format |
---|---|---|---|
Host Server | The IP address of the server that will receive the call | --grpc-host | 100.10.25.75 |
Host Server port | The port for the gRPC API on the server listening for calls | --grpc-port | 40401 |
This is an example of an API call to a remote server
./bin/rnode --grpc-host IP.Address.of.server --grpc-port 40401 repl
You can ask RNode to provide its status to report the RNode address, version, and peer count.
curl -s http://localhost:40403/status
Report status in Docker
sudo docker exec -ti <containername> curl -s http://localhost:40403/status
Example of a status request response
{"address":"rnode://4fa269b79e781af2c079713772cfc5dbd7dc1569@52.119.8.64?protocol=40400&discovery=40404","version":"RChain Node 0.9.4.git8a4c9939 (8a4c99394c3a22831c2eadef7cdde7dec35238d7)","peers":7,"nodes":44}
RNode offers two types of counts of peers. peers are the number of nodes you are connected to via the Kademlia protocol and the ones that are able to pass messages such as blocks. nodes are the number of nodes found as part of node discovery.
Use this command to show the number of blocks in the DAG according to your node.
Report status in Docker
rnode show-blocks
Get a count of blocks in Docker
Report status in Docker
docker run -it --rm --network-id rnode-net --name rnode -v $HOME/var/rholang:/var/ rchain/rnode:latest --grpc-host rnode2 show-blocks
You can use the RNode software to generate either a secp256k1 public/private key set to use when deploying Rholang or in other scenarios where providing keys is a requirement. With the release of RNode v0.9.7 the platform uses the secp256k1 algorithm.
rnode keygen --algorithm secp256k1 --private-key-path <arg>