Documentation ¶
Index ¶
- Constants
- Variables
- func AddAuthorizeCode(userId uint64, code, clientId string, appId uint64) error
- func AddSubscription(userID uint64, network string, eventName types.EventName, eventFilter string, ...) error
- func AddToWatchlist(watchlist []WatchlistEntry, network string) error
- func ApplyEmbeddedDbSchema(version int64) error
- func CalculateMevFromBlock(block *types.Eth1Block) *big.Int
- func CalculateTxFeeFromTransaction(tx *types.Eth1Transaction, blockBaseFee *big.Int) *big.Int
- func CalculateTxFeesFromBlock(block *types.Eth1Block) *big.Int
- func ChangeProductIDFromStripe(tx *sql.Tx, stripeSubscriptionID string, productID string) error
- func CountSentMail(email string) error
- func CreateAPIKey(userID uint64) error
- func CreateBLSToExecutionChangesNodeJob(nj *types.NodeJob) (*types.NodeJob, error)
- func CreateNodeJob(data []byte) (*types.NodeJob, error)
- func CreateVoluntaryExitNodeJob(nj *types.NodeJob) (*types.NodeJob, error)
- func DeleteAdConfiguration(id string) error
- func DeleteAllSubscription(userID uint64, network string, eventName types.EventName) error
- func DeleteSubscription(userID uint64, network string, eventName types.EventName, eventFilter string) error
- func DeleteUserByEmail(email string) error
- func DeleteUserById(id uint64) error
- func DisableAllSubscriptionsFromStripeUser(stripeCustomerID string) error
- func GetActiveValidatorCount() (uint64, error)
- func GetAdConfigurations() ([]*types.AdConfig, error)
- func GetAdConfigurationsForTemplate(ids []string, noAds bool) ([]*types.AdConfig, error)
- func GetAddressWithdrawals(address []byte, limit uint64, offset uint64) ([]*types.Withdrawals, error)
- func GetAddressWithdrawalsTotal(address []byte) (uint64, error)
- func GetAllAppSubscriptions() ([]*types.PremiumData, error)
- func GetAllEpochs() ([]uint64, error)
- func GetAppDataFromRedirectUri(callback string) (*types.OAuthAppData, error)
- func GetAppSubscriptionCount(userID uint64) (int64, error)
- func GetBLSChangeCount() (uint64, error)
- func GetBLSChanges(query string, length, start uint64, orderBy, orderDir string) ([]*types.BLSChange, error)
- func GetBlockNumber(slot uint64) (block uint64, err error)
- func GetBlocks(startEpoch, endEpoch uint64) ([]*types.MinimalBlock, error)
- func GetByRefreshToken(claimUserID, claimAppID, claimDeviceID uint64, hashedRefreshToken string) (uint64, error)
- func GetCurrentDayClIncome(validator_indices []uint64) (map[uint64]int64, map[uint64]int64, error)
- func GetCurrentDayClIncomeTotal(validator_indices []uint64) (int64, int64, error)
- func GetDashboardWithdrawals(validators []uint64, limit uint64, offset uint64, orderBy string, ...) ([]*types.Withdrawals, error)
- func GetDashboardWithdrawalsCount(validators []uint64) (uint64, error)
- func GetDataTablesState(user uint64, key string) (*types.DataTableSaveState, error)
- func GetDepositThresholdTime() (*time.Time, error)
- func GetEpochWithdrawals(epoch uint64) ([]*types.WithdrawalsNotification, error)
- func GetEpochWithdrawalsTotal(epoch uint64) (total uint64, err error)
- func GetEth1Deposits(address string, length, start uint64) ([]*types.EthOneDepositsData, error)
- func GetEth1DepositsCount() (uint64, error)
- func GetEth1DepositsJoinEth2Deposits(query string, length, start uint64, orderBy, orderDir string, ...) ([]*types.EthOneDepositsData, uint64, error)
- func GetEth1DepositsLeaderboard(query string, length, start uint64, orderBy, orderDir string) ([]*types.EthOneDepositLeaderboardData, uint64, error)
- func GetEth2Deposits(query string, length, start uint64, orderBy, orderDir string) ([]*types.EthTwoDepositData, error)
- func GetEth2DepositsCount(search string) (uint64, error)
- func GetExplorerConfigurations() ([]*types.ExplorerConfig, error)
- func GetHistoricPrice(currency string, day uint64) (float64, error)
- func GetLastPendingAndProposedBlocks(startEpoch, endEpoch uint64) ([]*types.MinimalBlock, error)
- func GetLastWithdrawalEpoch(validators []uint64) (map[uint64]uint64, error)
- func GetLatestEpoch() (uint64, error)
- func GetMachineRowKey(userID uint64, process string, machine string) string
- func GetMailsSentCount(email string, t time.Time) (int, error)
- func GetMostRecentWithdrawalValidator() (uint64, error)
- func GetNodeJob(id string) (*types.NodeJob, error)
- func GetNodeJobValidatorInfos(job *types.NodeJob) ([]types.NodeJobValidatorInfo, error)
- func GetPendingBLSChangeValidatorCount() (uint64, error)
- func GetPendingValidatorCount() (uint64, error)
- func GetQueueAheadOfValidator(validatorIndex uint64) (uint64, error)
- func GetRelayDataForIndexedBlocks(blocks []*types.Eth1BlockIndexed) (map[common.Hash]types.RelaysData, error)
- func GetSlashingCount() (uint64, error)
- func GetSlotBLSChange(slot uint64) ([]*types.BLSChange, error)
- func GetSlotVizData(latestEpoch uint64) ([]*types.SlotVizEpochs, error)
- func GetSlotWithdrawals(slot uint64) ([]*types.Withdrawals, error)
- func GetSubsForEventFilter(eventName types.EventName) ([][]byte, map[string][]types.Subscription, error)
- func GetSubscriptions(filter GetSubscriptionsFilter) ([]*types.Subscription, error)
- func GetTaggedValidators(filter WatchlistFilter) ([]*types.TaggedValidators, error)
- func GetTotalAmountDeposited() (uint64, error)
- func GetTotalAmountWithdrawn() (sum uint64, count uint64, err error)
- func GetTotalBLSChanges() (uint64, error)
- func GetTotalEligibleEther() (uint64, error)
- func GetTotalValidatorsCount() (uint64, error)
- func GetTotalWithdrawals() (total uint64, err error)
- func GetUserAPIKeyStatistics(apikey *string) (*types.ApiStatistics, error)
- func GetUserApiKeyById(id uint64) (string, error)
- func GetUserAuthDataByAuthorizationCode(code string) (*types.OAuthCodeData, error)
- func GetUserDevicesByUserID(userID uint64) ([]types.PairedDevice, error)
- func GetUserEmailById(id uint64) (string, error)
- func GetUserEmailsByIds(ids []uint64) (map[uint64]string, error)
- func GetUserIdByApiKey(apiKey string) (*types.UserWithPremium, error)
- func GetUserMonitorSharingSetting(userID uint64) (bool, error)
- func GetUserPremiumSubscription(id uint64) (types.UserPremiumSubscription, error)
- func GetUserPushTokenByIds(ids []uint64) (map[uint64][]string, error)
- func GetUserSubscriptionIDByStripe(stripeSubscriptionID string) (uint64, error)
- func GetValidatorBLSChange(validatorindex uint64) (*types.BLSChange, error)
- func GetValidatorDeposits(publicKey []byte) (*types.ValidatorDeposits, error)
- func GetValidatorIncomeHistory(validator_indices []uint64, lowerBoundDay uint64, upperBoundDay uint64) ([]types.ValidatorIncomeHistory, int64, error)
- func GetValidatorIncomeHistoryChart(validator_indices []uint64, currency string) ([]*types.ChartDataPoint, int64, error)
- func GetValidatorIndex(publicKey []byte) (uint64, error)
- func GetValidatorNames() (map[uint64]string, error)
- func GetValidatorPublicKey(index uint64) ([]byte, error)
- func GetValidatorWithdrawals(validator uint64, limit uint64, offset uint64, orderBy string, orderDir string) ([]*types.Withdrawals, error)
- func GetValidatorWithdrawalsCount(validator uint64) (count, lastWithdrawalEpoch uint64, err error)
- func GetValidatorsBLSChange(validators []uint64) ([]*types.ValidatorsBLSChange, error)
- func GetValidatorsGotSlashed(epoch uint64) ([]struct{ ... }, error)
- func GetValidatorsInitialWithdrawalCredentials(validators []uint64) ([][]byte, error)
- func GetValidatorsWithdrawals(validators []uint64, fromEpoch uint64, toEpoch uint64) ([]*types.Withdrawals, error)
- func GetValidatorsWithdrawalsByEpoch(validator []uint64, startEpoch uint64, endEpoch uint64) ([]*types.WithdrawalsByEpoch, error)
- func GetWithdrawableValidatorCount(epoch uint64) (uint64, error)
- func GetWithdrawals(query string, length, start uint64, orderBy, orderDir string) ([]*types.Withdrawals, error)
- func InsertAdConfigurations(adConfig types.AdConfig) error
- func InsertMobileSubscription(tx *sql.Tx, userID uint64, paymentDetails types.MobileSubscription, ...) error
- func InsertUserDevice(userID uint64, hashedRefreshToken string, name string, appID uint64) (uint64, error)
- func MobileDeviceDelete(userID, deviceID uint64) error
- func MobileDeviceSettingsSelect(userID, deviceID uint64) (*sql.Rows, error)
- func MobileDeviceSettingsUpdate(userID, deviceID uint64, notifyEnabled, active string) (*sql.Rows, error)
- func MobileNotificatonTokenUpdate(userID, deviceID uint64, notifyToken string) error
- func MustInitBigtableAdmin(ctx context.Context, project, instance string)
- func MustInitDB(writer *types.DatabaseConfig, reader *types.DatabaseConfig)
- func MustInitFrontendDB(writer *types.DatabaseConfig, reader *types.DatabaseConfig)
- func NewTransaction() (*sql.Tx, error)
- func RemoveFromWatchlist(userId uint64, validator_publickey string, network string) error
- func SaveBlock(block *types.Block) error
- func SaveChartSeriesPoint(date time.Time, indicator string, value any) error
- func SaveDataTableState(user uint64, key string, state types.DataTableSaveState) error
- func SaveEpoch(data *types.EpochData, client rpc.Client) error
- func SaveExplorerConfiguration(configs []types.ExplorerConfig) error
- func SaveValidatorQueue(validators *types.ValidatorQueue) error
- func SetBlockStatus(blocks []*types.CanonBlock) error
- func SetSubscriptionToExpired(tx *sql.Tx, id uint64) error
- func SetUserMonitorSharingSetting(userID uint64, share bool) error
- func StripeCreateSubscription(tx *sql.Tx, customerID, priceID, subscriptionID string, ...) error
- func StripeGetCustomerEmail(customerID string) (string, error)
- func StripeGetCustomerUserId(customerID string) (uint64, error)
- func StripeGetSubscription(id string) (*types.StripeSubscription, error)
- func StripeGetUserSubscription(id uint64, purchaseGroup string) (types.UserSubscription, error)
- func StripeRemoveCustomer(customerID string) error
- func StripeUpdateCustomerID(email, customerID string) error
- func StripeUpdateSubscription(tx *sql.Tx, priceID, subscriptionID string, payload json.RawMessage) error
- func StripeUpdateSubscriptionStatus(tx *sql.Tx, id string, status bool, payload *json.RawMessage) error
- func SubmitBLSToExecutionChangesNodeJob(job *types.NodeJob) error
- func SubmitBLSToExecutionChangesNodeJobs() error
- func SubmitNodeJobs() error
- func SubmitVoluntaryExitNodeJob(job *types.NodeJob) error
- func SubmitVoluntaryExitNodeJobs() error
- func TimestampToBigtableTimeDesc(ts time.Time) string
- func UpdateAdConfiguration(adConfig types.AdConfig) error
- func UpdateBLSToExecutionChangesNodeJob(job *types.NodeJob) error
- func UpdateBLSToExecutionChangesNodeJobs() error
- func UpdateCanonicalBlocks(startEpoch, endEpoch uint64, blocks []*types.MinimalBlock) error
- func UpdateEpochFinalization(finality_epoch uint64) error
- func UpdateEpochStatus(stats *types.ValidatorParticipation) error
- func UpdateMissedBlocks(startEpoch, endEpoch uint64) error
- func UpdateMissedBlocksInEpochWithSlotCutoff(slot uint64) error
- func UpdateNodeJobs() error
- func UpdatePassword(userId uint64, hash []byte) error
- func UpdateSubscriptionLastSent(tx *sqlx.Tx, ts uint64, epoch uint64, subID uint64) error
- func UpdateSubscriptionsLastSent(subscriptionIDs []uint64, sent time.Time, epoch uint64, useDB *sqlx.DB) error
- func UpdateUserSubscription(tx *sql.Tx, id uint64, valid bool, expiration int64, rejectReason string) error
- func UpdateVoluntaryExitNodeJob(job *types.NodeJob) error
- func UpdateVoluntaryExitNodeJobs() error
- func WriteChartSeriesForDay(day int64) error
- func WriteValidatorStatisticsForDay(day uint64) error
- type Bigtable
- func (bigtable *Bigtable) CheckForGapsInBlocksTable(lookback int) (gapFound bool, start int, end int, err error)
- func (bigtable *Bigtable) CheckForGapsInDataTable(lookback int) error
- func (bigtable *Bigtable) Close()
- func (bigtable *Bigtable) DeleteBlock(blockNumber uint64, blockHash []byte) error
- func (bigtable *Bigtable) DeleteEpoch(epoch uint64) error
- func (bigtable *Bigtable) DeleteRowsWithPrefix(prefix string)
- func (bigtable *Bigtable) GetAddressBlocksMinedTableData(address string, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressErc1155TableData(address string, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressErc20TableData(address []byte, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressErc721TableData(address string, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressInternalTableData(address []byte, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressName(address []byte) (string, error)
- func (bigtable *Bigtable) GetAddressNames(addresses map[string]string) error
- func (bigtable *Bigtable) GetAddressTransactionsTableData(address []byte, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressUnclesMinedTableData(address string, search string, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetAddressesNamesArMetadata(names *map[string]string, inputMetadata *map[string]*types.ERC20Metadata) (map[string]string, map[string]*types.ERC20Metadata, error)
- func (bigtable *Bigtable) GetAggregatedValidatorIncomeDetailsHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64]*itypes.ValidatorEpochIncome, error)
- func (bigtable *Bigtable) GetArbitraryTokenTransfersForTransaction(transaction []byte) ([]*types.Transfer, error)
- func (bigtable *Bigtable) GetBalanceForAddress(address []byte, token []byte) (*types.Eth1AddressBalance, error)
- func (bigtable *Bigtable) GetBlockFromBlocksTable(number uint64) (*types.Eth1Block, error)
- func (bigtable *Bigtable) GetBlockKeys(blockNumber uint64, blockHash []byte) ([]string, error)
- func (bigtable *Bigtable) GetBlocksDescending(start, limit uint64) ([]*types.Eth1BlockIndexed, error)
- func (bigtable *Bigtable) GetBlocksIndexedMultiple(blockNumbers []uint64, limit uint64) ([]*types.Eth1BlockIndexed, error)
- func (bigtable *Bigtable) GetClient() *gcp_bigtable.Client
- func (bigtable *Bigtable) GetContractMetadata(address []byte) (*types.ContractMetadata, error)
- func (bigtable *Bigtable) GetDataTable() *gcp_bigtable.Table
- func (bigtable *Bigtable) GetERC20MetadataForAddress(address []byte) (*types.ERC20Metadata, error)
- func (bigtable *Bigtable) GetEpochIncomeHistory(epoch uint64) (*itypes.ValidatorEpochIncome, error)
- func (bigtable *Bigtable) GetEpochIncomeHistoryDescending(startEpoch uint64, endEpoch uint64) (*itypes.ValidatorEpochIncome, error)
- func (bigtable *Bigtable) GetEth1BlocksForAddress(prefix string, limit int64) ([]*types.Eth1BlockIndexed, string, error)
- func (bigtable *Bigtable) GetEth1ERC1155ForAddress(prefix string, limit int64) ([]*types.ETh1ERC1155Indexed, string, error)
- func (bigtable *Bigtable) GetEth1ERC20ForAddress(prefix string, limit int64) ([]*types.Eth1ERC20Indexed, string, error)
- func (bigtable *Bigtable) GetEth1ERC721ForAddress(prefix string, limit int64) ([]*types.Eth1ERC721Indexed, string, error)
- func (bigtable *Bigtable) GetEth1ItxForAddress(prefix string, limit int64) ([]*types.Eth1InternalTransactionIndexed, string, error)
- func (bigtable *Bigtable) GetEth1TxForAddress(prefix string, limit int64) ([]*types.Eth1TransactionIndexed, string, error)
- func (bigtable *Bigtable) GetEth1TxForToken(prefix string, limit int64) ([]*types.Eth1ERC20Indexed, string, error)
- func (bigtable *Bigtable) GetEth1UnclesForAddress(prefix string, limit int64) ([]*types.Eth1UncleIndexed, string, error)
- func (bigtable *Bigtable) GetFullBlockDescending(start, limit uint64) ([]*types.Eth1Block, error)
- func (bigtable *Bigtable) GetFullBlocksDescending(stream chan<- *types.Eth1Block, high, low uint64) error
- func (bigtable *Bigtable) GetGasNowHistory(ts, pastTs time.Time) ([]types.GasNowHistory, error)
- func (bigtable *Bigtable) GetIndexedEth1Transaction(txHash []byte) (*types.Eth1TransactionIndexed, error)
- func (bigtable *Bigtable) GetInternalTransfersForTransaction(transaction []byte, from []byte) ([]types.Transfer, error)
- func (bigtable *Bigtable) GetLastBlockInBlocksTable() (int, error)
- func (bigtable *Bigtable) GetLastBlockInDataTable() (int, error)
- func (bigtable Bigtable) GetMachineMetricsForNotifications(rowKeys gcp_bigtable.RowList) (map[uint64]map[string]*types.MachineMetricSystemUser, error)
- func (bigtable Bigtable) GetMachineMetricsMachineCount(userID uint64) (uint64, error)
- func (bigtable Bigtable) GetMachineMetricsMachineNames(userID uint64) ([]string, error)
- func (bigtable Bigtable) GetMachineMetricsNode(userID uint64, limit, offset int) ([]*types.MachineMetricNode, error)
- func (bigtable Bigtable) GetMachineMetricsSystem(userID uint64, limit, offset int) ([]*types.MachineMetricSystem, error)
- func (bigtable Bigtable) GetMachineMetricsValidator(userID uint64, limit, offset int) ([]*types.MachineMetricValidator, error)
- func (bigtable *Bigtable) GetMetadatTable() *gcp_bigtable.Table
- func (bigtable *Bigtable) GetMetadata(startToken string, limit int) ([]string, []*types.Eth1AddressBalance, error)
- func (bigtable *Bigtable) GetMetadataForAddress(address []byte) (*types.Eth1AddressMetadata, error)
- func (bigtable *Bigtable) GetMetadataUpdates(prefix string, startToken string, limit int) ([]string, []*types.Eth1AddressBalance, error)
- func (bigtable *Bigtable) GetMetadataUpdatesTable() *gcp_bigtable.Table
- func (bigtable *Bigtable) GetMethodLabel(id []byte, invokesContract bool) string
- func (bigtable *Bigtable) GetMethodSignature(hex string) (*string, error)
- func (bigtable *Bigtable) GetMethodSignatureImportStatus() (*types.MethodSignatureImportStatus, error)
- func (bigtable *Bigtable) GetMostRecentBlockFromDataTable() (*types.Eth1BlockIndexed, error)
- func (bigtable *Bigtable) GetTokenTransactionsTableData(token []byte, address []byte, pageToken string) (*types.DataTableResponse, error)
- func (bigtable *Bigtable) GetValidatorAttestationHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64][]*types.ValidatorAttestation, error)
- func (bigtable *Bigtable) GetValidatorBalanceHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64][]*types.ValidatorBalance, error)
- func (bigtable *Bigtable) GetValidatorBalanceStatistics(startEpoch, endEpoch uint64) (map[uint64]*types.ValidatorBalanceStatistic, error)
- func (bigtable *Bigtable) GetValidatorEffectiveness(validators []uint64, epoch uint64) ([]*types.ValidatorEffectiveness, error)
- func (bigtable *Bigtable) GetValidatorIncomeDetailsHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64]map[uint64]*itypes.ValidatorEpochIncome, error)
- func (bigtable *Bigtable) GetValidatorMissedAttestationHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64]map[uint64]bool, error)
- func (bigtable *Bigtable) GetValidatorMissedAttestationsCount(validators []uint64, firstEpoch uint64, lastEpoch uint64) (map[uint64]*types.ValidatorMissedAttestationsStatistic, error)
- func (bigtable *Bigtable) GetValidatorProposalHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64][]*types.ValidatorProposal, error)
- func (bigtable *Bigtable) GetValidatorSyncCommitteesStats(validators []uint64, startEpoch uint64, endEpoch uint64) (types.SyncCommitteesStats, error)
- func (bigtable *Bigtable) GetValidatorSyncDutiesHistoryOrdered(validatorIndex uint64, startEpoch uint64, endEpoch uint64, ...) ([]*types.ValidatorSyncParticipation, error)
- func (bigtable *Bigtable) GetValidatorSyncDutiesStatistics(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64]*types.ValidatorSyncDutiesStatistic, error)
- func (bigtable *Bigtable) SaveAddressName(address []byte, name string) error
- func (bigtable *Bigtable) SaveAttestationAssignments(epoch uint64, assignments map[string]uint64) error
- func (bigtable *Bigtable) SaveAttestations(blocks map[uint64]map[string]*types.Block) error
- func (bigtable *Bigtable) SaveBalances(balances []*types.Eth1AddressBalance, deleteKeys []string) error
- func (bigtable *Bigtable) SaveBlock(block *types.Eth1Block) error
- func (bigtable *Bigtable) SaveBlockKeys(blockNumber uint64, blockHash []byte, keys string) error
- func (bigtable *Bigtable) SaveBlocks(block *types.Eth1Block) error
- func (bigtable *Bigtable) SaveContractMetadata(address []byte, metadata *types.ContractMetadata) error
- func (bigtable *Bigtable) SaveERC20Metadata(address []byte, metadata *types.ERC20Metadata) error
- func (bigtable *Bigtable) SaveERC20TokenPrices(prices []*types.ERC20TokenPrice) error
- func (bigtable *Bigtable) SaveGasNowHistory(slow, standard, rapid, fast *big.Int) error
- func (bigtable *Bigtable) SaveMachineMetric(process string, userID uint64, machine string, data []byte) error
- func (bigtable *Bigtable) SaveMethodSignatureImportStatus(status types.MethodSignatureImportStatus) error
- func (bigtable *Bigtable) SaveMethodSignatures(signatures []types.MethodSignature) error
- func (bigtable *Bigtable) SaveProposalAssignments(epoch uint64, assignments map[uint64]uint64) error
- func (bigtable *Bigtable) SaveProposals(blocks map[uint64]map[string]*types.Block) error
- func (bigtable *Bigtable) SaveSyncComitteeDuties(blocks map[uint64]map[string]*types.Block) error
- func (bigtable *Bigtable) SaveSyncCommitteesAssignments(startSlot, endSlot uint64, validators []uint64) error
- func (bigtable *Bigtable) SaveValidatorBalances(epoch uint64, validators []*types.Validator) error
- func (bigtable *Bigtable) SaveValidatorIncomeDetails(epoch uint64, rewards map[uint64]*itypes.ValidatorEpochIncome) error
- func (bigtable *Bigtable) SearchForAddress(addressPrefix []byte, limit int) ([]*types.Eth1AddressSearchItem, error)
- func (bigtable *Bigtable) TransformBlock(block *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformERC1155(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformERC20(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformERC721(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformItx(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformTx(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformUncle(block *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) TransformWithdrawals(block *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, ...)
- func (bigtable *Bigtable) WriteBulk(mutations *types.BulkMutations, table *gcp_bigtable.Table) error
- type BigtableAdmin
- type CreateFamily
- type CreateTables
- type GetSubscriptionsFilter
- type IndexFilter
- type PremiumResult
- type WatchlistEntry
- type WatchlistFilter
Constants ¶
const ( DEFAULT_FAMILY = "f" VALIDATOR_BALANCES_FAMILY = "vb" ATTESTATIONS_FAMILY = "at" PROPOSALS_FAMILY = "pr" SYNC_COMMITTEES_FAMILY = "sc" INCOME_DETAILS_COLUMN_FAMILY = "id" STATS_COLUMN_FAMILY = "stats" MACHINE_METRICS_COLUMN_FAMILY = "mm" SERIES_FAMILY = "series" SUM_COLUMN = "sum" )
const ( DATA_COLUMN = "d" INDEX_COLUMN = "i" DEFAULT_FAMILY_BLOCKS = "default" METADATA_UPDATES_FAMILY_BLOCKS = "blocks" ACCOUNT_METADATA_FAMILY = "a" CONTRACT_METADATA_FAMILY = "c" ERC20_METADATA_FAMILY = "erc20" ERC721_METADATA_FAMILY = "erc721" ERC1155_METADATA_FAMILY = "erc1155" MAX_INT = 9223372036854775807 MIN_INT = -9223372036854775808 )
const ( ACCOUNT_COLUMN_NAME = "NAME" ACCOUNT_IS_CONTRACT = "ISCONTRACT" CONTRACT_NAME = "CONTRACTNAME" CONTRACT_ABI = "ABI" ERC20_COLUMN_DECIMALS = "DECIMALS" ERC20_COLUMN_TOTALSUPPLY = "TOTALSUPPLY" ERC20_COLUMN_SYMBOL = "SYMBOL" ERC20_COLUMN_PRICE = "PRICE" ERC20_COLUMN_NAME = "NAME" ERC20_COLUMN_DESCRIPTION = "DESCRIPTION" ERC20_COLUMN_LOGO = "LOGO" ERC20_COLUMN_LOGO_FORMAT = "LOGOFORMAT" ERC20_COLUMN_LINK = "LINK" ERC20_COLUMN_OGIMAGE = "OGIMAGE" ERC20_COLUMN_OGIMAGE_FORMAT = "OGIMAGEFORMAT" )
Variables ¶
var ( ERC20TOPIC []byte ERC721TOPIC []byte ERC1155Topic []byte )
var ( GASNOW_RAPID_COLUMN = "RAPI" GASNOW_FAST_COLUMN = "FAST" GASNOW_STANDARD_COLUMN = "STAN" GASNOW_SLOW_COLUMN = "SLOW" )
var DBPGX *pgxpool.Conn
var EmbedMigrations embed.FS
var ErrBlockNotFound = errors.New("block not found")
var FrontendReaderDB *sqlx.DB
FrontendWriterDB is a pointer to the auth-database
var FrontendWriterDB *sqlx.DB
var ReaderDb *sqlx.DB
var WriterDb *sqlx.DB
DB is a pointer to the explorer-database
var ZERO_ADDRESS []byte = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
Functions ¶
func AddAuthorizeCode ¶
AddAuthorizeCode registers a code that can be used in exchange for an access token
func AddSubscription ¶
func AddSubscription(userID uint64, network string, eventName types.EventName, eventFilter string, eventThreshold float64) error
AddSubscription adds a new subscription to the database.
func AddToWatchlist ¶
func AddToWatchlist(watchlist []WatchlistEntry, network string) error
func ApplyEmbeddedDbSchema ¶
func CountSentMail ¶
CountSentMail increases the count of sent mails in the table `mails_sent` for this day.
func CreateAPIKey ¶
CreateAPIKey creates an API key for the user and saves it to the database
func DeleteAllSubscription ¶
func DeleteSubscription ¶
func DeleteSubscription(userID uint64, network string, eventName types.EventName, eventFilter string) error
DeleteSubscription removes a subscription from the database.
func DeleteUserByEmail ¶
DeleteUserByEmail deletes a user.
func GetActiveValidatorCount ¶
GetActiveValidatorCount will return the total-validator-count
func GetAdConfigurations ¶
get all ad configurations
func GetAdConfigurationsForTemplate ¶
get the ad configuration for a specific template that are active
func GetAddressWithdrawals ¶
func GetAddressWithdrawals(address []byte, limit uint64, offset uint64) ([]*types.Withdrawals, error)
GetAddressWithdrawals returns the withdrawals for an address
func GetAddressWithdrawalsTotal ¶
GetAddressWithdrawalsTotal returns the total withdrawals for an address
func GetAllAppSubscriptions ¶
func GetAllAppSubscriptions() ([]*types.PremiumData, error)
func GetAllEpochs ¶
GetAllEpochs will return a collection of all of the epochs from the database
func GetAppDataFromRedirectUri ¶
func GetAppDataFromRedirectUri(callback string) (*types.OAuthAppData, error)
GetAppNameFromRedirectUri receives an oauth redirect_url and returns the registered app name, if exists
func GetAppSubscriptionCount ¶
func GetBLSChangeCount ¶
func GetBLSChanges ¶
func GetBlockNumber ¶
func GetBlocks ¶
func GetBlocks(startEpoch, endEpoch uint64) ([]*types.MinimalBlock, error)
GetBlocks will return all blocks for a range of epochs from the database
func GetByRefreshToken ¶
func GetByRefreshToken(claimUserID, claimAppID, claimDeviceID uint64, hashedRefreshToken string) (uint64, error)
GetByRefreshToken basically used to confirm the claimed user id with the refresh token. Returns the userId if successful
func GetCurrentDayClIncome ¶
func GetDashboardWithdrawals ¶
func GetDataTablesState ¶
func GetDataTablesState(user uint64, key string) (*types.DataTableSaveState, error)
GetDataTablesState retrieves the state for a given user and table
func GetDepositThresholdTime ¶
func GetEpochWithdrawals ¶
func GetEpochWithdrawals(epoch uint64) ([]*types.WithdrawalsNotification, error)
func GetEth1Deposits ¶
func GetEth1Deposits(address string, length, start uint64) ([]*types.EthOneDepositsData, error)
func GetEth1DepositsCount ¶
func GetEth2Deposits ¶
func GetEth2DepositsCount ¶
func GetExplorerConfigurations ¶
func GetExplorerConfigurations() ([]*types.ExplorerConfig, error)
get all explorer configurations
func GetLastPendingAndProposedBlocks ¶
func GetLastPendingAndProposedBlocks(startEpoch, endEpoch uint64) ([]*types.MinimalBlock, error)
GetLastPendingAndProposedBlocks will return all proposed and pending blocks (ignores missed slots) from the database
func GetLastWithdrawalEpoch ¶
func GetLatestEpoch ¶
GetLatestEpoch will return the latest epoch from the database
func GetMailsSentCount ¶
GetMailsSentCount returns the number of sent mails for the day of the passed time.
func GetNodeJobValidatorInfos ¶
func GetNodeJobValidatorInfos(job *types.NodeJob) ([]types.NodeJobValidatorInfo, error)
func GetPendingValidatorCount ¶
GetPendingValidatorCount queries the pending validators currently in the queue
func GetRelayDataForIndexedBlocks ¶
func GetRelayDataForIndexedBlocks(blocks []*types.Eth1BlockIndexed) (map[common.Hash]types.RelaysData, error)
func GetSlashingCount ¶
func GetSlotVizData ¶
func GetSlotVizData(latestEpoch uint64) ([]*types.SlotVizEpochs, error)
func GetSlotWithdrawals ¶
func GetSlotWithdrawals(slot uint64) ([]*types.Withdrawals, error)
func GetSubsForEventFilter ¶
func GetSubscriptions ¶
func GetSubscriptions(filter GetSubscriptionsFilter) ([]*types.Subscription, error)
GetSubscriptions returns the subscriptions filtered by the provided filter.
func GetTaggedValidators ¶
func GetTaggedValidators(filter WatchlistFilter) ([]*types.TaggedValidators, error)
GetTaggedValidators returns validators that were tagged by a user
func GetTotalAmountDeposited ¶
func GetTotalAmountWithdrawn ¶
func GetTotalBLSChanges ¶
func GetTotalEligibleEther ¶
func GetTotalValidatorsCount ¶
GetTotalValidatorsCount will return the total-validator-count
func GetTotalWithdrawals ¶
func GetUserAPIKeyStatistics ¶
func GetUserAPIKeyStatistics(apikey *string) (*types.ApiStatistics, error)
func GetUserApiKeyById ¶
func GetUserAuthDataByAuthorizationCode ¶
func GetUserAuthDataByAuthorizationCode(code string) (*types.OAuthCodeData, error)
GetUserAuthDataByAuthorizationCode checks an oauth code for validity, consumes the code and returns the userId on success
func GetUserDevicesByUserID ¶
func GetUserDevicesByUserID(userID uint64) ([]types.PairedDevice, error)
func GetUserEmailById ¶
GetUserEmailById returns the email of a user.
func GetUserEmailsByIds ¶
GetUserEmailsByIds returns the emails of users.
func GetUserIdByApiKey ¶
func GetUserIdByApiKey(apiKey string) (*types.UserWithPremium, error)
func GetUserPremiumSubscription ¶
func GetUserPremiumSubscription(id uint64) (types.UserPremiumSubscription, error)
func GetValidatorBLSChange ¶
func GetValidatorDeposits ¶
func GetValidatorDeposits(publicKey []byte) (*types.ValidatorDeposits, error)
GetValidatorDeposits will return eth1- and eth2-deposits for a public key from the database
func GetValidatorIndex ¶
GetValidatorIndex will return the validator-index for a public key from the database
func GetValidatorNames ¶
func GetValidatorPublicKey ¶
GetValidatorPublicKey will return the public key for a specific validator from the database
func GetValidatorWithdrawals ¶
func GetValidatorsBLSChange ¶
func GetValidatorsBLSChange(validators []uint64) ([]*types.ValidatorsBLSChange, error)
GetValidatorsBLSChange returns the BLS change for a list of validators
func GetValidatorsGotSlashed ¶
func GetValidatorsGotSlashed(epoch uint64) ([]struct { Epoch uint64 `db:"epoch"` SlasherIndex uint64 `db:"slasher"` SlasherPubkey string `db:"slasher_pubkey"` SlashedValidatorIndex uint64 `db:"slashedvalidator"` SlashedValidatorPubkey []byte `db:"slashedvalidator_pubkey"` Reason string `db:"reason"` }, error)
GetValidatorsGotSlashed returns the validators that got slashed after `epoch` either by an attestation violation or a proposer violation
func GetWithdrawals ¶
func InsertAdConfigurations ¶
insert new ad configuration
func InsertUserDevice ¶
func InsertUserDevice(userID uint64, hashedRefreshToken string, name string, appID uint64) (uint64, error)
InsertUserDevice Insert user device and return device id
func MobileDeviceDelete ¶
func MustInitBigtableAdmin ¶
func MustInitDB ¶
func MustInitDB(writer *types.DatabaseConfig, reader *types.DatabaseConfig)
func MustInitFrontendDB ¶
func MustInitFrontendDB(writer *types.DatabaseConfig, reader *types.DatabaseConfig)
func NewTransaction ¶
func RemoveFromWatchlist ¶
RemoveFromWatchlist removes a validator for a given user from the users_validators_tag table It also deletes any subscriptions for that bookmarked validator
func SaveChartSeriesPoint ¶
func SaveDataTableState ¶
func SaveDataTableState(user uint64, key string, state types.DataTableSaveState) error
SaveDataTableState saves the state of the current datatable state update
func SaveExplorerConfiguration ¶
func SaveExplorerConfiguration(configs []types.ExplorerConfig) error
save current configurations
func SaveValidatorQueue ¶
func SaveValidatorQueue(validators *types.ValidatorQueue) error
SaveValidatorQueue will save the validator queue into the database
func SetBlockStatus ¶
func SetBlockStatus(blocks []*types.CanonBlock) error
func StripeCreateSubscription ¶
func StripeCreateSubscription(tx *sql.Tx, customerID, priceID, subscriptionID string, payload json.RawMessage) error
StripeCreateSubscription inserts a new subscription
func StripeGetCustomerEmail ¶
StripeGetCustomerEmail returns a customers email given their customerID
func StripeGetCustomerUserId ¶
func StripeGetSubscription ¶
func StripeGetSubscription(id string) (*types.StripeSubscription, error)
StripeGetSubscription returns a subscription given a subscription_id
func StripeGetUserSubscription ¶
func StripeGetUserSubscription(id uint64, purchaseGroup string) (types.UserSubscription, error)
StripeGetUserAPISubscription returns a users current subscription
func StripeRemoveCustomer ¶
StripeRemoveCustomer removes the stripe customer and sets all subscriptions to inactive
func StripeUpdateCustomerID ¶
StripeUpdateCustomerID adds a stripe customer id to a user. It checks if the user already has a stripe customer id.
func StripeUpdateSubscription ¶
func StripeUpdateSubscription(tx *sql.Tx, priceID, subscriptionID string, payload json.RawMessage) error
StripeUpdateSubscription inserts a new subscription
func StripeUpdateSubscriptionStatus ¶
func StripeUpdateSubscriptionStatus(tx *sql.Tx, id string, status bool, payload *json.RawMessage) error
StripeUpdateSubscriptionStatus sets the status of a subscription
func SubmitBLSToExecutionChangesNodeJobs ¶
func SubmitBLSToExecutionChangesNodeJobs() error
func SubmitNodeJobs ¶
func SubmitNodeJobs() error
func SubmitVoluntaryExitNodeJobs ¶
func SubmitVoluntaryExitNodeJobs() error
func UpdateAdConfiguration ¶
update exisiting ad configuration
func UpdateBLSToExecutionChangesNodeJobs ¶
func UpdateBLSToExecutionChangesNodeJobs() error
func UpdateCanonicalBlocks ¶
func UpdateCanonicalBlocks(startEpoch, endEpoch uint64, blocks []*types.MinimalBlock) error
UpdateCanonicalBlocks will update the blocks for an epoch range in the database
func UpdateEpochFinalization ¶
UpdateEpochFinalization will update finalized-flag of unfinalized epochs
func UpdateEpochStatus ¶
func UpdateEpochStatus(stats *types.ValidatorParticipation) error
UpdateEpochStatus will update the epoch status in the database
func UpdateMissedBlocks ¶
UpdateMissedBlocks will update the missed blocks for an epoch range in the database
func UpdateNodeJobs ¶
func UpdateNodeJobs() error
func UpdatePassword ¶
UpdatePassword updates the password of a user.
func UpdateSubscriptionLastSent ¶
UpdateSubscriptionLastSent updates `last_sent_ts` column of the `users_subscriptions` table.
func UpdateSubscriptionsLastSent ¶
func UpdateSubscriptionsLastSent(subscriptionIDs []uint64, sent time.Time, epoch uint64, useDB *sqlx.DB) error
UpdateSubscriptionsLastSent updates `last_sent_ts` column of the `users_subscriptions` table.
func UpdateUserSubscription ¶
func UpdateVoluntaryExitNodeJobs ¶
func UpdateVoluntaryExitNodeJobs() error
func WriteChartSeriesForDay ¶
Types ¶
type Bigtable ¶
type Bigtable struct {
// contains filtered or unexported fields
}
var BigtableClient *Bigtable
func InitBigtable ¶
func (*Bigtable) CheckForGapsInBlocksTable ¶
func (*Bigtable) CheckForGapsInDataTable ¶
func (*Bigtable) DeleteBlock ¶
Deletes all block data from bigtable
func (*Bigtable) DeleteEpoch ¶
Deletes all block data from bigtable
func (*Bigtable) DeleteRowsWithPrefix ¶
func (*Bigtable) GetAddressBlocksMinedTableData ¶
func (*Bigtable) GetAddressErc1155TableData ¶
func (*Bigtable) GetAddressErc20TableData ¶
func (*Bigtable) GetAddressErc721TableData ¶
func (*Bigtable) GetAddressInternalTableData ¶
func (*Bigtable) GetAddressName ¶
func (*Bigtable) GetAddressNames ¶
func (*Bigtable) GetAddressTransactionsTableData ¶
func (*Bigtable) GetAddressUnclesMinedTableData ¶
func (*Bigtable) GetAddressesNamesArMetadata ¶
func (*Bigtable) GetAggregatedValidatorIncomeDetailsHistory ¶
func (bigtable *Bigtable) GetAggregatedValidatorIncomeDetailsHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64]*itypes.ValidatorEpochIncome, error)
GetValidatorIncomeDetailsHistory returns the validator income details startEpoch & endEpoch are inclusive
func (*Bigtable) GetArbitraryTokenTransfersForTransaction ¶
func (bigtable *Bigtable) GetArbitraryTokenTransfersForTransaction(transaction []byte) ([]*types.Transfer, error)
currently only erc20
func (*Bigtable) GetBalanceForAddress ¶
func (*Bigtable) GetBlockFromBlocksTable ¶
func (*Bigtable) GetBlockKeys ¶
func (*Bigtable) GetBlocksDescending ¶
func (bigtable *Bigtable) GetBlocksDescending(start, limit uint64) ([]*types.Eth1BlockIndexed, error)
GetBlocksDescending gets blocks starting at block start
func (*Bigtable) GetBlocksIndexedMultiple ¶
func (*Bigtable) GetClient ¶
func (bigtable *Bigtable) GetClient() *gcp_bigtable.Client
func (*Bigtable) GetContractMetadata ¶
func (bigtable *Bigtable) GetContractMetadata(address []byte) (*types.ContractMetadata, error)
func (*Bigtable) GetDataTable ¶
func (bigtable *Bigtable) GetDataTable() *gcp_bigtable.Table
func (*Bigtable) GetERC20MetadataForAddress ¶
func (bigtable *Bigtable) GetERC20MetadataForAddress(address []byte) (*types.ERC20Metadata, error)
func (*Bigtable) GetEpochIncomeHistory ¶
func (bigtable *Bigtable) GetEpochIncomeHistory(epoch uint64) (*itypes.ValidatorEpochIncome, error)
func (*Bigtable) GetEpochIncomeHistoryDescending ¶
func (*Bigtable) GetEth1BlocksForAddress ¶
func (*Bigtable) GetEth1ERC1155ForAddress ¶
func (*Bigtable) GetEth1ERC20ForAddress ¶
func (*Bigtable) GetEth1ERC721ForAddress ¶
func (*Bigtable) GetEth1ItxForAddress ¶
func (*Bigtable) GetEth1TxForAddress ¶
func (*Bigtable) GetEth1TxForToken ¶
func (*Bigtable) GetEth1UnclesForAddress ¶
func (*Bigtable) GetFullBlockDescending ¶
GetFullBlockDescending gets blocks starting at block start
func (*Bigtable) GetFullBlocksDescending ¶
func (bigtable *Bigtable) GetFullBlocksDescending(stream chan<- *types.Eth1Block, high, low uint64) error
GetFullBlockDescending gets blocks starting at block start
func (*Bigtable) GetGasNowHistory ¶
func (*Bigtable) GetIndexedEth1Transaction ¶
func (bigtable *Bigtable) GetIndexedEth1Transaction(txHash []byte) (*types.Eth1TransactionIndexed, error)
func (*Bigtable) GetInternalTransfersForTransaction ¶
func (*Bigtable) GetLastBlockInBlocksTable ¶
func (*Bigtable) GetLastBlockInDataTable ¶
func (Bigtable) GetMachineMetricsForNotifications ¶
func (bigtable Bigtable) GetMachineMetricsForNotifications(rowKeys gcp_bigtable.RowList) (map[uint64]map[string]*types.MachineMetricSystemUser, error)
Returns a map[userID]map[machineName]machineData machineData contains the latest machine data in CurrentData and 5 minute old data in fiveMinuteOldData (defined in limit) as well as the insert timestamps of both
func (Bigtable) GetMachineMetricsMachineCount ¶
func (Bigtable) GetMachineMetricsMachineNames ¶
func (Bigtable) GetMachineMetricsNode ¶
func (Bigtable) GetMachineMetricsSystem ¶
func (Bigtable) GetMachineMetricsValidator ¶
func (*Bigtable) GetMetadatTable ¶
func (bigtable *Bigtable) GetMetadatTable() *gcp_bigtable.Table
func (*Bigtable) GetMetadata ¶
func (*Bigtable) GetMetadataForAddress ¶
func (bigtable *Bigtable) GetMetadataForAddress(address []byte) (*types.Eth1AddressMetadata, error)
func (*Bigtable) GetMetadataUpdates ¶
func (*Bigtable) GetMetadataUpdatesTable ¶
func (bigtable *Bigtable) GetMetadataUpdatesTable() *gcp_bigtable.Table
func (*Bigtable) GetMethodLabel ¶
get a method label for its byte signature with defaults
func (*Bigtable) GetMethodSignature ¶
get a method signature by it's hex representation
func (*Bigtable) GetMethodSignatureImportStatus ¶
func (bigtable *Bigtable) GetMethodSignatureImportStatus() (*types.MethodSignatureImportStatus, error)
Get the status of the last signature import run
func (*Bigtable) GetMostRecentBlockFromDataTable ¶
func (bigtable *Bigtable) GetMostRecentBlockFromDataTable() (*types.Eth1BlockIndexed, error)
func (*Bigtable) GetTokenTransactionsTableData ¶
func (*Bigtable) GetValidatorAttestationHistory ¶
func (*Bigtable) GetValidatorBalanceHistory ¶
func (*Bigtable) GetValidatorBalanceStatistics ¶
func (*Bigtable) GetValidatorEffectiveness ¶
func (bigtable *Bigtable) GetValidatorEffectiveness(validators []uint64, epoch uint64) ([]*types.ValidatorEffectiveness, error)
returns the validator attestation effectiveness in %
func (*Bigtable) GetValidatorIncomeDetailsHistory ¶
func (bigtable *Bigtable) GetValidatorIncomeDetailsHistory(validators []uint64, startEpoch uint64, endEpoch uint64) (map[uint64]map[uint64]*itypes.ValidatorEpochIncome, error)
GetValidatorIncomeDetailsHistory returns the validator income details startEpoch & endEpoch are inclusive
func (*Bigtable) GetValidatorMissedAttestationHistory ¶
func (*Bigtable) GetValidatorMissedAttestationsCount ¶
func (*Bigtable) GetValidatorProposalHistory ¶
func (*Bigtable) GetValidatorSyncCommitteesStats ¶
func (*Bigtable) GetValidatorSyncDutiesHistoryOrdered ¶
func (*Bigtable) GetValidatorSyncDutiesStatistics ¶
func (*Bigtable) SaveAddressName ¶
func (*Bigtable) SaveAttestationAssignments ¶
func (*Bigtable) SaveAttestations ¶
func (*Bigtable) SaveBalances ¶
func (bigtable *Bigtable) SaveBalances(balances []*types.Eth1AddressBalance, deleteKeys []string) error
func (*Bigtable) SaveBlockKeys ¶
func (*Bigtable) SaveContractMetadata ¶
func (bigtable *Bigtable) SaveContractMetadata(address []byte, metadata *types.ContractMetadata) error
func (*Bigtable) SaveERC20Metadata ¶
func (bigtable *Bigtable) SaveERC20Metadata(address []byte, metadata *types.ERC20Metadata) error
func (*Bigtable) SaveERC20TokenPrices ¶
func (bigtable *Bigtable) SaveERC20TokenPrices(prices []*types.ERC20TokenPrice) error
func (*Bigtable) SaveGasNowHistory ¶
func (*Bigtable) SaveMachineMetric ¶
func (*Bigtable) SaveMethodSignatureImportStatus ¶
func (bigtable *Bigtable) SaveMethodSignatureImportStatus(status types.MethodSignatureImportStatus) error
Save the status of the last signature import run
func (*Bigtable) SaveMethodSignatures ¶
func (bigtable *Bigtable) SaveMethodSignatures(signatures []types.MethodSignature) error
Save a list of method signatures
func (*Bigtable) SaveProposalAssignments ¶
func (*Bigtable) SaveProposals ¶
func (*Bigtable) SaveSyncComitteeDuties ¶
func (*Bigtable) SaveSyncCommitteesAssignments ¶
func (*Bigtable) SaveValidatorBalances ¶
func (*Bigtable) SaveValidatorIncomeDetails ¶
func (*Bigtable) SearchForAddress ¶
func (*Bigtable) TransformBlock ¶
func (bigtable *Bigtable) TransformBlock(block *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
TransformBlock extracts blocks from bigtable more specifically from the table blocks. It transforms the block and strips any information that is not necessary for a blocks view It writes blocks to table data: Row: <chainID>:B:<reversePaddedBlockNumber> Family: f Column: data Cell: Proto<Eth1BlockIndexed>
It indexes blocks by: Row: <chainID>:I:B:<Miner>:<reversePaddedBlockNumber> Family: f Column: <chainID>:B:<reversePaddedBlockNumber> Cell: nil
func (*Bigtable) TransformERC1155 ¶
func (bigtable *Bigtable) TransformERC1155(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
TransformERC1155 accepts an eth1 block and creates bigtable mutations for erc1155 transfer events. Example: https://etherscan.io/tx/0xcffdd4b44ba9361a769a559c360293333d09efffeab79c36125bb4b20bd04270#eventlog It transforms the logs contained within a block and writes the transformed logs to bigtable It writes erc1155 events to the table data: Row: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Family: f Column: data Cell: Proto<Eth1ERC1155Indexed> Example scan: "1:ERC1155:cffdd4b44ba9361a769a559c360293333d09efffeab79c36125bb4b20bd04270" returns mainnet erc1155 event(s) for transaction 0xcffdd4b44ba9361a769a559c360293333d09efffeab79c36125bb4b20bd04270
It indexes erc1155 events by: Row: <chainID>:I:ERC1155:<FROM_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC1155:<TO_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC1155:<TOKEN_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC1155:<TO_ADDRESS>:TO:<FROM_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC1155:<FROM_ADDRESS>:FROM:<TO_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC1155:<FROM_ADDRESS>:TOKEN_SENT:<TOKEN_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC1155:<TO_ADDRESS>:TOKEN_RECEIVED:<TOKEN_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC1155:<txHash>:<paddedLogIndex> Cell: nil
func (*Bigtable) TransformERC20 ¶
func (bigtable *Bigtable) TransformERC20(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
https://etherscan.io/tx/0xb10588bde42cb8eb14e72d24088bd71ad3903857d23d50b3ba4187c0cb7d3646#eventlog TransformERC20 accepts an eth1 block and creates bigtable mutations for ERC20 transfer events. It transforms the logs contained within a block and writes the transformed logs to bigtable It writes ERC20 events to the table data: Row: <chainID>:ERC20:<txHash>:<paddedLogIndex> Family: f Column: data Cell: Proto<Eth1ERC20Indexed> Example scan: "1:ERC20:b10588bde42cb8eb14e72d24088bd71ad3903857d23d50b3ba4187c0cb7d3646" returns mainnet ERC20 event(s) for transaction 0xb10588bde42cb8eb14e72d24088bd71ad3903857d23d50b3ba4187c0cb7d3646
It indexes ERC20 events by: Row: <chainID>:I:ERC20:<TOKEN_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC20:<FROM_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC20:<TO_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC20:<FROM_ADDRESS>:TO:<TO_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC20:<TO_ADDRESS>:FROM:<FROM_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC20:<FROM_ADDRESS>:TOKEN_SENT:<TOKEN_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC20:<TO_ADDRESS>:TOKEN_RECEIVED:<TOKEN_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC20:<txHash>:<paddedLogIndex> Cell: nil
func (*Bigtable) TransformERC721 ¶
func (bigtable *Bigtable) TransformERC721(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
example: https://etherscan.io/tx/0x4d3a6c56cecb40637c070601c275df9cc7b599b5dc1d5ac2473c92c7a9e62c64#eventlog TransformERC721 accepts an eth1 block and creates bigtable mutations for erc721 transfer events. It transforms the logs contained within a block and writes the transformed logs to bigtable It writes erc721 events to the table data: Row: <chainID>:ERC721:<txHash>:<paddedLogIndex> Family: f Column: data Cell: Proto<Eth1ERC721Indexed> Example scan: "1:ERC721:4d3a6c56cecb40637c070601c275df9cc7b599b5dc1d5ac2473c92c7a9e62c64" returns mainnet ERC721 event(s) for transaction 0x4d3a6c56cecb40637c070601c275df9cc7b599b5dc1d5ac2473c92c7a9e62c64
It indexes ERC721 events by: Row: <chainID>:I:ERC721:<FROM_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC721:<TO_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC721:<TOKEN_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC721:<FROM_ADDRESS>:TO:<TO_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC721:<TO_ADDRESS>:FROM:<FROM_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC721:<FROM_ADDRESS>:TOKEN_SENT:<TOKEN_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
Row: <chainID>:I:ERC721:<TO_ADDRESS>:TOKEN_RECEIVED:<TOKEN_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<PaddedLogIndex> Family: f Column: <chainID>:ERC721:<txHash>:<paddedLogIndex> Cell: nil
func (*Bigtable) TransformItx ¶
func (bigtable *Bigtable) TransformItx(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
TransformItx extracts internal transactions from bigtable more specifically from the table blocks. It transforms the internal transactions contained within a block and strips any information that is not necessary for our frontend views It writes internal transactions to table data: Row: <chainID>:ITX:<TX_HASH>:<paddedITXIndex> Family: f Column: data Cell: Proto<Eth1InternalTransactionIndexed>
It indexes internal transactions by: Row: <chainID>:I:ITX:<FROM_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<paddedITXIndex> Family: f Column: <chainID>:ITX:<HASH>:<paddedITXIndex> Cell: nil Row: <chainID>:I:ITX:<TO_ADDRESS>:TIME:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<paddedITXIndex> Family: f Column: <chainID>:ITX:<HASH>:<paddedITXIndex> Cell: nil Row: <chainID>:I:ITX:<FROM_ADDRESS>:TO:<TO_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<paddedITXIndex> Family: f Column: <chainID>:ITX:<HASH>:<paddedITXIndex> Cell: nil Row: <chainID>:I:ITX:<TO_ADDRESS>:FROM:<FROM_ADDRESS>:<reversePaddedBigtableTimestamp>:<paddedTxIndex>:<paddedITXIndex> Family: f Column: <chainID>:ITX:<HASH>:<paddedITXIndex> Cell: nil
func (*Bigtable) TransformTx ¶
func (bigtable *Bigtable) TransformTx(blk *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
TransformTx extracts transactions from bigtable more specifically from the table blocks.
func (*Bigtable) TransformUncle ¶
func (bigtable *Bigtable) TransformUncle(block *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
TransformUncle accepts an eth1 block and creates bigtable mutations. It transforms the uncles contained within a block, extracts the necessary information to create a view and writes that information to bigtable It writes uncles to table data: Row: <chainID>:U:<reversePaddedNumber> Family: f Column: data Cell: Proto<Eth1UncleIndexed> Example scan: "1:U:" returns mainnet uncles mined in desc order Example scan: "1:U:984886725" returns mainnet uncles mined after block 15113275 (1000000000 - 984886725)
It indexes uncles by: Row: <chainID>:I:U:<Miner>:TIME:<reversePaddedBigtableTimestamp> Family: f Column: <chainID>:U:<reversePaddedNumber> Cell: nil Example lookup: "1:I:U:ea674fdde714fd979de3edf0f56aa9716b898ec8:TIME:" returns mainnet uncles mined by ethermine in desc order
func (*Bigtable) TransformWithdrawals ¶
func (bigtable *Bigtable) TransformWithdrawals(block *types.Eth1Block, cache *freecache.Cache) (bulkData *types.BulkMutations, bulkMetadataUpdates *types.BulkMutations, err error)
TransformWithdrawals accepts an eth1 block and creates bigtable mutations. It transforms the withdrawals contained within a block, extracts the necessary information to create a view and writes that information to bigtable It writes uncles to table data: Row: <chainID>:W:<reversePaddedNumber>:<reversedWithdrawalIndex> Family: f Column: data Cell: Proto<Eth1WithdrawalIndexed> Example scan: "1:W:" returns withdrawals in desc order Example scan: "1:W:984886725" returns mainnet withdrawals included after block 15113275 (1000000000 - 984886725)
It indexes withdrawals by: Row: <chainID>:I:W:<Address>:TIME:<reversePaddedBigtableTimestamp> Family: f Column: <chainID>:W:<reversePaddedNumber> Cell: nil Example lookup: "1:I:W:ea674fdde714fd979de3edf0f56aa9716b898ec8:TIME:" returns withdrawals received by ethermine in desc order
func (*Bigtable) WriteBulk ¶
func (bigtable *Bigtable) WriteBulk(mutations *types.BulkMutations, table *gcp_bigtable.Table) error
type BigtableAdmin ¶
type BigtableAdmin struct {
// contains filtered or unexported fields
}
var BigAdminClient *BigtableAdmin
func (*BigtableAdmin) SetupBigtableCache ¶
func (admin *BigtableAdmin) SetupBigtableCache() error
func (*BigtableAdmin) TearDownCache ¶
func (admin *BigtableAdmin) TearDownCache() error
type CreateFamily ¶
type CreateFamily struct { Name string Policy gcp_bigtable.GCPolicy }
type CreateTables ¶
type CreateTables struct { Name string ColFams []CreateFamily }
var CacheTable CreateTables = CreateTables{ cache.TABLE_CACHE, []CreateFamily{ { Name: cache.FAMILY_TEN_MINUTES, Policy: gcp_bigtable.IntersectionPolicy(gcp_bigtable.MaxVersionsPolicy(1), gcp_bigtable.MaxAgePolicy(time.Minute*10)), }, { Name: cache.FAMILY_ONE_HOUR, Policy: gcp_bigtable.IntersectionPolicy(gcp_bigtable.MaxVersionsPolicy(1), gcp_bigtable.MaxAgePolicy(time.Hour)), }, { Name: cache.FAMILY_ONE_DAY, Policy: gcp_bigtable.IntersectionPolicy(gcp_bigtable.MaxVersionsPolicy(1), gcp_bigtable.MaxAgePolicy(time.Hour*24)), }, }, }
type GetSubscriptionsFilter ¶
type GetSubscriptionsFilter struct { EventNames *[]types.EventName UserIDs *[]uint64 EventFilters *[]string Search string Limit uint64 Offset uint64 JoinValidator bool }
GetSubscriptionsFilter can be passed to GetSubscriptions() to filter subscriptions.
type IndexFilter ¶
type IndexFilter string
const ( FILTER_TIME IndexFilter = "TIME" FILTER_TO IndexFilter = "TO" FILTER_FROM IndexFilter = "FROM" FILTER_TOKEN_RECEIVED IndexFilter = "TOKEN_RECEIVED" FILTER_TOKEN_SENT IndexFilter = "TOKEN_SENT" FILTER_METHOD IndexFilter = "METHOD" FILTER_CONTRACT IndexFilter = "CONTRACT" FILTER_ERROR IndexFilter = "ERROR" )
type PremiumResult ¶
func GetUserPremiumPackage ¶
func GetUserPremiumPackage(userID uint64) (PremiumResult, error)