Skip to content

Commit

Permalink
Add support for direct peers when pubsub is set to gossipsub (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: Shreerang Kale <[email protected]>
  • Loading branch information
prathamesh0 and shreerang6921 authored Sep 25, 2023
1 parent e0b5318 commit e3dc751
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/data/compose/docker-compose-mobymask-app-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 3 additions & 1 deletion app/data/config/watcher-mobymask-v3/mobymask-app-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions app/data/config/watcher-mobymask-v3/mobymask-params.env
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 3 additions & 0 deletions app/data/stacks/mobymask-v3/web-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit e3dc751

Please sign in to comment.