From e3dc75118bea0f5dc20fc95726b3f068c4636ed2 Mon Sep 17 00:00:00 2001 From: prathamesh0 <42446521+prathamesh0@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:55:53 +0530 Subject: [PATCH] Add support for direct peers when pubsub is set to gossipsub (#539) Co-authored-by: Shreerang Kale --- app/data/compose/docker-compose-mobymask-app-v3.yml | 1 + app/data/config/watcher-mobymask-v3/mobymask-app-start.sh | 4 +++- app/data/config/watcher-mobymask-v3/mobymask-params.env | 3 +++ app/data/stacks/mobymask-v3/web-app.md | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/data/compose/docker-compose-mobymask-app-v3.yml b/app/data/compose/docker-compose-mobymask-app-v3.yml index bc0973c8..a0de0d0c 100644 --- a/app/data/compose/docker-compose-mobymask-app-v3.yml +++ b/app/data/compose/docker-compose-mobymask-app-v3.yml @@ -14,6 +14,7 @@ services: CERC_RELAY_NODES: ${CERC_RELAY_NODES} CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS} CERC_PUBSUB: ${CERC_PUBSUB} + CERC_GOSSIPSUB_DIRECT_PEERS: ${CERC_GOSSIPSUB_DIRECT_PEERS} CERC_RELEASE: "laconic-v3" CERC_NA_ADDRESS: ${CERC_NA_ADDRESS} CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS} diff --git a/app/data/config/watcher-mobymask-v3/mobymask-app-start.sh b/app/data/config/watcher-mobymask-v3/mobymask-app-start.sh index d7f87f19..b7ad3a7a 100644 --- a/app/data/config/watcher-mobymask-v3/mobymask-app-start.sh +++ b/app/data/config/watcher-mobymask-v3/mobymask-app-start.sh @@ -10,6 +10,7 @@ CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRA CERC_RELAY_NODES="${CERC_RELAY_NODES:-${DEFAULT_CERC_RELAY_NODES}}" CERC_DENY_MULTIADDRS="${CERC_DENY_MULTIADDRS:-${DEFAULT_CERC_DENY_MULTIADDRS}}" CERC_PUBSUB="${CERC_PUBSUB:-${DEFAULT_CERC_PUBSUB}}" +CERC_GOSSIPSUB_DIRECT_PEERS="${CERC_GOSSIPSUB_DIRECT_PEERS:-${DEFAULT_CERC_GOSSIPSUB_DIRECT_PEERS}}" echo "Using CERC_RELAY_NODES $CERC_RELAY_NODES" @@ -49,7 +50,8 @@ jq --arg address "$CERC_DEPLOYED_CONTRACT" \ --argjson relayNodes "$CERC_RELAY_NODES" \ --argjson denyMultiaddrs "$CERC_DENY_MULTIADDRS" \ --arg pubsub "$CERC_PUBSUB" \ - '.address = $address | .chainId = $chainId | .relayNodes = $relayNodes | .peer.denyMultiaddrs = $denyMultiaddrs | .peer.pubsub = $pubsub' \ + --argjson directPeers "$CERC_GOSSIPSUB_DIRECT_PEERS" \ + '.address = $address | .chainId = $chainId | .relayNodes = $relayNodes | .peer.denyMultiaddrs = $denyMultiaddrs | .peer.pubsub = $pubsub | .peer.directPeers = $directPeers' \ /app/src/mobymask-app-config.json > /app/src/utils/config.json yarn install diff --git a/app/data/config/watcher-mobymask-v3/mobymask-params.env b/app/data/config/watcher-mobymask-v3/mobymask-params.env index 35a54b69..88b83942 100644 --- a/app/data/config/watcher-mobymask-v3/mobymask-params.env +++ b/app/data/config/watcher-mobymask-v3/mobymask-params.env @@ -28,6 +28,9 @@ DEFAULT_CERC_DENY_MULTIADDRS=[] # Type of pubsub to be used DEFAULT_CERC_PUBSUB="" +# Set of direct peers to be used when pubsub is set to gossipsub +DEFAULT_CERC_GOSSIPSUB_DIRECT_PEERS=[] + # Set deployed Nitro addresses to avoid deploying them in the stack DEFAULT_CERC_NA_ADDRESS= DEFAULT_CERC_VPA_ADDRESS= diff --git a/app/data/stacks/mobymask-v3/web-app.md b/app/data/stacks/mobymask-v3/web-app.md index d0efee81..aef90e99 100644 --- a/app/data/stacks/mobymask-v3/web-app.md +++ b/app/data/stacks/mobymask-v3/web-app.md @@ -45,6 +45,9 @@ Create and update an env file to be used in the next step ([defaults](../../conf # (Optional) Type of pubsub to be used ("floodsub" | "gossipsub") CERC_PUBSUB="" + # (Optional) Set of direct peers to be used when pubsub is set to gossipsub + CERC_GOSSIPSUB_DIRECT_PEERS=[] + # Set Nitro addresses CERC_NA_ADDRESS= CERC_VPA_ADDRESS=