services

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2021 License: BSD-3-Clause Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TableTransactions                     = "avm_transactions"
	TableOutputsRedeeming                 = "avm_outputs_redeeming"
	TableOutputs                          = "avm_outputs"
	TableAssets                           = "avm_assets"
	TableAddresses                        = "addresses"
	TableAddressChain                     = "address_chain"
	TableOutputAddresses                  = "avm_output_addresses"
	TableTransactionsEpochs               = "transactions_epoch"
	TableCvmAddresses                     = "cvm_addresses"
	TableCvmBlocks                        = "cvm_blocks"
	TableCvmTransactions                  = "cvm_transactions"
	TableCvmTransactionsTxdata            = "cvm_transactions_txdata"
	TablePvmBlocks                        = "pvm_blocks"
	TableRewards                          = "rewards"
	TableTransactionsValidator            = "transactions_validator"
	TableTransactionsBlock                = "transactions_block"
	TableAddressBech32                    = "addresses_bech32"
	TableOutputAddressAccumulateOut       = "output_addresses_accumulate_out"
	TableOutputAddressAccumulateIn        = "output_addresses_accumulate_in"
	TableOutputTxsAccumulate              = "output_txs_accumulate"
	TableAccumulateBalancesReceived       = "accumulate_balances_received"
	TableAccumulateBalancesSent           = "accumulate_balances_sent"
	TableAccumulateBalancesTransactions   = "accumulate_balances_transactions"
	TableTransactionsRewardsOwners        = "transactions_rewards_owners"
	TableTransactionsRewardsOwnersAddress = "transactions_rewards_owners_address"
	TableTransactionsRewardsOwnersOutputs = "transactions_rewards_owners_outputs"
	TableTxPool                           = "tx_pool"
	TableKeyValueStore                    = "key_value_store"
	TableCvmTransactionsTxdataTrace       = "cvm_transactions_txdata_trace"
)
View Source
const (
	MetricProduceProcessedCountKey = "produce_records_processed"
	MetricProduceSuccessCountKey   = "produce_records_success"
	MetricProduceFailureCountKey   = "produce_records_failure"

	MetricConsumeProcessedCountKey       = "consume_records_processed"
	MetricConsumeProcessMillisCounterKey = "consume_records_process_millis"
	MetricConsumeSuccessCountKey         = "consume_records_success"
	MetricConsumeFailureCountKey         = "consume_records_failure"
)

Variables

View Source
var LockSize = 5
View Source
var RowLimitValue = uint64(RowLimitValueBase)
View Source
var RowLimitValueBase = 5000

Functions

func EventErr added in v1.1.3

func EventErr(t string, upd bool, err error) error

func NewQuietStream added in v1.2.3

func NewQuietStream() *health.Stream

func NewRedisConn

func NewRedisConn(opts *redis.Options) (*redis.Client, error)

func NewStream

func NewStream() *health.Stream

func NewStreamDBDups added in v1.2.3

func NewStreamDBDups() *health.Stream

func RepeatForLock added in v1.2.0

func RepeatForLock(f func() error) error

Types

type AccumulateBalancesAmount added in v1.2.0

type AccumulateBalancesAmount struct {
	ID          string
	ChainID     string
	AssetID     string
	Address     string
	TotalAmount string
	UtxoCount   string
	UpdatedAt   time.Time
}

func (*AccumulateBalancesAmount) ComputeID added in v1.2.0

func (b *AccumulateBalancesAmount) ComputeID() error

type AccumulateBalancesTransactions added in v1.2.0

type AccumulateBalancesTransactions struct {
	ID               string
	ChainID          string
	AssetID          string
	Address          string
	TransactionCount string
	UpdatedAt        time.Time
}

func (*AccumulateBalancesTransactions) ComputeID added in v1.2.0

func (b *AccumulateBalancesTransactions) ComputeID() error

type AddressBech32 added in v1.2.0

type AddressBech32 struct {
	Address       string
	Bech32Address string
}

type AddressChain added in v1.1.3

type AddressChain struct {
	Address   string
	ChainID   string
	CreatedAt time.Time
}

type Addresses added in v1.1.3

type Addresses struct {
	Address   string
	PublicKey []byte
	CreatedAt time.Time
}

type Assets added in v1.1.3

type Assets struct {
	ID            string
	ChainID       string
	Name          string
	Symbol        string
	Denomination  byte
	Alias         string
	CurrentSupply uint64
	CreatedAt     time.Time
}

type BalanceAccumulatorManager added in v1.2.0

type BalanceAccumulatorManager struct {
	// contains filtered or unexported fields
}

func NewBalanceAccumulatorManager added in v1.2.3

func NewBalanceAccumulatorManager(persist Persist, sc *Control) (*BalanceAccumulatorManager, error)

func (*BalanceAccumulatorManager) Close added in v1.2.3

