Documentation ¶
Index ¶
- func Builder(cfg juno.Config, codec *params.EncodingConfig) (db.Database, error)
- type Db
- func (db *Db) GetAddresses() ([]string, error)
- func (db *Db) GetBlockHeightTimeDayAgo(now time.Time) (dbtypes.BlockRow, error)
- func (db *Db) GetBlockHeightTimeHourAgo(now time.Time) (dbtypes.BlockRow, error)
- func (db *Db) GetBlockHeightTimeMinuteAgo(now time.Time) (dbtypes.BlockRow, error)
- func (db *Db) GetGenesis() (*types.Genesis, error)
- func (db *Db) GetLastBlock() (*dbtypes.BlockRow, error)
- func (db *Db) GetLastBlockHeight() (int64, error)
- func (db *Db) GetTokenUnits() ([]types.TokenUnit, error)
- func (db *Db) IsStoreHistoricDataEnabled() bool
- func (db *Db) SaveAccounts(accounts []types.Account, height uint64) error
- func (db *Db) SaveAverageBlockTimeGenesis(blocktime types.BlockTime) error
- func (db *Db) SaveAverageBlockTimePerDay(blocktime types.BlockTime) error
- func (db *Db) SaveAverageBlockTimePerHour(blocktime types.BlockTime) error
- func (db *Db) SaveAverageBlockTimePerMin(blocktime types.BlockTime) error
- func (db *Db) SaveCurrentTable(currentTable types.CurrentTable) error
- func (db *Db) SaveCutPercentage(cutPercentage types.CutPercentage) error
- func (db *Db) SaveDelegatorAccounts(accounts []types.DelegatorAccount) error
- func (db *Db) SaveDelegatorInfo(delegatorInfo []types.DelegatorNodeInfo, height uint64) error
- func (db *Db) SaveGenesis(genesis *types.Genesis) error
- func (db *Db) SaveLockedAccount(accounts []types.LockedAccount) error
- func (db *Db) SaveLockedAccountBalance(accounts []types.LockedAccountBalance) error
- func (db *Db) SaveNodeInfosFromTable(nodeInfosFromTable []types.StakerNodeInfo, height uint64) error
- func (db *Db) SaveNodeTotalCommitment(nodeTotalCommitment []types.NodeTotalCommitment) error
- func (db *Db) SaveNodeTotalCommitmentWithoutDelegators(...) error
- func (db *Db) SaveNodeUnstakingTokens(nodeUnstakingTokens []types.NodeUnstakingTokens) error
- func (db *Db) SaveProposedTable(proposedTable types.ProposedTable) error
- func (db *Db) SaveStakeRequirements(stakeRequirements []types.StakeRequirements) error
- func (db *Db) SaveStakerNodeId(stakerNodeId []types.StakerNodeId) error
- func (db *Db) SaveStakingTable(stakingTable types.StakingTable) error
- func (db *Db) SaveSupply(supply uint64, height uint64) error
- func (db *Db) SaveToken(token types.Token) error
- func (db *Db) SaveTokenPricesHistory(prices []types.TokenPrice) error
- func (db *Db) SaveTokensPrices(prices []types.TokenPrice) error
- func (db *Db) SaveTotalStake(totalStake types.TotalStake) error
- func (db *Db) SaveTotalStakeByType(totalStake []types.TotalStakeByType) error
- func (db *Db) SaveWeeklyPayout(weeklyPayout types.WeeklyPayout) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Db ¶
type Db struct { *database.Database Sqlx *sqlx.DB PartitionSize int // contains filtered or unexported fields }
Db represents a PostgreSQL database with expanded features. so that it can properly store custom BigDipper-related data.
func (*Db) GetAddresses ¶
GetAccounts returns all the addresses that are currently stored inside the database.
func (*Db) GetBlockHeightTimeDayAgo ¶
GetBlockHeightTimeDayAgo return block height and time that a block proposals about a day (24hour) ago from input date
func (*Db) GetBlockHeightTimeHourAgo ¶
GetBlockHeightTimeHourAgo return block height and time that a block proposals about a hour ago from input date
func (*Db) GetBlockHeightTimeMinuteAgo ¶
GetBlockHeightTimeMinuteAgo return block height and time that a block proposals about a minute ago from input date
func (*Db) GetGenesis ¶
GetGenesis returns the genesis information stored inside the database
func (*Db) GetLastBlock ¶
GetLastBlock returns the last block stored inside the database based on the heights
func (*Db) GetLastBlockHeight ¶
GetLastBlockHeight returns the last block height stored inside the database
func (*Db) GetTokenUnits ¶
GetTokenUnits returns the slice of all the names of the different tokens units
func (*Db) IsStoreHistoricDataEnabled ¶
IsStoreHistoricDataEnabled tells whether or not the historical data should be stored inside the database
func (*Db) SaveAccounts ¶
SaveAccounts saves the given accounts inside the database
func (*Db) SaveAverageBlockTimeGenesis ¶
SaveAverageBlockTimeGenesis save the average block time in average_block_time_from_genesis table
func (*Db) SaveAverageBlockTimePerDay ¶
SaveAverageBlockTimePerDay save the average block time in average_block_time_per_day table
func (*Db) SaveAverageBlockTimePerHour ¶
SaveAverageBlockTimePerHour save the average block time in average_block_time_per_hour table
func (*Db) SaveAverageBlockTimePerMin ¶
SaveAverageBlockTimePerMin save the average block time in average_block_time_per_minute table
func (*Db) SaveCurrentTable ¶
func (db *Db) SaveCurrentTable(currentTable types.CurrentTable) error
func (*Db) SaveCutPercentage ¶
func (db *Db) SaveCutPercentage(cutPercentage types.CutPercentage) error
func (*Db) SaveDelegatorAccounts ¶
func (db *Db) SaveDelegatorAccounts(accounts []types.DelegatorAccount) error
func (*Db) SaveDelegatorInfo ¶
func (db *Db) SaveDelegatorInfo(delegatorInfo []types.DelegatorNodeInfo, height uint64) error
func (*Db) SaveGenesis ¶
SaveGenesis save the given genesis data
func (*Db) SaveLockedAccount ¶
func (db *Db) SaveLockedAccount(accounts []types.LockedAccount) error
func (*Db) SaveLockedAccountBalance ¶
func (db *Db) SaveLockedAccountBalance(accounts []types.LockedAccountBalance) error
func (*Db) SaveNodeInfosFromTable ¶
func (db *Db) SaveNodeInfosFromTable(nodeInfosFromTable []types.StakerNodeInfo, height uint64) error
func (*Db) SaveNodeTotalCommitment ¶
func (db *Db) SaveNodeTotalCommitment(nodeTotalCommitment []types.NodeTotalCommitment) error
func (*Db) SaveNodeTotalCommitmentWithoutDelegators ¶
func (db *Db) SaveNodeTotalCommitmentWithoutDelegators(nodeTotalCommitmentWithoutDelegators []types.NodeTotalCommitmentWithoutDelegators) error
func (*Db) SaveNodeUnstakingTokens ¶
func (db *Db) SaveNodeUnstakingTokens(nodeUnstakingTokens []types.NodeUnstakingTokens) error
func (*Db) SaveProposedTable ¶
func (db *Db) SaveProposedTable(proposedTable types.ProposedTable) error
func (*Db) SaveStakeRequirements ¶
func (db *Db) SaveStakeRequirements(stakeRequirements []types.StakeRequirements) error
SaveStakeRequirements save the stake requirement from cadence call
func (*Db) SaveStakerNodeId ¶
func (db *Db) SaveStakerNodeId(stakerNodeId []types.StakerNodeId) error
func (*Db) SaveStakingTable ¶
func (db *Db) SaveStakingTable(stakingTable types.StakingTable) error
func (*Db) SaveTokenPricesHistory ¶
func (db *Db) SaveTokenPricesHistory(prices []types.TokenPrice) error
SaveTokenPricesHistory stores the given prices as historic ones
func (*Db) SaveTokensPrices ¶
func (db *Db) SaveTokensPrices(prices []types.TokenPrice) error
SaveTokensPrices allows to save the given prices as the most updated ones
func (*Db) SaveTotalStake ¶
func (db *Db) SaveTotalStake(totalStake types.TotalStake) error
func (*Db) SaveTotalStakeByType ¶
func (db *Db) SaveTotalStakeByType(totalStake []types.TotalStakeByType) error
func (*Db) SaveWeeklyPayout ¶
func (db *Db) SaveWeeklyPayout(weeklyPayout types.WeeklyPayout) error