Fixes for mobymask-v3 stack

This commit is contained in:
Prathamesh Musale 2023-10-03 17:32:39 +05:30
parent 3498f6e2a2
commit a1f988c2c2
7 changed files with 39 additions and 30 deletions

View File

@ -86,9 +86,10 @@ services:
CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER:-111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f} CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER:-111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f}
CERC_WATCHER_NITRO_PK: ${CERC_WATCHER_NITRO_PK:-0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4} CERC_WATCHER_NITRO_PK: ${CERC_WATCHER_NITRO_PK:-0279651921cd800ac560c21ceea27aab0107b67daf436cdd25ce84cad30159b4}
CERC_PEER_ID: ${CERC_PEER_ID} CERC_PEER_ID: ${CERC_PEER_ID}
CERC_ENABLE_UPSTREAM_PAYMENTS: ${CERC_ENABLE_UPSTREAM_PAYMENTS}
CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS:-0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE} CERC_UPSTREAM_NITRO_ADDRESS: ${CERC_UPSTREAM_NITRO_ADDRESS:-0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE}
CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR:-/dns4/go-nitro/tcp/5005/ws/p2p/16Uiu2HAmSjXJqsyBJgcBUU2HQmykxGseafSatbpq5471XmuaUqyv} CERC_UPSTREAM_NITRO_MULTIADDR: ${CERC_UPSTREAM_NITRO_MULTIADDR:-/dns4/go-nitro/tcp/5005/ws/p2p/16Uiu2HAmSjXJqsyBJgcBUU2HQmykxGseafSatbpq5471XmuaUqyv}
CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT} CERC_UPSTREAM_NITRO_PAY_AMOUNT: ${CERC_UPSTREAM_NITRO_PAY_AMOUNT:-5000}
command: ["bash", "./start-server.sh"] command: ["bash", "./start-server.sh"]
volumes: volumes:
- ../config/watcher-mobymask-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml - ../config/watcher-mobymask-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml

View File

@ -46,9 +46,5 @@ DEFAULT_CERC_PUBSUB=""
# Set of direct peers to be used when pubsub is set to gossipsub # Set of direct peers to be used when pubsub is set to gossipsub
DEFAULT_CERC_GOSSIPSUB_DIRECT_PEERS=[] DEFAULT_CERC_GOSSIPSUB_DIRECT_PEERS=[]
# Nitro node details (nitro address + multiaddr) of upstream ETH server # Whether to enable payments to upstream ETH server
DEFAULT_CERC_UPSTREAM_NITRO_ADDRESS="" DEFAULT_CERC_ENABLE_UPSTREAM_PAYMENTS=true
DEFAULT_CERC_UPSTREAM_NITRO_MULTIADDR=""
# Payment amount per RPC query request to the upstream ETH server
DEFAULT_CERC_UPSTREAM_NITRO_PAY_AMOUNT="5000"

View File

