Skip to content

Commit

Permalink
Merge pull request #17 from maticnetwork/jhilliard/mumbai-testing
Browse files Browse the repository at this point in the history
Removing Chain-ID
  • Loading branch information
praetoriansentry authored May 18, 2023
2 parents b73772a + bb770ff commit b3d11d5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
1 change: 0 additions & 1 deletion ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ edge_user: edge
is_validator: false

loadtest_account: "0x85da99c8a7c2c95964c8efd687e95e632fc533d6"
rootchain_json_rpc: http://geth-001:8545

edge_grpc_port: 10000
edge_p2p_port: 10001
Expand Down
30 changes: 27 additions & 3 deletions ansible/local-extra-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,36 @@ clean_deploy_title: devnet13

block_gas_limit: 50_000_000
block_time: 5
chain_id: 2001

polycli_tag: 0.1.20
polycli_tag: 0.1.22
edge_tag: v0.9.0
geth_tag: v1.11.6
go_tag: 1.19.7.linux-amd64
go_tag: 1.19.9.linux-amd64

# this is the amount of value that will be transfered on the rootchain to the deployer address and the validators
rootchain_validator_fund_amount: 100ether
rootchain_deployer_fund_amount: 10000000ether
# rootchain_deployer_fund_amount: 10ether
# rootchain_validator_fund_amount: 1ether



# this is the rpc url that will be used for the root chain
rootchain_json_rpc: http://geth-001:8545
# rootchain_json_rpc: https://matic-mumbai.chainstacklabs.com

# When our l1 is geth with an unlocked account, we'll need to send
# ether from the randomly created coinbase to our predetermined
# account. Set this to true in order to fund. Set this to false if the
# coinbase account is already funded
fund_rootchain_coinbase: true
# fund_rootchain_coinbase: false

# This account is just for testing purposes. Don't actually use it. If
# the L1 is NOT an unlocked test account, then you'll need some wallet
# for funding validators. The address and private key here are used for this purpose
rootchain_coinbase_address: "0xC7FDEe289150041f2c4AAEF095e8a6715223663C"
rootchain_coinbase_private_key: "0xc0ffec0ffec0ffec0ffec0ffec0ffec0ffec0ffec0ffec0ffec0ffec0ffeDEAD"

ansible_ssh_private_key_file: ~/devnet_private.key
ansible_ssh_common_args: >
Expand Down
17 changes: 8 additions & 9 deletions ansible/roles/edge/templates/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,25 @@ main() {
{% 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 \
--reward-wallet 0x0101010101010101010101010101010101010101:1000000000000000000000000000 \
--premine 0xA39Fed214820cF843E2Bcd6cA1759257a530894B:1000000000000000000000000000 \
--premine 0x181d9fEc79EC674DD3cB30dd9dd4188E737939FE: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 %} \
--chain-id {{ chain_id }} \
--epoch-size 10

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

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 100ether $(cat rootchain-wallet.json | jq -r '.ETHAddress')
# 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 }}

polygon-edge rootchain deploy \
--deployer-key $(cat rootchain-wallet.json | jq -r '.HexPrivateKey') \
--json-rpc {{ rootchain_json_rpc }}

{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
cast send --rpc-url {{ rootchain_json_rpc }} --from $COINBASE_ADDRESS --value 100ether $(cat {{ hostvars[item].tags["Name"] }}.json | jq -r '.[0].address')
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 %}

Expand All @@ -59,7 +58,7 @@ main() {

{% for item in hostvars %}
{% if (hostvars[item].tags.Role == "validator") %}
polygon-edge polybft stake --data-dir {{ hostvars[item].tags["Name"] }} --chain-id {{ chain_id }} \
polygon-edge polybft stake --data-dir {{ hostvars[item].tags["Name"] }} --chain-id $(cat genesis.json | jq -r '.params.chainID') \
--amount 10 \
--stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \
--native-root-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.nativeERC20Address') \
Expand Down

0 comments on commit b3d11d5

Please sign in to comment.