Developing
Deploying a custom stagenet to have a developer-controlled environment
THORChain uses multiple network environments to move from an idea to mainnet deployment, each with a specific role:
Mainnet: The live production network where real assets are transacted. Security and reliability are ensured through validator consensus, with only well-tested changes deployed to minimize risks.
Stagenet: A pre-production network mirroring mainnet, used to test new features and chain integrations with real assets and participants. Changes require consensus, providing real-world validation but slower testing.
Devnet / Mocknet: A developer-managed environment for rapid testing and iteration. Validators and participants are fully controlled, making it ideal for testing new chains like TON, TRON, Optimism, or Arbitrum before advancing to the official stagenet or mainnet.
A devnet offers developers full control over the THORChain environment to test without impacting live networks. Key benefits include:
Autonomy: Configure without consensus delays.
Rapid Iteration: Test and refine quickly.
Risk Mitigation: Isolate changes to ensure live network stability.
gRPC Support
THORChain supports gRPC for enhanced communication between clients and servers. This feature is available in the Stagenet environment for testing and development purposes.
Enabled gRPC Endpoint: A gRPC endpoint has been deployed and can be accessed at
thornode-grpc.defiantlabs.net:443
.New Feature Development: The addition of gRPC support is being tracked in Merge Request #1232, which adds the required functionality to the node-launcher repository.
Prerequisites to Setup a Devnet
Hardware Requirements
CPU: 8 cores
Memory: 32 GiB
Storage: 256 GiB
Software Requirements
kubectl: Kubernetes CLI [v1.31.1 or later]
Helm: Manage Kubernetes deployments with Helm charts.
Minikube: Local Kubernetes cluster for testing.
THORNode Binary: Core THORChain binary for managing nodes.
1. Installation
Install kubectl
Install Helm
Install Minikube
Install THORNode Binary
2. Configuration
Configure Minikube
Minikube simulates a Kubernetes environment locally.
Start Minikube
Enable MetalLB for Load Balancing
Configure THORNode Binary
Initialize Configuration
Generate Faucet Keys
Save the faucet address for funding RUNE transactions in the stagenet.
3. Deploy the Devnet
Modify Deployment Configurations
Clone the node-launcher repository:
Edit thornode-stack/stagenet.yaml:
Enable Gaia Daemon only for testing:
Adjust resource allocations (CPU/memory) and persistence sizes.
Add environment variables for the faucet and chain configuration:
Deploy with Minikube:
4. Add a Validator Node
Start the genesis validator:
Start additional validators:
Trigger network churn:
5. Test Your Environment
Verify connectivity:
Access API:
Advanced Options
Custom Configurations: Use custom seed phrases or faucet wallets.
Enable Chains: Modify the docker-compose.yml or stagenet.yaml file to include more chains.
Deploy Custom Contracts: Override environment variables to test unique configurations.
References
For more details or if you encounter any errors in above steps, check out the docs in Gitlab directly:
Last updated