Documentation ¶
Overview ¶
Package node defines the concept of a Mop node by bootstrapping and injecting all necessary dependencies.
Index ¶
- Constants
- Variables
- func CheckOverlayWithStore(overlay cluster.Address, storer storage.StateStorer) error
- func GetExistingOverlay(storer storage.StateStorer) (cluster.Address, error)
- 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 InitStateStore(logger log.Logger, dataDir string) (storage.StateStorer, error)
- func InitSwap(p2ps *libp2p.Service, logger log.Logger, stateStore storage.StateStorer, ...) (*swap.Service, priceoracle.Service, error)
- func SetOverlayInStore(overlay cluster.Address, storer storage.StateStorer) error
- type DevMop
- type DevOptions
- type Mop
- type Options
Constants ¶
const LoggerName = "node"
LoggerName is the tree path name of the logger for this package.
const OverlayNonce = "overlayV2_nonce"
Variables ¶
var ErrShutdownInProgress error = errors.New("shutdown in progress")
Functions ¶
func CheckOverlayWithStore ¶
func CheckOverlayWithStore(overlay cluster.Address, storer storage.StateStorer) error
CheckOverlayWithStore checks the overlay is the same as stored in the statestore
func GetExistingOverlay ¶
func GetExistingOverlay(storer storage.StateStorer) (cluster.Address, error)
func GetTxNextBlock ¶
func InitChain ¶
func InitChain( ctx context.Context, logger log.Logger, stateStore storage.StateStorer, endpoints []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 BNB Smart Chain 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, legacyFactoryAddresses []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, deployGasPrice string, erc20Service erc20.Service, ) (chequebook.Service, error)
InitChequebookService will initialize the chequebook service with the given chequebook factory and chain backend.
func InitStateStore ¶
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.
func SetOverlayInStore ¶
func SetOverlayInStore(overlay cluster.Address, storer storage.StateStorer) error
SetOverlayInStore sets the overlay stored in the statestore (for purpose of overlay migration)
Types ¶
type DevMop ¶
type DevMop struct {
// contains filtered or unexported fields
}
type DevOptions ¶
type DevOptions struct { Logger log.Logger APIAddr string DebugAPIAddr string CORSAllowedOrigins []string DBOpenFilesLimit uint64 ReserveCapacity uint64 DBWriteBufferSize uint64 DBBlockCacheCapacity uint64 DBDisableSeeksCompaction bool Restricted bool TokenEncryptionKey string AdminPasswordHash string }
type Mop ¶
type Mop struct {
// contains filtered or unexported fields
}
func (*Mop) SyncingStopped ¶
func (b *Mop) SyncingStopped() chan struct{}
type Options ¶
type Options struct { DataDir string CacheCapacity uint64 MemCacheCapacity uint64 DBOpenFilesLimit uint64 DBWriteBufferSize uint64 DBBlockCacheCapacity uint64 DBDisableSeeksCompaction bool APIAddr []string DebugAPIAddr string Addr string NATAddr string EnableWS bool WelcomeMessage string Bootnodes []string CORSAllowedOrigins []string Logger log.Logger TracingEnabled bool TracingEndpoint string TracingServiceName string PaymentThreshold string PaymentTolerance int64 PaymentEarly int64 ResolverConnectionCfgs []multiresolver.ConnectionConfig RetrievalCaching bool BootnodeMode bool BSCEndpoints []string SwapFactoryAddress string SwapLegacyFactoryAddresses []string SwapInitialDeposit string SwapEnable bool ChequebookEnable bool FullNodeMode bool Transaction string BlockHash string VoucherContractAddress string PriceOracleAddress string PledgeAddress string RewardAddress string BlockTime uint64 DeployGasPrice string WarmupTime time.Duration ChainID int64 Resync bool BlockProfile bool MutexProfile bool StaticNodes []cluster.Address AllowPrivateCIDRs bool Restricted bool TokenEncryptionKey string AdminPasswordHash string UseVoucherSnapshot bool RemoteEndPoint string TrustNode bool TLSCertFile string TLSKeyFile string }