@ -13,10 +13,7 @@ CERC_PUBSUB="${CERC_PUBSUB:-${DEFAULT_CERC_PUBSUB}}"
CERC_RELAY_ANNOUNCE_DOMAIN="${CERC_RELAY_ANNOUNCE_DOMAIN:-${DEFAULT_CERC_RELAY_ANNOUNCE_DOMAIN}}" CERC_RELAY_ANNOUNCE_DOMAIN="${CERC_RELAY_ANNOUNCE_DOMAIN:-${DEFAULT_CERC_RELAY_ANNOUNCE_DOMAIN}}"
CERC_ENABLE_PEER_L2_TXS="${CERC_ENABLE_PEER_L2_TXS:-${DEFAULT_CERC_ENABLE_PEER_L2_TXS}}" CERC_ENABLE_PEER_L2_TXS="${CERC_ENABLE_PEER_L2_TXS:-${DEFAULT_CERC_ENABLE_PEER_L2_TXS}}"
CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}" CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}"
CERC_ENABLE_UPSTREAM_PAYMENTS="${CERC_ENABLE_UPSTREAM_PAYMENTS:-${DEFAULT_CERC_ENABLE_UPSTREAM_PAYMENTS}}"
CERC_UPSTREAM_NITRO_ADDRESS="${CERC_UPSTREAM_NITRO_ADDRESS:-${DEFAULT_CERC_UPSTREAM_NITRO_ADDRESS}}"
CERC_UPSTREAM_NITRO_MULTIADDR="${CERC_UPSTREAM_NITRO_MULTIADDR:-${DEFAULT_CERC_UPSTREAM_NITRO_MULTIADDR}}"
CERC_UPSTREAM_NITRO_PAY_AMOUNT="${CERC_UPSTREAM_NITRO_PAY_AMOUNT:-${DEFAULT_CERC_UPSTREAM_NITRO_PAY_AMOUNT}}"
watcher_keys_dir="./keys" watcher_keys_dir="./keys"
@ -126,6 +123,16 @@ else
CONSENSUS_PRIVATE_KEY='' CONSENSUS_PRIVATE_KEY=''
fi fi
if [ "$CERC_ENABLE_UPSTREAM_PAYMENTS" = true ]; then
UPSTREAM_NITRO_ADDRESS=${CERC_UPSTREAM_NITRO_ADDRESS}
UPSTREAM_NITRO_MULTIADDR=${CERC_UPSTREAM_NITRO_MULTIADDR}
UPSTREAM_NITRO_PAY_AMOUNT=${CERC_UPSTREAM_NITRO_PAY_AMOUNT}
else
UPSTREAM_NITRO_ADDRESS=""
UPSTREAM_NITRO_MULTIADDR=""
UPSTREAM_NITRO_PAY_AMOUNT=""
fi
# Read in the config template TOML file and modify it # Read in the config template TOML file and modify it
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml) WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
@ -145,9 +152,9 @@ WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
s|REPLACE_WITH_WATCHER_PARTY_PEERS_FILE|${WATCHER_PARTY_PEERS_FILE}|g; \ s|REPLACE_WITH_WATCHER_PARTY_PEERS_FILE|${WATCHER_PARTY_PEERS_FILE}|g; \
s|REPLACE_WITH_CERC_ETH_RPC_QUERY_ENDPOINT|${CERC_ETH_RPC_QUERY_ENDPOINT}|g; \ s|REPLACE_WITH_CERC_ETH_RPC_QUERY_ENDPOINT|${CERC_ETH_RPC_QUERY_ENDPOINT}|g; \
s|REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT|${CERC_ETH_RPC_MUTATION_ENDPOINT}|g; \ s|REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT|${CERC_ETH_RPC_MUTATION_ENDPOINT}|g; \
s/REPLACE_WITH_CERC_UPSTREAM_NITRO_ADDRESS/${CERC_UPSTREAM_NITRO_ADDRESS}/g; \ s/REPLACE_WITH_UPSTREAM_NITRO_ADDRESS/${UPSTREAM_NITRO_ADDRESS}/g; \
s|REPLACE_WITH_CERC_UPSTREAM_NITRO_MULTIADDR|${CERC_UPSTREAM_NITRO_MULTIADDR}|g; \ s|REPLACE_WITH_UPSTREAM_NITRO_MULTIADDR|${UPSTREAM_NITRO_MULTIADDR}|g; \
s/REPLACE_WITH_CERC_UPSTREAM_NITRO_PAY_AMOUNT/${CERC_UPSTREAM_NITRO_PAY_AMOUNT}/ ") s/REPLACE_WITH_UPSTREAM_NITRO_PAY_AMOUNT/${UPSTREAM_NITRO_PAY_AMOUNT}/ ")
# Write the modified content to a new file # Write the modified content to a new file
echo "$WATCHER_CONFIG" > environments/local.toml echo "$WATCHER_CONFIG" > environments/local.toml

View File

@ -73,7 +73,7 @@
enabled = REPLACE_WITH_CONSENSUS_ENABLED enabled = REPLACE_WITH_CONSENSUS_ENABLED
publicKey = 'REPLACE_WITH_CONSENSUS_PUBLIC_KEY' publicKey = 'REPLACE_WITH_CONSENSUS_PUBLIC_KEY'
privateKey = 'REPLACE_WITH_CONSENSUS_PRIVATE_KEY' privateKey = 'REPLACE_WITH_CONSENSUS_PRIVATE_KEY'
watcherPartyFile = 'REPLACE_WITH_WATCHER_PARTY_PEERS_FILE' watcherPartyPeersFile = 'REPLACE_WITH_WATCHER_PARTY_PEERS_FILE'
[metrics] [metrics]
host = "0.0.0.0" host = "0.0.0.0"
@ -98,9 +98,9 @@
rpcProviderMutationEndpoint = 'REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT' rpcProviderMutationEndpoint = 'REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT'
[upstream.ethServer.rpcProviderNitroNode] [upstream.ethServer.rpcProviderNitroNode]
address = 'REPLACE_WITH_CERC_UPSTREAM_NITRO_ADDRESS' address = 'REPLACE_WITH_UPSTREAM_NITRO_ADDRESS'
multiAddr = 'REPLACE_WITH_CERC_UPSTREAM_NITRO_MULTIADDR' multiAddr = 'REPLACE_WITH_UPSTREAM_NITRO_MULTIADDR'
amount = 'REPLACE_WITH_CERC_UPSTREAM_NITRO_PAY_AMOUNT' amount = 'REPLACE_WITH_UPSTREAM_NITRO_PAY_AMOUNT'
[upstream.cache] [upstream.cache]
name = "requests" name = "requests"

