diff --git a/app/data/compose/docker-compose-watcher-mobymask-v3.yml b/app/data/compose/docker-compose-watcher-mobymask-v3.yml index 107c9bba..bd07d7ef 100644 --- a/app/data/compose/docker-compose-watcher-mobymask-v3.yml +++ b/app/data/compose/docker-compose-watcher-mobymask-v3.yml @@ -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} diff --git a/app/data/config/watcher-mobymask-v3/mobymask-params.env b/app/data/config/watcher-mobymask-v3/mobymask-params.env index f96aae31..1d843597 100644 --- a/app/data/config/watcher-mobymask-v3/mobymask-params.env +++ b/app/data/config/watcher-mobymask-v3/mobymask-params.env @@ -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=[] diff --git a/app/data/config/watcher-mobymask-v3/start-server.sh b/app/data/config/watcher-mobymask-v3/start-server.sh index b3546e81..e2d005c4 100755 --- a/app/data/config/watcher-mobymask-v3/start-server.sh +++ b/app/data/config/watcher-mobymask-v3/start-server.sh @@ -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}}" @@ -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 @@ -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; \ diff --git a/app/data/config/watcher-mobymask-v3/watcher-config-template.toml b/app/data/config/watcher-mobymask-v3/watcher-config-template.toml index e2b5d1aa..4dd9fa2e 100644 --- a/app/data/config/watcher-mobymask-v3/watcher-config-template.toml +++ b/app/data/config/watcher-mobymask-v3/watcher-config-template.toml @@ -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' @@ -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 diff --git a/app/data/stacks/fixturenet-payments/demo.md b/app/data/stacks/fixturenet-payments/demo.md index ed0a5799..c3bf9b71 100644 --- a/app/data/stacks/fixturenet-payments/demo.md +++ b/app/data/stacks/fixturenet-payments/demo.md @@ -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: diff --git a/app/data/stacks/fixturenet-payments/stack.yml b/app/data/stacks/fixturenet-payments/stack.yml index a16c3cb1..4528c651 100644 --- a/app/data/stacks/fixturenet-payments/stack.yml +++ b/app/data/stacks/fixturenet-payments/stack.yml @@ -9,10 +9,10 @@ repos: - git.vdb.to/cerc-io/ipld-eth-server@v1.11.6-statediff-v5 # nitro repos - github.com/cerc-io/ts-nitro@v0.1.13 - - 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/watcher-ts@v0.2.61 - - github.com/cerc-io/mobymask-v2-watcher-ts@v3 # TODO: Update after fixes + - github.com/cerc-io/watcher-ts@v0.2.63 + - github.com/cerc-io/mobymask-v2-watcher-ts@v3 # TODO: Update - github.com/cerc-io/MobyMask@v0.1.3 # mobymask app repos - github.com/cerc-io/mobymask-snap