Cellframe Node is a background service for Linux/Windows/Mac OS’s and also pluggable library for Android/iOS.
This service exports socket, which address/path is decribed in base config (Configuration) in conserver section for external control.
For client interactions on desktops of UNIX-based OS is used UNIX-socket, for Windows/Android/iOS is used TCP-socket. This all can be tuned by using listen_unix_socket_path
and listen_port_tcp
parameters.
There is protocol for interaction between user and service called JSON_RPC.
There is an RPC-client with Cellframe Node CLI has already included in the cellframe node package. It is provided and built with the Cellframe node service and realises CLI interface which works according to JSON-RPC protocol.
Below there are two examples of interaction with the node:
- The first one is local, you can use Cellframe-Node CLI
Command:
cellframe-node-cli help|?
Response:
Available commands:
srv_stake: Delegated stake service commands
dag: DAG commands
dag_poa: DAG PoA commands
block: Create and explore blockchains
block_poa: Blockchain PoA commands
esbocs: ESBOCS commands
net: Network commands
net_srv: Network services managment
srv_xchange: eXchange service commands
stake_lock: Stake lock service commands
srv_datum: Service Datum commands
vpn_client: VPN client control
global_db: Work with global database
mempool: Sign operations
node: Work with node
ping: Send ICMP ECHO_REQUEST to network hosts
traceroute: Print the hops and time of packets trace to network host
tracepath: Traces path to a network host along this path
version: Return software version
help: Description of command parameters
?: Synonym for "help"
wallet: Wallet operations
token_update: Token update
token_decl: Token declaration
token_update_sign: Token update add sign and new sign
token_decl_sign: Token declaration add sign
token_emit: Token emission
mempool: Command for working with mempool
chain_ca_pub: Add pubic certificate into the mempool to prepare its way to chains
chain_ca_copy: Copy pubic certificate into the mempool to prepare its way to chains
tx_create: Make transaction
tx_create_json: Make transaction
tx_cond_create: Make cond transaction
tx_verify: Verifing transaction in mempool
tx_history: Transaction history (for address or by hash)
ledger: Ledger information
token: Token info
print_log: Print log info
stats: Print statistics
gdb_export: Export gdb to JSON
gdb_import: Import gdb from JSON
remove: Delete chain files or global database
decree: Work with decree
exit: Stop application and exit
- The next one is provided by JSON_RPC
Command:
curl --unix-socket /opt/cellframe-node/var/run/node_cli
-X POST http://localhost/connect
-d '{"method":"help", "params":[], "id":"1"}'
Response:
{
"type": 0,
"result": "as in cli response",
"errors": null,
"id": 1
}