Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(log *zap.SugaredLogger, indexerClient *indexerv2.Client, algodClient *algodv2.Client, couchClient *kivik.Client, dbName string) Agent
NewAgent constructs an Algorand for api access.
func (Agent) GetRound ¶
func (a Agent) GetRound(ctx context.Context, traceID string, log *zap.SugaredLogger, roundNum uint64) (*blockDb.NewBlock, error)
GetRound retrieves a block based on the round number given It works by first trying the indexer, if there's a connection it fetches the block data from Indexer and the additional data from Couch (this sounds redundant, but this is written with mind of getting rid of Couch in future), if not then it tries Algod, and finally only Couch.
func (Agent) GetTransaction ¶
func (a Agent) GetTransaction(ctx context.Context, traceID string, log *zap.SugaredLogger, transactionID string) (*models.Transaction, error)
GetTransaction retrieves a transaction based on the transaction ID given. It works by first trying the indexer, if there's a connection it fetches the transaction data from Indexer and the additional data from Couch (this sounds redundant, but this is written with mind of getting rid of Couch in future), if not then return the data from Couch.