Skip to content

Commit

Permalink
add docs link to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Sep 26, 2024
1 parent 8137451 commit 94f57ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo

// InitChainer application update at chain initialization
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
// The defer is used to catch panics during InitChain
//and display a more meaningful message for people trying to sync a node from block 1 using the latest binary.
// We exit the process after displaying the message as we do not need to start a node with empty state.

defer func() {
if r := recover(); r != nil {
ctx.Logger().Error("panic occurred during InitGenesis", "error", r)
Expand Down
5 changes: 4 additions & 1 deletion pkg/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ const (
OptionUnpause = "unpause"

// InitChainErrorMessage is the error message displayed when trying to sync testnet or mainnet from block 1
InitChainErrorMessage = "You cannot sync testnet or mainnet from block 1 using the latest version. You should sync your node from a snapshot"
InitChainErrorMessage = "You cannot sync testnet or mainnet from block 1 using the latest version. " +
"You should sync your node from a snapshot. " +
"Refer to the documentation for more information: " +
"https://www.zetachain.com/docs/nodes/start-here/syncing/"
)

0 comments on commit 94f57ef

Please sign in to comment.