Skip to content

Commit 6776c67

Browse files
authored
Merge pull request #42 from cloudstruct/chore/docs-preview-usage
chore: document preview usage in readme
2 parents 1aab1c8 + b2eef13 commit 6776c67

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# docker-cardano-node
2+
23
Builds a Cardano full node from source on Debian. This image attempts to keep
34
interface compatibility with `inputoutput/cardano-node`, but may diverge
45
slightly, particularly with any Nix-specific paths.
56

67
## Running a node
8+
79
To run a Cardano full node on mainnet:
10+
811
```bash
912
docker run --detach \
1013
--name cardano-node \
@@ -13,27 +16,56 @@ docker run --detach \
1316
-p 3001:3001 \
1417
ghcr.io/cloudstruct/cardano-node run
1518
```
19+
1620
The above maps port 3001 on the host to 3001 on the container, suitable
1721
for use as a mainnet relay node.
1822

1923
Node logs can be followed:
24+
2025
```bash
2126
docker logs -f cardano-node
2227
```
28+
29+
Running a node on a different network uses a slightly different syntax.
30+
31+
To run a Cardano full node on preview:
32+
33+
```bash
34+
docker run --detach \
35+
--name cardano-node \
36+
-v node-data:/data/db \
37+
-v node-ipc:/ipc \
38+
-e NETWORK=preview \
39+
-p 3001:3001 \
40+
ghcr.io/cloudstruct/cardano-node
41+
```
42+
2343
## Running the CLI
44+
2445
To run a Cardano CLI command, we use the `node-ipc` volume from our node.
46+
2547
```bash
2648
docker run --rm -ti \
2749
-v node-ipc:/opt/cardano/ipc \
2850
ghcr.io/cloudstruct/cardano-node cli <command>
2951
```
52+
3053
This can be added to a shell alias:
54+
3155
```bash
3256
alias cardano-cli="docker run --rm -ti \
3357
-v node-ipc:/opt/cardano/ipc \
3458
ghcr.io/cloudstruct/cardano-node cli"
3559
```
60+
3661
Now, you can use cardano-cli commands as you would, normally.
62+
3763
```bash
3864
cardano-cli query tip --mainnet
3965
```
66+
67+
Or, for preview:
68+
69+
```bash
70+
cardano-cli query tip --network-magic 2
71+
```

0 commit comments

Comments
 (0)