Chain Connector Configuration
The Chain Connector serves as a middleware linking the 2PM Node with blockchain systems. It abstracts the blockchain interface, enabling the 2PM Node to support a variety of different blockchain systems. Additionally, the Chain Connector is responsible for key management and signing tasks required by the blockchain system, ensuring the secure usage of these keys.
Downloading the Image
Copy and execute the following command to pull the Docker image:
Initializing Configuration
Before launching the Connector, it is necessary to first initialize its configuration:
Start by creating a new folder named 2pm_chain_connector
, which will serve as the root directory for launching the node:
Navigate into the node's root directory and enter the following command:
After executing this command, a new folder named config
will be created within the root directory 2pm_chain_connector
. This config
folder is used to store the node’s configuration files.
Modifying the Configuration File
Below is an example of a configuration file that needs to be updated according to your specific blockchain and smart contract requirements:
Next, you will need to update the following configurations in the evm
section of your file:
evm.nodeAddress and evm.privateKey: These are used to configure your blockchain wallet address and private key. You can generate these using any EVM-compatible wallet, such as MetaMask.
This wallet account will also be the one you need to use to stake $2PM before joining any subnets, and to receive rewards after performing computing tasks.
evm.provider: This should be set to your blockchain node's WebSocket URL.
evm.identity, evm.hfl, evm.datahub, and evm.hlr: These entries correspond to configurations for the IdentityContract, HFLContract, DataHub, and HLR smart contracts respectively. Each
contractAddress
field represents the address of the corresponding smart contract. In theevm.hlr.verifiers
section, you configure addresses for zero-knowledge proof verifiers specific to different input lengths, for instance,evm.hlr.verifiers.3
refers to the address for the smart contract PlonkVerifier3.
Each subnet has corresponding contracts deployed, and you will need to look up these contracts in the subnet information section (deployed smart contracts) to find them.
Last updated