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

feat(taiko-client): allow --l1.beacon to be optional when a blob server is given #18094

Merged
merged 7 commits into from
Sep 15, 2024
11 changes: 8 additions & 3 deletions packages/taiko-client/driver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
return nil, errors.New("empty L2 check point URL")
}

if !c.IsSet(flags.L1BeaconEndpoint.Name) {
return nil, errors.New("empty L1 beacon endpoint")
var beaconEndpoint string
if c.IsSet(flags.L1BeaconEndpoint.Name) {
beaconEndpoint = c.String(flags.L1BeaconEndpoint.Name)
}

var blobServerEndpoint *url.URL
Expand All @@ -64,11 +65,15 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
}
}

if beaconEndpoint == "" && blobServerEndpoint == nil && socialScanEndpoint == nil {
return nil, errors.New("empty L1 beacon endpoint, blob server and Social Scan endpoint")
}

var timeout = c.Duration(flags.RPCTimeout.Name)
return &Config{
ClientConfig: &rpc.ClientConfig{
L1Endpoint: c.String(flags.L1WSEndpoint.Name),
L1BeaconEndpoint: c.String(flags.L1BeaconEndpoint.Name),
L1BeaconEndpoint: beaconEndpoint,
L2Endpoint: c.String(flags.L2WSEndpoint.Name),
L2CheckPoint: l2CheckPoint,
TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)),
Expand Down
Loading