To enable access to the [JSON-RPC API](../../JSON-RPC-API/JSON-RPC-API.md), open the HTTP JSON-RPC and WebSockets JSON-RPC ports to the intended users
To enable access to the [JSON-RPC API](../../Pantheon-API/JSON-RPC-API.md), open the HTTP JSON-RPC and WebSockets JSON-RPC ports to the intended users
of the JSON-RPC API on TCP.
The [`--rpc-http-port`](../../Reference/Pantheon-CLI-Syntax.md#rpc-http-port) and [`--rpc-ws-port`](../../Reference/Pantheon-CLI-Syntax.md#rpc-ws-port)
@ -34,7 +34,7 @@ using the [`--genesis-file`](../Reference/Pantheon-CLI-Syntax.md#genesis-file) o
## Confirm Node is Running
If you have started Pantheon with the [`--rpc-http-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-enabled) option, use [cURL](https://curl.haxx.se/) to
call [JSON-RPC API methods](../Reference/JSON-RPC-API-Methods.md) to confirm the node is running.
call [JSON-RPC API methods](../Reference/Pantheon-API-Methods.md) to confirm the node is running.
Access the [Pantheon API](../Reference/Pantheon-API-Methods.md) using:
* [JSON-RPC over HTTP or WebSockets](Using-JSON-RPC-API.md)
* [RPC Pub/Sub over WebSockets](RPC-PubSub.md)
* GraphQL RPC over HTTP
Information applying to JSON-RPC, RPC Pub/Sub, and GraphQL is included below.
## Host Whitelist
To prevent DNS rebinding, incoming HTTP requests, WebSockets connections, and GraphQL requests are only accepted from hostnames
specified using the [`--host-whitelist`](../Reference/Pantheon-CLI-Syntax.md#host-whitelist) option.
By default, `localhost` and `127.0.0.1` are accepted.
If your application publishes RPC ports, specify the hostnames when starting Pantheon.
!!! example
```bash
pantheon --host-whitelist=example.com
```
Specify * for `--host-whitelist` to effectively disable host protection.
!!! caution
Specifying * for `--host-whitelist` is not recommended for production code.
## Not Supported by Pantheon
### Account Management
Account management relies on private key management in the client which is not implemented by Pantheon.
Use [`eth_sendRawTransaction`](../Reference/Pantheon-API-Methods.md#eth_sendrawtransaction) to send signed transactions; `eth_sendTransaction` is not implemented.
Use third-party wallets for [account management](../Using-Pantheon/Account-Management.md).
### Protocols
Pantheon does not implement the Whisper and Swarm protocols.
description: Using RPC Pub/Sub with Pantheon Web Socket API
description: Using RPC Pub/Sub with WebSockets
<!--- END of page meta data -->
# RPC Pub/Sub
# RPC Pub/Sub over WebSockets
## Introduction
Use the RPC Pub/Sub API to wait for events instead of polling for them. For example, a Dapp can subscribe to logs to be notified when a specific event has occurred.
Use RPC Pub/Sub over WebSockets to wait for events instead of polling for them. For example, a Dapp can
subscribe to logs to be notified when a specific event has occurred.
The RPC Pub/Sub methods are:
Methods specific to RPC Pub/Sub are:
* `eth_subscribe` - create a subscription for specific events.
* `eth_unsubscribe` - cancel a subscription.
!!!important
Unlike other [JSON RPC-API methods](../Reference/JSON-RPC-API-Methods.md),
Unlike other [Pantheon API methods](../Reference/Pantheon-API-Methods.md),
the RPC Pub/Sub methods cannot be called over HTTP. Use the [`--rpc-ws-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-enabled) option to enable
the WebSockets JSON-RPC service.
### Using RPC Pub/Sub
The RPC Pub/Sub API is supported on [WebSockets](../JSON-RPC-API/Using-JSON-RPC-API.md#http-and-websocket-requests).
The RPC Pub/Sub API is supported on [WebSockets](../Pantheon-API/Using-JSON-RPC-API.md#http-and-websocket-requests).
Use `eth_subscribe` to create subscriptions. Once subscribed, notifications are published by the API using `eth_subscription`.
@ -69,8 +70,8 @@ Use the `newHeads` parameter with `eth_subscribe` to be notified each time a blo
If a chain reorganization occurs, the subscription publishes notifications for blocks in the new chain.
This means the subscription can publish notifications for multiple blocks at the same height on the blockchain.
The new headers notification returns [block objects](../Reference/JSON-RPC-API-Objects.md#block-object). The
second parameter is optional. If specified, whole [transaction objects](../Reference/JSON-RPC-API-Objects.md#transaction-object)
The new headers notification returns [block objects](../Reference/Pantheon-API-Objects.md#block-object). The
second parameter is optional. If specified, whole [transaction objects](../Reference/Pantheon-API-Objects.md#transaction-object)
are included in the notifications. Otherwise, the transaction hashes are included.
!!!example
@ -151,19 +152,19 @@ are included in the notifications. Otherwise, the transaction hashes are include
### Logs
Use the `logs` parameter with `eth_subscribe` to be notified of [logs](Events-and-Logs.md) included in new blocks. You can
Use the `logs` parameter with `eth_subscribe` to be notified of [logs](../Using-Pantheon/Events-and-Logs.md) included in new blocks. You can
specify a filter object to receive notifications only for logs matching your filter.
Logs subscriptions have an filter object parameter with the following fields:
- `address` - (optional) Either an address or an array of addresses. Returns only logs created from these addresses.
- `topics` - (optional) Returns only logs that match the [specified topics](Events-and-Logs.md#topic-filters).
- `topics` - (optional) Returns only logs that match the [specified topics](../Using-Pantheon/Events-and-Logs.md#topic-filters).
If a chain reorganization occurs, the subscription publishes notifications for logs from the old chain
with the `removed` property in the [log object](../Reference/JSON-RPC-API-Objects.md#log-object) set to `true`.
with the `removed` property in the [log object](../Reference/Pantheon-API-Objects.md#log-object) set to `true`.
This means the subscription can publish notifications for multiple logs for the same transaction.
The logs subscription returns [log objects](../Reference/JSON-RPC-API-Objects.md#log-object).
The logs subscription returns [log objects](../Reference/Pantheon-API-Objects.md#log-object).
description: How to access the Pantheon API using JSON-RPC
<!--- END of page meta data -->
# Using the JSON-RPC API
## Postman
Use the button to import our collection of examples to [Postman](https://www.getpostman.com/).
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/c765d7d22b055c42a510)
## Endpoint Host and Port
The placeholder
`<JSON-RPC-http-endpoint:port>` and `<JSON-RPC-ws-endpoint:port>` represents an endpoint (IP address and port)
of the JSON-RPC service of a Pantheon node for HTTP and WebSocket requests.
# JSON-RPC over HTTP and WebSockets
To enable JSON-RPC over HTTP or WebSockets, use the [`--rpc-http-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-enabled)
and [`--rpc-ws-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-enabled) options.
## RPC Host
Use the [--rpc-http-host](../Reference/Pantheon-CLI-Syntax.md#rpc-http-host) and [--rpc-ws-host](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-host)
options to specify the host on which the JSON-RPC listens. The default host is 127.0.0.1 for HTTP and WebSockets.
@ -27,6 +17,8 @@ Set the host to `0.0.0.0` to allow remote connections.
Setting the host to 0.0.0.0 exposes the RPC connection on your node to any remote connection. In a
production environment, ensure you use a firewall to avoid exposing your node to the internet.
## RPC Port
Use the [--rpc-http-port](../Reference/Pantheon-CLI-Syntax.md#rpc-http-port) and [--rpc-ws-port](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-port)
options to specify the port on which the JSON-RPC listens. The default ports are:
@ -35,6 +27,13 @@ options to specify the port on which the JSON-RPC listens. The default ports are
Ports must be [exposed appropriately](../Configuring-Pantheon/Networking/Managing-Peers.md#port-configuration).
## Postman
Use the button to import our collection of examples to [Postman](https://www.getpostman.com/).
[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/c765d7d22b055c42a510)
## Geth Console
The geth console is a REPL (Read, Evaluate, & Print Loop) Javascript console. Use JSON-RPC APIs supported by geth and
@ -51,31 +50,13 @@ To use the geth console with Pantheon:
geth attach http://localhost:8545
```
Use the geth console to call [JSON-RPC API methods](../Reference/JSON-RPC-API-Methods.md) that geth and Pantheon share.
Use the geth console to call [JSON-RPC API methods](../Reference/Pantheon-API-Methods.md) that geth and Pantheon share.
!!! example
```bash
eth.syncing
```
## Host Whitelist
To prevent DNS rebinding, incoming HTTP requests and WebSockets connections are only accepted from hostnames
specified using the [`--host-whitelist`](../Reference/Pantheon-CLI-Syntax.md#host-whitelist) option.
By default, `localhost` and `127.0.0.1` are accepted.
If your application publishes RPC ports, specify the hostnames when starting Pantheon.
!!! example
```bash
pantheon --host-whitelist=example.com
```
Specify * for `--host-whitelist` to effectively disable host protection.
!!! caution
Specifying * for `--host-whitelist` is not recommended for production code.
## JSON-RPC Authentication
[Authentication](Authentication.md) is disabled by default.
@ -122,25 +103,12 @@ options to enable the `ADMIN`, `CLIQUE`, `DEBUG`, `EEA`, `IBFT`, `MINER`, `PERM`
When you make requests that might have different results depending on the block accessed,
the block parameter specifies the block.
Several methods, such as [eth_getTransactionByBlockNumberAndIndex](../Reference/JSON-RPC-API-Methods.md#eth_gettransactionbyblocknumberandindex), have a block parameter.
Several methods, such as [eth_getTransactionByBlockNumberAndIndex](../Reference/Pantheon-API-Methods.md#eth_gettransactionbyblocknumberandindex), have a block parameter.
The block parameter can have the following values:
* `blockNumber` : `quantity` - Block number. Can be specified in hexadecimal or decimal. 0 represents the genesis block.
* `earliest` : `tag` - Earliest (genesis) block.
* `latest` : `tag` - Last block mined.
* `pending` : `tag` - Last block mined plus pending transactions. Use only with [eth_getTransactionCount](../Reference/JSON-RPC-API-Methods.md#eth_gettransactioncount).
## Not Supported by Pantheon
### Account Management
Account management relies on private key management in the client which is not implemented by Pantheon.
Use [`eth_sendRawTransaction`](../Reference/JSON-RPC-API-Methods.md#eth_sendrawtransaction) to send signed transactions; `eth_sendTransaction` is not implemented.
Use third-party wallets for [account management](../Using-Pantheon/Account-Management.md).
### Protocols
* `pending` : `tag` - Last block mined plus pending transactions. Use only with [eth_getTransactionCount](../Reference/Pantheon-API-Methods.md#eth_gettransactioncount).
Pantheon does not implement the Whisper and Swarm protocols.
If you add a running node, the node does not attempt to reconnect to the bootnode and synchronize until
peer discovery restarts. To add a whitelisted node as a peer without waiting for peer discovery to restart, use [`admin_addPeer`](../Reference/JSON-RPC-API-Methods.md#admin_addpeer).
peer discovery restarts. To add a whitelisted node as a peer without waiting for peer discovery to restart, use [`admin_addPeer`](../Reference/Pantheon-API-Methods.md#admin_addpeer).
If the node is added to the whitelist before starting the node, using `admin_addPeer` is not required because
description: Pantheon JSON-RPC API methods reference
<!--- END of page meta data -->
# JSON-RPC API Methods
# Pantheon API Methods
!!! attention
All JSON-RPC HTTP examples use the default host and port endpoint `http://127.0.0.1:8545`.
@ -12,7 +12,7 @@ description: Pantheon JSON-RPC API methods reference
## Admin Methods
!!! note
The `ADMIN` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `ADMIN` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `ADMIN` API methods.
### admin_addPeer
@ -645,7 +645,7 @@ None
Returns a list of account addresses that the client owns.
!!!note
This method returns an empty object because Pantheon [does not support account management](../JSON-RPC-API/Using-JSON-RPC-API.md#account-management).
This method returns an empty object because Pantheon [does not support account management](../Pantheon-API/Using-JSON-RPC-API.md#account-management).
**Parameters**
@ -710,7 +710,7 @@ Returns the account balance of the specified address.
`DATA` - 20-byte account address from which to retrieve the balance.
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -743,7 +743,7 @@ Returns the value of a storage position at a specified address.
`QUANTITY` - Integer index of the storage position.
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -776,7 +776,7 @@ Returns the number of transactions sent from a specified address. Use the `pendi
`data` - 20-byte account address.
`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -834,7 +834,7 @@ Returns the number of transactions in a block matching the specified block numbe
**Parameters**
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -892,7 +892,7 @@ Returns the number of uncles in a block matching the specified block number.
**Parameters**
`QUANTITY|TAG` - Integer representing either the 0-based index of the block within the blockchain, or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing either the 0-based index of the block within the blockchain, or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -923,7 +923,7 @@ Returns the code of the smart contract at the specified address. Compiled smart
`DATA` - 20-byte contract address.
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -955,7 +955,7 @@ You can interact with contracts using [eth_sendRawTransaction or eth_call](../Us
To avoid exposing your private key, create signed transactions offline and send the signed transaction data using `eth_sendRawTransaction`.
!!!important
Pantheon does not implement [eth_sendTransaction](../JSON-RPC-API/Using-JSON-RPC-API.md#account-management).
Pantheon does not implement [eth_sendTransaction](../Pantheon-API/Using-JSON-RPC-API.md#account-management).
**Parameters**
@ -995,9 +995,9 @@ You can interact with contracts using [eth_sendRawTransaction or eth_call](../Us
*QUANTITY|TAG* - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
*QUANTITY|TAG* - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -1035,7 +1035,7 @@ The transaction call object parameters are the same as those for [eth_call](#eth
all fields are optional. Setting a gas limit is irrelevant to the estimation process (unlike transactions, in which gas
@ -1100,11 +1100,11 @@ Returns information about the block by hash.
`DATA` - 32-byte hash of a block.
`Boolean` - If `true`, returns the full [transaction objects](JSON-RPC-API-Objects.md#transaction-object); if `false`, returns the transaction hashes.
`Boolean` - If `true`, returns the full [transaction objects](Pantheon-API-Objects.md#transaction-object); if `false`, returns the transaction hashes.
**Returns**
`result` : *OBJECT* - [Block object](JSON-RPC-API-Objects.md#block-object) , or `null` when no block is found.
`result` : *OBJECT* - [Block object](Pantheon-API-Objects.md#block-object) , or `null` when no block is found.
!!! example
```bash tab="curl HTTP request"
@ -1149,13 +1149,13 @@ Returns information about a block by block number.
**Parameters**
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
`Boolean` - If `true`, returns the full [transaction objects](JSON-RPC-API-Objects.md#transaction-object); if `false`, returns only the hashes of the transactions.
`Boolean` - If `true`, returns the full [transaction objects](Pantheon-API-Objects.md#transaction-object); if `false`, returns only the hashes of the transactions.
**Returns**
`result` : *OBJECT* - [Block object](JSON-RPC-API-Objects.md#block-object) , or `null` when no block is found.
`result` : *OBJECT* - [Block object](Pantheon-API-Objects.md#block-object) , or `null` when no block is found.
!!! example
```bash tab="curl HTTP request"
@ -1204,7 +1204,7 @@ Returns transaction information for the specified transaction hash.
**Returns**
Object - [Transaction object](JSON-RPC-API-Objects.md#transaction-object), or `null` when no transaction is found.
Object - [Transaction object](Pantheon-API-Objects.md#transaction-object), or `null` when no transaction is found.
!!! example
```bash tab="curl HTTP request"
@ -1250,7 +1250,7 @@ Returns transaction information for the specified block hash and transaction ind
**Returns**
Object - [Transaction object](JSON-RPC-API-Objects.md#transaction-object), or `null` when no transaction is found.
Object - [Transaction object](Pantheon-API-Objects.md#transaction-object), or `null` when no transaction is found.
!!! example
```bash tab="curl HTTP request"
@ -1290,13 +1290,13 @@ Returns transaction information for the specified block number and transaction i
**Parameters**
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY|TAG` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
`QUANTITY` - The transaction index position.
**Returns**
Object - [Transaction object](JSON-RPC-API-Objects.md#transaction-object), or `null` when no transaction is found.
Object - [Transaction object](Pantheon-API-Objects.md#transaction-object), or `null` when no transaction is found.
!!!note
Your node must be synchronized to at least the block containing the transaction for the request to return it.
@ -1345,7 +1345,7 @@ Returns the receipt of a transaction by transaction hash. Receipts for pending t
**Returns**
`Object` - [Transaction receipt object](JSON-RPC-API-Objects.md#transaction-receipt-object), or `null` when no receipt is found.
`Object` - [Transaction receipt object](Pantheon-API-Objects.md#transaction-receipt-object), or `null` when no receipt is found.
!!! example
```bash tab="curl HTTP request"
@ -1383,7 +1383,7 @@ Creates a [log filter](../Using-Pantheon/Events-and-Logs.md). To poll for logs a
`fromBlock` and `toBlock` in the filter options object default to `latest`. To obtain logs using `eth_getFilterLogs`, set `fromBlock` and `toBlock` appropriately.
@ -1514,7 +1514,7 @@ Polls the specified filter and returns an array of changes that have occurred si
* For filters created with `eth_newBlockFilter`, returns block hashes.
* For filters created with `eth_newPendingTransactionFilter`, returns transaction hashes.
* For filters created with `eth_newFilter`, returns [log objects](JSON-RPC-API-Objects.md#log-object).
* For filters created with `eth_newFilter`, returns [log objects](Pantheon-API-Objects.md#log-object).
!!! example
```bash tab="curl HTTP request"
@ -1602,7 +1602,7 @@ Returns an array of [logs](../Using-Pantheon/Events-and-Logs.md) for the specifi
The following request returns all logs for the contract at address `0x2e1f232a9439c3d459fceca0beef13acc8259dd8`.
@ -1734,7 +1734,7 @@ None
## Clique Methods
!!! note
The `CLIQUE` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `CLIQUE` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `CLIQUE` API methods.
### clique_discard
@ -1772,7 +1772,7 @@ Lists [signers for the specified block](../Consensus-Protocols/Clique.md#adding-
**Parameters**
`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -1892,7 +1892,7 @@ If the boolean value is `true`, the proposal is to add a signer. If `false`, the
## Debug Methods
!!! note
The `DEBUG` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `DEBUG` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `DEBUG` API methods.
### debug_storageRangeAt
@ -1915,7 +1915,7 @@ Returns the contract storage for the specified range.
@ -2123,7 +2123,7 @@ Reruns the transaction with the same state as when the transaction was executed.
## Miner Methods
!!! note
The `MINER` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `MINER` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `MINER` API methods.
### miner_start
@ -2187,7 +2187,7 @@ None
## IBFT 2.0 Methods
!!! note
The `IBFT` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `IBFT` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `IBFT` API methods.
### ibft_discardValidatorVote
@ -2292,7 +2292,7 @@ Lists the validators defined in the specified block.
**Parameters**
`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter).
`quantity|tag` - Integer representing a block number or one of the string tags `latest`, `earliest`, or `pending`, as described in [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter).
**Returns**
@ -2353,7 +2353,7 @@ Proposes [adding or removing a validator](../Consensus-Protocols/IBFT.md#adding-
## Permissioning Methods
!!! note
The `PERM` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `PERM` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `PERM` API methods.
### perm_addAccountsToWhitelist
@ -2583,7 +2583,7 @@ None
## Txpool Methods
!!! note
The `TXPOOL` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `TXPOOL` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `TXPOOL` API methods.
### txpool_pantheonStatistics
@ -2667,7 +2667,7 @@ None
## EEA Methods
!!! note
The `EEA` API methods are not enabled by default. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
The `EEA` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api)
or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `EEA` API methods.
### eea_sendRawTransaction
@ -2726,7 +2726,7 @@ are not available.
**Returns**
`Object` - [Private Transaction receipt object](JSON-RPC-API-Objects.md#private-transaction-receipt-object), or `null` if no receipt found.
`Object` - [Private Transaction receipt object](Pantheon-API-Objects.md#private-transaction-receipt-object), or `null` if no receipt found.
!!! example
```bash tab="curl HTTP request"
@ -2755,7 +2755,7 @@ are not available.
### rpc_modules
Lists [enabled JSON-RPC APIs](../JSON-RPC-API/Using-JSON-RPC-API.md#api-methods-enabled-by-default) and the version of each.
Lists [enabled APIs](../Pantheon-API/Using-JSON-RPC-API.md#api-methods-enabled-by-default) and the version of each.
@ -34,16 +34,16 @@ Returned by [eth_getBlockByHash](JSON-RPC-API-Methods.md#eth_getblockbyhash) and
## Filter Options Object
Parameter for [eth_newFilter](JSON-RPC-API-Methods.md#eth_newfilter) and [eth_getLogs](JSON-RPC-API-Methods.md#eth_getlogs). Used to [filter logs](../Using-Pantheon/Accessing-Logs-Using-JSON-RPC.md).
Parameter for [eth_newFilter](Pantheon-API-Methods.md#eth_newfilter) and [eth_getLogs](Pantheon-API-Methods.md#eth_getlogs). Used to [filter logs](../Using-Pantheon/Accessing-Logs-Using-JSON-RPC.md).
| **fromBlock** | Quantity | Tag | Optional | Integer block number or `latest`, `pending`, `earliest`. See [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter). Default is `latest`. |
| **toBlock** | Quantity | Tag | Optional | Integer block number or `latest`, `pending`, `earliest`. See [Block Parameter](../JSON-RPC-API/Using-JSON-RPC-API.md#block-parameter). Default is `latest`. |
| **fromBlock** | Quantity | Tag | Optional | Integer block number or `latest`, `pending`, `earliest`. See [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter). Default is `latest`. |
| **toBlock** | Quantity | Tag | Optional | Integer block number or `latest`, `pending`, `earliest`. See [Block Parameter](../Pantheon-API/Using-JSON-RPC-API.md#block-parameter). Default is `latest`. |
| **address** | Data | Array | Optional | Contract address or array of addresses from which [logs](../Using-Pantheon/Events-and-Logs.md) originate. |
| **topics** | Array of Data, 32 bytes each | Optional | Array of topics by which to [filter logs](../Using-Pantheon/Events-and-Logs.md#topic-filters). |
[eth_getLogs](JSON-RPC-API-Methods.md#eth_getlogs) has an additional key.
[eth_getLogs](Pantheon-API-Methods.md#eth_getlogs) has an additional key.
@ -51,7 +51,7 @@ Parameter for [eth_newFilter](JSON-RPC-API-Methods.md#eth_newfilter) and [eth_ge
## Log Object
Returned by [eth_getFilterChanges](JSON-RPC-API-Methods.md#eth_getfilterchanges) and [transaction receipt objects](#transaction-receipt-object) can contain an array of log objects.
Returned by [eth_getFilterChanges](Pantheon-API-Methods.md#eth_getfilterchanges) and [transaction receipt objects](#transaction-receipt-object) can contain an array of log objects.
@ -104,7 +104,7 @@ Returned by [debug_traceTransaction](JSON-RPC-API-Methods.md#debug_tracetransact
## Transaction Object
Returned by [eth_getTransactionByHash](JSON-RPC-API-Methods.md#eth_gettransactionbyhash), [eth_getTransactionByBlockHashAndIndex](JSON-RPC-API-Methods.md#eth_gettransactionbyblockhashandindex), and [eth_getTransactionsByBlockNumberAndIndex](JSON-RPC-API-Methods.md#eth_gettransactionbyblocknumberandindex).
Returned by [eth_getTransactionByHash](Pantheon-API-Methods.md#eth_gettransactionbyhash), [eth_getTransactionByBlockHashAndIndex](Pantheon-API-Methods.md#eth_gettransactionbyblockhashandindex), and [eth_getTransactionsByBlockNumberAndIndex](Pantheon-API-Methods.md#eth_gettransactionbyblocknumberandindex).
Comma-separated list of hostnames to allow [access to the JSON-RPC API](../JSON-RPC-API/Using-JSON-RPC-API.md#host-whitelist).
Comma-separated list of hostnames to allow [access to the JSON-RPC API](../Pantheon-API/Using-JSON-RPC-API.md#host-whitelist).
By default, access from `localhost` and `127.0.0.1` is accepted.
!!!tip
@ -355,7 +355,7 @@ Job name when in `push` mode. The default is `pantheon-client`.
Account to which mining rewards are paid.
You must specify a valid coinbase when you enable mining using the [`--miner-enabled`](#miner-enabled)
option or the [`miner_start`](JSON-RPC-API-Methods.md#miner_start) JSON RPC-API method.
option or the [`miner_start`](Pantheon-API-Methods.md#miner_start) JSON RPC-API method.
!!!note
This option is ignored in networks using [Clique](../Consensus-Protocols/Clique.md) and [IBFT 2.0](../Consensus-Protocols/IBFT.md) consensus protocols.
@ -760,7 +760,7 @@ The default is: `ETH`, `NET`, `WEB3`.
@ -41,7 +41,7 @@ On non-mining nodes, log messages indicate blocks are being imported.
2019-05-08 20:28:31.031+10:00 | EthScheduler-Workers-0 | INFO | BlockPropagationManager | Imported #662 / 0 tx / 0 om / 0 (0.0%) gas / (0x0ead4e20123d3f1433d8dec894fcce386da4049819b24b309963ce7a8a0fcf03) in 0.000s.
```
Use the [`eth_blockNumber`](../Reference/JSON-RPC-API-Methods.md#eth_blocknumber) JSON-RPC API method to confirm the
Use the [`eth_blockNumber`](../Reference/Pantheon-API-Methods.md#eth_blocknumber) JSON-RPC API method to confirm the
block number is increasing.
If blocks are not being created in [Clique](../Consensus-Protocols/Clique.md#extra-data) or [IBFT 2.0](../Consensus-Protocols/IBFT.md#extra-data) networks,
Start another terminal, use curl to call the JSON-RPC API [`net_peerCount`](../Reference/JSON-RPC-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
Start another terminal, use curl to call the JSON-RPC API [`net_peerCount`](../Reference/Pantheon-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' localhost:8545
@ -222,7 +222,7 @@ The enode URL is required to update the permissions configuration file in the fo
### 8. Add Enode URLs for Nodes to Permissions Configuration File
In another terminal, use the [`perm_addNodesToWhitelist`](../Reference/JSON-RPC-API-Methods.md#perm_addnodestowhitelist)
In another terminal, use the [`perm_addNodesToWhitelist`](../Reference/Pantheon-API-Methods.md#perm_addnodestowhitelist)
JSON-RPC API method to add the nodes to the permissions configuration file for each node.
Replace `<EnodeNode1>`, `<EnodeNode2>`, and `<EnodeNode3>` with the enode URL displayed when starting each node.
@ -247,7 +247,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToWhitelist","param
### 9. Add Nodes as Peers
Use the [`admin_addPeer`](../Reference/JSON-RPC-API-Methods.md#admin_addpeer) JSON-RPC API method to add
Use the [`admin_addPeer`](../Reference/Pantheon-API-Methods.md#admin_addpeer) JSON-RPC API method to add
Node-1 as a peer for Node-2 and Node-3.
Replace `<EnodeNode1>` with the enode URL displayed when starting Node-1.
@ -276,7 +276,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":["<Enode
#### Check Peer Count
Use cURL to call the JSON-RPC API [`net_peerCount`](../Reference/JSON-RPC-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
Use cURL to call the JSON-RPC API [`net_peerCount`](../Reference/Pantheon-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' localhost:8545
Start another terminal, use curl to call the JSON-RPC API [`net_peerCount`](../Reference/JSON-RPC-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
Start another terminal, use curl to call the JSON-RPC API [`net_peerCount`](../Reference/Pantheon-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' localhost:8545
Start another terminal, use curl to call the JSON-RPC API [`net_peerCount`](../Reference/JSON-RPC-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
Start another terminal, use curl to call the JSON-RPC API [`net_peerCount`](../Reference/Pantheon-API-Methods.md#net_peercount) method and confirm the nodes are functioning as peers:
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' localhost:8545
@ -169,9 +169,9 @@ Import accounts to MetaMask and send transactions as described in the [Private N
Send transactions using `eth_sendRawTransaction` to [send ether or, deploy or invoke contracts](../Using-Pantheon/Transactions/Transactions.md).
Use the [JSON-RPC API](../JSON-RPC-API/Using-JSON-RPC-API.md).
Use the [JSON-RPC API](../Pantheon-API/Using-JSON-RPC-API.md).
Start a node with the [`--rpc-ws-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-enabled) option and use the [RPC Pub/Sub API](../Using-Pantheon/RPC-PubSub.md).
Start a node with the [`--rpc-ws-enabled`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-enabled) option and use the [RPC Pub/Sub API](../Pantheon-API/RPC-PubSub.md).
Use [`eth_newFilter`](../Reference/JSON-RPC-API-Methods.md#eth_newfilter) to create the filter before
using [`eth_getFilterChanges`](../Reference/JSON-RPC-API-Methods.md#eth_getfilterchanges) and [`eth_getFilterLogs`](../Reference/JSON-RPC-API-Methods.md#eth_getfilterlogs)).
Use [`eth_newFilter`](../Reference/Pantheon-API-Methods.md#eth_newfilter) to create the filter before
using [`eth_getFilterChanges`](../Reference/Pantheon-API-Methods.md#eth_getfilterchanges) and [`eth_getFilterLogs`](../Reference/Pantheon-API-Methods.md#eth_getfilterlogs)).
!!! note
The following examples are created using the sample contract included in [Events and Logs](Events-and-Logs.md).
## Creating a Filter
Create a filter using [`eth_newFilter`](../Reference/JSON-RPC-API-Methods.md#eth_newfilter).
Create a filter using [`eth_newFilter`](../Reference/Pantheon-API-Methods.md#eth_newfilter).
!!! example
@ -40,17 +40,17 @@ Create a filter using [`eth_newFilter`](../Reference/JSON-RPC-API-Methods.md#eth
}
```
[`eth_newFilter`](../Reference/JSON-RPC-API-Methods.md#eth_newfilter) returns a filter ID hash (for example, `0x1ddf0c00989044e9b41cc0ae40272df3`).
[`eth_newFilter`](../Reference/Pantheon-API-Methods.md#eth_newfilter) returns a filter ID hash (for example, `0x1ddf0c00989044e9b41cc0ae40272df3`).
### Polling Filter for Changes
To poll the filter for changes that have occurred since the last poll, use [`eth_getFilterChanges`](../Reference/JSON-RPC-API-Methods.md#eth_getfilterchanges)
with the filter ID hash returned by [`eth_newFilter`](../Reference/JSON-RPC-API-Methods.md#eth_newfilter).
To poll the filter for changes that have occurred since the last poll, use [`eth_getFilterChanges`](../Reference/Pantheon-API-Methods.md#eth_getfilterchanges)
with the filter ID hash returned by [`eth_newFilter`](../Reference/Pantheon-API-Methods.md#eth_newfilter).
!!! example
If the contract had been executed twice since the last poll, with `valueIndexed` set to 1 and 5,
@ -7,5 +7,5 @@ Pantheon does not implement private key management. Use third-party tools (for e
In Pantheon, you can use the JSON-RPC methods:
* [eth_getBalance](../Reference/JSON-RPC-API-Methods.md#eth_getbalance) to obtain the account balance
* [eth_sendRawTransaction](../Reference/JSON-RPC-API-Methods.md#eth_sendrawtransaction) to transfer ether or create and interact with contracts (for more information, refer to [Transactions](Transactions/Transactions.md#transactions)).
* [eth_getBalance](../Reference/Pantheon-API-Methods.md#eth_getbalance) to obtain the account balance
* [eth_sendRawTransaction](../Reference/Pantheon-API-Methods.md#eth_sendrawtransaction) to transfer ether or create and interact with contracts (for more information, refer to [Transactions](Transactions/Transactions.md#transactions)).
Options and methods for configuring and monitoring the transaction pool include:
* [`txpool_pantheonTransactions`](../../Reference/JSON-RPC-API-Methods.md#txpool_pantheontransactions) JSON-RPC API method to list
* [`txpool_pantheonTransactions`](../../Reference/Pantheon-API-Methods.md#txpool_pantheontransactions) JSON-RPC API method to list
transactions in the node transaction pool
* [`--tx-pool-max-size`](../../Reference/Pantheon-CLI-Syntax.md#tx-pool-max-size) command line option to specify the maximum number
of transactions in the node transaction pool
* [`newPendingTransactions`](../RPC-PubSub.md#pending-transactions) and [`droppedPendingTransactions`](../RPC-PubSub.md#dropped-transactions)
* [`newPendingTransactions`](../../Pantheon-API/RPC-PubSub.md#pending-transactions) and [`droppedPendingTransactions`](../../Pantheon-API/RPC-PubSub.md#dropped-transactions)
RPC subscriptions to notify of transactions added to and dropped from the node transaction pool
Once full, the Pantheon transaction pool accepts and retains local transactions in preference to remote transactions.
@ -3,9 +3,9 @@ description: Some use cases of creating transactions on a Pantheon network
# Creating and Sending Transactions
You can send signed transactions using the [`eth_sendRawTransaction`](../../Reference/JSON-RPC-API-Methods.md#eth_sendrawtransaction) JSON-RPC API method.
You can send signed transactions using the [`eth_sendRawTransaction`](../../Reference/Pantheon-API-Methods.md#eth_sendrawtransaction) JSON-RPC API method.
These examples describe how to create a signed raw transaction that can be passed to [`eth_sendRawTransaction`](../../Reference/JSON-RPC-API-Methods.md#eth_sendrawtransaction).
These examples describe how to create a signed raw transaction that can be passed to [`eth_sendRawTransaction`](../../Reference/Pantheon-API-Methods.md#eth_sendrawtransaction).
!!!tip
To avoid exposing your private keys, create signed transactions offline.
@ -146,7 +146,7 @@ All accounts and private keys in the examples are from the `dev.json` genesis fi
## eth_call or eth_sendRawTransaction
You can interact with contracts using [eth_call](../../Reference/JSON-RPC-API-Methods.md#eth_call) or [eth_sendRawTransaction](../../Reference/JSON-RPC-API-Methods.md#eth_sendrawtransaction). The table below compares the characteristics of both calls.
You can interact with contracts using [eth_call](../../Reference/Pantheon-API-Methods.md#eth_call) or [eth_sendRawTransaction](../../Reference/Pantheon-API-Methods.md#eth_sendrawtransaction). The table below compares the characteristics of both calls.