├── .github └── workflows │ └── main.yml ├── README.md ├── gentx └── gentx-fdaaef5749b2f69b279b0ba6b3ceb8adb3cb729a.json └── gentx_checker.js /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | pull_request: 4 | branches: [ "master" ] 5 | 6 | # Allows you to run this workflow manually from the Actions tab 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 14 | - uses: actions/checkout@v3 15 | 16 | - name: Setup Node.js environment 17 | uses: actions/setup-node@v3.4.1 18 | with: 19 | node-version: 14.18.1 20 | 21 | - id: files 22 | name: Check gentx 23 | uses: jitterbit/get-changed-files@v1 24 | with: 25 | format: 'json' 26 | - run: | 27 | readarray -t added_modified_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')" 28 | if [[ ${#added_modified_files[@]} > 1 ]]; then 29 | echo "More than one file found" 30 | exit 1 31 | fi 32 | for added_modified_file in ${added_modified_files[@]}; do 33 | node gentx_checker.js ${added_modified_file} 34 | done 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![haqq (1)](https://user-images.githubusercontent.com/104348282/188024190-b43f56d0-2dc6-4e4a-be0e-a7e9f615f751.png) 2 | # Prepare intensivized testnet Haqq 3 | *Instructions on how to prepare for the testnet* 4 | 5 | **Update packages and install required packages** 6 | ```bash 7 | sudo apt update && sudo apt upgrade -y && \ 8 | 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 9 | ``` 10 | 11 | **Install Go 1.18.3** 12 | ```bash 13 | wget https://golang.org/dl/go1.18.3.linux-amd64.tar.gz; \ 14 | rm -rv /usr/local/go; \ 15 | tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz && \ 16 | rm -v go1.18.3.linux-amd64.tar.gz && \ 17 | echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \ 18 | source ~/.bash_profile && \ 19 | go version > /dev/null 20 | ``` 21 | 22 | **Install binary project** 23 | ```bash 24 | cd $HOME && git clone https://github.com/haqq-network/haqq && \ 25 | cd haqq && \ 26 | make install && \ 27 | haqqd version 28 | ``` 29 | 30 | **Init moniker and set chainid** 31 | ```bash 32 | haqqd init YOURMONIKER --chain-id haqq_54211-2 && \ 33 | haqqd config chain-id haqq_54211-2 34 | ``` 35 | 36 | **Create wallet** 37 | ```bash 38 | haqqd keys add YOURWALLETNAME 39 | ``` 40 | 41 | **Add genesis account** 42 | ```bash 43 | haqqd add-genesis-account YOURWALLETNAME 10000000000000000000aISLM 44 | ``` 45 | 46 | **Create gentx** 47 | ```bash 48 | haqqd gentx YOURWALLETNAME 10000000000000000000aISLM \ 49 | --chain-id=haqq_54211-2 \ 50 | --moniker="YOURMONIKERNAME" \ 51 | --commission-max-change-rate 0.05 \ 52 | --commission-max-rate 0.20 \ 53 | --commission-rate 0.05 \ 54 | --website="" \ 55 | --security-contact="" \ 56 | --identity="" \ 57 | --details="" 58 | ``` 59 | 60 | After executing this command, you have a gentx. Submit a pull request (gentx folder) with the given gentx 61 | ```bash 62 | File Genesis transaction written to "/.haqqd/config/gentx/gentx-xxx.json" 63 | ``` 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /gentx/gentx-fdaaef5749b2f69b279b0ba6b3ceb8adb3cb729a.json: -------------------------------------------------------------------------------- 1 | {"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"metil","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.050000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.050000000000000000"},"min_self_delegation":"1","delegator_address":"haqq1nqmzss5lywaja29x0alng6n7kyynk8t0mcwqsg","validator_address":"haqqvaloper1nqmzss5lywaja29x0alng6n7kyynk8t0h6zw5f","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"c3u7s35SS2rxcY1PS30E6M7NCvxwXzb/zXxCfkyUAYs="},"value":{"denom":"aISLM","amount":"10000000000000000000"}}],"memo":"fdaaef5749b2f69b279b0ba6b3ceb8adb3cb729a@95.216.1.249:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"A5dL+TsH6yMmcwlv41pHQUp8bot5e8DtNz6fikgxZTmN"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["X+zTQNa3umw07zS64xCObqG1N193RiNKGIVSbZ5rQQZxV8hhJNQOPYLnbOs9EF1eP0XI8so8vC50bbiX3EVMHAE="]} 2 | -------------------------------------------------------------------------------- /gentx_checker.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | class GentxChecker { 4 | constructor(gentx) { 5 | this._validator_data = gentx.body.messages[0]; 6 | } 7 | 8 | isHealthyDelegatorAddress() { 9 | return this._validator_data.delegator_address.startsWith('haqq'); 10 | } 11 | 12 | isHealthyValidatorAddress() { 13 | return this._validator_data.validator_address.startsWith('haqq'); 14 | } 15 | 16 | isHealthyAmount() { 17 | return parseInt(this._validator_data.value.amount) / 10000000000000000000 === 1.0; 18 | } 19 | 20 | isHealthyDenom() { 21 | return this._validator_data.value['denom'] === 'aISLM' 22 | } 23 | } 24 | 25 | let rawData = fs.readFileSync(process.argv[2]); 26 | let gentx_json = JSON.parse(rawData); 27 | 28 | const gentxChecker = new GentxChecker(gentx_json) 29 | const str_errors = [] 30 | 31 | if (!gentxChecker.isHealthyDelegatorAddress()) 32 | str_errors.push('Incorrect delegator address.'); 33 | if (!gentxChecker.isHealthyValidatorAddress()) 34 | str_errors.push('Incorrect validator address.'); 35 | if (!gentxChecker.isHealthyAmount()) 36 | str_errors.push('Incorrect amount.'); 37 | if (!gentxChecker.isHealthyDenom()) 38 | str_errors.push('Incorrect denom.'); 39 | 40 | console.log(str_errors.length === 0 ? 'No errors found' : str_errors.join('\n')) 41 | process.exit(str_errors.length === 0 ? 0 : 1) 42 | --------------------------------------------------------------------------------