CROSS-CHAIN LIQUIDITY PROTOCOL BUILT ON SUBSTRATE
Please follow the contributions guidelines as outlined in docs/CONTRIBUTING.md
.
We are welcoming and friendly community please follow our Code of Conduct.
Follow these steps to prepare a local Substrate development environment ๐ ๏ธ
Install all the required dependencies with a single command (be patient, this can take up to 30 minutes).
curl https://getsubstrate.io -sSf | bash -s -- --fast
Find manual setup instructions at the Substrate Developer Hub.
Once the development environment is set up, build the node. This command will build the Wasm and native code:
cargo build --release
Purge any existing dev chain state:
./target/release/hydra-dx purge-chain --dev
Start a dev chain:
./target/release/hydra-dx --dev
Or, start a dev chain with detailed logging:
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/hydra-dx -lruntime=debug --dev
There is also an option to run the testing runtime with less restrictive settings to facilitate testing of new features. The following command starts a dev chain, and the testing runtime is used as a runtime for our node.
./target/release/hydra-dx --dev --runtime=testing
The testing runtime currently supports only two chain specifications: dev and local testnet.
Both runtimes store blockchain data in the same directories( e.g. the dev directory is shared for both runtimes
started with the --dev
parameter. That's why it is important to purge chain data when switching to different runtime( note: --runtime
parameter can't be used when purging chain data)
Go to the polkadot apps at https://dotapps.io
Then open settings screen -> developer and paste
NOTE - FixedU128 type is not yet implemented for polkadot apps. Balance is a measure so price can be reasonably selected. If using polkadot apps to create pool:
- 1 Mega Units equals 1:1 price
- 20 Mega Units equals 20:1 price
- 50 Kilo Units equals 0.05:1 price
{
"types": [
{
"AssetPair": {
"asset_in": "AssetId",
"asset_out": "AssetId"
},
"Amount": "i128",
"AmountOf": "Amount",
"Address": "AccountId",
"OrmlAccountData": {
"free": "Balance",
"frozen": "Balance",
"reserved": "Balance"
},
"BlockNumber": "u32",
"BalanceInfo": {
"amount": "Balance",
"assetId": "AssetId"
},
"Chain": {
"genesisHash": "Vec<u8>",
"lastBlockHash": "Vec<u8>"
},
"CurrencyId": "AssetId",
"CurrencyIdOf": "AssetId",
"Intention": {
"who": "AccountId",
"asset_sell": "AssetId",
"asset_buy": "AssetId",
"amount": "Balance",
"discount": "bool",
"sell_or_buy": "IntentionType"
},
"IntentionId": "Hash",
"IntentionType": {
"_enum": [
"SELL",
"BUY"
]
},
"LookupSource": "AccountId",
"OrderedSet": "Vec<AssetId>",
"Price": "Balance",
"Fee": {
"numerator": "u32",
"denominator": "u32"
},
"VestingScheduleOf": {
"start": "BlockNumber",
"period": "BlockNumber",
"period_count": "u32",
"per_period": "Balance"
}
}
],
"alias": {
"tokens": {
"AccountData": "OrmlAccountData"
}
}
}
Connect to the
- Hacknet:
wss://hack.hydradx.io:9944
- Stakenet:
wss://rpc-01.snakenet.hydradx.io
- or local node โ if you are on chromium based browser, set chrome://flags/#allow-insecure-localhost
Prerequisites: rust/cargo, python 3.8+
With the following script it is possible to run a simple performance check. It might be useful to determine whether your machine is suitable to run HydraDX node.
From the top-level node directory:
./scripts/check_performance.sh
This will run series of benchmarks ( which may take a while). The output will show benchmark results of HydraDX pallets and comparison against reference values.
The most interesting information would be the difference between the HydraDx benchmark value and the local machine's benchmark.
If the difference is >= 0, performance is similar or better. However, if the difference < 0 - your machine might not suitable to run HydraDX node. Contact HydraDX devs to discuss the results.
./target/release/hydra-dx --chain lerna