Welcome to the world of the Dymension Hub, a crucial piece of the Dymension protocol puzzle. In this article, we will explore how to set up and run a full Dymension Hub node, ensuring you’re ready to contribute to this innovative blockchain network.
Table of Contents
- Prerequisites
- Installation
- Initializing dymd
- Running the Chain
- Bootstrapping Liquidity Pools
- Adding Incentives
- Debugging Container
- Developer
Prerequisites
Before diving into the installation process, ensure you have Go version 1.18 or above installed on your system. You can find more details on how to install Go here.
Installation
To start your journey with Dymension, follow these installation steps:
sh git clone https://github.com/dymensionxyz/dymension.git
cd dymension
make install
sh dymd version
After running the command to check the version, if you encounter an error stating that the dymd command is not found, it might be due to an incorrectly configured GOPATH. You can update your PATH with the following command:
sh export PATH=$PATH:$(go env GOPATH)/bin
Initializing dymd
You can initialize dymd using two methods: the preferred setup script or manually. Here’s how:
Using the Setup Script
sh bash scripts/setup_local.sh
Manually
First, set the following environment variables:
sh export CHAIN_ID=dymension_100-1
export KEY_NAME=hub-user
export MONIKER_NAME=local
Next, create the genesis and initialize the Dymension chain:
sh dymd init $MONIKER_NAME --chain-id $CHAIN_ID
sh bash scripts/set_params.sh
Now add genesis account and provide tokens:
sh dymd keys add $KEY_NAME --keyring-backend test
dymd add-genesis-account $(dymd keys show $KEY_NAME -a --keyring-backend test) 1000dym
dymd gentx $KEY_NAME 670dym --chain-id $CHAIN_ID --keyring-backend test
dymd collect-gentxs
Running the Chain
Let’s start your chain with a simple command:
sh dymd start
If successful, you should observe that your local node is now up and running!
Bootstrapping Liquidity Pools
To set up the GAMM module with pools, execute the following command:
sh sh scripts/pools_bootstrap.sh
Adding Incentives
Incentives add value to liquidity pools. Here’s how to create them:
Creating Incentives Streams
After setting up your pools, create three incentive streams through governance:
sh sh scripts/incentives/fund_incentives.sh
Once you have created them, validate your results:
sh dymd q streamer streams
Locking Tokens
To receive incentives, lock your LP tokens with:
sh sh scripts/incentives/lockup_bootstrap.sh
sh dymd q lockup module-balance
Checking Rewards
Rewards will be distributed every minute. Validate your active gauges with:
sh dymd q incentives active-gauges
You can also watch the output to see real-time changes:
sh watch -n1 -d dymd q incentives active-gauges --output json | jq .data[] id: .id, coins: .coins
Debugging Container
For those who wish to debug, make sure to install:
Run the debug container with:
sh make docker-run-debug
Then, set up your debugger configuration in VSCode:
{
"version": "0.2.0",
"configurations": [
{
"name": "Dymension Debug Container",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 4000,
"host": "127.0.0.1",
"debugAdapter": "legacy" // To be removed in the future
}
]
}
Once you start debugging, you can set breakpoints in your code, allowing you to inspect values as the program runs smoothly.
Developer Insights
For additional support, we encourage you to join the Dymension Discord community and check out the Contribution guidelines.
Setup Push Hooks
To finalize your setup, implement push hooks using:
sh scripts/setup_push_hooks.sh
Troubleshooting
If you run into any issues during installation or while running your node, consider the following troubleshooting tips:
- Ensure that your Go installation is set up correctly and compatible.
- Check whether your environment variables have been set properly.
- Validate your network connection, as this is crucial for node synchronization.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.