BNS(Blockchain Node Service)
BNS (Blockchain Node Service) provides full-node RPC call capabilities based on blockchain nodes for all web3 customers. BNS helps customers achieve full node hosting, thereby exempting customers from The cost of node operation and maintenance, time-consuming development, and services are unavailable/scalable.
-
web3_clientVersion
-
web3_sha3
-
eth_blockNumber
-
eth_gasPrice
-
eth_call
web3_clientVersion
Returns the current client version.
Request example
curl -X POST https://blockchainnodeservice.cc
-H 'Content-Type: application/json'
-d '{
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": [],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": "Geth/v1.10.26-stable-e5eb32ac/linux-amd64/go1.18.5"
}
Documentation
Parameters
id (integer; required): a request ID (example: 1).
jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
method (string; required): a method used for the request.
params (array; required): None.
id (integer; required): a request ID (example: 1).
jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
method (string; required): a method used for the request.
params (array; required): None.
Returns
< string >: the current client version.
web3_sha3
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
Request example
curl -X POST https://blockchainnodeservice.cc
-H 'Content-Type: application/json'
-d '{
"jsonrpc": "2.0",
"method": "web3_sha3",
"params": ["0x68656c6c6f20776f726c64"],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x47173285a8d7341e5e972fc67728
6384f802f8ef42a5ec5f03bbfa254cb01fad"
}
documentation
Parameters
id (integer; required): a request ID (example: 1).
jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
method (string; required): a method used for the request.
params (array; required):
< string > (data): the data to convert into a SHA3 hash.
Returns
< string > (data): the SHA3 result of the given string.
eth_blockNumber
Returns the number of most recent block.
Request example
curl -X POST https://blockchainnodeservice.cc
-H 'Content-Type: application/json'
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xf5f277"
}
documentation
Parameters
id (integer; required): a request ID (example: 1).
jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
method (string; required): a method used for the request.
params (array; required): None.
Returns
< string > (quantity): the current block number the client is on.
eth_gasPrice
Returns the current price per gas in wei.
Request example
curl -X POST https://blockchainnodeservice.cc
-H 'Content-Type: application/json'
-d '{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x989680"
}
documentation
Parameters
id (integer; required): a request ID (example: 1).
jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
method (string; required): a method used for the request.
params (array; required): None.
Returns
< string > (quantity): the current gas price in wei.
eth_call
Executes a new message call immediately without creating a transaction on the blockchain.
Request example
curl -X POST https://blockchainnodeservice.cc
-H 'Content-Type: application/json'
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params":
[{
"from":null,
"to":"0x6b175474e89094c44da98b954eedeac495271d0f",
"data":"0x70a082310000000000000000000000006E0d0
1A76C3Cf4288372a29124A26D4353EE51BE"},
"latest"],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000
000000000000000000858898f93629000"
}
documentation
Parameters
id (integer; required): a request ID (example: 1).
jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
method (string; required): a method used for the request.
params (array; required):
1. < object > (hex encoded; required): the transaction object:
from (string; data, 20 bytes; optional): the address the transaction is sent from.
to (string; data, 20 bytes): the address the transaction is directed to.
gas (string; quantity; optional): the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
gasPrice (string; quantity; optional): the gas price willing to be paid by the sender in wei.
value (string; quantity; optional): the value sent with this transaction, in wei.
data (string; data; optional): the hash of the method signature and encoded parameters.
2. < string > (quantity|tag; required): either the hex value of a block number or one of the following block tags:
earliest: the lowest numbered block available on the client.
finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.
Returns
< string >(hex encoded bytes): the return value of executed contract.