func (a *BalanceAccumulatorManager) Close()

func (*BalanceAccumulatorManager) Run added in v1.2.0

func (a *BalanceAccumulatorManager) Run(sc *Control)

func (*BalanceAccumulatorManager) Start added in v1.2.3

func (a *BalanceAccumulatorManager) Start() error

type BalancerAccumulateHandler added in v1.2.0

type BalancerAccumulateHandler struct {
}

type Connections

type Connections struct {
	// contains filtered or unexported fields
}

func NewConnections

func NewConnections(s *health.Stream, quietStream *health.Stream, streamDBDedup *health.Stream, db *db.Conn, r *redis.Client) *Connections

func NewConnectionsFromConfig

func NewConnectionsFromConfig(conf cfg.Services, ro bool) (*Connections, error)

func NewDBFromConfig added in v1.2.0

func NewDBFromConfig(conf cfg.Services, ro bool) (*Connections, error)

func (Connections) Cache

func (c Connections) Cache() *cache.Cache

func (Connections) Close added in v1.1.0

func (c Connections) Close() error

func (Connections) DB

func (c Connections) DB() *db.Conn

func (Connections) QuietStream added in v1.2.3

func (c Connections) QuietStream() *health.Stream

func (Connections) Redis

func (c Connections) Redis() *redis.Client

func (Connections) Stream

func (c Connections) Stream() *health.Stream

func (Connections) StreamDBDedup added in v1.2.3

func (c Connections) StreamDBDedup() *health.Stream

type Consumable

type Consumable interface {
	ID() string
	ChainID() string
	Body() []byte
	Timestamp() int64
	Nanosecond() int64
	KafkaMessage() *kafkaMessage.Message
}

type Consumer

type Consumer interface {
	Name() string
	Bootstrap(context.Context, *Connections, Persist) error
	Consume(context.Context, *Connections, Consumable, Persist) error
	ConsumeConsensus(context.Context, *Connections, Consumable, Persist) error
	ParseJSON([]byte) ([]byte, error)
}

Consumer takes in Consumables and adds them to the service's backend

type ConsumerCChain added in v1.2.0

type ConsumerCChain interface {
	Name() string
	Consume(context.Context, *Connections, Consumable, *cblock.Block, Persist) error
	ParseJSON([]byte) ([]byte, error)
}

type ConsumerCtx

type ConsumerCtx struct {
	// contains filtered or unexported fields
}

ConsumerCtx

func NewConsumerContext

func NewConsumerContext(
	ctx context.Context,
	job *health.Job,
	db dbr.SessionRunner,
	ts int64,
	nanosecond int64,
	persist Persist,
) ConsumerCtx

func (*ConsumerCtx) Ctx

func (ic *ConsumerCtx) Ctx() context.Context

func (*ConsumerCtx) DB

func (ic *ConsumerCtx) DB() dbr.SessionRunner

func (*ConsumerCtx) Job

func (ic *ConsumerCtx) Job() *health.Job

func (*ConsumerCtx) Persist added in v1.1.3

func (ic *ConsumerCtx) Persist() Persist

func (*ConsumerCtx) Time

func (ic *ConsumerCtx) Time() time.Time

type Control added in v1.1.3

type Control struct {
	Services                   cfg.Services
	Log                        logging.Logger
	Persist                    Persist
	Features                   map[string]struct{}
	BalanceAccumulatorManager  *BalanceAccumulatorManager
	GenesisContainer           *GenesisContainer
	IsAccumulateBalanceIndexer bool
	IsAccumulateBalanceReader  bool
	IsDisableBootstrap         bool
	IsAggregateCache           bool
}

func (*Control) DatabaseOnly added in v1.2.0

func (s *Control) DatabaseOnly() (*Connections, error)

func (*Control) DatabaseRO added in v1.1.3

func (s *Control) DatabaseRO() (*Connections, error)

func (*Control) Init added in v1.1.3

func (s *Control) Init(networkID uint32) error

func (*Control) InitConsumeMetrics added in v1.1.3

func (s *Control) InitConsumeMetrics()

func (*Control) InitProduceMetrics added in v1.1.3

func (s *Control) InitProduceMetrics()

type CvmAddresses added in v1.1.3

type CvmAddresses struct {
	ID            string
	Type          models.CChainType
	Idx           uint64
	TransactionID string
	Address       string
	AssetID       string
	Amount        uint64
	Nonce         uint64
	CreatedAt     time.Time
}

type CvmBlocks added in v1.2.3

type CvmBlocks struct {
	Block     string
	CreatedAt time.Time
}

type CvmTransactions added in v1.1.3

type CvmTransactions struct {
	ID            string
	TransactionID string
	Type          models.CChainType
	BlockchainID  string
	Block         string
	CreatedAt     time.Time
	Serialization []byte
	TxTime        time.Time
	Nonce         uint64
	Hash          string
	ParentHash    string
}

type CvmTransactionsTxdata added in v1.2.0

type CvmTransactionsTxdata struct {
	Hash          string
	Block         string
	Idx           uint64
	Rcpt          string
	Nonce         uint64
	Serialization []byte
	CreatedAt     time.Time
}

type CvmTransactionsTxdataTrace added in v1.2.3

type CvmTransactionsTxdataTrace struct {
	Hash          string
	Idx           uint32
	ToAddr        string
	FromAddr      string
	CallType      string
	Type          string
	Serialization []byte
	CreatedAt     time.Time
}

type GenesisContainer added in v1.2.0

type GenesisContainer struct {
	NetworkID       uint32
	XChainGenesisTx *platformvm.Tx
	XChainID        ids.ID
	AvaxAssetID     ids.ID
	GenesisBytes    []byte
}

func NewGenesisContainer added in v1.2.0

func NewGenesisContainer(networkID uint32) (*GenesisContainer, error)

type KeyValueStore added in v1.2.3

type KeyValueStore struct {
	K string
	V string
}

type MockPersist added in v1.1.3

type MockPersist struct {
	Transactions                     map[string]*Transactions
	Outputs                          map[string]*Outputs
	OutputsRedeeming                 map[string]*OutputsRedeeming
	CvmTransactions                  map[string]*CvmTransactions
	CvmTransactionsTxdata            map[string]*CvmTransactionsTxdata
	CvmBlocks                        map[string]*CvmBlocks
	CvmAddresses                     map[string]*CvmAddresses
	TransactionsValidator            map[string]*TransactionsValidator
	TransactionsBlock                map[string]*TransactionsBlock
	Rewards                          map[string]*Rewards
	Addresses                        map[string]*Addresses
	AddressChain                     map[string]*AddressChain
	OutputAddresses                  map[string]*OutputAddresses
	Assets                           map[string]*Assets
	TransactionsEpoch                map[string]*TransactionsEpoch
	PvmBlocks                        map[string]*PvmBlocks
	AddressBech32                    map[string]*AddressBech32
	OutputAddressAccumulateOut       map[string]*OutputAddressAccumulate
	OutputAddressAccumulateIn        map[string]*OutputAddressAccumulate
	OutputTxsAccumulate              map[string]*OutputTxsAccumulate
	AccumulateBalancesReceived       map[string]*AccumulateBalancesAmount
	AccumulateBalancesSent           map[string]*AccumulateBalancesAmount
	AccumulateBalancesTransactions   map[string]*AccumulateBalancesTransactions
	TransactionsRewardsOwnersAddress map[string]*TransactionsRewardsOwnersAddress
	TransactionsRewardsOwnersOutputs map[string]*TransactionsRewardsOwnersOutputs
	TransactionsRewardsOwners        map[string]*TransactionsRewardsOwners
	TxPool                           map[string]*TxPool
	KeyValueStore                    map[string]*KeyValueStore
	CvmTransactionsTxdataTrace       map[string]*CvmTransactionsTxdataTrace
	// contains filtered or unexported fields
}

func NewPersistMock added in v1.1.3

func NewPersistMock() *MockPersist

func (*MockPersist) InsertAccumulateBalancesReceived added in v1.2.0

func (m *MockPersist) InsertAccumulateBalancesReceived(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) error

func (*MockPersist) InsertAccumulateBalancesSent added in v1.2.0

func (m *MockPersist) InsertAccumulateBalancesSent(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) error

func (*MockPersist) InsertAccumulateBalancesTransactions added in v1.2.0

func (m *MockPersist) InsertAccumulateBalancesTransactions(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesTransactions) error

func (*MockPersist) InsertAddressBech32 added in v1.2.0

func (m *MockPersist) InsertAddressBech32(ctx context.Context, runner dbr.SessionRunner, v *AddressBech32, b bool) error

func (*MockPersist) InsertAddressChain added in v1.1.3

func (m *MockPersist) InsertAddressChain(ctx context.Context, runner dbr.SessionRunner, v *AddressChain, b bool) error

func (*MockPersist) InsertAddresses added in v1.1.3

func (m *MockPersist) InsertAddresses(ctx context.Context, runner dbr.SessionRunner, v *Addresses, b bool) error

func (*MockPersist) InsertAssets added in v1.1.3

func (m *MockPersist) InsertAssets(ctx context.Context, runner dbr.SessionRunner, v *Assets, b bool) error

func (*MockPersist) InsertCvmAddresses added in v1.1.3

func (m *MockPersist) InsertCvmAddresses(ctx context.Context, runner dbr.SessionRunner, v *CvmAddresses, b bool) error

func (*MockPersist) InsertCvmBlocks added in v1.2.3

func (m *MockPersist) InsertCvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *CvmBlocks) error

func (*MockPersist) InsertCvmTransactions added in v1.1.3

func (m *MockPersist) InsertCvmTransactions(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactions, b bool) error

func (*MockPersist) InsertCvmTransactionsTxdata added in v1.2.0

func (m *MockPersist) InsertCvmTransactionsTxdata(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsTxdata, b bool) error

func (*MockPersist) InsertCvmTransactionsTxdataTrace added in v1.2.3

func (m *MockPersist) InsertCvmTransactionsTxdataTrace(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsTxdataTrace, _ bool) error

func (*MockPersist) InsertKeyValueStore added in v1.2.3

func (m *MockPersist) InsertKeyValueStore(ctx context.Context, runner dbr.SessionRunner, v *KeyValueStore) error

func (*MockPersist) InsertOutputAddressAccumulateIn added in v1.2.0

func (m *MockPersist) InsertOutputAddressAccumulateIn(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate, _ bool) error

func (*MockPersist) InsertOutputAddressAccumulateOut added in v1.2.0

func (m *MockPersist) InsertOutputAddressAccumulateOut(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate, _ bool) error

func (*MockPersist) InsertOutputAddresses added in v1.1.3

func (m *MockPersist) InsertOutputAddresses(ctx context.Context, runner dbr.SessionRunner, v *OutputAddresses, b bool) error

func (*MockPersist) InsertOutputTxsAccumulate added in v1.2.0

func (m *MockPersist) InsertOutputTxsAccumulate(ctx context.Context, runner dbr.SessionRunner, v *OutputTxsAccumulate) error

func (*MockPersist) InsertOutputs added in v1.1.3

func (m *MockPersist) InsertOutputs(ctx context.Context, runner dbr.SessionRunner, v *Outputs, b bool) error

func (*MockPersist) InsertOutputsRedeeming added in v1.1.3

func (m *MockPersist) InsertOutputsRedeeming(ctx context.Context, runner dbr.SessionRunner, v *OutputsRedeeming, b bool) error

func (*MockPersist) InsertPvmBlocks added in v1.1.3

func (m *MockPersist) InsertPvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *PvmBlocks, b bool) error

func (*MockPersist) InsertRewards added in v1.1.3

func (m *MockPersist) InsertRewards(ctx context.Context, runner dbr.SessionRunner, v *Rewards, b bool) error

func (*MockPersist) InsertTransactions added in v1.2.0

func (m *MockPersist) InsertTransactions(ctx context.Context, runner dbr.SessionRunner, v *Transactions, b bool) error

func (*MockPersist) InsertTransactionsBlock added in v1.1.3

func (m *MockPersist) InsertTransactionsBlock(ctx context.Context, runner dbr.SessionRunner, v *TransactionsBlock, b bool) error

func (*MockPersist) InsertTransactionsEpoch added in v1.1.3

func (m *MockPersist) InsertTransactionsEpoch(ctx context.Context, runner dbr.SessionRunner, v *TransactionsEpoch, b bool) error

func (*MockPersist) InsertTransactionsRewardsOwners added in v1.2.3

func (m *MockPersist) InsertTransactionsRewardsOwners(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwners, b bool) error

func (*MockPersist) InsertTransactionsRewardsOwnersAddress added in v1.2.3

func (m *MockPersist) InsertTransactionsRewardsOwnersAddress(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersAddress, b bool) error

func (*MockPersist) InsertTransactionsRewardsOwnersOutputs added in v1.2.3

func (m *MockPersist) InsertTransactionsRewardsOwnersOutputs(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersOutputs, b bool) error

func (*MockPersist) InsertTransactionsValidator added in v1.1.3

func (m *MockPersist) InsertTransactionsValidator(ctx context.Context, runner dbr.SessionRunner, v *TransactionsValidator, b bool) error

func (*MockPersist) InsertTxPool added in v1.2.3

func (m *MockPersist) InsertTxPool(ctx context.Context, runner dbr.SessionRunner, v *TxPool) error

func (*MockPersist) QueryAccumulateBalancesReceived added in v1.2.0

func (m *MockPersist) QueryAccumulateBalancesReceived(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) (*AccumulateBalancesAmount, error)

func (*MockPersist) QueryAccumulateBalancesSent added in v1.2.0

func (m *MockPersist) QueryAccumulateBalancesSent(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesAmount) (*AccumulateBalancesAmount, error)

func (*MockPersist) QueryAccumulateBalancesTransactions added in v1.2.0

func (m *MockPersist) QueryAccumulateBalancesTransactions(ctx context.Context, runner dbr.SessionRunner, v *AccumulateBalancesTransactions) (*AccumulateBalancesTransactions, error)

func (*MockPersist) QueryAddressBech32 added in v1.2.0

func (m *MockPersist) QueryAddressBech32(ctx context.Context, runner dbr.SessionRunner, v *AddressBech32) (*AddressBech32, error)

func (*MockPersist) QueryAddressChain added in v1.1.3

func (m *MockPersist) QueryAddressChain(ctx context.Context, runner dbr.SessionRunner, v *AddressChain) (*AddressChain, error)

func (*MockPersist) QueryAddresses added in v1.1.3

func (m *MockPersist) QueryAddresses(ctx context.Context, runner dbr.SessionRunner, v *Addresses) (*Addresses, error)

func (*MockPersist) QueryAssets added in v1.1.3

func (m *MockPersist) QueryAssets(ctx context.Context, runner dbr.SessionRunner, v *Assets) (*Assets, error)

func (*MockPersist) QueryCvmAddresses added in v1.1.3

func (m *MockPersist) QueryCvmAddresses(ctx context.Context, runner dbr.SessionRunner, v *CvmAddresses) (*CvmAddresses, error)

func (*MockPersist) QueryCvmBlocks added in v1.2.3

func (m *MockPersist) QueryCvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *CvmBlocks) (*CvmBlocks, error)

func (*MockPersist) QueryCvmTransactions added in v1.1.3

func (m *MockPersist) QueryCvmTransactions(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactions) (*CvmTransactions, error)

func (*MockPersist) QueryCvmTransactionsTxdata added in v1.2.0

func (m *MockPersist) QueryCvmTransactionsTxdata(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsTxdata) (*CvmTransactionsTxdata, error)

func (*MockPersist) QueryCvmTransactionsTxdataTrace added in v1.2.3

func (m *MockPersist) QueryCvmTransactionsTxdataTrace(ctx context.Context, runner dbr.SessionRunner, v *CvmTransactionsTxdataTrace) (*CvmTransactionsTxdataTrace, error)

func (*MockPersist) QueryKeyValueStore added in v1.2.3

func (m *MockPersist) QueryKeyValueStore(ctx context.Context, runner dbr.SessionRunner, v *KeyValueStore) (*KeyValueStore, error)

func (*MockPersist) QueryOutputAddressAccumulateIn added in v1.2.0

func (m *MockPersist) QueryOutputAddressAccumulateIn(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate) (*OutputAddressAccumulate, error)

func (*MockPersist) QueryOutputAddressAccumulateOut added in v1.2.0

func (m *MockPersist) QueryOutputAddressAccumulateOut(ctx context.Context, runner dbr.SessionRunner, v *OutputAddressAccumulate) (*OutputAddressAccumulate, error)

func (*MockPersist) QueryOutputAddresses added in v1.1.3

func (m *MockPersist) QueryOutputAddresses(ctx context.Context, runner dbr.SessionRunner, v *OutputAddresses) (*OutputAddresses, error)

func (*MockPersist) QueryOutputTxsAccumulate added in v1.2.0

func (m *MockPersist) QueryOutputTxsAccumulate(ctx context.Context, runner dbr.SessionRunner, v *OutputTxsAccumulate) (*OutputTxsAccumulate, error)

func (*MockPersist) QueryOutputs added in v1.1.3

func (m *MockPersist) QueryOutputs(ctx context.Context, runner dbr.SessionRunner, v *Outputs) (*Outputs, error)

func (*MockPersist) QueryOutputsRedeeming added in v1.1.3

func (m *MockPersist) QueryOutputsRedeeming(ctx context.Context, runner dbr.SessionRunner, v *OutputsRedeeming) (*OutputsRedeeming, error)

func (*MockPersist) QueryPvmBlocks added in v1.1.3

func (m *MockPersist) QueryPvmBlocks(ctx context.Context, runner dbr.SessionRunner, v *PvmBlocks) (*PvmBlocks, error)

func (*MockPersist) QueryRewards added in v1.1.3

func (m *MockPersist) QueryRewards(ctx context.Context, runner dbr.SessionRunner, v *Rewards) (*Rewards, error)

func (*MockPersist) QueryTransactions added in v1.1.3

func (m *MockPersist) QueryTransactions(ctx context.Context, runner dbr.SessionRunner, v *Transactions) (*Transactions, error)

func (*MockPersist) QueryTransactionsBlock added in v1.1.3

func (m *MockPersist) QueryTransactionsBlock(ctx context.Context, runner dbr.SessionRunner, v *TransactionsBlock) (*TransactionsBlock, error)

func (*MockPersist) QueryTransactionsEpoch added in v1.1.3

func (m *MockPersist) QueryTransactionsEpoch(ctx context.Context, runner dbr.SessionRunner, v *TransactionsEpoch) (*TransactionsEpoch, error)

func (*MockPersist) QueryTransactionsRewardsOwners added in v1.2.3

func (m *MockPersist) QueryTransactionsRewardsOwners(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwners) (*TransactionsRewardsOwners, error)

func (*MockPersist) QueryTransactionsRewardsOwnersAddress added in v1.2.3

func (m *MockPersist) QueryTransactionsRewardsOwnersAddress(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersAddress) (*TransactionsRewardsOwnersAddress, error)

func (*MockPersist) QueryTransactionsRewardsOwnersOutputs added in v1.2.3

func (m *MockPersist) QueryTransactionsRewardsOwnersOutputs(ctx context.Context, runner dbr.SessionRunner, v *TransactionsRewardsOwnersOutputs) (*TransactionsRewardsOwnersOutputs, error)

func (*MockPersist) QueryTransactionsValidator added in v1.1.3

func (m *MockPersist) QueryTransactionsValidator(ctx context.Context, runner dbr.SessionRunner, v *TransactionsValidator) (*TransactionsValidator, error)

func (*MockPersist) QueryTxPool added in v1.2.3

func (m *MockPersist) QueryTxPool(ctx context.Context, runner dbr.SessionRunner, v *TxPool) (*TxPool, error)

func (*MockPersist) UpdateOutputAddressAccumulateInOutputsProcessed added in v1.2.3

func (m *MockPersist) UpdateOutputAddressAccumulateInOutputsProcessed(ctx context.Context, runner dbr.SessionRunner, id string) error

func (*MockPersist) UpdateOutputAddresses added in v1.1.3

func (m *MockPersist) UpdateOutputAddresses(ctx context.Context, runner dbr.SessionRunner, v *OutputAddresses) error

func (*MockPersist) UpdateTxPoolStatus added in v1.2.3

func (m *MockPersist) UpdateTxPoolStatus(ctx context.Context, runner dbr.SessionRunner, v *TxPool) error

type OutputAddressAccumulate added in v1.2.0

type OutputAddressAccumulate struct {
	ID              string
	OutputID        string
	Address         string
	Processed       int
	OutputProcessed int
	TransactionID   string
	OutputIndex     uint32
	CreatedAt       time.Time
}

func (*OutputAddressAccumulate) ComputeID added in v1.2.0

func (b *OutputAddressAccumulate) ComputeID() error

type OutputAddresses added in v1.1.3

type OutputAddresses struct {
	OutputID           string
	Address            string
	RedeemingSignature []byte
	CreatedAt          time.Time
}

type OutputTxsAccumulate added in v1.2.0

type OutputTxsAccumulate struct {
	ID            string
	ChainID       string
	AssetID       string
	Address       string
	TransactionID string
	Processed     int
	CreatedAt     time.Time
}

func (*OutputTxsAccumulate) ComputeID added in v1.2.0

func (b *OutputTxsAccumulate) ComputeID() error

type Outputs added in v1.1.3

type Outputs struct {
	ID            string
	ChainID       string
	TransactionID string
	OutputIndex   uint32
	OutputType    models.OutputType
	AssetID       string
	Amount        uint64
	Locktime      uint64
	Threshold     uint32
	GroupID       uint32
	Payload       []byte
	StakeLocktime uint64
	Stake         bool
	Frozen        bool
	Stakeableout  bool
	Genesisutxo   bool
	CreatedAt     time.Time
}

type OutputsRedeeming added in v1.1.3

type OutputsRedeeming struct {
	ID                     string
	RedeemedAt             time.Time
	RedeemingTransactionID string
	Amount                 uint64
	OutputIndex            uint32
	Intx                   string
	AssetID                string
	ChainID                string
	CreatedAt              time.Time
}

type Persist added in v1.1.3

