axc

package
v0.0.0-...-4c0c530 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: BSD-3-Clause Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxAggregateIntervalCount = 20000

	MinSearchQueryLength = 1
)

Variables

View Source
var (
	ErrAggregateIntervalCountTooLarge = errors.New("requesting too many intervals")
	ErrFailedToParseStringAsBigInt    = errors.New("failed to parse string to big.Int")
	ErrSearchQueryTooShort            = errors.New("search query too short")
)
View Source
var (
	MaxSerializationLen = (16 * 1024 * 1024) - 1

	// MaxMemoLen is the maximum number of bytes a memo can be in the database
	MaxMemoLen = 1024
)

Functions

This section is empty.

Types

type AddInsContainer

type AddInsContainer struct {
	Ins     []*axc.TransferableInput
	ChainID string
}

type AddOutsContainer

type AddOutsContainer struct {
	Outs    []*axc.TransferableOutput
	Stake   bool
	ChainID string
}

type Reader

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

func NewReader

func NewReader(networkID uint32, conns *utils.Connections, chainConsumers map[string]services.Consumer, axChainCconsumer services.ConsumerAXChain, sc *servicesctrl.Control) (*Reader, error)

func (*Reader) ATxDATA

func (r *Reader) ATxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) AddressChains

func (r *Reader) AddressChains(ctx context.Context, p *params.AddressChainsParams) (*models.AddressChains, error)

func (*Reader) Aggregate

func (*Reader) CTxDATA

func (r *Reader) CTxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) CacheAddressCounts

func (r *Reader) CacheAddressCounts() []*models.ChainCounts

func (*Reader) CacheAggregates

func (r *Reader) CacheAggregates(tag string) *models.AggregatesHistogram

func (*Reader) CacheAssetAggregates

func (r *Reader) CacheAssetAggregates() []*models.AssetAggregate

func (*Reader) CacheAssets

func (r *Reader) CacheAssets() []*models.Asset

func (*Reader) CacheTxCounts

func (r *Reader) CacheTxCounts() []*models.ChainCounts

func (*Reader) ETxDATA

func (r *Reader) ETxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) GetAddress

func (*Reader) GetAsset

func (r *Reader) GetAsset(ctx context.Context, p *params.ListAssetsParams, idStrOrAlias string) (*models.Asset, error)

func (*Reader) GetBlock

func (r *Reader) GetBlock(ctx context.Context, id ids.ID) (*models.Block, error)

func (*Reader) GetOutput

func (r *Reader) GetOutput(ctx context.Context, id ids.ID) (*models.Output, error)

func (*Reader) GetTransaction

func (r *Reader) GetTransaction(ctx context.Context, id ids.ID, axcAssetID ids.ID) (*models.Transaction, error)

func (*Reader) ListAddresses

func (r *Reader) ListAddresses(ctx context.Context, p *params.ListAddressesParams) (*models.AddressList, error)

func (*Reader) ListAssets

func (r *Reader) ListAssets(ctx context.Context, p *params.ListAssetsParams, conns *utils.Connections) (*models.AssetList, error)

func (*Reader) ListBlocks

func (r *Reader) ListBlocks(ctx context.Context, params *params.ListBlocksParams) (*models.BlockList, error)

func (*Reader) ListCTransactions

func (*Reader) ListOutputs

func (r *Reader) ListOutputs(ctx context.Context, p *params.ListOutputsParams) (*models.OutputList, error)

func (*Reader) ListTransactions

func (r *Reader) ListTransactions(ctx context.Context, p *params.ListTransactionsParams, axcAssetID ids.ID) (*models.TransactionList, error)

func (*Reader) PTxDATA

func (r *Reader) PTxDATA(ctx context.Context, p *params.TxDataParam) ([]byte, error)

func (*Reader) RawTransaction

func (r *Reader) RawTransaction(ctx context.Context, id ids.ID) (*models.RawTx, error)

func (*Reader) Search

func (r *Reader) Search(ctx context.Context, p *params.SearchParams, axcAssetID ids.ID) (*models.SearchResults, error)

func (*Reader) TxfeeAggregate

type ReaderAggregate

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

type ReaderAggregateTxList

type ReaderAggregateTxList struct {
	Lock       sync.RWMutex
	Txs        []*models.Transaction
	TxsMap     map[models.StringID]*models.Transaction
	TxsByChain map[models.StringID][]*models.Transaction
}

func (*ReaderAggregateTxList) FindTxs

func (t *ReaderAggregateTxList) FindTxs(chainIDs []string, limit int) []*models.Transaction

func (*ReaderAggregateTxList) First

func (*ReaderAggregateTxList) Get

func (*ReaderAggregateTxList) IsProcessed

func (t *ReaderAggregateTxList) IsProcessed() bool

func (*ReaderAggregateTxList) Set

func (t *ReaderAggregateTxList) Set(txs []*models.Transaction)

type Writer

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

func NewWriter

func NewWriter(chainID string, axcAssetID ids.ID) *Writer

func (*Writer) InsertAddressFromPublicKey

func (w *Writer) InsertAddressFromPublicKey(
	ctx services.ConsumerCtx,
	publicKey crypto.PublicKey,
) error

func (*Writer) InsertOutput

func (w *Writer) InsertOutput(
	ctx services.ConsumerCtx,
	txID ids.ID,
	idx uint32,
	assetID ids.ID,
	out *secp256k1fx.TransferOutput,
	outputType models.OutputType,
	groupID uint32,
	payload []byte,
	stakeLocktime uint64,
	chainID string,
	stake bool,
	frozen bool,
	stakeableout bool,
	genesisutxo bool,
) error

func (*Writer) InsertOutputAddress

func (w *Writer) InsertOutputAddress(
	ctx services.ConsumerCtx,
	outputID ids.ID,
	address ids.ShortID,
	sig []byte,
	txID ids.ID,
	idx uint32,
	chainID string,
) error

func (*Writer) InsertTransaction

func (w *Writer) InsertTransaction(
	ctx services.ConsumerCtx,
	txBytes []byte,
	unsignedBytes []byte,
	baseTx *axc.BaseTx,
	creds []verify.Verifiable,
	txType models.TransactionType,
	addIns *AddInsContainer,
	addOuts *AddOutsContainer,
	addlOutTxfee uint64,
	genesis bool,
) error

func (*Writer) InsertTransactionBase

func (w *Writer) InsertTransactionBase(
	ctx services.ConsumerCtx,
	txID ids.ID,
	chainID string,
	txType string,
	memo []byte,
	txBytes []byte,
	txfee uint64,
	genesis bool,
	networkID uint32,
) error

func (*Writer) InsertTransactionIns

func (w *Writer) InsertTransactionIns(
	idx int,
	ctx services.ConsumerCtx,
	totalin uint64,
	in *axc.TransferableInput,
	txID ids.ID,
	creds []verify.Verifiable,
	unsignedBytes []byte,
	chainID string,
) (uint64, error)

func (*Writer) InsertTransactionOuts

func (w *Writer) InsertTransactionOuts(
	idx uint32,
	ctx services.ConsumerCtx,
	totalout uint64,
	out *axc.TransferableOutput,
	txID ids.ID,
	chainID string,
	stake bool,
	genesisutxo bool,
) (uint64, error)

func (*Writer) ProcessStateOut

func (w *Writer) ProcessStateOut(
	ctx services.ConsumerCtx,
	out verify.State,
	txID ids.ID,
	outputCount uint32,
	assetID ids.ID,
	amount uint64,
	totalout uint64,
	chainID string,
	stake bool,
	genesisutxo bool,
) (uint64, uint64, error)

Jump to

Keyboard shortcuts

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