Current Support: The Simple Config Generator currently supports EVM chains and Solana. Aptos support is not yet available.
Why Migrate to Simple Config?
The Simple Config Generator offers several advantages over manual configuration:- Reduced complexity: Fewer configuration parameters to manage
- Automatic bidirectional connections: Define one pathway, get both directions
- Built-in best practices: Uses recommended DVN and executor configurations
- Cross-VM compatibility: Works seamlessly with EVM chains, Solana, and other supported VMs
- Less error-prone: Automated configuration generation reduces manual errors
- VM-agnostic: Same configuration approach works across different virtual machines
Before Migration: Manual Configuration
In the traditional manual approach, you would need to:- Define each connection direction separately
- Manually specify send and receive libraries
- Configure ULN settings for each direction
- Set up executor configurations
- Define enforced options for each pathway
- Handle VM-specific configurations separately
After Migration: Simple Config
With the Simple Config Generator, the same configuration becomes much simpler and works across all VMs:Migration Steps
1. Install Required Dependencies
2. Update Your Configuration File
- EVM Chains Only
- EVM + Solana
Replace your manual
layerzero.config.ts with the Simple Config approach:3. Update Your Deployment Scripts
Replace your manual wire commands with the Simple Config approach:Key Differences
| Aspect | Manual Config | Simple Config |
|---|---|---|
| Connection Definition | Define each direction separately | Define once, get bidirectional |
| DVN Configuration | Manual specification | Automated with metadata |
| Executor Setup | Manual configuration | Automated with metadata |
| Library Selection | Manual specification | Automated with metadata |
| VM-Specific Handling | Separate configs per VM | Unified approach |
| Configuration Length | 100+ lines per pathway | ~20 lines per pathway |
| Error Prone | High (manual configuration) | Low (automated generation) |
Configuration Parameters Explained
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.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
Confirmations
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)
Aptos Support: Aptos is not yet supported by the Simple Config Generator. Use manual configuration for Aptos integrations.
Migration Checklist
- Install
@layerzerolabs/metadata-tools - Update
layerzero.config.tsto use Simple Config format - Define your contract objects with correct EIDs
- Configure enforced options for your use case
- Set appropriate DVN requirements
- Handle VM-specific requirements (
addressfor Solana contract objects) - Test by running
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts(if there were no config changes, there should be no transactions to be submitted)
Troubleshooting
Common Issues
- Missing Dependencies: Ensure
@layerzerolabs/metadata-toolsis installed - Incorrect EndpointId: Verify you are using the correct Endpoint ID (if using Endpoint V2, the constant name should include
V2) - VM-Specific Requirements: Remember to specify
addressfor Solana contracts andvaluefor enforced optionsmsgType1 when sending to Solana. - Gas Estimation: Profile your contracts to set appropriate gas limits
Getting Help
If you encounter issues during migration:- Check the Simple Config documentation
- Review the examples in devtools
- Consult VM-specific documentation.