type Persist interface {
	QueryTransactions(
		context.Context,
		dbr.SessionRunner,
		*Transactions,
	) (*Transactions, error)
	InsertTransactions(
		context.Context,
		dbr.SessionRunner,
		*Transactions,
		bool,
	) error

	QueryOutputsRedeeming(
		context.Context,
		dbr.SessionRunner,
		*OutputsRedeeming,
	) (*OutputsRedeeming, error)
	InsertOutputsRedeeming(
		context.Context,
		dbr.SessionRunner,
		*OutputsRedeeming,
		bool,
	) error

	QueryOutputs(
		context.Context,
		dbr.SessionRunner,
		*Outputs,
	) (*Outputs, error)
	InsertOutputs(
		context.Context,
		dbr.SessionRunner,
		*Outputs,
		bool,
	) error

	QueryAssets(
		context.Context,
		dbr.SessionRunner,
		*Assets,
	) (*Assets, error)
	InsertAssets(
		context.Context,
		dbr.SessionRunner,
		*Assets,
		bool,
	) error

	QueryAddresses(
		context.Context,
		dbr.SessionRunner,
		*Addresses,
	) (*Addresses, error)
	InsertAddresses(
		context.Context,
		dbr.SessionRunner,
		*Addresses,
		bool,
	) error

	QueryAddressChain(
		context.Context,
		dbr.SessionRunner,
		*AddressChain,
	) (*AddressChain, error)

	InsertAddressChain(
		context.Context,
		dbr.SessionRunner,
		*AddressChain,
		bool,
	) error

	QueryOutputAddresses(
		context.Context,
		dbr.SessionRunner,
		*OutputAddresses,
	) (*OutputAddresses, error)
	InsertOutputAddresses(
		context.Context,
		dbr.SessionRunner,
		*OutputAddresses,
		bool,
	) error
	UpdateOutputAddresses(
		context.Context,
		dbr.SessionRunner,
		*OutputAddresses,
	) error

	QueryTransactionsEpoch(
		context.Context,
		dbr.SessionRunner,
		*TransactionsEpoch,
	) (*TransactionsEpoch, error)
	InsertTransactionsEpoch(
		context.Context,
		dbr.SessionRunner,
		*TransactionsEpoch,
		bool,
	) error

	QueryCvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*CvmBlocks,
	) (*CvmBlocks, error)
	InsertCvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*CvmBlocks,
	) error

	QueryCvmAddresses(
		context.Context,
		dbr.SessionRunner,
		*CvmAddresses,
	) (*CvmAddresses, error)
	InsertCvmAddresses(
		context.Context,
		dbr.SessionRunner,
		*CvmAddresses,
		bool,
	) error

	QueryCvmTransactions(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactions,
	) (*CvmTransactions, error)
	InsertCvmTransactions(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactions,
		bool,
	) error

	QueryCvmTransactionsTxdata(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsTxdata,
	) (*CvmTransactionsTxdata, error)
	InsertCvmTransactionsTxdata(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsTxdata,
		bool,
	) error

	QueryPvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*PvmBlocks,
	) (*PvmBlocks, error)
	InsertPvmBlocks(
		context.Context,
		dbr.SessionRunner,
		*PvmBlocks,
		bool,
	) error

	QueryRewards(
		context.Context,
		dbr.SessionRunner,
		*Rewards,
	) (*Rewards, error)
	InsertRewards(
		context.Context,
		dbr.SessionRunner,
		*Rewards,
		bool,
	) error

	QueryTransactionsValidator(
		context.Context,
		dbr.SessionRunner,
		*TransactionsValidator,
	) (*TransactionsValidator, error)
	InsertTransactionsValidator(
		context.Context,
		dbr.SessionRunner,
		*TransactionsValidator,
		bool,
	) error

	QueryTransactionsBlock(
		context.Context,
		dbr.SessionRunner,
		*TransactionsBlock,
	) (*TransactionsBlock, error)

	InsertTransactionsBlock(
		context.Context,
		dbr.SessionRunner,
		*TransactionsBlock,
		bool,
	) error

	QueryAddressBech32(
		context.Context,
		dbr.SessionRunner,
		*AddressBech32,
	) (*AddressBech32, error)
	InsertAddressBech32(
		context.Context,
		dbr.SessionRunner,
		*AddressBech32,
		bool,
	) error

	QueryOutputAddressAccumulateOut(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
	) (*OutputAddressAccumulate, error)
	InsertOutputAddressAccumulateOut(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
		bool,
	) error

	QueryOutputAddressAccumulateIn(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
	) (*OutputAddressAccumulate, error)
	InsertOutputAddressAccumulateIn(
		context.Context,
		dbr.SessionRunner,
		*OutputAddressAccumulate,
		bool,
	) error
	UpdateOutputAddressAccumulateInOutputsProcessed(
		context.Context,
		dbr.SessionRunner,
		string,
	) error

	QueryOutputTxsAccumulate(
		context.Context,
		dbr.SessionRunner,
		*OutputTxsAccumulate,
	) (*OutputTxsAccumulate, error)
	InsertOutputTxsAccumulate(
		context.Context,
		dbr.SessionRunner,
		*OutputTxsAccumulate,
	) error

	QueryAccumulateBalancesReceived(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) (*AccumulateBalancesAmount, error)
	InsertAccumulateBalancesReceived(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) error

	QueryAccumulateBalancesSent(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) (*AccumulateBalancesAmount, error)
	InsertAccumulateBalancesSent(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesAmount,
	) error

	QueryAccumulateBalancesTransactions(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesTransactions,
	) (*AccumulateBalancesTransactions, error)
	InsertAccumulateBalancesTransactions(
		context.Context,
		dbr.SessionRunner,
		*AccumulateBalancesTransactions,
	) error

	QueryTransactionsRewardsOwnersAddress(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersAddress,
	) (*TransactionsRewardsOwnersAddress, error)
	InsertTransactionsRewardsOwnersAddress(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersAddress,
		bool,
	) error

	QueryTransactionsRewardsOwnersOutputs(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersOutputs,
	) (*TransactionsRewardsOwnersOutputs, error)
	InsertTransactionsRewardsOwnersOutputs(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwnersOutputs,
		bool,
	) error

	QueryTransactionsRewardsOwners(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwners,
	) (*TransactionsRewardsOwners, error)
	InsertTransactionsRewardsOwners(
		context.Context,
		dbr.SessionRunner,
		*TransactionsRewardsOwners,
		bool,
	) error

	QueryTxPool(
		context.Context,
		dbr.SessionRunner,
		*TxPool,
	) (*TxPool, error)
	InsertTxPool(
		context.Context,
		dbr.SessionRunner,
		*TxPool,
	) error
	UpdateTxPoolStatus(
		context.Context,
		dbr.SessionRunner,
		*TxPool,
	) error

	QueryKeyValueStore(
		context.Context,
		dbr.SessionRunner,
		*KeyValueStore,
	) (*KeyValueStore, error)
	InsertKeyValueStore(
		context.Context,
		dbr.SessionRunner,
		*KeyValueStore,
	) error

	QueryCvmTransactionsTxdataTrace(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsTxdataTrace,
	) (*CvmTransactionsTxdataTrace, error)
	InsertCvmTransactionsTxdataTrace(
		context.Context,
		dbr.SessionRunner,
		*CvmTransactionsTxdataTrace,
		bool,
	) error
}

