Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start node as Authority Role without toml config #3020

Closed
edwardmack opened this issue Jan 6, 2023 · 2 comments · Fixed by #3091
Closed

Unable to start node as Authority Role without toml config #3020

edwardmack opened this issue Jan 6, 2023 · 2 comments · Fixed by #3091

Comments

@edwardmack
Copy link
Contributor

edwardmack commented Jan 6, 2023

Describe the bug

  • It does not seem possible to start gossamer node as Authority Role (building and finalizing blocks) without using a toml config file.

Expected Behavior

  • Should be able to start node with Role Authority using command line arguments (without config file).
  • The CLI attribute --roles should work, it doesn't seem to be working when passed in as CLI attribute.
  • There should be a CLI attribute for babe-authority to define this from CLI (there is a babe-authority config attribute).

Current Behavior

  • In order to start node as Authority Role it is necessary to:
    • Use --config CLI flag that points to a .toml file that contains attributes:
    • core attribute role = 4
    • core attribute babe-authority = true

Possible Solution

  • These attributes should be working as CLI attributes.

To Reproduce

Steps to reproduce the behaviour:

  1. Try starting gossamer node as authority role without using config file:
gossamer --genesis /path/to/genesis.json --name alice --rpc  --ws  --ws-external  --rpc-external  --publish-metrics --key alice --babe-lead --rpcmods system,author,chain,state,rpc,grandpa,offchain,childstate,syncstate,payment --no-telemetry --roles 4 --rpcport 40775 --wsport 45543 --port 33403 --metrics-address :40433 --basepath /tmp/gossamer/basepath/alice/data
  1. The node will start, but will not build or finalize any blocks.

Specification

  • go version: 1.18
  • gossamer version: development
  • gossamer commit tag:
  • gossamer commit hash:
  • operating system:
  • additional links:
@edwardmack
Copy link
Contributor Author

Update: further investigations shows that gossamer can not be started if it doesn't have access to toml config file. Steps to reproduce issue:

emack@system76-pc:~/projects/ChainSafe/gossamer$ make gossamer
rm -fr ./bin
  >  Building binary... 
go build -trimpath -o ./bin/gossamer -ldflags="-s -w" ./cmd/gossamer
emack@system76-pc:~/projects/ChainSafe/gossamer$ ./bin/gossamer 
2023-02-01T15:04:12-05:00 INFO     loaded package log configuration: core: INFO, digest: INFO, sync: INFO, network: INFO, rpc: INFO, state: INFO, runtime: INFO, block producer: INFO, finality gadget: INFO   config.go:L122  pkg=cmd
2023-02-01T15:04:12-05:00 INFO     🕸️ initialising node services with global configuration name carpet-drill-8904, id westend_dev and base path /home/emack/.gossamer/gssmr... node.go:L245    pkg=dot
2023-02-01T15:04:12-05:00 INFO     created state service with head 0xb967a97c0906f0778912e115fc30e739aa9c274ac90b1ec1951657946c09c41c, highest number 0 and genesis hash 0xb967a97c0906f0778912e115fc30e739aa9c274ac90b1ec1951657946c09c41c    service.go:L161 pkg=state
2023-02-01T15:04:12-05:00 WARN     Bootstrap is enabled but no bootstrap nodes are defined      config.go:L140  pkg=network
2023-02-01T15:04:18-05:00 INFO     creating runtime with interpreter wasmer...  services.go:L115        pkg=dot
2023-02-01T15:04:20-05:00 ERROR    failed to create node services: no ed25519 keys provided for GRANDPA main.go:L281    pkg=cmd
no ed25519 keys provided for GRANDPA
emack@system76-pc:~/projects/ChainSafe/gossamer$ cd ~
emack@system76-pc:~$ ./projects/ChainSafe/gossamer/bin/gossamer 
2023-02-01T15:04:49-05:00 ERROR    failed to open toml configuration file: open /home/emack/chain/gssmr/config.toml: no such file or directory  toml_config.go:L29      pkg=cmd
2023-02-01T15:04:49-05:00 ERROR    failed to load toml configuration: open /home/emack/chain/gssmr/config.toml: no such file or directory       config.go:L66   pkg=cmd
2023-02-01T15:04:49-05:00 ERROR    failed to set chain configuration: open /home/emack/chain/gssmr/config.toml: no such file or directory       config.go:L109  pkg=cmd
2023-02-01T15:04:49-05:00 ERROR    failed to create node configuration: open /home/emack/chain/gssmr/config.toml: no such file or directory     main.go:L224    pkg=cmd
open /home/emack/chain/gssmr/config.toml: no such file or directory
emack@system76-pc:~$ 

Notice that after we cd to a directory outside the project home and run gossamer it fails with error failed to open toml configuration...
This is the core of this issue, gossamer should be able to start without needing to be run from the project home.

Copy link

🎉 This issue has been resolved in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants