Use variable for geth and optimsim chain id

This commit is contained in:
Neeraj 2024-09-04 14:19:37 +05:30
parent 76adabda96
commit 94156b85cc
2 changed files with 10 additions and 9 deletions

View File

@ -15,6 +15,8 @@
eth_value: "1ether"
fixturenet_optimism_dir: "{{ nitro_directory }}/fixturenet-optimism-deployment"
fixturenet_eth_dir: "{{ nitro_directory }}/fixturenet-eth-deployment"
geth_chain_id: "1212"
optimism_chain_id: "42069"
tasks:
- name: Start fixturenet-eth-deployment
@ -99,7 +101,7 @@
timeout: 60
- name: Export NA_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.NitroAdjudicator.address' /app/deployment/nitro-addresses.json"
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.NitroAdjudicator.address' /app/deployment/nitro-addresses.json"
args:
chdir: "{{ nitro_directory }}"
register: NA_ADDRESS
@ -107,7 +109,7 @@
msg: "NA_ADDRESS: {{ NA_ADDRESS.stdout }}"
- name: Export CA_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json"
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json"
args:
chdir: "{{ nitro_directory }}"
register: CA_ADDRESS
@ -115,7 +117,7 @@
msg: "CA_ADDRESS: {{ CA_ADDRESS.stdout }}"
- name: Export VPA_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json"
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json"
args:
chdir: "{{ nitro_directory }}"
register: VPA_ADDRESS
@ -123,7 +125,7 @@
msg: "VPA_ADDRESS: {{ VPA_ADDRESS.stdout }}"
- name: Export L1_ASSET_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.Token.address' /app/deployment/nitro-addresses.json"
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.Token.address' /app/deployment/nitro-addresses.json"
args:
chdir: "{{ nitro_directory }}"
register: L1_ASSET_ADDRESS
@ -164,20 +166,20 @@
- name: Send tokens to Alice
shell: >
laconic-so deployment --dir bridge-deployment exec l2-nitro-contracts
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts
"cd packages/nitro-protocol && yarn hardhat transfer --contract {{ L1_ASSET_ADDRESS.stdout }} --to {{ A_CHAIN_ADDRESS }} --amount 1000 --network geth"
args:
chdir: "{{ nitro_directory }}"
- name: Send tokens to Charlie
shell: >
laconic-so deployment --dir bridge-deployment exec l2-nitro-contracts
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts
"cd packages/nitro-protocol && yarn hardhat transfer --contract {{ L1_ASSET_ADDRESS.stdout }} --to {{ C_CHAIN_ADDRESS }} --amount 1000 --network geth"
args:
chdir: "{{ nitro_directory }}"
- name: Export BRIDGE_ADDRESS
shell: laconic-so deployment --dir bridge-deployment exec nitro-bridge "jq -r '.\"42069\"[0].contracts.Bridge.address' /app/deployment/nitro-addresses.json"
shell: laconic-so deployment --dir bridge-deployment exec nitro-bridge "jq -r '.\"{{ optimism_chain_id }}\"[0].contracts.Bridge.address' /app/deployment/nitro-addresses.json"
args:
chdir: "{{ nitro_directory }}"
register: BRIDGE_ADDRESS

View File

@ -5,10 +5,9 @@ config:
NITRO_L2_CHAIN_URL: ws://host.docker.internal:9546
NITRO_CHAIN_PK: 888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218
NITRO_SC_PK: 0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4
GETH_URL: http://host.docker.internal:8545
OPTIMISM_URL: http://host.docker.internal:9545
GETH_DEPLOYER_PK: '{{ GETH_DEPLOYER_PK }}'
OPTIMISM_DEPLOYER_PK: '{{ OPTIMISM_DEPLOYER_PK }}'
OPTIMISM_CHAIN_ID: '{{ optimism_chain_id }}'
TOKEN_NAME: LaconicNetworkToken
TOKEN_SYMBOL: LNT
INITIAL_TOKEN_SUPPLY: '129600'