node

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: BSD-3-Clause Imports: 54 Imported by: 2

Documentation

Overview

Package node defines the concept of a Bee node by bootstrapping and injecting all necessary dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitChain added in v0.5.2

func InitChain(
	ctx context.Context,
	logger logging.Logger,
	stateStore storage.StateStorer,
	endpoint string,
	signer crypto.Signer,
) (*ethclient.Client, common.Address, int64, transaction.Service, error)

InitChain will initialize the Ethereum backend at the given endpoint and set up the Transacton Service to interact with it using the provided signer.

func InitChequebookFactory added in v0.5.2

func InitChequebookFactory(
	logger logging.Logger,
	backend *ethclient.Client,
	chainID int64,
	transactionService transaction.Service,
	factoryAddress string,
) (chequebook.Factory, error)

InitChequebookFactory will initialize the chequebook factory with the given chain backend.

func InitChequebookService added in v0.5.2

func InitChequebookService(
	ctx context.Context,
	logger logging.Logger,
	stateStore storage.StateStorer,
	signer crypto.Signer,
	chainID int64,
	backend *ethclient.Client,
	overlayEthAddress common.Address,
	transactionService transaction.Service,
	chequebookFactory chequebook.Factory,
	initialDeposit string,
) (chequebook.Service, error)

InitChequebookService will initialize the chequebook service with the given chequebook factory and chain backend.

func InitStateStore added in v0.5.2

func InitStateStore(log logging.Logger, dataDir string) (ret storage.StateStorer, err error)

InitStateStore will initialze the stateStore with the given path to the data directory. When given an empty directory path, the function will instead initialize an in-memory state store that will not be persisted.

func InitSwap added in v0.5.2

func InitSwap(
	p2ps *libp2p.Service,
	logger logging.Logger,
	stateStore storage.StateStorer,
	networkID uint64,
	overlayEthAddress common.Address,
	chequebookService chequebook.Service,
	chequeStore chequebook.ChequeStore,
	cashoutService chequebook.CashoutService,
) (*swap.Service, error)

InitSwap will initialize and register the swap service.

Types

type Bee

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

func NewBee

func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, signer crypto.Signer, networkID uint64, logger logging.Logger, libp2pPrivateKey, pssPrivateKey *ecdsa.PrivateKey, o Options) (*Bee, error)

func (*Bee) Shutdown

func (b *Bee) Shutdown(ctx context.Context) error

type Options

type Options struct {
	DataDir                string
	DBCapacity             uint64
	APIAddr                string
	DebugAPIAddr           string
	Addr                   string
	NATAddr                string
	EnableWS               bool
	EnableQUIC             bool
	WelcomeMessage         string
	Bootnodes              []string
	CORSAllowedOrigins     []string
	Logger                 logging.Logger
	Standalone             bool
	TracingEnabled         bool
	TracingEndpoint        string
	TracingServiceName     string
	GlobalPinningEnabled   bool
	PaymentThreshold       string
	PaymentTolerance       string
	PaymentEarly           string
	ResolverConnectionCfgs []multiresolver.ConnectionConfig
	GatewayMode            bool
	SwapEndpoint           string
	SwapFactoryAddress     string
	SwapInitialDeposit     string
	SwapEnable             bool
}

Jump to

Keyboard shortcuts

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