Documentation ¶
Index ¶
- func BeginTransaction(ctx context.Context, tx storage.Transactable) (models.Transaction, error)
- type Action
- func (a *Action) ByAddress(ctx context.Context, addressId uint64, filters storage.AddressActionsFilter) (actions []storage.AddressAction, err error)
- func (a *Action) ByBlock(ctx context.Context, height types.Level, limit, offset int) (actions []storage.ActionWithTx, err error)
- func (a *Action) ByRollup(ctx context.Context, rollupId uint64, limit, offset int, sort sdk.SortOrder) (actions []storage.RollupAction, err error)
- func (a *Action) ByRollupAndBridge(ctx context.Context, rollupId uint64, ...) (actions []storage.ActionWithTx, err error)
- func (a *Action) ByTxId(ctx context.Context, txId uint64, limit, offset int) (actions []storage.Action, err error)
- type Address
- type BlockSignature
- type BlockStats
- type Blocks
- func (b *Blocks) ByHash(ctx context.Context, hash []byte) (block storage.Block, err error)
- func (b *Blocks) ByHeight(ctx context.Context, height types.Level, withStats bool) (block storage.Block, err error)
- func (b *Blocks) ByIdWithRelations(ctx context.Context, id uint64) (block storage.Block, err error)
- func (b *Blocks) ByProposer(ctx context.Context, proposerId uint64, limit, offset int, order sdk.SortOrder) (blocks []storage.Block, err error)
- func (b *Blocks) Last(ctx context.Context) (block storage.Block, err error)
- func (b *Blocks) ListWithStats(ctx context.Context, limit, offset uint64, order sdk.SortOrder) (blocks []*storage.Block, err error)
- type Bridge
- func (b *Bridge) ByAddress(ctx context.Context, addressId uint64) (bridge storage.Bridge, err error)
- func (b *Bridge) ByRoles(ctx context.Context, addressId uint64, limit, offset int) (result []storage.Bridge, err error)
- func (b *Bridge) ByRollup(ctx context.Context, rollupId uint64, limit, offset int) (bridge []storage.Bridge, err error)
- type Constant
- func (constant *Constant) All(ctx context.Context) (c []storage.Constant, err error)
- func (constant *Constant) ByModule(ctx context.Context, module types.ModuleName) (c []storage.Constant, err error)
- func (constant *Constant) Get(ctx context.Context, module types.ModuleName, name string) (c storage.Constant, err error)
- func (constant *Constant) IsNoRows(err error) bool
- type Fee
- type Notificator
- type Rollup
- func (r *Rollup) ActionsByHeight(ctx context.Context, height types.Level, limit, offset int) (actions []storage.RollupAction, err error)
- func (r *Rollup) ActionsByTxId(ctx context.Context, txId uint64, limit, offset int) (actions []storage.RollupAction, err error)
- func (r *Rollup) Addresses(ctx context.Context, rollupId uint64, limit, offset int, sort sdk.SortOrder) (addresses []storage.RollupAddress, err error)
- func (r *Rollup) ByHash(ctx context.Context, hash []byte) (rollup storage.Rollup, err error)
- func (r *Rollup) CountActionsByHeight(ctx context.Context, height types.Level) (int64, error)
- func (r *Rollup) CountActionsByTxId(ctx context.Context, txId uint64) (int64, error)
- func (r *Rollup) ListExt(ctx context.Context, fltrs storage.RollupListFilter) (rollups []storage.Rollup, err error)
- func (r *Rollup) ListRollupsByAddress(ctx context.Context, addressId uint64, limit, offset int, sort sdk.SortOrder) (addresses []storage.RollupAddress, err error)
- type Search
- type SentryHook
- type State
- type Stats
- func (s Stats) RollupSeries(ctx context.Context, rollupId uint64, timeframe storage.Timeframe, name string, ...) (response []storage.SeriesItem, err error)
- func (s Stats) Series(ctx context.Context, timeframe storage.Timeframe, name string, ...) (response []storage.SeriesItem, err error)
- func (s Stats) Summary(ctx context.Context) (summary storage.NetworkSummary, err error)
- func (s Stats) SummaryTimeframe(ctx context.Context, timeframe storage.Timeframe) (summary storage.NetworkSummaryWithChange, err error)
- type Storage
- type Transaction
- func (tx Transaction) GetProposerId(ctx context.Context, address string) (id uint64, err error)
- func (tx Transaction) GetRollup(ctx context.Context, rollupId []byte) (rollup models.Rollup, err error)
- func (tx Transaction) LastBlock(ctx context.Context) (block models.Block, err error)
- func (tx Transaction) LastNonce(ctx context.Context, id uint64) (uint32, error)
- func (tx Transaction) RetentionBlockSignatures(ctx context.Context, height types.Level) error
- func (tx Transaction) RollbackActions(ctx context.Context, height types.Level) (actions []models.Action, err error)
- func (tx Transaction) RollbackAddressActions(ctx context.Context, height types.Level) (addrActions []models.AddressAction, err error)
- func (tx Transaction) RollbackAddresses(ctx context.Context, height types.Level) (address []models.Address, err error)
- func (tx Transaction) RollbackBalanceUpdates(ctx context.Context, height types.Level) (updates []models.BalanceUpdate, err error)
- func (tx Transaction) RollbackBalances(ctx context.Context, ids []uint64) error
- func (tx Transaction) RollbackBlock(ctx context.Context, height types.Level) error
- func (tx Transaction) RollbackBlockSignatures(ctx context.Context, height types.Level) (err error)
- func (tx Transaction) RollbackBlockStats(ctx context.Context, height types.Level) (stats models.BlockStats, err error)
- func (tx Transaction) RollbackBridges(ctx context.Context, height types.Level) (err error)
- func (tx Transaction) RollbackFees(ctx context.Context, height types.Level) (err error)
- func (tx Transaction) RollbackRollupActions(ctx context.Context, height types.Level) (rActions []models.RollupAction, err error)
- func (tx Transaction) RollbackRollupAddresses(ctx context.Context, height types.Level) (err error)
- func (tx Transaction) RollbackRollups(ctx context.Context, height types.Level) (rollups []models.Rollup, err error)
- func (tx Transaction) RollbackTxs(ctx context.Context, height types.Level) (txs []models.Tx, err error)
- func (tx Transaction) RollbackValidators(ctx context.Context, height types.Level) (err error)
- func (tx Transaction) SaveActions(ctx context.Context, actions ...*models.Action) error
- func (tx Transaction) SaveAddressActions(ctx context.Context, actions ...*models.AddressAction) error
- func (tx Transaction) SaveAddresses(ctx context.Context, addresses ...*models.Address) (int64, error)
- func (tx Transaction) SaveBalanceUpdates(ctx context.Context, updates ...models.BalanceUpdate) error
- func (tx Transaction) SaveBalances(ctx context.Context, balances ...models.Balance) error
- func (tx Transaction) SaveBlockSignatures(ctx context.Context, signs ...models.BlockSignature) error
- func (tx Transaction) SaveBridges(ctx context.Context, bridges ...*models.Bridge) error
- func (tx Transaction) SaveConstants(ctx context.Context, constants ...models.Constant) error
- func (tx Transaction) SaveFees(ctx context.Context, fees ...*models.Fee) error
- func (tx Transaction) SaveRollupActions(ctx context.Context, actions ...*models.RollupAction) error
- func (tx Transaction) SaveRollupAddresses(ctx context.Context, addresses ...*models.RollupAddress) error
- func (tx Transaction) SaveRollups(ctx context.Context, rollups ...*models.Rollup) (int64, error)
- func (tx Transaction) SaveTransactions(ctx context.Context, txs ...*models.Tx) error
- func (tx Transaction) SaveValidators(ctx context.Context, validators ...*models.Validator) error
- func (tx Transaction) State(ctx context.Context, name string) (state models.State, err error)
- func (tx Transaction) UpdateAddresses(ctx context.Context, addresses ...*models.Address) error
- func (tx Transaction) UpdateConstants(ctx context.Context, constants ...*models.Constant) error
- func (tx Transaction) UpdateRollups(ctx context.Context, rollups ...*models.Rollup) error
- func (tx Transaction) UpdateValidators(ctx context.Context, validators ...*models.Validator) error
- func (tx Transaction) Validators(ctx context.Context) (validators []models.Validator, err error)
- type Tx
- func (tx *Tx) ByAddress(ctx context.Context, addressId uint64, fltrs storage.TxFilter) (txs []storage.Tx, err error)
- func (tx *Tx) ByHash(ctx context.Context, hash []byte) (transaction storage.Tx, err error)
- func (tx *Tx) ByHeight(ctx context.Context, height types.Level, limit, offset int) (txs []storage.Tx, err error)
- func (tx *Tx) Filter(ctx context.Context, fltrs storage.TxFilter) (txs []storage.Tx, err error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginTransaction ¶
func BeginTransaction(ctx context.Context, tx storage.Transactable) (models.Transaction, error)
Types ¶
type Action ¶
Action -
func (*Action) ByAddress ¶
func (a *Action) ByAddress(ctx context.Context, addressId uint64, filters storage.AddressActionsFilter) (actions []storage.AddressAction, err error)
func (*Action) ByRollupAndBridge ¶
func (a *Action) ByRollupAndBridge(ctx context.Context, rollupId uint64, fltrs storage.RollupAndBridgeActionsFilter) (actions []storage.ActionWithTx, err error)
type BlockSignature ¶
type BlockSignature struct { *postgres.Table[*storage.BlockSignature] }
BlockSignature -
func NewBlockSignature ¶
func NewBlockSignature(db *database.Bun) *BlockSignature
NewBlockSignature -
type BlockStats ¶
type BlockStats struct {
// contains filtered or unexported fields
}
BlockStats -
func (*BlockStats) ByHeight ¶
func (b *BlockStats) ByHeight(ctx context.Context, height types.Level) (stats storage.BlockStats, err error)
ByHeight -
type Blocks ¶
Blocks -
func (*Blocks) ByHeight ¶
func (b *Blocks) ByHeight(ctx context.Context, height types.Level, withStats bool) (block storage.Block, err error)
ByHeight -
func (*Blocks) ByIdWithRelations ¶
func (*Blocks) ByProposer ¶
type Constant ¶
type Constant struct {
// contains filtered or unexported fields
}
Constant -
type Notificator ¶
type Notificator struct {
// contains filtered or unexported fields
}
func NewNotificator ¶
func NewNotificator(cfg config.Database, db *bun.DB) *Notificator
func (*Notificator) Close ¶
func (n *Notificator) Close() error
func (*Notificator) Listen ¶
func (n *Notificator) Listen() chan *pq.Notification
type Rollup ¶
Rollup -
func (*Rollup) ActionsByHeight ¶
func (*Rollup) ActionsByTxId ¶
func (*Rollup) CountActionsByHeight ¶
func (*Rollup) CountActionsByTxId ¶
type SentryHook ¶
type SentryHook struct {
// contains filtered or unexported fields
}
func NewSentryHook ¶
func NewSentryHook(dbName string, tracer trace.Tracer, formatQueries bool) *SentryHook
func (*SentryHook) AfterQuery ¶
func (h *SentryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*SentryHook) BeforeQuery ¶
func (h *SentryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context
func (*SentryHook) Init ¶
func (h *SentryHook) Init(db *bun.DB)
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func (Stats) RollupSeries ¶
func (Stats) SummaryTimeframe ¶
type Storage ¶
type Storage struct { *postgres.Storage Blocks models.IBlock BlockStats models.IBlockStats Bridges models.IBridge Constants models.IConstant Tx models.ITx Fee models.IFee Action models.IAction Address models.IAddress Rollup models.IRollup BlockSignatures models.IBlockSignature Validator models.IValidator State models.IState Search models.ISearch Stats models.IStats Notificator *Notificator // contains filtered or unexported fields }
Storage -
func (Storage) CreateListener ¶
func (Storage) SetTracer ¶
func (s Storage) SetTracer(tp trace.TracerProvider)
type Transaction ¶
type Transaction struct {
storage.Transaction
}
func (Transaction) GetProposerId ¶
func (Transaction) RetentionBlockSignatures ¶
func (Transaction) RollbackActions ¶
func (Transaction) RollbackAddressActions ¶
func (tx Transaction) RollbackAddressActions(ctx context.Context, height types.Level) (addrActions []models.AddressAction, err error)
func (Transaction) RollbackAddresses ¶
func (Transaction) RollbackBalanceUpdates ¶
func (tx Transaction) RollbackBalanceUpdates(ctx context.Context, height types.Level) (updates []models.BalanceUpdate, err error)
func (Transaction) RollbackBalances ¶
func (tx Transaction) RollbackBalances(ctx context.Context, ids []uint64) error
func (Transaction) RollbackBlock ¶
func (Transaction) RollbackBlockSignatures ¶
func (Transaction) RollbackBlockStats ¶
func (tx Transaction) RollbackBlockStats(ctx context.Context, height types.Level) (stats models.BlockStats, err error)
func (Transaction) RollbackBridges ¶
func (Transaction) RollbackFees ¶
func (Transaction) RollbackRollupActions ¶
func (tx Transaction) RollbackRollupActions(ctx context.Context, height types.Level) (rActions []models.RollupAction, err error)
func (Transaction) RollbackRollupAddresses ¶
func (Transaction) RollbackRollups ¶
func (Transaction) RollbackTxs ¶
func (Transaction) RollbackValidators ¶
func (Transaction) SaveActions ¶
func (Transaction) SaveAddressActions ¶
func (tx Transaction) SaveAddressActions(ctx context.Context, actions ...*models.AddressAction) error
func (Transaction) SaveAddresses ¶
func (Transaction) SaveBalanceUpdates ¶
func (tx Transaction) SaveBalanceUpdates(ctx context.Context, updates ...models.BalanceUpdate) error
func (Transaction) SaveBalances ¶
func (Transaction) SaveBlockSignatures ¶
func (tx Transaction) SaveBlockSignatures(ctx context.Context, signs ...models.BlockSignature) error
func (Transaction) SaveBridges ¶
func (Transaction) SaveConstants ¶
func (Transaction) SaveRollupActions ¶
func (tx Transaction) SaveRollupActions(ctx context.Context, actions ...*models.RollupAction) error
func (Transaction) SaveRollupAddresses ¶
func (tx Transaction) SaveRollupAddresses(ctx context.Context, addresses ...*models.RollupAddress) error
func (Transaction) SaveRollups ¶
func (Transaction) SaveTransactions ¶
func (Transaction) SaveValidators ¶
func (Transaction) UpdateAddresses ¶
func (Transaction) UpdateConstants ¶
func (Transaction) UpdateRollups ¶
func (Transaction) UpdateValidators ¶
func (Transaction) Validators ¶
Click to show internal directories.
Click to hide internal directories.