Deploy Besu Onchain Permissioning Network¶
Prerequisites¶
- Metamask installed.
- Truffle installed.
Steps to achieve Besu OnChain Permissioning¶
Step 1: Configure Besu network configuration file.
-
Edit the Besu network configuration file. Refer to the guide for detailed instructions on editing the file.
-
To enable and use onchain permissioning, set the
network.permissioning.enabled
parameter totrue
in the Besu network configuration file. Below is a sample configuration for reference:network: type: besu version: 21.10.6 permissioning: enabled: true # Set to false if onchain permissioning is not required env:... docker:... config:... organizations:...
For reference, use sample configuration defined in the network-besu.yaml file.
Step 2: Deploy Besu network.
-
Utilize the site.yaml playbook to deploy the Besu network:
Step 3: Clone contracts and install dependencies.
-
Clone the permissioning-smart-contracts repository:
-
Change the directory to permissioning-smart-contracts:
-
Create a
.env
file to store environment variables with values defined based on your network configuration:
# Address of the Node Ingress contract in the genesis (ibftPermissionGenesisFile) file.
NODE_INGRESS_CONTRACT_ADDRESS=0x0000000000000000000000000000000000009999
# Address of the Account Ingress contract in the genesis (ibftPermissionGenesisFile) file.
ACCOUNT_INGRESS_CONTRACT_ADDRESS=0x0000000000000000000000000000000000008888
# Account used to deploy the permissioning contracts and become the first admin account.
BESU_NODE_PERM_ACCOUNT=<Metamask-Account-Address>
# Private key of the same account defined above, required to deploy the permissioning contracts.
BESU_NODE_PERM_KEY=<Metamask-Account-Private-Key>
# Besu uses the specified node to deploy the contracts, which is the first node in the network.
BESU_NODE_PERM_ENDPOINT=http://<organization-name>.<external-url-suffix>:<rpc-ambassador-port-number>
# The chain ID from the genesis (ibftPermissionGenesisFile) file.
CHAIN_ID=2018
# Enode URLs of permitted nodes. Specify multiple nodes (Node-1, Node-2, Node-3) as a comma-separated list.
INITIAL_ALLOWLISTED_NODES=<Enode-Address-Node-1>,<Enode-Address-Node-2>
# Addresses of initially allowed accounts. Specify multiple accounts as a comma-separated list.
INITIAL_ALLOWLISTED_ACCOUNTS=<Metamask-Account-1-Address>,<Metamask-Account-2-Address>
Step 4: Deploy the contracts.
Use the following command to deploy the contracts:
By following these steps, we will be able to successfully deploy a Besu Onchain Permissioning Network. Post network bootstrap permissioing smartcontract can be installed. Smartcontract installation steps can be found here