You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,3 +24,53 @@ but the node-to-node protocols will also be implemented in time.
24
24
| Local State Query | Not Implemented |
25
25
| Keep-Alive | Not Implemented |
26
26
27
+
## Testing
28
+
29
+
Testing is currently a mostly manual process. There's an included test program that use the library
30
+
and a Docker Compose file to launch a local `cardano-node` instance.
31
+
32
+
### Starting the local `cardano-node` instance
33
+
34
+
```
35
+
$ docker-compose up -d
36
+
```
37
+
38
+
If you want to use `mainnet`, set the `CARDANO_NETWORK` environment variable.
39
+
40
+
```
41
+
$ export CARDANO_NETWORK=mainnet
42
+
$ docker-compose up -d
43
+
```
44
+
45
+
You can communicate with the `cardano-node` instance on port `8081` (for "public" node-to-node protocol), port `8082` (for "private" node-to-client protocol), or
46
+
the `./tmp/cardano-node/ipc/node.socket` UNIX socket file (also for "private" node-to-client protocol).
47
+
48
+
NOTE: if using the UNIX socket file, you may need to adjust the permissions/ownership to allow your user to access it.
49
+
The `cardano-node` Docker image runs as `root` by default and the UNIX socket ends up with `root:root` ownership
50
+
and `0755` permissions, which doesn't allow a non-root use to write to it by default.
51
+
52
+
### Running `cardano-cli` against local `cardano-node` instance
53
+
54
+
```
55
+
$ docker exec -ti go-ouroboros-network_cardano-node_1 sh -c 'CARDANO_NODE_SOCKET_PATH=/ipc/node.socket cardano-cli query tip --testnet-magic 1097911063'
56
+
```
57
+
58
+
### Building and running the test program
59
+
60
+
Compile the test program.
61
+
62
+
```
63
+
$ make
64
+
```
65
+
66
+
Run the test program pointing to the UNIX socket from the `cardano-node` instance started above.
0 commit comments