func NewPersist added in v1.1.3

func NewPersist() Persist

type PvmBlocks added in v1.1.3

type PvmBlocks struct {
	ID            string
	ChainID       string
	Type          models.BlockType
	ParentID      string
	Serialization []byte
	CreatedAt     time.Time
}

type Rewards added in v1.1.3

type Rewards struct {
	ID                 string
	BlockID            string
	Txid               string
	Shouldprefercommit bool
	CreatedAt          time.Time
}

type Transactions added in v1.1.3

type Transactions struct {
	ID                     string
	ChainID                string
	Type                   string
	Memo                   []byte
	CanonicalSerialization []byte
	Txfee                  uint64
	NetworkID              uint32
	Genesis                bool
	CreatedAt              time.Time
}

type TransactionsBlock added in v1.1.3

type TransactionsBlock struct {
	ID        string
	TxBlockID string
	CreatedAt time.Time
}

type TransactionsEpoch added in v1.1.3

type TransactionsEpoch struct {
	ID        string
	Epoch     uint32
	VertexID  string
	CreatedAt time.Time
}

type TransactionsRewardsOwners added in v1.2.3

type TransactionsRewardsOwners struct {
	ID        string
	ChainID   string
	Threshold uint32
	Locktime  uint64
	CreatedAt time.Time
}

type TransactionsRewardsOwnersAddress added in v1.2.3

type TransactionsRewardsOwnersAddress struct {
	ID          string
	Address     string
	OutputIndex uint32
}

type TransactionsRewardsOwnersOutputs added in v1.2.3

type TransactionsRewardsOwnersOutputs struct {
	ID            string
	TransactionID string
	OutputIndex   uint32
	CreatedAt     time.Time
}

type TransactionsValidator added in v1.1.3

type TransactionsValidator struct {
	ID        string
	NodeID    string
	Start     uint64
	End       uint64
	CreatedAt time.Time
}

type TxPool added in v1.2.3

type TxPool struct {
	ID            string
	NetworkID     uint32
	ChainID       string
	MsgKey        string
	Serialization []byte
	Processed     int
	Topic         string
	CreatedAt     time.Time
}

func (*TxPool) ComputeID added in v1.2.3

func (b *TxPool) ComputeID() error

type WriterSinkExcludeDBDups added in v1.2.3

type WriterSinkExcludeDBDups struct {
	io.Writer
}

func (*WriterSinkExcludeDBDups) EmitComplete added in v1.2.3

func (s *WriterSinkExcludeDBDups) EmitComplete(job string, status health.CompletionStatus, nanos int64, kvs map[string]string)

func (*WriterSinkExcludeDBDups) EmitEvent added in v1.2.3

func (s *WriterSinkExcludeDBDups) EmitEvent(job string, event string, kvs map[string]string)

func (*WriterSinkExcludeDBDups) EmitEventErr added in v1.2.3

func (s *WriterSinkExcludeDBDups) EmitEventErr(job string, event string, inputErr error, kvs map[string]string)

func (*WriterSinkExcludeDBDups) EmitGauge added in v1.2.3

func (s *WriterSinkExcludeDBDups) EmitGauge(job string, event string, value float64, kvs map[string]string)

func (*WriterSinkExcludeDBDups) EmitTiming added in v1.2.3

func (s *WriterSinkExcludeDBDups) EmitTiming(job string, event string, nanos int64, kvs map[string]string)

Directories

Path Synopsis
indexes
avm
cvm
pvm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL