Documentation ¶
Index ¶
- Constants
- type Manager
- type Snapshotter
- func (s *Snapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
- func (s *Snapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
- func (s *Snapshotter) SnapshotFormat() uint32
- func (s *Snapshotter) SnapshotName() string
- func (s *Snapshotter) SupportedFormats() []uint32
- type TxHash
Constants ¶
const ( // SnapshotFormat defines the snapshot format of exported unordered transactions. // No protobuf envelope, no metadata. SnapshotFormat = 1 // SnapshotName defines the snapshot name of exported unordered transactions. SnapshotName = "unordered_txs" )
const ( // DefaultmaxTimeoutDuration defines the default maximum duration an un-ordered transaction // can set. DefaultMaxTimeoutDuration = time.Minute * 40 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager contains the tx hash dictionary for duplicates checking, and expire them when block production progresses.
func NewManager ¶
func (*Manager) Close ¶
Close must be called when a node gracefully shuts down. Typically, this should be called in an application's Close() function, which is called by the server. Note, Start() must be called in order for Close() to not hang.
It will free all necessary resources as well as writing all unexpired unordered transactions along with their TTL values to file.
func (*Manager) OnInit ¶
OnInit must be called when a node starts up. Typically, this should be called in an application's constructor, which is called by the server.
func (*Manager) OnNewBlock ¶
OnNewBlock sends the latest block time to the background purge loop, which should be called in ABCI Commit event.
type Snapshotter ¶
type Snapshotter struct {
// contains filtered or unexported fields
}
func NewSnapshotter ¶
func NewSnapshotter(m *Manager) *Snapshotter
func (*Snapshotter) RestoreExtension ¶
func (s *Snapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error
func (*Snapshotter) SnapshotExtension ¶
func (s *Snapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error
func (*Snapshotter) SnapshotFormat ¶
func (s *Snapshotter) SnapshotFormat() uint32
func (*Snapshotter) SnapshotName ¶
func (s *Snapshotter) SnapshotName() string
func (*Snapshotter) SupportedFormats ¶
func (s *Snapshotter) SupportedFormats() []uint32