Skip to main content

Configuration

The ElizaOS 0G plugin requires several environment variables to connect to the 0G network and perform storage operations.

Required Environment Variables

Set the following environment variables in your .env file or deployment environment:
ZEROG_INDEXER_RPC=<0G indexer RPC endpoint>
ZEROG_EVM_RPC=<0G EVM RPC endpoint>
ZEROG_PRIVATE_KEY=<Private key for transactions>
ZEROG_FLOW_ADDRESS=<0G Flow contract address>

Variable Descriptions

VariableDescriptionExample
ZEROG_INDEXER_RPC0G indexer RPC endpoint for querying network statehttps://indexer.0g.ai
ZEROG_EVM_RPC0G EVM-compatible RPC endpoint for transactionshttps://evmrpc.0g.ai
ZEROG_PRIVATE_KEYPrivate key for signing transactions (keep secure!)0x1234...
ZEROG_FLOW_ADDRESSContract address for 0G Flow operations0xabcd...

Security Best Practices

Never commit private keys to version control or expose them in client-side code.

Environment Variable Security

  • Use secure environment variable management systems
  • Rotate private keys periodically
  • Ensure RPC endpoints are accessible and trusted
  • Verify private key has sufficient permissions for operations

Production Considerations

  • Use separate keys for development and production
  • Implement key rotation policies
  • Monitor transaction activity
  • Set up alerts for unusual activity

Configuration Validation

The plugin will validate your configuration on startup. Common issues include:
  • Invalid RPC endpoints: Ensure URLs are accessible
  • Insufficient permissions: Verify private key has required permissions
  • Network connectivity: Check firewall and network settings
  • Contract addresses: Ensure Flow contract address is correct

Example Configuration

Create a .env file in your project root:
# 0G Network Configuration
ZEROG_INDEXER_RPC=https://indexer-testnet.0g.ai
ZEROG_EVM_RPC=https://evmrpc-testnet.0g.ai
ZEROG_PRIVATE_KEY=your_private_key_here
ZEROG_FLOW_ADDRESS=0x1234567890abcdef1234567890abcdef12345678

Next Steps

With configuration complete, learn how to use the plugin in your ElizaOS agents.