Migrate from SO branch
This commit is contained in:
parent
ee2d4f138f
commit
1fa46f4e57
141
compose/docker-compose-nitro-auth.yml
Normal file
141
compose/docker-compose-nitro-auth.yml
Normal file
@ -0,0 +1,141 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
go-nitro-alice:
|
||||
image: cerc/go-nitro:local
|
||||
hostname: go-nitro-alice
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- go-nitro-bootnode
|
||||
environment:
|
||||
CERC_NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK_ALICE:-888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218}
|
||||
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
|
||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
||||
env_file:
|
||||
- ../config/nitro-auth/alice.env
|
||||
entrypoint: ["bash", "-c", "/app/run-nitro-node.sh"]
|
||||
volumes:
|
||||
- nitro_deployment:/app/deployment
|
||||
- go_nitro_data_alice:/app/data
|
||||
- ../config/go-nitro/run-nitro-node.sh:/app/run-nitro-node.sh
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost", "4006"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 100
|
||||
start_period: 100s
|
||||
ports:
|
||||
- "3006"
|
||||
- "4006"
|
||||
- "5006"
|
||||
- "4106"
|
||||
- "4206"
|
||||
- "4216"
|
||||
|
||||
go-nitro-bob:
|
||||
image: cerc/go-nitro:local
|
||||
hostname: go-nitro-bob
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- go-nitro-bootnode
|
||||
environment:
|
||||
CERC_NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK_BOB:-570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597}
|
||||
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
|
||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
||||
env_file:
|
||||
- ../config/nitro-auth/bob.env
|
||||
entrypoint: ["bash", "-c", "/app/run-nitro-node.sh"]
|
||||
volumes:
|
||||
- nitro_deployment:/app/deployment
|
||||
- go_nitro_data_bob:/app/data
|
||||
- ../config/go-nitro/run-nitro-node.sh:/app/run-nitro-node.sh
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost", "4007"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 100
|
||||
start_period: 100s
|
||||
ports:
|
||||
- "3007"
|
||||
- "4007"
|
||||
- "5007"
|
||||
- "4107"
|
||||
- "4207"
|
||||
- "4217"
|
||||
|
||||
ts-nitro-charlie:
|
||||
image: cerc/ts-nitro:local
|
||||
hostname: ts-nitro-charlie
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- go-nitro-bootnode
|
||||
environment:
|
||||
CERC_NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK_CHARLIE:-111b7500bdce494d6f4bcfe8c2a0dde2ef92f751d9070fac6475dbd6d8021b3f}
|
||||
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
|
||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
||||
CERC_NITRO_TARGET_URL: ${CERC_NITRO_TARGET_URL:-http://localhost:5678}
|
||||
CERC_RUNTIME_ENV_RPC_URL: ${CERC_RUNTIME_ENV_RPC_URL:-ws://localhost:8546}
|
||||
PUBLIC_URL: http://localhost:5678/ts-nitro
|
||||
env_file:
|
||||
- ../config/nitro-auth/charlie.env
|
||||
entrypoint: ["bash", "-c", "/app/run.sh"]
|
||||
volumes:
|
||||
- nitro_deployment:/app/deployment
|
||||
- ../config/ts-nitro/run.sh:/app/run.sh
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3000"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 100
|
||||
start_period: 100s
|
||||
|
||||
go-nitro-bootnode:
|
||||
image: cerc/go-nitro:local
|
||||
hostname: go-nitro-bootnode
|
||||
restart: on-failure
|
||||
environment:
|
||||
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
|
||||
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
|
||||
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
|
||||
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
|
||||
CERC_NITRO_RELAY_ON: true
|
||||
env_file:
|
||||
- ../config/nitro-auth/bootnode.env
|
||||
entrypoint: [ "bash", "-c", "/app/run-nitro-node.sh" ]
|
||||
volumes:
|
||||
- nitro_deployment:/app/deployment
|
||||
- go_nitro_data_bootnode:/app/data
|
||||
- ../config/go-nitro/run-nitro-node.sh:/app/run-nitro-node.sh
|
||||
healthcheck:
|
||||
test: [ "CMD", "nc", "-vz", "localhost", "4008" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 100
|
||||
start_period: 100s
|
||||
ports:
|
||||
- "9090"
|
||||
|
||||
nitro-caddy:
|
||||
image: caddy:2-alpine
|
||||
restart: always
|
||||
environment:
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT:-http://fixturenet-eth-geth-1:8545}
|
||||
volumes:
|
||||
- ../config/nitro-auth/caddy/Caddyfile:/etc/caddy/Caddyfile
|
||||
ports:
|
||||
- "5678"
|
||||
depends_on:
|
||||
- go-nitro-alice
|
||||
- go-nitro-bob
|
||||
|
||||
volumes:
|
||||
go_nitro_data_alice:
|
||||
go_nitro_data_bob:
|
||||
go_nitro_data_bootnode:
|
||||
nitro_deployment:
|
19
config/nitro-auth/alice.env
Normal file
19
config/nitro-auth/alice.env
Normal file
@ -0,0 +1,19 @@
|
||||
# SET ME! Your on-chain private key.
|
||||
#CERC_NITRO_CHAIN_PK=<MY_PK_GOES_HERE>
|
||||
|
||||
# Default is CERC_NITRO_CHAIN_PK.
|
||||
#CERC_NITRO_PK=<MY_PK_GOES_HERE>
|
||||
|
||||
# SET ME! The WebSocket to connect to.
|
||||
#CERC_NITRO_CHAIN_URL=wss://linea-sepolia.infura.io/ws/v3/<MY_API_KEY_GOES_HERE>
|
||||
|
||||
CERC_NITRO_AUTH_ON=false
|
||||
CERC_NITRO_AUTH_RPC_PORT=4006
|
||||
CERC_NITRO_AUTH_UI_PORT=4206
|
||||
CERC_NITRO_BOOT_PEERS="/dns4/go-nitro-bootnode/tcp/3008/p2p/16Uiu2HAmFYz5YPf3GtkfQsAwYJfDsKSm34U9qAiTwxW7RJUVGMRK"
|
||||
CERC_NITRO_DURABLE_STORE_FOLDER=/app/data/nitro-store
|
||||
CERC_NITRO_MSG_PORT=3006
|
||||
CERC_NITRO_RPC_PORT=4006
|
||||
CERC_NITRO_UI_PORT=4106
|
||||
CERC_NITRO_USE_DURABLE_STORE=true
|
||||
CERC_NITRO_WS_MSG_PORT=5006
|
21
config/nitro-auth/bob.env
Normal file
21
config/nitro-auth/bob.env
Normal file
@ -0,0 +1,21 @@
|
||||
# SET ME! Your on-chain private key.
|
||||
#CERC_NITRO_CHAIN_PK=<MY_PK_GOES_HERE>
|
||||
|
||||
# Default is CERC_NITRO_CHAIN_PK.
|
||||
#CERC_NITRO_PK=<MY_PK_GOES_HERE>
|
||||
|
||||
# SET ME! The WebSocket to connect to.
|
||||
#CERC_NITRO_CHAIN_URL=wss://linea-sepolia.infura.io/ws/v3/<MY_API_KEY_GOES_HERE>
|
||||
|
||||
CERC_NITRO_AUTH_ON=true
|
||||
CERC_NITRO_AUTH_RPC_PORT=4007
|
||||
CERC_NITRO_AUTH_UI_PORT=4207
|
||||
CERC_NITRO_BOOT_PEERS="/dns4/go-nitro-bootnode/tcp/3008/p2p/16Uiu2HAmFYz5YPf3GtkfQsAwYJfDsKSm34U9qAiTwxW7RJUVGMRK"
|
||||
CERC_NITRO_DURABLE_STORE_FOLDER=/app/data/nitro-store
|
||||
CERC_NITRO_MSG_PORT=3007
|
||||
CERC_NITRO_RPC_PORT=4007
|
||||
CERC_NITRO_UI_PORT=4107
|
||||
CERC_NITRO_USE_DURABLE_STORE=true
|
||||
CERC_NITRO_WS_MSG_PORT=5007
|
||||
CERC_NITRO_MSG_PUBLIC_IP=127.0.0.1
|
||||
CERC_NITRO_MSG_PUBLIC_PORT=5007
|
17
config/nitro-auth/bootnode.env
Normal file
17
config/nitro-auth/bootnode.env
Normal file
@ -0,0 +1,17 @@
|
||||
CERC_NITRO_CHAIN_PK=596db2ac27479cfdf60f708bf64ae44a1c5090e9446cca011d72bc9a59b47d3d
|
||||
CERC_NITRO_PK=f41086394674cf00a66448c6688295d7330af39f6f38fed89ea023e39382d6a0
|
||||
|
||||
# The WebSocket to connect to.
|
||||
#CERC_NITRO_CHAIN_URL=wss://linea-sepolia.infura.io/ws/v3/<MY_API_KEY_GOES_HERE>
|
||||
|
||||
CERC_NITRO_AUTH_ON=false
|
||||
CERC_NITRO_AUTH_RPC_PORT=4008
|
||||
CERC_NITRO_AUTH_UI_PORT=4208
|
||||
CERC_NITRO_DURABLE_STORE_FOLDER=/app/data/nitro-store
|
||||
CERC_NITRO_MSG_PORT=3008
|
||||
CERC_NITRO_RPC_PORT=4008
|
||||
CERC_NITRO_UI_PORT=4108
|
||||
CERC_NITRO_USE_DURABLE_STORE=true
|
||||
CERC_NITRO_WS_MSG_PORT=5008
|
||||
|
||||
CERC_SCRIPT_DEBUG=true
|
48
config/nitro-auth/caddy/Caddyfile
Normal file
48
config/nitro-auth/caddy/Caddyfile
Normal file
@ -0,0 +1,48 @@
|
||||
:5678 {
|
||||
handle /pay* {
|
||||
reverse_proxy http://go-nitro-bob:8547
|
||||
}
|
||||
|
||||
@eth-key-in-header {
|
||||
path_regexp /eth/?$
|
||||
header X-Api-Key *
|
||||
}
|
||||
|
||||
handle @eth-key-in-header {
|
||||
forward_auth go-nitro-bob:8547 {
|
||||
uri /auth/{header.x-api-key}
|
||||
}
|
||||
rewrite * /
|
||||
reverse_proxy {$CERC_ETH_RPC_ENDPOINT} {
|
||||
header_up Host {upstream_hostport}
|
||||
header_up -X-Forwarded-*
|
||||
}
|
||||
}
|
||||
|
||||
@eth-key-in-path {
|
||||
path_regexp apikey eth/(.+)$
|
||||
}
|
||||
|
||||
handle @eth-key-in-path {
|
||||
forward_auth go-nitro-bob:8547 {
|
||||
uri /auth/{re.apikey.1}
|
||||
}
|
||||
rewrite * /
|
||||
reverse_proxy {$CERC_ETH_RPC_ENDPOINT} {
|
||||
header_up Host {upstream_hostport}
|
||||
header_up -X-Forwarded-*
|
||||
}
|
||||
}
|
||||
|
||||
handle /eth* {
|
||||
respond "401 Unauthorized" 401
|
||||
}
|
||||
|
||||
handle /ts-nitro* {
|
||||
reverse_proxy http://ts-nitro-charlie:3000
|
||||
}
|
||||
|
||||
handle {
|
||||
reverse_proxy http://go-nitro-alice:4206
|
||||
}
|
||||
}
|
19
config/nitro-auth/charlie.env
Normal file
19
config/nitro-auth/charlie.env
Normal file
@ -0,0 +1,19 @@
|
||||
# SET ME! Your on-chain private key.
|
||||
#CERC_NITRO_CHAIN_PK=<MY_PK_GOES_HERE>
|
||||
|
||||
# Default is CERC_NITRO_CHAIN_PK.
|
||||
#CERC_NITRO_PK=<MY_PK_GOES_HERE>
|
||||
|
||||
# SET ME! The WebSocket to connect to.
|
||||
#CERC_NITRO_CHAIN_URL=wss://linea-sepolia.infura.io/ws/v3/<MY_API_KEY_GOES_HERE>
|
||||
|
||||
CERC_NITRO_AUTH_ON=false
|
||||
CERC_NITRO_AUTH_RPC_PORT=4009
|
||||
CERC_NITRO_AUTH_UI_PORT=4209
|
||||
CERC_NITRO_BOOT_PEERS="/dns4/go-nitro-bootnode/tcp/3008/p2p/16Uiu2HAmFYz5YPf3GtkfQsAwYJfDsKSm34U9qAiTwxW7RJUVGMRK"
|
||||
CERC_NITRO_DURABLE_STORE_FOLDER=/app/data/nitro-store
|
||||
CERC_NITRO_MSG_PORT=3009
|
||||
CERC_NITRO_RPC_PORT=4009
|
||||
CERC_NITRO_UI_PORT=4109
|
||||
CERC_NITRO_USE_DURABLE_STORE=true
|
||||
CERC_NITRO_WS_MSG_PORT=5009
|
Loading…
Reference in New Issue
Block a user