order

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID               uint64
	IsNew            bool
	RepoRoot         string
	StoragePath      string
	OrderType        string
	PeerMgr          peermgr.PeerManager
	PrivKey          crypto.PrivateKey
	Logger           logrus.FieldLogger
	Nodes            map[uint64]*pb.VpInfo
	Applied          uint64
	Digest           string
	GetChainMetaFunc func() *pb.ChainMeta
	GetBlockByHeight func(height uint64) (*pb.Block, error)
	GetAccountNonce  func(address *types.Address) uint64
}

func GenerateConfig

func GenerateConfig(opts ...Option) (*Config, error)

type Option

type Option func(*Config)

func WithApplied

func WithApplied(height uint64) Option

func WithDigest

func WithDigest(digest string) Option

func WithGetAccountNonceFunc added in v1.6.1

func WithGetAccountNonceFunc(f func(address *types.Address) uint64) Option

func WithGetBlockByHeightFunc added in v1.4.0

func WithGetBlockByHeightFunc(f func(height uint64) (*pb.Block, error)) Option

func WithGetChainMetaFunc

func WithGetChainMetaFunc(f func() *pb.ChainMeta) Option

func WithID

func WithID(id uint64) Option

func WithIsNew added in v1.4.0

func WithIsNew(isNew bool) Option

func WithLogger

func WithLogger(logger logrus.FieldLogger) Option

func WithNodes

func WithNodes(nodes map[uint64]*pb.VpInfo) Option

func WithOrderType added in v1.10.1

func WithOrderType(typ string) Option

func WithPeerManager

func WithPeerManager(peerMgr peermgr.PeerManager) Option

func WithPrivKey

func WithPrivKey(privKey crypto.PrivateKey) Option

func WithRepoRoot

func WithRepoRoot(path string) Option

func WithStoragePath

func WithStoragePath(path string) Option

type ReqLookUp

type ReqLookUp struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewReqLookUp

func NewReqLookUp(storage storage.Storage, logger logrus.FieldLogger) (*ReqLookUp, error)

func (*ReqLookUp) Add

func (r *ReqLookUp) Add(key []byte)

func (*ReqLookUp) Build

func (r *ReqLookUp) Build() error

func (*ReqLookUp) LookUp

func (r *ReqLookUp) LookUp(key []byte) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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