l1connection

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0, BSD-2-Clause Imports: 18 Imported by: 1

Documentation

Overview

to be used by utilities like: cluster-tool, wasp-cli, apilib, etc

Index

Constants

This section is empty.

Variables

View Source
var ErrOperationAborted = errors.New("operation was aborted")

ErrOperationAborted is returned when the operation was aborted e.g. by a shutdown signal.

Functions

func MakeSimpleValueTX

func MakeSimpleValueTX(
	client Client,
	sender *cryptolib.KeyPair,
	recipientAddr iotago.Address,
	amount uint64,
) (*iotago.Transaction, error)

Types

type Client

type Client interface {
	// requests funds from faucet, waits for confirmation
	RequestFunds(addr iotago.Address, timeout ...time.Duration) error
	// sends a tx, waits for confirmation
	PostTx(tx *iotago.Transaction, timeout ...time.Duration) error
	// returns the outputs owned by a given address
	OutputMap(myAddress iotago.Address, timeout ...time.Duration) (iotago.OutputSet, error)
	// output
	GetAliasOutput(aliasID iotago.AliasID, timeout ...time.Duration) (iotago.OutputID, iotago.Output, error)
	// used to query the health endpoint of the node
	Health(timeout ...time.Duration) (bool, error)
}

func NewClient

func NewClient(config Config, log *logger.Logger, timeout ...time.Duration) Client

type Config

type Config struct {
	APIAddress    string
	INXAddress    string
	FaucetAddress string
	FaucetKey     *cryptolib.KeyPair
	UseRemotePoW  bool
}

type RefreshTipsFunc

type RefreshTipsFunc = func() (tips iotago.BlockIDs, err error)

RefreshTipsFunc refreshes tips of the block if PoW takes longer than a configured duration.

Jump to

Keyboard shortcuts

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