client

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 28 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRoundWaitTimeout = 5 * time.Second
View Source
var DefaultTimeout = 30 * time.Second
View Source
var ErrNoRound = errors.New("no current round found")
View Source
var ErrNotFound = hamt.ErrNotFound
View Source
var ErrTimeout = errors.New("error timeout")

Functions

This section is empty.

Types

type Client

type Client struct {
	Group *types.NotaryGroup
	// contains filtered or unexported fields
}

Client represents a Tupelo client for interacting with and listening to ChainTree events

func New

New instantiates a Client specific to a ChainTree/NotaryGroup. The store should probably be a bitswap peer. The store definitely needs access to the round confirmation, checkpoints, etc

func (*Client) CurrentRound

func (c *Client) CurrentRound() *types.RoundConfirmationWrapper

func (*Client) GetLatest

func (c *Client) GetLatest(parentCtx context.Context, did string) (*consensus.SignedChainTree, error)

func (*Client) GetTip

func (c *Client) GetTip(ctx context.Context, did string) (*gossip.Proof, error)

func (*Client) NewAddBlockRequest

func (c *Client) NewAddBlockRequest(ctx context.Context, tree *consensus.SignedChainTree, treeKey *ecdsa.PrivateKey, transactions []*transactions.Transaction) (*services.AddBlockRequest, error)

func (*Client) PlayTransactions

func (c *Client) PlayTransactions(ctx context.Context, tree *consensus.SignedChainTree, treeKey *ecdsa.PrivateKey, transactions []*transactions.Transaction) (*gossip.Proof, error)

func (*Client) Send

func (c *Client) Send(ctx context.Context, abr *services.AddBlockRequest, timeout time.Duration) (*gossip.Proof, error)

func (*Client) SendWithoutWait

func (c *Client) SendWithoutWait(ctx context.Context, abr *services.AddBlockRequest) error

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

func (*Client) SubscribeToAbr

func (c *Client) SubscribeToAbr(ctx context.Context, abr *services.AddBlockRequest, ch chan *gossip.Proof) (subscription, error)

func (*Client) SubscribeToRounds

func (c *Client) SubscribeToRounds(ctx context.Context, ch chan *types.RoundConfirmationWrapper) (subscription, error)

func (*Client) UnsubscribeFromAbr

func (c *Client) UnsubscribeFromAbr(s subscription)

func (*Client) UnsubscribeFromRounds

func (c *Client) UnsubscribeFromRounds(s subscription)

func (*Client) WaitForFirstRound

func (c *Client) WaitForFirstRound(ctx context.Context, timeout time.Duration) error

type ValidationNotification

type ValidationNotification struct {
	Accepted          []cid.Cid
	Checkpoint        *types.CheckpointWrapper
	RoundConfirmation *types.RoundConfirmationWrapper
	CompletedRound    *types.RoundWrapper
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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