etl

package
v0.0.0-...-fd63c1f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONITOR_DISABLE = true
	MONITOR_KEEP    = false
)
View Source
const (
	StateDBName = "state.db"
)

Variables

View Source
var (
	// errNoChainTip is an error that indicates a requested entry does
	// not exist in the database.
	ErrNoChainTip = errors.New("chain tip not found")

	// ErrNoTable is an error that indicates a requested table does
	// not exist in the database.
	ErrNoTable = errors.New("no such table")

	// ErrNoIndex is an error that indicates a requested indexer does
	// not exist.
	ErrNoIndex = errors.New("no such index")

	// ErrNoDb is an error that indicates a requested database does
	// not exist in the database.
	ErrNoDb = errors.New("no such database")

	// ErrNoData is an error that indicates a requested map or cache does
	// not exist.
	ErrNoData = errors.New("no data")
)
View Source
var (
	ErrGapDetected   = errors.New("block gap detected")
	ErrReorgDetected = errors.New("block reorg detected")
)
View Source
var (
	MinLogInterval time.Duration = 10 * time.Second
)

log is a logger that is initialized with no output filters. This means the package will not perform any logging by default until the caller requests it.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func NeedsBabylonUpgradeAccount

func NeedsBabylonUpgradeAccount(a *model.Account, p *rpc.Params) bool

func NeedsBabylonUpgradeContract

func NeedsBabylonUpgradeContract(c *model.Contract, p *rpc.Params) bool

upgrade smart contracts from before babylon - patch code and storage - only applies to mainnet contracts originated before babylon - don't upgrade when query height < babylon to return old params/storage format

func UpgradeToBabylon

func UpgradeToBabylon(c *model.Contract, p *rpc.Params, a *model.Account) error

func UpgradeToBabylonAccount

func UpgradeToBabylonAccount(a *model.Account, p *rpc.Params)

func UseLogger

