Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jesse/fix-nightly-v1.0.0-rc1 #1600

Merged
merged 5 commits into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 38 additions & 24 deletions .github/workflows/deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,67 +115,81 @@ jobs:
{% endif %}
{% endfor %}

BURN_CONTRACT_ADDRESS=0x0000000000000000000000000000000000000000

polygon-edge genesis \
--consensus polybft \
{% for item in hostvars %}{% if (hostvars[item].tags.Role == "fullnode" or hostvars[item].tags.Role == "validator") %} --bootnode /dns4/{{ hostvars[item].tags["Name"] }}/tcp/{{ edge_p2p_port }}/p2p/$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].node_id') {% endif %}{% endfor %} \
{% for item in hostvars %}{% if (hostvars[item].tags.Role == "fullnode" or hostvars[item].tags.Role == "validator") %} --premine $(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address'):1000000000000000000000000 {% endif %}{% endfor %} \
--premine {{ loadtest_account }}:1000000000000000000000000000 \
--premine $BURN_CONTRACT_ADDRESS \
--burn-contract 0:$BURN_CONTRACT_ADDRESS \
--reward-wallet 0x0101010101010101010101010101010101010101:1000000000000000000000000000 \
--premine 0xA39Fed214820cF843E2Bcd6cA1759257a530894B:1000000000000000000000000000 \
--premine 0x181d9fEc79EC674DD3cB30dd9dd4188E737939FE:1000000000000000000000000000 \
--premine 0x1AB8C3df809b85012a009c0264eb92dB04eD6EFa:1000000000000000000000000000 \
--block-gas-limit {{ block_gas_limit }} --block-time {{ block_time }}s \
--block-gas-limit {{ block_gas_limit }} \
--block-time {{ block_time }}s \
{% for item in hostvars %}{% if (hostvars[item].tags.Role == "validator") %} --validators /dns4/{{ hostvars[item].tags["Name"] }}/tcp/{{ edge_p2p_port }}/p2p/$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].node_id'):$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address' | sed 's/^0x//'):$(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].bls_pubkey') {% endif %}{% endfor %} \
--epoch-size 10 \
--native-token-config MyToken:MTK:18:true

polycli wallet create --words 12 --language english | jq '.Addresses[0]' > rootchain-wallet.json

# Should the deployer be funded from an unlocked L1 chain or from a prefunded account on L1
{% if (not fund_rootchain_coinbase) %}# {% endif %}COINBASE_ADDRESS=$(cast rpc --rpc-url {{ rootchain_json_rpc }} eth_coinbase | sed 's/"//g')
{% if (not fund_rootchain_coinbase) %}# {% endif %}cast send --rpc-url {{ rootchain_json_rpc }} --from $COINBASE_ADDRESS --value {{ rootchain_deployer_fund_amount }} $(cat rootchain-wallet.json | jq -r '.ETHAddress') --unlocked
{% if (fund_rootchain_coinbase) %}# {% endif %}cast send --rpc-url {{ rootchain_json_rpc }} --from {{ rootchain_coinbase_address }} --value {{ rootchain_deployer_fund_amount }} $(cat rootchain-wallet.json | jq -r '.ETHAddress') --private-key {{ rootchain_coinbase_private_key }}
COINBASE_ADDRESS=$(cast rpc --rpc-url {{ rootchain_json_rpc }} eth_coinbase | sed 's/"//g')
cast send --rpc-url {{ rootchain_json_rpc }} --from $COINBASE_ADDRESS --value {{ rootchain_deployer_fund_amount }} $(cat rootchain-wallet.json | jq -r '.ETHAddress') --unlocked

polygon-edge polybft stake-manager-deploy \
--jsonrpc {{ rootchain_json_rpc }} \
--private-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey')
--test

polygon-edge rootchain deploy \
--deployer-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
--stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \
--stake-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeTokenAddr') \
--json-rpc {{ rootchain_json_rpc }}
--json-rpc {{ rootchain_json_rpc }} \
--test

{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
cast send --rpc-url {{ rootchain_json_rpc }} --from $(cat rootchain-wallet.json | jq -r '.ETHAddress') --private-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
--value {{ rootchain_validator_fund_amount }} $(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address')
{% endif %}
{% endfor %}
polygon-edge rootchain fund \
--stake-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeTokenAddr') \
--mint \
--addresses $(cat validator-*.json | jq -r ".[].address" | paste -sd "," - | tr -d '\n') \
--amounts $(for f in validator-*.json; do echo -n "1000000000000000000000000,"; done | sed 's/,$//') \
--json-rpc {{ rootchain_json_rpc }}

polygon-edge polybft whitelist-validators \
--private-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
--addresses $(cat validator-*.json | jq -r ".[].address" | tr "\n" ",") \
--supernet-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') \
--jsonrpc {{ rootchain_json_rpc }}
--private-key aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d \
--addresses $(cat validator-*.json | jq -r ".[].address" | paste -sd "," - | tr -d '\n') \
--supernet-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') \
--jsonrpc {{ rootchain_json_rpc }}

counter=1
{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
polygon-edge polybft register-validator --data-dir {{ hostvars[item].tags["Name"] }} \
echo "Registering validator: ${counter}"

polygon-edge polybft register-validator \
--data-dir {{ hostvars[item].tags["Name"] }} \
--supernet-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') \
--jsonrpc {{ rootchain_json_rpc }}

polygon-edge polybft stake --data-dir {{ hostvars[item].tags["Name"] }} \
--amount 10 \
polygon-edge polybft stake \
--data-dir {{ hostvars[item].tags["Name"] }} \
--amount 1000000000000000000000000 \
--supernet-id $(cat genesis.json | jq -r '.params.engine.polybft.supernetID') \
--stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \
--stake-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeTokenAddr') \
--native-root-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.nativeERC20Address') \
--jsonrpc {{ rootchain_json_rpc }}

((counter++))
{% endif %}
{% endfor %}

{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
{% endif %}
{% endfor %}

polygon-edge polybft supernet --private-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
polygon-edge polybft supernet \
--private-key aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d \
--supernet-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') \
--stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \
--finalize-genesis-set \
Expand Down