algod

package
v0.0.0-...-8401909 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package algod provides the core business API of handling everything algod related.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBlockRawBytes

func ConvertBlockRawBytes(ctx context.Context, rawBlock []byte) (db.NewBlock, error)

ConvertBlockRawBytes processes the block in byte format and returns it in a struct.

func ExtractAccountAddrsFromTxn

func ExtractAccountAddrsFromTxn(txn models.Transaction) []string

func ExtractApplicationIdsFromTxn

func ExtractApplicationIdsFromTxn(txn models.Transaction) []uint64

func ExtractAssetIdsFromTxn

func ExtractAssetIdsFromTxn(txn models.Transaction, block types.Block) []uint64

func PrintBlockInfoFromRawBytes

func PrintBlockInfoFromRawBytes(rawBlock []byte) error

PrintBlockInfoFromRawBytes processes the raw block bytes and prints all the block information out

func PrintTransactionInBlock

func PrintTransactionInBlock(txn types.SignedTxnInBlock, padding int)

func PrintableUTF8OrEmpty

func PrintableUTF8OrEmpty(in string) string

PrintableUTF8OrEmpty checks to see if the entire string is a UTF8 printable string. If this is the case, the string is returned as is. Otherwise, the empty string is returned. https://github.com/algorand/indexer/blob/5ad47734a19f0ff319c7ae852053f45bfc226475/util/util.go#L13

func ProcessTransactionInBlock

func ProcessTransactionInBlock(txn types.SignedTxnInBlock, blockInfo types.Block) models.Transaction

ProcessTransactionInBlock transforms a transaction found inside a block into the desired transaction model References:

https://github.com/algorand/indexer/blob/6e4d737f2e4e49088b436a234caee6681435053d/api/handlers.go
https://github.com/algorand/indexer/blob/fac3b03349d108457abc27c083bd44052590c487/importer/importer.go
https://github.com/algorand/indexer/blob/6e4d737f2e4e49088b436a234caee6681435053d/api/converter_utils.go

Types

type Core

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

func NewCore

func NewCore(log *zap.SugaredLogger, algodClient *algodv2.Client) Core

func (Core) GetAccount

func (c Core) GetAccount(ctx context.Context, traceID string, address string) (*models.Account, error)

GetAccount retrieves account info from the Algod API based on the account address given

func (Core) GetApplication

func (c Core) GetApplication(ctx context.Context, traceID string, appID uint64) (*models.Application, error)

GetApplication retrieves application info from the Algod API based on the application ID given

func (Core) GetAsset

func (c Core) GetAsset(ctx context.Context, traceID string, assetID uint64) (*models.Asset, error)

GetAsset retrieves asset info from the Algod API based on the asset ID given

func (Core) GetCurrentRound

func (c Core) GetCurrentRound(ctx context.Context, traceID string) (*db.NewBlock, error)

GetCurrentRound retrieves retrieves the current block from the Algod API

func (Core) GetCurrentRoundNum

func (c Core) GetCurrentRoundNum(ctx context.Context) (uint64, error)

GetCurrentRoundNum retrieves the current round number from the Algod API

func (Core) GetRound

func (c Core) GetRound(ctx context.Context, traceID string, roundNum uint64) (*db.NewBlock, error)

GetRound retrieves a block from the Algod API based on the round number given

func (Core) GetRoundInRawBytes

func (c Core) GetRoundInRawBytes(ctx context.Context, roundNum uint64) ([]byte, error)

GetRoundInRawBytes retrieves the specified round and returns result in byte format.

func (Core) GetSupply

func (c Core) GetSupply(ctx context.Context, traceID string) (*models.Supply, error)

GetSupply retrieves the current supply reported by the ledger from the Algod API.

Jump to

Keyboard shortcuts

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