docs: additional content (#430)

* docs: additional content

* testnet and intro
This commit is contained in:
Federico Kunze Küllmer 2021-08-11 08:51:18 -04:00 committed by GitHub
parent 52f42b5ff4
commit 10f0164181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 150 additions and 133 deletions

View File

@ -50,7 +50,7 @@ interoperable with Ethereum. It's build using the the [Cosmos SDK](https://githu
To learn how the Ethermint works from a high-level perspective, go to the [Introduction](./docs/intro/overview.md) section from the documentation. To learn how the Ethermint works from a high-level perspective, go to the [Introduction](./docs/intro/overview.md) section from the documentation.
For more, please refer to the [Ethermint Docs](./docs/), which are also hosted on [docs.ethermint.zone](https://docs.ethermint.zone/). For more, please refer to the [Ethermint Docs](./docs/), which are also hosted on [ethermint.dev](https://ethermint.dev/).
### Community ### Community

View File

@ -85,9 +85,9 @@ module.exports = {
path: '/guides/localnet' path: '/guides/localnet'
}, },
{ {
title: 'Wallets', title: 'Keys and Wallets',
directory: true, directory: true,
path: '/guides/wallets' path: '/guides/keys-wallets'
}, },
{ {
title: 'Ethereum Tooling', title: 'Ethereum Tooling',
@ -102,7 +102,7 @@ module.exports = {
{ {
title: 'JSON-RPC', title: 'JSON-RPC',
directory: true, directory: true,
path: '/api/json-rpc' path: '/api/JSON-RPC'
}, },
{ {
title: 'Protobuf Reference', title: 'Protobuf Reference',
@ -141,7 +141,7 @@ module.exports = {
}, },
{ {
title: 'JSON-RPC API Reference', title: 'JSON-RPC API Reference',
path: '/api/json-rpc/endpoints' path: '/api/JSON-RPC/endpoints'
} }
] ]
} }

View File

@ -11,7 +11,7 @@ If you want to open a PR on the Cosmos SDK to update the documentation, please f
## Docs Build Workflow ## Docs Build Workflow
The documentation for Ethermint is hosted at https://docs.ethermint.zone/ The documentation for Ethermint is hosted at https://ethermint.dev/
built from the files in this (`/docs`) directory for built from the files in this (`/docs`) directory for
[master](https://github.com/tharsis/ethermint/tree/master/docs). [master](https://github.com/tharsis/ethermint/tree/master/docs).

View File

@ -8,5 +8,5 @@ parent:
This section contains different client and API reference document. This section contains different client and API reference document.
1. [JSON-RPC](./json_rpc) 1. [JSON-RPC](./JSON-RPC)
1. [Protobuf Docs](./proto-docs) 1. [Protobuf Docs](./proto-docs)

View File

@ -1,8 +1,8 @@
<!-- <!--
order: 1 order: 3
--> -->
# JSON-RPC Server # JSON-RPC Methods
Check the JSON-RPC methods supported on Ethermint. {synopsis} Check the JSON-RPC methods supported on Ethermint. {synopsis}
@ -11,20 +11,6 @@ Check the JSON-RPC methods supported on Ethermint. {synopsis}
- [Ethereum JSON-RPC](https://eth.wiki/json-rpc/API) {prereq} - [Ethereum JSON-RPC](https://eth.wiki/json-rpc/API) {prereq}
- [Geth JSON-RPC APIs](https://geth.ethereum.org/docs/rpc/server) {prereq} - [Geth JSON-RPC APIs](https://geth.ethereum.org/docs/rpc/server) {prereq}
## Running the server
To enable RPC server use the following flag (set to true by default).
```bash
ethermintd start --evm-rpc.enable
```
`Eth`,`Net` and `Web3` namespaces are enabled by default. In order to enable other namespaces use flag `--evm-rpc.api`.
```bash
ethermintd start --evm-rpc.api eth,txpool,personal,net,debug,web3,miner
```
## Endpoints ## Endpoints
| Method | Namespace | Implemented | Notes | | Method | Namespace | Implemented | Notes |
@ -177,7 +163,7 @@ Below is a list of the RPC methods, the parameters and an example response from
## Web3 Methods ## Web3 Methods
### web3_clientVersion ### `web3_clientVersion`
Get the web3 client version. Get the web3 client version.
@ -189,7 +175,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],
{"jsonrpc":"2.0","id":1,"result":"Ethermint/0.0.0+/linux/go1.14"} {"jsonrpc":"2.0","id":1,"result":"Ethermint/0.0.0+/linux/go1.14"}
``` ```
### web3_sha3 ### `web3_sha3`
Returns Keccak-256 (not the standardized SHA3-256) of the given data. Returns Keccak-256 (not the standardized SHA3-256) of the given data.
@ -207,7 +193,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x67656c6c
## Net Methods ## Net Methods
### net_version ### `net_version`
Returns the current network id. Returns the current network id.
@ -219,9 +205,10 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":1}
{"jsonrpc":"2.0","id":1,"result":"8"} {"jsonrpc":"2.0","id":1,"result":"8"}
``` ```
### net_peerCount ### `net_peerCount`
Returns the number of peers currently connected to the client. Returns the number of peers currently connected to the client.
```json ```json
// Request // Request
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545 curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
@ -230,7 +217,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":
{"jsonrpc":"2.0","id":1,"result":23} {"jsonrpc":"2.0","id":1,"result":23}
``` ```
### net_listening ### `net_listening`
Returns if client is actively listening for network connections. Returns if client is actively listening for network connections.
@ -244,7 +231,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":
## Eth Methods ## Eth Methods
### eth_protocolVersion ### `eth_protocolVersion`
Returns the current ethereum protocol version. Returns the current ethereum protocol version.
@ -256,7 +243,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[]
{"jsonrpc":"2.0","id":1,"result":"0x3f"} {"jsonrpc":"2.0","id":1,"result":"0x3f"}
``` ```
### eth_syncing ### `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. 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.
@ -268,7 +255,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}
{"jsonrpc":"2.0","id":1,"result":false} {"jsonrpc":"2.0","id":1,"result":false}
``` ```
### eth_gasPrice ### `eth_gasPrice`
Returns the current gas price in aphotons. Returns the current gas price in aphotons.
@ -280,7 +267,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1
{"jsonrpc":"2.0","id":1,"result":"0x0"} {"jsonrpc":"2.0","id":1,"result":"0x0"}
``` ```
### eth_accounts ### `eth_accounts`
Returns array of all eth accounts. Returns array of all eth accounts.
@ -292,7 +279,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1
{"jsonrpc":"2.0","id":1,"result":["0x3b7252d007059ffc82d16d022da3cbf9992d2f70","0xddd64b4712f7c8f1ace3c145c950339eddaf221d","0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0"]} {"jsonrpc":"2.0","id":1,"result":["0x3b7252d007059ffc82d16d022da3cbf9992d2f70","0xddd64b4712f7c8f1ace3c145c950339eddaf221d","0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0"]}
``` ```
### eth_blockNumber ### `eth_blockNumber`
Returns the current block height. Returns the current block height.
@ -304,7 +291,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id
{"jsonrpc":"2.0","id":1,"result":"0x66"} {"jsonrpc":"2.0","id":1,"result":"0x66"}
``` ```
### eth_getBalance ### `eth_getBalance`
Returns the account balance for a given account address and Block Number. Returns the account balance for a given account address and Block Number.
@ -322,7 +309,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x0f5
{"jsonrpc":"2.0","id":1,"result":"0x36354d5575577c8000"} {"jsonrpc":"2.0","id":1,"result":"0x36354d5575577c8000"}
``` ```
### eth_getStorageAt ### `eth_getStorageAt`
Returns the storage address for a given account address. Returns the storage address for a given account address.
@ -342,7 +329,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x0
{"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"} {"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"}
``` ```
### eth_getTransactionCount ### `eth_getTransactionCount`
Returns the total transaction for a given account address and Block Number. Returns the total transaction for a given account address and Block Number.
@ -360,7 +347,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params
{"jsonrpc":"2.0","id":1,"result":"0x8"} {"jsonrpc":"2.0","id":1,"result":"0x8"}
``` ```
### eth_getBlockTransactionCountByNumber ### `eth_getBlockTransactionCountByNumber`
Returns the total transaction count for a given block number. Returns the total transaction count for a given block number.
@ -376,7 +363,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNu
{"jsonrpc":"2.0","id":1,"result":{"difficulty":null,"extraData":"0x0","gasLimit":"0xffffffff","gasUsed":"0x0","hash":"0x8101cc04aea3341a6d4b3ced715e3f38de1e72867d6c0db5f5247d1a42fbb085","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","nonce":null,"number":"0x17d","parentHash":"0x70445488069d2584fea7d18c829e179322e2b2185b25430850deced481ca2e77","sha3Uncles":null,"size":"0x1df","stateRoot":"0x269bb17fe7adb8dd5f15f57b717979f82078d6b7a675c1ba1b0da2d27e415fcc","timestamp":"0x5f5ba97c","totalDifficulty":null,"transactions":[],"transactionsRoot":"0x","uncles":[]}} {"jsonrpc":"2.0","id":1,"result":{"difficulty":null,"extraData":"0x0","gasLimit":"0xffffffff","gasUsed":"0x0","hash":"0x8101cc04aea3341a6d4b3ced715e3f38de1e72867d6c0db5f5247d1a42fbb085","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","nonce":null,"number":"0x17d","parentHash":"0x70445488069d2584fea7d18c829e179322e2b2185b25430850deced481ca2e77","sha3Uncles":null,"size":"0x1df","stateRoot":"0x269bb17fe7adb8dd5f15f57b717979f82078d6b7a675c1ba1b0da2d27e415fcc","timestamp":"0x5f5ba97c","totalDifficulty":null,"transactions":[],"transactionsRoot":"0x","uncles":[]}}
``` ```
### eth_getBlockTransactionCountByHash ### `eth_getBlockTransactionCountByHash`
Returns the total transaction count for a given block hash. Returns the total transaction count for a given block hash.
@ -392,7 +379,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHa
{"jsonrpc":"2.0","id":1,"result":"0x3"} {"jsonrpc":"2.0","id":1,"result":"0x3"}
``` ```
### eth_getCode ### `eth_getCode`
Returns the code for a given account address and Block Number. Returns the code for a given account address and Block Number.
@ -410,19 +397,19 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x7bf7b1
{"jsonrpc":"2.0","id":1,"result":"0xef616c92f3cfc9e92dc270d6acff9cea213cecc7020a76ee4395af09bdceb4837a1ebdb5735e11e7d3adb6104e0c3ac55180b4ddf5e54d022cc5e8837f6a4f971b"} {"jsonrpc":"2.0","id":1,"result":"0xef616c92f3cfc9e92dc270d6acff9cea213cecc7020a76ee4395af09bdceb4837a1ebdb5735e11e7d3adb6104e0c3ac55180b4ddf5e54d022cc5e8837f6a4f971b"}
``` ```
### eth_sign ### `eth_sign`
The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))). 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 recognisable 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. By adding a prefix to the message makes the calculated signature recognisable 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 ::: warning
the address to sign with must be unlocked. the address to sign with must be unlocked.
::: :::
#### Parameters #### Parameters
- Account Address - Account Address
- Message to sign - Message to sign
@ -434,13 +421,13 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sign","params":["0x3b7252d00
{"jsonrpc":"2.0","id":1,"result":"0x909809c76ed2a5d38733de39207d0f411222b9b49c64a192bf649cb13f63f37b45acb4f6939facb4f1c277bc70fb00407564140c0f18600ac44388f2c1dfd1dc1b"} {"jsonrpc":"2.0","id":1,"result":"0x909809c76ed2a5d38733de39207d0f411222b9b49c64a192bf649cb13f63f37b45acb4f6939facb4f1c277bc70fb00407564140c0f18600ac44388f2c1dfd1dc1b"}
``` ```
### eth_sendTransaction ### `eth_sendTransaction`
Sends transaction from given account to a given account. Sends transaction from given account to a given account.
#### Parameters #### Parameters
- Object containing: - Object containing:
from: DATA, 20 Bytes - The address the transaction is send from. from: DATA, 20 Bytes - The address the transaction is send from.
@ -456,7 +443,6 @@ Sends transaction from given account to a given account.
nonce: QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce. nonce: QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
```json ```json
// Request // Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x3b7252d007059ffc82d16d022da3cbf9992d2f70", "to":"0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0", "value":"0x16345785d8a0000", "gasLimit":"0x5208", "gasPrice":"0x55ae82600"}],"id":1}' -H "Content-Type: application/json" http://localhost:8545 curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x3b7252d007059ffc82d16d022da3cbf9992d2f70", "to":"0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0", "value":"0x16345785d8a0000", "gasLimit":"0x5208", "gasPrice":"0x55ae82600"}],"id":1}' -H "Content-Type: application/json" http://localhost:8545
@ -465,7 +451,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{
{"jsonrpc":"2.0","id":1,"result":"0x33653249db68ebe5c7ae36d93c9b2abc10745c80a72f591e296f598e2d4709f6"} {"jsonrpc":"2.0","id":1,"result":"0x33653249db68ebe5c7ae36d93c9b2abc10745c80a72f591e296f598e2d4709f6"}
``` ```
### eth_sendRawTransaction ### `eth_sendRawTransaction`
Creates new message call transaction or a contract creation for signed transactions. Creates new message call transaction or a contract creation for signed transactions.
@ -473,7 +459,7 @@ You can get signed transaction data using the personal_sign method
#### Parameters #### Parameters
- The signed transaction data - The signed transaction data
```json ```json
// Request // Request
@ -483,7 +469,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params"
{"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"} {"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000000000000000000000"}
``` ```
### eth_call ### `eth_call`
Executes a new message call immediately without creating a transaction on the block chain. Executes a new message call immediately without creating a transaction on the block chain.
@ -513,13 +499,13 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0x3
{"jsonrpc":"2.0","id":1,"result":"0x"} {"jsonrpc":"2.0","id":1,"result":"0x"}
``` ```
### eth_estimateGas ### `eth_estimateGas`
Returns an estimate value of the gas required to send the transaction. Returns an estimate value of the gas required to send the transaction.
#### Parameters #### Parameters
- Object containing: - Object containing:
from: DATA, 20 Bytes - The address the transaction is send from. from: DATA, 20 Bytes - The address the transaction is send from.
@ -535,7 +521,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{"fro
{"jsonrpc":"2.0","id":1,"result":"0x1199b"} {"jsonrpc":"2.0","id":1,"result":"0x1199b"}
``` ```
### eth_getBlockByNumber ### `eth_getBlockByNumber`
Returns information about a block by block number. Returns information about a block by block number.
@ -553,11 +539,12 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":[
{"jsonrpc":"2.0","id":1,"result":{"difficulty":null,"extraData":"0x0","gasLimit":"0xffffffff","gasUsed":null,"hash":"0xabac6416f737a0eb54f47495b60246d405d138a6a64946458cf6cbeae0d48465","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","nonce":null,"number":"0x1","parentHash":"0x","sha3Uncles":null,"size":"0x9b","stateRoot":"0x","timestamp":"0x5f5bd3e5","totalDifficulty":null,"transactions":[],"transactionsRoot":"0x","uncles":[]}} {"jsonrpc":"2.0","id":1,"result":{"difficulty":null,"extraData":"0x0","gasLimit":"0xffffffff","gasUsed":null,"hash":"0xabac6416f737a0eb54f47495b60246d405d138a6a64946458cf6cbeae0d48465","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","nonce":null,"number":"0x1","parentHash":"0x","sha3Uncles":null,"size":"0x9b","stateRoot":"0x","timestamp":"0x5f5bd3e5","totalDifficulty":null,"transactions":[],"transactionsRoot":"0x","uncles":[]}}
``` ```
### eth_getBlockByHash ### `eth_getBlockByHash`
Returns the block info given the hash found in the command above and a bool. Returns the block info given the hash found in the command above and a bool.
#### Parameters #### Parameters
- Hash of a block. - Hash of a block.
- If true it returns the full transaction objects, if false only the hashes of the transactions. - If true it returns the full transaction objects, if false only the hashes of the transactions.
@ -570,7 +557,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0
{"jsonrpc":"2.0","id":1,"result":{"difficulty":null,"extraData":"0x0","gasLimit":"0xffffffff","gasUsed":null,"hash":"0x1b9911f57c13e5160d567ea6cf5b545413f96b95e43ec6e02787043351fb2cc4","logsBloom":"0x00000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000002000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","nonce":null,"number":"0xc","parentHash":"0x404e58f31a9ede1b614b98701d6b0fbf1450f186842dbcf6426dd16811a5ca0d","sha3Uncles":null,"size":"0x307","stateRoot":"0x599ccdb111fc62c6398dc39be957df8e97bf8ab72ce6c06ff10641a92b754627","timestamp":"0x5f5fdbbd","totalDifficulty":null,"transactions":["0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615"],"transactionsRoot":"0x4764dba431128836fa919b83d314ba9cc000e75f38e1c31a60484409acea777b","uncles":[]}} {"jsonrpc":"2.0","id":1,"result":{"difficulty":null,"extraData":"0x0","gasLimit":"0xffffffff","gasUsed":null,"hash":"0x1b9911f57c13e5160d567ea6cf5b545413f96b95e43ec6e02787043351fb2cc4","logsBloom":"0x00000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000002000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","nonce":null,"number":"0xc","parentHash":"0x404e58f31a9ede1b614b98701d6b0fbf1450f186842dbcf6426dd16811a5ca0d","sha3Uncles":null,"size":"0x307","stateRoot":"0x599ccdb111fc62c6398dc39be957df8e97bf8ab72ce6c06ff10641a92b754627","timestamp":"0x5f5fdbbd","totalDifficulty":null,"transactions":["0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615"],"transactionsRoot":"0x4764dba431128836fa919b83d314ba9cc000e75f38e1c31a60484409acea777b","uncles":[]}}
``` ```
### eth_getTransactionByHash ### `eth_getTransactionByHash`
Returns transaction details given the ethereum tx something. Returns transaction details given the ethereum tx something.
@ -586,9 +573,9 @@ curl localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x7a7398cc11d9c4c8e6f53e0c73824297aceafdab62db9e4b867a0da694384864","blockNumber":"0x188","from":"0x3b7252d007059ffc82d16d022da3cbf9992d2f70","gas":"0x147ee","gasPrice":"0x3b9aca00","hash":"0xec5fa15e1368d6ac314f9f64118c5794f076f63c02e66f97ea5fe1de761a8973","input":"0x6dba746c","nonce":"0x18","to":"0xa655256f589060437e5ffe2246dec385d040f148","transactionIndex":"0x0","value":"0x0","v":"0xa96","r":"0x6db399d694a452fb4106419140a6e5dbbe6817743a0f6f695a651e6576e59a5e","s":"0x25dd6ab1f936d0280d2fed0caeb0ebe5b9a46de6d8cb08ad8fd2c88deb55fc31"}} {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x7a7398cc11d9c4c8e6f53e0c73824297aceafdab62db9e4b867a0da694384864","blockNumber":"0x188","from":"0x3b7252d007059ffc82d16d022da3cbf9992d2f70","gas":"0x147ee","gasPrice":"0x3b9aca00","hash":"0xec5fa15e1368d6ac314f9f64118c5794f076f63c02e66f97ea5fe1de761a8973","input":"0x6dba746c","nonce":"0x18","to":"0xa655256f589060437e5ffe2246dec385d040f148","transactionIndex":"0x0","value":"0x0","v":"0xa96","r":"0x6db399d694a452fb4106419140a6e5dbbe6817743a0f6f695a651e6576e59a5e","s":"0x25dd6ab1f936d0280d2fed0caeb0ebe5b9a46de6d8cb08ad8fd2c88deb55fc31"}}
``` ```
### eth_getTransactionByBlockHashAndIndex ### `eth_getTransactionByBlockHashAndIndex`
Returns transaction details given the block hash and the transaction index. Returns transaction details given the block hash and the transaction index.
#### Parameters #### Parameters
@ -604,12 +591,12 @@ curl localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x1b9911f57c13e5160d567ea6cf5b545413f96b95e43ec6e02787043351fb2cc4","blockNumber":"0xc","from":"0xddd64b4712f7c8f1ace3c145c950339eddaf221d","gas":"0x4c4b40","gasPrice":"0x3b9aca00","hash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","input":"0x4f2be91f","nonce":"0x0","to":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","transactionIndex":"0x0","value":"0x0","v":"0xa96","r":"0xced57d973e58b0f634f776d57daf41d3d3387ceb347a3a72ca0746e5ec2b709e","s":"0x384e89e209a5eb147a2bac3a4e399507400ac7b29cd155531f9d6203a89db3f2"}} {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x1b9911f57c13e5160d567ea6cf5b545413f96b95e43ec6e02787043351fb2cc4","blockNumber":"0xc","from":"0xddd64b4712f7c8f1ace3c145c950339eddaf221d","gas":"0x4c4b40","gasPrice":"0x3b9aca00","hash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","input":"0x4f2be91f","nonce":"0x0","to":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","transactionIndex":"0x0","value":"0x0","v":"0xa96","r":"0xced57d973e58b0f634f776d57daf41d3d3387ceb347a3a72ca0746e5ec2b709e","s":"0x384e89e209a5eb147a2bac3a4e399507400ac7b29cd155531f9d6203a89db3f2"}}
``` ```
### eth_getTransactionReceipt ### `eth_getTransactionReceipt`
Returns the receipt of a transaction by transaction hash. Returns the receipt of a transaction by transaction hash.
Note: Tx Code from Tendermint and the Ethereum receipt status are switched: Note: Tx Code from Tendermint and the Ethereum receipt status are switched:
| | Tendermint | Ethereum | | | Tendermint | Ethereum |
| ------- | ---------- | -------- | | ------- | ---------- | -------- |
| Success | 0 | 1 | | Success | 0 | 1 |
| Fail | 1 | 0 | | Fail | 1 | 0 |
@ -626,7 +613,7 @@ curl localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc
{"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x1b9911f57c13e5160d567ea6cf5b545413f96b95e43ec6e02787043351fb2cc4","blockNumber":"0xc","contractAddress":"0x0000000000000000000000000000000000000000","cumulativeGasUsed":null,"from":"0xddd64b4712f7c8f1ace3c145c950339eddaf221d","gasUsed":"0x5289","logs":[{"address":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","topics":["0x64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee36061941"],"data":"0x0000000000000000000000000000000000000000000000000000000000000002","blockNumber":"0xc","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0","blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","logIndex":"0x0","removed":false},{"address":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","topics":["0x938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b829"],"data":"0x0000000000000000000000000000000000000000000000000000000000000002","blockNumber":"0xc","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0","blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","logIndex":"0x1","removed":false}],"logsBloom":"0x00000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000002000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0"}} {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x1b9911f57c13e5160d567ea6cf5b545413f96b95e43ec6e02787043351fb2cc4","blockNumber":"0xc","contractAddress":"0x0000000000000000000000000000000000000000","cumulativeGasUsed":null,"from":"0xddd64b4712f7c8f1ace3c145c950339eddaf221d","gasUsed":"0x5289","logs":[{"address":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","topics":["0x64a55044d1f2eddebe1b90e8e2853e8e96931cefadbfa0b2ceb34bee36061941"],"data":"0x0000000000000000000000000000000000000000000000000000000000000002","blockNumber":"0xc","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0","blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","logIndex":"0x0","removed":false},{"address":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","topics":["0x938d2ee5be9cfb0f7270ee2eff90507e94b37625d9d2b3a61c97d30a4560b829"],"data":"0x0000000000000000000000000000000000000000000000000000000000000002","blockNumber":"0xc","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0","blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","logIndex":"0x1","removed":false}],"logsBloom":"0x00000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000002000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x439c697e0742a0ddb124a376efd62a72a94ac35a","transactionHash":"0xae64961cb206a9773a6e5efeb337773a6fd0a2085ce480a174135a029afea615","transactionIndex":"0x0"}}
``` ```
### eth_newFilter ### `eth_newFilter`
Create new filter using topics of some kind. Create new filter using topics of some kind.
@ -642,11 +629,10 @@ curl localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc
{"jsonrpc":"2.0","id":1,"result":"0xdc714a4a2e3c39dc0b0b84d66a3ccb00"} {"jsonrpc":"2.0","id":1,"result":"0xdc714a4a2e3c39dc0b0b84d66a3ccb00"}
``` ```
### eth_newBlockFilter ### `eth_newBlockFilter`
Creates a filter in the node, to notify when a new block arrives. Creates a filter in the node, to notify when a new block arrives.
```json ```json
// Request // Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545 curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
@ -655,7 +641,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],
{"jsonrpc":"2.0","id":1,"result":"0x3503de5f0c766c68f78a03a3b05036a5"} {"jsonrpc":"2.0","id":1,"result":"0x3503de5f0c766c68f78a03a3b05036a5"}
``` ```
### eth_newPendingTransactionFilter ### `eth_newPendingTransactionFilter`
Creates a filter in the node, to notify when new pending transactions arrive. Creates a filter in the node, to notify when new pending transactions arrive.
@ -667,7 +653,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter"
{"jsonrpc":"2.0","id":1,"result":"0x9daacfb5893d946997d3801ea18e9902"} {"jsonrpc":"2.0","id":1,"result":"0x9daacfb5893d946997d3801ea18e9902"}
``` ```
### eth_uninstallFilter ### `eth_uninstallFilter`
Removes the filter with the given filter id. Returns true if the filter was successfully uninstalled, otherwise false. Removes the filter with the given filter id. Returns true if the filter was successfully uninstalled, otherwise false.
@ -683,7 +669,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":["
{"jsonrpc":"2.0","id":1,"result":true} {"jsonrpc":"2.0","id":1,"result":true}
``` ```
### eth_getFilterChanges ### `eth_getFilterChanges`
Polling method for a filter, which returns an array of logs which occurred since last poll. Polling method for a filter, which returns an array of logs which occurred since last poll.
@ -716,7 +702,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"filter 0x35b64c227ce30e84fc5c7bd347be380e doesn't have a LogsSubscription type: got 5"}} {"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"filter 0x35b64c227ce30e84fc5c7bd347be380e doesn't have a LogsSubscription type: got 5"}}
``` --> ``` -->
### eth_getLogs ### `eth_getLogs`
Returns an array of all logs matching a given filter object. Returns an array of all logs matching a given filter object.
@ -731,7 +717,7 @@ Returns an array of all logs matching a given filter object.
address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate. 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. 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. 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.
```json ```json
@ -744,7 +730,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics"
## TxPool Methods ## TxPool Methods
### txpool_content ### `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. 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.
@ -756,7 +742,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id"
{"jsonrpc":"2.0","id":1,"result":{"pending":{},"queued":{}} {"jsonrpc":"2.0","id":1,"result":{"pending":{},"queued":{}}
``` ```
### txpool_inspect ### `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. 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.
@ -766,9 +752,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_inspect","params":[],"id"
// Result // Result
{"jsonrpc":"2.0","id":1,"result":{"pending":{},"queued":{}} {"jsonrpc":"2.0","id":1,"result":{"pending":{},"queued":{}}
``` ```
### txpool_status ### `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. 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.
@ -778,13 +764,12 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_status","params":[],"id":
// Result // Result
{"jsonrpc":"2.0","id":1,"result":{"pending":"0x0","queued":"0x0"}} {"jsonrpc":"2.0","id":1,"result":{"pending":"0x0","queued":"0x0"}}
``` ```
### eth_coinbase ### eth_coinbase
Returns the account the mining rewards will be send to. Returns the account the mining rewards will be send to.
```json ```json
// Request // Request
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545 curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
@ -797,7 +782,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":1
Read about websockets in [events](./../quickstart/events.md) {hide} Read about websockets in [events](./../quickstart/events.md) {hide}
### eth_subscribe ### `eth_subscribe`
subscribe using JSON-RPC notifications. This allows clients to wait for events instead of polling for them. subscribe using JSON-RPC notifications. This allows clients to wait for events instead of polling for them.
@ -817,7 +802,7 @@ It works by subscribing to particular events. The node will return a subscriptio
< {"jsonrpc":"2.0","result":"0x34da6f29e3e953af4d0c7c58658fd525","id":1} < {"jsonrpc":"2.0","result":"0x34da6f29e3e953af4d0c7c58658fd525","id":1}
``` ```
### eth_unsubscribe ### `eth_unsubscribe`
Unsubscribe from an event using the subscription id Unsubscribe from an event using the subscription id
@ -835,7 +820,7 @@ Unsubscribe from an event using the subscription id
## Personal Methods ## Personal Methods
### personal_importRawKey ### `personal_importRawKey`
Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase. Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase.
@ -857,7 +842,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_importRawKey","params":
``` ```
### personal_listAccounts ### `personal_listAccounts`
Returns a list of addresses for accounts this node manages. Returns a list of addresses for accounts this node manages.
@ -869,7 +854,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_listAccounts","params":
{"jsonrpc":"2.0","id":1,"result":["0x3b7252d007059ffc82d16d022da3cbf9992d2f70","0xddd64b4712f7c8f1ace3c145c950339eddaf221d","0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0"]} {"jsonrpc":"2.0","id":1,"result":["0x3b7252d007059ffc82d16d022da3cbf9992d2f70","0xddd64b4712f7c8f1ace3c145c950339eddaf221d","0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0"]}
``` ```
### personal_lockAccount ### `personal_lockAccount`
Removes the private key with given address from memory. The account can no longer be used to send transactions. Removes the private key with given address from memory. The account can no longer be used to send transactions.
@ -885,7 +870,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_lockAccount","params":[
{"jsonrpc":"2.0","id":1,"result":true} {"jsonrpc":"2.0","id":1,"result":true}
``` ```
### personal_newAccount ### `personal_newAccount`
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. 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.
@ -901,7 +886,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":["
{"jsonrpc":"2.0","id":1,"result":"0xf0e4086ad1c6aab5d42161d5baaae2f9ad0571c0"} {"jsonrpc":"2.0","id":1,"result":"0xf0e4086ad1c6aab5d42161d5baaae2f9ad0571c0"}
``` ```
### personal_unlockAccount ### `personal_unlockAccount`
Decrypts the key with the given address from the key store. Decrypts the key with the given address from the key store.
@ -925,11 +910,11 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_unlockAccount","params"
{"jsonrpc":"2.0","id":1,"result":true} {"jsonrpc":"2.0","id":1,"result":true}
``` ```
### personal_sendTransaction ### `personal_sendTransaction`
Validate the given passphrase and submit transaction. 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 belogging to tx.from the transaction is verified, signed and send onto the network. 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 :::warning
The account is not unlocked globally in the node and cannot be used in other RPC calls. The account is not unlocked globally in the node and cannot be used in other RPC calls.
@ -937,7 +922,7 @@ The account is not unlocked globally in the node and cannot be used in other RPC
#### Parameters #### Parameters
- Object containing: - Object containing:
from: DATA, 20 Bytes - The address the transaction is send from. from: DATA, 20 Bytes - The address the transaction is send from.
@ -955,7 +940,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_sendTransaction","param
{"jsonrpc":"2.0","id":1,"result":"0xd2a31ec1b89615c8d1f4d08fe4e4182efa4a9c0d5758ace6676f485ea60e154c"} {"jsonrpc":"2.0","id":1,"result":"0xd2a31ec1b89615c8d1f4d08fe4e4182efa4a9c0d5758ace6676f485ea60e154c"}
``` ```
### personal_sign ### `personal_sign`
The sign method calculates an Ethereum specific signature with: sign(keccack256("\x19Ethereum Signed Message:\n" + len(message) + message))). The sign method calculates an Ethereum specific signature with: sign(keccack256("\x19Ethereum Signed Message:\n" + len(message) + message))).
@ -975,7 +960,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_sign","params":["0xdead
{"jsonrpc":"2.0","id":1,"result":"0xf9ff74c86aefeb5f6019d77280bbb44fb695b4d45cfe97e6eed7acd62905f4a85034d5c68ed25a2e7a8eeb9baf1b8401e4f865d92ec48c1763bf649e354d900b1c"} {"jsonrpc":"2.0","id":1,"result":"0xf9ff74c86aefeb5f6019d77280bbb44fb695b4d45cfe97e6eed7acd62905f4a85034d5c68ed25a2e7a8eeb9baf1b8401e4f865d92ec48c1763bf649e354d900b1c"}
``` ```
### personal_ecRecover ### `personal_ecRecover`
ecRecover returns the address associated with the private key that was used to calculate the signature in personal_sign. ecRecover returns the address associated with the private key that was used to calculate the signature in personal_sign.
@ -992,7 +977,3 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"personal_ecRecover","params":["0
// Result // Result
{"jsonrpc":"2.0","id":1,"result":"0x3b7252d007059ffc82d16d022da3cbf9992d2f70"} {"jsonrpc":"2.0","id":1,"result":"0x3b7252d007059ffc82d16d022da3cbf9992d2f70"}
``` ```
## Next {hide}
Learn about the Ethermint [Hard Spoon](./hard_spoon.md) functionality {hide}

View File

@ -1,5 +1,5 @@
<!-- <!--
order: 6 order: 4
--> -->
# Events # Events
@ -118,7 +118,7 @@ the node (default `"0.0.0.0:8546"`):
ethermintd start --evm-rpc.address"0.0.0.0:8545" --evm-rpc.ws-address="0.0.0.0:8546" --evm.rpc.api="eth,web3,net,txpool,debug" --evm-rpc.enable ethermintd start --evm-rpc.address"0.0.0.0:8545" --evm-rpc.ws-address="0.0.0.0:8546" --evm.rpc.api="eth,web3,net,txpool,debug" --evm-rpc.enable
``` ```
Then, start a websocket subscription with [ws](https://github.com/hashrocket/ws) Then, start a websocket subscription with [`ws`](https://github.com/hashrocket/ws)
```bash ```bash
# connect to tendermint websocet at port 8546 as defined above # connect to tendermint websocet at port 8546 as defined above
@ -128,7 +128,3 @@ ws ws://localhost:8546/
> {"id": 1, "method": "eth_subscribe", "params": ["newHeads", {}]} > {"id": 1, "method": "eth_subscribe", "params": ["newHeads", {}]}
< {"jsonrpc":"2.0","result":"0x44e010cb2c3161e9c02207ff172166ef","id":1} < {"jsonrpc":"2.0","result":"0x44e010cb2c3161e9c02207ff172166ef","id":1}
``` ```
## Next {hide}
Learn about Ethermint [accounts](./../basic/accounts.md) {hide}

View File

@ -8,5 +8,19 @@ Check the JSON-RPC namespaces supported on Ethermint. {synopsis}
## Pre-requisite Readings ## Pre-requisite Readings
- [JSON-RPC](./endpoints) {prereq}
- [Geth JSON-RPC Namespaces](https://geth.ethereum.org/docs/rpc/server) {prereq} - [Geth JSON-RPC Namespaces](https://geth.ethereum.org/docs/rpc/server) {prereq}
## Ethereum Namespaces
| Namespace | Description | Supported | Enabled by Default |
|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|--------------------|
| [`eth`](./endpoints#eth-methods) | Ethermint provides several extensions to the standard `eth` JSON-RPC namespace. | ✔ | ✔ |
| [`web3`](./endpoints#web3-methods) | The `web3` API provides utility functions for the web3 client. | ✔ | ✔ |
| [`net`](./endpoints#net-methods) | The `net` API provides access to network information of the node | ✔ | ✔ |
| `clique` | The `clique` API provides access to the state of the clique consensus engine. You can use this API to manage signer votes and to check the health of a private network. | ❌ | |
| `debug` | The `debug` API gives you access to several non-standard RPC methods, which will allow you to inspect, debug and set certain debugging flags during runtime. | ✔ | |
| `les` | The `les` API allows you to manage LES server settings, including client parameters and payment settings for prioritized clients. It also provides functions to query checkpoint information in both server and client mode. | ❌ | |
| `miner` | The `miner` API allows you to remote control the nodes mining operation and set various mining specific settings. | ✔ | ❌ |
| [`txpool`](./endpoints#txpool-methods) | The `txpool` API gives you access to several non-standard RPC methods to inspect the contents of the transaction pool containing all the currently pending transactions as well as the ones queued for future processing. | ✔ | ❌ |
| `admin` | The `admin` API gives you access to several non-standard RPC methods, which will allow you to have a fine grained control over your nodeinstance, including but not limited to network peer and RPC endpoint management. | ❌ | |
| [`personal`](./endpoints#personal-methods) | The `personal` API manages private keys in the key store. | ✔ | ❌ |

View File

@ -0,0 +1,31 @@
<!--
order: 1
-->
# Running the Server
Learn how to run and setup the JSON-RPC server on Ethermint. {synopsis}
## Enable Server
To enable RPC server use the following flag (set to true by default).
```bash
ethermintd start --evm-rpc.enable
```
## Defining Namespaces
`Eth`,`Net` and `Web3` [namespaces](./namespaces) are enabled by default. In order to enable other namespaces use flag `--evm-rpc.api`.
```bash
ethermintd start --evm-rpc.api eth,txpool,personal,net,debug,web3,miner
```
### CORS
If accessing the RPC from a browser, CORS will need to be enabled with the appropriate domain set. Otherwise, JavaScript calls are limit by the same-origin policy and requests will fail:
```bash
ethermintd start --evm-rpc.enable-unsafe-cors
```

View File

@ -33,7 +33,7 @@ This matches Ethereum denomination of:
### EVM Tokens ### EVM Tokens
Ethermint is compatible with ERC20 tokens and other non-fungible token standards (EIP721, EIP1155) Ethermint is compatible with ERC20 tokens and other non-fungible token standards (EIP721, EIP1155)
that are natively supported by the EVM. One important remark is that these tokens don't interact with the Cosmos modules and other Cosmos SDK coins. that are natively supported by the EVM.
## Next {hide} ## Next {hide}

View File

@ -8,7 +8,9 @@ parent:
This section contains different guides to use wallets and popular Ethereum tools with Ethermint. This section contains different guides to use wallets and popular Ethereum tools with Ethermint.
1. [Keyring](./wallets/keyring) 1. [Single Node Localnet](./localnet/single_node)
1. [Metamask](./wallets/metamask) 1. [Multi Node Localnet](./localnet/multi_node)
1. [Keyring](./keys-wallets/keyring)
1. [Metamask](./keys-wallets/metamask)
1. [Truffle](./tools/truffle) 1. [Truffle](./tools/truffle)
1. [Remix](./tools/remix) 1. [Remix](./tools/remix)

View File

@ -23,7 +23,7 @@ MY_VALIDATOR_ADDRESS=$(ethermintd keys show mykey -a --keyring-backend test)
This command generates a new 24-word mnemonic phrase, persists it to the relevant backend, and outputs information about the keypair. If this keypair will be used to hold value-bearing tokens, be sure to write down the mnemonic phrase somewhere safe! This command generates a new 24-word mnemonic phrase, persists it to the relevant backend, and outputs information about the keypair. If this keypair will be used to hold value-bearing tokens, be sure to write down the mnemonic phrase somewhere safe!
By default, the keyring generates a `eth_secp256k1` keypair. The keyring also supports `ed25519` keys, which may be created by passing the `--algo ed25519` flag. A keyring can of course hold both types of keys simultaneously. By default, the keyring generates a `eth_secp256k1` keypair. The keyring also supports `ed25519` and `secp256k1` keys, which may be created by passing the `--algo` flag. A keyring can of course hold both types of keys simultaneously.
## Keyring Backends ## Keyring Backends

View File

@ -14,10 +14,10 @@ Open the Metamask extension on your browser, you may have to log in to your Meta
are not already. Then click the top right circle and go to `Settings` > `Networks`. Press the `Add are not already. Then click the top right circle and go to `Settings` > `Networks`. Press the `Add
Network` button and fill the form as shown below with your application `ChainID`. Network` button and fill the form as shown below with your application `ChainID`.
Note: To find your `ChainID`, take a look at your genesis.json file. To get the Ethereum ChainId from the Cosmos ChainId, you need to consider only the digit in the string value. For example ::: tip
To find your full `ChainID`, got your genesis.json file. To get the Ethereum chain ID from the Cosmos chain ID, you need to consider only the last digit in the string value. For example
if your chain id on ethermint is `"chain_id": "ethermint-1337"`, then you will have to use the value `1337` on Metamask. if your chain id on ethermint is `"chain_id": "ethermint-1337"`, then you will have to use the value `1337` on Metamask.
:::
![metamask networks settings](./../img/metamask_network_settings.png) ![metamask networks settings](./../img/metamask_network_settings.png)

View File

@ -4,33 +4,26 @@ order: 3
# Clients # Clients
Learn how to connect a client to a running node. {synopsis} Learn about the client supported by your Ethermint node. {synopsis}
## Pre-requisite Readings ## Client Servers
- [Run a Node](./run_node.md) {prereq} The Ethermint client supports both [gRPC endpoints](https://cosmos.network/rpc) from the SDK and [Ethereum's JSON-RPC](https://eth.wiki/json-rpc/API).
- [Interacting with the Node](https://docs.cosmos.network/v0.43/run-node/interact-node.html) {prereq}
### Client Servers ### Cosmos gRPC and Tendermint RPC
The Ethermint client supports both [gRPC endpoints](https://cosmos.network/rpc) from the SDK and Ethereum's [JSON-RPC](https://eth.wiki/json-rpc/API).
#### Cosmos gRPC and Tendermint RPC
Ethermint exposes gRPC endpoints (and REST) for all the integrated Cosmos-SDK modules. This makes it easier for Ethermint exposes gRPC endpoints (and REST) for all the integrated Cosmos-SDK modules. This makes it easier for
wallets and block explorers to interact with the proof-of-stake logic and native Cosmos transactions and queries: wallets and block explorers to interact with the proof-of-stake logic and native Cosmos transactions and queries:
#### Ethereum JSON-RPC server ### Ethereum JSON-RPC server
Ethermint also supports most of the standard web3 [JSON-RPC Ethermint also supports most of the standard web3 [JSON-RPC
APIs](https://eth.wiki/json-rpc/API) to connect with existing web3 tooling. APIs](./../api/JSON-RPC/running_server) to connect with existing web3 tooling.
::: tip ::: tip
See the list of supported JSON-RPC API [namespaces](https://geth.ethereum.org/docs/rpc/server) and endpoints. See the list of supported JSON-RPC API [endpoints](./../api/JSON-RPC/endpoints) and [namespaces](./../api/JSON-RPC/namespaces).
::: :::
To connect to the JSON-PRC server, start the node with the `--evm-rpc.enable=true` flag and define the namespaces that you would like to run using the `--evm.rpc.api` flag (e.g. `"txpool,eth,web3,net,personal"`. Then, you can point any Ethereum development tooling to `http://localhost:8545` or whatever port you choose with the listen address flag (`--evm-rpc.address`). To connect to the JSON-PRC server, start the node with the `--evm-rpc.enable=true` flag and define the namespaces that you would like to run using the `--evm.rpc.api` flag (e.g. `"txpool,eth,web3,net,personal"`. Then, you can point any Ethereum development tooling to `http://localhost:8545` or whatever port you choose with the listen address flag (`--evm-rpc.address`).
## Next {hide} <!-- TODO: add Rosetta -->
Process and subscribe to [events](./events.md) via websockets {hide}

View File

@ -6,9 +6,9 @@ order: 4
Learn about Ethermint with the list of official resources. {synopsis} Learn about Ethermint with the list of official resources. {synopsis}
- Official Documentation: [https://docs.ethermint.zone/](https://docs.ethermint.zone/) - Official Documentation: [https://ethermint.dev/](https://ethermint.dev/)
- Official Codebase: [https://github.com/tharsis/ethermint](https://github.com/tharsis/ethermint) - Official Codebase: [https://github.com/tharsis/ethermint](https://github.com/tharsis/ethermint)
- Official Website: [https://ethermint.zone/](https://ethermint.zone/) - Official Website: [https://ethermint.dev/](https://ethermint.dev/)
## Workshops and Videos ## Workshops and Videos

View File

@ -84,6 +84,10 @@ as a CLI config option with:
ethermintd config keyring-backend file ethermintd config keyring-backend file
``` ```
:::tip
For more information about the Keyring and its backend options, click [here](./../guides/keys-wallets/keyring).
:::
## Clearing data from chain ## Clearing data from chain
### Reset Data ### Reset Data

View File

@ -4,7 +4,7 @@ parent:
order: 5 order: 5
--> -->
# API # Testnet
This section contains different client and API reference document. This section contains different client and API reference document.

View File

@ -1,5 +1,5 @@
<!-- <!--
order: 4 order: 2
--> -->
# Deploy Node on Cloud # Deploy Node on Cloud

View File

@ -1,5 +1,5 @@
<!-- <!--
order: 5 order: 1
--> -->
# Joining a Testnet # Joining a Testnet
@ -8,13 +8,13 @@ This document outlines the steps to join an existing testnet
## Steps ## Steps
1. Install the Ethermint binary ethermintd 1. [Install](./../quickstart/installation) the Ethermint binary `ethermintd`
```bash ```bash
go install https://github.com/tharsis/ethermint go install https://github.com/tharsis/ethermint
``` ```
2. Create an Ethermint account 2. Create an Ethermint [account](./../basics/accounts)
```bash ```bash
ethermintd keys add <keyname> --keyring-backend=test ethermintd keys add <keyname> --keyring-backend=test
@ -39,7 +39,3 @@ This document outlines the steps to join an existing testnet
ethermintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info" ethermintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info"
``` ```
## Next {hide}
Learn how to deploy a testnet node on a [cloud provider](./cloud_providers) {hide}

View File

@ -8,7 +8,7 @@ Learn how to deploy a local testnet or connect to an existing public one {synops
## Pre-requisite Readings ## Pre-requisite Readings
- [Install Ethermint](./installation.md) {prereq} - [Install Ethermint](./installation) {prereq}
### Supported OS ### Supported OS
@ -33,7 +33,7 @@ If you are looking to connect to a persistent public testnet. You will need to m
#### Copy the Genesis File #### Copy the Genesis File
::: tip ::: tip
If you want to start a network from scratch, you will need to start the [genesis procedure](#genesis-procedure) by creating a `genesis.json` and submit + collect the genesis transactions from the [validators](./validator-setup.md). If you want to start a network from scratch, you will need to start the [genesis procedure](#genesis-procedure) by creating a `genesis.json` and submit + collect the genesis transactions from the [validators](./validator-setup).
::: :::
If you want to connect to an existing testnet, fetch the testnet's `genesis.json` file and copy it into the `ethermintd`'s config directory (i.e `$HOME/.ethermintd/config/genesis.json`). If you want to connect to an existing testnet, fetch the testnet's `genesis.json` file and copy it into the `ethermintd`'s config directory (i.e `$HOME/.ethermintd/config/genesis.json`).
@ -52,8 +52,8 @@ For more information on seeds and peers, you can the Tendermint [P2P documentati
#### Start testnet #### Start testnet
The final step is to [start the nodes](./run_node.md#start-node). Once enough voting power (+2/3) from the genesis validators is up-and-running, the testnet will start producing blocks. The final step is to [start the nodes](./../quickstart/run_node#start-node). Once enough voting power (+2/3) from the genesis validators is up-and-running, the testnet will start producing blocks.
## Next {hide} ## Next {hide}
Learn about how to setup a [validator](./validator-setup.md) node on Ethermint {hide} Learn about how to setup a [validator](./validator-setup) node on Ethermint {hide}

View File

@ -174,8 +174,8 @@ type Params struct {
### JSON-RPC ### JSON-RPC
See the Ethermint [JSON-RPC docs](https://docs.ethermint.zone/basics/json_rpc.html) for reference. See the Ethermint [JSON-RPC docs](https://ethermint.dev/basics/json_rpc.html) for reference.
## Documentation and Specification ## Documentation and Specification
* Ethermint documentation: [https://docs.ethermint.zone](https://docs.ethermint.zone) * Ethermint documentation: [https://ethermint.dev](https://ethermint.dev)