If you’re looking to dive into the world of decentralized finance, HydrDX is an exciting cross-chain liquidity protocol built on Substrate. In this guide, we will walk you through the steps necessary to set up your local development environment for HydraDX, run the node, and troubleshoot any issues that may arise along the way.
Contributions
We welcome contributions and have guidelines outlined in our Contributions Guidelines. We also have a Code of Conduct that provides the framework for our friendly community.
Local Development Setup
To get started with a local Substrate development environment, follow these steps:
Simple Setup
You can install all the required dependencies with the following single command. (Be patient, as this may take up to 30 minutes!)
curl https:getsubstrate.io -sSf | bash -s -- --fast
Manual Setup
If you prefer to go the manual route, you can find detailed instructions at the Substrate Developer Hub.
Build the Node
Once your development environment is ready, it’s time to build the node using the following command:
cargo build --release
Running the Node
To run the HydraDX node, you have a couple of options, with Chopsticks being the easiest route:
Using Chopsticks
Install and run the node with the following command:
npx @acala-network/chopsticks@latest --config=launch-configs/chopsticks_hydradx.yml
Now, you should have a test node running at ws:localhost:8000.
Setting Up a Local Testnet with Zombienet
To create a local testnet, follow these steps:
- Build the relay chain repository in the directory
..polkadot
. - Grab the Zombienet utility to start the network from the releases.
- Start a local testnet with four relay chain validators and two collators for HydraDX:
cd .rococo-local
zombienet spawn config-zombienet.json
Interacting with the Node
You can connect to your local node via the Polkadot apps interface. Select the following options:
- Mainnet:
wss:rpc.hydradx.cloud
- Local node:
ws:localhost:8000
(if you used Chopsticks)
Testing Storage Migrations and Runtime Upgrades
To test migrations against real chain states, you can use the try-runtime
tool:
try-runtime --runtime ./target/release/hydradx-runtime/hydradx_runtime.wasm --on-runtime-upgrade --checks all --uri wss:rpc.hydradx.cloud:443
You may also test against the HydraDX testnet on Rococo by using this command:
--uri wss:rococo-hydradx-rpc.hydration.dev:443
Troubleshooting
If you encounter any issues during the setup or running of your HydraDX node, here are some troubleshooting tips:
- Timeout during installation: This can happen if your internet connection is slow. Try reconnecting or using a faster network.
- Node won’t start: Check for errors in your setup configurations. Ensure that the commands were executed correctly.
- Connection issues: Double-check the websocket URLs to ensure they are correctly typed.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
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.
Additional Resources
For more information about security and additional resources, refer to the following:
- HydraDX Security on GitHub
- HydraDX API Documentation
- HydraDX Official Documentation
- Omnipool Design Documentation
- HydraDX Fees
- Bug bounty: Immunefi Bug Bounty
- Responsible disclosure: security@hydradx.io