Update nitro-node stack to use public IP from config (#3)
* Rename nitro-node stack * Add flag for setting public IP * Log values in the nitro-node script * Add command to install nitro-rpc-client * Fix directory name * Set default value for public IP
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
# Go-nitro
|
||||
|
||||
## Setup
|
||||
|
||||
- Clone the stack repo
|
||||
|
||||
```bash
|
||||
laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack
|
||||
```
|
||||
|
||||
- Clone required repositories
|
||||
|
||||
```bash
|
||||
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node setup-repositories
|
||||
```
|
||||
|
||||
Note: Replace path to nitro stack with actual path
|
||||
|
||||
- Build the container image
|
||||
|
||||
```bash
|
||||
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers
|
||||
```
|
||||
|
||||
## Create a deployment
|
||||
|
||||
- Create a spec file
|
||||
|
||||
```bash
|
||||
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy init --output nitro-node-spec.yml
|
||||
```
|
||||
|
||||
- TODO: Edit `network` in the spec file to map container ports to host ports as required:
|
||||
|
||||
```bash
|
||||
network:
|
||||
ports:
|
||||
go-nitro:
|
||||
- 3006:3006
|
||||
- 4006:4006
|
||||
- 5006:5006
|
||||
```
|
||||
|
||||
- Create deployment
|
||||
|
||||
```bash
|
||||
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file nitro-node-spec.yml --deployment-dir nitro-node-deployment
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
- Inside the `nitro-node-deployment` deployment directory, open `config.env` file and set following env variables:
|
||||
|
||||
```bash
|
||||
# URL endpoint of the chain (Example: ws://host.docker.internal:8545)
|
||||
CERC_NITRO_CHAIN_URL=
|
||||
|
||||
# Private key of account to be used by Nitro node (derived address is used as Nitro address)
|
||||
CERC_NITRO_PK=
|
||||
|
||||
# Private key of the account on chain that is used for funding channels in Nitro node
|
||||
CERC_NITRO_CHAIN_PK=
|
||||
|
||||
# Port to be used by P2P message service (Example: 3009)
|
||||
CERC_NITRO_MSG_PORT=
|
||||
|
||||
# Port to be used by RPC server (Example: 4009)
|
||||
CERC_NITRO_RPC_PORT=4009
|
||||
|
||||
# Optional
|
||||
# Contract addresses of NitroAdjudicator, VirtualPaymentApp and ConsensusApp
|
||||
# TODO: Contracts are deployed if addresses are not set
|
||||
CERC_NA_ADDRESS=
|
||||
CERC_VPA_ADDRESS=
|
||||
CERC_CA_ADDRESS=
|
||||
```
|
||||
|
||||
## Start the deployment
|
||||
|
||||
```bash
|
||||
laconic-so deployment --dir nitro-node-deployment start
|
||||
```
|
||||
@@ -0,0 +1,11 @@
|
||||
version: "1.0"
|
||||
name: go-nitro
|
||||
description: "Stack to demonstrate payments between various services"
|
||||
repos:
|
||||
- github.com/cerc-io/go-nitro
|
||||
containers:
|
||||
- cerc/go-nitro
|
||||
# - cerc/nitro-rpc-client
|
||||
pods:
|
||||
- go-nitro
|
||||
# - nitro-rpc-client
|
||||
Reference in New Issue
Block a user