prysm-pulse/cmd/beacon-chain/blockchain/options.go
kasey 7920528ede
Checkpoint Sync 4/5 - enable checkpoint sync to be used by beacon node (#10386)
* enable checkpoint sync in beacon node

* lint fix

* rm unused error

* addressing PR feedback from Radek

* consistent slice -> fixed conversion

Co-authored-by: kasey <kasey@users.noreply.github.com>
2022-03-28 21:01:55 +00:00

25 lines
758 B
Go

package blockchaincmd
import (
"github.com/prysmaticlabs/prysm/beacon-chain/blockchain"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/cmd"
"github.com/prysmaticlabs/prysm/cmd/beacon-chain/flags"
"github.com/urfave/cli/v2"
)
// FlagOptions for blockchain service flag configurations.
func FlagOptions(c *cli.Context) ([]blockchain.Option, error) {
wsp := c.String(flags.WeakSubjectivityCheckpoint.Name)
wsCheckpt, err := helpers.ParseWeakSubjectivityInputString(wsp)
if err != nil {
return nil, err
}
maxRoutines := c.Int(cmd.MaxGoroutines.Name)
opts := []blockchain.Option{
blockchain.WithMaxGoroutines(maxRoutines),
blockchain.WithWeakSubjectivityCheckpoint(wsCheckpt),
}
return opts, nil
}