Documentation
¶
Overview ¶
Package node defines the concept of a Bee node by bootstrapping and injecting all necessary dependencies.
Index ¶
- Constants
- Variables
- func GetTxHash(stateStore storage.StateStorer, logger log.Logger, trxString string) ([]byte, error)
- func GetTxNextBlock(ctx context.Context, logger log.Logger, backend transaction.Backend, ...) ([]byte, error)
- func InitChain(ctx context.Context, logger log.Logger, stateStore storage.StateStorer, ...) (transaction.Backend, common.Address, int64, transaction.Monitor, ...)
- func InitChequebookFactory(logger log.Logger, backend transaction.Backend, chainID int64, ...) (chequebook.Factory, error)
- func InitChequebookService(ctx context.Context, logger log.Logger, stateStore storage.StateStorer, ...) (chequebook.Service, error)
- func InitStamperStore(logger log.Logger, dataDir string, stateStore storage.StateStorer) (storage.Store, error)
- func InitStateStore(logger log.Logger, dataDir string, cacheCapacity uint64) (storage.StateStorerManager, metrics.Collector, error)
- func InitSwap(p2ps *libp2p.Service, logger log.Logger, stateStore storage.StateStorer, ...) (*swap.Service, priceoracle.Service, error)
- type Bee
- type DevBee
- type DevOptions
- type Options
- type SnapshotGetter
- type SnapshotLogFilterer
Constants ¶
const LoggerName = "node"
LoggerName is the tree path name of the logger for this package.
Variables ¶
var ErrShutdownInProgress = errors.New("shutdown in progress")
Functions ¶
func GetTxNextBlock ¶
func InitChain ¶
func InitChain( ctx context.Context, logger log.Logger, stateStore storage.StateStorer, endpoint string, oChainID int64, signer crypto.Signer, pollingInterval time.Duration, chainEnabled bool, ) (transaction.Backend, common.Address, int64, transaction.Monitor, transaction.Service, error)
InitChain will initialize the Ethereum backend at the given endpoint and set up the Transaction Service to interact with it using the provided signer.
func InitChequebookFactory ¶
func InitChequebookFactory(logger log.Logger, backend transaction.Backend, chainID int64, transactionService transaction.Service, factoryAddress string) (chequebook.Factory, error)
InitChequebookFactory will initialize the chequebook factory with the given chain backend.
func InitChequebookService ¶
func InitChequebookService( ctx context.Context, logger log.Logger, stateStore storage.StateStorer, signer crypto.Signer, chainID int64, backend transaction.Backend, overlayEthAddress common.Address, transactionService transaction.Service, chequebookFactory chequebook.Factory, initialDeposit string, erc20Service erc20.Service, ) (chequebook.Service, error)
InitChequebookService will initialize the chequebook service with the given chequebook factory and chain backend.
func InitStamperStore ¶
func InitStamperStore(logger log.Logger, dataDir string, stateStore storage.StateStorer) (storage.Store, error)
InitStamperStore will create new stamper store 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 InitStateStore ¶
func InitStateStore(logger log.Logger, dataDir string, cacheCapacity uint64) (storage.StateStorerManager, metrics.Collector, error)
InitStateStore will initialize 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 ¶
func InitSwap( p2ps *libp2p.Service, logger log.Logger, stateStore storage.StateStorer, networkID uint64, overlayEthAddress common.Address, chequebookService chequebook.Service, chequeStore chequebook.ChequeStore, cashoutService chequebook.CashoutService, accounting settlement.Accounting, priceOracleAddress string, chainID int64, transactionService transaction.Service, ) (*swap.Service, priceoracle.Service, error)
InitSwap will initialize and register the swap service.
Types ¶
type Bee ¶
type Bee struct {
// contains filtered or unexported fields
}
func (*Bee) SyncingStopped ¶
func (b *Bee) SyncingStopped() chan struct{}
type DevBee ¶
type DevBee struct {
// contains filtered or unexported fields
}
type DevOptions ¶
type Options ¶
type Options struct { Addr string AllowPrivateCIDRs bool APIAddr string BlockchainRpcEndpoint string BlockProfile bool BlockTime time.Duration BootnodeMode bool Bootnodes []string CacheCapacity uint64 ChainID int64 ChequebookEnable bool CORSAllowedOrigins []string DataDir string DBBlockCacheCapacity uint64 DBDisableSeeksCompaction bool DBOpenFilesLimit uint64 DBWriteBufferSize uint64 EnableStorageIncentives bool EnableWS bool FullNodeMode bool Logger log.Logger MinimumStorageRadius uint MutexProfile bool NATAddr string NeighborhoodSuggester string PaymentEarly int64 PaymentThreshold string PaymentTolerance int64 PostageContractAddress string PostageContractStartBlock uint64 PriceOracleAddress string RedistributionContractAddress string ReserveCapacityDoubling int ResolverConnectionCfgs []multiresolver.ConnectionConfig Resync bool RetrievalCaching bool SkipPostageSnapshot bool StakingContractAddress string StatestoreCacheCapacity uint64 StaticNodes []swarm.Address SwapEnable bool SwapFactoryAddress string SwapInitialDeposit string TargetNeighborhood string TracingEnabled bool TracingEndpoint string TracingServiceName string TrxDebugMode bool UsePostageSnapshot bool WarmupTime time.Duration WelcomeMessage string WhitelistedWithdrawalAddress []string }
type SnapshotGetter ¶ added in v2.6.0
type SnapshotGetter interface {
GetBatchSnapshot() []byte
}
type SnapshotLogFilterer ¶ added in v2.6.0
type SnapshotLogFilterer struct {
// contains filtered or unexported fields
}
func NewSnapshotLogFilterer ¶ added in v2.6.0
func NewSnapshotLogFilterer(logger log.Logger, getter SnapshotGetter) *SnapshotLogFilterer
func (*SnapshotLogFilterer) BlockNumber ¶ added in v2.6.0
func (f *SnapshotLogFilterer) BlockNumber(_ context.Context) (uint64, error)