Skip to content

Commit

Permalink
feat(taiko-client): allow --l1.beacon to be optional when a blob s…
Browse files Browse the repository at this point in the history
…erver is given (#18094)

Co-authored-by: David <[email protected]>
  • Loading branch information
2 people authored and dantaik committed Sep 18, 2024
1 parent 613d16f commit 2b16d82
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 2b16d82

Please sign in to comment.