Documentation ¶
Index ¶
- Constants
- Variables
- func AddToCron(cron *gron.Cron, cfg config.Config, db *gorm.DB, ...)
- type Limiter
- type Provider
- type TezTracker
- func (t *TezTracker) AccountDelegatorsList(accountID string, limits Limiter) ([]models.Account, int64, error)
- func (t *TezTracker) AccountList(before string, limits Limiter) (accs []models.Account, count int64, err error)
- func (t *TezTracker) BakerList(limits Limiter) (bakers []models.Baker, count int64, err error)
- func (t *TezTracker) BakingRightsList(blockLevelOrHash []string, priorityTo int, limiter Limiter) (count int64, blocksWithRights []models.Block, err error)
- func (t *TezTracker) BlockList(beforeLevel uint64, limits Limiter) ([]models.Block, int64, error)
- func (t *TezTracker) BlocksInCycle() int64
- func (t *TezTracker) ContractList(before string, limits Limiter) (accs []models.Account, count int64, err error)
- func (t *TezTracker) FutureBakingRightsList(priorityTo int, limiter Limiter) (count int64, blocksWithRights []models.FutureBlockBakingRight, err error)
- func (t *TezTracker) GetAccount(id string) (acc models.Account, err error)
- func (t *TezTracker) GetBakerInfo(accountID string) (bi *models.BakerInfo, err error)
- func (t *TezTracker) GetBlockBakingRights(hashOrLevel string) (rights []models.FutureBakingRight, count int64, err error)
- func (t *TezTracker) GetBlockEndorsements(hashOrLevel string) (operations []models.Operation, count int64, err error)
- func (t *TezTracker) GetBlockWithOperationGroups(hashOrLevel string) (block models.Block, err error)
- func (t *TezTracker) GetCurrentCycle() (int64, error)
- func (t *TezTracker) GetDoubleBakings(ids, inBlocks []string, limits Limiter) (operations []models.DoubleBakingEvidence, count int64, err error)
- func (t *TezTracker) GetOperations(ids, kinds, inBlocks, accountIDs []string, limits Limiter, before int64) (operations []models.Operation, count int64, err error)
- func (t *TezTracker) GetStakingRatio() (float64, error)
- func (t *TezTracker) HeadBlock() (models.Block, error)
- func (t *TezTracker) Snapshots(limiter Limiter) (count int64, snapshots []models.Snapshot, err error)
Constants ¶
const ( PreservedCycles = 5 XTZ = 1000000 BlockSecurityDeposit = 512 * XTZ EndorsementSecurityDeposit = 64 * XTZ BlockReward = 16 * XTZ EndorsementReward = 2 * XTZ BlockEndorsers = 32 BlockLockEstimate = BlockReward + BlockSecurityDeposit + BlockEndorsers*(EndorsementReward+EndorsementSecurityDeposit) )
const BlocksInMainnetCycle = 4096
Variables ¶
var ErrNotFound = fmt.Errorf("not found")
ErrNotFound is an error returned when the requested entity doesn't exist in the repository.
Functions ¶
Types ¶
type Provider ¶
type Provider interface { GetBlock() block.Repo GetOperationGroup() operation_groups.Repo GetOperation() operation.Repo GetAccount() account.Repo GetBaker() baker.Repo GetFutureBakingRight() future_baking_rights.Repo GetSnapshots() snapshots.Repo GetDoubleBaking() double_baking.Repo }
Provider is the abstract interface to get any repository.
type TezTracker ¶
type TezTracker struct {
// contains filtered or unexported fields
}
TezTracker is the main service for tezos tracker. It has methods to process all the user's requests.
func New ¶
func New(rp Provider, net models.Network) *TezTracker
New creates a new TexTracker service using the repository provider.
func (*TezTracker) AccountDelegatorsList ¶
func (t *TezTracker) AccountDelegatorsList(accountID string, limits Limiter) ([]models.Account, int64, error)
AccountDelegatorsList retrives up to limit of delegators accounts for the specified accountID.
func (*TezTracker) AccountList ¶
func (t *TezTracker) AccountList(before string, limits Limiter) (accs []models.Account, count int64, err error)
AccountList retrives up to limit of account before the specified id.
func (*TezTracker) BakingRightsList ¶
func (*TezTracker) BlocksInCycle ¶
func (t *TezTracker) BlocksInCycle() int64
func (*TezTracker) ContractList ¶
func (t *TezTracker) ContractList(before string, limits Limiter) (accs []models.Account, count int64, err error)
ContractList retrives up to limit of contract before the specified id.
func (*TezTracker) FutureBakingRightsList ¶
func (t *TezTracker) FutureBakingRightsList(priorityTo int, limiter Limiter) (count int64, blocksWithRights []models.FutureBlockBakingRight, err error)
func (*TezTracker) GetAccount ¶
func (t *TezTracker) GetAccount(id string) (acc models.Account, err error)
GetAccount retrieves an account by its ID.
func (*TezTracker) GetBakerInfo ¶
func (t *TezTracker) GetBakerInfo(accountID string) (bi *models.BakerInfo, err error)
func (*TezTracker) GetBlockBakingRights ¶
func (t *TezTracker) GetBlockBakingRights(hashOrLevel string) (rights []models.FutureBakingRight, count int64, err error)
GetBlockEndorsements finds a block and returns endorsements for it.
func (*TezTracker) GetBlockEndorsements ¶
func (t *TezTracker) GetBlockEndorsements(hashOrLevel string) (operations []models.Operation, count int64, err error)
GetBlockEndorsements finds a block and returns endorsements for it.
func (*TezTracker) GetBlockWithOperationGroups ¶
func (t *TezTracker) GetBlockWithOperationGroups(hashOrLevel string) (block models.Block, err error)
GetBlockWithOperationGroups retrieves a block by hash or by level. It loads OperationGroups into the found block.
func (*TezTracker) GetCurrentCycle ¶
func (t *TezTracker) GetCurrentCycle() (int64, error)
func (*TezTracker) GetDoubleBakings ¶
func (t *TezTracker) GetDoubleBakings(ids, inBlocks []string, limits Limiter) (operations []models.DoubleBakingEvidence, count int64, err error)
GetOperations gets the operations filtering by operation kinds and blocks wiht pagination.
func (*TezTracker) GetOperations ¶
func (t *TezTracker) GetOperations(ids, kinds, inBlocks, accountIDs []string, limits Limiter, before int64) (operations []models.Operation, count int64, err error)
GetOperations gets the operations filtering by operation kinds and blocks wiht pagination.
func (*TezTracker) GetStakingRatio ¶
func (t *TezTracker) GetStakingRatio() (float64, error)
GetStakingRatio calculates the rough ratio of staked balance to the total supply.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_services is a generated GoMock package.
|
Package mock_services is a generated GoMock package. |