2024-07-17 09:29:46 +00:00
|
|
|
# Go-nitro
|
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
## Setup
|
2024-07-17 09:29:46 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
- Clone the stack repo
|
2024-07-17 09:29:46 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
```bash
|
|
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack
|
|
|
|
```
|
|
|
|
|
|
|
|
- Clone required repositories
|
|
|
|
|
|
|
|
```bash
|
2024-07-18 11:48:24 +00:00
|
|
|
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node setup-repositories
|
2024-07-18 04:52:37 +00:00
|
|
|
```
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
Note: Replace path to nitro stack with actual path
|
|
|
|
|
|
|
|
- Build the container image
|
|
|
|
|
|
|
|
```bash
|
2024-07-18 11:48:24 +00:00
|
|
|
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers
|
2024-07-18 04:52:37 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Create a deployment
|
|
|
|
|
|
|
|
- Create a spec file
|
|
|
|
|
|
|
|
```bash
|
2024-07-18 11:48:24 +00:00
|
|
|
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy init --output nitro-node-spec.yml
|
2024-07-18 04:52:37 +00:00
|
|
|
```
|
2024-07-17 09:29:46 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
- 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
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
```bash
|
2024-07-18 11:48:24 +00:00
|
|
|
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file nitro-node-spec.yml --deployment-dir nitro-node-deployment
|
2024-07-18 04:52:37 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2024-07-18 11:48:24 +00:00
|
|
|
- Inside the `nitro-node-deployment` deployment directory, open `config.env` file and set following env variables:
|
2024-07-18 04:52:37 +00:00
|
|
|
|
|
|
|
```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=
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
# Private key of the account on chain that is used for funding channels in Nitro node
|
|
|
|
CERC_NITRO_CHAIN_PK=
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
# 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
|
2024-07-18 11:48:24 +00:00
|
|
|
|
2024-07-18 04:52:37 +00:00
|
|
|
# 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
|
2024-07-17 09:29:46 +00:00
|
|
|
|
|
|
|
```bash
|
2024-07-18 11:48:24 +00:00
|
|
|
laconic-so deployment --dir nitro-node-deployment start
|
2024-07-18 04:52:37 +00:00
|
|
|
```
|