2021-10-18 17:48:05 +00:00
|
|
|
package blockchaincmd
|
|
|
|
|
|
|
|
import (
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/blockchain"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/cmd"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/cmd/beacon-chain/flags"
|
2021-10-18 17:48:05 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FlagOptions for blockchain service flag configurations.
|
|
|
|
func FlagOptions(c *cli.Context) ([]blockchain.Option, error) {
|
2022-03-28 21:01:55 +00:00
|
|
|
wsp := c.String(flags.WeakSubjectivityCheckpoint.Name)
|
2021-10-18 17:48:05 +00:00
|
|
|
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
|
|
|
|
}
|