Pular para o conteúdo principal

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​

MethodNamespaceImplementedPublicNotes
web3_clientVersionWeb3✔✔
web3_sha3Web3✔✔
net_versionNet✔✔
net_peerCountNet✔✔
net_listeningNet✔✔
eth_protocolVersionEth✔✔
eth_syncingEth✔✔
eth_gasPriceEth✔✔
eth_accountsEth✔✔
eth_blockNumberEth✔✔
eth_getBalanceEth✔✔
eth_getStorageAtEth✔✔
eth_getTransactionCountEth✔✔
eth_getBlockTransactionCountByNumberEth✔✔
eth_getBlockTransactionCountByHashEth✔✔
eth_getCodeEth✔✔
eth_signEth✔✔
eth_sendTransactionEth✔✔
eth_sendRawTransactionEth✔✔
eth_callEth✔✔
eth_estimateGasEth✔✔
eth_getBlockByNumberEth✔✔
eth_getBlockByHashEth✔✔
eth_getTransactionByHashEth✔✔
eth_getTransactionByBlockHashAndIndexEth✔✔
eth_getTransactionReceiptEth✔✔
eth_newFilterEth✔✔
eth_newBlockFilterEth✔✔
eth_newPendingTransactionFilterEth✔✔
eth_uninstallFilterEth✔✔
eth_getFilterChangesEth✔✔
eth_getFilterLogsEth✔✔
eth_getLogsEth✔✔
eth_getTransactionbyBlockNumberAndIndexEth✔
eth_getWorkEthN/A✔PoW-only
eth_submitWorkEthN/A✔PoW-only
eth_submitHashrateEth
eth_getCompilersEth
eth_compileLLLEth
eth_compileSolidityEth
eth_compileSerpentEth
eth_signTransactionEth
eth_miningEth❌
eth_coinbaseEth✔
eth_hashrateEthN/A❌PoW-only
eth_getUncleCountByBlockHashEthN/APoW-only
eth_getUncleCountByBlockNumberEthN/APoW-only
eth_getUncleByBlockHashAndIndexEthN/APoW-only
eth_getUncleByBlockNumberAndIndexEthN/APoW-only
eth_getProofEth✔
eth_subscribeWebsocket✔
eth_unsubscribeWebsocket✔
personal_importRawKeyPersonal✔❌
personal_listAccountsPersonal✔❌
personal_lockAccountPersonal✔❌
personal_newAccountPersonal✔❌
personal_unlockAccountPersonal✔❌
personal_sendTransactionPersonal✔❌
personal_signPersonal✔❌
personal_ecRecoverPersonal✔❌
personal_initializeWalletPersonal✔❌
personal_unpairPersonal✔❌
db_putStringDB
db_getStringDB
db_putHexDB
db_getHexDB
shh_postSSH
shh_versionSSH
shh_newIdentitySSH
shh_hasIdentitySSH
shh_newGroupSSH
shh_addToGroupSSH
shh_newFilterSSH
shh_uninstallFilterSSH
shh_getFilterChangesSSH
shh_getMessagesSSH
admin_addPeerAdmin❌
admin_datadirAdmin❌
admin_nodeInfoAdmin❌
admin_peersAdmin❌
admin_startRPCAdmin❌
admin_startWSAdmin❌
admin_stopRPCAdmin❌
admin_stopWSAdmin❌
clique_getSnapshotClique
clique_getSnapshotAtHashClique
clique_getSignersClique
clique_proposalsClique
clique_proposeClique
clique_discardClique
clique_statusClique
debug_backtraceAtDebug
debug_blockProfileDebug✔
debug_cpuProfileDebug✔
debug_dumpBlockDebug
debug_gcStatsDebug✔
debug_getBlockRlpDebug
debug_goTraceDebug✔
debug_freeOSMemoryDebug✔
debug_memStatsDebug✔
debug_mutexProfileDebug✔
debug_seedHashDebug
debug_setHeadDebug
debug_setBlockProfileRateDebug✔
debug_setGCPercentDebug✔
debug_setMutexProfileFractionDebug✔
debug_stacksDebug✔
debug_startCPUProfileDebug✔
debug_startGoTraceDebug✔
debug_stopCPUProfileDebug✔
debug_stopGoTraceDebug✔
debug_traceBlockDebug✔
debug_traceBlockByNumberDebug✔
debug_traceBlockByHashDebug✔
debug_traceBlockFromFileDebug
debug_standardTraceBlockToFileDebug
debug_standardTraceBadBlockToFileDebug
debug_traceTransactionDebug✔
debug_verbosityDebug
debug_vmoduleDebug
debug_writeBlockProfileDebug✔
debug_writeMemProfileDebug✔
debug_writeMutexProfileDebug✔
les_serverInfoLes
les_clientInfoLes
les_priorityClientInfoLes
les_addBalanceLes
les_setClientParamsLes
les_setDefaultParamsLes
les_latestCheckpointLes
les_getCheckpointLes
les_getCheckpointContractAddressLes
miner_getHashrateMiner✔❌No-op
miner_setExtraMiner✔❌No-op
miner_setGasPriceMiner✔❌Needs node restart
miner_startMiner✔❌No-op
miner_stopMiner✔❌No-op
miner_setGasLimitMiner✔❌No-op
miner_setEtherbaseMiner✔❌
txpool_contentTxPool✔
txpool_inspectTxPool✔
txpool_statusTxPool✔
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_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

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

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

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

eth_getCode​

Returns the code 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_sign​

The 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.

aviso

