forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
55 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/cmd/utils" | ||
"github.com/ethereum/go-ethereum/log" | ||
"github.com/ethereum/go-ethereum/node" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
// TODO: when we have clearer picture of how do we want rollup "features" (EIPs/RIPs) to be activated | ||
// make this "rule" activated (ie. if not "rule activated" then L1 client can simply be nil) | ||
func activateL1RPCEndpoint(ctx *cli.Context, stack *node.Node) { | ||
if !ctx.IsSet(utils.L1NodeRPCEndpointFlag.Name) { | ||
log.Error("L1 node RPC endpoint URL not set", "flag", utils.L1NodeRPCEndpointFlag.Name) | ||
return | ||
} | ||
|
||
l1RPCEndpoint := ctx.String(utils.L1NodeRPCEndpointFlag.Name) | ||
stack.RegisterEthClient(l1RPCEndpoint) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package node | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/ethclient" | ||
"github.com/ethereum/go-ethereum/log" | ||
) | ||
|
||
func (n *Node) RegisterEthClient(endpoint string) { | ||
ethClient, err := ethclient.Dial(endpoint) | ||
if err != nil { | ||
log.Error("Unable to connect to ETH RPC endpoint at", "URL", ethClient, "error", err) | ||
return | ||
} | ||
|
||
n.ethClient = ethClient | ||
log.Info("Initialized ETH RPC client", "endpoint", ethClient) | ||
} |