From fd4bada8574a95db3a5d4dabb1ec88a41973d552 Mon Sep 17 00:00:00 2001 From: Vijay Date: Tue, 19 Dec 2023 17:20:04 +1000 Subject: [PATCH] OCTODSO-588: Update tabs in docs of version of 23.7.3 Signed-off-by: Vijay --- .../configure/block-proposal-permissioning.md | 147 +- .../add-validators-without-voting.md | 39 +- .../how-to/configure/consensus/ibft.md | 36 +- .../how-to/configure/consensus/index.md | 23 +- .../how-to/configure/consensus/qbft.md | 63 +- .../how-to/configure/free-gas.md | 15 +- .../how-to/configure/tls/p2p.md | 131 +- .../how-to/monitor/opentelemetry.md | 27 +- .../how-to/use-privacy/web3js-quorum.md | 15 +- .../private-networks/reference/api/index.md | 703 ++-- .../private-networks/reference/cli/options.md | 383 ++- .../reference/cli/subcommands.md | 43 +- .../private-networks/tutorials/clique.md | 51 +- .../private-networks/tutorials/ethash.md | 39 +- .../private-networks/tutorials/ibft/index.md | 51 +- .../tutorials/ibft/validators.md | 36 +- .../tutorials/kubernetes/charts.md | 15 +- .../tutorials/permissioning/index.md | 113 +- .../tutorials/privacy/index.md | 71 +- .../private-networks/tutorials/qbft.md | 52 +- .../private-networks/tutorials/quickstart.md | 15 +- .../get-started/connect/mainnet.md | 15 +- .../get-started/connect/testnet.md | 30 +- .../get-started/system-requirements.md | 51 +- .../how-to/configure-jvm/manage-memory.md | 15 +- .../public-networks/how-to/monitor/metrics.md | 39 +- .../how-to/troubleshoot/evm-tool.md | 15 +- .../how-to/use-besu-api/authenticate.md | 76 +- .../how-to/use-besu-api/graphql.md | 63 +- .../how-to/use-besu-api/json-rpc.md | 98 +- .../how-to/use-besu-api/rpc-pubsub.md | 39 +- .../public-networks/how-to/use-engine-api.md | 51 +- .../public-networks/reference/api/index.md | 2949 ++++++----------- .../public-networks/reference/cli/options.md | 2227 +++++++++---- .../reference/cli/subcommands.md | 107 +- .../reference/engine-api/index.md | 115 +- .../public-networks/reference/evm-tool.md | 299 +- .../tutorials/besu-teku-mainnet.md | 15 +- .../tutorials/besu-teku-testnet.md | 51 +- 39 files changed, 4785 insertions(+), 3538 deletions(-) diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/block-proposal-permissioning.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/block-proposal-permissioning.md index c164fadeddd..848025d634b 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/block-proposal-permissioning.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/block-proposal-permissioning.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Block proposal permissioning :::info @@ -56,235 +59,289 @@ In the command line: ### `Xpki-block-creation-crl-file` - + -# Syntax + ```bash --Xpki-block-creation-crl-file= ``` -# Example + + + ```bash --Xpki-block-creation-crl-file=/home/cert/cert.crl.pem ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_CRL_FILE=/home/cert/cert.crl.pem ``` - + + + Path to the optional certificate revocation list (CRL) file. ### `Xpki-block-creation-enabled` - + -# Syntax + ```bash --Xpki-block-creation-enabled[=] ``` -# Example + + + ```bash --Xpki-block-creation-enabled=true ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_ENABLED=true ``` - + + + Enable PKI integration. The default is `false`. ### `Xpki-block-creation-keystore-certificate-alias` - + -# Syntax + ```bash --Xpki-block-creation-keystore-certificate-alias= ``` -# Example + + + ```bash --Xpki-block-creation-keystore-certificate-alias=validatorA ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_KEYSTORE_CERTIFICATE_ALIAS=validatorA ``` - + + + Alias of the certificate to be included in the blocks proposed by this validator. The default is `validator`. ### `Xpki-block-creation-keystore-file` - + -# Syntax + ```bash --Xpki-block-creation-keystore-file= ``` -# Example + + + ```bash --Xpki-block-creation-keystore-file=/home/cert/keystore.jks ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_KEYSTORE_FILE=/home/cert/keystore.jks ``` - + + + Keystore file containing the key and certificate for PKI block creation. ### `Xpki-block-creation-keystore-password-file` - + -# Syntax + ```bash --Xpki-block-creation-keystore-password-file= ``` -# Example + + + ```bash --Xpki-block-creation-keystore-password-file=/home/cert/password.txt ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_KEYSTORE_PASSWORD-FILE=/home/cert/password.txt ``` - + + + Text file containing the password to unlock the keystore file. ### `Xpki-block-creation-keystore-type` - + -# Syntax + ```bash --Xpki-block-creation-keystore-type= ``` -# Example + + + ```bash --Xpki-block-creation-keystore-type=JKS ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_KEYSTORE_TYPE=JKS ``` - + + + PKI keystore type. Valid options are `JKS` and `PKCS12`. The default is `JKS`. ### `Xpki-block-creation-truststore-file` - + -# Syntax + ```bash --Xpki-block-creation-truststore-file= ``` -# Example + + + ```bash --Xpki-block-creation-truststore-file=/home/cert/truststore.jks ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_TRUSTSTORE_FILE=/home/cert/truststore.jks ``` - + + + Truststore containing the trusted certificates for PKI block creation. ### `Xpki-block-creation-truststore-password-file` - + -# Syntax + ```bash --Xpki-block-creation-truststore-password-file= ``` -# Example + + + ```bash --Xpki-block-creation-truststore-password-file=/home/cert/password.txt ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_TRUSTSTORE_PASSWORD_FILE=/home/cert/password.txt ``` - + + + Text file containing the password to unlock the truststore file. ### `Xpki-block-creation-truststore-type` - + -# Syntax + ```bash --Xpki-block-creation-truststore-type= ``` -# Example + + + ```bash --Xpki-block-creation-truststore-type=JKS ``` -# Environment variable + + + ```bash BESU_XPKI_BLOCK_CREATION_TRUSTSTORE_TYPE=JKS ``` - + + + PKI truststore type. Valid options are `JKS` and `PKCS12`. The default is `JKS`. diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/add-validators-without-voting.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/add-validators-without-voting.md index 70d875e33a0..6bd592fdc1c 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/add-validators-without-voting.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/add-validators-without-voting.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Add and remove validators without voting [QBFT](qbft.md) or [IBFT 2.0](ibft.md) network conditions might not allow voting to change validators. For example, if a majority of the current validators are no longer participating in the network, a vote to add or remove validators won't be successful. You can bypass voting and specify new validators using a transition in the genesis file. @@ -24,9 +27,9 @@ To add or remove validators without voting: - `` is the upcoming block at which to change validators. - ` ... ` are strings representing the account addresses of the validators after ``. - + - # QBFT syntax + ```bash { @@ -54,7 +57,9 @@ To add or remove validators without voting: } ``` - # QBFT example + + + ```bash { @@ -136,7 +141,9 @@ To add or remove validators without voting: } ``` - + + + 2. Restart all nodes in the network using the updated genesis file. You can make a rolling update of the nodes, as long as they're all up before the transition block is processed. 3. To verify the changes after the transition block, call [`qbft_getValidatorsByBlockNumber`](../../../reference/api/index.md#qbft_getvalidatorsbyblocknumber) or [`ibft_getValidatorsByBlockNumber`](../../../reference/api/index.md#ibft_getvalidatorsbyblocknumber), specifying `latest`. @@ -163,9 +170,9 @@ To bypass the smart contract and specify new validators: - `` is the validator selection mode to switch to. In this case we'll switch to the `blockheader` mode temporarily. - ` ... ` are strings representing the account addresses of the validators after ``. These validators only need to be sufficient to progress the chain and allow a new contract to be deployed. - + - # Syntax + ```bash { @@ -195,7 +202,9 @@ To bypass the smart contract and specify new validators: } ``` - # Example + + + ```bash { @@ -224,7 +233,9 @@ To bypass the smart contract and specify new validators: } ``` - + + + 1. Restart all nodes in the network using the updated genesis file. You can make a rolling update of the nodes, as long as they're all up before the transition block is processed. 1. Deploy a new contract to the blockchain containing the desired list of validators. @@ -234,9 +245,9 @@ To bypass the smart contract and specify new validators: - `` is the validator selection mode to switch to. In this case we'll switch to `contract` mode. - `` is the address of the new smart contract. - + - # Syntax + ```bash { @@ -270,7 +281,9 @@ To bypass the smart contract and specify new validators: } ``` - # Example + + + ```bash { @@ -304,6 +317,8 @@ To bypass the smart contract and specify new validators: } ``` - + + + 1. Restart all nodes in the network using the updated genesis file. You can make a rolling update of the nodes, as long as they're all up before the transition block is processed. diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/ibft.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/ibft.md index de26b5a2a2b..a0005193352 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/ibft.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/ibft.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Configure IBFT 2.0 consensus Besu implements the IBFT 2.0 proof of authority (PoA) [consensus protocol](index.md). IBFT 2.0 is supported for existing private networks, but [QBFT](qbft.md) is the recommended enterprise-grade consensus protocol for private networks. @@ -265,9 +268,9 @@ To update an existing network with a new `blockperiodseconds`: - `` is the upcoming block at which to change `blockperiodseconds`. - `` is the updated value for `blockperiodseconds`. - + - # Syntax + ```bash { @@ -291,7 +294,9 @@ To update an existing network with a new `blockperiodseconds`: } ``` - # Example + + + ```bash { @@ -315,8 +320,9 @@ To update an existing network with a new `blockperiodseconds`: } ``` - + + 1. Restart all nodes in the network using the updated genesis file. 1. To verify the changes after the transition block, call [`ibft_getValidatorsByBlockNumber`](../../../../public-networks/reference/api/index.md#ibft_getvalidatorsbyblocknumber), specifying `latest`. @@ -330,9 +336,9 @@ To update an existing network with a new `blockreward`: - `` is the upcoming block at which to change `blockreward`. - `` is the updated value for `blockreward`. - + - # Syntax + ```bash { @@ -365,7 +371,9 @@ To update an existing network with a new `blockreward`: } ``` - # Example + + + ```bash { @@ -398,8 +406,9 @@ To update an existing network with a new `blockreward`: } ``` - + + :::note You can add multiple `blockreward` updates in one transition object by specifying multiple future blocks. @@ -418,9 +427,9 @@ To update an existing network with a new mining beneficiary: - `` is the upcoming block at which to change `miningbeneficiary`. - `` is the updated 20-byte address for `miningbeneficiary`. Starting at ``, block rewards go to this address. - + - # Syntax + ```bash { @@ -451,7 +460,9 @@ To update an existing network with a new mining beneficiary: } ``` - # Example + + + ```bash { @@ -482,8 +493,9 @@ To update an existing network with a new mining beneficiary: } ``` - + + :::note Setting the `miningbeneficiary` to an empty value clears out any override so that block rewards go to the block producer rather than a global override address. diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/index.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/index.md index 8ea4813a032..b8d10139d63 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/index.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/index.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Consensus protocols Besu supports the following consensus protocols: @@ -20,9 +23,9 @@ See a [comparison of the proof of authority consensus protocols](../../../concep The `config` property in the genesis file specifies the consensus protocol for a chain. - + -# Ethash + ```json { @@ -36,7 +39,9 @@ The `config` property in the genesis file specifies the consensus protocol for a } ``` -# Clique + + + ```json { @@ -50,7 +55,9 @@ The `config` property in the genesis file specifies the consensus protocol for a } ``` -# IBFT 2.0 + + + ```json { @@ -64,7 +71,9 @@ The `config` property in the genesis file specifies the consensus protocol for a } ``` -# QBFT + + + ```json { @@ -78,4 +87,6 @@ The `config` property in the genesis file specifies the consensus protocol for a } ``` - + + + diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/qbft.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/qbft.md index 727f2662887..2b6722a0946 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/qbft.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/consensus/qbft.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Configure QBFT consensus Hyperledger Besu implements the QBFT proof of authority (PoA) [consensus protocol](index.md). QBFT is the recommended enterprise-grade consensus protocol for private networks. @@ -40,9 +43,9 @@ You can use a [transitions](#transitions) to change the `blockperiodseconds` or ::: - + -# Block header validator selection + ```json { @@ -82,7 +85,9 @@ You can use a [transitions](#transitions) to change the `blockperiodseconds` or } ``` -# Contract validator selection + + + ```json { @@ -139,7 +144,9 @@ You can use a [transitions](#transitions) to change the `blockperiodseconds` or } ``` - + + + The QBFT properties are: @@ -399,9 +406,9 @@ To update an existing network with a new `blockperiodseconds`: - `` is the upcoming block at which to change `blockperiodseconds`. - `` is the updated value for `blockperiodseconds`. - + - # Syntax + ```bash { @@ -425,7 +432,9 @@ To update an existing network with a new `blockperiodseconds`: } ``` - # Example + + + ```bash { @@ -449,7 +458,9 @@ To update an existing network with a new `blockperiodseconds`: } ``` - + + + 3. Restart all nodes in the network using the updated genesis file. 4. To verify the changes after the transition block, call [`qbft_getValidatorsByBlockNumber`](../../../reference/api/index.md#ibft_getvalidatorsbyblocknumber), specifying `latest`. @@ -464,9 +475,9 @@ To update an existing network with a new `blockreward`: - `` is the upcoming block at which to change `blockreward`. - `` is the updated value for `blockreward`. - + - # Syntax + ```bash { @@ -499,7 +510,9 @@ To update an existing network with a new `blockreward`: } ``` - # Example + + + ```bash { @@ -532,7 +545,9 @@ To update an existing network with a new `blockreward`: } ``` - + + + :::note @@ -553,9 +568,9 @@ To swap between block header validator selection and contract validator selectio - `` is the validator selection mode to switch to. Valid options are `contract` and `blockheader`. - `` is the smart contract address, if switching to the contract validator selection method. - + - # Syntax + ```bash { @@ -580,7 +595,9 @@ To swap between block header validator selection and contract validator selectio } ``` - # Example + + + ```bash { @@ -605,7 +622,9 @@ To swap between block header validator selection and contract validator selectio } ``` - + + + 3. Restart all nodes in the network using the updated genesis file. @@ -619,9 +638,9 @@ To update an existing network with a new mining beneficiary: - `` is the upcoming block at which to change `miningbeneficiary`. - `` is the updated 20-byte address for `miningbeneficiary`. Starting at ``, block rewards go to this address. - + - # Syntax + ```bash { @@ -649,7 +668,9 @@ To update an existing network with a new mining beneficiary: } ``` - # Example + + + ```bash { @@ -677,7 +698,9 @@ To update an existing network with a new mining beneficiary: } ``` - + + + :::note diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/free-gas.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/free-gas.md index 9eccfd2666d..79a0bc5bf03 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/free-gas.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/free-gas.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Configure free gas networks Transactions use computational resources so have an associated cost. Gas is the cost unit and the gas price is the price per gas unit. The transaction cost is the gas used \* gas price. @@ -68,21 +71,25 @@ In the `config` section of the genesis file, set the contract size limit to the When starting nodes, set the [minimum gas price](../../../public-networks/reference/cli/options.md#min-gas-price) to zero. - + -# Command Line + ```bash --min-gas-price=0 ``` -# Configuration File + + + ```bash min-gas-price=0 ``` - + + + # Command Line diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/configure/tls/p2p.md b/versioned_docs/version-23.7.3/private-networks/how-to/configure/tls/p2p.md index 3121d25c520..1f7a89e26bb 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/configure/tls/p2p.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/configure/tls/p2p.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Configure P2P TLS You can configure TLS to secure the P2P communication between nodes by ensuring only authorized nodes can communicate with each other. Use certificates issued by a trusted authority to connect authorized nodes in the network. @@ -52,209 +55,257 @@ In the command line: ### `Xp2p-tls-crl-file` - + -# Syntax + ```bash --Xp2p-tls-crl-file= ``` -# Example + + + ```bash --Xp2p-tls-crl-file=/home/cert/cert.crl.pem ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_CRL_FILE=/home/cert/cert.crl.pem ``` - + + + Path to the optional certificate revocation list (CRL) file. ### `Xp2p-tls-enabled` - + -# Syntax + ```bash --Xp2p-tls-enabled[=] ``` -# Example + + + ```bash --Xp2p-tls-enabled=true ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_ENABLED=true ``` - + + + Enable TLS for P2P communication. The default is `false`. ### `Xp2p-tls-keystore-file` - + -# Syntax + ```bash --Xp2p-tls-keystore-file= ``` -# Example + + + ```bash --Xp2p-tls-keystore-file=/home/cert/keystore.jks ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_KEYSTORE_FILE=/home/cert/keystore.jks ``` - + + + Keystore file containing the key and certificate to allow TLS for P2P communication. ### `Xp2p-tls-keystore-password-file` - + -# Syntax + ```bash --Xp2p-tls-keystore-password-file= ``` -# Example + + + ```bash --Xp2p-tls-keystore-password-file=/home/cert/password.txt ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_KEYSTORE_PASSWORD_FILE=/home/cert/password.txt ``` - + + + Text file containing the password to unlock the keystore file. ### `Xp2p-tls-keystore-type` - + -# Syntax + ```bash --Xp2p-tls-keystore-type= ``` -# Example + + + ```bash --Xp2p-tls-keystore-type=JKS ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_KEYSTORE_TYPE=JKS ``` - + + + Keystore type that allows TLS for P2P communication. Valid options are `JKS`, `PKCS11`, and `PKCS12`. The default is `JKS`. ### `Xp2p-tls-truststore-file` - + -# Syntax + ```bash --Xp2p-tls-truststore-file= ``` -# Example + + + ```bash --Xp2p-tls-truststore-file=/home/cert/truststore.jks ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_TRUSTSTORE_FILE=/home/cert/truststore.jks ``` - + + + Truststore containing the trusted certificates that allows TLS for P2P communication. ### `Xp2p-tls-truststore-password-file` - + -# Syntax + ```bash --Xp2p-tls-truststore-password-file= ``` -# Example + + + ```bash --Xp2p-tls-truststore-password-file=/home/cert/password.txt ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_TRUSTSTORE_PASSWORD_FILE=/home/cert/password.txt ``` - + + + Text file containing the password to unlock the truststore file. ### `Xp2p-tls-truststore-type` - + -# Syntax + ```bash --Xp2p-tls-truststore-type= ``` -# Example + + + ```bash --Xp2p-tls-truststore-type=JKS ``` -# Environment variable + + + ```bash BESU_XP2P_TLS_TRUSTSTORE_TYPE=JKS ``` - + + + Truststore type. Valid options are `JKS`, `PKCS11`, and `PKCS12`. The default is `JKS`. diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/monitor/opentelemetry.md b/versioned_docs/version-23.7.3/private-networks/how-to/monitor/opentelemetry.md index 185b61da3d5..9fe1298e9ac 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/monitor/opentelemetry.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/monitor/opentelemetry.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use OpenTelemetry You can use the OpenTelemetry monitoring and tracing service to gather node metrics and traces. To enable OpenTelemetry to access Hyperledger Besu, use the [`--metrics-enabled`](../../../public-networks/reference/cli/options.md#metrics-enabled) and [`--metrics-protocol=opentelemetry`](../../../public-networks/reference/cli/options.md#metrics-protocol) options. Use [Splunk](https://splunk.com) to visualize the collected data. A [Besu Sync example](https://github.com/splunk/splunk-connect-for-ethereum/tree/master/examples/besu-sync) is available. @@ -112,9 +115,9 @@ You can also install exporters that send system metrics to OpenTelemetry to moni It is easiest to run the OpenTelemetry collector with Docker with the following command: - + - # Syntax + ```bash docker run -d \ @@ -125,7 +128,9 @@ You can also install exporters that send system metrics to OpenTelemetry to moni otel/opentelemetry-collector-contrib:latest ``` - # Example + + + ```bash docker run -d \ @@ -136,27 +141,33 @@ You can also install exporters that send system metrics to OpenTelemetry to moni otel/opentelemetry-collector-contrib:latest ``` - + + + You can also refer to this [Docker-compose example](https://github.com/splunk/splunk-connect-for-ethereum/blob/989dc2ccae7d8235bf3ce2a83a18cf0cd1713294/examples/besu-sync/full-sync/docker-compose.yaml). 2. Start Besu with the [`--metrics-enabled`](../../../public-networks/reference/cli/options.md#metrics-enabled) and [`--metrics-protocol=opentelemetry`](../../../public-networks/reference/cli/options.md#metrics-protocol) options. For example, run the following command to start a single node: - + - # Syntax + ```bash OTEL_EXPORTER_OTLP_ENDPOINT=https://: besu --network=dev --miner-enabled --miner-coinbase --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled --metrics-protocol=opentelemetry ``` - # Example + + + ```bash OTEL_EXPORTER_OTLP_ENDPOINT=https://localhost:4317 besu --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled --metrics-protocol=opentelemetry ``` - + + + The [OpenTelemetry SDK](https://github.com/open-telemetry/opentelemetry-specification/blob/8f7cdb73618a0b3afa9532b8f8103d719e352781/specification/sdk-environment-variables.md) mandates how to configure the OpenTelemetry gRPC client, so data flows to the collector from Besu. diff --git a/versioned_docs/version-23.7.3/private-networks/how-to/use-privacy/web3js-quorum.md b/versioned_docs/version-23.7.3/private-networks/how-to/use-privacy/web3js-quorum.md index 5538b3f9bc9..3efa9ec8f24 100644 --- a/versioned_docs/version-23.7.3/private-networks/how-to/use-privacy/web3js-quorum.md +++ b/versioned_docs/version-23.7.3/private-networks/how-to/use-privacy/web3js-quorum.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use the web3js-quorum client library [web3js-quorum](https://github.com/ConsenSys/web3js-quorum) is an Ethereum JavaScript library extending [web3.js](https://github.com/ethereum/web3.js/) that adds support for Besu-specific JSON-RPC APIs and features. Use the library to create and send RLP-encoded transactions using JSON-RPC. @@ -41,9 +44,9 @@ Initialize your client where: - `` is the JSON-RPC HTTP endpoint of your Hyperledger Besu node. Specified by the [`--rpc-http-host`](../../../public-networks/reference/cli/options.md#rpc-http-host) and [`--rpc-http-port`](../../../public-networks/reference/cli/options.md#rpc-http-port) command line options. - + -# Syntax + ```js const { Web3 } = require("web3"); @@ -51,7 +54,9 @@ const Web3Quorum = require("web3js-quorum"); const web3 = new Web3Quorum(new Web3("")); ``` -# Example + + + ```js const { Web3 } = require("web3"); @@ -59,7 +64,9 @@ const Web3Quorum = require("web3js-quorum"); const web3 = new Web3Quorum(new Web3("http://localhost:8545")); ``` - + + + :::note diff --git a/versioned_docs/version-23.7.3/private-networks/reference/api/index.md b/versioned_docs/version-23.7.3/private-networks/reference/api/index.md index 7ff104b9338..fa43c2ab2e4 100644 --- a/versioned_docs/version-23.7.3/private-networks/reference/api/index.md +++ b/versioned_docs/version-23.7.3/private-networks/reference/api/index.md @@ -4,6 +4,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Private network API methods :::warning @@ -35,21 +38,25 @@ Discards a proposal to [add or remove a signer with the specified address]. `result`: _boolean_ - indicates if the proposal is discarded - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"clique_discard","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"clique_discard","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73"], "id":1} ``` -# JSON result + + + ```json { @@ -59,7 +66,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"clique_discard","params":["0xFE3 } ``` - + + + ### `clique_getSigners` @@ -73,21 +82,25 @@ Lists [signers for the specified block]. `result`: _array_ of _string_ - list of 20-byte addresses of signers - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSigners","params":["latest"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"clique_getSigners","params":["latest"], "id":1} ``` -# JSON result + + + ```json { @@ -96,8 +109,8 @@ Lists [signers for the specified block]. "result" : [ "0x42eb768f2244c8811c63729a21a3569731535f06", "0x7ffc57839b00206d1ad20c69a1981b489f772031", "0xb279182d99e65703f0076e4812653aab85fca0f0" ] } ``` - - + + ### `clique_getSignerMetrics` @@ -131,21 +144,25 @@ The proposer of the genesis block has address `0x0000000000000000000000000000000 ::: - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSignerMetrics","params":["1", "100"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"clique_getSignerMetrics","params":["1", "100"], "id":1} ``` -# JSON result + + + ```json { @@ -170,8 +187,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSignerMetrics","params ] } ``` - - + + ### `clique_getSignersAtHash` @@ -185,21 +202,25 @@ Lists signers for the specified block. `result`: _array_ of _string_ - list of 20-byte addresses of signers - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSignersAtHash","params":["0x98b2ddb5106b03649d2d337d42154702796438b3c74fd25a5782940e84237a48"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"clique_getSignersAtHash","params":["0x98b2ddb5106b03649d2d337d42154702796438b3c74fd25a5782940e84237a48"], "id":1} ``` -# JSON result + + + ```json { @@ -213,7 +234,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSignersAtHash","params } ``` - + + + ### `clique_proposals` @@ -227,21 +250,25 @@ None `result`: _map_ of _strings_ to _booleans_ - map of account addresses to corresponding boolean values indicating the proposal for each account (if `true`, the proposal is to add a signer; if `false`, the proposal is to remove a signer.) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"clique_proposals","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"clique_proposals","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -254,7 +281,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"clique_proposals","params":[], " } ``` - + + + ### `clique_propose` @@ -270,21 +299,25 @@ Proposes to [add or remove a signer with the specified address]. `result`: _boolean_ - `true` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"clique_propose","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73", true], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"clique_propose","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73", true], "id":1} ``` -# JSON result + + + ```json { @@ -294,7 +327,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"clique_propose","params":["0xFE3 } ``` - + + + ## `EEA` methods @@ -342,21 +377,25 @@ If creating a contract, use [priv_getTransactionReceipt](#priv_gettransactionrec ::: - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eea_sendRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"eea_sendRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1} ``` -# JSON result + + + ```json { @@ -366,7 +405,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eea_sendRawTransaction","params" } ``` - + + + ## `IBFT` 2.0 methods @@ -390,21 +431,25 @@ Discards a proposal to [add or remove a validator] with the specified address. `result`: _boolean_ - indicates if the proposal is discarded - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_discardValidatorVote","params":["0xef1bfb6a12794615c9b0b5a21e6741f01e570185"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"ibft_discardValidatorVote","params":["0xef1bfb6a12794615c9b0b5a21e6741f01e570185"], "id":1} ``` -# JSON result + + + ```json { @@ -414,7 +459,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_discardValidatorVote","para } ``` - + + + ### `ibft_getPendingVotes` @@ -428,21 +475,25 @@ None `result`: _map_ of _strings_ to _booleans_ - map of account addresses to corresponding boolean values indicating the vote for each account; if `true`, the vote is to add a validator. If `false`, the proposal is to remove a validator. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getPendingVotes","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"ibft_getPendingVotes","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -455,7 +506,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getPendingVotes","params":[ } ``` - + + + ### `ibft_getSignerMetrics` @@ -489,21 +542,25 @@ The proposer of the genesis block has address `0x0000000000000000000000000000000 ::: - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getSignerMetrics","params":["1", "100"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"ibft_getSignerMetrics","params":["1", "100"], "id":1} ``` -# JSON result + + + ```json { @@ -529,7 +586,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getSignerMetrics","params": } ``` - + + + ### `ibft_getValidatorsByBlockHash` @@ -543,21 +602,25 @@ Lists the validators defined in the specified block. `result`: _array_ of _strings_ - list of validator addresses - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockHash","params":["0xbae7d3feafd743343b9a4c578cab5e5d65eb735f6855fb845c00cab356331256"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockHash","params":["0xbae7d3feafd743343b9a4c578cab5e5d65eb735f6855fb845c00cab356331256"], "id":1} ``` -# JSON result + + + ```json { @@ -571,7 +634,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockHash"," } ``` - + + + ### `ibft_getValidatorsByBlockNumber` @@ -585,21 +650,25 @@ Lists the validators defined in the specified block. `result`: _array_ of _strings_ - list of validator addresses - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockNumber","params":["latest"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockNumber","params":["latest"], "id":1} ``` -# JSON result + + + ```json { @@ -613,7 +682,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockNumber" } ``` - + + + ### `ibft_proposeValidatorVote` @@ -629,21 +700,25 @@ Proposes to [add or remove a validator] with the specified address. `result`: _boolean_ - `true` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_proposeValidatorVote","params":["42d4287eac8078828cf5f3486cfe601a275a49a5",true], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"ibft_proposeValidatorVote","params":["42d4287eac8078828cf5f3486cfe601a275a49a5",true], "id":1} ``` -# JSON result + + + ```json { @@ -653,7 +728,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_proposeValidatorVote","para } ``` - + + + ## `PERM` (Permissioning) methods @@ -683,21 +760,25 @@ The parameters list contains a list which is why the account addresses are enclo `result`: _string_ - `Success` or `error` (errors include attempting to add accounts already on the allowlist and including invalid account addresses.) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addAccountsToAllowlist","params":[["0xb9b81ee349c3807e46bc71aa2632203c5b462032", "0xb9b81ee349c3807e46bc71aa2632203c5b462034"]], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_addAccountsToAllowlist","params":[["0xb9b81ee349c3807e46bc71aa2632203c5b462032", "0xb9b81ee349c3807e46bc71aa2632203c5b462034"]], "id":1} ``` -# JSON result + + + ```json { @@ -707,7 +788,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addAccountsToAllowlist","pa } ``` - + + + ### `perm_addNodesToAllowlist` @@ -735,21 +818,25 @@ The parameters list contains a list which is why the enode URLs are enclosed by `result`: _string_ - `Success` or `error`; errors include attempting to add nodes already on the allowlist or including invalid enode URLs. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","params":[["enode://7e4ef30e9ec683f26ad76ffca5b5148fa7a6575f4cfad4eb0f52f9c3d8335f4a9b6f9e66fcc73ef95ed7a2a52784d4f372e7750ac8ae0b544309a5b391a23dd7@127.0.0.1:30303","enode://2feb33b3c6c4a8f77d84a5ce44954e83e5f163e7a65f7f7a7fec499ceb0ddd76a46ef635408c513d64c076470eac86b7f2c8ae4fcd112cb28ce82c0d64ec2c94@127.0.0.1:30304"]], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","params":[["enode://7e4ef30e9ec683f26ad76ffca5b5148fa7a6575f4cfad4eb0f52f9c3d8335f4a9b6f9e66fcc73ef95ed7a2a52784d4f372e7750ac8ae0b544309a5b391a23dd7@127.0.0.1:30303","enode://2feb33b3c6c4a8f77d84a5ce44954e83e5f163e7a65f7f7a7fec499ceb0ddd76a46ef635408c513d64c076470eac86b7f2c8ae4fcd112cb28ce82c0d64ec2c94@127.0.0.1:30304"]], "id":1} ``` -# JSON result + + + ```json { @@ -759,7 +846,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","param } ``` - + + + ### `perm_getAccountsAllowlist` @@ -773,21 +862,25 @@ None `result`: _array_ of _strings_ - list of accounts (participants) in the accounts allowlist - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_getAccountsAllowlist","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_getAccountsAllowlist","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -800,7 +893,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_getAccountsAllowlist","para } ``` - + + + ### `perm_getNodesAllowlist` @@ -814,21 +909,25 @@ None `result`: _array_ of _strings_ - [enode URLs](../../../public-networks/concepts/node-keys.md#enode-url) of nodes in the nodes allowlist - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_getNodesAllowlist","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_getNodesAllowlist","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -841,7 +940,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_getNodesAllowlist","params" } ``` - + + + ### `perm_reloadPermissionsFromFile` @@ -855,21 +956,25 @@ None `result`: _string_ - `Success`, or `error` if the permissions configuration file is not valid - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_reloadPermissionsFromFile","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_reloadPermissionsFromFile","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -879,7 +984,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_reloadPermissionsFromFile", } ``` - + + + ### `perm_removeAccountsFromAllowlist` @@ -899,21 +1006,25 @@ The parameters list contains a list which is why the account addresses are enclo `result`: _string_ - `Success` or `error` (errors include attempting to remove accounts not on the allowlist and including invalid account addresses.) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_removeAccountsFromAllowlist","params":[["0xb9b81ee349c3807e46bc71aa2632203c5b462032", "0xb9b81ee349c3807e46bc71aa2632203c5b462034"]], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_removeAccountsFromAllowlist","params":[["0xb9b81ee349c3807e46bc71aa2632203c5b462032", "0xb9b81ee349c3807e46bc71aa2632203c5b462034"]], "id":1} ``` -# JSON result + + + ```json { @@ -923,7 +1034,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_removeAccountsFromAllowlist } ``` - + + + ### `perm_removeNodesFromAllowlist` @@ -943,21 +1056,25 @@ The parameters list contains a list which is why the enode URLs are enclosed by `result`: _string_ - `Success` or `error` (errors include attempting to remove nodes not on the allowlist and including invalid enode URLs.) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_removeNodesFromAllowlist","params":[["enode://7e4ef30e9ec683f26ad76ffca5b5148fa7a6575f4cfad4eb0f52f9c3d8335f4a9b6f9e66fcc73ef95ed7a2a52784d4f372e7750ac8ae0b544309a5b391a23dd7@127.0.0.1:30303","enode://2feb33b3c6c4a8f77d84a5ce44954e83e5f163e7a65f7f7a7fec499ceb0ddd76a46ef635408c513d64c076470eac86b7f2c8ae4fcd112cb28ce82c0d64ec2c94@127.0.0.1:30304"]], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"perm_removeNodesFromAllowlist","params":[["enode://7e4ef30e9ec683f26ad76ffca5b5148fa7a6575f4cfad4eb0f52f9c3d8335f4a9b6f9e66fcc73ef95ed7a2a52784d4f372e7750ac8ae0b544309a5b391a23dd7@127.0.0.1:30303","enode://2feb33b3c6c4a8f77d84a5ce44954e83e5f163e7a65f7f7a7fec499ceb0ddd76a46ef635408c513d64c076470eac86b7f2c8ae4fcd112cb28ce82c0d64ec2c94@127.0.0.1:30304"]], "id":1} ``` -# JSON result + + + ```json { @@ -967,7 +1084,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"perm_removeNodesFromAllowlist"," } ``` - + + + ## `PRIV` methods @@ -997,21 +1116,25 @@ For private contracts, `priv_call` is the same as [`eth_call`](../../../public-n `result`: _data_ - return value of the executed contract - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_call","params":["tb8NVyQqZnHNegf/3mYsyB+HEud4SPWn90rz3GoskRw=", {"to":"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13","data": "0x3fa4f245"}, "latest"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"priv_call","params":["tb8NVyQqZnHNegf/3mYsyB+HEud4SPWn90rz3GoskRw=", {"to":"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13","data": "0x3fa4f245"}, "latest"],"id":1} ``` -# JSON result + + + ```json { @@ -1021,13 +1144,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_call","params":["tb8NVyQqZn } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {number call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13\", data :\"0x12a7b914\"}){data status}}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```bash { @@ -1041,7 +1168,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {num } ``` -# GraphQL result + + + ```json { @@ -1057,7 +1186,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {num } ``` - + + + ### `priv_createPrivacyGroup` @@ -1077,21 +1208,25 @@ Creates a group of nodes, specified by their [Tessera](https://docs.tessera.cons `result`: _string_ - privacy group ID - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method": "priv_createPrivacyGroup", "params": [{"addresses":["sTZpbQhcOfd9ZaFDnC00e/N2Ofv9p4/ZTBbEeVtXJ3E=","quhb1pQPGN1w8ZSZSyiIfncEAlVY/M/rauSyQ5wVMRE="],"name":"Group A","description":"Description Group A"}],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method": "priv_createPrivacyGroup", "params": [{"addresses":["sTZpbQhcOfd9ZaFDnC00e/N2Ofv9p4/ZTBbEeVtXJ3E=","quhb1pQPGN1w8ZSZSyiIfncEAlVY/M/rauSyQ5wVMRE="],"name":"Group A","description":"Description Group A"}],"id":1} ``` -# JSON result + + + ```json { @@ -1101,7 +1236,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "priv_createPrivacyGroup", "para } ``` - + + + ### `priv_debugGetStateRoot` @@ -1117,21 +1254,25 @@ Returns the state root of the specified privacy group at the specified block. `result`: _string_ - 32-byte state root - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_debugGetStateRoot","params":["xJdxvWOEmrs2MCkKWlgArTzWIXFfU/tmVxI3EKssVTk=","latest"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"priv_debugGetStateRoot","params":["xJdxvWOEmrs2MCkKWlgArTzWIXFfU/tmVxI3EKssVTk=","latest"],"id":1} ``` -# JSON result + + + ```json { @@ -1141,7 +1282,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_debugGetStateRoot","params" } ``` - + + + ### `priv_deletePrivacyGroup` @@ -1155,21 +1298,25 @@ Deletes the specified privacy group. `result`: _string_ - deleted privacy group ID - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_deletePrivacyGroup","params":["ewuTVoc5nlvWMwTFdRRK/wvV0dcyQo/Pauvx5bNEbTk="],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_deletePrivacyGroup","params":["ewuTVoc5nlvWMwTFdRRK/wvV0dcyQo/Pauvx5bNEbTk="],"id":1} ``` -# JSON result + + + ```json { @@ -1179,7 +1326,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_deletePrivacyGroup","params } ``` - + + + ### `priv_distributeRawTransaction` @@ -1199,21 +1348,25 @@ If you want to sign the [privacy marker transaction](../../how-to/use-privacy/si `result`: _string_ - 32-byte enclave key (the enclave key is a pointer to the private transaction in [Tessera](https://docs.tessera.consensys.net/).) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_distributeRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_distributeRawTransaction","params": ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id":1} ``` -# JSON result + + + ```json { @@ -1223,7 +1376,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_distributeRawTransaction"," } ``` - + + + ### `priv_findPrivacyGroup` @@ -1241,21 +1396,25 @@ Returns a list of privacy groups containing only the listed members. For example - `PANTHEON` for Besu-extended groups. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc": "2.0","method": "priv_findPrivacyGroup","params": [["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="]],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc": "2.0","method": "priv_findPrivacyGroup","params": [["negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw="]],"id": 1} ``` -# JSON result + + + ```json { @@ -1276,7 +1435,9 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_findPrivacyGroup","params } ``` - + + + ### `priv_getCode` @@ -1294,21 +1455,25 @@ Returns the code of the private smart contract at the specified address. Compile `result`: _data_ - code stored at the specified address - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getCode","params":["1lJxSIP4JOp6uRn9wYsPeWwqoOP1c4nPQjylB4FExUA=", "0xeaf1c1bd00ef0bec5e39fba81740f1c5d05aa201", "latest"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"priv_getCode","params":["1lJxSIP4JOp6uRn9wYsPeWwqoOP1c4nPQjylB4FExUA=", "0xeaf1c1bd00ef0bec5e39fba81740f1c5d05aa201", "latest"],"id":1} ``` -# JSON result + + + ```json { @@ -1318,7 +1483,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getCode","params":["1lJxSIP } ``` - + + + ### `priv_getEeaTransactionCount` @@ -1342,21 +1509,25 @@ Besu instead of using `priv_getEeaTransactionCount`. `result`: _string_ - integer representing the number of private transactions sent from the address to the specified group of sender and recipients - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getEeaTransactionCount","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "GGilEkXLaQ9yhhtbpBT03Me9iYa7U/mWXxrJhnbl1XY=", ["KkOjNLmCI6r+mICrC6l+XuEDjFEzQllaMQMpWLl4y1s=","eLb69r4K8/9WviwlfDiZ4jf97P9czyS3DkKu0QYGLjg="]], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_getEeaTransactionCount","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "GGilEkXLaQ9yhhtbpBT03Me9iYa7U/mWXxrJhnbl1XY=", ["KkOjNLmCI6r+mICrC6l+XuEDjFEzQllaMQMpWLl4y1s=","eLb69r4K8/9WviwlfDiZ4jf97P9czyS3DkKu0QYGLjg="]], "id":1} ``` -# JSON result + + + ```json { @@ -1366,7 +1537,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getEeaTransactionCount","pa } ``` - + + + ### `priv_getFilterChanges` @@ -1384,21 +1557,25 @@ Filters for private contracts can only be created by [`priv_newFilter`](#priv_ne `result`: _array_ of _objects_ - list of [log objects](../../../public-networks/reference/api/objects.md#log-object), or an empty list if nothing has changed since the last poll - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc": "2.0","method": "priv_getFilterChanges","params": ["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=","0x4a35b92809d73f4f53a2355d62125442"],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc": "2.0","method": "priv_getFilterChanges","params": ["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=","0x4a35b92809d73f4f53a2355d62125442"],"id": 1} ``` -# JSON result + + + ```json { @@ -1423,7 +1600,9 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_getFilterChanges","params } ``` - + + + ### `priv_getFilterLogs` @@ -1447,21 +1626,25 @@ For private contracts, `priv_getFilterLogs` is the same as [`eth_getFilterLogs`] `result`: _array_ of _objects_ - list of [log objects](../../../public-networks/reference/api/objects.md#log-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc": "2.0","method": "priv_getFilterLogs","params":["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=","0x4a35b92809d73f4f53a2355d62125442"],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc": "2.0","method": "priv_getFilterLogs","params":["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=","0x4a35b92809d73f4f53a2355d62125442"],"id": 1} ``` -# JSON result + + + ```json { @@ -1500,7 +1683,9 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_getFilterLogs","params":[ } ``` - + + + ### `priv_getLogs` @@ -1518,21 +1703,25 @@ For private contracts, `priv_getLogs` is the same as [`eth_getLogs`](../../../pu `result`: _array_ of _objects_ - list of [log objects](../../../public-networks/reference/api/objects.md#log-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc": "2.0","method": "priv_getLogs","params":["vGy/TZgO6y8VPMVeJAQ99MF1NaTf5ohA3TFfzoEF71k=",{"fromBlock": "earliest","toBlock": "latest","addresses": ["0x630c507ff633312087dc33c513b66276abcd2fc3"],"topics": ["0x85bea11d86cefb165374e0f727bacf21dc2f4ea816493981ecf72dcfb212a410"]}],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc": "2.0","method": "priv_getLogs","params":["vGy/TZgO6y8VPMVeJAQ99MF1NaTf5ohA3TFfzoEF71k=",{"fromBlock": "earliest","toBlock": "latest","addresses": ["0x630c507ff633312087dc33c513b66276abcd2fc3"],"topics": ["0x85bea11d86cefb165374e0f727bacf21dc2f4ea816493981ecf72dcfb212a410"]}],"id": 1} ``` -# JSON result + + + ```json { @@ -1571,7 +1760,9 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_getLogs","params":["vGy/T } ``` - + + + ### `priv_getPrivacyPrecompileAddress` @@ -1585,21 +1776,25 @@ None `result`: _string_ - address of the privacy precompile - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getPrivacyPrecompileAddress","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_getPrivacyPrecompileAddress","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -1609,7 +1804,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getPrivacyPrecompileAddress } ``` - + + + ### `priv_getPrivateTransaction` @@ -1623,21 +1820,25 @@ Returns the private transaction if you are a participant, otherwise, `null`. `result`: _object_ - [private transaction object](objects.md#private-transaction-object), or `null` if not a participant in the private transaction - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getPrivateTransaction","params":["0x623c4ce5275a87b91f4f1c521012d39ca19311c787bde405490f4c0426a71498"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_getPrivateTransaction","params":["0x623c4ce5275a87b91f4f1c521012d39ca19311c787bde405490f4c0426a71498"], "id":1} ``` -# JSON result + + + ```json { @@ -1662,7 +1863,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getPrivateTransaction","par } ``` - + + + ### `priv_getTransactionCount` @@ -1684,21 +1887,25 @@ If sending more than one transaction to be mined in the same block (that is, you `result`: _string_ - integer representing the number of private transactions sent from the address to the specified privacy group - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getTransactionCount","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "kAbelwaVW7okoEn1+okO+AbA4Hhz/7DaCOWVQz9nx5M="], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_getTransactionCount","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "kAbelwaVW7okoEn1+okO+AbA4Hhz/7DaCOWVQz9nx5M="], "id":1} ``` -# JSON result + + + ```json { @@ -1708,7 +1915,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getTransactionCount","param } ``` - + + + ### `priv_getTransactionReceipt` @@ -1722,21 +1931,25 @@ Returns information about the private transaction after mining the transaction. `result`: _object_ - [private Transaction receipt object](objects.md#private-transaction-receipt-object), or `null` if no receipt found - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getTransactionReceipt","params":["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"priv_getTransactionReceipt","params":["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"],"id":1} ``` -# JSON result + + + ```json { @@ -1765,7 +1978,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"priv_getTransactionReceipt","par } ``` - + + + ### `priv_newFilter` @@ -1789,21 +2004,25 @@ For private contracts, `priv_newFilter` is the same as [`eth_newFilter`](../../. `result`: _string_ - filter ID - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc": "2.0","method": "priv_newFilter","params": ["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=",{"fromBlock": "earliest","toBlock": "latest","addresses": ["0x991cc548c154b2953cc48c02f782e1314097dfbb"],"topics": ["0x85bea11d86cefb165374e0f727bacf21dc2f4ea816493981ecf72dcfb212a410"]}],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc": "2.0","method": "priv_newFilter","params": ["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=",{"fromBlock": "earliest","toBlock": "latest","addresses": ["0x991cc548c154b2953cc48c02f782e1314097dfbb"],"topics": ["0x85bea11d86cefb165374e0f727bacf21dc2f4ea816493981ecf72dcfb212a410"]}],"id": 1} ``` -# JSON result + + + ```json { @@ -1813,7 +2032,9 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_newFilter","params": ["4r } ``` - + + + ### `priv_uninstallFilter` @@ -1833,21 +2054,25 @@ For private contracts, `priv_uninstallFilter` is the same as [`eth_uninstallFilt `result`: _boolean_ - indicates if the filter is successfully uninstalled - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc": "2.0","method": "priv_uninstallFilter","params":["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=","0x4a35b92809d73f4f53a2355d62125442"],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc": "2.0","method": "priv_uninstallFilter","params":["4rFldHM792LeP/e2WPkTXZedjwKuTr/KwCFTt6mBbkI=","0x4a35b92809d73f4f53a2355d62125442"],"id": 1} ``` -# JSON result + + + ```json { @@ -1857,7 +2082,9 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_uninstallFilter","params" } ``` - + + + ## `QBFT` methods @@ -1881,21 +2108,25 @@ Discards a proposal to [add or remove a validator](../../how-to/configure/consen `result`: _boolean_ - indicates if the proposal is discarded - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_discardValidatorVote","params":["0xef1bfb6a12794615c9b0b5a21e6741f01e570185"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"qbft_discardValidatorVote","params":["0xef1bfb6a12794615c9b0b5a21e6741f01e570185"], "id":1} ``` -# JSON result + + + ```json { @@ -1905,7 +2136,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_discardValidatorVote","para } ``` - + + + ### `qbft_getPendingVotes` @@ -1919,21 +2152,25 @@ None `result`: _map_ of _strings_ to _booleans_ - map of account addresses to corresponding boolean values indicating the vote for each account; if `true`, the vote is to add a validator. If `false`, the proposal is to remove a validator. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getPendingVotes","params":[], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"qbft_getPendingVotes","params":[], "id":1} ``` -# JSON result + + + ```json { @@ -1946,7 +2183,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getPendingVotes","params":[ } ``` - + + + ### `qbft_getSignerMetrics` @@ -1980,21 +2219,25 @@ The proposer of the genesis block has address `0x0000000000000000000000000000000 ::: - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getSignerMetrics","params":["1", "100"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"qbft_getSignerMetrics","params":["1", "100"], "id":1} ``` -# JSON result + + + ```json { @@ -2020,7 +2263,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getSignerMetrics","params": } ``` - + + + ### `qbft_getValidatorsByBlockHash` @@ -2034,21 +2279,25 @@ Lists the validators defined in the specified block. `result`: _array_ of _strings_ - list of validator addresses - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockHash","params":["0xbae7d3feafd743343b9a4c578cab5e5d65eb735f6855fb845c00cab356331256"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockHash","params":["0xbae7d3feafd743343b9a4c578cab5e5d65eb735f6855fb845c00cab356331256"], "id":1} ``` -# JSON result + + + ```json { @@ -2062,7 +2311,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockHash"," } ``` - + + + ### `qbft_getValidatorsByBlockNumber` @@ -2076,21 +2327,25 @@ Lists the validators defined in the specified block. `result`: _array_ of _strings_ - list of validator addresses - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockNumber","params":["latest"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockNumber","params":["latest"], "id":1} ``` -# JSON result + + + ```json { @@ -2104,7 +2359,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockNumber" } ``` - + + + ### `qbft_proposeValidatorVote` @@ -2120,21 +2377,25 @@ Proposes to [add or remove a validator](../../how-to/configure/consensus/qbft.md `result`: _boolean_ - `true` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_proposeValidatorVote","params":["42d4287eac8078828cf5f3486cfe601a275a49a5",true], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"qbft_proposeValidatorVote","params":["42d4287eac8078828cf5f3486cfe601a275a49a5",true], "id":1} ``` -# JSON result + + + ```json { @@ -2144,7 +2405,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_proposeValidatorVote","para } ``` - + + + diff --git a/versioned_docs/version-23.7.3/private-networks/reference/cli/options.md b/versioned_docs/version-23.7.3/private-networks/reference/cli/options.md index 064549d46f2..e8d12ba9f1a 100644 --- a/versioned_docs/version-23.7.3/private-networks/reference/cli/options.md +++ b/versioned_docs/version-23.7.3/private-networks/reference/cli/options.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Private network command line options This reference describes the syntax of the Hyperledger Besu private network command line interface (CLI) options. @@ -54,33 +57,41 @@ Characters such as smart quotes and long (em) hyphens don't work in Besu command ### `permissions-accounts-config-file` - + -# Syntax + ```bash --permissions-accounts-config-file= ``` -# Example + + + ```bash --permissions-accounts-config-file=/home/me/me_configFiles/myPermissionsFile ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_ACCOUNTS_CONFIG_FILE=/home/me/me_configFiles/myPermissionsFile ``` -# Configuration file + + + ```bash permissions-accounts-config-file="/home/me/me_configFiles/myPermissionsFile" ``` - + + + The [accounts permissions configuration file]. The default is the `permissions_config.toml` file in the [data directory](../../../public-networks/reference/cli/options.md#data-path). @@ -92,129 +103,161 @@ The [accounts permissions configuration file]. The default is the `permissions_c ### `permissions-accounts-config-file-enabled` - + -# Syntax + ```bash --permissions-accounts-config-file-enabled[=] ``` -# Example + + + ```bash --permissions-accounts-config-file-enabled=true ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_ACCOUNTS_CONFIG_FILE_ENABLED=true ``` -# Configuration file + + + ```bash permissions-accounts-config-file-enabled=true ``` - + + + Enables or disables file-based account level permissions. The default is `false`. ### `permissions-accounts-contract-address` - + -# Syntax + ```bash --permissions-accounts-contract-address= ``` -# Example + + + ```bash --permissions-accounts-contract-address=xyz ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_ACCOUNTS_CONTRACT_ADDRESS=xyz ``` -# Configuration file + + + ```bash permissions-accounts-contract-address="xyz" ``` - + + + The contract address for [onchain account permissioning](../../concepts/permissioning/onchain.md). ### `permissions-accounts-contract-enabled` - + -# Syntax + ```bash --permissions-accounts-contract-enabled[=] ``` -# Example + + + ```bash --permissions-accounts-contract-enabled=true ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_ACCOUNTS_CONTRACT_ENABLED=true ``` -# Configuration file + + + ```bash permissions-accounts-contract-enabled=true ``` - + + + Enables or disables contract-based [onchain account permissioning](../../concepts/permissioning/onchain.md). The default is `false`. ### `permissions-nodes-config-file` - + -# Syntax + ```bash --permissions-nodes-config-file= ``` -# Example + + + ```bash --permissions-nodes-config-file=/home/me/me_configFiles/myPermissionsFile ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_NODES_CONFIG_FILE=/home/me/me_configFiles/myPermissionsFile ``` -# Configuration file + + + ```bash permissions-nodes-config-file="/home/me/me_configFiles/myPermissionsFile" ``` - + + + The [nodes permissions configuration file]. The default is the `permissions_config.toml` file in the [data directory](../../../public-networks/reference/cli/options.md#data-path). @@ -226,161 +269,201 @@ The [nodes permissions configuration file]. The default is the `permissions_conf ### `permissions-nodes-config-file-enabled` - + -# Syntax + ```bash --permissions-nodes-config-file-enabled[=] ``` -# Example + + + ```bash --permissions-nodes-config-file-enabled=true ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_NODES_CONFIG_FILE_ENABLED=true ``` -# Configuration file + + + ```bash permissions-nodes-config-file-enabled=true ``` - + + + Enables or disables file-based node level permissions. The default is `false`. ### `permissions-nodes-contract-address` - + -# Syntax + ```bash --permissions-nodes-contract-address= ``` -# Example + + + ```bash --permissions-nodes-contract-address=xyz ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_NODES_CONTRACT_ADDRESS=xyz ``` -# Configuration file + + + ```bash permissions-nodes-contract-address="xyz" ``` - + + + The contract address for [onchain node permissioning](../../concepts/permissioning/onchain.md). ### `permissions-nodes-contract-enabled` - + -# Syntax + ```bash --permissions-nodes-contract-enabled[=] ``` -# Example + + + ```bash --permissions-nodes-contract-enabled=true ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_NODES_CONTRACT_ENABLED=true ``` -# Configuration file + + + ```bash permissions-nodes-contract-enabled=true ``` - + + + Enables or disables contract-based [onchain node permissioning](../../concepts/permissioning/onchain.md). The default is `false`. ### `permissions-nodes-contract-version` - + -# Syntax + ```bash --permissions-nodes-contract-version= ``` -# Example + + + ```bash --permissions-nodes-contract-version=2 ``` -# Environment variable + + + ```bash BESU_PERMISSIONS_NODES_CONTRACT_VERSION=2 ``` -# Configuration file + + + ```bash permissions-nodes-contract-version=2 ``` - + + + Version of the EEA [node permissioning interface](../../how-to/use-permissioning/onchain.md#specify-the-permissioning-contract-interface-version). The default is 1. ### `privacy-enabled` - + -# Syntax + ```bash --privacy-enabled[=] ``` -# Example + + + ```bash --privacy-enabled=false ``` -# Environment variable + + + ```bash BESU_PRIVACY_ENABLED=false ``` -# Configuration file + + + ```bash privacy-enabled=false ``` - + + + Enables or disables [private transactions](../../concepts/privacy/index.md). The default is `false`. @@ -392,33 +475,41 @@ Using private transactions with [pruning](../../../public-networks/concepts/data ### `privacy-marker-transaction-signing-key-file` - + -# Syntax + ```bash --privacy-marker-transaction-signing-key-file= ``` -# Example + + + ```bash --privacy-marker-transaction-signing-key-file=/home/me/me_node/myPrivateKey ``` -# Environment variable + + + ```bash BESU_PRIVACY_MARKER_TRANSACTION_SIGNING_KEY_FILE=/home/me/me_node/myPrivateKey ``` -# Configuration file + + + ```bash privacy-marker-transaction-signing-key-file="/home/me/me_node/myPrivateKey" ``` - + + + `` is the name of the private key file used to [sign privacy marker transactions](../../how-to/use-privacy/sign-pmts.md). @@ -437,65 +528,81 @@ If you do not specify this option (for example, in a free gas network), Besu sig ### `privacy-multi-tenancy-enabled` - + -# Syntax + ```bash --privacy-multi-tenancy-enabled[=] ``` -# Example + + + ```bash --privacy-multi-tenancy-enabled=false ``` -# Environment variable + + + ```bash BESU_PRIVACY_MULTI_TENANCY_ENABLED=false ``` -# Configuration file + + + ```bash privacy-multi-tenancy-enabled=false ``` - + + + Enables or disables [multi-tenancy](../../concepts/privacy/multi-tenancy.md) for private transactions. The default is `false`. ### `privacy-flexible-groups-enabled` - + -# Syntax + ```bash --privacy-flexible-groups-enabled[=] ``` -# Example + + + ```bash --privacy-flexible-groups-enabled=true ``` -# Environment variable + + + ```bash BESU_PRIVACY_FLEXIBLE_GROUPS_ENABLED=true ``` -# Configuration file + + + ```bash privacy-flexible-groups-enabled=true ``` - + + + Enables or disables [flexible privacy groups](../../concepts/privacy/flexible-privacy.md). The default is `false`. @@ -503,33 +610,41 @@ Deprecated syntax for this option is `--privacy-onchain-groups-enabled`. ### `privacy-public-key-file` - + -# Syntax + ```bash --privacy-public-key-file= ``` -# Example + + + ```bash --privacy-public-key-file=Tessera/nodeKey.pub ``` -# Environment variable + + + ```bash BESU_PRIVACY_PUBLIC_KEY_FILE=Tessera/nodeKey.pub ``` -# Configuration file + + + ```bash privacy-public-key-file="Tessera/nodeKey.pub" ``` - + + + The [public key of the Tessera node](https://docs.tessera.consensys.net/). @@ -541,65 +656,81 @@ You cannot specify `privacy-public-key-file` when [`--privacy-multi-tenancy-enab ### `privacy-tls-enabled` - + -# Syntax + ```bash --privacy-tls-enabled[=] ``` -# Example + + + ```bash --privacy-tls-enabled=false ``` -# Environment variable + + + ```bash BESU_PRIVACY_TLS_ENABLED=false ``` -# Configuration file + + + ```bash privacy-tls-enabled=false ``` - + + + Enables or disables [TLS on communication with the private transaction manager]. The default is false. ### `privacy-tls-keystore-file` - + -# Syntax + ```bash --privacy-tls-keystore-file= ``` -# Example + + + ```bash --privacy--keystore-file=/home/me/me_node/key ``` -# Environment variable + + + ```bash BESU_PRIVACY_TLS_KEYSTORE_FILE=/home/me/me_node/key ``` -# Configuration file + + + ```bash privacy-tls-keystore-file="/home/me/me_node/key" ``` - + + + The keystore file (in PKCS #12 format) containing the private key and the certificate presented during authentication. @@ -607,97 +738,121 @@ You must specify `privacy-tls-keystore-file` if [`--privacy-tls-enabled`](#priva ### `privacy-tls-keystore-password-file` - + -# Syntax + ```bash --privacy-tls-keystore-password-file= ``` -# Example + + + ```bash --privacy-tls-keystore-password-file=/home/me/me_node/password ``` -# Environment variable + + + ```bash BESU_PRIVACY_TLS_KEYSTORE_PASSWORD_FILE=/home/me/me_node/password ``` -# Configuration file + + + ```bash privacy-tls-keystore-password-file="/home/me/me_node/password" ``` - + + + The path to the file containing the password to decrypt the keystore. ### `privacy-tls-known-enclave-file` - + -# Syntax + ```bash --privacy-tls-known-enclave-file= ``` -# Example + + + ```bash --privacy-tls-known-enclave-file=/home/me/me_node/knownEnclave ``` -# Environment variable + + + ```bash BESU_PRIVACY_TLS_KNOWN_ENCLAVE_FILE=/home/me/me_node/knownEnclave ``` -# Configuration file + + + ```bash privacy-tls-known-enclave-file="/home/me/me_node/knownEnclave" ``` - + + + The path to the file containing the hostnames, ports, and SHA256 certificate fingerprints of the [authorized privacy enclave](../../how-to/configure/tls/client-and-server.md#create-the-known-servers-file). ### `privacy-url` - + -# Syntax + ```bash --privacy-url= ``` -# Example + + + ```bash --privacy-url=http://127.0.0.1:8888 ``` -# Environment variable + + + ```bash BESU_PRIVACY_URL=http://127.0.0.1:8888 ``` -# Configuration file + + + ```bash privacy-url="http://127.0.0.1:8888" ``` - + + + The URL on which the [Tessera node](../../tutorials/privacy/index.md#3-create-tessera-configuration-files) is running. diff --git a/versioned_docs/version-23.7.3/private-networks/reference/cli/subcommands.md b/versioned_docs/version-23.7.3/private-networks/reference/cli/subcommands.md index 5b8b07c4dbd..19f6f8fad59 100644 --- a/versioned_docs/version-23.7.3/private-networks/reference/cli/subcommands.md +++ b/versioned_docs/version-23.7.3/private-networks/reference/cli/subcommands.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Private network subcommands This reference describes the syntax of the Hyperledger Besu private network command line interface (CLI) subcommands. @@ -34,21 +37,25 @@ Provides operator actions. ### `generate-blockchain-config` - + -# Syntax + ```bash besu operator generate-blockchain-config --config-file= --to= [--genesis-file-name=] [--private-key-file-name=] [--public-key-file-name=] ``` -# Example + + + ```bash besu operator generate-blockchain-config --config-file=config.json --to=myNetworkFiles ``` - + + + Generates an [IBFT 2.0](../../how-to/configure/consensus/ibft.md#genesis-file) or [QBFT](../../how-to/configure/consensus/qbft.md#genesis-file) genesis file. @@ -60,27 +67,33 @@ Provides RLP related actions. ### `encode` - + -# Syntax + ```bash besu rlp encode [--from=] [--to=] [--type=] ``` -# File example + + + ```bash besu rlp encode --from=ibft_extra_data.json --to=extra_data_for_ibft_genesis.txt --type=IBFT_EXTRA_DATA ``` -# Standard input/output example + + + ```bash cat extra_data.json | besu rlp encode > rlp.txt ``` - + + + Encodes the RLP hexadecimal string for use in an [IBFT 2.0](../../how-to/configure/consensus/ibft.md#genesis-file) or [QBFT](../../how-to/configure/consensus/qbft.md#genesis-file) genesis file. The default type is `IBFT_EXTRA_DATA`. @@ -123,9 +136,9 @@ Use the following JSON Schema to validate that your JSON data is well formed. To Example IBFT_EXTRA_DATA encoding - + -# JSON input + ```json [ @@ -134,10 +147,14 @@ Example IBFT_EXTRA_DATA encoding ] ``` -# RLP output + + + ``` 0xf853a00000000000000000000000000000000000000000000000000000000000000000ea94be068f726a13c8d46c44be6ce9d275600e1735a4945ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193808400000000c0 ``` - + + + diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/clique.md b/versioned_docs/version-23.7.3/private-networks/tutorials/clique.md index 5a92e40122f..46ffd7fcbb9 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/clique.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/clique.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create a private network using Clique A private network provides a configurable network for testing. This private network uses the [Clique (proof of authority) consensus protocol]. @@ -47,21 +50,25 @@ In Clique networks, you must include the address of at least one initial signer To get the address for Node-1, in the `Node-1` directory, use the [`public-key export-address`](../../public-networks/reference/cli/subcommands.md#export-address) subcommand to write the node address to the specified file (`node1Address` in this example). - + -# MacOS + ```bash besu --data-path=data public-key export-address --to=data/node1Address ``` -# Windows + + + ```bash besu --data-path=data public-key export-address --to=data\node1Address ``` - + + + ### 3. Create the genesis file @@ -135,21 +142,25 @@ Do not use the accounts in `alloc` in the genesis file on Mainnet or any public Start Node-1: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../cliqueGenesis.json --network-id 123 --rpc-http-enabled --rpc-http-api=ETH,NET,CLIQUE --host-allowlist="*" --rpc-http-cors-origins="all" ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\cliqueGenesis.json --network-id 123 --rpc-http-enabled --rpc-http-api=ETH,NET,CLIQUE --host-allowlist="*" --rpc-http-cors-origins="all" ``` - + + + The command line enables: @@ -166,21 +177,25 @@ When the node starts, the [enode URL](../../public-networks/concepts/node-keys.m Start another terminal, change to the `Node-2` directory and start Node-2 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../cliqueGenesis.json --bootnodes= --network-id 123 --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,CLIQUE --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\cliqueGenesis.json --bootnodes= --network-id 123 --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,CLIQUE --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 ``` - + + + The command line specifies: @@ -194,21 +209,25 @@ The command line specifies: Start another terminal, change to the `Node-3` directory and start Node-3 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../cliqueGenesis.json --bootnodes= --network-id 123 --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,CLIQUE --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\cliqueGenesis.json --bootnodes= --network-id 123 --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,CLIQUE --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 ``` - + + + The command line specifies: diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/ethash.md b/versioned_docs/version-23.7.3/private-networks/tutorials/ethash.md index ea464438383..84f7a21f1be 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/ethash.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/ethash.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create a private network using Ethash A private network provides a configurable network for testing. By configuring a low difficulty and enabling mining, this allows for fast block creation. @@ -94,21 +97,25 @@ Don't use the accounts in `alloc` in the genesis file on Mainnet or any public n Start Node-1: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../privateNetworkGenesis.json --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-enabled --host-allowlist="*" --rpc-http-cors-origins="all" ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\privateNetworkGenesis.json --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-enabled --host-allowlist="*" --rpc-http-cors-origins="all" ``` - + + + The command line enables: @@ -131,21 +138,25 @@ When the node starts, the [enode URL](../../public-networks/concepts/node-keys.m Start another terminal, change to the `Node-2` directory and start Node-2 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../privateNetworkGenesis.json --bootnodes= --p2p-port=30304 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\privateNetworkGenesis.json --bootnodes= --p2p-port=30304 ``` - + + + The command line specifies: @@ -158,21 +169,25 @@ The command line specifies: Start another terminal, change to the `Node-3` directory and start Node-3 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../privateNetworkGenesis.json --bootnodes= --p2p-port=30305 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\privateNetworkGenesis.json --bootnodes= --p2p-port=30305 ``` - + + + The command line specifies: diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/index.md b/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/index.md index 92df0a3f9ae..cc9bc1cd99b 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/index.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/index.md @@ -4,6 +4,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create a private network using IBFT 2.0 A private network provides a configurable network for testing. This private network uses the [IBFT 2.0 (proof of authority) consensus protocol](../../how-to/configure/consensus/ibft.md). @@ -172,21 +175,25 @@ IBFT-Network/ In the `Node-1` directory, start Node-1: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=../genesis.json --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" ``` - + + + The command line: @@ -204,21 +211,25 @@ When the node starts, the [enode URL](../../../public-networks/concepts/node-key Start another terminal, change to the `Node-2` directory and start Node-2 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 ``` - + + + The command line specifies: @@ -232,21 +243,25 @@ The command line specifies: Start another terminal, change to the `Node-3` directory and start Node-3 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 ``` - + + + The command line specifies: @@ -260,21 +275,25 @@ The command line specifies: Start another terminal, change to the `Node-4` directory and start Node-4 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30306 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8548 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30306 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8548 ``` - + + + The command line specifies: diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/validators.md b/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/validators.md index 1e74b04d01d..d4170fd986f 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/validators.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/ibft/validators.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Add and remove IBFT 2.0 validators This example walks through [adding and removing an IBFT 2.0 validator](../../how-to/configure/consensus/ibft.md#add-and-remove-validators). @@ -50,35 +53,41 @@ Copy the address of the node. You can find the address in the logs when starting Or use the [`public-key export-address`](../../../public-networks/reference/cli/subcommands.md#export-address) subcommand: - + -# Subcommand + ```bash besu --data-path=IBFT-Network/Node-5/data public-key export-address ``` -# Output + + + ```bash 0x90626e6a67445aabf1c0615410d108d4733aa90b ``` - + + + ### 4. Propose adding the new validator Propose adding the new validator from more than half the number of current validators, using [`ibft_proposeValidatorVote`](../../../public-networks/reference/api/index.md#ibft_proposevalidatorvote), specifying the address of the proposed validator and `true`: - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_proposeValidatorVote","params":["0x90626e6a67445aabf1c0615410d108d4733aa90b", true], "id":1}' http://127.0.0.1:8545 ``` -# JSON result + + + ```json { @@ -87,8 +96,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_proposeValidatorVote","para "result": true } ``` + - + Repeat the proposal process for this candidate node from at least two of the other nodes. @@ -96,15 +106,18 @@ Repeat the proposal process for this candidate node from at least two of the oth Verify that the new validator is now in the list of validators using [`ibft_getValidatorsByBlockNumber`](../../../public-networks/reference/api/index.md#ibft_getvalidatorsbyblocknumber): - + + + # curl HTTP request ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockNumber","params":["latest"], "id":1}' http://127.0.0.1:8545 ``` + -# JSON result + ```json [ @@ -115,8 +128,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"ibft_getValidatorsByBlockNumber" "0x90626e6a67445aabf1c0615410d108d4733aa90b" ] ``` + - + The list of validators contains 5 addresses now. diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/kubernetes/charts.md b/versioned_docs/version-23.7.3/private-networks/tutorials/kubernetes/charts.md index 259fe1d13d3..ae170556018 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/kubernetes/charts.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/kubernetes/charts.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Deploy charts You can deploy Besu Helm charts for a Kubernetes cluster. @@ -448,15 +451,17 @@ Once complete, view the IP address listed under the `Ingress` section if you're The following is an example RPC call, which confirms that the node running the JSON-RPC service is syncing: - + -# curl HTTP request + ```bash curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http:///rpc ``` -# JSON result + + + ```json { @@ -466,7 +471,9 @@ curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","me } ``` - + + + ### 10. Blockchain explorer diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/permissioning/index.md b/versioned_docs/version-23.7.3/private-networks/tutorials/permissioning/index.md index 054469e436d..4c7eaf5105d 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/permissioning/index.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/permissioning/index.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create a permissioned network The following steps set up a permissioned network with local node and account permissions. The network uses the [IBFT 2.0 proof of authority consensus protocol]. @@ -180,21 +183,25 @@ Use the [`perm_addNodesToAllowlist`](../../reference/api/index.md#perm_addnodest Use the following command: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" ``` - + + + The command line allows you to enable: @@ -212,21 +219,25 @@ When the node starts, the [enode URL](../../../public-networks/concepts/node-key Start another terminal, change to the `Node-2` directory, and start Node-2: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30304 --rpc-http-port=8546 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30304 --rpc-http-port=8546 ``` - + + + The command line specifies: @@ -241,21 +252,25 @@ When the node starts, the [enode URL](../../../public-networks/concepts/node-key Start another terminal, change to the `Node-3` directory, and start Node-3: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30305 --rpc-http-port=8547 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30305 --rpc-http-port=8547 ``` - + + + The command line specifies: @@ -270,21 +285,25 @@ When the node starts, the [enode URL](../../../public-networks/concepts/node-key Start another terminal, change to the `Node-4` directory, and start Node-4: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30306 --rpc-http-port=8548 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --permissions-nodes-config-file-enabled --permissions-accounts-config-file-enabled --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30306 --rpc-http-port=8548 ``` - + + + The command line specifies: @@ -301,33 +320,43 @@ Start another terminal and use the [`perm_addNodesToAllowlist`](../../reference/ Replace ``, ``, ``, and `` with the enode URL displayed when starting each node. - + -# Node-1 + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","params":[["","","","EnodeNode4"]], "id":1}' http://127.0.0.1:8545 ``` -# Node-2 + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","params":[["","","","EnodeNode4"]], "id":1}' http://127.0.0.1:8546 ``` -# Node-3 + + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","params":[["","","","EnodeNode4"]], "id":1}' http://127.0.0.1:8547 ``` -# Node-4 + + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"perm_addNodesToAllowlist","params":[["","","","EnodeNode4"]], "id":1}' http://127.0.0.1:8548 ``` - + + + :::tip @@ -341,27 +370,33 @@ Use the [`admin_addPeer`](../../../public-networks/reference/api/index.md#admin_ Replace `` with the enode URL displayed when starting Node-1. - + -# Node-2 + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":[""],"id":1}' http://127.0.0.1:8546 ``` -# Node-3 + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":[""],"id":1}' http://127.0.0.1:8547 ``` -# Node-4 + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":[""],"id":1}' http://127.0.0.1:8548 ``` - + + + :::tip @@ -371,21 +406,25 @@ The curl call is the same for each node except for the JSON-RPC endpoint. Replace `` with the enode URL displayed when starting Node-2. - + -# Node-3 + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":[""],"id":1}' http://127.0.0.1:8547 ``` -# Node-4 + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":[""],"id":1}' http://127.0.0.1:8548 ``` - + + + Replace `` with the enode URL displayed when starting Node-3. @@ -449,21 +488,25 @@ In your `Permissioned-Network` directory, create a `Node-5` directory and `data` Change to the `Node-5` directory and start Node-5 specifying the Node-1 enode URL as the bootnode: - + -# MacOS + ```bash besu --data-path=data --bootnodes="" --genesis-file=../genesis.json --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30307 --rpc-http-port=8549 ``` -# Windows + + + ```bash besu --data-path=data --bootnodes="" --genesis-file=..\genesis.json --rpc-http-enabled --rpc-http-api=ADMIN,ETH,NET,PERM,IBFT --host-allowlist="*" --rpc-http-cors-origins="*" --p2p-port=30307 --rpc-http-port=8549 ``` - + + + Start another terminal and use curl to call the JSON-RPC API [`net_peerCount`](../../../public-networks/reference/api/index.md#net_peercount) method: diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/privacy/index.md b/versioned_docs/version-23.7.3/private-networks/tutorials/privacy/index.md index f3991a18afd..a1cd0973c12 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/privacy/index.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/privacy/index.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create a privacy-enabled network Configuring a network that supports private transactions requires starting a [Tessera] node for each Hyperledger Besu node. Besu command line options associate the Besu node with the Tessera node. @@ -70,9 +73,9 @@ In production environments, only specify [`tls`](https://docs.tessera.consensys. ::: - + -# Node-1 + ```json { @@ -128,7 +131,9 @@ In production environments, only specify [`tls`](https://docs.tessera.consensys. } ``` -# Node-2 + + + ```json { @@ -184,7 +189,9 @@ In production environments, only specify [`tls`](https://docs.tessera.consensys. } ``` -# Node-3 + + + ```json { @@ -240,7 +247,9 @@ In production environments, only specify [`tls`](https://docs.tessera.consensys. } ``` -# Node-4 + + + ```json { @@ -296,7 +305,9 @@ In production environments, only specify [`tls`](https://docs.tessera.consensys. } ``` - + + + In the configuration file, specify: @@ -322,21 +333,25 @@ After starting the first Tessera node and before starting the other nodes, the l In the `Node-1` directory, start Besu Node-1: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --privacy-enabled --privacy-url=http://127.0.0.1:9102 --privacy-public-key-file=Tessera/nodeKey.pub --min-gas-price=0 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --privacy-enabled --privacy-url=http://127.0.0.1:9102 --privacy-public-key-file=Tessera\nodeKey.pub --min-gas-price=0 ``` - + + + The command line specifies privacy options: @@ -360,21 +375,25 @@ When the node starts, the [enode URL](../../../public-networks/concepts/node-key In the `Node-2` directory, start Besu Node-2 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 --privacy-enabled --privacy-url=http://127.0.0.1:9202 --privacy-public-key-file=Tessera/nodeKey.pub --min-gas-price=0 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 --privacy-enabled --privacy-url=http://127.0.0.1:9202 --privacy-public-key-file=Tessera\nodeKey.pub --min-gas-price=0 ``` - + + + The command line specifies the same options as for Node-1 with different ports and Tessera node URL. The [`--bootnodes`](../../../public-networks/reference/cli/options.md#bootnodes) option specifies the enode URL of Node-1. @@ -388,21 +407,25 @@ When running Besu from the [Docker image](../../get-started/install/run-docker-i In the `Node-3` directory, start Besu Node-3 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 --privacy-enabled --privacy-url=http://127.0.0.1:9302 --privacy-public-key-file=Tessera/nodeKey.pub --min-gas-price=0 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 --privacy-enabled --privacy-url=http://127.0.0.1:9302 --privacy-public-key-file=Tessera\nodeKey.pub --min-gas-price=0 ``` - + + + The command line specifies the same options as for Node-1 with different ports and Tessera node URL. The [`--bootnodes`](../../../public-networks/reference/cli/options.md#bootnodes) option specifies the enode URL of Node-1. @@ -410,21 +433,25 @@ The command line specifies the same options as for Node-1 with different ports a In the `Node-4` directory, start Besu Node-4 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30306 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8548 --privacy-enabled --privacy-url=http://127.0.0.1:9402 --privacy-public-key-file=Tessera/nodeKey.pub --min-gas-price=0 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30306 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT,EEA,PRIV --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8548 --privacy-enabled --privacy-url=http://127.0.0.1:9402 --privacy-public-key-file=Tessera\nodeKey.pub --min-gas-price=0 ``` - + + + The command line specifies the same options as for Node-1 with different ports and Tessera node URL. The [`--bootnodes`](../../../public-networks/reference/cli/options.md#bootnodes) option specifies the enode URL of Node-1. diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/qbft.md b/versioned_docs/version-23.7.3/private-networks/tutorials/qbft.md index a8c2234ee1a..b9de554e79c 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/qbft.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/qbft.md @@ -6,6 +6,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Create a private network using QBFT A private network provides a configurable network for testing. This private network uses the [QBFT (proof of authority) consensus protocol](../how-to/configure/consensus/qbft.md). @@ -176,21 +179,25 @@ QBFT-Network/ In the `Node-1` directory, start Node-1: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" ``` - + + + The command line: @@ -208,21 +215,25 @@ When the node starts, the [enode URL](../../public-networks/concepts/node-keys.m Start another terminal, change to the `Node-2` directory and start Node-2 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30304 --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8546 ``` - + + + The command line specifies: @@ -236,21 +247,26 @@ The command line specifies: Start another terminal, change to the `Node-3` directory and start Node-3 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 ``` -# Windows + + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30305 --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8547 ``` - + + + The command line specifies: @@ -264,21 +280,25 @@ The command line specifies: Start another terminal, change to the `Node-4` directory and start Node-4 specifying the Node-1 enode URL copied when starting Node-1 as the bootnode: - + -# MacOS + ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30306 --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8548 ``` -# Windows + + + ```bash besu --data-path=data --genesis-file=..\genesis.json --bootnodes= --p2p-port=30306 --rpc-http-enabled --rpc-http-api=ETH,NET,QBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8548 ``` - + + + The command line specifies: diff --git a/versioned_docs/version-23.7.3/private-networks/tutorials/quickstart.md b/versioned_docs/version-23.7.3/private-networks/tutorials/quickstart.md index b54fb721347..391306d8ccd 100644 --- a/versioned_docs/version-23.7.3/private-networks/tutorials/quickstart.md +++ b/versioned_docs/version-23.7.3/private-networks/tutorials/quickstart.md @@ -10,6 +10,9 @@ import TestAccounts from '../../global/test_accounts.md'; import Postman from '../../global/postman.md'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Developer Quickstart The Quorum Developer Quickstart uses the Hyperledger Besu Docker image to run a private [IBFT 2.0](../how-to/configure/consensus/ibft.md) network of Besu nodes managed by Docker Compose. @@ -182,9 +185,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[], The result displays the client version of the running node: - + -# Result example + ```json { @@ -194,7 +197,9 @@ The result displays the client version of the running node: } ``` -# Result explanation + + + - `"jsonrpc" : "2.0"` indicates that the JSON-RPC 2.0 spec format is used. - `"id" : 1` is the request identifier used to match the request and the response. This tutorial always uses 1. @@ -203,7 +208,9 @@ The result displays the client version of the running node: - `linux-x86_64` is the architecture used to build this version. - `oracle_openjdk-java-11` is the JVM type and version used to build this version. This may be different when you run this tutorial. - + + + Successfully calling this method shows that you can connect to the nodes using JSON-RPC over HTTP. diff --git a/versioned_docs/version-23.7.3/public-networks/get-started/connect/mainnet.md b/versioned_docs/version-23.7.3/public-networks/get-started/connect/mainnet.md index 00722030e74..1316ae431cb 100644 --- a/versioned_docs/version-23.7.3/public-networks/get-started/connect/mainnet.md +++ b/versioned_docs/version-23.7.3/public-networks/get-started/connect/mainnet.md @@ -6,6 +6,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Connect to Mainnet :::info @@ -100,9 +103,9 @@ If you're using Teku, follow the [Besu and Teku Mainnet tutorial](../../tutorial After starting Besu and the consensus client, your node starts syncing and connecting to peers. - + -# Besu logs + ```bash {"@timestamp":"2023-02-03T04:43:49,555","level":"INFO","thread":"main","class":"DefaultSynchronizer","message":"Starting synchronizer.","throwable":""} @@ -119,7 +122,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 {"@timestamp":"2023-02-03T04:51:28,985","level":"INFO","thread":"EthScheduler-Services-29 (importBlock)","class":"FastImportBlocksStep","message":"Block import progress: 180400 of 16545859 (1%)","throwable":""} ``` -# Teku logs + + + ```bash 2022-03-21 20:43:24.355 INFO - Syncing *** Target slot: 76092, Head slot: 2680, Remaining slots: 73412, Connected peers: 8 @@ -129,7 +134,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 2022-03-21 20:44:12.353 INFO - Syncing *** Target slot: 76096, Head slot: 3519, Remaining slots: 72577, Connected peers: 9 ``` - + + + If you're running the consensus client as a beacon node only, you're all set. If you're also running the consensus client as a validator client, ensure your clients are fully synced before submitting your staking deposit in the next step. Syncing Besu can take several days. diff --git a/versioned_docs/version-23.7.3/public-networks/get-started/connect/testnet.md b/versioned_docs/version-23.7.3/public-networks/get-started/connect/testnet.md index 1722bc8e489..2744d0de2e8 100644 --- a/versioned_docs/version-23.7.3/public-networks/get-started/connect/testnet.md +++ b/versioned_docs/version-23.7.3/public-networks/get-started/connect/testnet.md @@ -6,6 +6,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Connect to a testnet Run Besu as an [execution client](../../concepts/the-merge.md#execution-clients) with any consensus client on the [Goerli](https://github.com/eth-clients/goerli) and [Sepolia](https://github.com/eth-clients/sepolia) testnets. @@ -59,9 +62,9 @@ Save the password you use to generate each key pair in a `.txt` file. You should Run the following command or specify the options in a [configuration file](../../how-to/configuration-file.md): - + -# Goerli + ```bash besu \ @@ -77,7 +80,9 @@ besu \ --engine-jwt-secret= ``` -# Holesky + + + ```bash besu \ @@ -93,7 +98,9 @@ besu \ --engine-jwt-secret= ``` -# Sepolia + + + ```bash besu \ @@ -109,7 +116,9 @@ besu \ --engine-jwt-secret= ``` - + + + Specify the path to the `jwtsecret.hex` file generated in [step 1](#1-generate-the-shared-secret) using the [`--engine-jwt-secret`](../../reference/cli/options.md#engine-jwt-secret) option. @@ -131,9 +140,9 @@ If you're using Teku, follow the [Besu and Teku testnet tutorial](../../tutorial After starting Besu and the consensus client, your node starts syncing and connecting to peers. - + -# Besu logs + ```bash {"@timestamp":"2023-02-03T04:43:49,555","level":"INFO","thread":"main","class":"DefaultSynchronizer","message":"Starting synchronizer.","throwable":""} @@ -150,7 +159,8 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 {"@timestamp":"2023-02-03T04:51:28,985","level":"INFO","thread":"EthScheduler-Services-29 (importBlock)","class":"FastImportBlocksStep","message":"Block import progress: 180400 of 16545859 (1%)","throwable":""} ``` -# Teku logs + + ```bash 2022-03-21 20:43:24.355 INFO - Syncing *** Target slot: 76092, Head slot: 2680, Remaining slots: 73412, Connected peers: 8 @@ -160,7 +170,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 2022-03-21 20:44:12.353 INFO - Syncing *** Target slot: 76096, Head slot: 3519, Remaining slots: 72577, Connected peers: 9 ``` - + + + If you're running the consensus client as a beacon node only, you're all set. If you're also running the consensus client as a validator client, ensure your clients are fully synced before submitting your staking deposit in the next step. This can take several days. diff --git a/versioned_docs/version-23.7.3/public-networks/get-started/system-requirements.md b/versioned_docs/version-23.7.3/public-networks/get-started/system-requirements.md index e0d9dfe7122..35f42ac2527 100644 --- a/versioned_docs/version-23.7.3/public-networks/get-started/system-requirements.md +++ b/versioned_docs/version-23.7.3/public-networks/get-started/system-requirements.md @@ -6,6 +6,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # System requirements Determine public network system requirements by checking CPU and disk space requirements using [Prometheus](../how-to/monitor/metrics.md). Grafana provides a [sample dashboard](https://grafana.com/grafana/dashboards/10273) for Besu. @@ -43,75 +46,91 @@ docker image, or install the OpenJ9 JDK using the following steps: ``` 2. Uncompress the binaries: - + - # Command + ```bash tar -xvf YOUR_J9_IMAGE.tar.gz ``` - # Example + + + ```bash tar -xvf ibm-semeru-open-jdk_x64_linux_17.0.5_8_openj9-0.35.0.tar.gz ``` - + + + 3. Move the binaries to `bin` directory: - + - # Command + ```bash sudo cp -r YOUR_IMAGE/ /usr/bin/ ``` - # Example + + + ```bash sudo cp -r jdk-17.0.5+8/ /usr/bin/ ``` - + + + 4. Specify OpenJ9 for Java on your machine: - + - # Command + ```bash sudo update-alternatives --install "/usr/bin/java" "java" "/usr/bin/YOUR_IMAGE" 1 sudo update-alternatives --config java (and choose OpenJ9) ``` - # Example + + + ```bash sudo update-alternatives --install "/usr/bin/java" "java" "/usr/bin/jdk-17.0.5+8/bin/java" ``` - + + + Change your `JAVA_HOME` to OpenJ9 (if using the JDK implementation), where `jdk-install-dir` is the installation location you specified: - + - # Command + ```bash export JAVA_HOME=jdk-install-dir` ``` - # Example + + + ```bash export JAVA_HOME=/usr/bin/jdk-17.0.5+8 ``` - + + + ## Java Virtual Machine size diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/configure-jvm/manage-memory.md b/versioned_docs/version-23.7.3/public-networks/how-to/configure-jvm/manage-memory.md index 9605ce18cfe..fda9791481c 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/configure-jvm/manage-memory.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/configure-jvm/manage-memory.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Manage JVM memory You can manage Java Virtual Machine (JVM) memory usage for Besu by modifying the maximum heap size. @@ -27,9 +30,9 @@ Setting a higher maximum heap size speeds up the sync period but doesn't have mu You can set the maximum heap size using the `BESU_OPTS` environment variable and the `-Xmx` option. The following examples set the maximum heap size to 8 GB: - + -# Exported environment variable example + Set the variable for the whole shell before running Besu. @@ -37,7 +40,9 @@ Set the variable for the whole shell before running Besu. export BESU_OPTS=-Xmx8g ``` -# Inline environment variable example + + + Set the variable only for the specific Besu command. @@ -55,7 +60,9 @@ ExecStart=besu [Besu options] ... ``` - + + + ## Manage the heap dump diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/monitor/metrics.md b/versioned_docs/version-23.7.3/public-networks/how-to/monitor/metrics.md index e76b90abbc2..3320923fc50 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/monitor/metrics.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/monitor/metrics.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use metrics to monitor node performance To enable the [Prometheus](https://prometheus.io/) monitoring and alerting service to access Hyperledger Besu metrics, use the [`--metrics-enabled`](../../reference/cli/options.md#metrics-enabled) option. Use [Grafana](https://grafana.com/) to visualize the collected data. See the sample [Besu Full Grafana dashboard](https://grafana.com/grafana/dashboards/16455-besu-full/). @@ -40,9 +43,9 @@ To configure Prometheus and run with Besu: 1. Configure Prometheus to poll Besu. For example, add the following YAML fragment to the `scrape_configs` block of the `prometheus.yml` file: - + - # Fragment to insert in prometheus.yml + ```yml - job_name: besu @@ -55,7 +58,9 @@ To configure Prometheus and run with Besu: - localhost:9545 ``` - # Full prometheus.yml example + + + ```yml global: @@ -75,27 +80,33 @@ To configure Prometheus and run with Besu: - localhost:9545 ``` - + + + Prometheus requires 3 MB of space per node per hour for metrics, with a `scrape_interval` of 15 seconds. 2. Start Besu with the [`--metrics-enabled`](../../reference/cli/options.md#metrics-enabled) option. To start a single node for testing with metrics enabled, run the following command: - + - # Syntax + ```bash besu --network=dev --miner-enabled --miner-coinbase --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled ``` - # Example + + + ```bash besu --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled ``` - + + + To specify the host and port on which Prometheus accesses Besu, use the [`--metrics-host`](../../reference/cli/options.md#metrics-host) and [`--metrics-port`](../../reference/cli/options.md#metrics-port) options. The default host and port are 127.0.0.1 (`localhost`) and 9545. @@ -147,21 +158,25 @@ To configure Prometheus and run with Besu pushing to a push gateway: 1. Start Besu specifying the `--metrics-push-enabled` option and port of the push gateway: - + - # Syntax + ```bash besu --network=dev --miner-enabled --miner-coinbase --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-push-enabled --metrics-push-port=9091 --metrics-push-host=127.0.0.1 ``` - # Example + + + ```bash besu --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-push-enabled --metrics-push-port=9091 --metrics-push-host=127.0.0.1 ``` - + + + 1. In another terminal, run Prometheus specifying the `prometheus.yml` file: diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/troubleshoot/evm-tool.md b/versioned_docs/version-23.7.3/public-networks/how-to/troubleshoot/evm-tool.md index 7e5a044180a..1f529f8695f 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/troubleshoot/evm-tool.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/troubleshoot/evm-tool.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use the EVM tool The Besu EVM tool is a CLI program that executes arbitrary EVM programs and Ethereum State Tests outside the context of an operating node. Use the EVM tool for benchmarking and fuzz testing. @@ -55,20 +58,24 @@ The first mode of the EVM tool runs an arbitrary EVM and is invoked without an e The EVM tool also has a [`state-test` subcommand](../../reference/evm-tool.md#state-test-options) that allows [Ethereum state tests](https://github.com/ethereum/tests/tree/develop/GeneralStateTests) to be evaluated, and a [`code-validate` subcommand](../../reference/evm-tool.md#eof-code-validation) that allows [Ethereum object formatted (EOF)](https://eips.ethereum.org/EIPS/eip-3540) code to be validated. Most of the options from EVM execution don't apply. - + -# `state-test` + ```bash evm state-test --nomemory ``` -# `code-validate` + + + ```bash evm code-validate --file ``` - + + + The [EVM tool reference](../../reference/evm-tool.md) provides more information on these modes. diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/authenticate.md b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/authenticate.md index 490203cd708..737e4edda8f 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/authenticate.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/authenticate.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Authenticate and authorize JSON-RPC Authentication identifies a user, and authorization verifies user access to requested JSON-RPC methods. Hyperledger Besu verifies users using [JSON Web Tokens (JWT)](https://jwt.io/introduction/). JWT is also used in [multi-tenancy](../../../private-networks/concepts/privacy/multi-tenancy.md) to verify tenant data access. @@ -63,21 +66,25 @@ Each user requiring JSON-RPC access the configuration file lists the: - [JSON-RPC permissions](#json-rpc-permissions). - Optional. The tenant's Tessera public key using `privacyPublicKey`. Only used for [multi-tenancy](../../../private-networks/concepts/privacy/multi-tenancy.md). - + -# Command + ```bash besu password hash --password=MyPassword ``` -# Hash output + + + ```text $2a$10$L3Xb5G/AJOsEK5SuOn9uzOhpCCfuVWTajc5hwWerY6N5xBM/xlrMK ``` - + + + ### 2. Enable authentication @@ -89,33 +96,41 @@ To specify the [credentials file](#1-create-the-credentials-file), use the [`--r To generate an authentication token, make a request to the `/login` endpoint with your username and password. Specify the HTTP port or the WS port to generate a token to authenticate over HTTP or WS respectively. HTTP and WS requires a different token. - + -# Generate a token for HTTP + ```bash curl -X POST --data '{"username":"username1","password":"MyPassword"}' /login ``` -# Example for HTTP + + + ```bash curl -X POST --data '{"username":"username1","password":"MyPassword"}' http://localhost:8545/login ``` -# Generate a token for WS + + + ```bash curl -X POST --data '{"username":"username1","password":"MyPassword"}' /login ``` -# Example for WS + + + ```bash curl -X POST --data '{"username":"username1","password":"MyPassword"}' http://localhost:8546/login ``` -# JSON result + + + ```json { @@ -123,7 +138,9 @@ curl -X POST --data '{"username":"username1","password":"MyPassword"}' http://lo } ``` - + + + Authentication tokens expire five minutes after generation. If you require access after the token expires, you need to generate a new token. @@ -148,9 +165,8 @@ The [key algorithm](https://datatracker.ietf.org/doc/html/rfc7518#section-3.1) c Besu default is `RS256`. - - -# `RS256` RSA Keys + + 1. Generate the private key: @@ -164,7 +180,9 @@ Besu default is `RS256`. openssl rsa -pubout -in privateRSAKey.pem -pubout -out publicRSAKey.pem ``` -# `ES256` `secp256r1` ECDSA Keys + + + 1. Generate the private key: @@ -178,7 +196,9 @@ Besu default is `RS256`. openssl ec -in privateECDSAKey.pem -pubout -out publicECDSAKey.pem ``` - + + + :::danger Private key security @@ -210,9 +230,9 @@ Each payload for the JWT must contain: - [`exp` (Expiration Time) claim](https://tools.ietf.org/html/rfc7519#section-4.1.4) - Optionally, the tenant's Tessera public key using `privacyPublicKey`. Only used for [multi-tenancy](../../../private-networks/concepts/privacy/multi-tenancy.md). - + -# Example JSON Payload + ```json { @@ -222,11 +242,15 @@ Each payload for the JWT must contain: } ``` -# Example JWT result + + + ![Example result](jwt.png) - + + + ### 3. Enable authentication @@ -256,18 +280,22 @@ In the **Authorization** tab in the **TYPE** drop-down list, select **Bearer Tok Specify the `Bearer` in the header. - + -# cURL Request with authentication placeholders + ```bash curl -X POST -H 'Authorization: Bearer ' -d '{"jsonrpc":"2.0","method":"","params":[],"id":1}' ``` -# cURL Request with authentication + + + ```bash curl -X POST -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJwZXJtaXNzaW9ucyI6WyIqOioiXSwidXNlcm5hbWUiOiJ1c2VyMiIsImlhdCI6MTU1MDQ2MTQxNiwiZXhwIjoxNTUwNDYxNzE2fQ.WQ1mqpqzRLHaoL8gOSEZPvnRs_qf6j__7A3Sg8vf9RKvWdNTww_vRJF1gjcVy-FFh96AchVnQyXVx0aNUz9O0txt8VN3jqABVWbGMfSk2T_CFdSw5aDjuriCsves9BQpP70Vhj-tseaudg-XU5hCokX0tChbAqd9fB2138zYm5M' -d '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":1}' http://localhost:8545 ``` - + + + diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/graphql.md b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/graphql.md index 0ac87401670..53d04996d37 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/graphql.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/graphql.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use GraphQL over HTTP GraphQL can reduce the overhead needed for common queries. @@ -34,15 +37,16 @@ The default endpoint is `http://127.0.0.1:8547/graphql`. For example, the following request returns the block number: - - -# Request + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{number}}"}' http://localhost:8547/graphql ``` -# Response + + + ```json { @@ -54,19 +58,21 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{numb } ``` - + + The following request returns the gas price: - - -# Request + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{gasPrice}"}' http://localhost:8547/graphql ``` -# Response + + + ```json { @@ -76,20 +82,22 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{gasPrice}" } ``` - + + The following [`syncing`](../../reference/api/index.md#eth_syncing) request returns data about the synchronization status: - - -# Request + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{syncing{startingBlock currentBlock highestBlock}}"}' http://localhost:8547/graphql ``` -# Response + + + ```json { @@ -103,8 +111,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{syncing{st } ``` - + + :::info note In some cases, for example, when your node is fully synced, the syncing request returns a `null` response: @@ -136,15 +145,16 @@ Pending do not reflect pending transactions. ::: - - -# Pending transaction count + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{pending {transactionCount}}"}' http://localhost:8547/graphql ``` -# Result + + + ```json { @@ -156,17 +166,19 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{pending {t } ``` - + - - -# Pending transactions + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{pending {transactions{hash}}}"}' http://localhost:8547/graphql ``` -# Result + + + ```json { @@ -185,8 +197,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{pending {t } ``` - + + [Besu GraphQL schema]: https://github.com/hyperledger/besu/blob/750580dcca349d22d024cc14a8171b2fa74b505a/ethereum/api/src/main/resources/schema.graphqls diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/json-rpc.md b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/json-rpc.md index 84f70aa4086..8a973d40fdf 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/json-rpc.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/json-rpc.md @@ -8,6 +8,8 @@ tags: --- import Postman from '../../../global/postman.md'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; # Use JSON-RPC over HTTP, WebSocket, and IPC @@ -41,20 +43,26 @@ To use the geth console with Besu: 1. Specify which APIs to enable using the [`--rpc-http-api`](../../reference/cli/options.md#rpc-http-api) or `--Xrpc-ipc-api` option. 1. Start the geth console specifying the JSON-RPC endpoint: - + -# HTTP endpoint + ```bash geth attach http://localhost:8545 ``` -# IPC endpoint + + + ```bash geth attach /path/to/besu.ipc ``` + + + + Use the geth console to call [JSON-RPC API methods](../../reference/api/index.md) that geth and Besu share. ```bash @@ -71,21 +79,25 @@ Besu disables [Authentication](authenticate.md) by default. To make RPC requests over HTTP, you can use [`curl`](https://curl.haxx.se/download.html). - + -# Syntax + ```bash curl -X POST --data '{"jsonrpc":"2.0","id":,"method":"","params":[]}' ``` -# curl HTTP request + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","params":[]}' http://127.0.0.1:8555 ``` -# JSON result + + + ```json { @@ -95,19 +107,23 @@ curl -X POST --data '{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","param } ``` - + + + You can use `curl` to make multiple RPC requests (batch requests) over HTTP at the same time. Send the requests as an array, and receive an array of responses. The default number of allowed requests in a RPC batch request is `1024`. Use the [`--rpc-http-max-batch-size`](../../reference/cli/options.md#rpc-http-max-batch-size) command line option to update the default value. - + -# curl HTTP request + ```bash curl -X POST --data '[{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","params":[]}, {"jsonrpc":"2.0","id":"2","method":"admin_peers","params":[]}]' http://127.0.0.1:8555 ``` -# JSON result + + + ```json [ @@ -124,7 +140,9 @@ curl -X POST --data '[{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","para ] ``` - + + + ### WebSocket @@ -138,21 +156,25 @@ wscat -c ws:// After you establish a connection, the terminal displays a '>' prompt. Send individual requests as a JSON data package at each prompt. - + -# Syntax + ```bash {"jsonrpc":"2.0","id":,"method":"","params":[]} ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","params":[]} ``` -# JSON result + + + ```json { @@ -162,19 +184,23 @@ After you establish a connection, the terminal displays a '>' prompt. Send indiv } ``` - + + + You can use `wscat` to make multiple RPC requests over WebSocket at the same time. Send the requests as an array, and receive an array of responses. - + -# wscat WS request + ```bash [{"jsonrpc":"2.0","id":"1","method":"eth_blockNumber","params":[]}, {"jsonrpc":"2.0","id":"2","method":"admin_peers","params":[]}] ``` -# JSON result + + + ```json [ @@ -191,7 +217,9 @@ You can use `wscat` to make multiple RPC requests over WebSocket at the same tim ] ``` - + + + :::note @@ -209,47 +237,57 @@ By default, the readiness check requires a connected peer and the node to be wit Use the query parameters `minPeers` and `maxBlocksBehind` to adjust the number of peers required and the number of blocks tolerance. - + -# Readiness endpoint + ```bash http:///readiness ``` -# curl request example + + + ```bash curl -v 'http://localhost:8545/readiness' ``` -# Query parameters example + + + ```bash curl -v 'http://localhost:8545/readiness?minPeers=0&maxBlocksBehind=10' ``` - + + + ### Liveness The liveness check requires the JSON-RPC server to be up. You can use the endpoint to verify that the node can respond to RPC calls. The status in the response will always be `UP`. - + -# Liveness endpoint + ```bash http:///liveness ``` -# curl request example + + + ```bash curl -v 'http://localhost:8545/liveness' ``` - + + + ## API methods enabled by default diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/rpc-pubsub.md b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/rpc-pubsub.md index ab315fd1468..d0ed530b497 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/rpc-pubsub.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/use-besu-api/rpc-pubsub.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use RPC Pub/Sub over WebSockets ## Introduction @@ -215,9 +218,9 @@ If a chain reorganization occurs, the subscription publishes notifications for l The logs subscription returns [log objects](../../reference/api/objects.md#log-object). - + -# All logs + ```json { "id": 1, "method": "eth_subscribe", "params": ["logs", {}] } @@ -243,13 +246,17 @@ The logs subscription returns [log objects](../../reference/api/objects.md#log-o } ``` -# Result + + + ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` -# Notification + + + ```json { @@ -275,11 +282,13 @@ The logs subscription returns [log objects](../../reference/api/objects.md#log-o } ``` - + + + - + -# All logs for privacy group + ```json { @@ -289,7 +298,9 @@ The logs subscription returns [log objects](../../reference/api/objects.md#log-o } ``` -# Specific address and topic + + + ```json { @@ -308,13 +319,17 @@ The logs subscription returns [log objects](../../reference/api/objects.md#log-o } ``` -# Result + + + ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` -# Notification + + + ```json { @@ -341,7 +356,9 @@ The logs subscription returns [log objects](../../reference/api/objects.md#log-o } ``` - + + + ### Pending transactions diff --git a/versioned_docs/version-23.7.3/public-networks/how-to/use-engine-api.md b/versioned_docs/version-23.7.3/public-networks/how-to/use-engine-api.md index 1155a51fe6a..b633a2a1988 100644 --- a/versioned_docs/version-23.7.3/public-networks/how-to/use-engine-api.md +++ b/versioned_docs/version-23.7.3/public-networks/how-to/use-engine-api.md @@ -6,6 +6,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Use the Engine API [Consensus and execution clients](../concepts/the-merge.md#execution-and-consensus-clients) communicate with each other using the [Engine API](../reference/engine-api/index.md). These API methods are a separate subsection of the [JSON-RPC API](../how-to/use-besu-api/index.md). @@ -77,15 +80,17 @@ Set the [JWT secret](use-besu-api/authenticate.md#jwt-public-key-authentication) Prepare to send a payload using [`engine_forkchoiceUpdatedV1`](../reference/engine-api/index.md#engine_forkchoiceupdatedv1). - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","params":[{"headBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", "safeBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000"},{"timestamp": "0x5","prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000","suggestedFeeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"}],"id":67}' http://127.0.0.1:8550 ``` -# JSON result + + + ```json { @@ -102,21 +107,25 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","par } ``` - + + + ### 2. Get the payload Get the payload using [`engine_getPayloadV1`](../reference/engine-api/index.md#engine_getpayloadv1) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadV1","params":["0x1"],"id":1}' http://127.0.0.1:8550 ``` -# JSON result + + + ```json { @@ -141,15 +150,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadV1","params":[" } ``` - + + + ### 3. Execute the payload Execute the payload using [`engine_newPayloadV1`](../reference/engine-api/index.md#engine_newpayloadv1) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ @@ -172,7 +183,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ ],"id":67}' http://127.0.0.1:8550 ``` -# JSON result + + + ```json { @@ -186,21 +199,25 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ } ``` - + + + ### 4. Update the fork choice Update the fork choice using [`engine_forkchoiceUpdatedV1`](../reference/engine-api/index.md#engine_forkchoiceupdatedv1) again. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","params":[{"headBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", "safeBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", "finalizedBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a"},null],"id":67}' http://127.0.0.1:8550 ``` -# JSON result + + + ```json { @@ -217,4 +234,6 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","par } ``` - + + + diff --git a/versioned_docs/version-23.7.3/public-networks/reference/api/index.md b/versioned_docs/version-23.7.3/public-networks/reference/api/index.md index fb0c3d0ab30..60337c2f967 100644 --- a/versioned_docs/version-23.7.3/public-networks/reference/api/index.md +++ b/versioned_docs/version-23.7.3/public-networks/reference/api/index.md @@ -8,6 +8,8 @@ tags: --- import Postman from '../../../global/postman.md' +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; # Besu API methods @@ -49,21 +51,25 @@ If connections are timing out, ensure the node ID in the [enode URL](../../conce `result`: _boolean_ - `true` if peer added or `false` if peer already a [static node](../../how-to/connect/static-nodes.md) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":["enode://f59c0ab603377b6ec88b89d5bb41b98fc385030ab1e4b03752db6f7dab364559d92c757c13116ae6408d2d33f0138e7812eb8b696b2a22fe3332c4b5127b22a3@127.0.0.1:30304"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"admin_addPeer","params":["enode://f59c0ab603377b6ec88b89d5bb41b98fc385030ab1e4b03752db6f7dab364559d92c757c13116ae6408d2d33f0138e7812eb8b696b2a22fe3332c4b5127b22a3@127.0.0.1:30304"],"id":1} ``` -# JSON result + + + ```json { @@ -73,7 +79,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_addPeer","params":["enode: } ``` - + + + ### `admin_changeLogLevel` @@ -93,21 +101,25 @@ You can specify only one log level per RPC call. The following example changes the debug level for specified classes to `DEBUG`. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0", "method":"admin_changeLogLevel", "params":["DEBUG", ["org.hyperledger.besu.ethereum.eth.manager","org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.ApiHandler"]], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0", "method":"admin_changeLogLevel", "params":["DEBUG", ["org.hyperledger.besu.ethereum.eth.manager","org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.ApiHandler"]], "id":1} ``` -# JSON result + + + ```json { @@ -117,19 +129,23 @@ curl -X POST --data '{"jsonrpc":"2.0", "method":"admin_changeLogLevel", "params" } ``` - + + + The following example changes the debug level of all logs to `WARN`. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":["WARN"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -140,7 +156,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":[ } ``` -# JSON result + + + ```json { @@ -150,7 +168,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_changeLogLevel","params":[ } ``` - + + + ### `admin_generateLogBloomCache` @@ -188,15 +208,17 @@ Each index file contains 100000 blocks. The last fragment of blocks less than 10 - _boolean_ - indicates acceptance of the request from this call to generate the cache - + -# curl HTTP request + ```bash curl -X POST --data '{jsonrpc":"2.0","method":"admin_generateLogBloomCache", "params":["0x0", "0x10000"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -207,7 +229,9 @@ curl -X POST --data '{jsonrpc":"2.0","method":"admin_generateLogBloomCache", "pa } ``` -# JSON result + + + ```json { @@ -223,7 +247,9 @@ curl -X POST --data '{jsonrpc":"2.0","method":"admin_generateLogBloomCache", "pa } ``` - + + + ### `admin_logsRemoveCache` @@ -247,15 +273,17 @@ You can skip a parameter by using an empty string, `""`. If you specify: `result`: _object_ - `Cache Removed` status or `error`. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_logsRemoveCache","params":["1", "100"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -266,7 +294,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_logsRemoveCache","params": } ``` -# JSON result + + + ```json { @@ -278,7 +308,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_logsRemoveCache","params": } ``` - + + + ### `admin_logsRepairCache` @@ -292,15 +324,17 @@ Repairs cached logs by fixing all segments starting with the specified block num `result`: _object_ - status of the repair request; `Started` or `Already running` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_logsRepairCache","params":["1200"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -311,7 +345,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_logsRepairCache","params": } ``` -# JSON result + + + ```json { @@ -323,7 +359,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_logsRepairCache","params": } ``` - + + + ### `admin_nodeInfo` @@ -355,21 +393,25 @@ If the node is running locally, the host of the `enode` and `listenAddr` display ::: - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1} ``` -# JSON result + + + ```json { @@ -411,7 +453,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id" } ``` - + + + ### `admin_peers` @@ -441,21 +485,25 @@ None - `enode`: _string_ - enode URL of the remote node - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_peers","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"admin_peers","params":[],"id":1} ``` -# JSON result + + + ```json { @@ -485,7 +533,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_peers","params":[],"id":1} } ``` - + + + ### `admin_removePeer` @@ -499,21 +549,25 @@ Removes a [static node](../../how-to/connect/static-nodes.md). `result`: _boolean_ - `true` if peer removed or `false` if peer not a [static node](../../how-to/connect/static-nodes.md) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"admin_removePeer","params":["enode://f59c0ab603377b6ec88b89d5bb41b98fc385030ab1e4b03752db6f7dab364559d92c757c13116ae6408d2d33f0138e7812eb8b696b2a22fe3332c4b5127b22a3@127.0.0.1:30304"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"admin_removePeer","params":["enode://f59c0ab603377b6ec88b89d5bb41b98fc385030ab1e4b03752db6f7dab364559d92c757c13116ae6408d2d33f0138e7812eb8b696b2a22fe3332c4b5127b22a3@127.0.0.1:30304"],"id":1} ``` -# JSON result + + + ```json { @@ -523,7 +577,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"admin_removePeer","params":["eno } ``` - + + + ## `DEBUG` methods @@ -561,15 +617,17 @@ Returns account information at the specified index of the specified block. This example uses an externally owned account address for the `address` parameter. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0xc8df1f061abb4d0c107b2b1a794ade8780b3120e681f723fe55a7be586d95ba6", 0, "0xbcde5374fce5edbc8e2a8697c15331677e6ebf0b"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -584,7 +642,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0xc8 } ``` -# JSON result + + + ```json { @@ -599,19 +659,23 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0xc8 } ``` - + + + This example uses a contract address for the `address` parameter. - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0x2b76b3a2fc44c0e21ea183d06c846353279a7acf12abcc6fb9d5e8fb14ae2f8c", 0, "0x0e0d2c8f7794e82164f11798276a188147fbd415"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -626,7 +690,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0x2b } ``` -# JSON result + + + ```json { @@ -641,7 +707,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountAt","params":["0x2b } ``` - + + + ### `debug_accountRange` @@ -667,15 +735,17 @@ Returns the accounts for a specified block. - `nextKey`: _string_ - hash of the next address if any addresses remain in the state, otherwise zero - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountRange","params":["12345", 0, "0", 5],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -686,7 +756,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountRange","params":["1 } ``` -# JSON result + + + ```json { @@ -705,7 +777,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_accountRange","params":["1 } ``` - + + + ### `debug_batchSendRawTransaction` @@ -725,21 +799,25 @@ Sends a list of [signed transactions](../../how-to/send-transactions.md). This i - `errorMessage`: _string_ - (optional) error message - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_batchSendRawTransaction","params":["0xf868808203e882520894627306090abab3a6e1400e9345bc60c78a8bef57872386f26fc10000801ba0ac74ecfa0e9b85785f042c143ead4780931234cc9a032fce99fab1f45e0d90faa02fd17e8eb433d4ca47727653232045d4f81322619c0852d3fe8ddcfcedb66a43","0x416","0xf868018203e882520894627306090abab3a6e1400e9345bc60c78a8bef57872386f26fc10000801ca0b24ea1bee8fe36984c36acbf80979a4509f23fc17141851e08d505c0df158aa0a00472a05903d4cd7a811bd4d5c59cc105d93f5943f3393f253e92e65fc36e7ce0","0xf868808203e882520894627306090abab3a6e1400e9345bc60c78a8bef5787470de4df820000801ca0f7936b4de04792e3c65095cfbfd1399d231368f5f05f877588c0c8509f6c98c9a01834004dead527c8da1396eede42e1c60e41f38a77c2fd13a6e495479c729b99"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"debug_batchSendRawTransaction","params":["0xf868808203e882520894627306090abab3a6e1400e9345bc60c78a8bef57872386f26fc10000801ba0ac74ecfa0e9b85785f042c143ead4780931234cc9a032fce99fab1f45e0d90faa02fd17e8eb433d4ca47727653232045d4f81322619c0852d3fe8ddcfcedb66a43","0x416","0xf868018203e882520894627306090abab3a6e1400e9345bc60c78a8bef57872386f26fc10000801ca0b24ea1bee8fe36984c36acbf80979a4509f23fc17141851e08d505c0df158aa0a00472a05903d4cd7a811bd4d5c59cc105d93f5943f3393f253e92e65fc36e7ce0","0xf868808203e882520894627306090abab3a6e1400e9345bc60c78a8bef5787470de4df820000801ca0f7936b4de04792e3c65095cfbfd1399d231368f5f05f877588c0c8509f6c98c9a01834004dead527c8da1396eede42e1c60e41f38a77c2fd13a6e495479c729b99"],"id":1} ``` -# JSON result + + + ```json { @@ -768,7 +846,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_batchSendRawTransaction"," } ``` - + + + ### `debug_getBadBlocks` @@ -782,21 +862,25 @@ None `result`: _array_ of _objects_ - list of [block objects](objects.md#block-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getBadBlocks","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```bash {"jsonrpc":"2.0","method":"debug_getBadBlocks","params":[],"id":1} ``` -# JSON result + + + ```json { @@ -893,7 +977,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getBadBlocks","params":[], } ``` - + + + ### `debug_getRawBlock` @@ -907,21 +993,25 @@ Returns the [RLP encoding](https://ethereum.org/en/developers/docs/data-structur `result`: _object_ - RLP-encoded [block object](objects.md#block-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x32026E"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x32026E"],"id":1} ``` -# JSON result + + + ```json { @@ -931,7 +1021,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x } ``` - + + + ### `debug_getRawHeader` @@ -945,15 +1037,17 @@ Returns the [RLP encoding](https://ethereum.org/en/developers/docs/data-structur `result`: _string_ - RLP-encoded block header or `error` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawHeader","params":["0x32026E"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -964,7 +1058,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawHeader","params":["0 } ``` -# JSON result + + + ```json { @@ -974,7 +1070,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawHeader","params":["0 } ``` - + + + ### `debug_getRawReceipts` @@ -990,21 +1088,25 @@ of the transaction receipts of the specified block. `result`: _object_ - array of RLP-encoded [transaction receipts](objects.md#transaction-receipt-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawReceipts","params":["0x32026E"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"debug_getRawReceipts","params":["0x32026E"],"id":1} ``` -# JSON result + + + ```json { @@ -1017,7 +1119,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawReceipts","params":[ } ``` - + + + ### `debug_getRawTransaction` @@ -1032,21 +1136,25 @@ of the specified transaction. `result`: _object_ - RLP-encoded [transaction object](objects.md#transaction-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawTransaction","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"debug_getRawTransaction","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1} ``` -# JSON result + + + ```json { @@ -1056,7 +1164,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawTransaction","params } ``` - + + + ### `debug_metrics` @@ -1080,21 +1190,25 @@ None `result`: _object_ - metrics object - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_metrics","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "debug_metrics", "params": [], "id": 1 } ``` -# JSON result + + + ```json { @@ -1195,7 +1309,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_metrics","params":[],"id": } ``` - + + + ### `debug_replayBlock` @@ -1209,21 +1325,25 @@ Re-imports the block matching the specified block number, by rolling the head of `result`: _string_ - `Success` or `error` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_replayBlock","params":["0x1"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "debug_replayBlock", "params": ["0x1"], "id": 1 } ``` -# JSON result + + + ```json { @@ -1233,7 +1353,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_replayBlock","params":["0x } ``` - + + + ### `debug_resyncWorldstate` @@ -1247,21 +1369,25 @@ None `result`: _string_ - `Success` or `error` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_resyncWorldstate","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "debug_resyncWorldstate", "params": [], "id": 1 } ``` -# JSON result + + + ```json { @@ -1271,7 +1397,9 @@ None } ``` - + + + ### `debug_setHead` @@ -1285,21 +1413,25 @@ Sets the current head of the local chain to the block matching the specified blo `result`: _string_ - `Success` or `error` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_setHead","params":["0x1"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "debug_setHead", "params": ["0x1"], "id": 1 } ``` -# JSON result + + + ```json { @@ -1309,7 +1441,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_setHead","params":["0x1"], } ``` - + + + ### `debug_standardTraceBlockToFile` @@ -1331,16 +1465,18 @@ Use [`debug_standardTraceBadBlockToFile`](#debug_standardtracebadblocktofile) to `result`: _string_ - location of the generated trace files - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBlockToFile","params":["0x2dc0b6c43144e314a86777b4bd4f987c0790a6a0b21560671d221ed81a23f2dc", { "txHash": "0x4ff04c4aec9517721179c8dd435f47fbbfc2ed26cd4926845ab687420d5580a6", "disableMemory": false}], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1357,7 +1493,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBlockToFile", } ``` -# JSON result + + + ```json { @@ -1369,7 +1507,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBlockToFile", } ``` - + + + ### `debug_standardTraceBadBlockToFile` @@ -1385,15 +1525,17 @@ Use [`debug_standardTraceBlockToFile`](#debug_standardtraceblocktofile) to view `result`: _string_ - location of the generated trace files - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBadBlockToFile","params":["0x53741e9e94791466d117c5f9e41a2ed1de3f73d39920c621dfc2f294e7779baa"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1406,7 +1548,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBadBlockToFil } ``` -# JSON result + + + ```json { @@ -1418,7 +1562,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_standardTraceBadBlockToFil } ``` - + + + ### `debug_storageRangeAt` @@ -1442,15 +1588,17 @@ Returns the contract storage for the specified range. `result`: _object_ - [range object](objects.md#range-object). - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_storageRangeAt","params":["0x2b76b3a2fc44c0e21ea183d06c846353279a7acf12abcc6fb9d5e8fb14ae2f8c",0,"0x0e0d2c8f7794e82164f11798276a188147fbd415","0x0000000000000000000000000000000000000000000000000000000000000000",1], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1467,7 +1615,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_storageRangeAt","params":[ } ``` -# JSON result + + + ```json { @@ -1485,6 +1635,10 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_storageRangeAt","params":[ } ``` + + + + ::: ### `debug_traceTransaction` @@ -1509,15 +1663,17 @@ Reruns the transaction with the same state as when the transaction executed. `result`: _object_ - [trace object](objects.md#trace-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0x2cc6c94c21685b7e0f8ddabf277a5ccf98db157c62619cde8baea696a74ed18e",{"disableStorage":true}],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1531,7 +1687,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params" } ``` -# JSON result + + + ```json { @@ -1557,7 +1715,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params" } ``` - + + + ### `debug_traceBlock` @@ -1579,15 +1739,17 @@ Returns full trace of all invoked opcodes of all transactions included in the bl `result`: _object_ - [trace object](objects.md#trace-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlock","params":["0xf90277f90208a05a41d0e66b4120775176c09fcf39e7c0520517a13d2b57b18d33d342df038bfca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794e6a7a1d47ff21b6321162aea7c6cb457d5476bcaa00e0df2706b0a4fb8bd08c9246d472abbe850af446405d9eba1db41db18b4a169a04513310fcb9f6f616972a3b948dc5d547f280849a87ebb5af0191f98b87be598a0fe2bf2a941abf41d72637e5b91750332a30283efd40c424dc522b77e6f0ed8c4b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000860153886c1bbd82b44382520b8252088455c426598b657468706f6f6c2e6f7267a0b48c515a9dde8d346c3337ea520aa995a4738bb595495506125449c1149d6cf488ba4f8ecd18aab215f869f86780862d79883d2000825208945df9b87991262f6ba471f09758cde1c0fc1de734827a69801ca088ff6cf0fefd94db46111149ae4bfc179e9b94721fffd821d38d16464b3f71d0a045e0aff800961cfce805daef7016b9b675c137a6a41a548f7b60a3484c06a33ac0"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1600,7 +1762,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlock","params":["0xf } ``` -# JSON result + + + ```json { @@ -1626,7 +1790,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlock","params":["0xf } ``` - + + + ### `debug_traceBlockByHash` @@ -1648,15 +1814,17 @@ Returns full trace of all invoked opcodes of all transactions included in the bl `result`: _array_ of _objects_ - list of [trace objects](objects.md#trace-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0xaceb3b2c9b25b0589230873921eb894b28722011b8df63977145517d754875a5"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1669,7 +1837,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params" } ``` -# JSON result + + + ```json { @@ -1698,7 +1868,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params" } ``` - + + + ### `debug_traceBlockByNumber` @@ -1720,15 +1892,17 @@ Returns full trace of all invoked opcodes of all transactions included in the bl `result`: _array_ of _objects_ - list of [trace objects](objects.md#trace-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","params":["0x7224",{"disableStorage":true}], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -1739,7 +1913,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","param } ``` -# JSON result + + + ```json { @@ -1768,7 +1944,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","param } ``` - + + + ## `ETH` methods @@ -1800,21 +1978,25 @@ None `result`: _array_ of _strings_ - list of 20-byte account addresses owned by the client - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 53 } ``` -# JSON result + + + ```json { @@ -1824,7 +2006,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":5 } ``` - + + + ### `eth_blockNumber` @@ -1838,21 +2022,25 @@ None `result`: _string_ - hexadecimal integer representing the index corresponding to the block number of the current chain head - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":51}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 51 } ``` -# JSON result + + + ```json { @@ -1862,13 +2050,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{number}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -1878,7 +2070,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{numb } ``` -# GraphQL result + + + ```json { @@ -1890,7 +2084,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{numb } ``` - + + + ### `eth_call` @@ -1916,15 +2112,17 @@ By default, `eth_call` does not fail if the sender account has an insufficient b `result`: _string_ - return value of the executed contract - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13","value":"0x1"}, "latest"],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -1938,7 +2136,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x694 } ``` -# JSON result + + + ```json { @@ -1948,13 +2148,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x694 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {number call (data : {from : \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\", to: \"0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13\", data :\"0x12a7b914\"}){data status}}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -1968,7 +2172,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {num } ``` -# GraphQL result + + + ```json { @@ -1984,21 +2190,25 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block {num } ``` - + + + :::info Example of a simulated contract creation The following example creates a simulated contract by not including the `to` parameter from the [transaction call object](objects.md#transaction-call-object) in the `call` parameter. Besu simulates the data to create the contract. - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "data":"0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005057600080fd5b5061021e806100606000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063445df0ac146100465780638da5cb5b14610064578063fdacd576146100ae575b600080fd5b61004e6100dc565b6040518082815260200191505060405180910390f35b61006c6100e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610107565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806101b76033913960400191505060405180910390fd5b806001819055505056fe546869732066756e6374696f6e206973207265737472696374656420746f2074686520636f6e74726163742773206f776e6572a265627a7a7231582007302f208a10686769509b529e1878bda1859883778d70dedd1844fe790c9bde64736f6c63430005100032","gas":"0x439cf","gasPrice":"0x0"},"latest"],"id":53}' http://127.0.0.1:8545 ``` -# JSON result + + + ```json { @@ -2008,7 +2218,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0xf } ``` - + + + ::: @@ -2024,21 +2236,25 @@ None `result`: _string_ - chain ID in hexadecimal - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":51}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 51 } ``` -# JSON result + + + ```json { @@ -2048,7 +2264,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":51 } ``` - + + + ### `eth_coinbase` @@ -2068,21 +2286,25 @@ None `result`: _string_ - coinbase address - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "eth_coinbase", "params": [], "id": 53 } ``` -# JSON result + + + ```json { @@ -2092,7 +2314,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":5 } ``` - + + + ### `eth_createAccessList` @@ -2113,15 +2337,17 @@ Creates an [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) access list that - `storageKeys`: _array_ - storage keys to be accessed by the transaction - `gasUsed`: _string_ - approximate gas cost for the transaction if the access list is included - + -# curl HTTP + ```bash curl -X POST --data '{"method":"eth_createAccessList","params":[{"from": "0xaeA8F8f781326bfE6A7683C2BD48Dd6AA4d3Ba63", "data": "0x608060806080608155"}, "pending"],"id":1,"jsonrpc":"2.0"}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2138,7 +2364,9 @@ curl -X POST --data '{"method":"eth_createAccessList","params":[{"from": "0xaeA8 } ``` -# JSON result + + + ```json { @@ -2154,7 +2382,9 @@ curl -X POST --data '{"method":"eth_createAccessList","params":[{"from": "0xaeA8 } ``` - + + + ### `eth_estimateGas` @@ -2176,15 +2406,17 @@ For `eth_estimateGas`, all fields are optional because setting a gas limit is ir The following example returns an estimate of 21000 wei (`0x5208`) for the transaction. - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{"from":"0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73","to":"0x44Aa93095D6749A706051658B970b941c72c1D53","value":"0x1"}],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2201,7 +2433,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{"fro } ``` -# JSON result + + + ```json { @@ -2211,13 +2445,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{"fro } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{estimateGas (data: {from :\"0x6295ee1b4f6dd65047762f924ecd367c17eabf8f\", to :\"0x8888f1f195afa192cfee860698584c030f4c9db1\"})}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2227,7 +2465,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{esti } ``` -# GraphQL result + + + ```json { @@ -2239,13 +2479,15 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block{esti } ``` - + + + The following example request estimates the cost of deploying a simple storage smart contract to the network. The data field contains the hash of the compiled contract you want to deploy. (You can get the compiled contract hash from your IDE, for example, **Remix > Compile tab > details > WEB3DEPLOY**.) The result is 113355 wei. - + -# curl HTTP request + ```bash curl -X POST \ @@ -2262,7 +2504,9 @@ http://127.0.0.1:8545 \ }' ``` -# JSON result + + + ```json { @@ -2272,7 +2516,9 @@ http://127.0.0.1:8545 \ } ``` - + + + ### `eth_feeHistory` @@ -2290,15 +2536,17 @@ Returns base fee per gas and transaction effective priority fee per gas history `result`: _object_ - [Fee history results object](objects.md#fee-history-results-object). - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_feeHistory","params": ["0x5", "latest", [20,30]],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2309,7 +2557,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_feeHistory","params": ["0x5" } ``` -# JSON result + + + ```json { @@ -2340,7 +2590,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_feeHistory","params": ["0x5" } ``` - + + + ### `eth_gasPrice` @@ -2358,21 +2610,25 @@ None `result`: _string_ - percentile gas unit price for the most recent blocks, in Wei, as a hexadecimal value - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 53 } ``` -# JSON result + + + ```json { @@ -2382,13 +2638,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":5 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{gasPrice}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2396,7 +2656,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{gasPrice}" } ``` -# GraphQL result + + + ```json { @@ -2406,7 +2668,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{gasPrice}" } ``` - + + + ### `eth_getBalance` @@ -2422,15 +2686,17 @@ Returns the account balance of the specified address. `result`: _string_ - current balance, in Wei, as a hexadecimal value - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "latest"],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2441,7 +2707,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xfe3 } ``` -# JSON result + + + ```json { @@ -2451,13 +2719,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xfe3 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ account ( address: \"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73\") { balance } }"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2467,7 +2739,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ account ( } ``` -# GraphQL result + + + ```json { @@ -2479,7 +2753,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ account ( } ``` - + + + ### `eth_getBlockByHash` @@ -2495,15 +2771,17 @@ Returns information about the block matching the specified block hash. `result`: _object_ - [block object](objects.md#block-object), or `null` when there is no block - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c", false],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2517,7 +2795,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0 } ``` -# JSON result + + + ```json { @@ -2552,13 +2832,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block (hash : \"0xb0efed1fc9326fee967cb2d845d4ebe57c5350a0670c8e86f8052dea6f219f92\") {number transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2587,7 +2871,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block (has } ``` -# GraphQL result + + + ```json { @@ -2617,7 +2903,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block (has } ``` - + + + ### `eth_getBlockByNumber` @@ -2633,15 +2921,17 @@ Returns information about the block matching the specified block number. `result`: _object_ - [block object](objects.md#block-object), or `null` when there is no block. - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x68B3", true],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2652,7 +2942,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":[ } ``` -# JSON result + + + ```json { @@ -2684,13 +2976,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":[ } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block (number : 100) {transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot ommers{hash} ommerAt(index : 1){hash} miner{address} account(address: \"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73\"){balance} parent{hash} }}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2733,7 +3029,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block (num } ``` -# GraphQL result + + + ```json { @@ -2773,7 +3071,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block (num } ``` - + + + ### `eth_getBlockTransactionCountByHash` @@ -2787,15 +3087,17 @@ Returns the number of transactions in the block matching the specified block has `result`: _number_ - integer representing the number of transactions in the specified block, or `null` if no matching block hash is found - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2808,7 +3110,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHa } ``` -# JSON result + + + ```json { @@ -2818,13 +3122,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHa } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash:\"0xe455c14f757b0b9b67774baad1be1c180a4c1657df52259dbb685bf375408097\"){transactionCount}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2834,7 +3142,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash } ``` -# GraphQL result + + + ```json { @@ -2846,7 +3156,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash } ``` - + + + ### `eth_getBlockTransactionCountByNumber` @@ -2860,15 +3172,17 @@ Returns the number of transactions in a block matching the specified block numbe `result`: _string_ - integer representing the number of transactions in the specified block, or `null` if no matching block number is found - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["0xe8"],"id":51}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2879,7 +3193,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNu } ``` -# JSON result + + + ```json { @@ -2889,13 +3205,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNu } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(number:232){transactionCount}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2905,7 +3225,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(numb } ``` -# GraphQL result + + + ```json { @@ -2917,7 +3239,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(numb } ``` - + + + ### `eth_getCode` @@ -2933,15 +3257,17 @@ Returns the code of the smart contract at the specified address. Besu stores com `result`: _data_ - code stored at the specified address - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa50a51c09a5c451c52bb714527e1974b686d8e77", "latest"],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -2952,7 +3278,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa50a51 } ``` -# JSON result + + + ```json { @@ -2962,13 +3290,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa50a51 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{"query": "{account(address: \"0xa50a51c09a5c451c52bb714527e1974b686d8e77\"){ code }}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -2978,7 +3310,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{account(add } ``` -# GraphQL result + + + ```json { @@ -2990,7 +3324,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{account(add } ``` - + + + ### `eth_getFilterChanges` @@ -3010,15 +3346,17 @@ Polls the specified filter and returns an array of changes that have occurred si - For filters created with `eth_newFilter`, returns [log objects](objects.md#log-object). - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["0xf8bf5598d9e04fbe84523d42640b9b0e"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -3029,7 +3367,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":[ } ``` -# JSON result + + + ```json title="Example result from a filter created with eth_newBlockFilter" { @@ -3089,7 +3429,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":[ } ``` - + + + ### `eth_getFilterLogs` @@ -3111,15 +3453,17 @@ Leave the [`--auto-log-bloom-caching-enabled`](../cli/options.md#auto-log-bloom- `result`: _array_ of _objects_ - list of [log objects](objects.md#log-object) - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x5ace5de3985749b6a1b2b0d3f3e1fb69"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -3130,7 +3474,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x } ``` -# JSON result + + + ```json { @@ -3167,7 +3513,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x } ``` - + + + ### `eth_getLogs` @@ -3189,15 +3537,17 @@ Using `eth_getLogs` to get logs from a large range of blocks, especially an enti `result`: _array_ of _objects_ - list of [log objects](objects.md#log-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlock":"earliest", "toBlock":"latest", "address": "0x2e1f232a9439c3d459fceca0beef13acc8259dd8", "topics":[]}], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3215,7 +3565,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlo } ``` -# JSON result + + + ```json { @@ -3252,13 +3604,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlo } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{"query": "{logs(filter:{fromBlock: 1486000, toBlock: 1486010, addresses: [\"0x7ef66b77759e12caf3ddb3e4aff524e577c59d8d\"], topics: [[\"0x8a22ee899102a366ac8ad0495127319cb1ff2403cfae855f83a89cda1266674d\"]]}) {index topics data account{address} transaction{hash} }}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -3276,7 +3632,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{logs(filter } ``` -# GraphQL result + + + ```json { @@ -3317,7 +3675,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{logs(filter } ``` - + + + ### `eth_getMinerDataByBlockHash` @@ -3331,15 +3691,17 @@ Returns miner data for the specified block. `result`: _object_ - [miner data object](objects.md#miner-data-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getMinerDataByBlockHash","params": ["0xbf137c3a7a1ebdfac21252765e5d7f40d115c2757e4a4abee929be88c624fdb7"],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3352,7 +3714,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getMinerDataByBlockHash","p } ``` -# JSON result + + + ```json { @@ -3377,7 +3741,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getMinerDataByBlockHash","p } ``` - + + + ### `eth_getMinerDataByBlockNumber` @@ -3391,15 +3757,17 @@ Returns miner data for the specified block. `result`: _object_ - [miner data object](objects.md#miner-data-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getMinerDataByBlockNumber","params": ["0x7689D2"],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3410,7 +3778,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getMinerDataByBlockNumber", } ``` -# JSON result + + + ```json { @@ -3435,7 +3805,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getMinerDataByBlockNumber", } ``` - + + + ### `eth_getProof` @@ -3473,16 +3845,18 @@ The API allows IoT devices or mobile apps which are unable to run light clients - `proof`: _array_ of _strings_ - list of RLP-encoded Merkle tree nodes, starting with the `storageHash` - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getProof","params": [ "0a8156e7ee392d885d10eaa86afd0e323afdcd95", ["0x0000000000000000000000000000000000000000000000000000000000000347"], "latest"],"id": 1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3497,7 +3871,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getProof","params": [ } ``` -# JSON result + + + ```json { @@ -3530,7 +3906,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getProof","params": [ } ``` - + + + ### `eth_getStorageAt` @@ -3550,15 +3928,17 @@ Returns the value of a storage position at a specified address. Calculating the correct position depends on the storage you want to retrieve. - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getStorageAt","params": ["0x‭3B3F3E‬","0x0","latest"],"id": 53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3569,7 +3949,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getStorageAt","params": ["0 } ``` -# JSON result + + + ```json { @@ -3579,13 +3961,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method": "eth_getStorageAt","params": ["0 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{account(address: \"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73\") {storage(slot: \"0x04\")}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -3595,7 +3981,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{account(ad } ``` -# GraphQL result + + + ```json { @@ -3607,7 +3995,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{account(ad } ``` - + + + ### `eth_getTransactionByBlockHashAndIndex` @@ -3623,15 +4013,17 @@ Returns transaction information for the specified block hash and transaction ind `result`: _object_ - [transaction object](objects.md#transaction-object), or `null` when there is no transaction - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0xbf137c3a7a1ebdfac21252765e5d7f40d115c2757e4a4abee929be88c624fdb7", "0x2"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3645,7 +4037,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAnd } ``` -# JSON result + + + ```json { @@ -3671,13 +4065,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAnd } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{"query": "{ block(hash: \"0x9270651f9c6fa36232c379d0ecf69b519383aa275815a65f1e03114346668f69\") { transactionAt(index: 0) {block{hash} hash } } }"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -3692,7 +4090,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{ block(hash } ``` -# GraphQL result + + + ```json { @@ -3709,7 +4109,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{ block(hash } ``` - + + + ### `eth_getTransactionByBlockNumberAndIndex` @@ -3725,17 +4127,19 @@ Returns transaction information for the specified block number and transaction i `result`: _object_ - [transaction object](objects.md#transaction-object), or `null` when there is no transaction - - This request returns the third transaction in the 82990 block on the Ropsten testnet. You can also view this [block](https://ropsten.etherscan.io/txs?block=82990) and [transaction] on Etherscan. -# curl HTTP + + + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["82990", "0x2"], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3746,7 +4150,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberA } ``` -# JSON result + + + ```json { @@ -3772,13 +4178,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberA } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{"query": "{block(number:20303) {transactionAt(index: 0) {block{hash} hash}}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -3793,7 +4203,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{block(numbe } ``` -# GraphQL result + + + ```json { @@ -3810,7 +4222,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{block(numbe } ``` - + + + ### `eth_getTransactionByHash` @@ -3824,15 +4238,17 @@ Returns transaction information for the specified transaction hash. `result`: _object_ - [transaction object](objects.md#transaction-object), or `null` when there is no transaction - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44"],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3845,7 +4261,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","param } ``` -# JSON result + + + ```json { @@ -3871,13 +4289,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","param } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{"query": "{transaction(hash : \"0x03d80b9ca0a71435399a268609d6d7896f7155d2147cc22b780672bcb59b170d\") { block{hash} gas gasPrice hash nonce value from {address} to {address} status}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -3901,7 +4323,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{transaction } ``` -# GraphQL result + + + ```json { @@ -3927,7 +4351,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{transaction } ``` - + + + ### `eth_getTransactionCount` @@ -3943,15 +4369,17 @@ Returns the number of transactions sent from a specified address. Use the `pendi `result`: _string_ - integer representing the number of transactions sent from the specified address - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0xc94770007dda54cF92009BFF0dE90c06F603a09f","latest"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -3962,7 +4390,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params } ``` -# JSON result + + + ```json { @@ -3972,13 +4402,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ account (address:\"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73\"){transactionCount}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -3988,7 +4422,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ account ( } ``` -# GraphQL result + + + ```json { @@ -4000,7 +4436,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ account ( } ``` - + + + ### `eth_getTransactionReceipt` @@ -4016,15 +4454,17 @@ If you enabled [revert reason](../../../private-networks/how-to/send-transaction `result`: _object_ - [transaction receipt object](objects.md#transaction-receipt-object), or `null` when there is no receipt - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x504ce587a65bdbdb6414a0c6c16d86a04dd79bfcc4f2950eec9634b30ce5370f"],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -4037,7 +4477,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","para } ``` -# JSON result + + + ```json { @@ -4061,13 +4503,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","para } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{"query": "{transaction(hash: \"0x5f5366af89e8777d5ae62a1af94a0876bdccbc22417bed0aff361eefa3e37f86\") {block{hash logsBloom} hash createdContract{address} cumulativeGasUsed gas gasUsed logs{topics} from{address} to{address} index}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -4097,7 +4543,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{transaction } ``` -# GraphQL result + + + ```json { @@ -4126,7 +4574,9 @@ curl -X POST -H "Content-Type: application/json" --data '{"query": "{transaction } ``` - + + + ### `eth_getUncleByBlockHashAndIndex` @@ -4148,15 +4598,17 @@ Uncles don't contain individual transactions. ::: - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex","params":["0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7", "0x0"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -4170,7 +4622,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex" } ``` -# JSON result + + + ```json { @@ -4200,13 +4654,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex" } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash:\"0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7\"){ ommerAt(index: 0) {difficulty extraData gasLimit gasUsed hash logsBloom mixHash nonce number receiptsRoot stateRoot timestamp totalDifficulty transactionsRoot}}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -4231,7 +4689,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash } ``` -# GraphQL result + + + ```json { @@ -4256,7 +4716,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash } ``` - + + + ### `eth_getUncleByBlockNumberAndIndex` @@ -4278,15 +4740,17 @@ Uncles do not contain individual transactions. ::: - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleByBlockNumberAndIndex","params":["0x7689D2", "0x0"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -4297,7 +4761,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleByBlockNumberAndInde } ``` -# JSON result + + + ```json { @@ -4327,13 +4793,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleByBlockNumberAndInde } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(number:2587){ ommerAt(index: 0) {difficulty extraData gasLimit gasUsed hash logsBloom mixHash nonce number receiptsRoot stateRoot timestamp totalDifficulty transactionsRoot}}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -4358,7 +4828,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(numb } ``` -# GraphQL result + + + ```json { @@ -4370,7 +4842,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(numb } ``` - + + + ### `eth_getUncleCountByBlockHash` @@ -4384,15 +4858,17 @@ Returns the number of uncles in a block from a block matching the given block ha `result`: _string_ - integer representing the number of uncles in the specified block - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -4405,7 +4881,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","p } ``` -# JSON result + + + ```json { @@ -4415,13 +4893,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","p } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash:\"0x65c08d792e4192b9ece6b6f2390da7da464208b22d88490be8add9373917b426\"){ommerCount}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -4431,7 +4913,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash } ``` -# GraphQL result + + + ```json { @@ -4443,7 +4927,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(hash } ``` - + + + ### `eth_getUncleCountByBlockNumber` @@ -4457,15 +4943,17 @@ Returns the number of uncles in a block matching the specified block number. `result`: _string_ - integer representing the number of uncles in the specified block - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params":["0xe8"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -4476,7 +4964,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber", } ``` -# JSON result + + + ```json { @@ -4486,13 +4976,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber", } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(number:\"0x59fd\"){ommerCount}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -4502,7 +4996,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(numb } ``` -# GraphQL result + + + ```json { @@ -4514,7 +5010,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{block(numb } ``` - + + + ### `eth_getWork` @@ -4536,21 +5034,25 @@ None - `blockNumber`: _string_ - hexadecimal integer representing the current block number - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getWork","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "eth_getWork", "params": [], "id": 1 } ``` -# JSON result + + + ```json { @@ -4565,7 +5067,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getWork","params":[],"id":1} } ``` - + + + ### `eth_hashrate` @@ -4581,21 +5085,25 @@ None `result`: _string_ - number of hashes per second - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":1} ``` -# JSON result + + + ```json { @@ -4605,7 +5113,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":1 } ``` - + + + ### `eth_mining` @@ -4619,21 +5129,25 @@ None `result`: _boolean_ - indicates if the client is actively mining new blocks - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_mining","params":[],"id":53}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "eth_mining", "params": [], "id": 53 } ``` -# JSON result + + + ```json { @@ -4643,7 +5157,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_mining","params":[],"id":53} } ``` - + + + ### `eth_newBlockFilter` @@ -4657,21 +5173,25 @@ None `result`: _string_ - filter ID - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { "jsonrpc": "2.0", "method": "eth_newBlockFilter", "params": [], "id": 1 } ``` -# JSON result + + + ```json { @@ -4681,7 +5201,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[], } ``` - + + + ### `eth_newFilter` @@ -4701,15 +5223,17 @@ Creates a [log filter](../../concepts/events-and-logs.md). To poll for logs asso `result`: _string_ - filter ID - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock":"earliest", "toBlock":"latest", "topics":[]}],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -4720,7 +5244,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromB } ``` -# JSON result + + + ```json { @@ -4730,7 +5256,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromB } ``` - + + + ### `eth_newPendingTransactionFilter` @@ -4744,15 +5272,17 @@ None `result`: _string_ - filter ID - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -4763,7 +5293,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter" } ``` -# JSON result + + + ```json { @@ -4773,7 +5305,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter" } ``` - + + + ### `eth_protocolVersion` @@ -4787,21 +5321,25 @@ None `result`: _string_ - Ethereum protocol version - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 } ``` -# JSON result + + + ```json { @@ -4811,13 +5349,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[] } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{protocolVersion}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -4825,7 +5367,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{protocolVe } ``` -# GraphQL result + + + ```json { @@ -4835,7 +5379,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{protocolVe } ``` - + + + ### `eth_sendRawTransaction` @@ -4867,15 +5413,17 @@ Besu doesn't implement [`eth_sendTransaction`](../../how-to/send-transactions.md `result`: _string_ - 32-byte transaction hash - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { @@ -4888,7 +5436,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params" } ``` -# JSON result + + + ```json { @@ -4898,13 +5448,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params" } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "mutation {sendRawTransaction(data: \"0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833\")}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text mutation { @@ -4912,7 +5466,9 @@ mutation { } ``` -# GraphQL result + + + ```json { @@ -4922,7 +5478,9 @@ mutation { } ``` - + + + ### `eth_submitHashrate` @@ -4938,15 +5496,17 @@ Submits the mining hashrate. This is used by mining software such as [Ethminer]( `result`: _boolean_ - indicates if submission is successful - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0", "method":"eth_submitHashrate", "params":["0x0000000000000000000000000000000000000000000000000000000000500000", "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -4960,7 +5520,9 @@ curl -X POST --data '{"jsonrpc":"2.0", "method":"eth_submitHashrate", "params":[ } ``` -# JSON result + + + ```json { @@ -4970,7 +5532,9 @@ curl -X POST --data '{"jsonrpc":"2.0", "method":"eth_submitHashrate", "params":[ } ``` - + + + ### `eth_submitWork` @@ -4988,21 +5552,25 @@ Submits a proof of work (Ethash) solution. This is used by mining software such `result`: _boolean_ - indicates if the provided solution is valid - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0", "method":"eth_submitWork", "params":["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1GE5700000000000000000000000000D1GE5700000000000000000000000000"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```bash {"jsonrpc":"2.0", "method":"eth_submitWork", "params":["0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1GE5700000000000000000000000000D1GE5700000000000000000000000000"],"id":73} ``` -# JSON result + + + ```json { @@ -5012,7 +5580,9 @@ curl -X POST --data '{"jsonrpc":"2.0", "method":"eth_submitWork", "params":["0x0 } ``` - + + + ### `eth_syncing` @@ -5042,21 +5612,25 @@ None - `knownStates`: _string_ - if fast synchronizing, the number of states the node knows of so far, or `null` if this is not known or not relevant (if full synchronizing or fully synchronized, this field is not returned.) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":51}' http://127.0.0.1:8545 ``` -# wscat WS + + + ```json { "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 51 } ``` -# JSON result + + + ```json { @@ -5072,13 +5646,17 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":51 } ``` -# curl GraphQL + + + ```bash curl -X POST -H "Content-Type: application/json" --data '{ "query": "{syncing{startingBlock currentBlock highestBlock pulledStates knownStates}}"}' http://localhost:8547/graphql ``` -# GraphQL + + + ```text { @@ -5092,7 +5670,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{syncing{st } ``` -# GraphQL result + + + ```json { @@ -5108,7 +5688,9 @@ curl -X POST -H "Content-Type: application/json" --data '{ "query": "{syncing{st } ``` - + + + ### `eth_uninstallFilter` @@ -5124,15 +5706,17 @@ Filters time out when not requested by [`eth_getFilterChanges`](#eth_getfilterch `result`: _boolean_ - indicates if the filter is successfully uninstalled - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":["0x70355a0b574b437eaa19fe95adfedc0a"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -5143,7 +5727,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":[" } ``` -# JSON result + + + ```json { @@ -5153,7 +5739,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":[" } ``` - + + + ## `MINER` methods @@ -5177,15 +5765,17 @@ Updates the target gas limit set using the [`--target-gas-limit`](../cli/options `result`: _string_ - `Success` or `error` - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"miner_changeTargetGasLimit","params":[800000], "id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -5196,7 +5786,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_changeTargetGasLimit","par } ``` -# JSON result + + + ```json { @@ -5206,7 +5798,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_changeTargetGasLimit","par } ``` - + + + ### `miner_setCoinbase` @@ -5226,15 +5820,17 @@ You can also use `miner_setEtherbase` as an alternative method. They both work t `result`: _boolean_ - `true` when address is set - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73"],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request + + + ```json { @@ -5245,7 +5841,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["0x } ``` -# JSON result + + + ```json { @@ -5255,7 +5853,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["0x } ``` - + + + ### `miner_start` @@ -5269,248 +5869,41 @@ None `result`: _boolean_ - `true` if mining starts, or if the node is already mining - + -# curl HTTP request + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start","params":[],"id":1}' http://127.0.0.1:8545 ``` -# wscat WS request - -```json -{ "jsonrpc": "2.0", "method": "miner_start", "params": [], "id": 1 } -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": true -} -``` - - - -### `miner_stop` - -Stops the mining process on the client. - -#### Parameters - -None - -#### Returns - -`result`: _boolean_ - `true` if mining stops, or if the node is not mining - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"miner_stop","params":[],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request + -```json -{ "jsonrpc": "2.0", "method": "miner_stop", "params": [], "id": 1 } -``` - -# JSON result + ```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": true -} -``` - - - -## `NET` methods - -The `NET` API methods provide network-related information. - -### `net_enode` - -Returns the [enode URL](../../concepts/node-keys.md#enode-url). - -#### Parameters - -None - -#### Returns - -`result`: _string_ - [enode URL](../../concepts/node-keys.md#enode-url) of the node - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"net_enode","params":[],"id":1}' http://127.0.0.1:8545 +{ "jsonrpc": "2.0", "method": "miner_start", "params": [], "id": 1 } ``` -# wscat WS request - -```bash -{"jsonrpc":"2.0","method":"net_enode","params":[],"id":1} -``` + -# JSON result + ```json { "jsonrpc": "2.0", "id": 1, - "result": "enode://6a63160d0ccef5e4986d270937c6c8d60a9a4d3b25471cda960900d037c61988ea14da67f69dbfb3497c465d0de1f001bb95598f74b68a39a5156a608c42fa1b@127.0.0.1:30303" -} -``` - - - -### `net_listening` - -Whether the client is actively listening for network connections. - -#### Parameters - -None - -#### Returns - -`result`: _boolean_ - indicates if the client is actively listening for network connections - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":53}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```bash -{"jsonrpc":"2.0","method":"net_listening","params":[],"id":53} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 53, "result": true } ``` - - -### `net_peerCount` - -Returns the number of peers currently connected to the client. - -#### Parameters - -None - -#### Returns - -`result`: _string_ - number of connected peers in hexadecimal - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":53}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ "jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 53 } -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 53, - "result": "0x5" -} -``` - - - -### `net_services` - -Returns enabled services (for example, `jsonrpc`) and the host and port for each service. - -:::note - -The [`--nat-method`](../cli/options.md#nat-method) setting affects the JSON-RPC and P2P host and port values, but not the metrics host and port values. - -::: - -#### Parameters - -None - -#### Returns - -`result`: _object_ - enabled services - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"net_services","params":[],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```bash -{"jsonrpc":"2.0","method":"net_services","params":[],"id":1} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "jsonrpc": { - "host": "127.0.0.1", - "port": "8545" - }, - "p2p": { - "host": "127.0.0.1", - "port": "30303" - }, - "metrics": { - "host": "127.0.0.1", - "port": "9545" - } - } -} -``` + - + -### `net_version` +### `miner_stop` -Returns the [network ID](../../concepts/network-and-chain-id.md). +Stops the mining process on the client. #### Parameters @@ -5518,1222 +5911,4 @@ None #### Returns -`result`: _string_ - current network ID - -| Network ID | Chain | Network | Description | -| ---------- | ----- | ------- | ----------------------------- | -| `1` | ETH | Mainnet | Main Ethereum network | -| `5` | ETH | Goerli | PoS test network | -| `11155111` | ETH | Sepolia | PoS test network | -| `2018` | ETH | Dev | PoW development network | -| `1` | ETC | Classic | Main Ethereum Classic network | -| `7` | ETC | Mordor | PoW test network | - -:::note - -For almost all networks, network ID and chain ID are the same. - -The only networks in the table above with different network and chain IDs are Classic with a chain ID of `61` and Mordor with a chain ID of `63`. - -::: - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":53}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 53 } -``` - -# JSON result for Mainnet - -```json -{ - "jsonrpc": "2.0", - "id": 51, - "result": "1" -} -``` - -# JSON result for Goerli - -```json -{ - "jsonrpc": "2.0", - "id": 53, - "result": "5" -} -``` - - - -## `PLUGINS` methods - -The `PLUGINS` API methods provide plugin-related functionality. - -:::note - -The `PLUGINS` API methods are not enabled by default for JSON-RPC. To enable the `PLUGINS` API methods, use the [`--rpc-http-api`](../cli/options.md#rpc-http-api) or [`--rpc-ws-api`](../cli/options.md#rpc-ws-api) options. - -::: - -### `plugins_reloadPluginConfig` - -Reloads specified plugin configuration. - -#### Parameters - -`plugin`: _string_ - plugin - -#### Returns - -`result`: _string_ - `Success` - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"plugins_reloadPluginConfig","params":["tech.pegasys.plus.plugin.kafka.KafkaPlugin"],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "plugins_reloadPluginConfig", - "params": ["tech.pegasys.plus.plugin.kafka.KafkaPlugin"], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "Success" -} -``` - - - -## `TRACE` methods - -The `TRACE` API is a more concise alternative to the [`DEBUG` API](#debug-methods). - -:::note - -The `TRACE` API methods are not enabled by default for JSON-RPC. To enable the `TRACE` API methods, use the [`--rpc-http-api`](../cli/options.md#rpc-http-api) or [`--rpc-ws-api`](../cli/options.md#rpc-ws-api) options. - -::: - -### `trace_block` - -Provides transaction processing of [type `trace`](../trace-types.md#trace) for the specified block. - -:::tip - -Your node must be an archive node (that is, synchronized without pruning or fast sync) or the requested block must be within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -`blockNumber`: _string_ - hexadecimal or decimal integer representing a block number or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter) - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in transaction execution order; if revert reason is enabled with [`--revert-reason-enabled`](../cli/options.md#revert-reason-enabled), the returned list items include the [revert reason](../../../private-networks/how-to/send-transactions/revert-reason.md). - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"trace_block","params":["0x6"],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ "jsonrpc": "2.0", "method": "trace_block", "params": ["0x6"], "id": 1 } -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": [ - { - "action": { - "callType": "call", - "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "gas": "0xffad82", - "input": "0x0000000000000000000000000000000000000999", - "to": "0x0020000000000000000000000000000000000000", - "value": "0x0" - }, - "blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd", - "blockNumber": 6, - "result": { - "gasUsed": "0x7536", - "output": "0x" - }, - "subtraces": 1, - "traceAddress": [], - "transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e", - "transactionPosition": 0, - "type": "call" - }, - { - "action": { - "address": "0x0020000000000000000000000000000000000000", - "balance": "0x300", - "refundAddress": "0x0000000000000999000000000000000000000000" - }, - "blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd", - "blockNumber": 6, - "result": null, - "subtraces": 0, - "traceAddress": [0], - "transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e", - "transactionPosition": 0, - "type": "suicide" - }, - { - "action": { - "author": "0x0000000000000000000000000000000000000000", - "rewardType": "block", - "value": "0x1bc16d674ec80000" - }, - "blockHash": "0x71512d31e18f828cef069a87bc2c7514a8ca334f9ee72625efdf5cc2d43768dd", - "blockNumber": 6, - "result": null, - "subtraces": 0, - "traceAddress": [], - "transactionHash": null, - "transactionPosition": null, - "type": "reward" - } - ], - "id": 1 -} -``` - - - -### `trace_call` - -Executes the given call and returns a number of possible traces for it. - -:::info - -The requested transaction must be contained in a block within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -- `call`: _object_ - [transaction call object](objects.md#transaction-call-object) - -- `blockNumber`: _string_ - hexadecimal or decimal integer representing a block number or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter) - -- `options`: _array_ of _strings_ - list of tracing options; tracing options are [`trace`, `vmTrace`, and `stateDiff`](../trace-types.md). Specify any combination of the three options including none of them. - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in transaction execution order - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"trace_call","params":[{"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","to":"0x0010000000000000000000000000000000000000","gas":"0xfffff2","gasPrice":"0xef","value":"0x0","data":"0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002","nonce":"0x0"},["trace"],"latest"],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "trace_call", - "params": [ - { - "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "to": "0x0010000000000000000000000000000000000000", - "gas": "0xfffff2", - "gasPrice": "0xef", - "value": "0x0", - "data": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002", - "nonce": "0x0" - }, - ["trace"], - "latest" - ], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": { - "output" : "0x", - "stateDiff" : null, - "trace" : [ { - "action" : { - "callType" : "call", - "from" : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "gas" : "0xffabba", - "input" : "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002", - "to" : "0x0010000000000000000000000000000000000000", - "value" : "0x0" - }, - "result" : { - "gasUsed" : "0x9c58", - "output" : "0x" - }, - "subtraces" : 0, - "traceAddress" : [ ], - "type" : "call" - } ], - "vmTrace" : null - }, -"id" : 2 -}, -``` - - - -### `trace_callMany` - -Performs multiple call traces on top of the same block. You can trace dependent transactions. - -:::info - -The requested block must be within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -- `options`: _array_ of _strings_ - list of tracing options; tracing options are [`trace`, `vmTrace`, and `stateDiff`](../trace-types.md). Specify any combination of the three options including none of them. - -- `blockNumber`: _string_ - hexadecimal or decimal integer representing a block number or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter) - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in transaction execution order - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"trace_callMany","params":[[[{"from":"0x407d73d8a49eeb85d32cf465507dd71d507100c1","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","value":"0x186a0"},["trace"]],[{"from":"0x407d73d8a49eeb85d32cf465507dd71d507100c1","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","value":"0x186a0"},["trace"]]],"latest"],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{"jsonrpc":"2.0","method":"trace_callMany","params":[[[{"from":"0x407d73d8a49eeb85d32cf465507dd71d507100c1","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","value":"0x186a0"},["trace"]],[{"from":"0x407d73d8a49eeb85d32cf465507dd71d507100c1","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","value":"0x186a0"},["trace"]]],"latest"],"latest"],"id":1} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": [ - { - "output" : "0x", - "stateDiff" : null, - "trace" : [ { - "action" : { - "callType" : "call", - "from" : "0x407d73d8a49eeb85d32cf465507dd71d507100c1", - "gas" : "0x1dcd12f8", - "input" : "0x", - "to" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "value" : "0x186a0" - }, - "result" : { - "gasUsed" : "0x0", - "output" : "0x" - }, - "subtraces" : 0, - "traceAddress" : [ ], - "type" : "call" - } ], - "vmTrace" : null - }, - { - "output" : "0x", - "stateDiff" : null, - "trace" : [ { - "action" : { - "callType" : "call", - "from" : "0x407d73d8a49eeb85d32cf465507dd71d507100c1", - "gas" : "0x1dcd12f8", - "input" : "0x", - "to" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "value" : "0x186a0" - }, - "result" : { - "gasUsed" : "0x0", - "output" : "0x" - }, - "subtraces" : 0, - "traceAddress" : [ ], - "type" : "call" - } ], - "vmTrace" : null - }, - ], -"id" : 1 -}, -``` - - - -### `trace_filter` - -Returns traces matching the specified filter. - -:::info - -Your node must be an archive node (that is, synchronized without pruning or fast sync) or the requested block must be within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -`traceFilterOptions`: _object_ - [trace filter options object](objects.md#trace-filter-options-object) - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in transaction execution order - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"trace_filter","params":[{"fromBlock":"0x1","toBlock":"0x21","after":2,"count":2,"fromAddress":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"]}],"id":415}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "trace_filter", - "params": [ - { - "fromBlock": "0x1", - "toBlock": "0x21", - "after": 2, - "count": 2, - "fromAddress": ["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"] - } - ], - "id": 415 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": [ - { - "action": { - "callType": "call", - "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "gas": "0xffad82", - "input": "0x0000000000000000000000000000000000000999", - "to": "0x0020000000000000000000000000000000000000", - "value": "0x0" - }, - "blockHash": "0xcd5d9c7acdcbd3fb4b24a39e05a38e32235751bb0c9e4f1aa16dc598a2c2a9e4", - "blockNumber": 6, - "result": { - "gasUsed": "0x7536", - "output": "0x" - }, - "subtraces": 1, - "traceAddress": [], - "transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e", - "transactionPosition": 0, - "type": "call" - }, - { - "action": { - "callType": "call", - "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "gas": "0xffad52", - "input": "0xf000000000000000000000000000000000000000000000000000000000000001", - "to": "0x0030000000000000000000000000000000000000", - "value": "0x0" - }, - "blockHash": "0xeed85fe57db751442c826cfe4fdf43b10a5c2bc8b6fd3a8ccced48eb3fb35885", - "blockNumber": 7, - "result": { - "gasUsed": "0x1b", - "output": "0xf000000000000000000000000000000000000000000000000000000000000002" - }, - "subtraces": 0, - "traceAddress": [], - "transactionHash": "0x47f4d445ea1812cb1ddd3464ab23d2bfc6ed408a8a9db1c497f94e8e06e85286", - "transactionPosition": 0, - "type": "call" - } - ], - "id": 415 -} -``` - - - -### `trace_get` - -Returns trace at given position. - -:::info - -Your node must be an archive node (that is, synchronized without pruning or fast sync) or the requested transaction must be contained in a block within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -- `transaction`: _string_ - transaction hash - -- `indexPositions`: _array_ - Index positions of the traces - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in the order called by the transaction - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"trace_get","params":["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",["0x0"]],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "trace_get", - "params": [ - "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3", - ["0x0"] - ], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": { - "action" : { - "callType" : "call", - "from" : "0x1c39ba39e4735cb65978d4db400ddd70a72dc750", - "gas" : "0x13e99", - "input" : "0x16c72721", - "to" : "0x2bd2326c993dfaef84f696526064ff22eba5b362", - "value" : "0x0" - }, - "blockHash" : "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add" - "blockNumber": 3068185, - "result": { - "gasUsed": "0x183", - "output" : "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "subtraces" : 0, - "traceAddress" : [ - 0 - ], - "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3", - "transactionPosition": 2, - "type" : "call" - }, -"id" : 1 -}, -``` - - - -### `trace_rawTransaction` - -Traces a call to `eth_sendRawTransaction` without making the call, returning the traces. - -:::info - -The requested transaction must be contained in a block within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -- `data` - _string_ - Raw transaction data - -- `options`: _array_ of _strings_ - list of tracing options; tracing options are [`trace`, `vmTrace`, and `stateDiff`](../trace-types.md). Specify any combination of the three options including none of them. - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in the order called by the transaction - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"trace_rawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",["trace"]],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "trace_rawTransaction", - "params": [ - "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", - ["trace"] - ], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": { - "output" : "0x" - "stateDiff": null, - "from" : "0x1c39ba39e4735cb65978d4db400ddd70a72dc750", - "trace": [{ - "action": { ... }, - "result": { - "gasUsed": "0x0", - "output": "0x" - } - "subtraces": 0, - "traceAddress": [], - "type": "call" - }], - "vmTrace": null - }, -"id" : 1 -}, -``` - - - -### `trace_replayBlockTransactions` - -Provides transaction processing tracing per block. - -:::info - -When using [Bonsai](../../concepts/data-storage-formats.md#bonsai-tries), the requested block must be within the number of [blocks retained](../cli/options.md#bonsai-historical-block-limit) (by default, 512 from the head of the chain). - -When using [Forest](../../concepts/data-storage-formats.md#forest-of-tries), the requested block must be within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024 from head of the chain). - -::: - -#### Parameters - -- `blockNumber`: _string_ - hexadecimal or decimal integer representing a block number or one of the string tags `latest`, `earliest`, `pending`, `finalized`, or `safe`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter) - -- `options`: _array_ of _strings_ - list of tracing options; tracing options are [`trace`, `vmTrace`, and `stateDiff`](../trace-types.md). Specify any combination of the three options including none of them. - -#### Returns - -`result`: _array_ of _objects_ - list of [transaction trace objects](objects.md#transaction-trace-object) containing one object per transaction, in transaction execution order; if revert reason is enabled with [`--revert-reason-enabled`](../cli/options.md#revert-reason-enabled), the [`trace`](../trace-types.md#trace) list items in the returned transaction trace object include the [revert reason](../../../private-networks/how-to/send-transactions/revert-reason.md). - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc": "2.0", "method": "trace_replayBlockTransactions","params": ["0x12",["trace","vmTrace","stateDiff"]],"id": 1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "trace_replayBlockTransactions", - "params": ["0x12", ["trace", "vmTrace", "stateDiff"]], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result":[ - { - "output":"0x", - "vmTrace":{ - "code":"0x7f3940be4289e4c3587d88c1856cc95352461992db0a584c281226faefe560b3016000527f14c4d2c102bdeb2354bfc3dc96a95e4512cf3a8461e0560e2272dbf884ef3905601052600851", - "ops":[ - { - "cost":3, - "ex":{ - "mem":null, - "push":[ - "0x8" - ], - "store":null, - "used":16756175 - }, - "pc":72, - "sub":null - }, - ... - ] - }, - "trace":[ - { - "action":{ - "callType":"call", - "from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "gas":"0xffadea", - "input":"0x", - "to":"0x0100000000000000000000000000000000000000", - "value":"0x0" - }, - "result":{ - "gasUsed":"0x1e", - "output":"0x" - }, - "subtraces":0, - "traceAddress":[ - ], - "type":"call" - } - ], - "stateDiff":{ - "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73":{ - "balance":{ - "*":{ - "from":"0xffffffffffffffffffffffffffffffffc3e12a20b", - "to":"0xffffffffffffffffffffffffffffffffc3dc5f091" - } - }, - "code":"=", - "nonce":{ - "*":{ - "from":"0x14", - "to":"0x15" - } - }, - "storage":{ - } - } - }, - "transactionHash":"0x2a5079cc535c429f668f13a7fb9a28bdba6831b5462bd04f781777b332a8fcbd", - }, - {...} - ] -} -``` - - - -### `trace_transaction` - -Provides transaction processing of [type `trace`](../trace-types.md#trace) for the specified transaction. - -:::info - -Your node must be an archive node (that is, synchronized without pruning or fast sync) or the requested transaction must be contained in a block within the number of [blocks retained](../cli/options.md#pruning-blocks-retained) with [pruning enabled](../cli/options.md#pruning-enabled) (by default, 1024). - -::: - -#### Parameters - -`transaction`: _string_ - transaction hash - -#### Returns - -`result`: _array_ of _objects_ - list of [calls to other contracts](../trace-types.md#trace) containing one object per call, in the order called by the transaction; if revert reason is enabled with [`--revert-reason-enabled`](../cli/options.md#revert-reason-enabled), the returned list items include the [revert reason](../../../private-networks/how-to/send-transactions/revert-reason.md). - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc": "2.0", "method": "trace_transaction","params": ["0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7"],"id": 1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "trace_transaction", - "params": [ - "0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7" - ], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "result": [ - { - "action": { - "creationMethod": "create", - "from": "0x627306090abab3a6e1400e9345bc60c78a8bef57", - "gas": "0xff2e26", - "init": "0x60006000600060006000732c2b9c9a4a25e24b174f26114e8926a9f2128fe45af2600060006000600060007300a00000000000000000000000000000000000005af2", - "value": "0x0" - }, - "blockHash": "0x7e9a993adc6f043c0a9b6a385e6ed3fa370586c55823251b8fa7033cf89d414e", - "blockNumber": 19, - "result": { - "address": "0x30753e4a8aad7f8597332e813735def5dd395028", - "code": "0x", - "gasUsed": "0x1c39" - }, - "subtraces": 2, - "traceAddress": [], - "transactionHash": "0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7", - "transactionPosition": 3, - "type": "create" - }, - { - "action": { - "callType": "callcode", - "from": "0x30753e4a8aad7f8597332e813735def5dd395028", - "gas": "0xfb2ea9", - "input": "0x", - "to": "0x2c2b9c9a4a25e24b174f26114e8926a9f2128fe4", - "value": "0x0" - }, - "blockHash": "0x7e9a993adc6f043c0a9b6a385e6ed3fa370586c55823251b8fa7033cf89d414e", - "blockNumber": 19, - "result": { - "gasUsed": "0x138e", - "output": "0x" - }, - "subtraces": 1, - "traceAddress": [0], - "transactionHash": "0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7", - "transactionPosition": 3, - "type": "call" - }, - { - "action": { - "address": "0x30753e4a8aad7f8597332e813735def5dd395028", - "balance": "0x0", - "refundAddress": "0x0000000000000000000000000000000000000000" - }, - "blockHash": "0x7e9a993adc6f043c0a9b6a385e6ed3fa370586c55823251b8fa7033cf89d414e", - "blockNumber": 19, - "result": null, - "subtraces": 0, - "traceAddress": [0, 0], - "transactionHash": "0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7", - "transactionPosition": 3, - "type": "suicide" - }, - { - "action": { - "callType": "callcode", - "from": "0x30753e4a8aad7f8597332e813735def5dd395028", - "gas": "0xfb18a5", - "input": "0x", - "to": "0x00a0000000000000000000000000000000000000", - "value": "0x0" - }, - "blockHash": "0x7e9a993adc6f043c0a9b6a385e6ed3fa370586c55823251b8fa7033cf89d414e", - "blockNumber": 19, - "result": { - "gasUsed": "0x30b", - "output": "0x" - }, - "subtraces": 0, - "traceAddress": [1], - "transactionHash": "0x4c253746668dca6ac3f7b9bc18248b558a95b5fc881d140872c2dff984d344a7", - "transactionPosition": 3, - "type": "call" - } - ], - "id": 1 -} -``` - - - -## `TXPOOL` methods - -The `TXPOOL` API methods allow you to inspect the contents of the transaction pool. - -:::note - -The `TXPOOL` API methods are not enabled by default for JSON-RPC. To enable the `TXPOOL` API methods, use the [`--rpc-http-api`](../cli/options.md#rpc-http-api) or [`--rpc-ws-api`](../cli/options.md#rpc-ws-api) options. - -::: - -### `txpool_besuPendingTransactions` - -Lists pending transactions that match the supplied filter conditions. - -#### Parameters - -- `numResults`: _number_ - integer representing the maximum number of results to return - -- `fields`: _object_ - object of fields used to create the filter condition - -Each field in the object corresponds to a field name containing an operator, and a value for the operator. A field name can only be specified once, and can only contain one operator. For example, you cannot query transactions with a gas price between 8 and 9 Gwei by using both the `gt` and `lt` operator in the same field name instance. - -All filters must be satisfied for a transaction to be returned. - -| Field name | Value | Value type | Supported operators | -| --- | --- | :-: | --- | -| `from` | Address of the sender. | _Data_, 20 bytes | `eq` | -| `to` | Address of the receiver, or `"contract_creation"`. | _Data_, 20 bytes | `eq`, `action` | -| `gas` | Gas provided by the sender. | _Quantity_ | `eq`, `gt`, `lt` | -| `gasPrice` | Gas price, in wei, provided by the sender. | _Quantity_ | `eq`, `gt`, `lt` | -| `value` | Value transferred, in wei. | _Quantity_ | `eq`, `gt`, `lt` | -| `nonce` | Number of transactions made by the sender. | _Quantity_ | `eq`, `gt`, `lt` | - -Supported operators: - -- `eq` (equal to) - -- `lt` (less than) - -- `gt` (greater than) - -- `action` - -:::note - -The only supported `action` is `"contract_creation"`. - -::: - -#### Returns - -`result`: _array_ of _objects_ - list of objects with [details of the pending transaction](objects.md#pending-transaction-object) - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_besuPendingTransactions","params":[2,{"from":{"eq":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"},"gas":{"lt":"0x5209"},"nonce":{"gt":"0x1"}}],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "txpool_besuPendingTransactions", - "params": [ - 2, - { - "from": { "eq": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" }, - "gas": { "lt": "0x5209" }, - "nonce": { "gt": "0x1" } - } - ], - "id": 1 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", - "gas": "0x5208", - "gasPrice": "0xab5d04c00", - "hash": "0xb7b2f4306c1c228ec94043da73b582594007091a7dfe024b1f8d6d772284e54b", - "input": "0x", - "nonce": "0x2", - "to": "0xf8be4ebda7f62d79a665294ec1263bfdb59aabf2", - "value": "0x0", - "v": "0xfe8", - "r": "0x5beb711e652c6cf0a589d3cea904eefc4f45ce4372652288701d08cc4412086d", - "s": "0x3af14a56e63aa5fb7dcb444a89708363a9d2c1eba1f777c67690288415080ded" - } - ] -} -``` - - - -### `txpool_besuStatistics` - -Lists statistics about the node transaction pool. - -#### Parameters - -None - -#### Returns - -`result`: _object_ - transaction pool statistics object with the following fields: - -- `maxSize`: _number_ - maximum number of transactions kept in the transaction pool; use the [`--tx-pool-max-size`](../cli/options.md#tx-pool-max-size) option to configure the maximum size. - -- `localCount`: _number_ - number of transactions submitted directly to this node - -- `remoteCount`: _number_ - number of transactions received from remote nodes - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_besuStatistics","params":[],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```bash -{"jsonrpc":"2.0","method":"txpool_besuStatistics","params":[],"id":1} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "maxSize": 4096, - "localCount": 1, - "remoteCount": 0 - } -} -``` - - - -### `txpool_besuTransactions` - -Lists transactions in the node transaction pool. - -#### Parameters - -None - -#### Returns - -`result`: _array_ of _objects_ - list of transactions - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"txpool_besuTransactions","params":[],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ "jsonrpc": "2.0", "method": "txpool_besuTransactions", "params": [], "id": 1 } -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "hash": "0x8a66830098be4006a3f63a03b6e9b67aa721e04bd6b46d420b8f1937689fb4f1", - "isReceivedFromLocalSource": true, - "addedToPoolAt": "2019-03-21T01:35:50.911Z" - }, - { - "hash": "0x41ee803c3987ceb5bcea0fad7a76a8106a2a6dd654409007d9931032ea54579b", - "isReceivedFromLocalSource": true, - "addedToPoolAt": "2019-03-21T01:36:00.374Z" - } - ] -} -``` - - - -## `WEB3` methods - -The `WEB3` API methods provide functionality for the Ethereum ecosystem. - -### `web3_clientVersion` - -Returns the current client version. - -#### Parameters - -None - -#### Returns - -`result`: _string_ - current client version - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 } -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 53, - "result": "besu/" -} -``` - - - -### `web3_sha3` - -Returns a [SHA3](https://en.wikipedia.org/wiki/SHA-3) hash of the specified data. The result value is a [Keccak-256](https://keccak.team/keccak.html) hash, not the standardized SHA3-256. - -#### Parameters - -`data`: _string_ - data to convert to a SHA3 hash - -#### Returns - -`result`: _string_ - SHA3 result of the input data - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c00"],"id":53}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```json -{ - "jsonrpc": "2.0", - "method": "web3_sha3", - "params": ["0x68656c6c6f20776f726c00"], - "id": 53 -} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 53, - "result": "0x5e39a0a66544c0668bde22d61c47a8710000ece931f13b84d3b2feb44ec96d3f" -} -``` - - - -## Miscellaneous methods - -### `rpc_modules` - -Lists [enabled APIs](../../how-to/use-besu-api/json-rpc.md#api-methods-enabled-by-default) and the version of each. - -#### Parameters - -None - -#### Returns - -`result`: _map_ of _strings_ to _strings_ - enabled APIs and their versions - - - -# curl HTTP request - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"rpc_modules","params":[],"id":1}' http://127.0.0.1:8545 -``` - -# wscat WS request - -```bash -{"jsonrpc":"2.0","method":"rpc_modules","params":[],"id":1} -``` - -# JSON result - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "web3": "1.0", - "eth": "1.0", - "net": "1.0" - } -} -``` - - - - - -[schema]: https://github.com/hyperledger/besu/blob/750580dcca349d22d024cc14a8171b2fa74b505a/ethereum/api/src/main/resources/schema.graphqls -[eth_sendRawTransaction or eth_call]: ../../how-to/send-transactions.md#eth_call-or-eth_sendrawtransaction -[transaction]: https://ropsten.etherscan.io/tx/0xfc766a71c406950d4a4955a340a092626c35083c64c7be907060368a5e6811d6 +`result`: _boolean_ - `true` if mining stops, or if the node is not mining \ No newline at end of file diff --git a/versioned_docs/version-23.7.3/public-networks/reference/cli/options.md b/versioned_docs/version-23.7.3/public-networks/reference/cli/options.md index f49f23ec20d..38e2cd7c498 100644 --- a/versioned_docs/version-23.7.3/public-networks/reference/cli/options.md +++ b/versioned_docs/version-23.7.3/public-networks/reference/cli/options.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Command line options This reference describes the syntax of the Hyperledger Besu command line interface (CLI) options. @@ -55,97 +58,121 @@ Characters such as smart quotes and long (em) hyphens don't work in Besu command ### `api-gas-price-blocks` - + -# Syntax + ```bash --api-gas-price-blocks= ``` -# Example + + + ```bash --api-gas-price-blocks=50 ``` -# Environment variable + + + ```bash BESU_API_GAS_PRICE_BLOCKS=50 ``` -# Example configuration file + + + ```bash api-gas-price-blocks=50 ``` - + + + Number of blocks back from the head block to examine for [`eth_gasPrice`](../api/index.md#eth_gasprice). The default is `100`. ### `api-gas-price-max` - + -# Syntax + ```bash --api-gas-price-max= ``` -# Example + + + ```bash --api-gas-price-max=20000 ``` -# Environment variable + + + ```bash BESU_API_GAS_PRICE_MAX=20000 ``` -# Example configuration file + + + ```bash api-gas-price-max=20000 ``` - + + + Maximum gas price to return for [`eth_gasPrice`](../api/index.md#eth_gasprice), regardless of the percentile value measured. The default is `500000000000` (500 GWei). ### `api-gas-price-percentile` - + -# Syntax + ```bash --api-gas-price-percentile= ``` -# Example + + + ```bash --api-gas-price-percentile=75 ``` -# Environment variable + + + ```bash BESU_API_GAS_PRICE_PERCENTILE=75 ``` -# Example configuration file + + + ```bash api-gas-price-percentile=75 ``` - + + + Percentile value to measure for [`eth_gasPrice`](../api/index.md#eth_gasprice). The default is `50.0`. @@ -156,33 +183,41 @@ For [`eth_gasPrice`](../api/index.md#eth_gasprice), to return the: ### `auto-log-bloom-caching-enabled` - + -# Syntax + ```bash --auto-log-bloom-caching-enabled[=] ``` -# Example + + + ```bash --auto-log-bloom-caching-enabled=false ``` -# Environment variable + + + ```bash BESU_AUTO_LOG_BLOOM_CACHING_ENABLED=false ``` -# Example configuration file + + + ```bash auto-log-bloom-caching-enabled=false ``` - + + + Enables or disables automatic log bloom caching. APIs such as [`eth_getLogs`](../api/index.md#eth_getlogs) and [`eth_getFilterLogs`](../api/index.md#eth_getfilterlogs) use the cache for improved performance. The default is `true`. @@ -192,33 +227,41 @@ Automatic log bloom caching has a small impact on performance. If you are not qu ### `banned-node-ids` - + -# Syntax + ```bash --banned-node-ids=[,...]... ``` -# Example + + + ```bash --banned-node-ids=0xc35c3...d615f,0xf42c13...fc456 ``` -# Environment variable + + + ```bash BESU_BANNED_NODE_IDS=0xc35c3...d615f,0xf42c13...fc456 ``` -# Configuration file + + + ```bash banned-node-ids=["0xc35c3...d615f","0xf42c13...fc456"] ``` - + + + A list of node IDs with which this node will not peer. The node ID is the public key of the node. You can specify the banned node IDs with or without the `0x` prefix. @@ -230,65 +273,81 @@ The singular `--banned-node-id` and plural `--banned-node-ids` are available and ### `bonsai-historical-block-limit` - + -# Syntax + ```bash --bonsai-historical-block-limit=256 ``` -# Example + + + ```bash --bonsai-historical-block-limit=256 ``` -# Environment variable + + + ```bash BESU_BONSAI_MAXIMUM_BACK_LAYERS_TO_LOAD=256 ``` -# Example configuration file + + + ```bash bonsai-historical-block-limit=256 ``` - + + + When using [Bonsai Tries](../../concepts/data-storage-formats.md#bonsai-tries), the [maximum number of previous blocks](../../concepts/data-storage-formats.md#accessing-data) for which Bonsai can reconstruct a historical state. The default is 512. ### `bootnodes` - + -# Syntax + ```bash --bootnodes[=[,...]...] ``` -# Example + + + ```bash --bootnodes=enode://c35c3...d615f@1.2.3.4:30303,enode://f42c13...fc456@1.2.3.5:30303 ``` -# Environment variable + + + ```bash BESU_BOOTNODES=enode://c35c3...d615f@1.2.3.4:30303,enode://f42c13...fc456@1.2.3.5:30303 ``` -# Example configuration file + + + ```bash bootnodes=["enode://c35c3...d615f@1.2.3.4:30303","enode://f42c13...fc456@1.2.3.5:30303"] ``` - + + + A list of comma-separated [enode URLs](../../concepts/node-keys.md#enode-url) for [P2P discovery bootstrap](../../../private-networks/how-to/configure/bootnodes.md). @@ -298,65 +357,81 @@ In private networks defined using [`--genesis-file`](#genesis-file) or when usin ### `color-enabled` - + -# Syntax + ```bash --color-enabled[=] ``` -# Example + + + ```bash --color-enabled=false ``` -# Environment variable + + + ```bash BESU_COLOR_ENABLED=false ``` -# Example configuration file + + + ```bash color-enabled=false ``` - + + + Enables or disables color output to console. The default is `true`. ### `compatibility-eth64-forkid-enabled` - + -# Syntax + ```bash --compatibility-eth64-forkid-enabled[=] ``` -# Example + + + ```bash --compatibility-eth64-forkid-enabled=true ``` -# Environment variable + + + ```bash BESU_COMPATIBILITY_ETH64_FORKID_ENABLED=true ``` -# Example configuration file + + + ```bash compatibility-eth64-forkid-enabled=true ``` - + + + Enables or disables the legacy Eth/64 fork ID. For any networks with nodes using Besu v1.4 or earlier and nodes using Besu v20.10.1 or later, either: @@ -373,149 +448,185 @@ If networks have Besu nodes using v1.4 or earlier and other Besu nodes using v20 ### `config-file` - + -# Syntax + ```bash --config-file= ``` -# Example + + + ```bash --config-file=/home/me/me_node/config.toml ``` -# Environment variable + + + ```bash BESU_CONFIG_FILE=/home/me/me_node/config.toml ``` - + + + The path to the [TOML configuration file](../../how-to/configuration-file.md). The default is `none`. ### `data-path` - + -# Syntax + ```bash --data-path= ``` -# Example + + + ```bash --data-path=/home/me/me_node ``` -# Environment variable + + + ```bash BESU_DATA_PATH=/home/me/me_node ``` -# Configuration file + + + ```bash data-path="/home/me/me_node" ``` - + + + The path to the Besu data directory. The default is the directory you installed Besu in, or `/opt/besu/database` if using the [Besu Docker image](../../get-started/install/run-docker-image.md). ### `data-storage-format` - + -# Syntax + ```bash --data-storage-format= ``` -# Example + + + ```bash --data-storage-format=BONSAI ``` -# Environment variable + + + ```bash BESU_DATA_STORAGE_FORMAT=BONSAI ``` -# Configuration file + + + ```bash data-storage-format="BONSAI" ``` - + + + The [data storage format](../../concepts/data-storage-formats.md) to use. Set to `BONSAI` for Bonsai Tries or `FOREST` for Forest of Tries. The default is `FOREST`. ### `discovery-dns-url` - + -# Syntax + ```bash --discovery-dns-url= ``` -# Environment variable + + + ```bash BESU_DISCOVERY_DNS_URL=enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org ``` -# Example configuration file + + + ```bash discovery-dns-url="enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org" ``` - + + + The `enrtree` URL of the DNS node list for [node discovery via DNS](https://eips.ethereum.org/EIPS/eip-1459). The default is `null`. ### `discovery-enabled` - + -# Syntax + ```bash --discovery-enabled[=] ``` -# Example + + + ```bash --discovery-enabled=false ``` -# Environment variable + + + ```bash BESU_DISCOVERY_ENABLED=false ``` -# Example configuration file + + + ```bash discovery-enabled=false ``` - + + + Enables or disables P2P discovery. The default is `true`. @@ -527,33 +638,41 @@ You can override the default DNS server if it's unreliable or doesn't serve TCP ### `engine-host-allowlist` - + -# Syntax + ```bash --engine-host-allowlist=[,...]... or "*" ``` -# Example + + + ```bash --engine-host-allowlist=localhost,127.0.0.1 ``` -# Environment variable + + + ```bash BESU_ENGINE_HOST_ALLOWLIST=localhost,127.0.0.1 ``` -# Configuration file + + + ```bash engine-host-allowlist=["localhost","127.0.0.1"] ``` - + + + A comma-separated list of hostnames to allow for Engine API access (applies to both HTTP and WebSocket). @@ -565,161 +684,201 @@ To allow all hostnames, use `"*"`. We don't recommend allowing all hostnames in ### `engine-jwt-disabled` - + -# Syntax + ```bash --engine-jwt-disabled[=] ``` -# Example + + + ```bash --engine-jwt-disabled=true ``` -# Environment variable + + + ```bash BESU_ENGINE_JWT_DISABLED=true ``` -# Configuration file + + + ```bash engine-jwt-disabled=true ``` - + + + Disables or enables [authentication](../../how-to/use-engine-api.md#authentication) for Engine APIs. The default is `false` (authentication is enabled by default). ### `engine-jwt-secret` - + -# Syntax + ```bash --engine-jwt-secret= ``` -# Example + + + ```bash --engine-jwt-secret=jwt.hex ``` -# Environment variable + + + ```bash BESU_ENGINE_JWT_SECRET="jwt.hex" ``` -# Configuration file + + + ```bash engine-jwt-secret="jwt.hex" ``` - + + + Shared secret used to authenticate [consensus clients](../../concepts/the-merge.md) when using the Engine JSON-RPC API (both HTTP and WebSocket). Contents of file must be at least 32 hex-encoded bytes and not begin with `0x`. May be a relative or absolute path. See an [example of how to generate this](../../get-started/connect/mainnet.md#1-generate-the-shared-secret). ### `engine-rpc-enabled` - + -# Syntax + ```bash --engine-rpc-enabled[= ``` -# Example + + + ```bash --engine-rpc-enabled ``` -# Environment variable + + + ```bash BESU_ENGINE_RPC_ENABLED=true ``` -# Configuration file + + + ```bash engine-rpc-enabled=true ``` - + + + Enables or disables the [Engine API](../engine-api/index.md). The default is `false`. ### `engine-rpc-port` - + -# Syntax + ```bash --engine-rpc-port= ``` -# Example + + + ```bash --engine-rpc-port=8551 ``` -# Environment variable + + + ```bash BESU_ENGINE_RPC_PORT=8551 ``` -# Configuration file + + + ```bash engine-rpc-port="8551" ``` - + + + The listening port for the Engine API calls (`ENGINE`, `ETH`) for JSON-RPC over HTTP and WebSocket. The default is `8551`. ### `ethstats` - + -# Syntax + ```bash --ethstats=<[ws://|wss://]nodename:secret@host:[port]> ``` -# Example + + + ```bash --ethstats=Dev-Node-1:secret@127.0.0.1:3001 ``` -# Environment variable + + + ```bash BESU_ETHSTATS=Dev-Node-1:secret@127.0.0.1:3001 ``` -# Configuration file + + + ```bash ethstats="Dev-Node-1:secret@127.0.0.1:3001" ``` - + + + Reporting URL of an [Ethstats](../../../private-networks/how-to/deploy/ethstats.md) server. If specified without a port, the default port is 443 for SSL connections and 80 for non-SSL connections. @@ -729,97 +888,121 @@ If you specify this scheme, the connection doesn't need to switch from SSL to no ### `ethstats-cacert-file` - + -# Syntax + ```bash --ethstats-cacert-file= ``` -# Example + + + ```bash --ethstats-cacert-file=./root.cert ``` -# Environment variable + + + ```bash BESU_ETHSTATS_CACERT_FILE=./root.cert ``` -# Configuration file + + + ```bash ethstats-cacert-file="./root.cert" ``` - + + + Path to the root certificate authority (CA) certificate file of the Ethstats server specified by [`--ethstats`](#ethstats). This option is useful in non-production environments. ### `ethstats-contact` - + -# Syntax + ```bash --ethstats-contact= ``` -# Example + + + ```bash --ethstats-contact=contact@mail.com ``` -# Environment variable + + + ```bash BESU_ETHSTATS_CONTACT=contact@mail.com ``` -# Configuration file + + + ```bash ethstats-contact="contact@mail.com" ``` - + + + Contact email address to send to the Ethstats server specified by [`--ethstats`](#ethstats). ### `fast-sync-min-peers` - + -# Syntax + ```bash --fast-sync-min-peers= ``` -# Example + + + ```bash --fast-sync-min-peers=8 ``` -# Environment variable + + + ```bash BESU_FAST_SYNC_MIN_PEERS=8 ``` -# Example configuration file + + + ```bash fast-sync-min-peers=8 ``` - + + + The minimum number of peers required before starting [fast synchronization](../../get-started/connect/sync-node.md#fast-synchronization) in [proof of work](../../how-to/use-pow/mining.md) networks. The default is 5. @@ -831,33 +1014,41 @@ This option only applies to proof of work networks. ### `genesis-file` - + -# Syntax + ```bash --genesis-file= ``` -# Example + + + ```bash --genesis-file=/home/me/me_node/customGenesisFile.json ``` -# Environment variable + + + ```bash BESU_GENESIS_FILE=/home/me/me_node/customGenesisFile.json ``` -# Configuration file + + + ```bash genesis-file="/home/me/me_node/customGenesisFile.json" ``` - + + + The path to the [genesis file](../../concepts/genesis-file.md). @@ -869,65 +1060,81 @@ You can't use the [`--genesis-file`](#genesis-file) and [`--network`](#network) ### `graphql-http-cors-origins` - + -# Syntax + ```bash --graphql-http-cors-origins= ``` -# Example + + + ```bash --graphql-http-cors-origins="http://medomain.com","https://meotherdomain.com" ``` -# Environment variable + + + ```bash BESU_GRAPHQL_HTTP_CORS_ORIGINS="http://medomain.com","https://meotherdomain.com" ``` -# Configuration file + + + ```bash graphql-http-cors-origins=["http://medomain.com","https://meotherdomain.com"] ``` - + + + A list of comma-separated origin domain URLs for CORS validation. The default is none. ### `graphql-http-enabled` - + -# Syntax + ```bash --graphql-http-enabled[=] ``` -# Example + + + ```bash --graphql-http-enabled ``` -# Environment variable + + + ```bash BESU_GRAPHQL_HTTP_ENABLED=true ``` -# Configuration file + + + ```bash graphql-http-enabled=true ``` - + + + Enables or disables the GraphQL HTTP service. The default is `false`. @@ -935,35 +1142,43 @@ The default GraphQL HTTP service endpoint is `http://127.0.0.1:8547/graphql` if ### `graphql-http-host` - + -# Syntax + ```bash --graphql-http-host= ``` -# Example + + + ```bash # to listen on all interfaces --graphql-http-host=0.0.0.0 ``` -# Environment variable + + + ```bash # to listen on all interfaces BESU_GRAPHQL_HTTP_HOST=0.0.0.0 ``` -# Configuration file + + + ```bash graphql-http-host="0.0.0.0" ``` - + + + The host on which GraphQL HTTP listens. The default is `127.0.0.1`. @@ -971,81 +1186,99 @@ To allow remote connections, set to `0.0.0.0`. ### `graphql-http-port` - + -# Syntax + ```bash --graphql-http-port= ``` -# Example + + + ```bash # to listen on port 6175 --graphql-http-port=6175 ``` -# Environment variable + + + ```bash # to listen on port 6175 BESU_GRAPHQL_HTTP_PORT=6175 ``` -# Configuration file + + + ```bash graphql-http-port="6175" ``` - + + + The port (TCP) on which GraphQL HTTP listens. The default is `8547`. Ports must be [exposed appropriately](../../how-to/connect/configure-ports.md). ### `help` - + -# Syntax + ```bash -h, --help ``` - + + + Show the help message and exit. ### `host-allowlist` - + -# Syntax + ```bash --host-allowlist=[,...]... or "*" ``` -# Example + + + ```bash --host-allowlist=medomain.com,meotherdomain.com ``` -# Environment variable + + + ```bash BESU_HOST_ALLOWLIST=medomain.com,meotherdomain.com ``` -# Configuration file + + + ```bash host-allowlist=["medomain.com", "meotherdomain.com"] ``` - + + + A comma-separated list of hostnames to [access the JSON-RPC API](../../how-to/use-besu-api/index.md#host-allowlist) and [pull Besu metrics](../../how-to/monitor/metrics.md). By default, Besu accepts requests from `localhost` and `127.0.0.1`. @@ -1069,33 +1302,41 @@ To allow all hostnames, use `"*"`. We don't recommend allowing all hostnames for ### `identity` - + -# Syntax + ```bash --identity= ``` -# Example + + + ```bash --identity=MyNode ``` -# Environment variable + + + ```bash BESU_IDENTITY=MyNode ``` -# Configuration file + + + ```bash identity="MyNode" ``` - + + + The name for the node. If specified, it's the second section of the client ID provided by some Ethereum network explorers. For example, in the client ID `besu/MyNode/v1.3.4/linux-x86_64/oracle_openjdk-java-11`, the node name is `MyNode`. @@ -1103,33 +1344,41 @@ If a name is not specified, the name section is not included in the client ID. F ### `key-value-storage` - + -# Syntax + ```bash --key-value-storage= ``` -# Example + + + ```bash --key-value-storage=rocksdb ``` -# Environment variable + + + ```bash BESU_KEY_VALUE_STORAGE=rocksdb ``` -# Configuration file + + + ```bash key-value-storage="rocksdb" ``` - + + + The key-value storage to use. Use this option only if using a storage system provided with a plugin. The default is `rocksdb`. @@ -1137,65 +1386,81 @@ For development use only, the `memory` option provides ephemeral storage for syn ### `logging` - + -# Syntax + ```bash -l, --logging= ``` -# Example + + + ```bash --logging=DEBUG ``` -# Environment variable + + + ```bash BESU_LOGGING=DEBUG ``` -# Example configuration file + + + ```bash logging="DEBUG" ``` - + + + Sets logging verbosity. Log levels are `OFF`, `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`, `ALL`. The default is `INFO`. ### `max-peers` - + -# Syntax + ```bash --max-peers= ``` -# Example + + + ```bash --max-peers=42 ``` -# Environment variable + + + ```bash BESU_MAX_PEERS=42 ``` -# Configuration file + + + ```bash max-peers=42 ``` - + + + The maximum number of P2P connections you can establish. The default is 25. @@ -1207,33 +1472,41 @@ The minimum number of peers is set by the early access option `--Xp2p-peer-lower ### `metrics-category` - + -# Syntax + ```bash --metrics-category=[,metrics-category...]... ``` -# Example + + + ```bash --metrics-category=BLOCKCHAIN,PEERS,PROCESS ``` -# Environment variable + + + ```bash BESU_METRICS_CATEGORY=BLOCKCHAIN,PEERS,PROCESS ``` -# Configuration file + + + ```bash metrics-category=["BLOCKCHAIN","PEERS","PROCESS"] ``` - + + + A comma-separated list of categories for which to track metrics. The defaults are `BLOCKCHAIN`, `ETHEREUM`, `EXECUTORS`, `JVM`, `NETWORK`, `PEERS`, `PERMISSIONING`, `PROCESS`, `PRUNER`, `RPC`, `STRATUM`, `SYNCHRONIZER`, and `TRANSACTION_POOL`. @@ -1243,33 +1516,41 @@ Categories containing `PRIVATE` track metrics when you enable [private transacti ### `metrics-enabled` - + -# Syntax + ```bash --metrics-enabled[=] ``` -# Example + + + ```bash --metrics-enabled ``` -# Environment variable + + + ```bash BESU_METRICS_ENABLED=true ``` -# Configuration file + + + ```bash metrics-enabled=true ``` - + + + Enables or disables the [metrics exporter](../../how-to/monitor/metrics.md#monitor-node-performance-using-prometheus). The default is `false`. @@ -1277,33 +1558,41 @@ You can't specify `--metrics-enabled` with [`--metrics-push-enabled`](#metrics-p ### `metrics-host` - + -# Syntax + ```bash --metrics-host= ``` -# Example + + + ```bash --metrics-host=127.0.0.1 ``` -# Environment variable + + + ```bash BESU_METRICS_HOST=127.0.0.1 ``` -# Configuration file + + + ```bash metrics-host="127.0.0.1" ``` - + + + The host on which [Prometheus](https://prometheus.io/) accesses [Besu metrics](../../how-to/monitor/metrics.md#monitor-node-performance-using-prometheus). The metrics server respects the [`--host-allowlist` option](#host-allowlist). @@ -1311,97 +1600,121 @@ The default is `127.0.0.1`. ### `metrics-port` - + -# Syntax + ```bash --metrics-port= ``` -# Example + + + ```bash --metrics-port=6174 ``` -# Environment variable + + + ```bash BESU_METRICS_PORT=6174 ``` -# Configuration file + + + ```bash metrics-port="6174" ``` - + + + The port (TCP) on which [Prometheus](https://prometheus.io/) accesses [Besu metrics](../../how-to/monitor/metrics.md#monitor-node-performance-using-prometheus). The default is `9545`. Ports must be [exposed appropriately](../../how-to/connect/configure-ports.md). ### `metrics-protocol` - + -# Syntax + ```bash --metrics-protocol= ``` -# Example + + + ```bash --metrics-protocol=OPENTELEMETRY ``` -# Environment variable + + + ```bash BESU_METRICS_PROTOCOL=OPENTELEMETRY ``` -# Configuration file + + + ```bash metrics-protocol="OPENTELEMETRY" ``` - + + + Metrics protocol to use: `PROMETHEUS`, `OPENTELEMETRY`, or `NONE`. The default is `PROMETHEUS`. ### `metrics-push-enabled` - + -# Syntax + ```bash --metrics-push-enabled[=] ``` -# Example + + + ```bash --metrics-push-enabled=true ``` -# Environment variable + + + ```bash BESU_METRICS_PUSH_ENABLED=true ``` -# Configuration file + + + ```bash metrics-push-enabled=true ``` - + + + Enables or disables [push gateway integration]. @@ -1409,33 +1722,41 @@ You can't specify `--metrics-push-enabled` with [`--metrics-enabled`](#metrics-e ### `metrics-push-host` - + -# Syntax + ```bash --metrics-push-host= ``` -# Example + + + ```bash --metrics-push-host=127.0.0.1 ``` -# Environment variable + + + ```bash BESU_METRICS_PUSH_HOST=127.0.0.1 ``` -# Configuration file + + + ```bash metrics-push-host="127.0.0.1" ``` - + + + The host of the [Prometheus Push Gateway](https://github.com/prometheus/pushgateway). The default is `127.0.0.1`. The metrics server respects the [`--host-allowlist` option](#host-allowlist). @@ -1447,129 +1768,161 @@ When pushing metrics, ensure you set `--metrics-push-host` to the machine on whi ### `metrics-push-interval` - + -# Syntax + ```bash --metrics-push-interval= ``` -# Example + + + ```bash --metrics-push-interval=30 ``` -# Environment variable + + + ```bash BESU_METRICS_PUSH_INTERVAL=30 ``` -# Configuration file + + + ```bash metrics-push-interval=30 ``` - + + + The interval, in seconds, to push metrics when in `push` mode. The default is 15. ### `metrics-push-port` - + -# Syntax + ```bash --metrics-push-port= ``` -# Example + + + ```bash --metrics-push-port=6174 ``` -# Environment variable + + + ```bash BESU_METRICS_PUSH_PORT=6174 ``` -# Configuration file + + + ```bash metrics-push-port="6174" ``` - + + + The port (TCP) of the [Prometheus Push Gateway](https://github.com/prometheus/pushgateway). The default is `9001`. Ports must be [exposed appropriately](../../how-to/connect/configure-ports.md). ### `metrics-push-prometheus-job` - + -# Syntax + ```bash --metrics-push-prometheus-job= ``` -# Example + + + ```bash --metrics-push-prometheus-job="my-custom-job" ``` -# Environment variable + + + ```bash BESU_METRICS_PUSH_PROMETHEUS_JOB="my-custom-job" ``` -# Configuration file + + + ```bash metrics-push-prometheus-job="my-custom-job" ``` - + + + The job name when in `push` mode. The default is `besu-client`. ### `min-block-occupancy-ratio` - + -# Syntax + ```bash --min-block-occupancy-ratio= ``` -# Example + + + ```bash --min-block-occupancy-ratio=0.5 ``` -# Environment variable + + + ```bash BESU_MIN_BLOCK_OCCUPANCY_RATIO=0.5 ``` -# Configuration file + + + ```bash min-block-occupancy-ratio="0.5" ``` - + + + Minimum occupancy ratio for a mined block if the transaction pool is not empty. When filling a block during mining, the occupancy ratio indicates the threshold at which the node stops waiting for smaller transactions to fill the remaining space. The default is 0.8. @@ -1581,33 +1934,41 @@ Besu ignores the `--min-block-occupancy-ratio` option for proof of stake network ### `miner-coinbase` - + -# Syntax + ```bash --miner-coinbase= ``` -# Example + + + ```bash --miner-coinbase=fe3b557e8fb62b89f4916b721be55ceb828dbd73 ``` -# Environment variable + + + ```bash BESU_MINER_COINBASE=fe3b557e8fb62b89f4916b721be55ceb828dbd73 ``` -# Configuration file + + + ```bash miner-coinbase="0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" ``` - + + + The account you pay mining rewards to. You must specify a valid coinbase when you enable mining using the [`--miner-enabled`](#miner-enabled) option or the [`miner_start`](../api/index.md#miner_start) JSON-RPC API method. @@ -1619,187 +1980,233 @@ Besu ignores this option in networks using [Clique](../../../private-networks/ho ### `miner-enabled` - + -# Syntax + ```bash --miner-enabled[=] ``` -# Example + + + ```bash --miner-enabled=true ``` -# Environment variable + + + ```bash BESU_MINER_ENABLED=true ``` -# Configuration file + + + ```bash miner-enabled=true ``` - + + + Enables or disables mining when you start the node. The default is `false`. ### `miner-extra-data` - + -# Syntax + ```bash --miner-extra-data= ``` -# Example + + + ```bash --miner-extra-data=0x444F4E27542050414E4943202120484F444C2C20484F444C2C20484F444C2021 ``` -# Environment variable + + + ```bash BESU_MINER_EXTRA_DATA=0x444F4E27542050414E4943202120484F444C2C20484F444C2C20484F444C2021 ``` -# Configuration file + + + ```bash miner-extra-data="0x444F4E27542050414E4943202120484F444C2C20484F444C2C20484F444C2021" ``` - + + + A hex string representing the 32 bytes included in the extra data field of a mined block. The default is 0x. ### `miner-stratum-enabled` - + -# Syntax + ```bash --miner-stratum-enabled ``` -# Environment variable + + + ```bash BESU_MINER_STRATUM_ENABLED=true ``` -# Configuration file + + + ```bash miner-stratum-enabled=true ``` - + + + Enables a node to perform stratum mining. The default is `false`. ### `miner-stratum-host` - + -# Syntax + ```bash --miner-stratum-host= ``` -# Example + + + ```bash --miner-stratum-host=192.168.1.132 ``` -# Environment variable + + + ```bash BESU_MINER_STRATUM_HOST=192.168.1.132 ``` -# Configuration file + + + ```bash miner-stratum-host="192.168.1.132" ``` - + + + The host of the stratum mining service. The default is `0.0.0.0`. ### `miner-stratum-port` - + -# Syntax + ```bash --miner-stratum-port= ``` -# Example + + + ```bash --miner-stratum-port=8010 ``` -# Environment variable + + + ```bash BESU_MINER_STRATUM_PORT=8010 ``` -# Configuration file + + + ```bash miner-stratum-port="8010" ``` - + + + The port of the stratum mining service. The default is `8008`. You must [expose ports appropriately](../../how-to/connect/configure-ports.md). ### `min-gas-price` - + -# Syntax + ```bash --min-gas-price= ``` -# Example + + + ```bash --min-gas-price=1337 ``` -# Environment variable + + + ```bash BESU_MIN_GAS_PRICE=1337 ``` -# Configuration file + + + ```bash min-gas-price=1337 ``` - + + + The minimum price a transaction offers to include it in a mined block. The minimum gas price is the lowest value [`eth_gasPrice`](../api/index.md#eth_gasprice) can return. The default is 1000 Wei. @@ -1811,21 +2218,25 @@ In a [free gas network](../../../private-networks/how-to/configure/free-gas.md), ### `nat-method` - + -# Syntax + ```bash --nat-method=UPNP ``` -# Example configuration file + + + ```bash nat-method="UPNP" ``` - + + + Specify the method for handling [NAT environments](../../how-to/connect/specify-nat.md). The options are: @@ -1860,33 +2271,41 @@ You must specify `DOCKER` when using the [Besu Docker image](../../get-started/i ### `network` - + -# Syntax + ```bash --network= ``` -# Example + + + ```bash --network=goerli ``` -# Environment variable + + + ```bash BESU_NETWORK=goerli ``` -# Configuration file + + + ```bash network="goerli" ``` - + + + The predefined network configuration. The default is `mainnet`. @@ -1918,33 +2337,41 @@ Values are case insensitive, so either `mainnet` or `MAINNET` works. ### `network-id` - + -# Syntax + ```bash --network-id= ``` -# Example + + + ```bash --network-id=8675309 ``` -# Environment variable + + + ```bash BESU_NETWORK_ID=8675309 ``` -# Configuration file + + + ```bash network-id="8675309" ``` - + + + The [P2P network identifier](../../concepts/network-and-chain-id.md). @@ -1952,33 +2379,41 @@ Use this option to override the default network ID. The default value is the sam ### `node-private-key-file` - + -# Syntax + ```bash --node-private-key-file= ``` -# Example + + + ```bash --node-private-key-file=/home/me/me_node/myPrivateKey ``` -# Environment variable + + + ```bash BESU_NODE_PRIVATE_KEY_FILE=/home/me/me_node/myPrivateKey ``` -# Configuration file + + + ```bash node-private-key-file="/home/me/me_node/myPrivateKey" ``` - + + + The private key file for the node. The default is the key file in the [data directory](#data-path). If no key file exists, Besu creates a key file containing the generated private key, otherwise, the existing key file specifies the node private key. @@ -1992,67 +2427,83 @@ This option is ignored if [`--security-module`](#security-module) is set to a no ### `p2p-enabled` - + -# Syntax + ```bash --p2p-enabled[=] ``` -# Example + + + ```bash --p2p-enabled=false ``` -# Environment variable + + + ```bash BESU_P2P_ENABLED=false ``` -# Configuration file + + + ```bash p2p-enabled=false ``` - + + + Enables or disables all P2P communication. The default is `true`. ### `p2p-host` - + -# Syntax + ```bash --p2p-host= ``` -# Example + + + ```bash # to listen on all interfaces --p2p-host=0.0.0.0 ``` -# Environment variable + + + ```bash # to listen on all interfaces BESU_P2P_HOST=0.0.0.0 ``` -# Configuration file + + + ```bash p2p-host="0.0.0.0" ``` - + + + The advertised host that can be used to access the node from outside the network in [P2P communication](../../how-to/connect/configure-ports.md#p2p-networking). The default is `127.0.0.1`. @@ -2064,99 +2515,123 @@ If [`--nat-method`](#nat-method) is set to [`NONE`](../../how-to/connect/specify ### `p2p-interface` - + -Syntax + ```bash --p2p-interface= ``` -# Example + + + ```bash --p2p-interface=192.168.1.132 ``` -# Environment variable + + + ```bash BESU_P2P_INTERFACE=192.168.1.132 ``` -# Configuration file + + + ```bash p2p-interface="192.168.1.132" ``` - + + + The network interface on which the node listens for [P2P communication](../../how-to/connect/configure-ports.md#p2p-networking). Use the option to specify the required network interface when the device that Besu is running on has multiple network interfaces. The default is 0.0.0.0 (all interfaces). ### `p2p-port` - + -# Syntax + ```bash --p2p-port= ``` -# Example + + + ```bash # to listen on port 1789 --p2p-port=1789 ``` -# Environment variable + + + ```bash # to listen on port 1789 BESU_P2P_PORT=1789 ``` -# Configuration file + + + ```bash p2p-port="1789" ``` - + + + The P2P listening ports (UDP and TCP). The default is `30303`. You must [expose ports appropriately](../../how-to/connect/configure-ports.md). ### `pruning-block-confirmations` - + -# Syntax + ```bash --pruning-block-confirmations= ``` -# Example + + + ```bash --pruning-block-confirmations=5 ``` -# Environment variable + + + ```bash BESU_PRUNING_BLOCK_CONFIRMATIONS=5 ``` -# Configuration file + + + ```bash pruning-block-confirmations=5 ``` - + + + The minimum number of confirmations on a block before marking of newly-stored or in-use state trie nodes that cannot be pruned. The default is 10. @@ -2168,33 +2643,41 @@ Using pruning with [private transactions](../../../private-networks/concepts/pri ### `pruning-blocks-retained` - + -# Syntax + ```bash --pruning-blocks-retained= ``` -# Example + + + ```bash --pruning-blocks-retained=10000 ``` -# Environment variable + + + ```bash BESU_PRUNING_BLOCKS_RETAINED=10000 ``` -# Configuration file + + + ```bash pruning-blocks-retained=10000 ``` - + + + The minimum number of recent blocks to keep the entire world state for. The default is 1024. @@ -2206,33 +2689,41 @@ Using pruning with [private transactions](../../../private-networks/concepts/pri ### `pruning-enabled` - + -# Syntax + ```bash --pruning-enabled ``` -# Example + + + ```bash --pruning-enabled=true ``` -# Environment variable + + + ```bash BESU_PRUNING_ENABLED=true ``` -# Configuration file + + + ```bash pruning-enabled=true ``` - + + + Enables [pruning](../../concepts/data-storage-formats.md#pruning) to reduce storage required for the world state. The default is `false`. @@ -2250,65 +2741,81 @@ Pruning is being deprecated for [Bonsai Tries](../../concepts/data-storage-forma ### `random-peer-priority-enabled` - + -# Syntax + ```bash --random-peer-priority-enabled[=] ``` -# Example + + + ```bash --random-peer-priority-enabled=true ``` -# Environment variable + + + ```bash BESU_RANDOM_PEER_PRIORITY_ENABLED=true ``` -# Configuration file + + + ```bash random-peer-priority-enabled=true ``` - + + + Enables or disables random prioritization of incoming connections. Enable in small, stable networks to prevent closed groups of peers forming. The default is `false`. ### `remote-connections-limit-enabled` - + -# Syntax + ```bash --remote-connections-limit-enabled[=] ``` -# Example + + + ```bash --remote-connections-limit-enabled=false ``` -# Environment variable + + + ```bash BESU_REMOTE_CONNECTIONS_LIMIT_ENABLED=false ``` -# Configuration file + + + ```bash remote-connections-limit-enabled=false ``` - + + + Enables or disables using the [`--remote-connections-max-percentage`](#remote-connections-max-percentage) option to limit the percentage of remote P2P connections initiated by peers. The default is `true`. @@ -2326,129 +2833,161 @@ To prevent eclipse attacks, ensure you enable the remote connections limit when ### `remote-connections-max-percentage` - + -# Syntax + ```bash --remote-connections-max-percentage= ``` -# Example + + + ```bash --remote-connections-max-percentage=25 ``` -# Environment variable + + + ```bash BESU_REMOTE_CONNECTIONS_MAX_PERCENTAGE=25 ``` -# Configuration file + + + ```bash remote-connections-max-percentage=25 ``` - + + + The percentage of remote P2P connections you can establish with the node. Must be between 0 and 100, inclusive. The default is 60. ### `reorg-logging-threshold` - + -# Syntax + ```bash --reorg-logging-threshold= ``` -# Example + + + ```bash --reorg-logging-threshold=3 ``` -# Environment variable + + + ```bash BESU_REORG_LOGGING_THRESHOLD=3 ``` -# Configuration file + + + ```bash reorg-logging-threshold=3 ``` - + + + Minimum depth of chain reorganizations to log. The default is 6. ### `required-block` - + -# Syntax + ```bash --required-block, --required-blocks[=BLOCK=HASH[,BLOCK=HASH...]...] ``` -# Example + + + ```bash --required-block=6485846=0x43f0cd1e5b1f9c4d5cda26c240b59ee4f1b510d0a185aa8fd476d091b0097a80 ``` -# Environment variable + + + ```bash BESU_REQUIRED_BLOCK=6485846=0x43f0cd1e5b1f9c4d5cda26c240b59ee4f1b510d0a185aa8fd476d091b0097a80 ``` -# Configuration file + + + ```bash required-block=["6485846=0x43f0cd1e5b1f9c4d5cda26c240b59ee4f1b510d0a185aa8fd476d091b0097a80"] ``` - + + + Requires a peer with the specified block number to have the specified hash when connecting, or Besu rejects that peer. ### `revert-reason-enabled` - + -# Syntax + ```bash --revert-reason-enabled[=] ``` -# Example + + + ```bash --revert-reason-enabled=true ``` -# Environment variable + + + ```bash BESU_REVERT_REASON_ENABLED=true ``` -# Configuration file + + + ```bash revert-reason-enabled=true ``` - + + + Enables or disables including the [revert reason](../../../private-networks/how-to/send-transactions/revert-reason.md) in the transaction receipt, [`eth_estimateGas`](../api/index.md#eth_estimategas) error response, [`eth_call`](../api/index.md#eth_call) error response, and [`trace`](../trace-types.md#trace) response. The default is `false`. @@ -2460,33 +2999,41 @@ Enabling revert reason may use a significant amount of memory. We don't recommen ### `rpc-http-api` - + -# Syntax + ```bash --rpc-http-api=[,...]... ``` -# Example + + + ```bash --rpc-http-api=ETH,NET,WEB3 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_API=ETH,NET,WEB3 ``` -# Configuration file + + + ```bash rpc-http-api=["ETH","NET","WEB3"] ``` - + + + A comma-separated list of APIs to enable on the HTTP JSON-RPC channel. When you use this option you must also specify the `--rpc-http-enabled` option. The available API options are: `ADMIN`, `CLIQUE`, `DEBUG`, `EEA`, `ETH`, `IBFT`, `MINER`, `NET`, `PERM`, `PLUGINS`, `PRIV`, `QBFT`, `TRACE`, `TXPOOL`, and `WEB3`. The default is: `ETH`, `NET`, `WEB3`. @@ -2498,111 +3045,137 @@ The singular `--rpc-http-api` and plural `--rpc-http-apis` are available and are ### `rpc-http-authentication-credentials-file` - + -# Syntax + ```bash --rpc-http-authentication-credentials-file= ``` -# Example + + + ```bash --rpc-http-authentication-credentials-file=/home/me/me_node/auth.toml ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_AUTHENTICATION_CREDENTIALS_FILE=/home/me/me_node/auth.toml ``` -# Configuration file + + + ```bash rpc-http-authentication-credentials-file="/home/me/me_node/auth.toml" ``` - + + + The [credentials file](../../how-to/use-besu-api/authenticate.md#credentials-file) for JSON-RPC API [authentication](../../how-to/use-besu-api/authenticate.md). ### `rpc-http-authentication-enabled` - + -# Syntax + ```bash --rpc-http-authentication-enabled[=] ``` -# Example + + + ```bash --rpc-http-authentication-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_AUTHENTICATION_ENABLED=true ``` -# Configuration file + + + ```bash rpc-http-authentication-enabled=true ``` - + + + Enables or disables [authentication](../../how-to/use-besu-api/authenticate.md) for the HTTP JSON-RPC service. ### `rpc-http-authentication-jwt-public-key-file` - + -# Syntax + ```bash --rpc-http-authentication-jwt-public-key-file= ``` -# Example + + + ```bash --rpc-http-authentication-jwt-public-key-file=publicKey.pem ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_AUTHENTICATION_JWT_PUBLIC_KEY_FILE="publicKey.pem" ``` -# Configuration file + + + ```bash rpc-http-authentication-jwt-public-key-file="publicKey.pem" ``` - + + + The [JWT provider's public key file] used for JSON-RPC HTTP authentication with an external JWT. ### `rpc-http-cors-origins` - + -# Syntax + ```bash --rpc-http-cors-origins=[,...]... or all or "*" ``` -# Example + + + ```bash @@ -2611,13 +3184,17 @@ $# You can allow one or more domains with a comma-separated list. --rpc-http-cors-origins=http://medomain.com,https://meotherdomain.com ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_CORS_ORIGINS=http://medomain.com,https://meotherdomain.com ``` -# Configuration file + + + ```bash rpc-http-cors-origins=["http://medomain.com","https://meotherdomain.com"] @@ -2632,7 +3209,9 @@ $# The following allows Remix to interact with your Besu node. --rpc-http-cors-origins=http://remix.ethereum.org ``` - + + + A list of domain URLs for CORS validation. @@ -2656,66 +3235,82 @@ For testing and development purposes, use `"all"` or `"*"` to accept requests fr ### `rpc-http-enabled` - + -# Syntax + ```bash --rpc-http-enabled[=] ``` -# Example + + + ```bash --rpc-http-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_ENABLED=true ``` -# Configuration file + + + ```bash rpc-http-enabled=true ``` - + + + Enables or disables the HTTP JSON-RPC service. The default is `false`. ### `rpc-http-host` - + -# Syntax + ```bash --rpc-http-host= ``` -# Example + + + ```bash # to listen on all interfaces --rpc-http-host=0.0.0.0 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_HOST=0.0.0.0 ``` -# Configuration file + + + ```bash rpc-http-host="0.0.0.0" ``` - + + + The host on which HTTP JSON-RPC listens. The default is `127.0.0.1`. @@ -2729,65 +3324,81 @@ Setting the host to `0.0.0.0` exposes the RPC connection on your node to any rem ### `rpc-http-max-active-connections` - + -# Syntax + ```bash --rpc-http-max-active-connections= ``` -# Example + + + ```bash --rpc-http-max-active-connections=100 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_MAX_ACTIVE_CONNECTIONS=100 ``` -# Configuration file + + + ```toml rpc-http-max-active-connections=100 ``` - + + + The maximum number of allowed HTTP JSON-RPC connections. Once this limit is reached, incoming connections are rejected. The default is 80. ### `rpc-http-max-request-content-length` - + -# Syntax + ```bash --rpc-http-max-request-content-length= ``` -# Example + + + ```bash --rpc-http-max-request-content-length=2097152 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_MAX_REQUEST_CONTENT_LENGTH=2097152 ``` -# Configuration file + + + ```toml rpc-http-max-request-content-length=2097152 ``` - + + + The maximum request content length. Besu only accepts JSON-RPC API requests with a body size less than or equal to this value. @@ -2795,98 +3406,122 @@ The default is 5242880 (5 MB). ### `rpc-http-max-batch-size` - + -# Syntax + ```bash --rpc-http-max-batch-size= ``` -# Example + + + ```bash --rpc-http-max-batch-size=1200 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_MAX_BATCH_SIZE=1200 ``` -# Configuration file + + + ```toml rpc-http-max-batch-size=1200 ``` - + + + The maximum number of allowed requests in a [RPC batch request](../../how-to/use-besu-api/json-rpc.md#http). The default limit is `1024`, and `-1` specifies no limit. ### `rpc-http-port` - + -# Syntax + ```bash --rpc-http-port= ``` -# Example + + + ```bash # to listen on port 3435 --rpc-http-port=3435 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_PORT=3435 ``` -# Configuration file + + + ```bash rpc-http-port="3435" ``` - + + + The port (TCP) on which HTTP JSON-RPC listens. The default is `8545`. You must [expose ports appropriately](../../how-to/connect/configure-ports.md). ### `rpc-http-tls-ca-clients-enabled` - + -# Syntax + ```bash --rpc-http-tls-ca-clients-enabled[=] ``` -# Example + + + ```bash --rpc-http-tls-ca-clients-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_CA_CLIENTS_ENABLED=true ``` -# Configuration file + + + ```bash rpc-http-tls-ca-clients-enabled=true ``` - + + + Enables or disables clients with trusted CA certificates to connect. The default is `false`. @@ -2898,33 +3533,41 @@ You must enable client authentication using the [`--rpc-http-tls-client-auth-ena ### `rpc-http-tls-client-auth-enabled` - + -# Syntax + ```bash --rpc-http-tls-client-auth-enabled[=] ``` -# Example + + + ```bash --rpc-http-tls-client-auth-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_CLIENT_AUTH_ENABLED=true ``` -# Configuration file + + + ```bash rpc-http-tls-client-auth-enabled=true ``` - + + + Enables or disables TLS client authentication for the JSON-RPC HTTP service. The default is `false`. @@ -2936,33 +3579,41 @@ You must specify [`--rpc-http-tls-ca-clients-enabled`](#rpc-http-tls-ca-clients- ### `rpc-http-tls-cipher-suite` - + -# Syntax + ```bash --rpc-http-tls-cipher-suite=[, ...] ``` -# Example + + + ```bash --rpc-http-tls-cipher-suite=TLS_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_CIPHER_SUITE=TLS_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ``` -# Configuration file + + + ```bash rpc-http-tls-cipher-suite=["TLS_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"] ``` - + + + A list of comma-separated TLS cipher suites to support. @@ -2974,33 +3625,41 @@ The singular `--rpc-http-tls-cipher-suite` and plural `--rpc-http-tls-cipher-sui ### `rpc-http-tls-enabled` - + -# Syntax + ```bash --rpc-http-tls-enabled[=] ``` -# Example + + + ```bash --rpc-http-tls-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_ENABLED=true ``` -# Configuration file + + + ```bash rpc-http-tls-enabled=true ``` - + + + Enables or disables TLS for the JSON-RPC HTTP service. The default is `false`. @@ -3012,97 +3671,121 @@ Enables or disables TLS for the JSON-RPC HTTP service. The default is `false`. ### `rpc-http-tls-keystore-file` - + -# Syntax + ```bash --rpc-http-tls-keystore-file= ``` -# Example + + + ```bash --rpc-http-tls-keystore-file=/home/me/me_node/keystore.pfx ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_KEYSTORE_FILE=/home/me/me_node/keystore.pfx ``` -# Configuration file + + + ```bash rpc-http-tls-keystore-file="/home/me/me_node/keystore.pfx" ``` - + + + The Keystore file (in PKCS #12 format) that contains private key and the certificate presented to the client during authentication. ### `rpc-http-tls-keystore-password-file` - + -# Syntax + ```bash --rpc-http-tls-keystore-password-file= ``` -# Example + + + ```bash --rpc-http-tls-keystore-password-file=/home/me/me_node/password ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_KEYSTORE_PASSWORD_FILE=/home/me/me_node/password ``` -# Configuration file + + + ```bash rpc-http-tls-keystore-password-file="/home/me/me_node/password" ``` - + + + The path to the file containing the password to decrypt the keystore. ### `rpc-http-tls-known-clients-file` - + -# Syntax + ```bash --rpc-http-tls-known-clients-file= ``` -# Example + + + ```bash --rpc-http-tls-known-clients-file=/home/me/me_node/knownClients ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_KNOWN_CLIENTS_FILE=/home/me/me_node/knownClients ``` -# Configuration file + + + ```bash rpc-http-tls-known-clients-file="/home/me/me_node/knownClients" ``` - + + + The path to the file used to [authenticate clients](../../../private-networks/how-to/configure/tls/client-and-server.md#create-the-known-clients-file) using self-signed certificates or non-public certificates. @@ -3116,33 +3799,41 @@ You must enable client authentication using the [`--rpc-http-tls-client-auth-ena ### `rpc-http-tls-protocol` - + -# Syntax + ```bash --rpc-http-tls-protocol=[, ...] ``` -# Example + + + ```bash --rpc-http-tls-protocol=TLSv1.3,TLSv1.2 ``` -# Environment variable + + + ```bash BESU_RPC_HTTP_TLS_PROTOCOL=TLSv1.3,TLSv1.2 ``` -# Configuration file + + + ```bash rpc-http-tls-protocol=["TLSv1.3","TLSv1.2"] ``` - + + + A list of comma-separated TLS protocols to support. The default is `DEFAULT_TLS_PROTOCOLS`, a list which includes `TLSv1.3` and `TLSv1.2`. @@ -3154,33 +3845,41 @@ The singular `--rpc-http-tls-protocol` and plural `--rpc-http-tls-protocols` are ### `rpc-max-logs-range` - + -# Syntax + ```bash --rpc-max-logs-range= ``` -# Example + + + ```bash --rpc-max-logs-range=500 ``` -# Environment variable + + + ```bash BESU_RPC_MAX_LOGS_RANGE=500 ``` -# Configuration file + + + ```bash rpc-max-logs-range=500 ``` - + + + When using [`eth_getLogs`](../api/index.md#eth_getlogs), the maximum number of blocks to retrieve logs from. Set to 0 to specify no limit. The default is 5000. @@ -3194,33 +3893,41 @@ We recommend setting a range limit or leaving this option at its default value. ### `rpc-tx-feecap` - + -# Syntax + ```bash --rpc-tx-feecap= ``` -# Example + + + ```bash --rpc-tx-feecap=1200000000000000000 ``` -# Environment variable + + + ```bash BESU_RPC_TX_FEECAP=1200000000000000000 ``` -# Configuration file + + + ```bash rpc-tx-feecap=1200000000000000000 ``` - + + + The maximum transaction fee (in Wei) accepted for transactions submitted through the [`eth_sendRawTransaction`](../api/index.md#eth_sendrawtransaction) RPC. The default is 1000000000000000000 (1 ether). @@ -3228,33 +3935,41 @@ If set to 0, then this option is ignored and no cap is applied. ### `rpc-ws-api` - + -# Syntax + ```bash --rpc-ws-api=[,...]... ``` -# Example + + + ```bash --rpc-ws-api=ETH,NET,WEB3 ``` -# Environment variable + + + ```bash BESU_RPC_WS_API=ETH,NET,WEB3 ``` -# Configuration file + + + ```bash rpc-ws-api=["ETH","NET","WEB3"] ``` - + + + A comma-separated list of APIs to enable on the WebSockets channel. When you use this option you must also specify the `--rpc-ws-enabled` option. The available API options are: `ADMIN`, `CLIQUE`, `DEBUG`, `EEA`, `ETH`, `IBFT`, `MINER`, `NET`, `PERM`, `PLUGINS`, `PRIV`, `QBFT`, `TRACE`, `TXPOOL`, and `WEB3`. The default is: `ETH`, `NET`, `WEB3`. @@ -3266,65 +3981,81 @@ The singular `--rpc-ws-api` and plural `--rpc-ws-apis` options are available and ### `rpc-ws-authentication-credentials-file` - + -# Syntax + ```bash --rpc-ws-authentication-credentials-file= ``` -# Example + + + ```bash --rpc-ws-authentication-credentials-file=/home/me/me_node/auth.toml ``` -# Environment variable + + + ```bash BESU_RPC_WS_AUTHENTICATION_CREDENTIALS_FILE=/home/me/me_node/auth.toml ``` -# Configuration file + + + ```bash rpc-ws-authentication-credentials-file="/home/me/me_node/auth.toml" ``` - + + + The path to the [credentials file](../../how-to/use-besu-api/authenticate.md#credentials-file) for JSON-RPC API [authentication](../../how-to/use-besu-api/authenticate.md). ### `rpc-ws-authentication-enabled` - + -# Syntax + ```bash --rpc-ws-authentication-enabled[=] ``` -# Example + + + ```bash --rpc-ws-authentication-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_WS_AUTHENTICATION_ENABLED=true ``` -# Configuration file + + + ```bash rpc-ws-authentication-enabled=true ``` - + + + Enables or disables [authentication](../../how-to/use-besu-api/authenticate.md) for the WebSocket JSON-RPC service. @@ -3336,98 +4067,122 @@ Enables or disables [authentication](../../how-to/use-besu-api/authenticate.md) ### `rpc-ws-authentication-jwt-public-key-file` - + -# Syntax + ```bash --rpc-ws-authentication-jwt-public-key-file= ``` -# Example + + + ```bash --rpc-ws-authentication-jwt-public-key-file=publicKey.pem ``` -# Environment variable + + + ```bash BESU_RPC_WS_AUTHENTICATION_JWT_PUBLIC_KEY_FILE="publicKey.pem" ``` -# Configuration file + + + ```bash rpc-ws-authentication-jwt-public-key-file="publicKey.pem" ``` - + + + The [JWT provider's public key file] used for JSON-RPC WebSocket authentication with an external JWT. ### `rpc-ws-enabled` - + -# Syntax + ```bash --rpc-ws-enabled[=] ``` -# Example + + + ```bash --rpc-ws-enabled=true ``` -# Environment variable + + + ```bash BESU_RPC_WS_ENABLED=true ``` -# Configuration file + + + ```bash rpc-ws-enabled=true ``` - + + + Enables or disables the WebSocket JSON-RPC service. The default is `false`. ### `rpc-ws-host` - + -# Syntax + ```bash --rpc-ws-host= ``` -# Example + + + ```bash # to listen on all interfaces --rpc-ws-host=0.0.0.0 ``` -# Environment variable + + + ```bash BESU_RPC_WS_HOST=0.0.0.0 ``` -# Configuration file + + + ```bash rpc-ws-host="0.0.0.0" ``` - + + + The host on which WebSocket JSON-RPC listens. The default is `127.0.0.1`. @@ -3436,162 +4191,202 @@ To allow remote connections, set to `0.0.0.0` ### `rpc-ws-max-active-connections` - + -# Syntax + ```bash --rpc-ws-max-active-connections= ``` -# Example + + + ```bash --rpc-ws-max-active-connections=100 ``` -# Environment variable + + + ```bash BESU_RPC_WS_MAX_ACTIVE_CONNECTIONS=100 ``` -# Configuration file + + + ```toml rpc-ws-max-active-connections=100 ``` - + + + The maximum number of WebSocket connections allowed for JSON-RPC. Once this limit is reached, incoming connections are rejected. The default is 80. ### `rpc-ws-max-frame-size` - + -# Syntax + ```bash --rpc-ws-max-frame-size= ``` -# Example + + + ```bash --rpc-ws-max-frame-size=65536 ``` -# Environment variable + + + ```bash BESU_RPC_WS_MAX_FRAME_SIZE=65536 ``` -# Configuration file + + + ```toml rpc-ws-max-frame-size=65536 ``` - + + + The maximum size in bytes for JSON-RPC WebSocket frames. If this limit is exceeded, the WebSocket disconnects. The default is 1048576 (or 1 MB). ### `rpc-ws-port` - + -# Syntax + ```bash --rpc-ws-port= ``` -# Example + + + ```bash # to listen on port 6174 --rpc-ws-port=6174 ``` -# Environment variable + + + ```bash BESU_RPC_WS_PORT=6174 ``` -# Configuration file + + + ```bash rpc-ws-port="6174" ``` - + + + The port (TCP) on which WebSocket JSON-RPC listens. The default is `8546`. You must [expose ports appropriately](../../how-to/connect/configure-ports.md). ### `json-pretty-print-enabled` - + -# Syntax + ```bash --json-pretty-print-enabled[=] ``` -# Example + + + ```bash --json-pretty-print-enabled=true ``` -# Environment variable + + + ```bash BESU_JSON_PRETTY_PRINT_ENABLED=true ``` -# Configuration file + + + ```bash json-pretty-print-enabled=true ``` - + + + Enables or disables the pretty-print output for HTTP and WebSocket responses. The default is `false`. ### `security-module` - + -# Syntax + ```bash --security-module= ``` -# Example + + + ```bash --security-module=security_module ``` -# Environment variable + + + ```bash BESU_SECURITY_MODULE=security_module ``` -# Configuration file + + + ```bash security-module="security_module" ``` - + + + Name of the security module plugin to use. For example, a Hardware Security Module (HSM) or V3 filestore plugin. @@ -3599,97 +4394,121 @@ The default is the node's local private key file specified using [`--node-privat ### `static-nodes-file` - + -# Syntax + ```bash --static-nodes-file= ``` -# Example + + + ```bash --static-nodes-file=~/besudata/static-nodes.json ``` -# Environment variable + + + ```bash BESU_STATIC_NODES_FILE=~/besudata/static-nodes.json ``` -# Configuration file + + + ```bash static-nodes-file="~/besudata/static-nodes.json" ``` - + + + Static nodes JSON file containing the [static nodes](../../how-to/connect/static-nodes.md) for this node to connect to. The default is `datapath/static-nodes.json`. ### `strict-tx-replay-protection-enabled` - + -# Syntax + ```bash --strict-tx-replay-protection-enabled[=] ``` -# Example + + + ```bash --strict-tx-replay-protection-enabled=false ``` -# Environment variable + + + ```bash STRICT_TX_REPLAY_PROTECTION_ENABLED=false ``` -# Configuration file + + + ```bash strict-tx-replay-protection-enabled=false ``` - + + + Enables or disables replay protection, in accordance with [EIP-155](https://eips.ethereum.org/EIPS/eip-155), on transactions submitted using JSON-RPC. The default is `false`. ### `sync-mode` - + -# Syntax + ```bash --sync-mode=X_SNAP ``` -# Example + + + ```bash --sync-mode=X_SNAP ``` -# Environment variable + + + ```bash BESU_SYNC_MODE=X_SNAP ``` -# Configuration file + + + ```bash sync-mode="X_SNAP" ``` - + + + The synchronization mode. Use `X_SNAP` for [snap sync](../../get-started/connect/sync-node.md#snap-synchronization), `X_CHECKPOINT` for [checkpoint sync](../../get-started/connect/sync-node.md#checkpoint-synchronization), `FAST` for [fast sync](../../get-started/connect/sync-node.md#fast-synchronization), and `FULL` for [full sync](../../get-started/connect/sync-node.md#run-an-archive-node). @@ -3707,33 +4526,41 @@ The synchronization mode. Use `X_SNAP` for [snap sync](../../get-started/connect ### `target-gas-limit` - + -# Syntax + ```bash --target-gas-limit= ``` -# Example + + + ```bash --target-gas-limit=8000000 ``` -# Environment variable + + + ```bash BESU_TARGET_GAS_LIMIT=8000000 ``` -# Configuration file + + + ```bash target-gas-limit="8000000" ``` - + + + The gas limit toward which Besu will gradually move on an existing network, if enough miners are in agreement. To change the block gas limit set in the genesis file without creating a new network, use `target-gas-limit`. The gas limit between blocks can change only 1/1024th, so the target tells the block creator how to set the gas limit in its block. If the values are the same or within 1/1024th, Besu sets the limit to the specified value. Otherwise, the limit moves as far as it can within that constraint. @@ -3743,66 +4570,82 @@ Use the [`miner_changeTargetGasLimit`](../api/index.md#miner_changetargetgaslimi ### `tx-pool-disable-locals` - + -# Syntax + ```bash --tx-pool-disable-locals[=] ``` -# Example + + + ```bash --tx-pool-disable-locals=true ``` -# Environment variable + + + ```bash BESU_TX_POOL_DISABLE_LOCALS=true ``` -# Configuration file + + + ```bash tx-pool-disable-locals=true ``` - + + + If this option is set to true, transactions received via RPC must have the same checks, and should not be prioritized over remote transactions. The default is `false`. ### `tx-pool-enable-save-restore` - + -# Syntax + ```bash --tx-pool-enable-save-restore[=] ``` -# Example + + + ```bash --tx-pool-enable-save-restore=true ``` -# Environment variable + + + ```bash BESU_TX_POOL_ENABLE_SAVE_RESTORE=true ``` -# Configuration file + + + ```bash tx-pool-enable-save-restore=true ``` - + + + Enables or disables saving the transaction pool contents to a file on shutdown and reloading it at startup. The default is `false`. @@ -3811,33 +4654,41 @@ You can define a custom path to the transaction pool file using the [`--tx-pool- ### `tx-pool-limit-by-account-percentage` - + -# Syntax + ```bash --tx-pool-limit-by-account-percentage= ``` -# Example + + + ```bash --tx-pool-limit-by-account-percentage=0.1 ``` -# Environment variable + + + ```bash BESU_TX_POOL_LIMIT_BY_ACCOUNT_PERCENTAGE=0.1 ``` -# Configuration file + + + ```bash tx-pool-limit-by-account-percentage=0.4 ``` - + + + The maximum percentage of future transactions kept in the transaction pool, per account. Accepted values are in the range (0–1]. The default is .001 or 0.1% of transactions from a single account to be kept in the pool. @@ -3849,129 +4700,161 @@ The default value is often unsuitable for [private networks](../../../private-ne ### `tx-pool-max-size` - + -# Syntax + ```bash --tx-pool-max-size= ``` -# Example + + + ```bash --tx-pool-max-size=2000 ``` -# Environment variable + + + ```bash BESU_TX_POOL_MAX_SIZE=2000 ``` -# Configuration file + + + ```bash tx-pool-max-size="2000" ``` - + + + The maximum number of transactions kept in the transaction pool. The default is 4096. ### `tx-pool-price-bump` - + -# Syntax + ```bash --tx-pool-price-bump= ``` -# Example + + + ```bash --tx-pool-price-bump=25 ``` -# Environment variable + + + ```bash BESU_TX_POOL_PRICE_BUMP=25 ``` -# Configuration file + + + ```bash tx-pool-price-bump=25 ``` - + + + The price bump percentage to replace an existing transaction. The default is 10. ### `tx-pool-retention-hours` - + -# Syntax + ```bash --tx-pool-retention-hours= ``` -# Example + + + ```bash --tx-pool-retention-hours=5 ``` -# Environment variable + + + ```bash BESU_TX_POOL_RETENTION_HOURS=5 ``` -# Configuration file + + + ```bash tx-pool-retention-hours=5 ``` - + + + The maximum period, in hours, to hold pending transactions in the transaction pool. The default is 13. ### `tx-pool-save-file` - + -# Syntax + ```bash --tx-pool-save-file= ``` -# Example + + + ```bash --tx-pool-save-file=/home/me/me_node/node_txpool.dump ``` -# Environment variable + + + ```bash BESU_TX_POOL_SAVE_FILE=/home/me/me_node/node_txpool.dump ``` -# Configuration file + + + ```bash tx-pool-save-file="/home/me/me_node/node_txpool.dump" ``` - + + + Path to the file that stores the transaction pool's content if the save and restore functionality is enabled using [`--tx-pool-enable-save-restore`](#tx-pool-enable-save-restore). The @@ -3980,15 +4863,17 @@ file is created on shutdown and reloaded during startup. The default file name i ### `Xhelp` - + -# Syntax + ```bash -X, --Xhelp ``` - + + + Displays the early access options and their descriptions, and exit. @@ -4000,15 +4885,17 @@ The displayed options are unstable and may change between releases. ### `version` - + -# Syntax + ```bash -V, --version ``` - + + + Prints version information and exit. diff --git a/versioned_docs/version-23.7.3/public-networks/reference/cli/subcommands.md b/versioned_docs/version-23.7.3/public-networks/reference/cli/subcommands.md index 2edad520f93..8592ca94565 100644 --- a/versioned_docs/version-23.7.3/public-networks/reference/cli/subcommands.md +++ b/versioned_docs/version-23.7.3/public-networks/reference/cli/subcommands.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Subcommands This reference describes the syntax of the Hyperledger Besu command line interface (CLI) subcommands. @@ -35,21 +38,25 @@ Provides blocks related actions. ### `import` - + -# Syntax + ```bash besu blocks import [--skip-pow-validation-enabled] [--start-block=] [--end-block=] --from= ``` -# Example + + + ```bash besu blocks import --skip-pow-validation-enabled --start-block=100 --end-block=300 --from=/home/me/me_project/mainnet-export1.blocks --from=/home/me/me_project/mainnet-export2.blocks ``` - + + + Imports a block or range of blocks from the specified file into the blockchain database. @@ -69,21 +76,25 @@ Use `--skip-pow-validation-enabled` when performing [Ethereum Foundation hive te ### `export` - + -# Syntax + ```bash besu blocks export [--start-block=] [--end-block=] --to= ``` -# Example + + + ```bash besu --network=goerli --data-path=/home/data/ blocks export --start-block=100 --end-block=300 --to=/home/exportblock.bin ``` - + + + Exports a block or range of blocks from storage to a file in RLP format. @@ -103,53 +114,65 @@ To get the public key or address of a node, ensure you use the [`--data-path`](o ### `export` - + -# Syntax + ```bash besu public-key export [--node-private-key-file=] [--to=] [--ec-curve=] ``` -# Example (to standard output) + + + ```bash besu --data-path= public-key export --node-private-key-file=/home/me/me_node/myPrivateKey --ec-curve=secp256k1 ``` -# Example (to file) + + + ```bash besu --data-path= public-key export --node-private-key-file=/home/me/me_node/myPrivateKey --to=/home/me/me_project/not_precious_pub_key --ec-curve=secp256k1 ``` - + + + Outputs the node public key to standard output or to the file specified by `--to=`. You can output the public key associated with a specific private key file using the [`--node-private-key-file`](options.md#node-private-key-file) option. The default elliptic curve used for the key is `secp256k1`. Use the `--ec-curve` option to choose between `secp256k1` or `secp256r1`. ### `export-address` - + -# Syntax + ```bash besu public-key export-address [--node-private-key-file=] [--to=] [--ec-curve=] ``` -# Example (to standard output) + + + ```bash besu --data-path= public-key export-address --node-private-key-file=/home/me/me_node/myPrivateKey --ec-curve=secp256k1 ``` -# Example (to file) + + + ```bash besu --data-path= public-key export-address --node-private-key-file=/home/me/me_node/myPrivateKey --to=/home/me/me_project/me_node_address --ec-curve=secp256k1 ``` - + + + Outputs the node address to standard output or to the file specified by `--to=`. You can output the address associated with a specific private key file using the [`--node-private-key-file`](options.md#node-private-key-file) option. The default elliptic curve used for the key is `secp256k1`. Use the `--ec-curve` option to choose between `secp256k1` or `secp256r1`. @@ -159,21 +182,25 @@ Provides password related actions. ### `hash` - + -# Syntax + ```bash besu password hash --password= ``` -# Example + + + ```bash besu password hash --password=myPassword123 ``` - + + + Generates the hash of a given password. Include the hash in the [credentials file](../../how-to/use-besu-api/authenticate.md#credentials-file) for JSON-RPC API [authentication](../../how-to/use-besu-api/authenticate.md). @@ -183,21 +210,25 @@ Provides operator actions. ### `generate-log-bloom-cache` - + -# Syntax + ```bash besu operator generate-log-bloom-cache [--start-block=] [--end-block=] ``` -# Example + + + ```bash besu --network=goerli --data-path=/project/goerli operator generate-log-bloom-cache --start-block=0 --end-block=100000 ``` - + + + :::tip @@ -217,21 +248,25 @@ To generate cached log bloom indexes while the node is running, use the [`admin_ ## `retesteth` - + -# Syntax + ```bash besu retesteth [--data-path=] [--rpc-http-host=] [--rpc-http-port=] [-l=] [--host-allowlist=[,…]… or * or all] ``` -# Example + + + ```bash besu retesteth --data-path=/home/me/me_node --rpc-http-port=8590 --host-allowlist=* ``` - + + + Runs a Retesteth-compatible server. [Retesteth](https://github.com/ethereum/retesteth/wiki) is a developer tool that can generate and run consensus tests against any Ethereum client running such a server. @@ -245,20 +280,24 @@ The command accepts the following command line options: ## `validate-config` - + -# Syntax + ```bash besu validate-config --config-file ``` -# Example + + + ```bash besu validate-config --config-file ../besu-local-nodes/config/besu/besu1.conf ``` - + + + Performs basic syntax validation of the specified [TOML configuration file](../../how-to/configuration-file.md). Checks TOML syntax (for example, valid format and unmatched quotes) and flags unknown options. Doesn't check data types, and doesn't check dependencies between options (this is done at Besu startup). diff --git a/versioned_docs/version-23.7.3/public-networks/reference/engine-api/index.md b/versioned_docs/version-23.7.3/public-networks/reference/engine-api/index.md index ebb85e4a430..d18fb998727 100644 --- a/versioned_docs/version-23.7.3/public-networks/reference/engine-api/index.md +++ b/versioned_docs/version-23.7.3/public-networks/reference/engine-api/index.md @@ -5,6 +5,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Engine API methods [Consensus and execution clients](../../concepts/the-merge.md#execution-and-consensus-clients) communicate with each other using the Engine API. When running Besu as an execution client, [use these API calls](../../how-to/use-engine-api.md) to communicate with a consensus client. @@ -31,15 +34,17 @@ Exchanges a list of supported Engine API methods between the consensus client an `localCapabilities`: _array_ of _strings_ - Engine API method names that Besu supports - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_exchangeCapabilities","params":[["engine_exchangeTransitionConfigurationV1","engine_forkchoiceUpdatedV1","engine_getPayloadBodiesByHash","engine_getPayloadBodiesByRangeV1","engine_getPayloadV1","engine_newPayloadV1"]],"id":67}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -59,7 +64,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_exchangeCapabilities","pa } ``` -# JSON result + + + ```json { @@ -80,7 +87,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_exchangeCapabilities","pa } ``` - + + + ### `engine_exchangeTransitionConfigurationV1` @@ -100,15 +109,17 @@ The execution client runs this call every 60 seconds in the background. The log `transitionConfiguration`: _object_ - [Transition configuration object](objects.md#transition-configuration-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_exchangeTransitionConfigurationV1","params":[{"terminalTotalDifficulty": 0, "terminalBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "terminalBlockNumber": "0x1"}],"id":67}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -125,7 +136,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_exchangeTransitionConfigu } ``` -# JSON result + + + ```json { @@ -139,7 +152,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_exchangeTransitionConfigu } ``` - + + + ### `engine_forkchoiceUpdatedV1` @@ -157,15 +172,17 @@ Updates the fork choice with the consensus client. - `payloadId`: _data_ - identifier of the payload build process or `null` - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","params":[{"headBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", "safeBlockHash": "0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", "finalizedBlockHash": "0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a"},null],"id":67}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -183,7 +200,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","par } ``` -# JSON result + + + ```json { @@ -200,7 +219,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdatedV1","par } ``` - + + + ### `engine_getPayloadBodiesByHashV1` @@ -214,15 +235,17 @@ Returns the bodies of the execution payloads corresponding to the specified bloc `engineGetPayloadBodiesResultV1`: **array** of **objects** - Execution payload body objects - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByHashV1","params":[["0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c","0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"]],"id":1}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -238,7 +261,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByHashV1" } ``` -# JSON result + + + ```json { @@ -274,7 +299,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByHashV1" } ``` - + + + ### `engine_getPayloadBodiesByRangeV1` @@ -290,15 +317,17 @@ Returns the bodies of the execution payloads corresponding to the specified rang `engineGetPayloadBodiesResultV1`: _array_ of _objects_ - Execution payload body objects - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByRangeV1","params":["0x20", "0x2"],"id":1}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -309,7 +338,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByRangeV1 } ``` -# JSON result + + + ```json { @@ -345,7 +376,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByRangeV1 } ``` - + + + ### `engine_getPayloadV1` @@ -359,15 +392,17 @@ Prepares the payload to send to the consensus client. `executionPayload`: _object_ - [Execution payload object](objects.md#execution-payload-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadV1","params":["0x0000000021f32cc1"],"id":1}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -378,7 +413,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadV1","params":[" } ``` -# JSON result + + + ```json { @@ -403,7 +440,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_getPayloadV1","params":[" } ``` - + + + ### `engine_newPayloadV1` @@ -417,9 +456,9 @@ Executes the payload with the consensus client. - `payloadStatus`: _object_ - [Payload status object](objects.md#payload-status-object) - + -# curl HTTP + ```bash curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ @@ -442,7 +481,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ ],"id":67}' http://127.0.0.1:8550 ``` -# wscat WS + + + ```json { @@ -470,7 +511,9 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ } ``` -# JSON result + + + ```json { @@ -484,4 +527,6 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"engine_newPayloadV1","params":[ } ``` - + + + diff --git a/versioned_docs/version-23.7.3/public-networks/reference/evm-tool.md b/versioned_docs/version-23.7.3/public-networks/reference/evm-tool.md index 37c8b88ea02..9559989d130 100644 --- a/versioned_docs/version-23.7.3/public-networks/reference/evm-tool.md +++ b/versioned_docs/version-23.7.3/public-networks/reference/evm-tool.md @@ -7,6 +7,9 @@ tags: - private networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # EVM tool reference This reference describes options for running the following [using the EVM tool](../how-to/troubleshoot/evm-tool.md): @@ -27,155 +30,185 @@ The first mode of the EVM tool runs an arbitrary EVM and is invoked without an e ### `code` - + -# Syntax + ```bash --code= ``` -# Example + + + ```bash --code=5B600080808060045AFA50600056 ``` - + + + The code to be executed, in compiled hex code form. Execution fails if this is not set. ### `gas` - + -# Syntax + ```bash --gas= ``` -# Example + + + ```bash --gas=100000000 ``` - + + + Amount of gas to make available to the EVM. The default is 10 billion, a number unlikely to be seen in any production blockchain. ### `price` - + -# Syntax + ```bash --price= ``` -# Example + + + ```bash --price=10 ``` - + + + Price of gas in Gwei. The default is `0`. If set to a non-zero value, the sender account must have enough value to cover the gas fees. ### `sender` - + -# Syntax + ```bash --sender=
``` -# Example + + + ```bash --sender=0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 ``` - + + + The account the invocation is sent from. The specified account must exist in the world state, which, unless specified by [`--genesis`](#genesis), is the set of [accounts used for testing](../../private-networks/reference/accounts-for-testing.md). ### `receiver` - + -# Syntax + ```bash --receiver=
``` -# Example + + + ```bash --receiver=0x588108d3eab34e94484d7cda5a1d31804ca96fe7 ``` - + + + The account the invocation is sent to. The specified account does not need to exist. ### `input` - + -# Syntax + ```bash --input= ``` -# Example + + + ```bash --input=9064129300000000000000000000000000000000000000000000000000000000 ``` - + + + The data passed into the call. Corresponds to the `data` field of the transaction and is returned by the `CALLDATA` and related opcodes. ### `value` - + -# Syntax + ```bash --value= ``` -# Example + + + ```bash --value=1000000000000000000 ``` - + + + The value, in wei, attached to this transaction. For operations that query the value or transfer it to other accounts this is the amount that is available. The amount is not reduced to cover intrinsic cost and gas fees. ### `json`, `trace` - + -# Syntax + ```bash --json ``` - + + + Provides an operation-by-operation trace of the command in JSON. @@ -183,29 +216,33 @@ Provides an operation-by-operation trace of the command in JSON. ### `json-alloc` - + -# Syntax + ```bash --json-alloc ``` - + + + Outputs a JSON summary of the post-execution world state and allocations. ### `[no]memory`, `trace.[no]memory` - + -# Syntax + ```bash --nomemory, --memory ``` - + + + Setting `--nomemory` disables tracing the memory output for each operation. Setting `--memory` enables it. Memory traces are disabled by default. @@ -215,43 +252,49 @@ For memory heavy scripts, disabling memory traces may reduce the volume of JSON ### `trace.[no]stack` - + -# Syntax + ```bash --trace.nostack, --trace.stack ``` - + + + Setting `--trace.nostack` disables tracing the operand stack for each operation. Setting `--trace.stack` enables it. Stack traces are enabled by default. ### `trace.[no]returndata` - + -# Syntax + ```bash --trace.noreturndata, --trace.returndata ``` - + + + Setting `--trace.noreturndata` disables tracing the return data for each operation. Setting `--trace.returndata` enables it. Return data traces are enabled by default. ### `[no]time` - + -# Syntax + ```bash --notime, --time ``` - + + + Setting `--notime` disables including time data in the summary output. Setting `--time` enables it. @@ -259,21 +302,25 @@ This is useful for testing and differential evaluations. ### `genesis` - + -# Syntax + ```bash --genesis= ``` -# Example + + + ```bash --genesis=/opt/besu/genesis.json ``` - + + + The [Besu genesis file](genesis-items.md) to use when evaluating the EVM. Most useful are the `alloc` items that set up accounts and their stored memory states. @@ -281,95 +328,113 @@ The [Besu genesis file](genesis-items.md) to use when evaluating the EVM. Most u ### `chain` - + -# Syntax + ```bash --chain= ``` -# Example + + + ```bash --chain=goerli ``` - + + + The well-known network genesis file to use when evaluating the EVM. These values are an alternative to the [`--genesis`](#genesis) option for well-known networks. ### `repeat` - + -# Syntax + ```bash --repeat= ``` -# Example + + + ```bash --repeat=1000 ``` - + + + Number of times to repeat the contract before gathering timing information. This is useful when benchmarking EVM operations. The default is `0`. ### `revert-reason-enabled` - + -# Syntax + ```bash --revert-reason-enabled ``` - + + + Enables tracing the reason included in `REVERT` operations. The revert reason is enabled by default. ### `fork` - + -# Syntax + ```bash --fork= ``` -# Example + + + ```bash --fork=FutureEips ``` - + + + Specific fork to evaluate, overriding network settings. ### `key-value-storage` - + -# Syntax + ```bash --key-value-storage= ``` -# Example + + + ```bash --key-value-storage=rocksdb ``` - + + + Kind of key value storage to use. @@ -379,55 +444,65 @@ When set to `rocksdb` and combined with [`--data-path`](#data-path), [`--block-n ### `data-path` - + -# Syntax + ```bash --data-path= ``` -# Example + + + ```bash --data-path=/opt/besu/data ``` - + + + When [`--key-value-storage`](#key-value-storage) is set to `rocksdb`, specifies the location of the database on disk. ### `block-number` - + -# Syntax + ```bash --block-number= ``` -# Example + + + ```bash --block-number=10000000 ``` - + + + The block number to evaluate the code against. Used to ensure that the EVM is evaluating the code against the correct fork, or to specify the world state when [`--key-value-storage`](#key-value-storage) is set to `rocksdb`. ### `version` - + -# Syntax + ```bash --version ``` - + + + Displays the version information. @@ -439,15 +514,17 @@ The `state-test` subcommand allows the [Ethereum state tests](https://github.com ### `json`, `trace` - + -# Syntax + ```bash --json ``` - + + + Provides an operation-by-operation trace of the command in JSON. @@ -457,15 +534,17 @@ Set this option for EVM Lab Fuzzing. Whether or not `--json` is set, a summary J ### `[no]memory`, `trace.[no]memory` - + -# Syntax + ```bash --[no]memory ``` - + + + Setting `--nomemory` disables tracing the memory output for each operation. Setting `--memory` enables it. Memory traces are disabled by default. @@ -477,41 +556,49 @@ For memory heavy scripts, disabling memory traces may reduce the volume of JSON If you use command arguments, you can list one or more state tests. All the state tests are evaluated in the order they are specified. - - -# Docker example + + ```bash docker run --rm -v ${PWD}:/opt/referencetests hyperledger/besu-evmtool:develop --json state-test /opt/referencetests/GeneralStateTests/stExample/add11.json ``` -# CLI example + + + + ```bash evm --json state-test stExample/add11.json ``` - + + + ### Use standard input If no reference tests are passed in using the command line, the EVM tool loads one complete JSON object from standard input and executes that state test. - + -# Docker example + ```bash docker run --rm -i hyperledger/besu-evmtool:develop --json state-test < stExample/add11.json ``` -# CLI example + + + ```bash evm --json state-test < stExample/add11.json ``` - + + + ## EOF code validation @@ -519,21 +606,24 @@ The `code-validate` subcommand allows [Ethereum object formatted (EOF)](https:// ### `file` - + -# Syntax + ```bash --file= ``` -# Example + + ```bash --file=eof.txt ``` - + + + File containing one or more EOF containers or EVM bytecode. Each line in the file is considered a separate program. @@ -541,21 +631,24 @@ File containing one or more EOF containers or EVM bytecode. Each line in the fil If you use command arguments, each argument is considered a separate program. If a code segment includes spaces, it must be contained in quotes. - + -# Docker example + ```bash docker run --rm hyperledger/besu-evmtool:develop code-validate "0xef0001 010008 020002-0007-0002 030000 00 00000002-02010002 59-59-b00001-50-b1 03-b1" 0xef0002 0xef00010100040200010001030000000000000000 ``` -# CLI example + + ```bash evm code-validate "0xef0001 010008 020002-0007-0002 030000 00 00000002-02010002 59-59-b00001-50-b1 03-b1" 0xef0002 0xef00010100040200010001030000000000000000 ``` - + + + ### Use standard input diff --git a/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-mainnet.md b/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-mainnet.md index 56fa7eaaa14..7252c156d3b 100644 --- a/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-mainnet.md +++ b/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-mainnet.md @@ -6,6 +6,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Run Besu and Teku on Mainnet Run Besu as an [execution client](../concepts/the-merge.md#execution-clients) and [Teku](https://docs.teku.consensys.net/) as a [consensus client](../concepts/the-merge.md#consensus-clients) on Ethereum Mainnet. @@ -137,9 +140,9 @@ You can modify the option values and add other [Teku command line options] as ne After starting Besu and Teku, your node starts syncing and connecting to peers. - + -# Besu logs + ```json {"@timestamp":"2023-02-03T04:43:49,555","level":"INFO","thread":"main","class":"DefaultSynchronizer","message":"Starting synchronizer.","throwable":""} @@ -156,7 +159,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 {"@timestamp":"2023-02-03T04:51:28,985","level":"INFO","thread":"EthScheduler-Services-29 (importBlock)","class":"FastImportBlocksStep","message":"Block import progress: 180400 of 16545859 (1%)","throwable":""} ``` -# Teku logs + + + ```bash 2022-03-21 20:43:24.355 INFO - Syncing *** Target slot: 76092, Head slot: 2680, Remaining slots: 73412, Connected peers: 8 @@ -166,7 +171,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 2022-03-21 20:44:12.353 INFO - Syncing *** Target slot: 76096, Head slot: 3519, Remaining slots: 72577, Connected peers: 9 ``` - + + + If you're running Teku as a beacon node only, you're all set. If you're also running Teku as a validator client, ensure Besu and Teku are fully synced before submitting your staking deposit in the next step. Syncing Besu can take several days. diff --git a/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-testnet.md b/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-testnet.md index c270a234b58..4da3aa4f3eb 100644 --- a/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-testnet.md +++ b/versioned_docs/version-23.7.3/public-networks/tutorials/besu-teku-testnet.md @@ -6,6 +6,9 @@ tags: - public networks --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + # Run Besu and Teku on a testnet Run Besu as an [execution client](../concepts/the-merge.md#execution-clients) and [Teku](https://docs.teku.consensys.net/) as a [consensus client](../concepts/the-merge.md#consensus-clients) on the [Goerli](https://github.com/eth-clients/goerli) and [Sepolia](https://github.com/eth-clients/sepolia) Ethereum testnets. @@ -58,9 +61,9 @@ Save the password you use to generate each key pair in a `.txt` file. You should Run the following command or specify the options in a [configuration file](../how-to/configuration-file.md): - + -# Goerli + ```bash besu \ @@ -76,7 +79,9 @@ besu \ --engine-jwt-secret= ``` -# Sepolia + + + ```bash besu \ @@ -92,7 +97,9 @@ besu \ --engine-jwt-secret= ``` - + + + Specify the path to the `jwtsecret.hex` file generated in [step 2](#2-generate-the-shared-secret) using the [`--engine-jwt-secret`](../reference/cli/options.md#engine-jwt-secret) option. @@ -106,9 +113,9 @@ Open a new terminal window. To run Teku as a beacon node only (without validator duties), run the following command or specify the options in the [Teku configuration file]: - + -# Goerli + ```bash teku \ @@ -119,7 +126,9 @@ teku \ --rest-api-enabled=true ``` -# Sepolia + + + ```bash teku \ @@ -130,7 +139,9 @@ teku \ --rest-api-enabled=true ``` - + + + Specify the path to the `jwtsecret.hex` file generated in [step 2](#2-generate-the-shared-secret) using the [`--ee-jwt-secret-file`](https://docs.teku.consensys.net/Reference/CLI/CLI-Syntax/#ee-jwt-secret-file) option. @@ -140,9 +151,9 @@ You can modify the option values and add other [Teku command line options] as ne To run Teku as a beacon node and validator in a single process, run the following command or specify the options in the [Teku configuration file]: - + -# Goerli + ```bash teku \ @@ -155,11 +166,15 @@ teku \ --validator-keys=:[,:,...] ``` -# Sepolia + + + Sepolia is a permissioned network and you can't run a validator client on it without [requesting to become a validator](https://notes.ethereum.org/zvkfSmYnT0-uxwwEegbCqg) first. - + + + Specify: @@ -173,9 +188,9 @@ You can modify the option values and add other [Teku command line options] as ne After starting Besu and Teku, your node starts syncing and connecting to peers. - + -# Besu logs + ```json {"@timestamp":"2023-02-03T04:43:49,555","level":"INFO","thread":"main","class":"DefaultSynchronizer","message":"Starting synchronizer.","throwable":""} @@ -192,7 +207,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 {"@timestamp":"2023-02-03T04:51:28,985","level":"INFO","thread":"EthScheduler-Services-29 (importBlock)","class":"FastImportBlocksStep","message":"Block import progress: 180400 of 16545859 (1%)","throwable":""} ``` -# Teku logs + + + ```bash 2022-03-21 20:43:24.355 INFO - Syncing *** Target slot: 76092, Head slot: 2680, Remaining slots: 73412, Connected peers: 8 @@ -202,7 +219,9 @@ cb9f0fcc6f16386df70da3c5). State root 0xa7114541f42c62a72c8b6bb9901c2ccf4b424cd7 2022-03-21 20:44:12.353 INFO - Syncing *** Target slot: 76096, Head slot: 3519, Remaining slots: 72577, Connected peers: 9 ``` - + + + If you're running Teku as a beacon node only, you're all set. If you're also running Teku as a validator client, ensure Besu and Teku are fully synced before submitting your staking deposit in the next step. Syncing Besu can take several days.