- Notifications
You must be signed in to change notification settings - Fork361
dymensionxyz/dymension
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Welcome to the Dymension Hub, theSettlement Layer of the Dymension protocol.
This guide will walk you through the steps required to set up and run a Dymension Hub full node.
Clonedymension
:
git clone https://github.com/dymensionxyz/dymension.gitcd dymensionmake install
Check that the dymd binaries have been successfully installed:
dymd version
If the dymd command is not found an error message is returned,confirm that yourGOPATH is correctly configured by running the following command:
export PATH=$PATH:$(go env GOPATH)/bin
Using the setup script:
This method is preferred as it is preconfigured to supportrunning rollapps locally
bash scripts/setup_local.sh
Manually:
First, set the following environment variables:
export CHAIN_ID="dymension_100-1"export KEY_NAME="hub-user"export MONIKER_NAME="local"
Second, create genesis and init dymension chain:
dymd init"$MONIKER_NAME" --chain-id"$CHAIN_ID"
Third, set parameters to ensure denom is udym:
bash scripts/set_params.sh
Then, add genesis account and provide token to the account:
dymd keys add"$KEY_NAME" --keyring-backendtestdymd add-genesis-account"$(dymd keys show"$KEY_NAME" -a --keyring-backend test)" 1000dymdymd gentx"$KEY_NAME" 670dym --chain-id"$CHAIN_ID" --keyring-backendtestdymd collect-gentxs
Now start the chain!
dymd start
You should have a running local node!
To bootstrap theGAMM
module with pools:
sh scripts/pools/pools_bootstrap.sh
After creating the pools above, we create 3 incentive streams through gov:
sh scripts/incentives/fund_incentives.sh
Wait for the gov proposal to pass, and validate with:
dymd q streamer streams
The last stream is community-driven and governed byx/sponsorship
.
To get incentives, we need to lock the LP tokens:
sh scripts/incentives/lockup_bootstrap.sh
validate with:
dymd q lockup module-balance
Every minute a share of the rewards will be distributed!
validate with:
dymd q incentives active-gauges# alternatively, watch the output - you will see the "amount" change every minute# watch -n1 -d "dymd q incentives active-gauges --output json | jq '.data[] | { "id": .id, "coins": .coins } '"
The following script casts two votes for a community-driven distribution.
sh scripts/incentives/sponsorship_vote.sh
This will change the corresponding stream distribution at the end of the current epoch.
dymd q streamer streams
The community-driven distribution may be queried with:
dymd q sponsorship distribution
Pre-requisite:InstallDockerInstallVSCodeInstallVSCode Go extensionInstallDelve
To debug, you can use the following command to run the debug container:
make docker-run-debug
Then you can run the debugger with the following config forlaunch.json
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 after https://github.com/golang/vscode-go/issues/3096 is fixed } ]}
After that, you can run the debugger and set breakpoints in the code.
Example:
Add breakpoint toctx
inx/eibc/keeper/grpc_query.go
:
func (qQuerier)Params(goCtx context.Context,req*types.QueryParamsRequest) (*types.QueryParamsResponse,error) {ifreq==nil {returnnil,status.Error(codes.InvalidArgument,"invalid request")}ctx:=sdk.UnwrapSDKContext(goCtx)return&types.QueryParamsResponse{Params:q.GetParams(ctx)},nil}
Open your browser and go tohttp://localhost:1318/dymensionxyz/dymension/eibc/params
and you will see debugger stop and print the value at the breakpoint.
For support, join ourDiscord community and find us in the Developer section. SeeContribution guidelines.
To setup push hooks, run the following command:
./scripts/setup_push_hooks.sh
About
Dymension Hub