Replace laconicd with optimism in mobymask-v2 stack (#272)
* Remove laconicd to use optimism endpoint * Use fixturenet-optimism stack for mobymask-v2-watcher * Fix setting L1 account private key in mobymask-v2 stack Former-commit-id: b266ac78b4253ff655875922670797a6e56d578f
This commit is contained in:
@@ -28,10 +28,12 @@ PROPOSER_ADDRESS=$(echo "$KEYS_JSON" | jq -r '.Proposer.address')
|
||||
BATCHER_ADDRESS=$(echo "$KEYS_JSON" | jq -r '.Batcher.address')
|
||||
SEQUENCER_ADDRESS=$(echo "$KEYS_JSON" | jq -r '.Sequencer.address')
|
||||
|
||||
# Read the private key of a L1 account
|
||||
# Read the private key of L1 accounts
|
||||
# TODO: Take from env if /geth-accounts volume doesn't exist to allow using separately running L1
|
||||
L1_ADDRESS=$(head -n 1 /geth-accounts/accounts.csv | cut -d ',' -f 2)
|
||||
L1_PRIV_KEY=$(head -n 1 /geth-accounts/accounts.csv | cut -d ',' -f 3)
|
||||
L1_ADDRESS_2=$(awk -F, 'NR==2{print $(NF-1)}' /geth-accounts/accounts.csv)
|
||||
L1_PRIV_KEY_2=$(awk -F, 'NR==2{print $NF}' /geth-accounts/accounts.csv)
|
||||
|
||||
# Send balances to the above L2 addresses
|
||||
yarn hardhat send-balance --to "${ADMIN_ADDRESS}" --amount 2 --private-key "${L1_PRIV_KEY}" --network getting-started
|
||||
@@ -69,13 +71,18 @@ yarn hardhat deploy --network getting-started
|
||||
|
||||
echo "Deployed the L1 smart contracts"
|
||||
|
||||
# Read Proxy contarct's JSON and get the address
|
||||
# Read Proxy contract's JSON and get the address
|
||||
PROXY_JSON=$(cat deployments/getting-started/Proxy__OVM_L1StandardBridge.json)
|
||||
PROXY_ADDRESS=$(echo "$PROXY_JSON" | jq -r '.address')
|
||||
|
||||
# Send balance to the above L2 address
|
||||
# Send balance to the above Proxy contract in L1 for reflecting balance in L2
|
||||
# First account
|
||||
yarn hardhat send-balance --to "${PROXY_ADDRESS}" --amount 1 --private-key "${L1_PRIV_KEY}" --network getting-started
|
||||
# Second account
|
||||
yarn hardhat send-balance --to "${PROXY_ADDRESS}" --amount 1 --private-key "${L1_PRIV_KEY_2}" --network getting-started
|
||||
|
||||
echo "Balance sent to Proxy L2 contract"
|
||||
echo "Use account ${L1_ADDRESS} to deploy contracts to L2"
|
||||
echo "Use following accounts for transactions in L2:"
|
||||
echo "${L1_ADDRESS}"
|
||||
echo "${L1_ADDRESS_2}"
|
||||
echo "Done"
|
||||
|
||||
@@ -6,11 +6,11 @@ SEQUENCER_KEY=$(jq -r '.Sequencer.privateKey' /l2-accounts/keys.json | tr -d '"'
|
||||
|
||||
op-node \
|
||||
--l2=http://op-geth:8551 \
|
||||
--l2.jwt-secret=/app/jwt.txt \
|
||||
--l2.jwt-secret=/op-node-data/jwt.txt \
|
||||
--sequencer.enabled \
|
||||
--sequencer.l1-confs=3 \
|
||||
--verifier.l1-confs=3 \
|
||||
--rollup.config=/app/rollup.json \
|
||||
--rollup.config=/op-node-data/rollup.json \
|
||||
--rpc.addr=0.0.0.0 \
|
||||
--rpc.port=8547 \
|
||||
--p2p.disable \
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Read the private key of L1 account to deploy contract
|
||||
# TODO: Take from env if /geth-accounts volume doesn't exist to allow using separately running L1
|
||||
L1_PRIV_KEY=$(head -n 1 /geth-accounts/accounts.csv | cut -d ',' -f 3)
|
||||
|
||||
# Set the private key
|
||||
jq --arg privateKey "$L1_PRIV_KEY" '.privateKey = ($privateKey)' secrets-template.json > secrets.json
|
||||
|
||||
npm start
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rpcUrl": "http://op-geth:8545",
|
||||
"privateKey": "",
|
||||
"baseURI": "http://127.0.0.1:3002/#"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"rpcUrl": "http://laconicd:8545",
|
||||
"privateKey": "GENESIS_ACCOUNT_PRIVATE_KEY",
|
||||
"baseURI": "http://127.0.0.1:3002/#"
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Assign deployed contract address from server config
|
||||
CONTRACT_ADDRESS=`jq '.address' /server/config.json`
|
||||
CONTRACT_ADDRESS=$(jq -r '.address' /server/config.json | tr -d '"')
|
||||
L1_PRIV_KEY_2=$(awk -F, 'NR==2{print $NF}' /geth-accounts/accounts.csv)
|
||||
|
||||
sed "s/REPLACE_WITH_CONTRACT_ADDRESS/${CONTRACT_ADDRESS}/" environments/watcher-config-template.toml > environments/local.toml
|
||||
sed "s/REPLACE_WITH_PRIVATE_KEY/${L1_PRIV_KEY_2}/" environments/watcher-config-template.toml > environments/local.toml
|
||||
sed -i "s/REPLACE_WITH_CONTRACT_ADDRESS/${CONTRACT_ADDRESS}/" environments/local.toml
|
||||
|
||||
echo 'yarn server'
|
||||
yarn server
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
enableDebugInfo = true
|
||||
|
||||
[server.p2p.peer.l2TxConfig]
|
||||
privateKey = ''
|
||||
contractAddress = REPLACE_WITH_CONTRACT_ADDRESS
|
||||
privateKey = 'REPLACE_WITH_PRIVATE_KEY'
|
||||
contractAddress = 'REPLACE_WITH_CONTRACT_ADDRESS'
|
||||
|
||||
[metrics]
|
||||
host = "0.0.0.0"
|
||||
@@ -59,7 +59,7 @@
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
gqlApiEndpoint = "http://ipld-eth-server:8083/graphql"
|
||||
rpcProviderEndpoint = "http://laconicd:8545"
|
||||
rpcProviderEndpoint = "http://op-geth:8545"
|
||||
blockDelayInMilliSecs = 60000
|
||||
|
||||
[upstream.cache]
|
||||
|
||||
Reference in New Issue
Block a user