Documentation ¶
Index ¶
- Variables
- func Bool(b bool) *pb.Arg
- func Bytes(content []byte) *pb.Arg
- func Int32(i int32) *pb.Arg
- func Int64(i int64) *pb.Arg
- func String(content string) *pb.Arg
- func Uint32(i uint32) *pb.Arg
- func Uint64(i uint64) *pb.Arg
- type Client
- type Interchain
- type Logger
- type NodeInfo
- type Option
- type SubscriptionType
- type TransactOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // error type which can be fixed by retrying ErrRecoverable = errors.New("recoverable error") // error type which tx format is invalid to send ErrReconstruct = errors.New("invalid tx format error") // set ibtp and normal nonce at the same time ErrIllegalNonceSet = fmt.Errorf("%w: can't set ibtp nonce and normal nonce at the same time", ErrReconstruct) // signature for tx is invalid ErrSignTx = fmt.Errorf("%w: sign for transaction invalid", ErrReconstruct) // network problem received from grpc ErrBrokenNetwork = fmt.Errorf("%w: grpc broker error", ErrRecoverable) )
Functions ¶
Types ¶
type Client ¶
type Client interface { internal.Launcher // Reset ecdsa key. SetPrivateKey(crypto.PrivateKey) // Send a readonly transaction to link33. If the transaction is writable, // this transaction will not be executed and error wil be returned. SendView(tx *pb.BxhTransaction) (*pb.Receipt, error) // Send a signed transaction to link33. If the signature is illegal, // the transaction hash will be obtained but the transaction receipt is illegal. SendTransaction(tx *pb.BxhTransaction, opts *TransactOpts) (string, error) // Send transaction to link33 and get the receipt. SendTransactionWithReceipt(tx *pb.BxhTransaction, opts *TransactOpts) (*pb.Receipt, error) // Get the receipt by transaction hash, // the status of the receipt is a sign of whether the transaction is successful. GetReceipt(hash string) (*pb.Receipt, error) // Get transaction from link33 by transaction hash. GetTransaction(hash string) (*pb.GetTransactionResponse, error) // Get the current blockchain situation of link33. GetChainMeta() (*pb.ChainMeta, error) // Get blocks of the specified block height range. GetBlocks(start uint64, end uint64) (*pb.GetBlocksResponse, error) // Obtain block information from link33. // The block header contains the basic information of the block, // and the block body contains all the transactions packaged. GetBlock(value string, blockType pb.GetBlockRequest_Type) (*pb.Block, error) // Get the status of the blockchain from link33, normal or abnormal. GetChainStatus() (*pb.Response, error) // Get the validators from link33. GetValidators() (*pb.Response, error) // Get the current network situation of link33. GetNetworkMeta() (*pb.Response, error) // Get account balance from link33 by address. GetAccountBalance(address string) (*pb.Response, error) // Get the missing block header from link33. GetBlockHeader(ctx context.Context, begin, end uint64, ch chan<- *pb.BlockHeader) error // Get the missing block header from link33. GetInterchainTxWrappers(ctx context.Context, pid string, begin, end uint64, ch chan<- *pb.InterchainTxWrappers) error // Subscribe to event notifications from link33. Subscribe(context.Context, pb.SubscriptionRequest_Type, []byte) (<-chan interface{}, error) // Deploy the contract, the contract address will be returned when the deployment is successful. DeployContract(contract []byte, opts *TransactOpts) (contractAddr *types.Address, err error) // GenerateContractTx generates signed transaction to invoke contract GenerateContractTx(vmType pb.TransactionData_VMType, address *types.Address, method string, args ...*pb.Arg) (*pb.BxhTransaction, error) // GenerateIBTPTx generates interchain tx with ibtp specified GenerateIBTPTx(ibtp *pb.IBTP) (*pb.BxhTransaction, error) // Call the contract according to the contract type, contract address, // contract method, and contract method parameters InvokeContract(vmType pb.TransactionData_VMType, address *types.Address, method string, opts *TransactOpts, args ...*pb.Arg) (*pb.Receipt, error) // Invoke the BVM contract, BVM is link33's blot contract. InvokeBVMContract(address *types.Address, method string, opts *TransactOpts, args ...*pb.Arg) (*pb.Receipt, error) // Invoke the XVM contract, XVM is WebAssembly contract. InvokeXVMContract(address *types.Address, method string, opts *TransactOpts, args ...*pb.Arg) (*pb.Receipt, error) // Get link33's signatures specified by id and type. GetMultiSigns(id string, typ pb.GetMultiSignsRequest_Type) (*pb.SignResponse, error) // GetPendingNonceByAccount returns the latest nonce of an account in the pending status, // and it should be the nonce for next transaction GetPendingNonceByAccount(account string) (uint64, error) HeartBeat(address string, index string) (*pb.Response, error) }
type Interchain ¶
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Printf(format string, args ...interface{}) Warningf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Panicf(format string, args ...interface{}) Debug(args ...interface{}) Info(args ...interface{}) Print(args ...interface{}) Warning(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Panic(args ...interface{}) Debugln(args ...interface{}) Infoln(args ...interface{}) Println(args ...interface{}) Warningln(args ...interface{}) Errorln(args ...interface{}) Fatalln(args ...interface{}) Panicln(args ...interface{}) }
The FieldLogger interface generalizes the Entry and logger types
type Option ¶
type Option func(*config)
func WithLogger ¶
func WithNodesInfo ¶
func WithPrivateKey ¶
func WithPrivateKey(key crypto.PrivateKey) Option
func WithTimeoutLimit ¶
type SubscriptionType ¶
type SubscriptionType int
const (
SubscribeNewBlock SubscriptionType = iota
)
type TransactOpts ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_client is a generated GoMock package.
|
Package mock_client is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.