tezedge / tezedge

Tezos node/shell in Rust. Unfortunately dev has ceased. If you are interested in resurrecting, please contact @drchrispinnock
MIT License
147 stars 57 forks source link

Config: Peers= not optional #1040

Closed jdsika closed 2 years ago

jdsika commented 2 years ago

Taken from the config example

# <Optional> A peer to bootstrap the network from. Peers are delimited by a colon. Format: IP1:PORT1,IP2:PORT2,IP3:PORT3
# --peers <IP:PORT>
# --peers=

Result:

    Finished dev [unoptimized + debuginfo] target(s) in 0.32s
     Running `target/debug/light-node --config-file /home/it-tezos/config/tezedge.config`
error: The following required arguments were not provided:
    --peers <IP:PORT>

USAGE:
    light-node --bootstrap-db-path <PATH> --compute-context-action-tree-hashes <BOOL> --config-file <PATH> --disable-mempool --enable-testchain <BOOL> --identity-expected-pow <NUM> --identity-file <PATH> --log <STRING>... --log-file <PATH> --log-format <log-format> --log-level <LEVEL> --maindb-backend <STRING> --network <network> --ocaml-log-enabled <BOOL> --p2p-port <PORT> --peer-thresh-high <NUM> --peer-thresh-low <NUM> --peers <IP:PORT> --private-node <BOOL> --protocol-runner <PATH> --rpc-port <PORT> --tezos-context-storage <NAME> --tezos-data-dir <PATH> --tokio-threads <NUM> --websocket-address <IP:PORT>

For more information try --help
tizoc commented 2 years ago

Hi @jdsika, can you tell me which change did you make to the config file to produce this error?

jdsika commented 2 years ago
###############################################################################################
################################ Tezos Node configuration file ################################
###############################################################################################

# All parameters can be provided also as command line arguments in the same format, in which case
# they have higher priority than the ones in conifg file

# The context storage to use [possible values: both, tezedge, irmin]
# --tezos-context-storage <NAME>
--tezos-context-storage=tezedge

# A directory for Tezos node generated data
# --tezos-data-dir <PATH>
--tezos-data-dir=~/.tezedge-data/

# Path to the json identity file with peer-id, public-key, secret-key and pow-stamp
# New identity is automatically generated if it does not exist on specified path
# In case it starts with "./" or "../", it is relative path to the current dir, otherwise to the --tezos-data-dir
# --identity-file <PATH>
--identity-file=identity.json

# Expected power of identity for node. It is used to generate new identity. Default: 26.0
# --identity-expected-pow <NUM>
--identity-expected-pow=26.0

# Path to bootstrap database directory
# In case it starts with "./" or "../", it is relative path to the current dir, otherwise to the --tezos-data-dir
# If directory does not exists, it will be created. If directory already exists, and contains valid database, node
# will continue in bootstrap process on that database
# --bootstrap-db-path <PATH>
--bootstrap-db-path=bootstrap_db

# Path to context-stats database directory
# In case it starts with "./" or "../", it is relative path to the current dir, otherwise to the --tezos-data-dir
# If directory does not exists, it will be created. If directory already exists, and contains valid database, node
# will erase it and create a new database
# --context-stats-db-path <PATH>

#Max number of threads used by database configuration. If not specified, then number of threads equal to CPU cores.
#--db-cfg-max-threads <NUM>

# <Optional> A peers for dns lookup to get the peers to bootstrap the network from. Peers are delimited by a colon.
# Default: used according to --network parameter see TezosEnvironment
# --bootstrap-lookup-address <bootstrap-lookup-address>
# --bootstrap-lookup-address=

# <Optional> Disables dns lookup to get the peers to bootstrap the network from. Default: false
#--disable-bootstrap-lookup

# <Optional> Defines the logging target. [possible values: terminall, file, combined]. Default: terminal
# --log <LoggerType>
--log=terminal

# <Optional> Path to the log file. If provided, logs are written to the log file, otherwise displayed in terminal
# In case it starts with "./" or "../", it is relative path to the current dir, otherwise to the --tezos-data-dir
# --log-file <PATH>
--log-file=logs/tezedge.log

# Set output format of the log. [possible values: json, simple]
# --log-format <log-format>
--log-format=simple

# Set log level [possible values: critical, error, warn, info, debug, trace]
# --log-level <LEVEL>
--log-level=info

# Flag for turn on/off logging in Tezos OCaml runtime.
# --ocaml-log-enabled <BOOL>
--ocaml-log-enabled=false

# Choose the Tezos environment [possible values: alphanet, babylonnet, babylon, mainnet, zeronet, carthagenet, carthage, delphinet, delphi, edonet (deprecated - use edo2), edo (deprecated - use edo2), edo2net, edo2, sandbox, florencenet, florence]
--network=mainnet

