Documentation
¶
Index ¶
- func EpochFromString(str string) (primitives.Epoch, error)
- func PubKeyFromHex(str string) ([fieldparams.BLSPubkeyLength]byte, error)
- func PubKeyToHexString(pubKey []byte) (string, error)
- func RootFromHex(str string) ([32]byte, error)
- func RootToHexString(root []byte) (string, error)
- func SlotFromString(str string) (primitives.Slot, error)
- func Uint64FromString(str string) (uint64, error)
- func ValidateMetadata(ctx context.Context, validatorDB iface.ValidatorDB, ...) error
- type NodeConnection
- type NodeConnectionOption
- func WithGRPC(ctx context.Context, endpoint string, dialOpts []grpc.DialOption) NodeConnectionOption
- func WithGRPCProvider(provider grpcutil.GrpcConnectionProvider) NodeConnectionOption
- func WithREST(endpoint string, opts ...rest.RestConnectionProviderOption) NodeConnectionOption
- func WithRestProvider(provider rest.RestConnectionProvider) NodeConnectionOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EpochFromString ¶
func EpochFromString(str string) (primitives.Epoch, error)
EpochFromString converts a string into Epoch.
func PubKeyFromHex ¶
func PubKeyFromHex(str string) ([fieldparams.BLSPubkeyLength]byte, error)
PubKeyFromHex takes in a hex string, verifies its length as 48 bytes, and converts that representation.
func PubKeyToHexString ¶
func RootFromHex ¶
RootFromHex takes in a hex string, verifies its length as 32 bytes, and converts that representation.
func RootToHexString ¶
func SlotFromString ¶
func SlotFromString(str string) (primitives.Slot, error)
SlotFromString converts a string into Slot.
func Uint64FromString ¶
Uint64FromString converts a string into a uint64 representation.
func ValidateMetadata ¶
func ValidateMetadata(ctx context.Context, validatorDB iface.ValidatorDB, interchangeJSON *format.EIPSlashingProtectionFormat) error
Types ¶
type NodeConnection ¶
type NodeConnection interface {
// GetGrpcClientConn returns the current gRPC client connection.
// Returns nil if no gRPC provider is configured.
GetGrpcClientConn() *grpc.ClientConn
// GetGrpcConnectionProvider returns the gRPC connection provider.
GetGrpcConnectionProvider() grpcutil.GrpcConnectionProvider
// GetRestConnectionProvider returns the REST connection provider.
GetRestConnectionProvider() rest.RestConnectionProvider
// GetRestHandler returns the REST handler for making API requests.
// Returns nil if no REST provider is configured.
GetRestHandler() rest.Handler
}
NodeConnection provides access to both gRPC and REST API connections to a beacon node.
func NewNodeConnection ¶
func NewNodeConnection(opts ...NodeConnectionOption) (NodeConnection, error)
NewNodeConnection creates a new NodeConnection with the given options. At least one provider (gRPC or REST) must be configured via options. Returns an error if no providers are configured.
type NodeConnectionOption ¶
type NodeConnectionOption func(*nodeConnection) error
NodeConnectionOption is a functional option for configuring a NodeConnection.
func WithGRPC ¶ added in v7.1.3
func WithGRPC(ctx context.Context, endpoint string, dialOpts []grpc.DialOption) NodeConnectionOption
WithGRPC configures a gRPC connection provider for the NodeConnection. If endpoint is empty, this option is a no-op.
func WithGRPCProvider ¶ added in v7.1.3
func WithGRPCProvider(provider grpcutil.GrpcConnectionProvider) NodeConnectionOption
WithGRPCProvider sets a pre-built gRPC connection provider.
func WithREST ¶ added in v7.1.3
func WithREST(endpoint string, opts ...rest.RestConnectionProviderOption) NodeConnectionOption
WithREST configures a REST connection provider for the NodeConnection. If endpoint is empty, this option is a no-op.
func WithRestProvider ¶ added in v7.1.3
func WithRestProvider(provider rest.RestConnectionProvider) NodeConnectionOption
WithRestProvider sets a pre-built REST connection provider.