@layerzerolabs/metadata-tools package to provide a streamlined approach to configuring your OApp connections. It allows for a more simplified LayerZero config file.
Current Support: The Simple Config Generator currently supports EVM chains and Solana. Aptos support is not yet available.
-
Install metadata-tools:
pnpm add -D @layerzerolabs/metadata-tools -
Create a new LZ config file named
layerzero.config.ts(or edit your existing one) in the project root and use the examples below as a starting point:
- Note that only the Solana contract object requires
addressto be specified. Do not specifyaddressfor non-Solana contract objects. - The above examples contain a minimal mesh with only one pathway (two chains) for demonstration purposes. You are able to add as many pathways as you need into the
connectionsparam, viagenerateConnectionsConfig.
- If your pathways include Solana, run the Solana init config command:
- Run the wire command:
- EVM Only
- EVM + Solana
Key Features
- Automatic Bidirectional Connections: Define one pathway, get both directions automatically
- Built-in Best Practices: Uses recommended DVN and executor configurations
- Cross-VM Compatibility: Works seamlessly with EVM chains and Solana
- Reduced Complexity: Fewer configuration parameters to manage
- Less Error-Prone: Automated configuration generation reduces manual errors
Configuration Parameters
Pathway Definition
DVN Configuration
- Required DVNs: Must verify the message for it to be considered valid
- Optional DVNs: Additional verifiers (with threshold) for enhanced security
Enforced Options
VM-Specific Considerations
EVM Chains
- Use
contractNamefor contract identification - Gas values represent actual gas units
- Value is typically 0
Solana
- Use
addressfor contract identification (required) - Gas values represent compute units
- Value represents lamports (typically 2039280 for SPL token account rent)
Custom Metadata: For advanced use cases, you can provide custom metadata by passing a
fetchMetadata function to generateConnectionsConfig. This allows you to extend the default metadata with custom DVNs and executors.Next Steps
- Migrate from Manual Config: See the Migrate to Simple Config guide
- Production Deployment: Review and adjust settings for production environments
- Gas Optimization: Profile your contracts to set optimal gas limits
- Custom DVNs: Consider adding custom DVNs for enhanced security