Guides / Instructions how to run a node
August 30, 2022
HAQQ Installation Guide (English Edition)
Haqq is a scalable, high-throughput Proof-of-Stake blockchain that is fully compatible and interoperable with Ethereum. It’s built using the Cosmos SDK which runs on top of Tendermint Core consensus engine. Ethereum compatibility allows developers to build applications on Haqq using the existing Ethereum codebase and toolset, without rewriting smart contracts that already work on Ethereum or other Ethereum-compatible networks. Ethereum compatibility is done using modules built by Tharsis for their Evmos network.
Islamic Coin is a community driven project design to empower an ethics-first Sharia-compliant financial ecosystem This amazing team already raised $200 millions.
Islamic Coin is based on its own Haqq Blockchain, the first Shariah-compliant decentralized ledger, specifically designed to comply with the rules and traditions of Islamic finance. The international roadshow continues in the Middle East and Europe, and ISLM will launch soon on top-tier exchanges.
Recommended Hardware Requirements
- 4x CPU; the higher the clock speed the better
- 8GB of RAM
- 200 GB storage (SSD or NVME)
- Persistent Internet connection (traffic will be minimum 10Mbps during testnet - at least 100Mbps expected for production)
I'm personally using two platforms so far. They are pretty cheap and have good support assistance. Feel free to use my referral invitation and get a discount.
You can watch how I've performed the Haqq Node installation on my Youtube.
And if you've already decided to run Haqq node I strongly suggest to subscribe to all Islamic Coin media.
Haqq Full Node Installation Steps
1. Preparing the server
sudo apt update && sudo apt upgrade -y
sudo apt install curl build-essential git wget jq make gcc tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev -y
2. Installing GO 18.3 (by one command)
ver="1.18.3" && \ cd $HOME && \ wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \ sudo rm -rf /usr/local/go && \ sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \ rm "go$ver.linux-amd64.tar.gz" && \ echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \ source $HOME/.bash_profile && \ go version
3. Downloading and Installing Binaries from Github:
git clone https://github.com/haqq-network/haqq.git cd haqq make install chmod +x /root/go/bin/haqqd && sudo mv /root/go/bin/haqqd /usr/local/bin/ cd $HOME
4. Let's put some variables. Instead of user_name you better put the name you prefer.
MONIKER="user_name" CHAIN="haqq_53211-1" WALLET_NAME="user_name"
5.Now we shell put everything in bush profile.
echo 'export MONIKER='${MONIKER} >> $HOME/.bash_profile echo 'export CHAIN='${CHAIN} >> $HOME/.bash_profile echo 'export WALLET_NAME='${WALLET_NAME} >> $HOME/.bash_profile source $HOME/.bash_profile
6. Initialize the chain
Before actually running the node, we need to initialize the chain, and most importantly its genesis file. This is done with the init
subcommand:
haqqd init $MONIKER --chain-id $CHAIN
7. Setting the configuration of the chain identifier
haqqd config chain-id $CHAIN
8. Downloading Genesis snapshots and checking it
curl -OL https://storage.googleapis.com/haqq-testedge-snapshots/genesis.json mv genesis.json $HOME/.haqqd/config/genesis.json haqqd validate-genesis
9. Resetting the validator
haqqd tendermint unsafe-reset-all --home $HOME/.haqqd
10. Setting up synchronization
curl -OL https://raw.githubusercontent.com/haqq-network/testnets/main/TestEdge/state_sync.sh chmod +x state_sync.sh ./state_sync.sh
11. Setting up Pruning (one command)
pruning="custom" && \ pruning_keep_recent="100" && \ pruning_keep_every="0" && \ pruning_interval="50" && \ sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.haqqd/config/app.toml && \ sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.haqqd/config/app.toml && \ sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.haqqd/config/app.toml && \ sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.haqqd/config/app.toml
12. Indexer (optional) one command
indexer="null" && \ sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.haqqd/config/config.toml
13. Creating a service file
sudo tee /etc/systemd/system/haqqd.service > /dev/null <<EOF [Unit] Description=haqqd After=network-online.target
[Service] User=$USER ExecStart=$(which haqqd) start Restart=on-failure RestartSec=3 LimitNOFILE=65535
[Install] WantedBy=multi-user.target EOF
14. Start node (one command)
sudo systemctl daemon-reload && \ sudo systemctl enable haqqd && \ sudo systemctl restart haqqd
15. Let's speed up the synchronization process by downloading address book and setting up Peers and Seeds
sudo systemctl stop haqqd haqqd tendermint unsafe-reset-all --home $HOME/.haqqd SEEDS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656" PEERS=""; \ sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.haqqd/config/config.toml wget -O $HOME/.haqqd/config/addrbook.json "https://raw.githubusercontent.com/StakeTake/guidecosmos/main/haqq/haqq_53211-1/addrbook.json" SNAP_RPC="http://haqq.stake-take.com:36657" LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \ BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \ TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \ s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.haqqd/config/config.toml sudo systemctl restart haqqd && journalctl -u haqqd -f -o cat
16. Now we can observes our logs. To quit logs - push ctrl + C. And to go back to the Logs we are using:
sudo journalctl -u haqqd -f -o cat
17. We need to make sure our validator syncs blocks. You can use the following command to check the sync status. What we need is for "catching_up" to become "false".
curl localhost:26657/status
18. After "catching_up" have been done, we need to create a new or recover our wallet using mnemonic:
haqqd keys add $WALLET_NAME --recover
To get a new one:
haqqd keys add $WALLET_NAME
19. Add a variable with the wallet address:
WALLET_ADDRESS=$(haqqd keys show $WALLET_NAME -a)
20. Now we shell put everything in bush profile.
echo 'export WALLET_ADDRESS='${WALLET_ADDRESS} >> $HOME/.bash_profile source $HOME/.bash_profile
21. We need to get some $ISLM tokens. For that we'll need Chrome, MetaMask and Github profile.
Let's go to testedge.haqq.network. To sign up we will use our Github profile. Connect our MM, adding test chain and pushing the claim button
22.Going back to our terminal and checking the balance.
haqqd query bank balances $WALLET_ADDRESS
23. So we've got our tokens. Let's create Create a validator. I'll show you how to validate 500 $ISLM.
1 ISLM = 1000000000000000000 aISLM (18 zeros)
haqqd tx staking create-validator \ --amount=500000000000000000000aISLM \ --pubkey=$(haqqd tendermint show-validator) \ --moniker=$MONIKER \ --chain-id=haqq_53211-1 \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ --min-self-delegation="1000000" \ --gas="auto" \ --from=$WALLET_NAME \ --node https://rpc.tm.testedge.haqq.network:443
24. Set a variable with the validator's address:
VALOPER=$(haqqd keys show $WALLET_ADDRESS --bech val -a)
25. And put it in bush profile.
echo 'export VALOPER='${VALOPER} >> $HOME/.bash_profile source $HOME/.bash_profile
27. Checking the validator status.
haqqd query staking validator $VALOPER
28. Let's delegate some tokens to our validator. Let's do 10 tokens.
haqqd tx staking delegate $VALOPER 10000000000000000000aISLM --from $WALLET_NAME --chain-id haqq_53211-1
29. Let's delegate to some other validator also 10 tokens. Feel free to leave my address in gesture of appreciation for good content.
haqqd tx staking delegate haqqvaloper1c7ft8zfrk6h34vhtml0vh20au9g4zya05xd8m5 10000000000000000000aISLM --from $WALLET_NAME --chain-id haqq_53211-1
Voila, you guys did a great job.
After your Node was successfully installed you can submit this form.
Where you can find and check your validator and transactions?
I present to your attention three explorers that I managed to find:
Useful Commands
To Delete Node Completely:
sudo systemctl stop haqqd && \ sudo systemctl disable haqqd && \ rm /etc/systemd/system/haqqd.service && \ sudo systemctl daemon-reload && \ cd $HOME && \ rm -rf .haqqd && \ rm -rf haqq && \ rm -rf $(which haqqd)
To Restart Node:
sudo systemctl daemon-reload && \ sudo systemctl enable haqqd && \ sudo systemctl restart haqqd && \ sudo journalctl -u haqqd -f -o cat
To withdraw all rewards:
haqqd tx distribution withdraw-all-rewards --from $WALLET_NAME --fees=000aISLM --chain-id $CHAIN
Validator Information:
haqqd status 2>&1 | jq .ValidatorInfo
Node Information:
haqqd status 2>&1 | jq .NodeInfo
Get Out Of Jail(Unjail):
haqqd tx slashing unjail \ --broadcast-mode=block \ --from=$WALLETNAME \ --chain-id=$CHAIN_ID \ --gas=auto --fees 250aISLM