covalent

package module
v1.999.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

covalent-indexer-go

Avro schema update

In case you want to modify the existing avro schema, after you finish your changes, you need to re-generate the corresponding code, by:

  1. Get code generator binary
go install github.com/elodina/go-avro/codegen@v0.1.0.0
  1. Run go generate from schema/codegen.go

Documentation

Index

Constants

View Source
const RetrialTimeoutMS = 50

Variables

View Source
var ErrBlockBodyAssertion = errors.New("error asserting BodyHandler interface of type block body")

ErrBlockBodyAssertion signals that an error occurred when trying to assert BodyHandler interface of type block body

View Source
var ErrCannotCastAccountHandlerToUserAccount = errors.New("cannot cast AccountHandler to UserAccountHandler")

ErrCannotCastAccountHandlerToUserAccount signals an error when trying to cast from AccountHandler to UserAccountHandler

View Source
var ErrNilAccountsAdapter = errors.New("received nil input value: accounts adapter")

ErrNilAccountsAdapter signals that an accounts adapter input parameter is nil

View Source
var ErrNilDataHandler = errors.New("received nil input value: data handler")

ErrNilDataHandler signals that a nil data handler handler has been provided

View Source
var ErrNilHTTPServer = errors.New("received nil input value: http server")

ErrNilHTTPServer signals that a nil http server has been provided

View Source
var ErrNilHasher = errors.New("received nil input value: hasher")

ErrNilHasher signals that a nil hasher has been provided

View Source
var ErrNilMarshaller = errors.New("received nil input value: marshaller")

ErrNilMarshaller signals that a nil marshaller has been provided

View Source
var ErrNilMiniBlockHandler = errors.New("received nil input value: mini block handler")

ErrNilMiniBlockHandler signals that a nil mini block handler has been provided

View Source
var ErrNilPubKeyConverter = errors.New("received nil input value: pub key converter")

ErrNilPubKeyConverter signals that a pub key converter input parameter is nil

View Source
var ErrNilShardCoordinator = errors.New("received nil input value: shard coordinator")

ErrNilShardCoordinator signals that a shard coordinator input parameter is nil

Functions

func NewCovalentDataIndexer

func NewCovalentDataIndexer(processor DataHandler, server *http.Server) (*covalentIndexer, error)

NewCovalentDataIndexer creates a new instance of covalent data indexer, which implements Driver interface and converts protocol input data to covalent required data TODO should refactor as to avoid using *http.Server here. For testing purposes we should use httptest.Server Reason: all unit tests might fail, if for example, the machine that the tests run onto can not open the hardcoded port written in the tests (might have it already open by another process)

Types

type AccountsAdapter

type AccountsAdapter interface {
	LoadAccount(address []byte) (vmcommon.AccountHandler, error)
	IsInterfaceNil() bool
}

type DataHandler

type DataHandler interface {
	ProcessData(args *indexer.ArgsSaveBlockData) (*schema.BlockResult, error)
}

type Driver

type Driver interface {
	SaveBlock(args *indexer.ArgsSaveBlockData) error
	RevertIndexedBlock(header data.HeaderHandler, body data.BodyHandler) error
	SaveRoundsInfo(roundsInfos []*indexer.RoundInfo) error
	SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte, epoch uint32) error
	SaveValidatorsRating(indexID string, infoRating []*indexer.ValidatorRatingInfo) error
	SaveAccounts(blockTimestamp uint64, acc []data.UserAccountHandler) error
	FinalizedBlock(headerHash []byte) error
	Close() error
	IsInterfaceNil() bool
}

Jump to

Keyboard shortcuts

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