func UseLogger(logger logpkg.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using logpkg.

Types

type BlockProgressLogger

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

BlockProgressLogger provides periodic logging for other services in order to show users progress of certain "actions" involving some or all current blocks. Ex: syncing to best chain, indexing all blocks, etc.

func NewBlockProgressLogger

func NewBlockProgressLogger(msg string) *BlockProgressLogger

NewBlockProgressLogger returns a new block progress logger.

func (*BlockProgressLogger) LogBlockHeight

func (b *BlockProgressLogger) LogBlockHeight(block *model.Block, qlen int, state State, d time.Duration, flush bool)

LogBlockHeight logs a new block height as an information message to show progress to the user. In order to prevent spam, it limits logging to one message every 10 seconds with duration and totals included.

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(idx *Indexer, c *rpc.Client, validate bool) *Builder

func (*Builder) AccountByAddress

func (b *Builder) AccountByAddress(addr tezos.Address) (*model.Account, bool)

func (*Builder) AccountById

func (b *Builder) AccountById(id model.AccountID) (*model.Account, bool)

func (*Builder) Accounts

func (b *Builder) Accounts() map[model.AccountID]*model.Account

func (*Builder) ActivateBaker

func (b *Builder) ActivateBaker(bkr *model.Baker)

func (*Builder) AppendActivationOp

func (b *Builder) AppendActivationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendAirdropOp

func (b *Builder) AppendAirdropOp(ctx context.Context, acc *model.Account, amount int64, p int) error

func (*Builder) AppendBallotOp

func (b *Builder) AppendBallotOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

this is a generic op only, details are in governance table

func (*Builder) AppendBigmapMigrationOp

func (b *Builder) AppendBigmapMigrationOp(ctx context.Context, acc *model.Account, c *model.Contract, p int, events micheline.BigmapEvents) error

func (*Builder) AppendContractMigrationOp

func (b *Builder) AppendContractMigrationOp(ctx context.Context, acc *model.Account, c *model.Contract, p int) error

func (*Builder) AppendDelegationOp

func (b *Builder) AppendDelegationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

Notes - manager operation, extends grace period - delegations may or may not pay a fee, so BalanceUpdates may be empty - early delegations did neither pay nor consume gas - status is either `applied` or `failed` - failed delegations may still pay fees, but don't consume gas - self-delegation (src == ndlg) represents a new/renewed baker registration - zero-delegation (ndlg == null) represents a delegation withdraw

Start conditions when building flows NewBaker OldBaker ----------------------------------------------------------------------- 1. new baker registration w/ fresh acc - - 1. new baker registration w/ delegated acc - x 2. baker re-registration self self 3. new delegation x - 4. redelegation x y 5. failed redelegation x x 6. delegation withdrawal - x 7. failed delegation withdrawal - -

func (*Builder) AppendDepositsLimitOp

func (b *Builder) AppendDepositsLimitOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendDoubleBakingOp

func (b *Builder) AppendDoubleBakingOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendDoubleEndorsingOp

func (b *Builder) AppendDoubleEndorsingOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendDrainDelegateOp

func (b *Builder) AppendDrainDelegateOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendEndorsementOp

func (b *Builder) AppendEndorsementOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendFinalizeUnstakeOp

func (b *Builder) AppendFinalizeUnstakeOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendImplicitBlockOps

func (b *Builder) AppendImplicitBlockOps(ctx context.Context) error

generate synthetic ops from block implicit ops (Granada+) Originations (on migration) Transactions / Subsidy

func (*Builder) AppendImplicitEvents

func (b *Builder) AppendImplicitEvents(ctx context.Context) error

generate synthetic ops from flows for OpTypeInvoice OpTypeBake OpTypeUnfreeze OpTypeSeedSlash OpTypeBonus - reward to Ithaca proposer when <> baker OpTypeDeposit - Ithaca deposit event OpTypeReward - Ithaca endorsing reward

func (*Builder) AppendImplicitUnstakeOp

func (b *Builder) AppendImplicitUnstakeOp(ctx context.Context, src *model.Account, bkr *model.Baker, flows []*model.Flow, id model.OpRef, rollback bool) error

Implicit unstake can happen as part of (internal) re-delegations. We can only detect this by looking at flows, so we're re-using the already populated delegation op and decoded flows here.

func (*Builder) AppendInternalDelegationOp

func (b *Builder) AppendInternalDelegationOp(
	ctx context.Context,
	origsrc *model.Account,
	origbkr *model.Baker,
	oh *rpc.Operation,
	iop rpc.InternalResult,
	id model.OpRef,
	rollback bool) error

func (*Builder) AppendInternalOriginationOp

func (b *Builder) AppendInternalOriginationOp(
	ctx context.Context,
	origsrc *model.Account,
	origbkr *model.Baker,
	oh *rpc.Operation,
	iop rpc.InternalResult,
	id model.OpRef,
	rollback bool) error

func (*Builder) AppendInternalTransactionOp

func (b *Builder) AppendInternalTransactionOp(
	ctx context.Context,
	origsrc *model.Account,
	origbkr *model.Baker,
	oh *rpc.Operation,
	iop rpc.InternalResult,
	id model.OpRef,
	rollback bool) error

func (*Builder) AppendInvoiceOp

func (b *Builder) AppendInvoiceOp(ctx context.Context, acc *model.Account, amount int64, p int) error

func (*Builder) AppendMagicBakerRegistrationOp

func (b *Builder) AppendMagicBakerRegistrationOp(ctx context.Context, bkr *model.Baker, p int) error

func (*Builder) AppendNormalTransactionOp

func (b *Builder) AppendNormalTransactionOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendOriginationOp

func (b *Builder) AppendOriginationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

NOTE: does not extend grace period although it's a manager operation - burns a fee (optional, not used early on) - can delegate funds - only originated accounts (KT1) can delegate - only implicit accounts (tz1) can be delegates - by default originated accounts are not delegatable (but initial delegate can be set)

func (*Builder) AppendProposalOp

func (b *Builder) AppendProposalOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

this is a generic op only, details are in governance table

func (*Builder) AppendRegisterConstantOp

func (b *Builder) AppendRegisterConstantOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendRegularBlockOps

func (b *Builder) AppendRegularBlockOps(ctx context.Context, rollback bool) error

func (*Builder) AppendRevealOp

func (b *Builder) AppendRevealOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

manager operation, extends grace period

func (*Builder) AppendRollupOriginationOp

func (b *Builder) AppendRollupOriginationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendRollupTransactionOp

func (b *Builder) AppendRollupTransactionOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendSeedNonceOp

func (b *Builder) AppendSeedNonceOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendSetDelegateParametersOp

func (b *Builder) AppendSetDelegateParametersOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendSmartRollupOriginationOp

func (b *Builder) AppendSmartRollupOriginationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendSmartRollupTransactionOp

func (b *Builder) AppendSmartRollupTransactionOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendStakeOp

func (b *Builder) AppendStakeOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendStorageLimitOp

func (b *Builder) AppendStorageLimitOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendTransactionOp

func (b *Builder) AppendTransactionOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

can implicitly burn a fee when new account is created NOTE: this seems to not extend grace period

func (*Builder) AppendTransferTicketOp

func (b *Builder) AppendTransferTicketOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendTxRollupOriginationOp

func (b *Builder) AppendTxRollupOriginationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendTxRollupTransactionOp

func (b *Builder) AppendTxRollupTransactionOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendUnstakeOp

func (b *Builder) AppendUnstakeOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendUpdateConsensusKeyOp

func (b *Builder) AppendUpdateConsensusKeyOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AppendVdfRevelationOp

func (b *Builder) AppendVdfRevelationOp(ctx context.Context, oh *rpc.Operation, id model.OpRef, rollback bool) error

func (*Builder) AuditAccountDatabase

func (b *Builder) AuditAccountDatabase(ctx context.Context, nofail bool) error

func (*Builder) AuditState

func (b *Builder) AuditState(ctx context.Context, offset int64) error

func (*Builder) BakerByAddress

func (b *Builder) BakerByAddress(addr tezos.Address) (*model.Baker, bool)

func (*Builder) BakerById

func (b *Builder) BakerById(id model.AccountID) (*model.Baker, bool)

func (*Builder) Bakers

func (b *Builder) Bakers() map[model.AccountID]*model.Baker

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, tz *rpc.Bundle) (*model.Block, error)

func (*Builder) BuildGenesisBlock

func (b *Builder) BuildGenesisBlock(ctx context.Context) (*model.Block, error)

func (*Builder) BuildReorg

func (b *Builder) BuildReorg(ctx context.Context, tz *rpc.Bundle, parent *model.Block) (*model.Block, error)

during reorg rpc and model blocks are already loaded, parent data is ignored

func (*Builder) CacheStats

func (b *Builder) CacheStats() map[string]interface{}

func (*Builder) Clean

func (b *Builder) Clean()

func (*Builder) CleanReorg

func (b *Builder) CleanReorg()

func (*Builder) ClearCache

func (b *Builder) ClearCache()

func (*Builder) Constants

func (b *Builder) Constants() micheline.ConstantDict

func (*Builder) ContractById

func (b *Builder) ContractById(id model.AccountID) (*model.Contract, bool)

func (*Builder) Contracts

func (b *Builder) Contracts() map[model.AccountID]*model.Contract

func (*Builder) DeactivateBaker

func (b *Builder) DeactivateBaker(bkr *model.Baker)

func (*Builder) Decorate

func (b *Builder) Decorate(ctx context.Context, rollback bool) error

func (*Builder) DumpState

func (b *Builder) DumpState()

func (*Builder) FixOriginationBug

func (b *Builder) FixOriginationBug(ctx context.Context, params *rpc.Params) error

v002 fixed an 'origination bug'

Changelog published on Slack at 20-07-2018 15:45:31 (block 26,579 cycle 6) https://log.tezos.link/index.php?date=20-07-2018

  • Fixed a bug in delegations, where contracts could delegate to unregistered delegates. This will be enforced from now on, and the existing unregistered delegates will be automatically registered (except for two empty addresses).

Note: we register self-delegation on origination bakers right away, but track them explicitly (account.baker_id == 0 and account.is_baker = true). During migration we check if an active delegation exists and upgrade status to full baker.

Correctly registered bakers (via self delegation) are not affected since their baker_id is set.

func (*Builder) FixOxfordMigration

func (b *Builder) FixOxfordMigration(ctx context.Context) error

temp fix for light-mode migration issue

func (*Builder) Init

func (b *Builder) Init(ctx context.Context, tip *model.ChainTip, c *rpc.Client) error

func (*Builder) InitAccounts

func (b *Builder) InitAccounts(ctx context.Context) error

func (*Builder) IsLightMode

func (b *Builder) IsLightMode() bool

func (*Builder) LoadAccountByAccountId

func (b *Builder) LoadAccountByAccountId(ctx context.Context, id model.AccountID) (*model.Account, error)

func (*Builder) LoadAccountByAddress

func (b *Builder) LoadAccountByAddress(ctx context.Context, addr tezos.Address) (*model.Account, error)

func (*Builder) LoadConstants

func (b *Builder) LoadConstants(ctx context.Context) error

func (*Builder) LoadContractByAccountId

func (b *Builder) LoadContractByAccountId(ctx context.Context, id model.AccountID) (*model.Contract, error)

func (*Builder) LoadOfflineRightsHolders

func (b *Builder) LoadOfflineRightsHolders(ctx context.Context) error

func (*Builder) MigrateAdaptiveIssuance

func (b *Builder) MigrateAdaptiveIssuance(ctx context.Context, params *rpc.Params) error

func (*Builder) MigrateAthens

func (b *Builder) MigrateAthens(ctx context.Context, oldparams, params *rpc.Params) error

insert invoice

func (*Builder) MigrateBabylon

func (b *Builder) MigrateBabylon(ctx context.Context, oldparams, nextparams *rpc.Params) error

func (*Builder) MigrateCarthage

func (b *Builder) MigrateCarthage(ctx context.Context, oldparams, params *rpc.Params) error

func (*Builder) MigrateGranada

func (b *Builder) MigrateGranada(ctx context.Context, oldparams, params *rpc.Params) error

func (*Builder) MigrateIthaca

func (b *Builder) MigrateIthaca(ctx context.Context, oldparams, params *rpc.Params) error

func (*Builder) MigrateLima

func (b *Builder) MigrateLima(ctx context.Context, oldparams, params *rpc.Params) error

func (*Builder) MigrateMumbai

func (b *Builder) MigrateMumbai(ctx context.Context, oldparams, params *rpc.Params) error

func (*Builder) MigrateOxford

func (b *Builder) MigrateOxford(ctx context.Context, oldparams, params *rpc.Params) error

func (*Builder) MigrateProtocol

func (b *Builder) MigrateProtocol(ctx context.Context, prevparams, nextparams *rpc.Params) error

func (*Builder) NewActivationFlow

func (b *Builder) NewActivationFlow(acc *model.Account, aop *rpc.Activation, id model.OpRef) []*model.Flow

func (*Builder) NewAirdropFlow

func (b *Builder) NewAirdropFlow(acc *model.Account, amount int64, id model.OpRef) *model.Flow

func (*Builder) NewConstantRegistrationFlows

func (b *Builder) NewConstantRegistrationFlows(
	src *model.Account,
	srcbkr *model.Baker,
	fees, bal rpc.BalanceUpdates,
	id model.OpRef) []*model.Flow

func (*Builder) NewDelegationFlows

func (b *Builder) NewDelegationFlows(src *model.Account, newbkr, oldbkr *model.Baker, fees, upd rpc.BalanceUpdates, id model.OpRef) []*model.Flow

used for internal an non-internal delegations

func (*Builder) NewDrainDelegateFlows

func (b *Builder) NewDrainDelegateFlows(src, dst *model.Account, dbkr *model.Baker, bal rpc.BalanceUpdates, id model.OpRef) (int64, int64, []*model.Flow)

- sends amount from drained baker to destination - sends tip from drained baker to block producer - pays no fee - create delegation flow for destination baker

func (*Builder) NewEndorserFlows

func (b *Builder) NewEndorserFlows(acc *model.Account, bal rpc.BalanceUpdates, id model.OpRef) []*model.Flow

Note: during chain bootstrap there used to be blocks without rewards and no balance updates were issued to endorsers

Note: Ithaca+ balance updates are empty since deposit/reward is paid before cycle start (technically at cycle end)

func (*Builder) NewFeeFlows

func (b *Builder) NewFeeFlows(src *model.Account, fees rpc.BalanceUpdates, id model.OpRef) ([]*model.Flow, int64)

Fees for manager operations (optional, i.e. sender may set to zero, for batch ops fees may also be paid by any op in batch)

func (*Builder) NewFinalizeUnstakeFlows

func (b *Builder) NewFinalizeUnstakeFlows(src *model.Account, bkr, auxbkr *model.Baker, fees, upd rpc.BalanceUpdates, id model.OpRef) []*model.Flow

func (*Builder) NewImplicitFlows

func (b *Builder) NewImplicitFlows() []*model.Flow

pre-Ithaca - baker pays deposit and receives block rewards+fees - on last block in cycle, deposits, rewards and fees from cycle-N are unfrozen

post-Ithaca - baker reward is paid directly (to proposer and bonus to baker) - baker fee is paid directly via accumulator - all bakers pay deposit at migration and at end of cycle - endorsing reward is minted and paid at end of cycle or burned for low participation

post-Oxford - each reward flow may be split into two flows (4 balance updates), one for the baker and another for the staker pool - only bake reward, bake bonus and endorse reward are shared with stakers

func (*Builder) NewIncreasePaidStorageFlows

func (b *Builder) NewIncreasePaidStorageFlows(
	src *model.Account,
	srcbkr *model.Baker,
	fees, bal rpc.BalanceUpdates,
	id model.OpRef) []*model.Flow