The address to sign with must be unlocked.

Parameters​

  • Account Address
  • Message to sign
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

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.

// Request
curl -X POST --data '],"id":1}' -H "Content-Type: application/json" http://localhost:8545

// Result

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
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

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)

// Request
curl -X POST --data ', "0x0"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

// Result

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

// Request
curl -X POST --data '],"id":1}' -H "Content-Type: application/json" http://localhost:8545

// Result

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.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result
}

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.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result
}

eth_getTransactionByHash​

Returns transaction details given the ethereum tx something.

Parameters​

  • hash of a transaction
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result
}

eth_getTransactionByBlockHashAndIndex​

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

Parameters​

  • Hash of a block.
  • Transaction index position.
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result
}

eth_getTransactionReceipt​

Returns the receipt of a transaction by transaction hash.

Note: Tx Code from Tendermint and the Ethereum receipt status are switched:

TendermintEthereum
Success01
Fail10

Parameters​

  • Hash of a transaction
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result
,],"logsBloom":"0x00000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000002000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0"}}

eth_newFilter​

Create new filter using topics of some kind.

Parameters​

  • hash of a transaction
// Request
curl -X POST --data '],"id":1}' -H "Content-Type: application/json" http://localhost:8545

// Result

eth_newBlockFilter​

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

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

eth_newPendingTransactionFilter​

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

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

eth_uninstallFilter​

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

Parameters​

  • The filter id
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

eth_getFilterChanges​

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

Parameters​

  • The filter id
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

eth_getFilterLogs​

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

Parameters​

  • QUANTITY - The filter id
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result
}

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.

// Request
curl -X POST --data '],"id":1}' -H "Content-Type: application/json" http://localhost:8545

// Result

eth_coinbase​

Returns the account the mining rewards will be send to.

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

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)
// Request
curl -X POST --data '' -H "Content-type:application/json" http://localhost:8545

// Result
, ]}}

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
// Request
]}

// Result
<

eth_unsubscribe​

Unsubscribe from an event using the subscription id

Parameters​

  • Subscription ID
// Request

// Result

Personal Methods​

personal_importRawKey​

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: ✓ Yes2: password string- Required: ✓ Yes```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

```### personal_listAccounts:::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
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

personal_listAccounts​

Private: Requires authentication.

Returns a list of addresses for accounts this node manages.

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_lockAccount​

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```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

```### personal_newAccount:::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
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_newAccount​

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
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_unlockAccount​

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```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

```### personal_sendTransaction:::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
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_sendTransaction​

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.

aviso

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

  • Passphrase

// Request
curl -X POST --data ', "passphrase"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_sign​

Private: Requires authentication.

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

  • Account Address
  • Password```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

```### personal_ecRecover:::tip Private: Requires authentication.

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

Parameters​

  • Message
  • Account Address
  • Password
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_ecRecover​

Private: Requires authentication.

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

Parameters​

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

personal_initializeWallet​

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 curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''

wscat -c ws://localhost:8546 -x ''

javascript personal.initializeWallet(url); ```### personal_unpair:::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​

curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''

wscat -c ws://localhost:8546 -x ''
javascript
personal.initializeWallet(url);

personal_unpair​

Private: Requires authentication.

Unpair deletes a pairing between wallet and the node.

Parameters (2)​

  • URL
  • Pairing password

Client Examples​

curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data ''

wscat -c ws://localhost:8546 -x ''
javascript
personal.unpair(url,pin);

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
// Request
curl -X POST --data ', step: function(log) , result: function() }"}],"id":1}' -H "Content-Type: application/json" http://localhost:8545

//Result
["68410", "51470"]

debug_traceBlockByNumber​

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

Parameters​

  • Trace Config
// Request
curl -X POST --data ', step: function(log) , result: function() }"}],"id":1}' -H "Content-Type: application/json" http://localhost:8545

//Result
]}

Miner Methods​

miner_getHashrate​

Private: Requires authentication.

:::Get the hashrate in H/s (Hash operations per second).:::warning Proof-of-Work specific. This endpoint always returns 0.

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

aviso

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

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

miner_setExtra​

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

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

aviso

Unsupported. This endpoint always returns an error

Parameters​

  • Data
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

miner_setGasPrice​

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```json // Request curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

```### miner_start:::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 '' -H "Content-Type: application/json" http://localhost:8545

// Result

miner_start​

Private: Requires authentication.

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

aviso

Unsupported. This endpoint always returns an error

Parameters​

  • Hex Number of threads
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

miner_stop​

Private: Requires authentication.

:::Stop the validation operation.:::warning Unsupported. This endpoint always performs a no-op.

Stop the validation operation.

aviso

Unsupported. This endpoint always performs a no-op.

// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

miner_setGasLimit​

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.:::warning Unsupported. This endpoint always returns false

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.

aviso

Unsupported. This endpoint always returns false

Parameters​

  • Hex gas limit
// Request
curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

// Result

miner_setEtherbase​

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 '' -H "Content-Type: application/json" http://localhost:8545

// Result

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 '' -H "Content-Type: application/json" http://localhost:8545

wscat -c ws://localhost:8546 -x ''
javascript
txpool.content();

Result​

json
,"queued":{}}

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​

curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

wscat -c ws://localhost:8546 -x ''
javascript
txpool.inspect();

Result​

json
,"queued":{}}

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​

curl -X POST --data '' -H "Content-Type: application/json" http://localhost:8545

wscat -c ws://localhost:8546 -x ''
txpool.status();

Result​

json
}