From 379332d5ecb7f92c4918576bfe3987e30974e06a Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Thu, 4 May 2023 20:00:58 +0530 Subject: [PATCH] Add watcher config option for blacklisted multiaddrs --- app/data/compose/docker-compose-watcher-mobymask-v2.yml | 1 + app/data/config/watcher-mobymask-v2/start-server.sh | 2 ++ .../watcher-mobymask-v2/watcher-config-template.toml | 2 ++ app/data/stacks/mobymask-v2/mobymask-only.md | 7 +++++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/data/compose/docker-compose-watcher-mobymask-v2.yml b/app/data/compose/docker-compose-watcher-mobymask-v2.yml index 36c5f3f9..0c743670 100644 --- a/app/data/compose/docker-compose-watcher-mobymask-v2.yml +++ b/app/data/compose/docker-compose-watcher-mobymask-v2.yml @@ -83,6 +83,7 @@ services: CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL} CERC_PRIVATE_KEY_PEER: ${CERC_PRIVATE_KEY_PEER} CERC_RELAY_PEERS: ${CERC_RELAY_PEERS} + CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS} CERC_RELAY_ANNOUNCE_DOMAIN: ${CERC_RELAY_ANNOUNCE_DOMAIN} CERC_ENABLE_PEER_L2_TXS: ${CERC_ENABLE_PEER_L2_TXS} CERC_DEPLOYED_CONTRACT: ${CERC_DEPLOYED_CONTRACT} diff --git a/app/data/config/watcher-mobymask-v2/start-server.sh b/app/data/config/watcher-mobymask-v2/start-server.sh index b46a7c14..fe263ec4 100755 --- a/app/data/config/watcher-mobymask-v2/start-server.sh +++ b/app/data/config/watcher-mobymask-v2/start-server.sh @@ -8,6 +8,7 @@ CERC_L2_GETH_RPC="${CERC_L2_GETH_RPC:-${DEFAULT_CERC_L2_GETH_RPC}}" CERC_L1_ACCOUNTS_CSV_URL="${CERC_L1_ACCOUNTS_CSV_URL:-${DEFAULT_CERC_L1_ACCOUNTS_CSV_URL}}" CERC_RELAY_PEERS="${CERC_RELAY_PEERS:-${DEFAULT_CERC_RELAY_PEERS}}" +CERC_DENY_MULTIADDRS="${CERC_DENY_MULTIADDRS:-${DEFAULT_CERC_DENY_MULTIADDRS}}" 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_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRACT}}" @@ -42,6 +43,7 @@ fi WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml) WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ sed -E "s|REPLACE_WITH_CERC_RELAY_PEERS|${CERC_RELAY_PEERS}|g; \ + s/REPLACE_WITH_CERC_DENY_MULTIADDRS/${CERC_DENY_MULTIADDRS}/g; \ s/REPLACE_WITH_CERC_RELAY_ANNOUNCE_DOMAIN/${CERC_RELAY_ANNOUNCE_DOMAIN}/g; \ s|REPLACE_WITH_CERC_RELAY_MULTIADDR|${CERC_RELAY_MULTIADDR}|g; \ s/REPLACE_WITH_CERC_ENABLE_PEER_L2_TXS/${CERC_ENABLE_PEER_L2_TXS}/g; \ diff --git a/app/data/config/watcher-mobymask-v2/watcher-config-template.toml b/app/data/config/watcher-mobymask-v2/watcher-config-template.toml index e6ce0750..5a2c7ce4 100644 --- a/app/data/config/watcher-mobymask-v2/watcher-config-template.toml +++ b/app/data/config/watcher-mobymask-v2/watcher-config-template.toml @@ -27,6 +27,7 @@ host = "0.0.0.0" port = 9090 relayPeers = REPLACE_WITH_CERC_RELAY_PEERS + denyMultiaddrs = REPLACE_WITH_CERC_DENY_MULTIADDRS peerIdFile = './peers/relay-id.json' announce = 'REPLACE_WITH_CERC_RELAY_ANNOUNCE_DOMAIN' enableDebugInfo = true @@ -34,6 +35,7 @@ [server.p2p.peer] relayMultiaddr = 'REPLACE_WITH_CERC_RELAY_MULTIADDR' pubSubTopic = 'mobymask' + denyMultiaddrs = REPLACE_WITH_CERC_DENY_MULTIADDRS peerIdFile = './peers/peer-id.json' enableDebugInfo = true enableL2Txs = REPLACE_WITH_CERC_ENABLE_PEER_L2_TXS diff --git a/app/data/stacks/mobymask-v2/mobymask-only.md b/app/data/stacks/mobymask-v2/mobymask-only.md index 4cfb4ecf..67d12dcb 100644 --- a/app/data/stacks/mobymask-v2/mobymask-only.md +++ b/app/data/stacks/mobymask-v2/mobymask-only.md @@ -67,11 +67,14 @@ Create and update an env file to be used in the next step ([defaults](../../conf # (used for generating a root invite link after deploying the contract) CERC_MOBYMASK_APP_BASE_URI="http://127.0.0.1:3002/#" + # (Optional) Domain to be used in the relay node's announce address + CERC_RELAY_ANNOUNCE_DOMAIN= + # (Optional) Set of relay peers to connect to from the relay node CERC_RELAY_PEERS=[] - # (Optional) Domain to be used in the relay node's announce address - CERC_RELAY_ANNOUNCE_DOMAIN= + # (Optional) Set of multiaddrs to be avoided while dialling + CERC_DENY_MULTIADDRS=[] # Set to false for disabling watcher peer to send txs to L2 CERC_ENABLE_PEER_L2_TXS=true