View File

@ -2,11 +2,11 @@ version: "1.0"
description: "MobyMask v3 stack" description: "MobyMask v3 stack"
name: mobymask-v3 name: mobymask-v3
repos: repos:
- github.com/cerc-io/ts-nitro - github.com/cerc-io/ts-nitrov0.1.12
- github.com/cerc-io/watcher-ts@v0.2.57 - github.com/cerc-io/watcher-ts@v0.2.57
- github.com/cerc-io/mobymask-v2-watcher-ts@v0.2.0 - github.com/cerc-io/mobymask-v2-watcher-ts@v3 # TODO: Update after fixes
- github.com/cerc-io/MobyMask@v0.1.3 - github.com/cerc-io/MobyMask@v0.1.3
- github.com/cerc-io/mobymask-ui - github.com/cerc-io/mobymask-ui@v0.2.0
containers: containers:
- cerc/nitro-contracts - cerc/nitro-contracts
- cerc/watcher-ts - cerc/watcher-ts

View File

@ -23,14 +23,16 @@ laconic-so --stack mobymask-v3 build-containers --exclude cerc/mobymask-ui
Create and update an env file to be used in the next step ([defaults](../../config/watcher-mobymask-v3/mobymask-params.env)): Create and update an env file to be used in the next step ([defaults](../../config/watcher-mobymask-v3/mobymask-params.env)):
```bash ```bash
# External ETH RPC endpoint # External ETH RPC endpoint (L2 Optimism geth)
CERC_ETH_RPC_ENDPOINT= CERC_ETH_RPC_ENDPOINT=
# URL (fixturenet-eth-bootnode-lighthouse) to get CSV with credentials for accounts on L1 to perform txs on L2 # External ETH RPC endpoint used for queries in the watcher
CERC_L1_ACCOUNTS_CSV_URL= CERC_ETH_RPC_QUERY_ENDPOINT=
# OR # External ETH RPC endpoint used for mutations in the watcher
# Specify the required account credentials CERC_ETH_RPC_MUTATION_ENDPOINT=
# Specify the an account PK for contract deployment
CERC_PRIVATE_KEY_DEPLOYER= CERC_PRIVATE_KEY_DEPLOYER=
# Base URI for mobymask-app # Base URI for mobymask-app
@ -69,6 +71,9 @@ Create and update an env file to be used in the next step ([defaults](../../conf
# (Optional) Set a pre-existing peer id to be used (enables consensus) # (Optional) Set a pre-existing peer id to be used (enables consensus)
# Uses a generated peer id if not set (disables consensus) # Uses a generated peer id if not set (disables consensus)
CERC_PEER_ID= CERC_PEER_ID=
# Disable payments to upstream ETH server
CERC_ENABLE_UPSTREAM_PAYMENTS=false
``` ```
* NOTE: If Optimism is running on the host machine, use `host.docker.internal` as the hostname to access the host port * NOTE: If Optimism is running on the host machine, use `host.docker.internal` as the hostname to access the host port
@ -101,9 +106,9 @@ laconic-so --stack mobymask-v3 deploy --cluster mobymask_v3 --exclude mobymask-a
* Check logs of the Nitro contracts container to get the deployed Nitro contracts' addresses: * Check logs of the Nitro contracts container to get the deployed Nitro contracts' addresses:
```bash ```bash
docker exec -it $(docker ps -q --filter name="nitro-contracts") bash -c "cat /app/deployment/nitro-addresses.json" docker exec -it $(docker ps -q --filter name="nitro-contracts") bash -c "cat /app/deployment/nitro-addresses.json"
``` ```
## Clean up ## Clean up

View File

@ -56,7 +56,7 @@ Create and update an env file to be used in the next step ([defaults](../../conf
# Nitro account address to make the query and mutation payments to # Nitro account address to make the query and mutation payments to
CERC_PAYMENT_NITRO_ADDRESS= CERC_PAYMENT_NITRO_ADDRESS=
# Endpoint for Mobymask snap installation # (Optional) Endpoint for Mobymask snap installation
CERC_SNAP_URL= CERC_SNAP_URL=
``` ```