Prerequisites
Before deploying Gasolina, ensure you have:| Requirement | Details |
|---|---|
| Cloud Provider Account | AWS account with CDK permissions, or GCP account with billing enabled |
| Node.js | Version 18 or higher |
| Package Manager | npm, yarn, or pnpm |
| Cloud CLI | AWS CLI + CDK CLI, or gcloud CLI + Terraform |
| RPC Providers | Reliable endpoints for each supported chain (2+ per chain recommended) |
AWS Implementation
Step 1: Clone and Setup
Step 2: Configure AWS Authentication
Step 3: Choose Signer Type
You have two options for managing signing keys:- AWS KMS (Recommended)
- Mnemonic-based
AWS KMS provides HSM-backed signing keys that are automatically created and managed:
- Set
signerType: 'KMS'in your configuration - Specify
kmsNumOfSignersfor the number of keys to create - Keys are automatically created during CDK deployment
- Hardware security module protection
- Automatic key rotation support
- No manual secret management
Step 4: Configure Infrastructure
Editcdk/gasolina/config/index.ts:
| Config Option | Description |
|---|---|
projectName | Unique project identifier (used for S3 bucket naming) |
environment | mainnet or testnet |
availableChainNames | Comma-separated list of supported chains |
signerType | KMS for HSM-backed or MNEMONIC for secret-based |
kmsNumOfSigners | Number of KMS signing keys to create |
extraContextGasolinaUrl | Optional custom verification endpoint |
Step 5: Configure RPC Providers
Editcdk/gasolina/config/providers/mainnet/providers.json:
Step 6: Configure Wallet Definitions (Mnemonic Only)
If using mnemonics, editcdk/gasolina/config/walletConfig/mainnet.json:
Step 7: Bootstrap CDK (First Time Only)
Step 8: Deploy Infrastructure
Step 9: Test Deployment
Google Cloud Platform Implementation
Step 1: Clone and Setup
Step 2: Configure GCP Project
Step 3: Create Terraform Backend Storage
Step 4: Configure Terraform Backend
Editterraform/lz-mainnet-verifier.backend.conf:
Step 5: Configure Infrastructure Variables
Editterraform/lz-mainnet-verifier.tfvars:
Step 6: Configure RPC Providers
Editterraform/providers-mainnet.json:
Step 7: Deploy with Terraform
Step 8: Test Deployment
Integration with LayerZero
Once your Gasolina instance is deployed and tested:Step 1: Share Gasolina URL
Provide your Gasolina API URL to LayerZero Labs:Step 2: DVN Contract Deployment
LayerZero will:- Query your
/signer-infoendpoint to retrieve signer addresses - Deploy DVN contracts on all supported chains with:
- Your signer addresses registered
- Agreed-upon quorum threshold
- Essence wallet as initial
ADMIN_ROLEholder
- Provide you with the DVN contract addresses for each chain
Step 3: OApp Configuration
OApps configure your DVN using the contract addresses:Advanced Configuration
Extra Context Verification
Add custom verification logic by implementing an API endpoint:Multi-Signer Setup
For enhanced security and availability, deploy multiple Gasolina instances with different signers:| Instance | Endpoint | Signers |
|---|---|---|
| Gasolina 1 | https://gasolina1.example.com | Signers A, B |
| Gasolina 2 | https://gasolina2.example.com | Signers C, D |
| Gasolina 3 | https://gasolina3.example.com | Signers E, F |
Managing Configuration Changes
As a Gasolina operator, you maintain full control over the DVN through the signer quorum.Change Quorum Threshold
Add a Signer
Remove a Signer
Emergency Admin Takeover
The DVN contract includes aquorumChangeAdmin function that allows the signer quorum to reassign the admin role without requiring the current admin’s permission. This ensures signers maintain ultimate control over the DVN even if the admin role has been delegated to a service like Essence.
ExecuteParam Structure
The function accepts a singleExecuteParam struct:
Step-by-Step Implementation
Step 1: Prepare the ParametersValidation Requirements
The contract validates:| Check | Requirement |
|---|---|
| Expiration | expiration > block.timestamp |
| Target | target == address(this) (the DVN contract) |
| VID | vid == contract.vid |
| Signatures | Must meet quorum, sorted by signer address |
| Replay | Hash must not have been used before |
Operational Management
Monitoring
- AWS
- GCP
- CloudWatch Logs: Automatic log collection
- CloudWatch Alarms: Set up error rate monitoring
- SNS Notifications: Configure alerts
Scaling
| Platform | Scaling Method |
|---|---|
| AWS | ECS auto-scales based on CPU/memory thresholds |
| GCP | Cloud Run auto-scales based on request volume |
Key Rotation
KMS Keys (Recommended)- AWS KMS supports automatic key rotation
- Update DVN contract if key ID changes
- Generate new mnemonic
- Update Secrets Manager
- Update wallet configuration
- Redeploy application
- Update DVN contract with new signer addresses
Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
| ”API has not been used in project” (GCP) | Wait a few minutes for API enablement to propagate |
| ”Resource already exists” (AWS) | Delete GasolinaMetricLogGroup and S3 bucket, retry |
| RPC connection failures | Verify endpoints, check API keys, add backup providers |
| Signature verification failures | Ensure signer addresses match DVN contract config |
Debug Commands
Security Best Practices
-
Key Management
- Use HSM-backed keys (KMS) for production
- Implement key rotation policies
- Monitor key usage patterns
-
Network Security
- Restrict API Gateway access if needed
- Implement IP allowlisting where appropriate
- Use VPC endpoints for internal communication
-
Monitoring
- Set up alerts for unusual signature request patterns
- Monitor RPC provider response times
- Track error rates and latency
-
Backup and Recovery
- Backup configuration regularly
- Document recovery procedures
- Test disaster recovery plans periodically
Repository Links
| Resource | Link |
|---|---|
| AWS Infrastructure | gasolina-aws |
| GCP Infrastructure | gasolina-gcp |
| DVN Contract | DVN.sol |
Next Steps
- Gasolina Overview - Architecture and security model
- DVN Technical Reference - Contract methods and events
- DVN Overview - General DVN concepts
For implementation support, reach out through LayerZero Discord or open an issue in the respective GitHub repository.