Skip to content

Commit

Permalink
Pass Nitro chain URL in watcher config
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh0 committed Oct 5, 2023
1 parent c3653c5 commit f1fa5ba
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/data/compose/docker-compose-watcher-mobymask-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ services:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_ETH_RPC_QUERY_ENDPOINT: ${CERC_ETH_RPC_QUERY_ENDPOINT}
CERC_ETH_RPC_MUTATION_ENDPOINT: ${CERC_ETH_RPC_MUTATION_ENDPOINT}
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL}
CERC_RELAY_PEERS: ${CERC_RELAY_PEERS}
CERC_DENY_MULTIADDRS: ${CERC_DENY_MULTIADDRS}
CERC_PUBSUB: ${CERC_PUBSUB}
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 @@ -9,6 +9,9 @@ DEFAULT_CERC_ETH_RPC_QUERY_ENDPOINT="http://nitro-reverse-payment-proxy:8081"
# ETH RPC endpoint used for mutations in the watcher
DEFAULT_CERC_ETH_RPC_MUTATION_ENDPOINT="http://fixturenet-eth-geth-1:8545"

# ETH endpoint used by watcher's Nitro node
DEFAULT_CERC_NITRO_CHAIN_URL="http://fixturenet-eth-geth-1:8546"

# Set of relay peers to connect to from the relay node
DEFAULT_CERC_RELAY_PEERS=[]

Expand Down
3 changes: 3 additions & 0 deletions app/data/config/watcher-mobymask-v3/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fi

CERC_ETH_RPC_QUERY_ENDPOINT="${CERC_ETH_RPC_QUERY_ENDPOINT:-${DEFAULT_CERC_ETH_RPC_QUERY_ENDPOINT}}"
CERC_ETH_RPC_MUTATION_ENDPOINT="${CERC_ETH_RPC_MUTATION_ENDPOINT:-${DEFAULT_CERC_ETH_RPC_MUTATION_ENDPOINT}}"
CERC_NITRO_CHAIN_URL="${CERC_NITRO_CHAIN_URL:-${DEFAULT_CERC_NITRO_CHAIN_URL}}"
CERC_RELAY_PEERS="${CERC_RELAY_PEERS:-${DEFAULT_CERC_RELAY_PEERS}}"
CERC_DENY_MULTIADDRS="${CERC_DENY_MULTIADDRS:-${DEFAULT_CERC_DENY_MULTIADDRS}}"
CERC_PUBSUB="${CERC_PUBSUB:-${DEFAULT_CERC_PUBSUB}}"
Expand All @@ -19,6 +20,7 @@ watcher_keys_dir="./keys"

echo "Using RPC query endpoint ${CERC_ETH_RPC_QUERY_ENDPOINT}"
echo "Using RPC mutation endpoint ${CERC_ETH_RPC_MUTATION_ENDPOINT}"
echo "Using Nitro chain URL ${CERC_NITRO_CHAIN_URL}"

# Use public domain for relay multiaddr in peer config if specified
# Otherwise, use the docker container's host IP
Expand Down Expand Up @@ -146,6 +148,7 @@ WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
s/REPLACE_WITH_CERC_PRIVATE_KEY_PEER/${CERC_PRIVATE_KEY_PEER}/g; \
s/REPLACE_WITH_CERC_WATCHER_NITRO_PK/${CERC_WATCHER_NITRO_PK}/g; \
s/REPLACE_WITH_CONTRACT_ADDRESS/${CONTRACT_ADDRESS}/g; \
s|REPLACE_WITH_CERC_NITRO_CHAIN_URL|${CERC_NITRO_CHAIN_URL}|g; \
s/REPLACE_WITH_CONSENSUS_ENABLED/${CONSENSUS_ENABLED}/g; \
s/REPLACE_WITH_CONSENSUS_PUBLIC_KEY/${CONSENSUS_PUBLIC_KEY}/g; \
s/REPLACE_WITH_CONSENSUS_PRIVATE_KEY/${CONSENSUS_PRIVATE_KEY}/g; \
Expand Down
16 changes: 12 additions & 4 deletions app/data/config/watcher-mobymask-v3/watcher-config-template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
contractAddress = 'REPLACE_WITH_CONTRACT_ADDRESS'

[server.p2p.nitro]
chainUrl = 'REPLACE_WITH_CERC_NITRO_CHAIN_URL'
store = './out/nitro-db'
privateKey = 'REPLACE_WITH_CERC_WATCHER_NITRO_PK'
chainPrivateKey = 'REPLACE_WITH_CERC_PRIVATE_KEY_PEER'
Expand Down Expand Up @@ -93,15 +94,22 @@

[upstream]
[upstream.ethServer]
gqlApiEndpoint = 'http://ipld-eth-server:8083/graphql'
gqlApiEndpoint = "http://ipld-eth-server:8083/graphql"
rpcProviderEndpoint = 'REPLACE_WITH_CERC_ETH_RPC_QUERY_ENDPOINT'
rpcProviderMutationEndpoint = 'REPLACE_WITH_CERC_ETH_RPC_MUTATION_ENDPOINT'

[upstream.ethServer.rpcProviderNitroNode]
address = 'REPLACE_WITH_UPSTREAM_NITRO_ADDRESS'
multiAddr = 'REPLACE_WITH_UPSTREAM_NITRO_MULTIADDR'
[upstream.ethServer.payments]
paidRPCMethods = ["eth_getBlockByHash", "eth_getStorageAt"]
amount = 'REPLACE_WITH_UPSTREAM_NITRO_PAY_AMOUNT'

[upstream.ethServer.payments.nitro]
address = 'REPLACE_WITH_UPSTREAM_NITRO_ADDRESS'
multiAddr = 'REPLACE_WITH_UPSTREAM_NITRO_MULTIADDR'

[upstream.ethServer.payments.nitro.fundingAmounts]
directFund = "1000000000000"
virtualFund = "1000000000"

[upstream.cache]
name = "requests"
enabled = false
Expand Down
1 change: 1 addition & 0 deletions app/data/stacks/fixturenet-payments/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# ts-nitro:util:nitro Ledger channel created with id 0x65703ccdfacab09ac35367bdbe6c5a337e7a6651aad526807607b1c59b28bc1e
# ...
# ts-nitro:util:nitro Virtual payment channel created with id 0x29ff1335d73391a50e8fde3e9b34f00c3d81c39ddc7f89187f44dd51df96140e
# vulcanize:server Starting server... +0ms
```

* Export the payment channel id to a variable:
Expand Down
6 changes: 3 additions & 3 deletions app/data/stacks/fixturenet-payments/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ repos:
- git.vdb.to/cerc-io/[email protected]
# nitro repos
- github.com/cerc-io/[email protected]
- github.com/cerc-io/go-nitro@parse-rpc-method # TODO: Update after fixes
- github.com/cerc-io/go-nitro@ts-interop # TODO: Update after fixes
# mobymask watcher repos
- github.com/cerc-io/[email protected].61
- github.com/cerc-io/mobymask-v2-watcher-ts@v3 # TODO: Update after fixes
- github.com/cerc-io/[email protected].63
- github.com/cerc-io/mobymask-v2-watcher-ts@v3 # TODO: Update
- github.com/cerc-io/[email protected]
# mobymask app repos
- github.com/cerc-io/mobymask-snap
Expand Down

0 comments on commit f1fa5ba

Please sign in to comment.