EVM
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 | ✔ |
"earliest", "latest" or "pending".:::Below is a list of the RPC methods, the parameters and an example response from the namespaces.## Web3 Methods### web3_clientVersionGet the web3 client version.#### Parameters (0)#### Client Examples```shell
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''
wscat -c ws://localhost:8546 -x ''
javascript
web3.clientVersion();
### `web3_sha3`Returns Keccak-256 (not the standardized SHA3-256) of the given data.#### Parameters (1)1: input `hexutil.Bytes`- Required: ✓ Yes#### Resultjson
#### Client Examplesshell
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''
wscat -c ws://localhost:8546 -x ''
javascript
web3.sha3(input);
## Net Methods### `net_version`Returns the current network id.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `net_peerCount`Returns the number of peers currently connected to the client.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `net_listening`Returns if client is actively listening for network connections.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
## Eth Methods### `eth_protocolVersion`Returns the current ethereum protocol version.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `eth_syncing`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.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `eth_gasPrice`Returns the current gas price in the default EVM denomination parameter.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `eth_accounts`Returns array of all eth accounts.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `eth_blockNumber`Returns the current block height.json
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
```### eth_getBalanceReturns the account balance for a given account address and Block Number.#### Parameters- Account Address
- Block Number or Block Hash (EIP-1898)```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
```### eth_getStorageAtReturns the storage address for a given account address.#### Parameters- Account Address
- Integer of the position in the storage
- Block Number or Block Hash (EIP-1898)```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
```### eth_getTransactionCountReturns the total transaction for a given account address and Block Number.#### Parameters- Account Address
- Block Number or Block Hash (EIP-1898)```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
### `eth_getBlockTransactionCountByNumber`Returns the total transaction count for a given block number.#### Parameters- Block numberjson
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
}
### `eth_getBlockTransactionCountByHash`Returns the total transaction count for a given block hash.#### Parameters- Block Hashjson
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
```### eth_getCodeReturns the code for a given account address and Block Number.#### Parameters- Account Address
- Block Number or Block Hash (EIP-1898)```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
```### eth_signThe sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message: " + 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.
Below is a list of the RPC methods, the parameters and an example response from the namespaces.
Web3 Methods
web3_clientVersion
Get the web3 client version.
Parameters (0)
Client Examples
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''
wscat -c ws://localhost:8546 -x ''
javascript
web3.clientVersion();
web3_sha3
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
Parameters (1)
1: input hexutil.Bytes
- Required: ✓ Yes
Result
Client Examples
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''
wscat -c ws://localhost:8546 -x ''
javascript
web3.sha3(input);
Net Methods
net_version
Returns the current network id.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
net_peerCount
Returns the number of peers currently connected to the client.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
net_listening
Returns if client is actively listening for network connections.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
Eth Methods
eth_protocolVersion
Returns the current ethereum protocol version.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_syncing
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.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_gasPrice
Returns the current gas price in the default EVM denomination parameter.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_accounts
Returns array of all eth accounts.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_blockNumber
Returns the current block height.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_getBalance
Returns the account balance for a given account address and Block Number.
Parameters
- Account Address
- Block Number or Block Hash (EIP-1898)
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_getStorageAt
Returns the storage address for a given account address.
Parameters
- Account Address
- Integer of the position in the storage
- Block Number or Block Hash (EIP-1898)
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_getTransactionCount
Returns the total transaction for a given account address and Block Number.
Parameters
- Account Address
- Block Number or Block Hash (EIP-1898)
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
eth_getBlockTransactionCountByNumber
Returns the total transaction count for a given block number.
Parameters
- Block number
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result
}
eth_getBlockTransactionCountByHash
Returns the total transaction count for a given block hash.
Parameters
- Block Hash
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545
// Result