April 22, 2022

Installing the DeFund Node

Hello everyone, today we will talk about installing the DeFund node

At the time of writing, the project launched only Private Testnet, perhaps everyone will be admitted further.

UPD: 04/22/2022 - You can still join the closed testnet Fill out the form: https://docs.google.com/forms/d/e/1FAIpQLSfqw1F6cDCsEt1Qmn70oIp3tdvcPFvRyk9Nd4mFacelhzQFYA/viewform Discord - https://discord.gg/5D4Mdetf

The characteristics of the server have not yet been announced, but most likely, like other projects in cosmos 4/8/200

First, install GO

cd $HOME

wget -O go1.17.1.linux-amd64.tar.gz https://golang.org/dl/go1.17.linux-amd64.tar.gz

rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz && rm go1.17.1.linux-amd64.tar.gz

echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile

echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile

echo 'export GO111MODULE=on' >> $HOME/.bash_profile

echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && . $HOME/.bash_profile

Checking the version

go version

As always, we update the server and install the necessary packages.

sudo apt update && sudo apt upgrade -y sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y

Скачиваем и устанавливаем ноду

git clone https://github.com/defund-labs/defund cd $HOME/defund make install

We set the names of the variables for convenience, you can do without them (we leave DEFUND_CHAIN unchanged, enter our names in the rest)

DEFUND_CHAIN="defund-private-1" DEFUND_MONIKER="YOUR_MONIKER_NAME" DEFUND_WALLET="YOUR_WALLET_NAME"

We register everything in the .bash_profile

echo 'export DEFUND_CHAIN='${DEFUND_CHAIN} >> $HOME/.bash_profile echo 'export DEFUND_MONIKER='${DEFUND_MONIKER} >> $HOME/.bash_profile echo 'export DEFUND_WALLET='${DEFUND_WALLET} >> $HOME/.bash_profile source $HOME/.bash_profile

Initialize the node

defundd init $DEFUND_MONIKER --chain-id=$DEFUND_CHAIN

Adding seeds and peers

seeds="[email protected]:26656"

peers="[email protected]:26656,[email protected]:26656"

sed -i "s/^seeds *=.*/seeds = \"$seeds\"/;" $HOME/.defund/config/config.toml sed -i "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/;" $HOME/.defund/config/config.toml

Download the genesis file

wget -O $HOME/.defund/config/genesis.json https://raw.githubusercontent.com/schnetzlerjoe/defund/main/testnet/private/genesis.json

defundd tendermint unsafe-reset-all --home $HOME/.defund

We create a service

tee $HOME/defund.service > /dev/null <<EOF [Unit] Description=Defund After=network.target [Service] Type=simple User=$USER ExecStart=$(which defundd) start Restart=on-failure LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF

sudo mv $HOME/defund.service /etc/systemd/system/

Restart system services and turn on our

sudo systemctl restart systemd-journald sudo systemctl daemon-reload sudo systemctl enable defund sudo systemctl restart defund

We look at the logs

journalctl -u defund -f -o cat

Or we look at the status and wait until it is synchronized

curl -s localhost:26657/status

After you see "catching_up": false the node has been synced

Let's make a wallet! Don't forget to save the mnemonic!!! it will also ask you to enter a password to access the wallet SAVE or REMEMBER (If the wallet already exists and you just need to restore it, use this command defundd keys add $DEFUND_WALLET --recover and enter the mnemonic)

defundd keys add $DEFUND_WALLET

We add the wallet address to the variable for our convenience (for confirmation, we need the password entered earlier)

DEFUND_ADDR=$(defundd keys show $DEFUND_WALLET -a)

Add a variable to .bash_profile:

echo 'export DEFUND_ADDR='${DEFUND_ADDR} >> $HOME/.bash_profile

source $HOME/.bash_profile

Balance check:

defundd query bank balances $DEFUND_ADDR

After synchronization, we create a validator (in the --amount line, we write in numbers the amount that we want to delegate the letters ufetf unchanged) we also enter the previously entered password (do not forget that the wallet from which you will delegate must have funds):

defundd tx staking create-validator \ --amount=25000000ufetf \ --pubkey=$(defundd tendermint show-validator) \ --moniker=$DEFUND_MONIKER \ --chain-id=defund-private-1 \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ --min-self-delegation="1" \ --from=$DEFUND_WALLET

We write the address of the validator into a variable (the same password will need to be entered)

DEFUND_VALOPER=$(defundd keys show $DEFUND_WALLET --bech val -a)

Add a variable to .bash_profile:

echo 'export DEFUND_VALOPER='${DEFUND_VALOPER} >> $HOME/.bash_profile source $HOME/.bash_profile

Checking the status of the validator:

defundd query staking validator $DEFUND_VALOPER

Now how to delegate funds to the validator: (instead of values in brackets [ ] we insert our data, (remove parentheses) or variables if specified)

defundd tx staking delegate [VALOPER_ADDRESS] [STAKE_AMOUNT]ufetf --from [your-key-name] --chain-id defund-private-1

Well, if suddenly your node got into jail, then the output is: (instead of values in brackets [ ] we insert our data, (remove parentheses) or variables if specified)

defundd tx slashing unjail --from [your-key-name] --chain-id defund-private-1

Thank you very much for your attention and time

Sincerely, MMS_Team