# Socket listening port for p2p for communication with tezos world
# --p2p-port <PORT>
--p2p-port=9732

# Rust server RPC port for communication with rust node
# --rpc-port <PORT>
--rpc-port=18732

# Node expose various metrics and statistics in real-time through websocket. This argument specifies address, on which
# will be this websocket accessible, e.g.: 0.0.0.0:4927.
# --bootstrap-lookup-address=

# <Optional> Disables dns lookup to get the peers to bootstrap the network from. Default: false
#--disable-bootstrap-lookup

# <Optional> Defines the logging target. [possible values: terminall, file, combined]. Default: terminal
# --log <LoggerType>
--log=terminal

# <Optional> Path to the log file. If provided, logs are written to the log file, otherwise displayed in terminal
# In case it starts with "./" or "../", it is relative path to the current dir, otherwise to the --tezos-data-dir
# --log-file <PATH>
--log-file=logs/tezedge.log

# Set output format of the log. [possible values: json, simple]
# --log-format <log-format>
--log-format=simple

# Set log level [possible values: critical, error, warn, info, debug, trace]
# --log-level <LEVEL>
--log-level=info

# Flag for turn on/off logging in Tezos OCaml runtime.
# --ocaml-log-enabled <BOOL>
--ocaml-log-enabled=false

# Choose the Tezos environment [possible values: alphanet, babylonnet, babylon, mainnet, zeronet, carthagenet, carthage, delphinet, delphi, edonet (deprecated - use edo2), edo (deprecated - use edo2), edo2net, edo2, sandbox, florencenet, florence]
--network=mainnet

# Socket listening port for p2p for communication with tezos world
# --p2p-port <PORT>
--p2p-port=9732

# Rust server RPC port for communication with rust node
# --rpc-port <PORT>
--rpc-port=18732

# Node expose various metrics and statistics in real-time through websocket. This argument specifies address, on which
# will be this websocket accessible, e.g.: 0.0.0.0:4927.
--websocket-address=127.0.0.1:4927

# <Optional> A peer to bootstrap the network from. Peers are delimited by a colon. Format: IP1:PORT1,IP2:PORT2,IP3:PORT3
# --peers <IP:PORT>
--peers=95.216.45.62:9732

# Minimal number of peers to connect to
# --peer-thresh-low <NUM>
--peer-thresh-low=10

# Maximal number of peers to connect to
# --peer-thresh-high <NUM>
--peer-thresh-high=15

# Threshold number of peers the node has to be synced with to be pronounced bootstrapped
# --synchronization-thresh <NUM>
# --synchronization-thresh=0

# Path to a tezos protocol runner executable
# --protocol-runner <PATH>
--protocol-runner=./target/release/protocol-runner

# Compute the hashes of the trees to which context actions are being applied. Defaults to false.
# --compute-context-action-tree-hashe <BOOL>
--compute-context-action-tree-hashes=false

# Number of threads spawned by a tokio thread pool. If zero, then number of threads equal to CPU cores is spawned.
# --tokio-threads <NUM>
--tokio-threads=0

# Flag for enable/disable test chain switching for block applying. Default: false
# --enable-testchain <BOOL>
--enable-testchain=false

# Path to the json file with key-values, which will be added to empty context on startup and commit genesis.
# In case it starts with "./" or "../", it is relative path to the current dir, otherwise to the --tezos-data-dir
# --sandbox-patch-context-json-file <PATH>
# --sandbox-patch-context-json-file=./light_node/etc/tezedge_sandbox/sandbox-patch-context.json

# Enable or disable mempool
--disable-mempool=false

# Enable or disable private node. Use --peers to set IP addresses of the peers you want to connect to.
--private-node=false
jdsika commented 2 years ago

I have added a peer from the Octez client to solve it

tizoc commented 2 years ago

@jdsika but when you got an error, what were you using? just a commented out --peers ?

I can get an error if I use --peers=, but I haven't been able to reproduce the specific error you got.

tizoc commented 2 years ago

Ok, I was just able to reproduce it.

tizoc commented 2 years ago

@jdsika the problem is that if --private-node is specified (even if it is false), the configuration parser will require --peers too. For now the solution is to just not specify --private-node when it is false (the default).

The configuration parsing and commandline handling is being replaced by a newer, cleaner implementation here https://github.com/tezedge/tezedge/pull/988 (+ cleaner config file format later), and it is going to fix many issues, but right now we are focusing on improving TezEdge's support for tenderbake, so it may take some time before those configuration improvements get integrated.

Please keep reporting any other issues you find so that we can make sure the new parser indeed fixes them. Thank you for your patience.

jdsika commented 2 years ago

Sure, thanks for investigating