Setup a Multichain Service
Overview
This guide walks you through configuring your AVS components for proper Multichain support, natively supported by the Othentic Stack, by modifying the following components:
Environment Variables
Specifying Target Chain on Task Submission
Prerequisites
For additional reference, see this Github repo for boilerplate code.
Environment Variables
The Othentic CLI natively supports multi-L2 configurations for L2-specific environment variables.
Set L2_CHAIN
Specify the names of all L2 chains, separated by commas. You can use standard chain names and specify specific environments as detailed here, or use numerical ChainId
s.
L2_CHAIN=<chain1>,<chain2>
Example
L2_CHAIN=amoy,base-sepolia
Set ATTESTATION_CENTER_ADDRESS
Specify all the AttestationCenter contracts for all L2 chains, separated by commas:
ATTESTATION_CENTER_ADDRESS=<chain_id_1>@<attestation_center_address_1>,<chain_id_2>@<attestation_center_address_2>
Example
ATTESTATION_CENTER_ADDRESS=80002@0x1C4E893Dcc1eAFbf59f8a75e0AbB49Cd841bCECc,84532@0x022AFc410f1190F9a9642AAB990d0668268327a6
Send tasks to the corresponding L2
In your Execution Service implementation, make sure to specify the correct targetChainId
parameter in the sendTask
RPC request sent to the AVS network.
If targetChainId
is not specified, the first chain listed in the .env
file will be used by default.
Example
{
"jsonrpc": "2.0",
"method": "sendTask",
"params": [
"proof_string", // <proofOfTask>
"extra_data", // <data>
"1", // <taskDefinitionId>
"0xabcd....7890", // <performerAddress>
"c35a......62df", // <signature>
"bls", // <signatureType>
"84532" // <targetChainId> <------ Pass target chain ID
]
}
Last updated