The BSV SV Node JSON-RPC API allows developers to interact with the BSV blockchain through a set of remote procedure calls. This document outlines the available commands and their usage.
It’s important to keep your RPC interface secure, it allows direct control over how your node operates. Use firewalls and the rpcallowip setting to limit access to the RPC interface.
Overview
The JSON-RPC API provides a way to communicate with the BSV SV Node to perform various operations such as querying blockchain data, managing transactions, and retrieving network information.
JSON-RPC is a remote procedure call (RPC) protocol encoded in JSON. It allows for calling methods on a server from a client and receiving responses in a structured manner.
To use the JSON-RPC API, you need to configure your BSV SV Node to accept JSON-RPC commands. This involves setting up the node with the appropriate RPC credentials and network settings.
Configuration
Enable RPC: Ensure that the bitcoin.conf file has the following settings:
~/bitcoin/bin/bitcoin-cli -datadir="/home/ubuntu/bitcoin-data" help submitminingsolution
submitminingsolution "<json string>"
Attempts to submit a new block to the network.
Json Object should comprise of the following and must be escaped
{
"id": n, (string) ID from getminingcandidate RPC
"nonce": n, (integer) Miner generated nonce
"coinbase": "", (hex string, optional) Modified Coinbase transaction
"time": n, (integer, optional) Block time
"version": n (integer, optional) Block version
}
Result:
Nothing on success, error string if block was rejected.
Identical to "submitblock".