func (*Builder) NewInternalOriginationFlows

func (b *Builder) NewInternalOriginationFlows(
	origsrc, src, dst *model.Account,
	origbkr, srcbkr, newbkr *model.Baker,
	bal rpc.BalanceUpdates,
	id model.OpRef) []*model.Flow

func (*Builder) NewInternalTransactionFlows

func (b *Builder) NewInternalTransactionFlows(
	origsrc, src, dst *model.Account,
	origbkr, srcbkr, dstbkr *model.Baker,
	srccon, dstcon *model.Contract,
	bal rpc.BalanceUpdates,
	block *model.Block,
	id model.OpRef,
) []*model.Flow

fees are already paid by outer tx burn is attributed to outer source

func (*Builder) NewInvoiceFlow

func (b *Builder) NewInvoiceFlow(acc *model.Account, amount int64, id model.OpRef) *model.Flow

func (*Builder) NewOriginationFlows

func (b *Builder) NewOriginationFlows(
	src, dst *model.Account,
	srcbkr, newbkr *model.Baker,
	fees, bal rpc.BalanceUpdates,
	id model.OpRef) []*model.Flow

func (*Builder) NewPenaltyFlows

func (b *Builder) NewPenaltyFlows(accuser, offender *model.Baker, bal rpc.BalanceUpdates, id model.OpRef) []*model.Flow

works for double-bake, double-endorse, double-preendorse oxford+ penalty ops do not slash anymore

func (*Builder) NewRevealFlows

func (b *Builder) NewRevealFlows(src *model.Account, bkr *model.Baker, fees rpc.BalanceUpdates, id model.OpRef) []*model.Flow

func (*Builder) NewRollupOriginationFlows

func (b *Builder) NewRollupOriginationFlows(
	src, dst *model.Account,
	srcbkr *model.Baker,
	fees, bal rpc.BalanceUpdates,
	id model.OpRef) []*model.Flow

func (*Builder) NewRollupTransactionFlows

func (b *Builder) NewRollupTransactionFlows(
	src, dst, loser, winner, recv *model.Account,
	sbkr, lbkr, wbkr *model.Baker,
	fees, bal rpc.BalanceUpdates,
	block *model.Block,
	id model.OpRef) []*model.Flow

func (*Builder) NewSeedNonceFlows

func (b *Builder) NewSeedNonceFlows(bal rpc.BalanceUpdates, id model.OpRef) []*model.Flow

injected by the baker only

func (*Builder) NewSetDepositsLimitFlows

func (b *Builder) NewSetDepositsLimitFlows(src *model.Account, fees rpc.BalanceUpdates, id model.OpRef) []*model.Flow

sent by baker, so no delegation update required post-Ithaca only op, so no pre-Ithaca fee handling

func (*Builder) NewStakeFlows

func (b *Builder) NewStakeFlows(src *model.Account, bkr *model.Baker, fees, upd rpc.BalanceUpdates, id model.OpRef) []*model.Flow

func (*Builder) NewSubsidyFlow

func (b *Builder) NewSubsidyFlow(acc *model.Account, amount int64, id model.OpRef) *model.Flow

func (*Builder) NewTransactionFlows

func (b *Builder) NewTransactionFlows(
	src, dst *model.Account,
	sbkr, dbkr *model.Baker,
	srccon, dstcon *model.Contract,
	fees, bal rpc.BalanceUpdates,
	block *model.Block,
	id model.OpRef) []*model.Flow

func (*Builder) NewTransferTicketFlows

func (b *Builder) NewTransferTicketFlows(
	src *model.Account,
	sbkr *model.Baker,
	fees, bal rpc.BalanceUpdates,
	block *model.Block,
	id model.OpRef) []*model.Flow

func (*Builder) NewUnstakeFlows

func (b *Builder) NewUnstakeFlows(src *model.Account, bkr *model.Baker, fees, upd rpc.BalanceUpdates, id model.OpRef) []*model.Flow

func (*Builder) NewUpdateConsensusKeyFlows

func (b *Builder) NewUpdateConsensusKeyFlows(src *model.Account, fees rpc.BalanceUpdates, id model.OpRef) []*model.Flow

only fees are paid

func (*Builder) OnDeactivate

func (b *Builder) OnDeactivate(ctx context.Context, rollback bool) error

func (*Builder) OnUpgrade

func (b *Builder) OnUpgrade(ctx context.Context, rollback bool) error

func (*Builder) Params

func (b *Builder) Params(height int64) *rpc.Params

func (*Builder) PatchBigmapEvents

func (b *Builder) PatchBigmapEvents(ctx context.Context, diff micheline.BigmapEvents, addr tezos.Address, script *micheline.Script) (micheline.BigmapEvents, error)

Pre-Babylon Bigmaps do not have a bigmap id in alloc.

big_map_diffs in proto < v005 lack id and action. Also allocs are not explicit. In order to satisfy further processing logic we patch in an alloc when we see a new contract using a bigmap. Contracts before v005 can only own a single bigmap which makes life a bit easier. Note: on zeronet big_map is a regular map due to protocol bug

func (*Builder) Purge

func (b *Builder) Purge()

remove state on error

func (*Builder) RebuildFutureRightsAndIncome

func (b *Builder) RebuildFutureRightsAndIncome(ctx context.Context, params *rpc.Params) error

func (*Builder) RebuildIthacaSnapshotsRightsAndIncome

func (b *Builder) RebuildIthacaSnapshotsRightsAndIncome(ctx context.Context, params *rpc.Params) error

func (*Builder) RegisterBaker

func (b *Builder) RegisterBaker(acc *model.Account, enable bool) *model.Baker

func (*Builder) RollbackStats

func (b *Builder) RollbackStats(ctx context.Context) error

func (*Builder) RunBabylonAirdrop

func (b *Builder) RunBabylonAirdrop(ctx context.Context, params *rpc.Params) (int, error)

v005 airdrops 1 mutez to unfunded manager accounts to avoid origination burn

func (*Builder) RunBabylonUpgrade

func (b *Builder) RunBabylonUpgrade(ctx context.Context, params *rpc.Params, n int) error

func (*Builder) Sched

func (b *Builder) Sched() *task.Scheduler

func (*Builder) Table

func (b *Builder) Table(key string) (*pack.Table, error)

func (*Builder) UnregisterBaker

func (b *Builder) UnregisterBaker(baker *model.Baker)

only called from rollback and bug fix code

func (*Builder) UpdateStats

func (b *Builder) UpdateStats(ctx context.Context) error

update counters, totals and sums from flows and ops

type Crawler

type Crawler struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Crawler loads blocks from blockchain client via RPC and informs indexers to connect/disconnect blocks when chaintip changes. It also handles chain reorganizations and API calls.

func NewCrawler

func NewCrawler(cfg CrawlerConfig) *Crawler

func (*Crawler) BlockByHeight

func (c *Crawler) BlockByHeight(ctx context.Context, height int64) (*model.Block, error)

func (*Crawler) BlockHeightFromTime

func (c *Crawler) BlockHeightFromTime(ctx context.Context, tm time.Time) int64

func (*Crawler) CacheStats

func (c *Crawler) CacheStats() map[string]interface{}

func (*Crawler) ChainByHeight

func (c *Crawler) ChainByHeight(ctx context.Context, height int64) (*model.Chain, error)

func (*Crawler) Height

func (c *Crawler) Height() int64

func (*Crawler) Init

func (c *Crawler) Init(ctx context.Context, mode Mode) error

Init is invoked when the block manager is first initializing.

func (*Crawler) IsDegraded

func (c *Crawler) IsDegraded() bool

func (*Crawler) IsHealthy

func (c *Crawler) IsHealthy() bool

func (*Crawler) MaybeSnapshot

func (c *Crawler) MaybeSnapshot(ctx context.Context) error

func (*Crawler) NextBlockTime

func (c *Crawler) NextBlockTime() time.Time

func (*Crawler) Params

func (c *Crawler) Params() *rpc.Params

func (*Crawler) ParamsByCycle

func (c *Crawler) ParamsByCycle(cycle int64) *rpc.Params

func (*Crawler) ParamsByHeight

func (c *Crawler) ParamsByHeight(height int64) *rpc.Params

func (*Crawler) ParamsByProtocol

func (c *Crawler) ParamsByProtocol(proto tezos.ProtocolHash) *rpc.Params

func (*Crawler) Rollback

func (c *Crawler) Rollback(ctx context.Context, height int64, ignoreErrors bool) error

func (*Crawler) SnapshotRequest

func (c *Crawler) SnapshotRequest(ctx context.Context) error

func (*Crawler) Start

func (c *Crawler) Start()

run goroutine

func (*Crawler) Status

func (c *Crawler) Status() CrawlerStatus

func (*Crawler) Stop

func (c *Crawler) Stop(ctx context.Context)

close quit channel

func (*Crawler) SupplyByHeight

func (c *Crawler) SupplyByHeight(ctx context.Context, height int64) (*model.Supply, error)

func (*Crawler) Table

func (c *Crawler) Table(key string) (*pack.Table, error)

func (*Crawler) Time

func (c *Crawler) Time() time.Time

func (*Crawler) Tip

func (c *Crawler) Tip() *model.ChainTip

type CrawlerConfig

type CrawlerConfig struct {
	DB            store.DB
	Indexer       *Indexer
	Client        *rpc.Client
	Queue         int
	Delay         int
	StopBlock     int64
	Snapshot      *SnapshotConfig
	EnableMonitor bool
	Validate      bool
}

type CrawlerStatus

type CrawlerStatus struct {
	Mode       Mode      `json:"mode"`
	Status     State     `json:"status"`
	Blocks     int64     `json:"blocks"`
	Finalized  int64     `json:"finalized"`
	Indexed    int64     `json:"indexed"`
	Progress   float64   `json:"progress"`
	LastUpdate time.Time `json:"last_update"`
	// contains filtered or unexported fields
}

func (CrawlerStatus) Expires

func (s CrawlerStatus) Expires() time.Time

func (CrawlerStatus) LastModified

func (s CrawlerStatus) LastModified() time.Time

type Growth

type Growth struct {
	NewAccounts     int64
	NewContracts    int64
	ClearedAccounts int64
	FundedAccounts  int64
}

type IndexTip

type IndexTip struct {
	Hash   *tezos.BlockHash `json:"hash,omitempty"`
	Height int64            `json:"height"`
}

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

Indexer defines an index manager that manages and stores multiple indexes.

func NewIndexer

func NewIndexer(cfg IndexerConfig) *Indexer

func (*Indexer) BakerPerformance

func (m *Indexer) BakerPerformance(ctx context.Context, id model.AccountID, fromCycle, toCycle int64) ([3]int64, error)

luck, performance, contribution (reliability)

func (*Indexer) BestHeight

func (m *Indexer) BestHeight() int64

func (*Indexer) BlockByHash

func (m *Indexer) BlockByHash(ctx context.Context, h tezos.BlockHash, from, to int64) (*model.Block, error)

func (*Indexer) BlockByHeight

func (m *Indexer) BlockByHeight(ctx context.Context, height int64) (*model.Block, error)

func (*Indexer) BlockByID

func (m *Indexer) BlockByID(ctx context.Context, id uint64) (*model.Block, error)

func (*Indexer) BlockByParentId

func (m *Indexer) BlockByParentId(ctx context.Context, id uint64) (*model.Block, error)

find a block's canonical successor (non-orphan)

func (*Indexer) BlockHashByHeight

func (m *Indexer) BlockHashByHeight(ctx context.Context, height int64) (tezos.BlockHash, error)

func (*Indexer) BlockHashById

func (m *Indexer) BlockHashById(ctx context.Context, id uint64) (tezos.BlockHash, error)

func (*Indexer) CacheStats

func (m *Indexer) CacheStats() map[string]interface{}

func (*Indexer) ChainByHeight

func (m *Indexer) ChainByHeight(ctx context.Context, height int64) (*model.Chain, error)

func (*Indexer) Close

func (m *Indexer) Close() error

func (*Indexer) ConnectBlock

func (m *Indexer) ConnectBlock(ctx context.Context, block *model.Block, builder model.BlockBuilder) error

func (*Indexer) ConnectProtocol

func (m *Indexer) ConnectProtocol(ctx context.Context, next, prev *rpc.Params) error

func (*Indexer) CycleByNum

func (m *Indexer) CycleByNum(ctx context.Context, num int64) (*model.Cycle, error)

func (*Indexer) DeleteBlock

func (m *Indexer) DeleteBlock(ctx context.Context, tz *rpc.Bundle) error

func (*Indexer) DisconnectBlock

func (m *Indexer) DisconnectBlock(ctx context.Context, block *model.Block, builder model.BlockBuilder, ignoreErrors bool) error

func (*Indexer) ElectionByHeight

func (m *Indexer) ElectionByHeight(ctx context.Context, height int64) (*model.Election, error)

func (*Indexer) ElectionById

func (m *Indexer) ElectionById(ctx context.Context, id model.ElectionID) (*model.Election, error)

func (*Indexer) Finalize

func (m *Indexer) Finalize(ctx context.Context) error

func (*Indexer) FindActivatedAccount

func (m *Indexer) FindActivatedAccount(ctx context.Context, addr tezos.Address) (*model.Account, error)

func (*Indexer) FindLastCall

func (m *Indexer) FindLastCall(ctx context.Context, acc model.AccountID, from, to int64) (*model.Op, error)

func (*Indexer) FindLatestDelegation

func (m *Indexer) FindLatestDelegation(ctx context.Context, id model.AccountID, height int64) (*model.Op, error)

func (*Indexer) FindLatestFinalizeUnstake

func (m *Indexer) FindLatestFinalizeUnstake(ctx context.Context, id model.AccountID, height int64) (*model.Op, error)

func (*Indexer) FindLatestUnstake

func (m *Indexer) FindLatestUnstake(ctx context.Context, id model.AccountID, height int64) (*model.Op, error)

func (*Indexer) FindOrigination

func (m *Indexer) FindOrigination(ctx context.Context, id model.AccountID, height int64) (*model.Op, error)

func (*Indexer) FindPreviousStorage

func (m *Indexer) FindPreviousStorage(ctx context.Context, id model.AccountID, since, until int64) (*model.Storage, error)

func (*Indexer) Flush

func (m *Indexer) Flush(ctx context.Context) error

func (*Indexer) FlushJournals

func (m *Indexer) FlushJournals(ctx context.Context) error

func (*Indexer) GC

func (m *Indexer) GC(ctx context.Context, ratio float64) error

func (*Indexer) GrowthByDuration

func (m *Indexer) GrowthByDuration(ctx context.Context, to time.Time, d time.Duration) (*Growth, error)

func (*Indexer) Index

func (m *Indexer) Index(key string) (model.BlockIndexer, error)

func (*Indexer) Init

func (m *Indexer) Init(ctx context.Context, tip *model.ChainTip, mode Mode) error

func (*Indexer) IsLightMode

func (m *Indexer) IsLightMode() bool

func (*Indexer) ListAccountOps

func (m *Indexer) ListAccountOps(ctx context.Context, r ListRequest) ([]*model.Op, error)

Note: - order is defined by funding or spending operation - offset and limit counts in atomar ops - high traffic addresses may have many, so we use query limits

func (*Indexer) ListAccountOpsCollapsed

func (m *Indexer) ListAccountOpsCollapsed(ctx context.Context, r ListRequest) ([]*model.Op, error)

Note: - order is defined by funding or spending operation - offset and limit counts in collapsed ops (all batch/internal contents) - high traffic addresses may have many, so we use query limits

func (*Indexer) ListBakerEndorsements

func (m *Indexer) ListBakerEndorsements(ctx context.Context, r ListRequest) ([]*model.Op, error)

func (*Indexer) ListBakers

func (m *Indexer) ListBakers(ctx context.Context, activeOnly bool) ([]*model.Baker, error)

func (*Indexer) ListBallots

func (m *Indexer) ListBallots(ctx context.Context, r ListRequest) ([]*model.Ballot, error)

func (*Indexer) ListBigmapKeys

func (m *Indexer) ListBigmapKeys(ctx context.Context, r ListRequest) ([]*model.BigmapValue, error)

func (*Indexer) ListBigmapUpdates

func (m *Indexer) ListBigmapUpdates(ctx context.Context, r ListRequest) ([]model.BigmapUpdate, error)

func (*Indexer) ListBlockEndorsements

func (m *Indexer) ListBlockEndorsements(ctx context.Context, r ListRequest) ([]*model.Endorsement, error)

func (*Indexer) ListBlockOps

func (m *Indexer) ListBlockOps(ctx context.Context, r ListRequest) ([]*model.Op, error)

Note: offset and limit count in atomar operations

func (*Indexer) ListBlockRights

func (m *Indexer) ListBlockRights(ctx context.Context, height int64, typ tezos.RightType) ([]model.BaseRight, error)

func (*Indexer) ListContractBigmaps

func (m *Indexer) ListContractBigmaps(ctx context.Context, acc model.AccountID, height int64) ([]*model.BigmapAlloc, error)

func (*Indexer) ListContractCalls

func (m *Indexer) ListContractCalls(ctx context.Context, r ListRequest) ([]*model.Op, error)

func (*Indexer) ListContracts

func (m *Indexer) ListContracts(ctx context.Context, r ListRequest) ([]*model.Contract, error)

func (*Indexer) ListFrozenUnstakeRequests

func (m *Indexer) ListFrozenUnstakeRequests(ctx context.Context, baker model.AccountID, cycle int64, p *rpc.Params) ([]*model.Op, error)

ListFrozenUnstakeRequests is used to identify slashable unstake requests.

func (*Indexer) ListHistoricBigmapKeys

func (m *Indexer) ListHistoricBigmapKeys(ctx context.Context, r ListRequest) ([]*model.BigmapValue, error)

func (*Indexer) ListOpEvents

func (m *Indexer) ListOpEvents(ctx context.Context, id uint64, sndr model.AccountID) ([]*model.Event, error)

id is the external op id (not row_id)!

func (*Indexer) ListVoters

func (m *Indexer) ListVoters(ctx context.Context, r ListRequest) ([]*model.Voter, error)

r.Since is the true vote start block

func (*Indexer) LookupAccount

func (m *Indexer) LookupAccount(ctx context.Context, addr tezos.Address) (*model.Account, error)

func (*Indexer) LookupAccountById

func (m *Indexer) LookupAccountById(ctx context.Context, id model.AccountID) (*model.Account, error)

func (*Indexer) LookupAccountId

func (m *Indexer) LookupAccountId(ctx context.Context, addr tezos.Address) (model.AccountID, error)

func (*Indexer) LookupAccountsById

func (m *Indexer) LookupAccountsById(ctx context.Context, ids []uint64) ([]*model.Account, error)

func (*Indexer) LookupAddress

func (m *Indexer) LookupAddress(ctx context.Context, id model.AccountID) tezos.Address

func (*Indexer) LookupBaker

func (m *Indexer) LookupBaker(ctx context.Context, addr tezos.Address) (*model.Baker, error)

func (*Indexer) LookupBakerId

func (m *Indexer) LookupBakerId(ctx context.Context, id model.AccountID) (*model.Baker, error)

func (*Indexer) LookupBigmapAlloc

func (m *Indexer) LookupBigmapAlloc(ctx context.Context, id int64) (*model.BigmapAlloc, error)

always read fresh data with updated counters

func (*Indexer) LookupBigmapType

func (m *Indexer) LookupBigmapType(ctx context.Context, id int64) (*model.BigmapAlloc, error)

only type info is relevant

func (*Indexer) LookupBlock

func (m *Indexer) LookupBlock(ctx context.Context, blockIdent string) (*model.Block, error)

func (*Indexer) LookupBlockHash

func (m *Indexer) LookupBlockHash(ctx context.Context, height int64) tezos.BlockHash

called concurrently from API consumers, uses read-mostly cache

func (*Indexer) LookupBlockHeightFromTime

func (m *Indexer) LookupBlockHeightFromTime(ctx context.Context, tm time.Time) int64

called concurrently from API consumers, uses read-mostly cache

func (*Indexer) LookupBlockId

func (m *Indexer) LookupBlockId(ctx context.Context, blockIdent string) (tezos.BlockHash, int64, error)

func (*Indexer) LookupBlockTime

func (m *Indexer) LookupBlockTime(ctx context.Context, height int64) time.Time

called concurrently from API consumers, uses read-mostly cache

func (*Indexer) LookupBlockTimeMs

func (m *Indexer) LookupBlockTimeMs(ctx context.Context, height int64) int64

called concurrently from API consumers, uses read-mostly cache

func (*Indexer) LookupBlockTimePtr

func (m *Indexer) LookupBlockTimePtr(ctx context.Context, height int64) *time.Time

called concurrently from API consumers, uses read-mostly cache

func (*Indexer) LookupConstant

func (m *Indexer) LookupConstant(ctx context.Context, hash tezos.ExprHash) (*model.Constant, error)

func (*Indexer) LookupContract

func (m *Indexer) LookupContract(ctx context.Context, addr tezos.Address) (*model.Contract, error)

func (*Indexer) LookupContractId

func (m *Indexer) LookupContractId(ctx context.Context, id model.AccountID) (*model.Contract, error)

func (*Indexer) LookupContractType

func (m *Indexer) LookupContractType(ctx context.Context, id model.AccountID) (micheline.Type, micheline.Type, uint64, error)

func (*Indexer) LookupEndorsement

func (m *Indexer) LookupEndorsement(ctx context.Context, opIdent string) ([]*model.Op, error)

func (*Indexer) LookupLastBakedBlock

func (m *Indexer) LookupLastBakedBlock(ctx context.Context, bkr *model.Baker, height int64) (int64, error)

func (*Indexer) LookupLastEndorsedBlock

func (m *Indexer) LookupLastEndorsedBlock(ctx context.Context, bkr *model.Baker, height int64) (int64, error)

func (*Indexer) LookupOp

func (m *Indexer) LookupOp(ctx context.Context, opIdent string, r ListRequest) ([]*model.Op, error)

func (*Indexer) LookupOpHash

func (m *Indexer) LookupOpHash(ctx context.Context, opid model.OpID) tezos.OpHash

func (*Indexer) LookupOpIds

func (m *Indexer) LookupOpIds(ctx context.Context, ids []uint64) ([]*model.Op, error)

these are row_id's (!)

func (*Indexer) LookupProposal

func (m *Indexer) LookupProposal(ctx context.Context, proto tezos.ProtocolHash) (*model.Proposal, error)

func (*Indexer) LookupProposalHash

func (m *Indexer) LookupProposalHash(ctx context.Context, id model.ProposalID) tezos.ProtocolHash

called concurrently from API consumers, uses read-mostly cache

func (*Indexer) LookupProposalIds

func (m *Indexer) LookupProposalIds(ctx context.Context, ids []uint64) ([]*model.Proposal, error)

func (*Indexer) LookupRanking

func (m *Indexer) LookupRanking(ctx context.Context, id model.AccountID) (*model.AccountRank, bool)

func (*Indexer) LookupStorage

func (m *Indexer) LookupStorage(ctx context.Context, id model.AccountID, h uint64, since, until int64) (*model.Storage, error)

func (*Indexer) LookupTicket

func (m *Indexer) LookupTicket(ctx context.Context, id model.TicketID) (*model.Ticket, error)

func (*Indexer) NextRights

func (m *Indexer) NextRights(ctx context.Context, a model.AccountID, height int64) (int64, int64)

func (*Indexer) OnTaskComplete

func (m *Indexer) OnTaskComplete(ctx context.Context, res *task.TaskResult) error

func (*Indexer) ParamsByCycle

func (m *Indexer) ParamsByCycle(cycle int64) *rpc.Params

func (*Indexer) ParamsByDeployment

func (m *Indexer) ParamsByDeployment(v int) (*rpc.Params, error)

func (*Indexer) ParamsByHeight

func (m *Indexer) ParamsByHeight(height int64) *rpc.Params

func (*Indexer) ParamsByProtocol

func (m *Indexer) ParamsByProtocol(proto tezos.ProtocolHash) (*rpc.Params, error)

func (*Indexer) ProposalsByElection

func (m *Indexer) ProposalsByElection(ctx context.Context, id model.ElectionID) ([]*model.Proposal, error)

func (*Indexer) PurgeCaches

func (m *Indexer) PurgeCaches()

func (*Indexer) Sched

func (m *Indexer) Sched() *task.Scheduler

func (*Indexer) SumUnfrozenUnstake

func (m *Indexer) SumUnfrozenUnstake(ctx context.Context, id model.AccountID, height, cycle int64, p *rpc.Params) (int64, error)

SumUnfrozenUnstake is used to reconcile finalize unstake amounts with unstake requests in order to identify slashing losses.

func (*Indexer) SupplyByHeight

func (m *Indexer) SupplyByHeight(ctx context.Context, height int64) (*model.Supply, error)

func (*Indexer) SupplyByTime

func (m *Indexer) SupplyByTime(ctx context.Context, t time.Time) (*model.Supply, error)

func (*Indexer) Table

func (m *Indexer) Table(key string) (*pack.Table, error)

func (*Indexer) TableStats

func (m *Indexer) TableStats() []pack.TableStats

func (*Indexer) TopRich

func (m *Indexer) TopRich(ctx context.Context, n, o int) ([]*model.AccountRank, error)

func (*Indexer) TopTraffic

func (m *Indexer) TopTraffic(ctx context.Context, n, o int) ([]*model.AccountRank, error)

func (*Indexer) TopVolume

func (m *Indexer) TopVolume(ctx context.Context, n, o int) ([]*model.AccountRank, error)

func (*Indexer) VotesByElection

func (m *Indexer) VotesByElection(ctx context.Context, id model.ElectionID) ([]*model.Vote, error)

type IndexerConfig

type IndexerConfig struct {
	DBPath    string
	DBOpts    interface{}
	StateDB   store.DB
	Indexes   []model.BlockIndexer
	LightMode bool
}

type ListRequest

type ListRequest struct {
	Account     *model.Account
	Mode        pack.FilterMode
	Typs        model.OpTypeList
	Since       int64
	Until       int64
	Offset      uint
	Limit       uint
	Cursor      uint64
	Order       pack.OrderType
	SenderId    model.AccountID
	ReceiverId  model.AccountID
	Entrypoints []int64
	Period      int64
	BigmapId    int64
	BigmapKey   tezos.ExprHash
	OpId        model.OpID
	WithStorage bool
}

func (ListRequest) WithDelegation

func (r ListRequest) WithDelegation() bool

type Mode

type Mode string
const (
	MODE_SYNC     Mode = "sync"
	MODE_INFO     Mode = "info"
	MODE_LIGHT    Mode = "light"
	MODE_ROLLBACK Mode = "rollback"
)

type Registry

type Registry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) GetAllParams

func (r *Registry) GetAllParams() []*rpc.Params

func (*Registry) GetParams

func (r *Registry) GetParams(h tezos.ProtocolHash) (*rpc.Params, error)

func (*Registry) GetParamsByCycle

func (r *Registry) GetParamsByCycle(cycle int64) *rpc.Params

func (*Registry) GetParamsByDeployment

func (r *Registry) GetParamsByDeployment(v int) (*rpc.Params, error)

func (*Registry) GetParamsByHeight

func (r *Registry) GetParamsByHeight(height int64) *rpc.Params

func (*Registry) GetParamsLatest

func (r *Registry) GetParamsLatest() *rpc.Params

func (*Registry) Register

func (r *Registry) Register(p *rpc.Params)

Register registers network parameters for a Tezos network.

type ReorgDelayFilter

type ReorgDelayFilter struct {
	// contains filtered or unexported fields
}

func NewReorgDelayFilter

func NewReorgDelayFilter(depth int, out chan<- *rpc.Bundle) *ReorgDelayFilter

func (ReorgDelayFilter) Depth

func (f ReorgDelayFilter) Depth() int

func (ReorgDelayFilter) Head

func (f ReorgDelayFilter) Head() *rpc.Bundle

func (*ReorgDelayFilter) Push

func (f *ReorgDelayFilter) Push(ctx context.Context, b *rpc.Bundle, quit <-chan struct{}) error

func (*ReorgDelayFilter) Reset

func (f *ReorgDelayFilter) Reset()

func (ReorgDelayFilter) Tail

func (f ReorgDelayFilter) Tail() *rpc.Bundle

type ReportTip

type ReportTip struct {
	LastReportTime time.Time `json:"last_time"` // day of last report generation
}

type SnapshotConfig

type SnapshotConfig struct {
	Path          string
	Blocks        []int64
	BlockInterval int64
}

type State

type State string
const (
	STATE_LOADING       State = "loading"    // index init in progress
	STATE_CONNECTING    State = "connecting" // RPC disconnected
	STATE_STOPPING      State = "stopping"   // shutting down
	STATE_STOPPED       State = "stopped"    // auto-sync disabled, serving stale blockchain state
	STATE_WAITING       State = "waiting"    // ready to sync, but RPC server is not ready
	STATE_SYNCHRONIZING State = "syncing"    // sync in progress
	STATE_SYNCHRONIZED  State = "synced"     // in sync with blockchain
	STATE_FAILED        State = "failed"     // sync stopped due to index error
	STATE_STALLED       State = "stalled"    // temporary state when no new block in 1 min
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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