Skip to content

Commit f5023ca

Browse files
authored
Merge pull request #49 from blinklabs-io/chore/docs-readme-blinklabs
chore(docs): update readme for blink labs
2 parents 115526f + e1eea27 commit f5023ca

File tree

1 file changed

+89
-8
lines changed

1 file changed

+89
-8
lines changed

README.md

Lines changed: 89 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,110 @@ Builds a Cardano full node from source on Debian. This image attempts to keep
44
interface compatibility with `inputoutput/cardano-node`, but may diverge
55
slightly, particularly with any Nix-specific paths.
66

7-
## Running a node
7+
We found that the learning curve for using Nix is too high for many in the
8+
community who need to run a full node for various reasons but don't want to
9+
get too heavy into learning a new operating system just to extend a container
10+
image. This image uses FHS paths and installs into `/usr/local` while taking
11+
advantage of multi-stage image builds to reduce final image size over the
12+
official Nix-based distribution.
813

9-
To run a Cardano full node on mainnet:
14+
## Running a Cardano Node
15+
16+
The container image has some differing behaviors depending on how it's
17+
invoked. There is a `NETWORK` environment variable which can be used as a
18+
short cut to starting nodes on a specific named Cardano network with a default
19+
configuration.
20+
21+
### Using run (Recommended for SPO)
22+
23+
Using the `run` argument to the image causes the entrypoint script to use the
24+
fully configurable code path.
25+
26+
To run a Cardano full node on mainnet with minimal configuration and defaults:
1027

1128
```bash
1229
docker run --detach \
1330
--name cardano-node \
1431
-v node-data:/opt/cardano/data \
1532
-v node-ipc:/opt/cardano/ipc \
1633
-p 3001:3001 \
17-
ghcr.io/cloudstruct/cardano-node run
34+
ghcr.io/blinklabs-io/cardano-node run
1835
```
1936

2037
The above maps port 3001 on the host to 3001 on the container, suitable
21-
for use as a mainnet relay node.
38+
for use as a mainnet relay node. We use docker volumes for our persistent data
39+
storage and IPC (interprocess communication) so they live beyond the lifetime
40+
of the container.
2241

2342
Node logs can be followed:
2443

2544
```bash
2645
docker logs -f cardano-node
2746
```
2847

29-
Running a node on a different network uses a slightly different syntax.
48+
#### Configuration using environment variables
49+
50+
The power in using `run` is being able to configure the node's behavior to
51+
provide the correct type of service.
52+
53+
This behavior can be changes via the following environment variables:
54+
55+
- `CARDANO_CONFIG_BASE`
56+
- A directory which contains configuration files (default:
57+
`/opt/cardano/config`)
58+
- This variable is used as the base for other configuration variable default
59+
- `CARDANO_BIND_ADDR`
60+
- IP address to bind for listening (default: `0.0.0.0`)
61+
- `CARDANO_BLOCK_PRODUCER`
62+
- Set to true for a block producing node (default: false)
63+
- Requires key files and node certificates to be present to start
64+
- `CARDANO_CONFIG`
65+
- Full path to the Cardano node configuration (default:
66+
`${CARDANO_CONFIG_BASE}/mainnet-config.json`)
67+
- Use your own configuration file to modify the node behavior fully
68+
- `CARDANO_DATABASE_PATH`
69+
- A directory which contains the ledger database files (default:
70+
`/opt/cardano/data`)
71+
- This is the location for persistent data storage for the ledger
72+
- `CARDANO_PORT`
73+
- TCP port to bind for listening (default: `3001`)
74+
- `CARDANO_RTS_OPTS`
75+
- Controls the Cardano node's Haskell runtime (default:
76+
`-N2 -A64m -I0 -qg -qb --disable-delayed-os-memory-return`)
77+
- This allows tuning the node for specific use cases or resource contraints
78+
- `CARDANO_SOCKET_PATH`
79+
- UNIX socket path for listening (default: `/opt/cardano/ipc/socket`)
80+
- This socket speaks Ouroboros NtC and is used by client software
81+
- `CARDANO_TOPOLOGY`
82+
- Full path to the Cardano node topology (default:
83+
`${CARDANO_CONFIG_BASE}/mainnet-topology.json`)
84+
85+
#### Running a block producer
86+
87+
To run a block producing node, you should, at minimum, configure your topology
88+
to recommended settings and have only your own relays listed. You will need to
89+
set `CARDANO_BLOCK_PRODUCER` to `true` and provide the appropriate key files
90+
and operational certificate.
91+
92+
- `CARDANO_SHELLEY_KES_KEY`
93+
- Stake pool hot key, authenticates (default:
94+
`${CARDANO_CONFIG_BASE}/keys/kes.skey`)
95+
- `CARDANO_SHELLEY_VRF_KEY`
96+
- Stake pool signing key, verifies (default:
97+
`${CARDANO_CONFIG_BASE}/keys/vrf.skey`)
98+
- `CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE`
99+
- Stake pool identity certificate (default:
100+
`${CARDANO_CONFIG_BASE}/keys/node.cert`
101+
102+
### Using NETWORK (standalone)
103+
104+
Using the `NETWORK` environment variable causes the entrypoint script to use
105+
the simplified path. The only configurable option in this path is the
106+
`NETWORK` environment variable itself.
107+
108+
**NOTE** The container paths for persist disks is different in this mode
109+
110+
This is in keeping with the IOHK image behavior.
30111

31112
To run a Cardano full node on preview:
32113

@@ -37,7 +118,7 @@ docker run --detach \
37118
-v node-ipc:/ipc \
38119
-e NETWORK=preview \
39120
-p 3001:3001 \
40-
ghcr.io/cloudstruct/cardano-node
121+
ghcr.io/blinklabs-io/cardano-node
41122
```
42123

43124
## Running the CLI
@@ -47,15 +128,15 @@ To run a Cardano CLI command, we use the `node-ipc` volume from our node.
47128
```bash
48129
docker run --rm -ti \
49130
-v node-ipc:/opt/cardano/ipc \
50-
ghcr.io/cloudstruct/cardano-node cli <command>
131+
ghcr.io/blinklabs-io/cardano-node cli <command>
51132
```
52133

53134
This can be added to a shell alias:
54135

55136
```bash
56137
alias cardano-cli="docker run --rm -ti \
57138
-v node-ipc:/opt/cardano/ipc \
58-
ghcr.io/cloudstruct/cardano-node cli"
139+
ghcr.io/blinklabs-io/cardano-node cli"
59140
```
60141

61142
Now, you can use cardano-cli commands as you would, normally.

0 commit comments

Comments
 (0)