services

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: AGPL-3.0 Imports: 25 Imported by: 13

Documentation

Index

Constants

View Source
const (
	// Log keys
	PrimarySyncProgressKey  string = "primarySyncProgress"
	FallbackSyncProgressKey string = "fallbackSyncProgress"
	SyncProgressKey         string = "syncProgress"
	PrimaryErrorKey         string = "primaryError"
	FallbackErrorKey        string = "fallbackError"
)

Variables

View Source
var (
	ErrExecutionClientNotSynced error = errors.New("The Execution client is currently syncing. Please try again later.")
	ErrBeaconNodeNotSynced      error = errors.New("The Beacon node is currently syncing. Please try again later.")
	ErrNotRegisteredWithNodeSet error = errors.New("The node is not registered with the Node Set. Please run 'hyperdrive nodeset register-node' and try again.")
	ErrWalletNotReady           error = errors.New("The node does not have a wallet ready yet. Please run 'hyperdrive wallet status' to learn more first.")
)
View Source
var (
	ErrNodeAddressNotSet error = errors.New("The node currently does not have an address set. Please run 'hyperdrive wallet init' and try again.")
	ErrNeedPassword      error = errors.New("The node has a node wallet on disk but does not have the password for it loaded. Please run `hyperdrive wallet set-password` to load it.")
	ErrWalletLoadFailure error = errors.New("The node has a node wallet and a password on disk but there was an error loading it - perhaps the password is incorrect? Please check the node logs for more information.")
	ErrNoWallet          error = errors.New("The node currently does not have a node wallet keystore. Please run 'hyperdrive wallet init' and try again.")
	ErrWalletMismatch    error = errors.New("The node's wallet keystore does not match the node address. This node is currently in read-only mode.")
)

Functions

func CheckIfWalletReady

func CheckIfWalletReady(status wallet.WalletStatus) error

Types

type IHyperdriveClientProvider added in v1.1.0

type IHyperdriveClientProvider interface {
	// Gets the Hyperdrive client
	GetHyperdriveClient() *client.ApiClient
}

Provides a Hyperdrive API client

type ILoggerProvider added in v1.1.0

type ILoggerProvider interface {
	services.ILoggerProvider

	// Gets the logger for the Hyperdrive client
	GetClientLogger() *log.Logger
}

Provides access to the module's loggers

type IModuleConfigProvider added in v1.1.0

type IModuleConfigProvider interface {
	// Gets Hyperdrive's configuration
	GetHyperdriveConfig() *hdconfig.HyperdriveConfig

	// Gets Hyperdrive's list of resources
	GetHyperdriveResources() *hdconfig.MergedResources

	// Gets the module's configuration
	GetModuleConfig() hdconfig.IModuleConfig

	// Gets the path to the module's data directory
	GetModuleDir() string
}

Provides the configurations for Hyperdrive and the module

type IModuleServiceProvider added in v1.1.0

Provides access to all of the standard services the module can use

func NewModuleServiceProvider added in v1.1.0

func NewModuleServiceProvider[ConfigType hdconfig.IModuleConfig](hyperdriveUrl *url.URL, moduleDir string, moduleName string, clientLogName string, factory func(*hdconfig.HyperdriveConfig) (ConfigType, error), authMgr *auth.AuthorizationManager) (IModuleServiceProvider, error)

Creates a new IModuleServiceProvider instance

func NewModuleServiceProviderFromArtifacts added in v1.1.0

func NewModuleServiceProviderFromArtifacts(hdClient *client.ApiClient, hdCfg *hdconfig.HyperdriveConfig, moduleCfg hdconfig.IModuleConfig, resources *hdconfig.MergedResources, moduleDir string, moduleName string, clientLogName string, ecManager *services.ExecutionClientManager, bcManager *services.BeaconClientManager) (IModuleServiceProvider, error)

Creates a new IModuleServiceProvider instance, using the given artifacts instead of creating ones based on the config parameters

type IRequirementsProvider added in v1.1.0

type IRequirementsProvider interface {
	// Require Hyperdrive has a node address set
	RequireNodeAddress(status wallet.WalletStatus) error

	// Require Hyperdrive has a wallet that's loaded and ready for transactions
	RequireWalletReady(status wallet.WalletStatus) error

	// Require that the Ethereum client is synced
	RequireEthClientSynced(ctx context.Context) error

	// Require that the Beacon chain client is synced
	RequireBeaconClientSynced(ctx context.Context) error

	// Require the node has been registered with a nodeset.io account
	RequireRegisteredWithNodeSet(ctx context.Context) error

	// Wait for the Ethereum client to be synced
	WaitEthClientSynced(ctx context.Context, verbose bool) error

	// Wait for the Beacon chain client to be synced
	WaitBeaconClientSynced(ctx context.Context, verbose bool) error

	// Wait for Hyperdrive to have a node address assigned
	WaitForNodeAddress(ctx context.Context) (*wallet.WalletStatus, error)

	// Wait for the node to have a wallet loaded and ready for transactions
	WaitForWallet(ctx context.Context) (*wallet.WalletStatus, error)

	// Wait for the node to be registered with a nodeset.io account
	WaitForNodeSetRegistration(ctx context.Context) bool
}

Provides methods for requiring or waiting for various conditions to be met

type ISignerProvider added in v1.1.0

type ISignerProvider interface {
	// Gets the module's signer
	GetSigner() *ModuleSigner
}

Provides a signer that can sign messages from the node's wallet

type ModuleSigner

type ModuleSigner struct {
	// contains filtered or unexported fields
}

Used to request TX signatures from the node wallet

func NewModuleSigner

func NewModuleSigner(hd *client.ApiClient) *ModuleSigner

Creates a new ModuleSigner

func (*ModuleSigner) GetTransactor

func (s *ModuleSigner) GetTransactor(walletAddress common.Address) *bind.TransactOpts

Gets a transactor for signing transactions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL