Documentation
¶
Index ¶
- func BeginTransaction(ctx context.Context, tx storage.Transactable) (models.Transaction, error)
- func Create(ctx context.Context, cfg config.Database, scriptsDir string, ...) (*postgres.Storage, 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 App
- func (app *App) ByRollupId(ctx context.Context, rollupId uint64) (result storage.AppWithStats, err error)
- func (app *App) BySlug(ctx context.Context, slug string) (result storage.AppWithStats, err error)
- func (app *App) Leaderboard(ctx context.Context, fltrs storage.LeaderboardFilters) (rollups []storage.AppWithStats, err error)
- type Asset
- 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) ById(ctx context.Context, id 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)
- func (b *Bridge) ListWithAddress(ctx context.Context, limit, offset int) (result []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 Deposit
- type Fee
- func (f *Fee) ByPayerId(ctx context.Context, id uint64, limit, offset int, sort sdk.SortOrder) (fees []storage.Fee, err error)
- func (f *Fee) ByTxId(ctx context.Context, id uint64, limit, offset int) (fees []storage.Fee, err error)
- func (f *Fee) FullTxFee(ctx context.Context, id uint64) (fees []storage.Fee, err error)
- type ListenerFactory
- type Notificator
- type Price
- func (p *Price) All(ctx context.Context, limit, offset int) (prices []storage.Price, err error)
- func (p *Price) Last(ctx context.Context, currencyPair string) (price storage.Price, err error)
- func (p *Price) Series(ctx context.Context, currencyPair string, timeframe storage.Timeframe) (prices []storage.Candle, err error)
- 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) ActiveAddressesCount(ctx context.Context) (val int64, err error)
- func (s Stats) FeeSummary(ctx context.Context) (response []storage.FeeSummary, err error)
- 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)
- func (s Stats) TokenTransferDistribution(ctx context.Context, limit int) (items []storage.TokenTransferDistributionItem, err error)
- type Transaction
- func (tx Transaction) DeleteApp(ctx context.Context, appId uint64) error
- func (tx Transaction) GetAddressId(ctx context.Context, hash string) (addrId uint64, err error)
- func (tx Transaction) GetBridgeIdByAddressId(ctx context.Context, id uint64) (bridgeId uint64, err error)
- 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) RefreshLeaderboard(ctx context.Context) 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) (int, error)
- func (tx Transaction) RollbackDeposits(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) RollbackTransfers(ctx context.Context, height types.Level) (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) SaveApp(ctx context.Context, app *models.App) 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) (int64, error)
- func (tx Transaction) SaveConstants(ctx context.Context, constants ...models.Constant) error
- func (tx Transaction) SaveDeposits(ctx context.Context, deposits ...*models.Deposit) error
- func (tx Transaction) SaveFees(ctx context.Context, fees ...*models.Fee) error
- func (tx Transaction) SavePrices(ctx context.Context, prices ...models.Price) 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) SaveTransfers(ctx context.Context, transfers ...*models.Transfer) 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) UpdateApp(ctx context.Context, app *models.App) 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) Validators(ctx context.Context) (validators []models.Validator, err error)
- type Transfer
- 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 App ¶ added in v1.2.0
App -
func (*App) ByRollupId ¶ added in v1.3.0
func (*App) Leaderboard ¶ added in v1.2.0
func (app *App) Leaderboard(ctx context.Context, fltrs storage.LeaderboardFilters) (rollups []storage.AppWithStats, err error)
type BlockSignature ¶
type BlockSignature struct { *postgres.Table[*storage.BlockSignature] }
BlockSignature -
func NewBlockSignature ¶
func NewBlockSignature(db *postgres.Storage) *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 Bridge ¶
Bridge -
type Constant ¶
type Constant struct {
// contains filtered or unexported fields
}
Constant -
type ListenerFactory ¶ added in v1.4.0
type ListenerFactory struct {
// contains filtered or unexported fields
}
func NewListenerFactory ¶ added in v1.4.0
func NewListenerFactory(cfg config.Database, db *postgres.Storage) *ListenerFactory
func (*ListenerFactory) CreateListener ¶ added in v1.4.0
func (factory *ListenerFactory) CreateListener() storage.Listener
type Notificator ¶
type Notificator struct {
// contains filtered or unexported fields
}
func NewNotificator ¶
func NewNotificator(cfg config.Database, db *postgres.Storage) *Notificator
func (*Notificator) Close ¶
func (n *Notificator) Close() error
func (*Notificator) Listen ¶
func (n *Notificator) Listen() chan *pq.Notification
type Price ¶ added in v1.4.0
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) ActiveAddressesCount ¶ added in v1.1.0
func (Stats) FeeSummary ¶ added in v1.1.0
func (Stats) RollupSeries ¶
func (Stats) SummaryTimeframe ¶
func (Stats) TokenTransferDistribution ¶ added in v1.1.0
type Transaction ¶
type Transaction struct {
storage.Transaction
}
func (Transaction) DeleteApp ¶ added in v1.2.0
func (tx Transaction) DeleteApp(ctx context.Context, appId uint64) error
func (Transaction) GetAddressId ¶ added in v1.1.0
func (Transaction) GetBridgeIdByAddressId ¶ added in v1.1.0
func (Transaction) GetProposerId ¶
func (Transaction) RefreshLeaderboard ¶ added in v1.2.0
func (tx Transaction) RefreshLeaderboard(ctx context.Context) error
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) RollbackDeposits ¶ added in v1.1.0
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) RollbackTransfers ¶ added in v1.1.0
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) SaveDeposits ¶ added in v1.1.0
func (Transaction) SavePrices ¶ added in v1.4.0
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) SaveTransfers ¶ added in v1.1.0
func (Transaction) SaveValidators ¶
func (Transaction) UpdateAddresses ¶
func (Transaction) UpdateConstants ¶
func (Transaction) UpdateRollups ¶
func (Transaction) Validators ¶
Source Files
¶
- action.go
- address.go
- app.go
- asset.go
- block.go
- block_signature.go
- block_stats.go
- bridge.go
- constant.go
- core.go
- custom_types.go
- deposit.go
- fee.go
- index.go
- listener.go
- notificator.go
- price.go
- rollup.go
- scopes.go
- scripts.go
- search.go
- sentry_hook.go
- state.go
- stats.go
- transaction.go
- transfer.go
- tx.go
- validator.go
Click to show internal directories.
Click to hide internal directories.