Documentation ¶
Index ¶
- Variables
- func StreamSync(ctx context.Context) error
- func SubtractSets(a [][]byte, b [][]byte) [][]byte
- func Sync(ctx context.Context, tmc *TendermintClient, st *store.Store, hrp string) (uint, error)
- func ValidatorAddresses(validators []*TendermintValidator) [][]byte
- type ABCIInfo
- type TendermintBlock
- type TendermintClient
- type TendermintCommit
- type TendermintValidator
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotImplemented = errors.Register(2100, "not implemented") ErrFailedResponse = errors.Register(2002, "failed response") )
Functions ¶
func StreamSync ¶
StreamSync is expected to work similar to Sync but to use websocket and never quit unless context was cancelled.
func SubtractSets ¶
SubtractSets returns all elements in a that are not in b
func Sync ¶
Sync uploads to local store all blocks that are not present yet, starting with the blocks with the lowest hight first. It always returns the number of blocks inserted, even if returning an error.
func ValidatorAddresses ¶
func ValidatorAddresses(validators []*TendermintValidator) [][]byte
ValidatorAddresses extracts just the addresses of out a signing set
Types ¶
type TendermintBlock ¶
type TendermintBlock struct { Height int64 Time time.Time Transactions []*bnsd.Tx TransactionHashes [][32]byte }
func FetchBlock ¶
func FetchBlock(ctx context.Context, c *TendermintClient, height int64) (*TendermintBlock, error)
type TendermintClient ¶
type TendermintClient struct {
// contains filtered or unexported fields
}
func DialTendermint ¶
func DialTendermint(websocketURL string) (*TendermintClient, error)
DialTendermint returns a client that is maintains a websocket connection to tendermint API. The websocket is used instead of standard HTTP connection to lower the latency, bypass throttling and to allow subscription requests.
func (*TendermintClient) Close ¶
func (c *TendermintClient) Close() error
func (*TendermintClient) Do ¶
func (c *TendermintClient) Do(method string, dest interface{}, args ...interface{}) error
Do makes a jsonrpc call. This method is safe for concurrent calls.
Use API as described in https://tendermint.com/rpc/
type TendermintCommit ¶
type TendermintCommit struct { Height int64 Hash []byte Time time.Time ProposerAddress []byte ValidatorsHash []byte ParticipantAddresses [][]byte }
func Commit ¶
func Commit(ctx context.Context, c *TendermintClient, height int64) (*TendermintCommit, error)
type TendermintValidator ¶
func Validators ¶
func Validators(ctx context.Context, c *TendermintClient, blockHeight int64) ([]*TendermintValidator, error)
Validators return all validators as represented on the block at given height.