client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrFailedToBroadcastTx = "failed to broadcast transaction"
	ErrTxBufferFull        = "tx buffer is full"
	ErrTxRetryCanceled     = "user canceled tx retry"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ABClient

type ABClient interface {
	SendTransaction(ctx context.Context, tx *types.TransactionOrder) error
	SendTransactionWithRetry(ctx context.Context, tx *types.TransactionOrder, maxTries int) error
	GetBlock(ctx context.Context, blockNumber uint64) ([]byte, error)
	GetBlocks(ctx context.Context, blockNumber, blockCount uint64) (*alphabill.GetBlocksResponse, error)
	GetRoundNumber(ctx context.Context) (uint64, error)
	Close() error
}

ABClient manages connection to alphabill node and implements RPC methods

type AlphabillClient

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

func New

New creates instance of AlphabillClient

func (*AlphabillClient) Close added in v0.2.0

func (c *AlphabillClient) Close() error

func (*AlphabillClient) GetBlock

func (c *AlphabillClient) GetBlock(ctx context.Context, blockNumber uint64) ([]byte, error)

func (*AlphabillClient) GetBlocks added in v0.1.1

func (c *AlphabillClient) GetBlocks(ctx context.Context, blockNumber uint64, blockCount uint64) (res *alphabill.GetBlocksResponse, err error)

func (*AlphabillClient) GetRoundNumber added in v0.2.0

func (c *AlphabillClient) GetRoundNumber(ctx context.Context) (uint64, error)

func (*AlphabillClient) SendTransaction

func (c *AlphabillClient) SendTransaction(ctx context.Context, tx *types.TransactionOrder) error

func (*AlphabillClient) SendTransactionWithRetry added in v0.2.0

func (c *AlphabillClient) SendTransactionWithRetry(ctx context.Context, tx *types.TransactionOrder, maxTries int) error

type AlphabillClientConfig

type AlphabillClientConfig struct {
	Uri          string
	WaitForReady bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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