Deploy Allora Appchain
What You'll Learn
- Understanding the Allora Appchain as the settlement layer for the network
- How different network actors interact with the appchain and why
- Complete deployment options using Docker Compose or Kubernetes with Helm
- Managing chain parameters for testnets and development environments
Overview
We discuss the settlement layer for the Allora Network and how to deploy it
The Allora Appchain serves as the fundamental infrastructure layer that coordinates all network activities and incentives. Understanding and deploying the appchain is essential for network operators, validators, and infrastructure providers.
Why Deploy the Appchain?
Infrastructure Control:
- Network customization: Deploy custom network configurations for specific use cases
- Development environments: Create isolated environments for development and testing
- Infrastructure ownership: Maintain control over blockchain infrastructure and operations
- Service provision: Offer blockchain infrastructure services to network participants
Architecture Overview
What is the Appchain?
The Allora Appchain is a Cosmos SDK appchain that serves as the settlement layer for the Allora Network. It serves to coordinate all incentives for all actors:
Core Functions
Incentive Coordination:
- The weights between reputers and workers, as well as a reference to the logic used to update those weights, are stored on-chain.
- Rewards payable from inflation are calculated based on those weights at a global cadence on-chain.
- Consumers pay for inferences to be collected and for all the above calculations to run. These funds get allocated to workers and reputers, respectively.
The appchain also coordinates actions between protocol actors.
Protocol Coordination:
- The appchain triggers requests to workers and reputers to collect inferences and run loss-calculation logic, respectively, as per each topic's respective inference and loss-calculation cadence.
- The appchain collects a recent history of inferences in batches to later be scored by loss-calculation.
Technical Architecture Benefits
Cosmos SDK Foundation:
- Proven technology: Built on battle-tested Cosmos SDK framework
- Interoperability: Compatible with Cosmos ecosystem and IBC protocol
- Governance: Built-in governance mechanisms for parameter management
- Security: Inherits security model from Cosmos SDK and Tendermint consensus
Settlement Layer Design:
- Finality: Provides final settlement for all network transactions
- Transparency: All weights, rewards, and incentives are publicly verifiable
- Efficiency: Optimized for batch processing of inference data and rewards
- Scalability: Designed to handle high volumes of AI/ML network activity
Network Interaction Patterns
Why and How might one interact with the Allora Appchain?
Different actors interact with the Allora Appchain for different reasons. They do so via a standard client connection (such as CosmJS (opens in a new tab)) or the Appchain CLI.
Data Scientists (Workers)
Worker Interactions:
- Data scientists interact with the Appchain to register their worker nodes and to withdraw rewards accrued for their inferences. These rewards are paid by both consumers and inflation based on their relative weight.
Worker Benefits:
- Registration process: Secure on-chain registration for network participation
- Reward claiming: Direct access to earned rewards from inference provision
- Performance tracking: On-chain record of worker performance and weights
- Economic participation: Transparent reward system based on inference quality
Developers (Consumers)
Developer Interactions:
- Developers interact with the Appchain to create topics, fund topics, and perhaps also to read recent inferences.
Developer Benefits:
- Topic creation: Establish new prediction markets and inference categories
- Funding management: Control topic funding and inference request economics
- Data access: Real-time access to network inferences and performance data
- Integration support: Direct blockchain integration for application development
Validators
Validator Interactions:
- Validators run the Appchain and receive standard inflationary rewards for running Cosmos SDK appchains and a cut of the funds from consumers. They will also register themselves on the Appchain so that they can be eligible for rewards.
Validator Benefits:
- Economic rewards: Earn both inflation rewards and transaction fees
- Network security: Contribute to network security and consensus
- Infrastructure provision: Provide essential blockchain infrastructure services
- Governance participation: Participate in network governance and parameter updates
Deployment Prerequisites
Dependencies
Setup Requirements:
- Create a set of keys and initialize genesis. See example in
scripts/init.sh. - The script
scripts/l1_node.shis provided too, to facilitate configuration and maintenance of the node when connecting it to a network, downloading genesis.
Preparation Benefits:
- Key management: Secure generation and management of validator keys
- Genesis setup: Proper initialization of blockchain state
- Network configuration: Automated setup for network connectivity
- Maintenance automation: Scripts for ongoing node management
Deployment Options
Option 1: Deploy with Docker Compose
There is a docker-compose.yml provided that sets up a validator node.
Docker Deployment Process
Run
Once this is set up, run docker compose up.
Docker Benefits:
- Simplified deployment: Single command deployment with all dependencies
- Container isolation: Isolated environment prevents conflicts with host system
- Configuration management: Centralized configuration through Docker Compose
- Service orchestration: Automatic coordination of all required services
Docker Use Cases:
- Development environments: Quick setup for development and testing
- Single-node deployment: Simple deployment for individual validator nodes
- Container infrastructure: Integration with existing Docker-based infrastructure
- Rapid prototyping: Fast setup for experimentation and proof-of-concept
Option 2: Deploy in Kubernetes with Helm Chart
Upshot team uses a universal-helm (opens in a new tab) chart to deploy applications into kubernetes clusters.
There is a index-provider/values.yaml provided that sets up one head node and one worker node.
Kubernetes Prerequisites
Dependencies
You need to have configured kubeconfig file on the computer to connect to the cluster and deploy the node.
Kubernetes Requirements:
- Cluster access: Properly configured kubeconfig for cluster authentication
- Helm client: Helm package manager installed and configured
- Cluster permissions: Adequate permissions for application deployment
- Network connectivity: Stable connection to Kubernetes cluster
Kubernetes Deployment Process
Deploy with the Helm Chart
- Add upshot Helm chart repo:
helm repo add upshot https://upshot-tech.github.io/helm-charts- Install helm chart with the given values file:
helm install \
index-provider \
upshot/universal-helm \
-f appchain/values.yamlKubernetes Benefits:
- Production scalability: Designed for production-grade deployments
- High availability: Built-in redundancy and failover capabilities
- Resource management: Automated resource allocation and scaling
- Monitoring integration: Native integration with Kubernetes monitoring
Kubernetes Use Cases:
- Production networks: Enterprise-grade deployment for live networks
- Multi-node clusters: Coordinated deployment of multiple validator nodes
- Cloud infrastructure: Integration with cloud-native deployment pipelines
- Enterprise environments: Compliance with enterprise infrastructure requirements
Network Management
Edit Chain Parameters
The public mainnet uses standard cosmos governance modules to vote on global network parameters (such as reward epoch time in blocks, for example). For testnets and devnets, however, you can use the following allorad CLI command to set the global parameters of the blockchain if you are whitelisted to do so. The parameters below are just example values:
allorad tx emissions update-params "$VALIDATOR_KEY_FOR_TX_SEND" '{"version":["v0.0.4"], "min_topic_weight":["5"], "max_topics_per_block":[50]}'Parameter Management Strategy
Governance Models:
- Mainnet governance: Democratic governance through token holder voting
- Testnet flexibility: Direct parameter updates for development and testing
- Access control: Whitelist system for testnet parameter management
- Example parameters: Version, minimum topic weight, and maximum topics per block
Parameter Categories:
- Network performance: Parameters affecting throughput and efficiency
- Economic policy: Settings controlling rewards and incentives
- Quality control: Parameters ensuring network quality standards
- System limits: Constraints preventing network abuse and overload
Deployment Best Practices
Infrastructure Planning
Deployment Strategy:
- Environment selection: Choose appropriate deployment method based on use case
- Resource allocation: Plan adequate computing resources for validator operations
- Network connectivity: Ensure stable internet connection and proper networking
- Security considerations: Implement proper security measures for key management
Monitoring and Maintenance
Operational Excellence:
- Health monitoring: Set up monitoring for node health and performance
- Log management: Implement comprehensive logging for troubleshooting
- Backup procedures: Maintain backups of critical configuration and state data
- Update procedures: Plan for software updates and network upgrades
Troubleshooting
Common Issues
Deployment Problems:
- Key generation: Ensure proper key generation and management
- Network connectivity: Verify network access and peer connectivity
- Configuration errors: Validate configuration files and parameters
- Resource constraints: Ensure adequate system resources for operation
Support Resources
Getting Help:
- Documentation: Comprehensive guides and references
- Community support: Developer forums and community assistance
- Script examples: Provided scripts for common operations
- Technical support: Professional support for enterprise deployments
Prerequisites
- Blockchain operations: Understanding of blockchain node operations and maintenance
- Container technology: Familiarity with Docker and Kubernetes for deployment
- Network administration: Basic network configuration and troubleshooting skills
- System administration: Linux system administration and security practices
Next Steps
- Learn validator operations for ongoing node management
- Study system requirements for infrastructure planning
- Explore the CLI reference for command-line operations
- Review staking procedures for validator registration