Overview
Configuration is done through the SDK provided by@layerzerolabs/lz-v2-protocol-starknet. All examples use SDK methods to interact with the Endpoint and message library contracts.
Configuration flow:
- Set delegate (required if configuring via external account)
- Set message libraries (optional)
- Configure DVNs for send/receive (optional but recommended)
- Set enforced options (optional)
- Set peer addresses (required - opens pathway, call last!)
SDK Setup
Prerequisite: Set Delegate
Endpoint configuration calls (set_send_library, set_receive_library, set_send_configs, set_receive_configs) require the caller to be the OApp itself or an authorized delegate. If you’re configuring from an external account, set a delegate first (owner-only):
Default Configuration
LayerZero provides sensible defaults. If you don’t configure custom settings:
You can query the default configuration via the Endpoint or check LayerZero Deployments.
Configuration Methods
Set Peer
Set Message Libraries
DEFAULT_SEND_LIB_UNAVAILABLE or UNSUPPORTED_EID, set the send/receive libraries explicitly and ensure the EID is supported by the ULN.
DVN Configuration
Configure Send DVN (Outbound)
Configure Receive DVN (Inbound)
ULN Configuration Structure
has_ Fields*The
has_* fields indicate whether the corresponding value should override the default configuration. Set them to true when you want to use custom values, otherwise the protocol defaults will be used.MessageLibConfigType.EXECUTOR = 1, MessageLibConfigType.ULN = 2
Configuring Executor
The Executor delivers messages on the destination chain.Executor Config Structure
Setting Enforced Options
Enforced options set minimum execution parameters that users cannot override. This requires the OAppOptionsType3 component (included in OFT contracts). If your ABI doesn’t exposeset_enforced_options, load your compiled contract artifact and call the entrypoint directly.
sncast, call the entrypoint directly:
Message Types
Complete Configuration Example
Reading Configuration
Get Current Send Config
Get Current Receive Config
Get Peer
Gas Recommendations
Next Steps
- Protocol Overview - Message lifecycle
- Technical Reference - Deployment guide
- Troubleshooting - Configuration errors