### Run the local dapp Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Commands to install dependencies and start the Next.js development server for the dapp. ```bash cd frontend npm install --legacy-peer-deps npm run dev ``` -------------------------------- ### Start Chainlens with Developer Quickstart Source: https://besu.hyperledger.org/private-networks/how-to/monitor/chainlens Launch Chainlens using Docker Compose with the specified node endpoint and network configuration. ```bash NODE_ENDPOINT=http://rpcnode:8545 docker-compose -f docker-compose.yml -f chainlens-extensions/docker-compose-quorum-dev-quickstart.yml up ``` -------------------------------- ### Start Node-3 Source: https://besu.hyperledger.org/private-networks/tutorials/ibft Command to start the third node with unique P2P and RPC ports. ```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 --profile=ENTERPRISE ``` ```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 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-3 on Windows Source: https://besu.hyperledger.org/private-networks/tutorials/ethash Use this command to start Node-3 on Windows, specifying the Node-1 enode URL as the bootnode. ```bash besu --data-path=data --genesis-file=..\privateNetworkGenesis.json --bootnodes= --p2p-port=30305 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-2 Source: https://besu.hyperledger.org/private-networks/tutorials/ibft Command to start the second node, connecting it to the network via the Node-1 enode URL. ```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 --profile=ENTERPRISE ``` ```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 --profile=ENTERPRISE ``` -------------------------------- ### Start Besu node Source: https://besu.hyperledger.org/private-networks/reference/cli/subcommands General syntax for starting a Besu node using subcommands. ```bash besu [OPTIONS] [SUBCOMMAND] [SUBCOMMAND OPTIONS] ``` -------------------------------- ### Genesis file transition example for block header mode Source: https://besu.hyperledger.org/private-networks/how-to/configure/consensus/add-validators-without-voting A concrete example of configuring a transition to block header mode at a specific block height. ```json { "config": { ... "qbft": { "blockperiodseconds": 2, "epochlength": 30000, "requesttimeoutseconds": 4, "validatorcontractaddress": "0x0000000000000000000000000000000000007777" }, "transitions": { "qbft": [ { "block": 2555, "validatorselectionmode": "blockheader", "validators": [ "0x372a70ace72b02cc7f1757183f98c620254f9c8d", "0x9811ebc35d7b06b3fa8dc5809a1f9c52751e1deb" ] } ] } }, ... } ``` -------------------------------- ### Genesis file transition example for reverting to contract mode Source: https://besu.hyperledger.org/private-networks/how-to/configure/consensus/add-validators-without-voting A concrete example of configuring a transition back to contract mode at a specific block height. ```json { "config": { ... "qbft": { "blockperiodseconds": 2, "epochlength": 30000, "requesttimeoutseconds": 4, "validatorcontractaddress": "0x0000000000000000000000000000000000007777" }, "transitions": { "qbft": [ { "block": 2555, "validatorselectionmode": "blockheader", "validators": [ "0x372a70ace72b02cc7f1757183f98c620254f9c8d", "0x9811ebc35d7b06b3fa8dc5809a1f9c52751e1deb" ] }, { "block": 2755, "validatorselectionmode": "contract", "validatorcontractaddress": "0x0000000000000000000000000000000000009999" } ] } }, ... } ``` -------------------------------- ### JSON-RPC Response Example Source: https://besu.hyperledger.org/private-networks/get-started/start-node Example output returned by the eth_syncing method. ```json { "jsonrpc": "2.0", "id": 1, "result": { "startingBlock": "0x0", "currentBlock": "0x2d0", "highestBlock": "0x66c0" } } ``` -------------------------------- ### Start Node-4 Source: https://besu.hyperledger.org/private-networks/tutorials/ibft Command to start the fourth node with unique P2P and RPC ports. ```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 --profile=ENTERPRISE ``` ```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 --profile=ENTERPRISE ``` -------------------------------- ### Deploy contract to Quickstart network Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Command to deploy a contract using Hardhat targeting the quickstart network. ```bash npx hardhat run ./scripts/deploy_quorumtoken.ts --network quickstart ``` -------------------------------- ### Start Chainlens Services Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Navigate to the `docker-compose` directory and run this command to start the Chainlens services. Ensure you set the `NODE_ENDPOINT` and `PORT` environment variables. ```bash cd docker-compose NODE_ENDPOINT=member1besu PORT=26000 docker-compose -f docker-compose.yml -f chainlens-extensions/docker-compose-quorum-dev-quickstart.yml up ``` -------------------------------- ### Configure Hardhat for Quorum network Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Example configuration for the networks object in hardhat.config.js to connect to the Quickstart RPC endpoint. ```javascript module.exports = { networks: { // in built test network to use when developing contracts hardhat: { chainId: 1337 }, quickstart: { url: "http://127.0.0.1:8545", chainId: 1337, // test accounts only, all good ;) accounts: [ "0x8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63", "0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3", "0xae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f" ] } }, defaultNetwork: "hardhat", ... ... ``` -------------------------------- ### Start Node for Testing Source: https://besu.hyperledger.org/private-networks/get-started/start-node Start a Besu node in development mode with permissive CORS and host settings for testing. ```bash besu --network=dev --rpc-http-cors-origins="all" --host-allowlist="*" --rpc-ws-enabled --rpc-http-enabled --data-path=/tmp/tmpDatdir ``` -------------------------------- ### Start Node-1 (Windows) Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Command to start Node-1 with permissions enabled, JSON-RPC API active, and enterprise profile. Ensure you are in the Node-1 data directory. ```batch 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="*" --profile=ENTERPRISE ``` -------------------------------- ### Deployment Output Example Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Expected console output after running compilation, testing, and deployment commands. ```text # compile > quorumToken@1.0.0 compile > npx hardhat compile Generating typings for: 5 artifacts in dir: typechain-types for target: ethers-v6 Successfully generated 24 typings! Compiled 5 Solidity files successfully # test > quorumToken@1.0.0 test > npx hardhat test QuorumToken Deployment ✔ Should have the correct initial supply (1075ms) ✔ Should token transfer with correct balance (78ms) 2 passing (1s) # deploy Contract deploy at: 0x5FbDB2315678afecb367f032d93F642f64180aa3 ``` -------------------------------- ### Start Node-3 on MacOS Source: https://besu.hyperledger.org/private-networks/tutorials/ethash Use this command to start Node-3 on MacOS, specifying the Node-1 enode URL as the bootnode. ```bash besu --data-path=data --genesis-file=../privateNetworkGenesis.json --bootnodes= --p2p-port=30305 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-2 (Windows) Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Command to start Node-2, specifying different P2P and RPC ports, with permissions and enterprise profile enabled. Ensure you are in the Node-2 data directory. ```batch 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 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-3 (Windows) Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Command to start Node-3, specifying unique P2P and RPC ports, with permissions and enterprise profile enabled. Ensure you are in the Node-3 data directory. ```batch 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 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-3 - Windows Source: https://besu.hyperledger.org/private-networks/tutorials/qbft Command to start Node-3 on Windows, connecting it to the bootnode. It uses distinct P2P and RPC ports and specifies the bootnode enode URL. ```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 --profile=ENTERPRISE ``` -------------------------------- ### Start the network Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Executes the startup script to build Docker images and launch the network containers. ```bash ./run.sh ``` -------------------------------- ### Start Node-4 - Windows Source: https://besu.hyperledger.org/private-networks/tutorials/qbft Command to start Node-4 on Windows, connecting it to the bootnode. It assigns unique P2P and RPC ports and includes the bootnode enode URL. ```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 --profile=ENTERPRISE ``` -------------------------------- ### Install Besu via Homebrew Source: https://besu.hyperledger.org/private-networks/get-started/install/binary-distribution Use these commands to add the Besu tap and install the binary on MacOS. ```bash brew tap hyperledger/besu brew install hyperledger/besu/besu ``` -------------------------------- ### Start Node-1 (MacOS) Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Command to start Node-1 with permissions enabled, JSON-RPC API active, and enterprise profile. Ensure you are in the Node-1 data directory. ```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="*" --profile=ENTERPRISE ``` -------------------------------- ### Deploy Quorum-Explorer Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/charts Installs the Quorum-Explorer chart for development or demonstration purposes. ```bash helm install quorum-explorer ./charts/explorer --namespace besu --values ./values/explorer-besu.yaml ``` -------------------------------- ### Start Node on Private Network Source: https://besu.hyperledger.org/private-networks/get-started/start-node Start a node on a private network by specifying a custom genesis file and data path. ```bash besu --genesis-file=/genesis.json --data-path= --rpc-http-enabled --bootnodes= ``` -------------------------------- ### Start Besu on Sepolia network using environment variables Source: https://besu.hyperledger.org/private-networks/get-started/install/run-docker-image Start a Besu node for the Sepolia testnet using environment variables to enable HTTP JSON-RPC and specify the network. Ensure a volume is mounted at a custom data path if state persistence is required. ```bash docker run -p 30303:30303 -p 8545:8545 -e BESU_RPC_HTTP_ENABLED=true -e BESU_NETWORK=sepolia hyperledger/besu:latest ``` -------------------------------- ### Start Node-2 (MacOS) Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Command to start Node-2, specifying different P2P and RPC ports, with permissions and enterprise profile enabled. Ensure you are in the Node-2 data directory. ```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 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-3 (MacOS) Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Command to start Node-3, specifying unique P2P and RPC ports, with permissions and enterprise profile enabled. Ensure you are in the Node-3 data directory. ```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 --profile=ENTERPRISE ``` -------------------------------- ### Start Besu Node-4 Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Starts a Besu node with specific data paths, genesis files, and RPC configurations. The command differs slightly between operating systems due to path separators. ```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 --profile=ENTERPRISE ``` ```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 --profile=ENTERPRISE ``` -------------------------------- ### Start Node-1 as Bootnode Source: https://besu.hyperledger.org/private-networks/tutorials/ibft Command to initialize the first node, which acts as the bootnode for the network. ```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" --profile=ENTERPRISE ``` ```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" --profile=ENTERPRISE ``` -------------------------------- ### Start Node-2 on Windows Source: https://besu.hyperledger.org/private-networks/tutorials/ethash Starts the second node of the private network on Windows, connecting to the bootnode. Specifies a different P2P port and uses the bootnode's enode URL for discovery. ```bash besu --data-path=data --genesis-file=..\privateNetworkGenesis.json --bootnodes= --p2p-port=30304 --profile=ENTERPRISE ``` -------------------------------- ### Start Besu on Ephemery network using environment variables Source: https://besu.hyperledger.org/private-networks/get-started/install/run-docker-image Start a Besu node for the Ephemery testnet using environment variables to enable HTTP JSON-RPC and specify the network. Ensure a volume is mounted at a custom data path if state persistence is required. ```bash docker run -p 30303:30303 -p 8545:8545 -e BESU_RPC_HTTP_ENABLED=true -e BESU_NETWORK=ephemery hyperledger/besu:latest ``` -------------------------------- ### Start Node-3 - MacOS Source: https://besu.hyperledger.org/private-networks/tutorials/qbft Command to start Node-3 on MacOS, connecting it to the bootnode. It uses distinct P2P and RPC ports and specifies the bootnode enode URL. ```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 --profile=ENTERPRISE ``` -------------------------------- ### Install AKS Preview Extensions Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/cluster Add or update the aks-preview extension for the Azure CLI. ```bash az extension add --name aks-preview az extension update --name aks-preview ``` -------------------------------- ### Start Node-4 - MacOS Source: https://besu.hyperledger.org/private-networks/tutorials/qbft Command to start Node-4 on MacOS, connecting it to the bootnode. It assigns unique P2P and RPC ports and includes the bootnode enode URL. ```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 --profile=ENTERPRISE ``` -------------------------------- ### QBFT Validator Transition Example Source: https://besu.hyperledger.org/private-networks/how-to/configure/consensus/add-validators-without-voting An example of specifying validator addresses for a QBFT network at block 25 in the genesis file. This configuration will take effect after block 25 is processed. ```json { "config": { ... "qbft": { "blockperiodseconds": 2, "epochlength": 30000, "requesttimeoutseconds": 4 }, "transitions": { "qbft": [ { "block": 25, "validators": [ "0x372a70ace72b02cc7f1757183f98c620254f9c8d", "0x9811ebc35d7b06b3fa8dc5809a1f9c52751e1deb" ] } ] } }, ... } ``` -------------------------------- ### Start Node-1 (Bootnode) - Windows Source: https://besu.hyperledger.org/private-networks/tutorials/qbft Command to start the first node (bootnode) on Windows. It specifies the data path, genesis file, enables RPC HTTP, and configures API access and security settings. ```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" --profile=ENTERPRISE ``` -------------------------------- ### Start First Node (Bootnode) on Windows Source: https://besu.hyperledger.org/private-networks/tutorials/ethash Initializes and starts the first node of the private network on Windows. Enables JSON-RPC API and allows all hosts and origins for access. This node acts as the bootnode. ```bash besu --data-path=data --genesis-file=..\privateNetworkGenesis.json --rpc-http-enabled --host-allowlist="*" --rpc-http-cors-origins="all" --profile=ENTERPRISE ``` -------------------------------- ### Kubectl Version Output Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/charts Example output showing client and server version information. ```text Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1", GitCommit:"86ec240af8cbd1b60bcc4c03c20da9b98005b92e", GitTreeState:"clean", BuildDate:"2021-12-16T11:41:01Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeState:"clean", BuildDate:"2021-10-27T18:35:25Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"} ``` -------------------------------- ### Dapp development server output Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Example output showing the dapp binding to port 3001. ```text > webapp@0.1.0 dev > next dev -p 3001 - ready started server on [::]:3001, url: http://localhost:3001 - event compiled client and server successfully in 270 ms (18 modules) - wait compiling... - event compiled client and server successfully in 173 ms (18 modules) ``` -------------------------------- ### Deploy QuorumToken Commands Source: https://besu.hyperledger.org/private-networks/tutorials/quickstart Commands to install dependencies, compile, test, and deploy the QuorumToken contract. ```bash cd dapps/quorumToken # install dependencies npm install --legacy-peer-deps # compile the contract npm run compile npm run test # deploy the contract to the quickstart network npm run deploy-quorumtoken ``` -------------------------------- ### Initialize accounts and check balances Source: https://besu.hyperledger.org/private-networks/tutorials/contracts/transfer-funds Sets up a pre-seeded account and a new account, then retrieves their initial balances. ```javascript const web3 = new Web3(host); // Pre-seeded account with 90000 ETH const privateKeyA = "0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"; const accountA = web3.eth.accounts.privateKeyToAccount(privateKeyA); var accountABalance = web3.utils.fromWei( await web3.eth.getBalance(accountA.address), ); console.log("Account A has balance of: " + accountABalance); // Create a new account to transfer ETH to var accountB = web3.eth.accounts.create(); var accountBBalance = web3.utils.fromWei( await web3.eth.getBalance(accountB.address), ); console.log("Account B has balance of: " + accountBBalance); ``` -------------------------------- ### IBFT Get Validators Response Source: https://besu.hyperledger.org/private-networks/reference/api Example JSON response when successfully retrieving validators by block hash. It returns an array of validator addresses. ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x42d4287eac8078828cf5f3486cfe601a275a49a5", "0xb1b2bc9582d2901afdc579f528a35ca41403fa85", "0xef1bfb6a12794615c9b0b5a21e6741f01e570185" ] } ``` -------------------------------- ### Sample permissions configuration file Source: https://besu.hyperledger.org/private-networks/how-to/use-local-permissioning Example structure for a permissions configuration file containing both accounts and nodes allowlists. ```toml accounts-allowlist=["0xb9b81ee349c3807e46bc71aa2632203c5b462032", "0xb9b81ee349c3807e46bc71aa2632203c5b462034"] nodes-allowlist=["enode://7e4ef30e9ec683f26ad76ffca5b5148fa7a6575f4cfad4eb0f52f9c3d8335f4a9b6f9e66fcc73ef95ed7a2a52784d4f372e7750ac8ae0b544309a5b391a23dd7@127.0.0.1:30303","enode://2feb33b3c6c4a8f77d84a5ce44954e83e5f163e7a65f7f7a7fec499ceb0ddd76a46ef635408c513d64c076470eac86b7f2c8ae4fcd112cb28ce82c0d64ec2c94@127.0.0.1:30304","enode://7b61d5ee4b44335873e6912cb5dd3e3877c860ba21417c9b9ef1f7e500a82213737d4b269046d0669fb2299a234ca03443f25fe5f706b693b3669e5c92478ade@127.0.0.1:30305"] ``` -------------------------------- ### Start Besu Node-5 Source: https://besu.hyperledger.org/private-networks/tutorials/permissioning Commands to initialize a new node in a permissioned network, specifying bootnodes and RPC settings. ```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 ``` ```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 ``` -------------------------------- ### Example Validator Selection Transition Source: https://besu.hyperledger.org/private-networks/how-to/configure/consensus/qbft An example of switching to contract-based validator selection at block 102885. ```json { "config": { ... "qbft": { "blockperiodseconds": 5, "epochlength": 30000, "requesttimeoutseconds": 10 }, "transitions": { "qbft": [ { "block": 102885, "validatorselectionmode": "contract", "validatorcontractaddress": "0x0000000000000000000000000000000000007777" } ] } }, ... } ``` -------------------------------- ### Start a Minikube cluster Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/cluster Initializes a local Kubernetes cluster with specific CPU and memory requirements recommended for Besu. ```bash minikube start --cpus 2 --memory 16384 --cni auto ``` -------------------------------- ### IBFT extra data encoding example Source: https://besu.hyperledger.org/private-networks/reference/cli/subcommands Example of JSON input and the resulting RLP encoded output. ```json [ "be068f726a13c8d46c44be6ce9d275600e1735a4", "5ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193" ] ``` ```text 0xf853a00000000000000000000000000000000000000000000000000000000000000000ea94be068f726a13c8d46c44be6ce9d275600e1735a4945ff6f4b66a46a2b2310a6f3a93aaddc0d9a1c193808400000000c0 ``` -------------------------------- ### Verify Linux Binary Installation Source: https://besu.hyperledger.org/private-networks/get-started/install/binary-distribution Command to verify the installation of the unpacked Besu binary on Linux systems. ```bash bin/besu --help ``` -------------------------------- ### Verify Besu Installation Source: https://besu.hyperledger.org/private-networks/get-started/install/binary-distribution Commands to check the installed version or access the command line help interface. ```bash besu --version ``` ```bash besu --help ``` -------------------------------- ### Start Besu with TLS configuration Source: https://besu.hyperledger.org/private-networks/how-to/configure/tls Command-line flags to enable HTTP JSON-RPC with TLS and client authentication. ```bash besu --rpc-http-enabled --rpc-http-tls-enabled --rpc-http-tls-client-auth-enabled --rpc-http-tls-keystore-file=/Users/me/my_node/keystore.pfx --rpc-http-tls-keystore-password-file=/Users/me/my_node/keystorePassword --rpc-http-tls-known-clients-file=/Users/me/my_node/knownClients --rpc-http-tls-cipher-suite=TLS_AES_256_GCM_SHA384 --rpc-http-tls-protocol=TLSv1.3,TLSv1.2 ``` -------------------------------- ### Example Mining Beneficiary Transition Source: https://besu.hyperledger.org/private-networks/how-to/configure/consensus/qbft An example of updating the mining beneficiary address at block 10000 and clearing the override at block 20000. ```json { "config": { ... "qbft": { "blockperiodseconds": 5, "epochlength": 30000, "requesttimeoutseconds": 10 }, "transitions": { "qbft": [ { "block": 10000, "miningbeneficiary": "0x0000000000000000000000000000000000000002", }, { "block": 20000, "miningbeneficiary": "", } ] } }, ... } ``` -------------------------------- ### Example Revert Reason String Source: https://besu.hyperledger.org/private-networks/how-to/send-transactions/revert-reason This is an example of a complete ABI-encoded revert reason string for the message 'Not enough Ether provided'. ```plaintext "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a4e6f7420656e6f7567682045746865722070726f76696465642e000000000000" ``` -------------------------------- ### Create a kind cluster Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/cluster Initializes a lightweight local Kubernetes cluster using Docker. ```bash kind create cluster ``` -------------------------------- ### Start new IBFT 2.0 node Source: https://besu.hyperledger.org/private-networks/tutorials/ibft/validators Start a new Besu node for an IBFT 2.0 network, specifying the bootnode and necessary ports. ```bash besu --data-path=data --genesis-file=../genesis.json --bootnodes= --p2p-port=30307 --rpc-http-enabled --rpc-http-api=ETH,NET,IBFT --host-allowlist="*" --rpc-http-cors-origins="all" --rpc-http-port=8549 --profile=ENTERPRISE ``` -------------------------------- ### Deploy Elastic Stack for Logs and Metrics Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/charts Installs Elasticsearch, Kibana, and Filebeat using Helm charts for log aggregation and analysis. Adjust replica counts for local deployments. ```bash helm repo add elastic https://helm.elastic.co helm repo update # if on cloud helm install elasticsearch --version 7.17.1 elastic/elasticsearch --namespace quorum --values ./values/elasticsearch.yml # if local - set the replicas to 1 helm install elasticsearch --version 7.17.1 elastic/elasticsearch --namespace quorum --values ./values/elasticsearch.yml --set replicas=1 --set minimumMasterNodes: 1 helm install kibana --version 7.17.1 elastic/kibana --namespace quorum --values ./values/kibana.yml helm install filebeat --version 7.17.1 elastic/filebeat --namespace quorum --values ./values/filebeat.yml ``` -------------------------------- ### Node Configuration File Source: https://besu.hyperledger.org/private-networks/get-started/start-node Configuration file format for starting a node with equivalent settings to the command line. ```toml network="dev" rpc-http-cors-origins=["all"] host-allowlist=["*"] rpc-ws-enabled=true rpc-http-enabled=true data-path="/tmp/tmpdata-path" ``` -------------------------------- ### Genesis Chart Configuration Example Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/charts Example of an override values.yml file for the genesis chart. Configures cluster provider, cloud-native services, and cloud-specific settings for AWS and Azure. ```yaml --- quorumFlags: removeGenesisOnDelete: true cluster: provider: local # choose from: local | aws | azure cloudNativeServices: false aws: # the aws cli commands uses the name 'quorum-node-secrets-sa' so only change this if you altered the name serviceAccountName: quorum-node-secrets-sa # the region you are deploying to region: ap-southeast-2 azure: # the script/bootstrap.sh uses the name 'quorum-pod-identity' so only change this if you altered the name identityName: quorum-pod-identity # the clientId of the user assigned managed identity created in the template identityClientId: azure-clientId keyvaultName: azure-keyvault # the tenant ID of the key vault tenantId: azure-tenantId # the subscription ID to use - this needs to be set explicitly when using multi tenancy subscriptionId: azure-subscriptionId ``` -------------------------------- ### Start Chainlens with Network Tab Enabled Source: https://besu.hyperledger.org/private-networks/how-to/monitor/chainlens Launch Chainlens with the network tab enabled by setting the environment variable. ```bash NODE_ENDPOINT=http://member1besu:8545 DISPLAY_NETWORK_TAB=enabled docker-compose -f docker-compose.yml -f chainlens-extensions/docker-compose-quorum-dev-quickstart.yml up ``` -------------------------------- ### Start Node-2 on MacOS Source: https://besu.hyperledger.org/private-networks/tutorials/ethash Starts the second node of the private network on macOS, connecting to the bootnode. Specifies a different P2P port and uses the bootnode's enode URL for discovery. ```bash besu --data-path=data --genesis-file=../privateNetworkGenesis.json --bootnodes= --p2p-port=30304 --profile=ENTERPRISE ``` -------------------------------- ### Deploy Besu Genesis Chart with Helm Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/charts Install the Besu genesis chart using Helm to create the network's genesis configuration. Ensure to specify the correct values file for genesis configuration. ```bash cd helm helm install genesis ./charts/besu-genesis --namespace besu --create-namespace --values ./values/genesis-besu.yml ``` -------------------------------- ### Start First Node (Bootnode) on MacOS Source: https://besu.hyperledger.org/private-networks/tutorials/ethash Initializes and starts the first node of the private network on macOS. Enables JSON-RPC API and allows all hosts and origins for access. This node acts as the bootnode. ```bash besu --data-path=data --genesis-file=../privateNetworkGenesis.json --rpc-http-enabled --host-allowlist="*" --rpc-http-cors-origins="all" --profile=ENTERPRISE ``` -------------------------------- ### Install EBS CSI Driver Addon Source: https://besu.hyperledger.org/private-networks/tutorials/kubernetes/cluster Install the EBS CSI driver as an EKS addon, associating it with the previously created IAM role. Replace `CLUSTER_NAME`, `AWS_REGION`, and `AWS_ACCOUNT` with your deployment details. ```bash eksctl create addon --name aws-ebs-csi-driver --cluster CLUSTER_NAME --region AWS_REGION --service-account-role-arn arn:aws:iam::AWS_ACCOUNT:role/AmazonEKS_EBS_CSI_DriverRole --force ```