Find below a list of JSON-RPC methods supported on CrossFi, sorted by namespaces.
Curl Examples Explained
The curl options below might return a response where the node complains about the content type, this is because the --data option sets the content type to application/x-www-form-urlencoded. If your node does complain, manually set the header by placing -H "Content-Type: application/json" at the start of the call.
The examples also do not include the URL/IP & port combination which must be the last argument given to curl e.x. 127.0.0.1:8545
Endpoints
Method
Namespace
Implemented
Public
Notes
web3_clientVersion
Web3
✔
✔
web3_sha3
Web3
✔
✔
net_version
Net
✔
✔
net_peerCount
Net
✔
✔
net_listening
Net
✔
✔
eth_protocolVersion
Eth
✔
✔
eth_syncing
Eth
✔
✔
eth_gasPrice
Eth
✔
✔
eth_accounts
Eth
✔
✔
eth_blockNumber
Eth
✔
✔
eth_getBalance
Eth
✔
✔
eth_getStorageAt
Eth
✔
✔
eth_getTransactionCount
Eth
✔
✔
eth_getBlockTransactionCountByNumber
Eth
✔
✔
eth_getBlockTransactionCountByHash
Eth
✔
✔
eth_getCode
Eth
✔
✔
eth_sign
Eth
✔
✔
eth_sendTransaction
Eth
✔
✔
eth_sendRawTransaction
Eth
✔
✔
eth_call
Eth
✔
✔
eth_estimateGas
Eth
✔
✔
eth_getBlockByNumber
Eth
✔
✔
eth_getBlockByHash
Eth
✔
✔
eth_getTransactionByHash
Eth
✔
✔
eth_getTransactionByBlockHashAndIndex
Eth
✔
✔
eth_getTransactionReceipt
Eth
✔
✔
eth_newFilter
Eth
✔
✔
eth_newBlockFilter
Eth
✔
✔
eth_newPendingTransactionFilter
Eth
✔
✔
eth_uninstallFilter
Eth
✔
✔
eth_getFilterChanges
Eth
✔
✔
eth_getFilterLogs
Eth
✔
✔
eth_getLogs
Eth
✔
✔
eth_getTransactionbyBlockNumberAndIndex
Eth
✔
eth_getWork
Eth
N/A
✔
PoW-only
eth_submitWork
Eth
N/A
✔
PoW-only
eth_submitHashrate
Eth
eth_getCompilers
Eth
eth_compileLLL
Eth
eth_compileSolidity
Eth
eth_compileSerpent
Eth
eth_signTransaction
Eth
eth_mining
Eth
❌
eth_coinbase
Eth
✔
eth_hashrate
Eth
N/A
❌
PoW-only
eth_getUncleCountByBlockHash
Eth
N/A
PoW-only
eth_getUncleCountByBlockNumber
Eth
N/A
PoW-only
eth_getUncleByBlockHashAndIndex
Eth
N/A
PoW-only
eth_getUncleByBlockNumberAndIndex
Eth
N/A
PoW-only
eth_getProof
Eth
✔
eth_subscribe
Websocket
✔
eth_unsubscribe
Websocket
✔
personal_importRawKey
Personal
✔
❌
personal_listAccounts
Personal
✔
❌
personal_lockAccount
Personal
✔
❌
personal_newAccount
Personal
✔
❌
personal_unlockAccount
Personal
✔
❌
personal_sendTransaction
Personal
✔
❌
personal_sign
Personal
✔
❌
personal_ecRecover
Personal
✔
❌
personal_initializeWallet
Personal
✔
❌
personal_unpair
Personal
✔
❌
db_putString
DB
db_getString
DB
db_putHex
DB
db_getHex
DB
shh_post
SSH
shh_version
SSH
shh_newIdentity
SSH
shh_hasIdentity
SSH
shh_newGroup
SSH
shh_addToGroup
SSH
shh_newFilter
SSH
shh_uninstallFilter
SSH
shh_getFilterChanges
SSH
shh_getMessages
SSH
admin_addPeer
Admin
❌
admin_datadir
Admin
❌
admin_nodeInfo
Admin
❌
admin_peers
Admin
❌
admin_startRPC
Admin
❌
admin_startWS
Admin
❌
admin_stopRPC
Admin
❌
admin_stopWS
Admin
❌
clique_getSnapshot
Clique
clique_getSnapshotAtHash
Clique
clique_getSigners
Clique
clique_proposals
Clique
clique_propose
Clique
clique_discard
Clique
clique_status
Clique
debug_backtraceAt
Debug
debug_blockProfile
Debug
✔
debug_cpuProfile
Debug
✔
debug_dumpBlock
Debug
debug_gcStats
Debug
✔
debug_getBlockRlp
Debug
debug_goTrace
Debug
✔
debug_freeOSMemory
Debug
✔
debug_memStats
Debug
✔
debug_mutexProfile
Debug
✔
debug_seedHash
Debug
debug_setHead
Debug
debug_setBlockProfileRate
Debug
✔
debug_setGCPercent
Debug
✔
debug_setMutexProfileFraction
Debug
✔
debug_stacks
Debug
✔
debug_startCPUProfile
Debug
✔
debug_startGoTrace
Debug
✔
debug_stopCPUProfile
Debug
✔
debug_stopGoTrace
Debug
✔
debug_traceBlock
Debug
✔
debug_traceBlockByNumber
Debug
✔
debug_traceBlockByHash
Debug
✔
debug_traceBlockFromFile
Debug
debug_standardTraceBlockToFile
Debug
debug_standardTraceBadBlockToFile
Debug
debug_traceTransaction
Debug
✔
debug_verbosity
Debug
debug_vmodule
Debug
debug_writeBlockProfile
Debug
✔
debug_writeMemProfile
Debug
✔
debug_writeMutexProfile
Debug
✔
les_serverInfo
Les
les_clientInfo
Les
les_priorityClientInfo
Les
les_addBalance
Les
les_setClientParams
Les
les_setDefaultParams
Les
les_latestCheckpoint
Les
les_getCheckpoint
Les
les_getCheckpointContractAddress
Les
miner_getHashrate
Miner
✔
❌
No-op
miner_setExtra
Miner
✔
❌
No-op
miner_setGasPrice
Miner
✔
❌
Needs node restart
miner_start
Miner
✔
❌
No-op
miner_stop
Miner
✔
❌
No-op
miner_setGasLimit
Miner
✔
❌
No-op
miner_setEtherbase
Miner
✔
❌
txpool_content
TxPool
✔
txpool_inspect
TxPool
✔
txpool_status
TxPool
✔
:::tip Block Number can be entered as a Hex string, "earliest", "latest" or "pending". :::
Below is a list of the RPC methods, the parameters and an example response from the namespaces.
The sync status object may need to be different depending on the details of Tendermint's sync protocol. However, the 'synced' result is simply a boolean, and can easily be derived from Tendermint's internal sync state.
The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).
By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.
:::warning The address to sign with must be unlocked. :::
Creates new message call transaction or a contract creation for signed transactions. You can get signed transaction data using the personal_sign method.
Returns an array of all logs matching filter with given id.
Parameters
QUANTITY - The filter id
// Requestcurl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x127e9eca4f7751fb4e5cb5291ad8b455"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"filter 0x35b64c227ce30e84fc5c7bd347be380e doesn't have a LogsSubscription type: got 5"}}
eth_getLogs
Returns an array of all logs matching a given filter object.
Parameters
Object containing:
fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.
toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.
address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
topics: Array of DATA, - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options.
blockhash: (optional, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in in the filter criteria, then neither fromBlock nor toBlock are allowed.
subscribe using JSON-RPC notifications. This allows clients to wait for events instead of polling for them.
It works by subscribing to particular events. The node will return a subscription id. For each event that matches the subscription a notification with relevant data is send together with the subscription id.
Imports the given unencrypted private key (hex encoded string) into the key store, encrypting it with the passphrase.
Returns the address of the new account.
Parameters (2)
1: privkey string
Required: ✓ Yes
2: password string
Required: ✓ Yes
// Requestcurl -X POST --data '{"jsonrpc":"2.0","method":"personal_importRawKey","params":["c5bd76cd0cd948de17a31261567d219576e992d9066fe1a6bca97496dec634e2c8e06f8949773b300b9f73fabbbc7710d5d6691e96bcf3c9145e15daf6fe07b9", "the key is this"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
personal_listAccounts
:::tip Private: Requires authentication. :::
Returns a list of addresses for accounts this node manages.
Generates a new private key and stores it in the key store directory. The key file is encrypted with the given passphrase. Returns the address of the new account.
Parameters
Passphrase
// Requestcurl -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":["This is the passphrase"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result{"jsonrpc":"2.0","id":1,"result":"0xf0e4086ad1c6aab5d42161d5baaae2f9ad0571c0"}
personal_unlockAccount
:::tip Private: Requires authentication. :::
Decrypts the key with the given address from the key store.
Both passphrase and unlock duration are optional when using the JavaScript console. The unencrypted key will be held in memory until the unlock duration expires. If the unlock duration defaults to 300 seconds. An explicit duration of zero seconds unlocks the key until geth exits.
The account can be used with eth_sign and eth_sendTransaction while it is unlocked.
Validate the given passphrase and submit transaction.
The transaction is the same argument as for eth_sendTransaction and contains the from address. If the passphrase can be used to decrypt the private key belonging to tx.from the transaction is verified, signed and send onto the network.
:::warning The account is not unlocked globally in the node and cannot be used in other RPC calls. :::
Parameters
Object containing:
from: DATA, 20 Bytes - The address the transaction is send from.
to: DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.
value: QUANTITY - value sent with this transaction
The traceTransaction debugging method will attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been executed prior to this one before it will finally attempt to execute the transaction that corresponds to the given hash.
Get the hashrate in H/s (Hash operations per second).
:::warning Proof-of-Work specific. This endpoint always returns 0. :::
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setGasPrice","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result
{"jsonrpc":"2.0","id":1,"result":0}
miner_setExtra
:::tip Private: Requires authentication. :::
Sets the extra data a validator can include when proposing blocks. This is capped at 32 bytes.
:::warning Unsupported. This endpoint always returns an error :::
Parameters
Data
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setExtra","params":["data"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result
{"jsonrpc":"2.0","id":1,"result":false}
miner_setGasPrice
:::tip Private: Requires authentication. :::
Sets the minimal gas price used to accept transactions. Any transaction below this limit is excluded from the validator block proposal process.
This method requires a node restart after being called because it changes the configuration file.
Make sure your crossfid start call is not using the flag minimum-gas-prices because this value will be used instead of the one set on the configuration file.
Parameters
Hex Gas Price
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setGasPrice","params":["0x0"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result
{"jsonrpc":"2.0","id":1,"result":true}
miner_start
:::tip Private: Requires authentication. :::
Start the CPU validation process with the given number of threads.
:::warning Unsupported. This endpoint always returns an error :::
Parameters
Hex Number of threads
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start","params":["0x1"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result
{"jsonrpc":"2.0","id":1,"result":false}
miner_stop
:::tip Private: Requires authentication. :::
Stop the validation operation.
:::warning Unsupported. This endpoint always performs a no-op. :::
Sets the gas limit the miner will target when mining. Note: on networks where EIP-1559 is activated, this should be set to twice what you want the gas target (i.e. the effective gas used on average per block) to be.
:::warning Unsupported. This endpoint always returns false :::
Parameters
Hex gas limit
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setGasLimit","params":["0x10000"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result
{"jsonrpc":"2.0","id":1,"result":false}
miner_setEtherbase
:::tip Private: Requires authentication. :::
Sets the etherbase. It changes the wallet where the validator rewards will be deposited.
Parameters
Account Address
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setEtherbase","params":["0x3b7252d007059ffc82d16d022da3cbf9992d2f70"],"id":1}' -H "Content-Type: application/json" http://localhost:8545
// Result
{"jsonrpc":"2.0","id":1,"result":true}
TxPool Methods
txpool_content
Returns a list of the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Parame (0)
Client Examples
curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
Returns a list on text format to summarize all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. This is a method specifically tailored to developers to quickly see the transactions in the pool and find any potential issues.
Parameters (0)
Client Examples
curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_inspect","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Parameters (0)
Client Examples
curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_status","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545