Documentation
¶
Index ¶
- Constants
- Variables
- func BannerString() string
- func IsHealthyCoverage(coverage, supply uint64, fraction Fraction) bool
- func IsHealthyCoverageString(coverage, supply uint64, fraction Fraction) string
- func NewLogger(name string, level zapcore.Level, outputs []string, timeLayout string) *zap.SugaredLogger
- func SetGlobalLogger(l *Global)
- type Fraction
- type Global
- func (l *Global) AssertMustError(err error)
- func (l *Global) AssertNoError(err error, prefix ...string)
- func (l *Global) Assertf(cond bool, format string, args ...any)
- func (l *Global) AttachmentFinished(started ...time.Time)
- func (l *Global) ClockCatchUpWithLedgerTime(ts ledger.Time)
- func (l *Global) Counter(name string) int
- func (l *Global) CounterLines(prefix ...string) *lines.Lines
- func (l *Global) Ctx() context.Context
- func (l *Global) DecCounter(name string)
- func (l *Global) IncCounter(name string)
- func (l *Global) Infof0(template string, args ...any)
- func (l *Global) Infof1(template string, args ...any)
- func (l *Global) Infof2(template string, args ...any)
- func (l *Global) InfofAtLevel(level int, template string, args ...any)
- func (l *Global) IsBootstrapMode() bool
- func (l *Global) IsShuttingDown() bool
- func (l *Global) Log() *zap.SugaredLogger
- func (l *Global) MarkWorkProcessStarted(name string)
- func (l *Global) MarkWorkProcessStopped(name string)
- func (l *Global) MetricsRegistry() *prometheus.Registry
- func (l *Global) RepeatInBackground(name string, period time.Duration, fun func() bool, skipFirst ...bool)
- func (l *Global) StartTracingTags(tags ...string)
- func (l *Global) StartTracingTx(txid ledger.TransactionID)
- func (l *Global) Stop()
- func (l *Global) StopTracingTag(tag string)
- func (l *Global) StopTracingTx(txid ledger.TransactionID)
- func (l *Global) TraceTx(txid *ledger.TransactionID, format string, args ...any)
- func (l *Global) TraceTxEnable()
- func (l *Global) Tracef(tag string, format string, args ...any)
- func (l *Global) TxPullParameters() (time.Duration, int, int)
- func (l *Global) VerbosityLevel() int
- func (l *Global) WaitAllWorkProcessesStop(timeout ...time.Duration) bool
- type IndexedStateReader
- type Logging
- type Metrics
- type NodeGlobal
- type NodeInfo
- type StartStop
- type StateIndexReader
- type StateReader
- type StateStore
- type StateStoreReader
- type TraceTx
- type TxBytesGet
- type TxBytesPersist
- type TxBytesStore
Constants ¶
View Source
const ( MultiStateDBName = "proximadb" TxStoreDBName = "proximadb.txstore" ConfigKeyTxStoreType = "txstore.type" // MaxSyncPortionSlots max number of slots in the sync portion MaxSyncPortionSlots = 100 // DefaultSyncToleranceThresholdSlots specifies threshold of diff between current slot and latest slot in DB // when start pulling sync portions DefaultSyncToleranceThresholdSlots = 50 )
View Source
const ( PullRepeatPeriodDefault = 2 * time.Second PullMaxAttemptsDefault = 60 PullFromNumPeersDefault = 2 )
PullTimeout maximum time allowed for the virtual txid become transaction (full vertex)
View Source
const TimeLayoutDefault = "01-02 15:04:05.000"
View Source
const TraceTag = "global"
View Source
const (
Version = "v0.1.2-alpha"
)
Version is the version of the Proxima node
Variables ¶
View Source
var ( FractionHalf = Fraction{ Numerator: 1, Denominator: 2, } Fraction23 = Fraction{ Numerator: 2, Denominator: 3, } FractionHealthyBranch = FractionHalf ErrInterrupted = errors.New("interrupted by global stop") )
Functions ¶
func BannerString ¶
func BannerString() string
func IsHealthyCoverage ¶
IsHealthyCoverage coverage is healthy if it is bigger than 2 times the fraction of supply
func IsHealthyCoverageString ¶
Types ¶
type Global ¶
type Global struct { *zap.SugaredLogger // contains filtered or unexported fields }
func NewDefault ¶
func NewDefault() *Global
func NewFromConfig ¶
func NewFromConfig() *Global
func (*Global) AssertMustError ¶
func (*Global) AssertNoError ¶
func (*Global) AttachmentFinished ¶
func (*Global) ClockCatchUpWithLedgerTime ¶
func (*Global) DecCounter ¶
func (*Global) IncCounter ¶
func (*Global) InfofAtLevel ¶
func (*Global) IsBootstrapMode ¶
func (*Global) IsShuttingDown ¶
func (*Global) Log ¶
func (l *Global) Log() *zap.SugaredLogger
func (*Global) MarkWorkProcessStarted ¶
func (*Global) MarkWorkProcessStopped ¶
func (*Global) MetricsRegistry ¶
func (l *Global) MetricsRegistry() *prometheus.Registry
func (*Global) RepeatInBackground ¶
func (*Global) StartTracingTags ¶
func (*Global) StartTracingTx ¶
func (l *Global) StartTracingTx(txid ledger.TransactionID)
func (*Global) StopTracingTag ¶
func (*Global) StopTracingTx ¶
func (l *Global) StopTracingTx(txid ledger.TransactionID)
func (*Global) TraceTx ¶
func (l *Global) TraceTx(txid *ledger.TransactionID, format string, args ...any)
func (*Global) TraceTxEnable ¶
func (l *Global) TraceTxEnable()
func (*Global) VerbosityLevel ¶
type IndexedStateReader ¶
type IndexedStateReader interface { StateReader StateIndexReader }
IndexedStateReader state and indexer readers packing together
type Logging ¶
type Logging interface { Log() *zap.SugaredLogger Tracef(tag string, format string, args ...any) TraceTxEnable() TraceTx(txid *ledger.TransactionID, format string, args ...any) // Assertf asserts only if global shutdown wasn't issued Assertf(cond bool, format string, args ...any) AssertNoError(err error, prefix ...string) VerbosityLevel() int Infof0(template string, args ...any) Infof1(template string, args ...any) Infof2(template string, args ...any) IncCounter(name string) DecCounter(nane string) Counter(name string) int CounterLines(prefix ...string) *lines.Lines AttachmentFinished(started ...time.Time) // TxPullParameters repeat after period, max attempts, num peers TxPullParameters() (time.Duration, int, int) }
type Metrics ¶
type Metrics interface {
MetricsRegistry() *prometheus.Registry
}
type NodeGlobal ¶
type NodeInfo ¶
type NodeInfo struct { ID peer.ID `json:"id"` Version string `json:"version"` NumStaticAlive uint16 `json:"num_static_peers"` NumDynamicAlive uint16 `json:"num_dynamic_alive"` Sequencer *ledger.ChainID `json:"sequencers,omitempty"` }
func NodeInfoFromBytes ¶
type StartStop ¶
type StartStop interface { Ctx() context.Context // global context of the node. Canceling means stopping the node Stop() IsShuttingDown() bool ClockCatchUpWithLedgerTime(ts ledger.Time) MarkWorkProcessStarted(name string) MarkWorkProcessStopped(name string) RepeatInBackground(name string, period time.Duration, fun func() bool, skipFirst ...bool) // runs background goroutine }
StartStop interface of the global objects which coordinates graceful shutdown
type StateIndexReader ¶
type StateIndexReader interface { // GetIDsLockedInAccount TODO limit maximum number of output GetIDsLockedInAccount(addr ledger.AccountID) ([]ledger.OutputID, error) // GetUTXOsLockedInAccount TODO limit maximum number of output GetUTXOsLockedInAccount(accountID ledger.AccountID) ([]*ledger.OutputDataWithID, error) GetUTXOForChainID(id *ledger.ChainID) (*ledger.OutputDataWithID, error) Root() common.VCommitment MustLedgerIdentityBytes() []byte // either state identity consistent or panic }
type StateReader ¶
type StateStore ¶
type StateStore interface { StateStoreReader common.BatchedUpdatable }
type StateStoreReader ¶
type StateStoreReader interface { common.KVReader common.Traversable IsClosed() bool }
type TraceTx ¶
type TraceTx interface { StartTracingTx(txid ledger.TransactionID) StopTracingTx(txid ledger.TransactionID) StartTracingTags(tags ...string) StopTracingTag(string) }
type TxBytesGet ¶
type TxBytesGet interface { // GetTxBytesWithMetadata return empty slice on absence, otherwise returns concatenated metadata bytes and transaction bytes GetTxBytesWithMetadata(id *ledger.TransactionID) []byte HasTxBytes(txid *ledger.TransactionID) bool }
type TxBytesPersist ¶
type TxBytesPersist interface { // PersistTxBytesWithMetadata saves txBytes prefixed with metadata bytes. // metadata == nil is interpreted as empty metadata (one 0 byte as prefix) PersistTxBytesWithMetadata(txBytes []byte, metadata *txmetadata.TransactionMetadata) (ledger.TransactionID, error) }
type TxBytesStore ¶
type TxBytesStore interface { TxBytesGet TxBytesPersist }
Click to show internal directories.
Click to hide internal directories.