Skip to content

Commit

Permalink
fix build for dcli and instructions for new path (#638)
Browse files Browse the repository at this point in the history
`dcli` got moved and the guide is no longer accurate. Update the paths.
Also, relative imports were incorret inside `dcli.nim`, and error when
using Nim 2.0 compiler.
  • Loading branch information
etan-status authored Sep 22, 2023
1 parent 02c8a12 commit f133d7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions doc/discv5.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,21 @@ node, by providing its ENR.
# Make sure you have the latest modules, do NOT trust nimble on this.
nimble install
# Build dcli
nim c -d:chronicles_log_level:trace -d:release --threads:on eth/p2p/discoveryv5/dcli
nim c -d:chronicles_log_level:trace -d:release --threads:on ./tools/dcli
# See all options
./eth/p2p/discoveryv5/dcli --help
./tools/dcli --help
# Ping another node
./eth/p2p/discoveryv5/dcli ping enr:<base64 encoding of ENR>
./tools/dcli ping enr:<base64 encoding of ENR>
# Run discovery node
./eth/p2p/discoveryv5/dcli --log-level:debug --bootnode:enr:<base64 encoding of ENR>
./tools/dcli --log-level:debug --bootnode:enr:<base64 encoding of ENR>
```

### Metrics
To run dcli with metrics enabled provide the `metrics` flag:

```sh
# Run dcli with metrics
./eth/p2p/discoveryv5/dcli --metrics --bootnode:enr:<base64 encoding of ENR>
./tools/dcli --metrics --bootnode:enr:<base64 encoding of ENR>
```

You can now see the metrics at http://localhost:8008/metrics. Or use e.g.
Expand Down
6 changes: 3 additions & 3 deletions tools/dcli.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import
std/[options, strutils, tables, sets],
confutils, confutils/std/net, chronicles, chronicles/topics_registry,
chronos, metrics, metrics/chronos_httpserver, stew/byteutils, stew/bitops2,
./eth/keys, ./eth/net/nat,
./eth/p2p/discoveryv5/[enr, node],
./eth/p2p/discoveryv5/protocol as discv5_protocol
../eth/keys, ../eth/net/nat,
../eth/p2p/discoveryv5/[enr, node],
../eth/p2p/discoveryv5/protocol as discv5_protocol

type
DiscoveryCmd* = enum
Expand Down

0 comments on commit f133d7a

Please sign in to comment.