berachain / beacon-kit

A modular framework for building EVM consensus clients ⛵️✨
https://berachain.com
Other
162 stars 120 forks source link

Beaconkit runs perfectly first time, but doesn't run after restart #1933

Open JasoonS opened 2 months ago

JasoonS commented 2 months ago
beacon-kit-1  | Error: genesis.json file already exists: /tmp/bera/config/genesis.json
beacon-kit-1  | Usage:
beacon-kit-1  |   BeaconKit init [moniker] [flags]
beacon-kit-1  | 
beacon-kit-1  | Flags:
beacon-kit-1  |       --chain-id string             genesis file chain-id, if left blank will be randomly created
beacon-kit-1  |       --consensus-key-algo string   algorithm to use for the consensus key (default "ed25519")
beacon-kit-1  |       --default-denom string        genesis file default denomination, if left blank default value is 'stake'
beacon-kit-1  |   -h, --help                        help for init
beacon-kit-1  |       --initial-height int          specify the initial block height at genesis (default 1)
beacon-kit-1  |   -o, --overwrite                   overwrite the genesis.json file
beacon-kit-1  |       --recover                     provide seed phrase to recover existing key instead of creating
beacon-kit-1  | 
beacon-kit-1  | Global Flags:
beacon-kit-1  |       --home string         directory for config and data (default "/root/.beacond")
beacon-kit-1  |       --log_format string   The logging format (json|plain) (default "plain")
beacon-kit-1  |       --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info")
beacon-kit-1  |       --log_no_color        Disable colored logs
beacon-kit-1  |       --trace               print out full stack trace on errors
beacon-kit-1  | 
beacon-kit-1  | 2024/08/20 11:50:23 ERROR startup failure error="genesis.json file already exists: /tmp/bera/config/genesis.json"
beacon-kit-1 exited with code 1

I can't work out why the file shouldn't exist, or what changes the second time I run the service.

This is running on ubuntu 24.04 - I followed this tutorial which works like a charm: https://docs.ghostlogs.xyz/blog/spin_up_bera_node/ - I just don't know how to stop and then restart things so they run correctly. I have tried with 0.2.0-alpha.4 and 0.2.0-alpha.2

itsdevbear commented 2 months ago

hi @JasoonS can you try main and see if this is resolved?

JasoonS commented 2 months ago

can you try main and see if this is resolved?

Will give it a try when I get a chance and let you know.

JasoonS commented 2 months ago

I got this now on the latest version, maybe I need to do a complete resync from block zero and can't use this snapshot?

beacon-kit-1  | 2024/08/27 14:25:26 [JOB 1] WAL file /bera/bera-snapshot/beacond-data/data/application.db/044923.log with log number 044923 stopped reading at offset: 0; replayed 0 keys in 0 batches
beacon-kit-1  | panic: error calling provider github.com/berachain/beacon-kit/mod/node-core/pkg/components.ProvideJWTSecret (github.com/berachain/beacon-kit/mod/node-core/pkg/components/jwt_secret.go:41): hex string without 0x prefix
beacon-kit-1  | 
beacon-kit-1  | goroutine 1 [running]:
beacon-kit-1  | github.com/berachain/beacon-kit/mod/node-core/pkg/builder.(*NodeBuilder[...]).Build(0x28f98e0, 0xc000f44210, {0x28fc520, 0xc00011b018}, {0x20, 0x2411132?}, 0xc000bb3180?, {0x28c2a20, 0xc000b3bdc0})
beacon-kit-1  |         github.com/berachain/beacon-kit/mod/node-core/pkg/builder/builder.go:109 +0x45a
beacon-kit-1  | github.com/berachain/beacon-kit/mod/cli/pkg/commands/server.StartCmdWithOptions[...].func1({0x241128e, 0x4?, 0x2411152?})
beacon-kit-1  |         github.com/berachain/beacon-kit/mod/cli/pkg/commands/server/start.go:123 +0xd6
beacon-kit-1  | github.com/spf13/cobra.(*Command).execute(0xc000b42f08, {0xc000de2f30, 0x9, 0x9})
beacon-kit-1  |         github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa
beacon-kit-1  | github.com/spf13/cobra.(*Command).ExecuteC(0xc000b33208)
beacon-kit-1  |         github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
beacon-kit-1  | github.com/spf13/cobra.(*Command).Execute(...)
beacon-kit-1  |         github.com/spf13/cobra@v1.8.1/command.go:1041
beacon-kit-1  | github.com/spf13/cobra.(*Command).ExecuteContext(...)
beacon-kit-1  |         github.com/spf13/cobra@v1.8.1/command.go:1034
beacon-kit-1  | github.com/berachain/beacon-kit/mod/cli/pkg/commands/server/cmd.Execute(0xc000b33208, {0x0, 0x0}, {0xc00118d470, 0xe})
beacon-kit-1  |         github.com/berachain/beacon-kit/mod/cli/pkg/commands/server/cmd/execute.go:56 +0x2a5
beacon-kit-1  | github.com/berachain/beacon-kit/mod/cli/pkg/commands.(*Root).Run(0xc001425740?, {0xc00118d470?, 0x18?})
beacon-kit-1  |         github.com/berachain/beacon-kit/mod/cli/pkg/commands/root.go:92 +0x25
beacon-kit-1  | main.run()
beacon-kit-1  |         github.com/berachain/beacon-kit/beacond/cmd/main.go:86 +0x39c
beacon-kit-1  | main.main()
beacon-kit-1  |         github.com/berachain/beacon-kit/beacond/cmd/main.go:91 +0x17
beacon-kit-1 exited with code 2