|
| 1 | +# Demo |
| 2 | + |
| 3 | +## Getting Started |
| 4 | + |
| 5 | +This module provides an executable for starting a demo cluster of wallet nodes. |
| 6 | +It is designed to remove all the overhead of setting up a configuration |
| 7 | +and an environment and to _just work_, out-of-the-box. Minor configuration |
| 8 | +adjustments are however possible via environment variables. |
| 9 | + |
| 10 | +``` |
| 11 | +stack test cardano-sl-wallet-new:demo |
| 12 | +``` |
| 13 | + |
| 14 | +This spawns three wallet-nodes running respectively on: |
| 15 | + |
| 16 | +| NodeId | Address | API Address | API Doc Address | |
| 17 | +| --- | --- | --- | --- | |
| 18 | +| node0 | localhost:3000 | localhost:8090 | localhost:8190 | |
| 19 | +| node1 | localhost:3001 | localhost:8091 | localhost:8191 | |
| 20 | +| node2 | localhost:3002 | localhost:8092 | localhost:8192 | |
| 21 | + |
| 22 | + |
| 23 | +## Configuring Nodes |
| 24 | + |
| 25 | +Almost _anything_ from the normal CLI arguments of a node or a wallet node can be |
| 26 | +configured via an ENV variable using an `UPPER_SNAKE_CASE` naming, correctly |
| 27 | +prefixed with `DEMO_` with a few gotchas: |
| 28 | + |
| 29 | +- Flags need an explicit boolean value |
| 30 | + |
| 31 | +- There's no ENV vars mapping to (i.e. you can't configure): |
| 32 | + - `--topology` |
| 33 | + - `--tlscert` |
| 34 | + - `--tlsca` |
| 35 | + - `--tlskey` |
| 36 | + - `--logger-config` |
| 37 | + - `--node-id` |
| 38 | + - `--db-path` |
| 39 | + - `--wallet-db-path` |
| 40 | + |
| 41 | +- There's an extra `LOG_SEVERITY` variable that can be set to `Debug`, `Info` |
| 42 | + and so forth to ajust logging severity for _all_ nodes. |
| 43 | + |
| 44 | +- When it make senses, variable values are automatically incremented by the |
| 45 | + node index. For instance, if you provide `LISTEN=127.0.0.1:3000`, then |
| 46 | + - node0 will receive "127.0.0.1:3000" |
| 47 | + - node1 will receive "127.0.0.1:3001" |
| 48 | + - node2 will receive "127.0.0.1:3002" |
| 49 | + |
| 50 | + This is the case for: |
| 51 | + - `--listen` |
| 52 | + - `--wallet-address` |
| 53 | + - `--wallet-doc-address` |
| 54 | + |
| 55 | +For instance, one can disable TLS client authentication doing: |
| 56 | + |
| 57 | +``` |
| 58 | +DEMO_NO_CLIENT_AUTH=True stack test cardano-sl-wallet-new:demo |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +### Relative FilePath |
| 63 | + |
| 64 | +One can provide relative filepath as values for ENV vars. They are computed from |
| 65 | +the `wallet-new` folder, so for instance, providing `./state-demo` will point |
| 66 | +to the directory `$(git rev-parse --show-toplevel)/wallet-new/state-demo`. |
| 67 | + |
| 68 | + |
| 69 | +### State Directory |
| 70 | + |
| 71 | +By default, each node receives a temporary state directory from the system; |
| 72 | +probably somewhere in `/tmp`. This location can always be overriden by |
| 73 | +providing an extra `DEMO_STATE_DIR` variable with a custom location. |
| 74 | + |
| 75 | +Note that, each default has been choosen in such way that they won't conflict |
| 76 | +if all nodes were to share the same state directory :) |
0 commit comments