Methods

Find below a list of JSON-RPC methods supported on Financiyo, 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

Net

Net

Net

Eth

Eth

Eth

Eth

Eth

Eth

eth_getBlockByHash

Eth

Eth

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_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

Personal

personal_sendTransaction

Personal

Personal

personal_ecRecover

Personal

personal_unpair

Personal

db_putString

DB

db_getString

DB

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_propose

Clique

clique_discard

Clique

clique_status

Clique

debug_blockProfile

Debug

debug_cpuProfile

Debug

debug_dumpBlock

Debug

debug_gcStats

Debug

debug_getBlockRlp

Debug

debug_seedHash

Debug

debug_setHead

Debug

debug_setBlockProfileRate

Debug

debug_setGCPercent

Debug

debug_setMutexProfileFraction

Debug

debug_stacks

Debug

debug_writeMemProfile

Debug

debug_writeMutexProfile

Debug

les_addBalance

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.

Web3 Methods

web3_clientVersion

Get the web3 client version.

Parameters (0)

Result

Client Examples

Shell HTTP

Websocket

Javascript Console

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

Shell HTTP

Websocket

Javascript Console

Net Methods

net_version

Returns the current network id.

net_peerCount

Returns the number of peers currently connected to the client.

net_listening

Returns if client is actively listening for network connections.

Eth Methods

eth_protocolVersion

Returns the current ethereum protocol version.

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.

eth_gasPrice

Returns the current gas price in the default EVM denomination parameter.

eth_accounts

Returns array of all eth accounts.

eth_blockNumber

Returns the current block height.

eth_getBalance

Returns the account balance for a given account address and Block Number.

Parameters

  • Account Address

  • Block Number or Block Hash (EIP-1898)

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)

eth_getTransactionCount

Returns the total transaction for a given account address and Block Number.

Parameters

  • Account Address

  • Block Number or Block Hash (EIP-1898)

eth_getBlockTransactionCountByNumber

Returns the total transaction count for a given block number.

Parameters

  • Block number

eth_getBlockTransactionCountByHash

Returns the total transaction count for a given block hash.

Parameters

  • Block Hash

eth_getCode

Returns the code for a given account address and Block Number.

Parameters

  • Account Address

  • Block Number or Block Hash (EIP-1898)

eth_sign

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.

Parameters

  • Account Address

  • Message to sign

eth_sendTransaction

Sends transaction from given account to a given account.

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.

    gas: QUANTITY - (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.

    gasPrice: QUANTITY - (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas

    value: QUANTITY - value sent with this transaction

    data: DATA - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI

    nonce: QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

eth_sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions. You can get signed transaction data using the personal_sign method.

Parameters

  • The signed transaction data

eth_call

Executes a new message call immediately without creating a transaction on the block chain.

Parameters

  • Object containing:

    from: DATA, 20 Bytes - (optional) The address the transaction is sent from.

    to: DATA, 20 Bytes - The address the transaction is directed to.

    gas: QUANTITY - gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.

    gasPrice: QUANTITY - gasPrice used for each paid gas

    value: QUANTITY - value sent with this transaction

    data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation

  • Block number or Block Hash (EIP-1898)

eth_estimateGas

Returns an estimate value of the gas required to send the transaction.

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

eth_getBlockByNumber

Returns information about a block by block number.

Parameters

  • Block Number

  • If true it returns the full transaction objects, if false only the hashes of the transactions.

eth_getBlockByHash

Returns the block info given the hash found in the command above and a bool.

Parameters

  • Hash of a block.

  • If true it returns the full transaction objects, if false only the hashes of the transactions.

eth_getTransactionByHash

Returns transaction details given the ethereum tx something.

Parameters

  • hash of a transaction

eth_getTransactionByBlockHashAndIndex

Returns transaction details given the block hash and the transaction index.

Parameters

  • Hash of a block.

  • Transaction index position.

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

Note: Tx Code from Tendermint and the Ethereum receipt status are switched: | | Tendermint | Ethereum | |---------|------------|----------| | Success | 0 | 1 | | Fail | 1 | 0 |

Parameters

  • Hash of a transaction

eth_newFilter

Create new filter using topics of some kind.

Parameters

  • hash of a transaction

eth_newBlockFilter

Creates a filter in the node, to notify when a new block arrives.

eth_newPendingTransactionFilter

Creates a filter in the node, to notify when new pending transactions arrive.

eth_uninstallFilter

Removes the filter with the given filter id. Returns true if the filter was successfully uninstalled, otherwise false.

Parameters

  • The filter id

eth_getFilterChanges

Polling method for a filter, which returns an array of logs which occurred since last poll.

Parameters

  • The filter id

eth_getFilterLogs

Returns an array of all logs matching filter with given id.

Parameters

  • QUANTITY - The filter id

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.

eth_coinbase

Returns the account the mining rewards will be send to.

eth_getProof

Returns the account- and storage-values of the specified account including the Merkle-proof.

Parameters

  • Address of account or contract

  • Integer of the position in the storage

  • Block Number or Block Hash (EIP-1898)

WebSocket Methods

Read about websockets in Tendermint Events

eth_subscribe

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.

Parameters

  • Subscription Name

  • Optional Arguments

eth_unsubscribe

Unsubscribe from an event using the subscription id

Parameters

  • Subscription ID

Personal Methods

personal_importRawKey

TIP

Private: Requires authentication.

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

personal_listAccounts

TIP

Private: Requires authentication.

Returns a list of addresses for accounts this node manages.

personal_lockAccount

TIP

Private: Requires authentication.

Removes the private key with given address from memory. The account can no longer be used to send transactions.

Parameters

  • Account Address

personal_newAccount

TIP

Private: Requires authentication.

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

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.

Parameters

  • Account Address

  • Passphrase

  • Duration

personal_sendTransaction

TIP

Private: Requires authentication.

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.

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

  • Passphrase

personal_sign

TIP

Private: Requires authentication.

The sign method calculates an Ethereum specific signature with: sign(keccack256("\x19Ethereum Signed Message:\n" + len(message) + message))),

Parameters

  • Message

  • Account Address

  • Password

personal_ecRecover

TIP

Private: Requires authentication.

ecRecover returns the address associated with the private key that was used to calculate the signature in personal_sign.

Parameters

personal_initializeWallet

TIP

Private: Requires authentication.

Initializes a new wallet at the provided URL, by generating and returning a new private key.

Parameters (1)

Parameters must be given by position.

1: url string

  • Required: ✓ Yes

Client Examples

Shell HTTP

Websocket

Javascript Console

personal_unpair

TIP

Private: Requires authentication.

Unpair deletes a pairing between wallet and the node.

Parameters (2)

  • URL

  • Pairing password

Client Examples

Shell HTTP

WebSocket

Javascript Console

Debug Methods

debug_traceTransaction

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.

Parameters

  • Trace Config

debug_traceBlockByNumber

The traceBlockByNumber endpoint accepts a block number and will replay the block that is already present in the database.

Parameters

  • Trace Config

Miner Methods

miner_getHashrate

TIP

Private: Requires authentication.

Get the hashrate in H/s (Hash operations per second).

DANGER

Proof-of-Work specific. This endpoint always returns 0.

miner_setExtra

TIP

Private: Requires authentication.

Sets the extra data a validator can include when proposing blocks. This is capped at 32 bytes.

Parameters

  • Data

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 financiyod 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

miner_start

TIP

Private: Requires authentication.

Start the CPU validation process with the given number of threads.

DANGER

Unsupported. This endpoint always returns an error

Parameters

  • Hex Number of threads

miner_stop

TIP

Private: Requires authentication.

Stop the validation operation.

DANGER

Unsupported. This endpoint always performs a no-op.

miner_setGasLimit

TIP

Private: Requires authentication.

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.

DANGER

Unsupported. This endpoint always returns false

Parameters

  • Hex gas limit

miner_setEtherbase

TIP

Private: Requires authentication.

Sets the etherbase. It changes the wallet where the validator rewards will be deposited.

Parameters

  • Account Address

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

Shell HTTP

Websocket

Javascript Console

Result

txpool_inspect

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

Shell HTTP

Websocket

Javascript Console

Result

txpool_status

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

Shell HTTP

Websocket

Javascript Console

Result

Last updated