client

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGRPCServer = "localhost:9092"
View Source
const DefaultSecureConnection = false

Variables

This section is empty.

Functions

This section is empty.

Types

type WalletBackend

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

WalletBackend wallet holder

func OpenConnection

func OpenConnection(grpcServer string, secureConnection bool, wd string) (wbx *WalletBackend, err error)

OpenConnection opens a connection but not the wallet

func OpenWalletBackend

func OpenWalletBackend(wallet string, grpcServer string, secureConnection bool) (wbx *WalletBackend, err error)

OpenWalletBackend opens an existing wallet

func (WalletBackend) AccountRewards

func (c WalletBackend) AccountRewards(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)

AccountRewards returns rewards for an account

func (WalletBackend) AccountRewardsStream

func (c WalletBackend) AccountRewardsStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)

AccountRewardsStream returns a stream of account rewards

func (WalletBackend) AccountState

func (c WalletBackend) AccountState(address gosmtypes.Address) (*apitypes.Account, error)

AccountState returns basic account data such as balance and nonce from the global state

func (WalletBackend) AccountTransactionsReceipts

func (c WalletBackend) AccountTransactionsReceipts(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.TransactionReceipt, uint32, error)

AccountTransactionsReceipts returns transaction receipts for an account

func (WalletBackend) AccountUpdatesStream

func (c WalletBackend) AccountUpdatesStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)

AccountUpdatesStream returns a stream of account changes

func (WalletBackend) Close

func (c WalletBackend) Close() error

func (*WalletBackend) CloseWallet

func (w *WalletBackend) CloseWallet()

func (WalletBackend) Config added in v0.1.30

func (c WalletBackend) Config() (*apitypes.PostConfigResponse, error)

Config returns the current smesher configuration

func (WalletBackend) Connect

func (c WalletBackend) Connect() error

func (*WalletBackend) CreateAccount

func (w *WalletBackend) CreateAccount(displayName string) (la *common.LocalAccount, err error)

func (*WalletBackend) CurrentAccount

func (w *WalletBackend) CurrentAccount() (*common.LocalAccount, error)

CurrentAccount - get the latest account into cli-wallet format

func (WalletBackend) DebugAllAccounts

func (c WalletBackend) DebugAllAccounts() ([]*apitypes.Account, error)

func (WalletBackend) Echo

func (c WalletBackend) Echo() error

Echo is a basic api sanity test. It verifies that the client can connect to the node service and get a response from it to an echo request. todo: change this to api health-check service as node service might not be available

func (*WalletBackend) GetAccount

func (w *WalletBackend) GetAccount(accountName string) (*common.LocalAccount, error)

func (WalletBackend) GetMeshActivations

func (c WalletBackend) GetMeshActivations(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Activation, uint32, error)

GetMeshActivations returns activations where the address is the coinbase

func (WalletBackend) GetMeshInfo

func (c WalletBackend) GetMeshInfo() (*common.NetInfo, error)

GetMeshInfo returns basic mesh data

func (WalletBackend) GetMeshTransactions

func (c WalletBackend) GetMeshTransactions(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.MeshTransaction, uint32, error)

GetMeshTransactions returns the MeshTransactions on the mesh to or from an address.

func (WalletBackend) GetPostComputeProviders

func (c WalletBackend) GetPostComputeProviders(benchmark bool) ([]*apitypes.PostSetupComputeProvider, error)

GetPostComputeProviders returns the proof of space generators available on the system

func (WalletBackend) GetRewardsAddress

func (c WalletBackend) GetRewardsAddress() (*gosmtypes.Address, error)

GetRewardsAddress get the smesher's current rewards address

func (WalletBackend) GetSmesherId

func (c WalletBackend) GetSmesherId() ([]byte, error)

GetSmesherId returns the current smesher id configured in the node

func (WalletBackend) GlobalStateHash

func (c WalletBackend) GlobalStateHash() (*apitypes.GlobalStateHash, error)

GlobalStateHash returns the current global state hash

func (*WalletBackend) IsOpen

func (w *WalletBackend) IsOpen() bool

func (WalletBackend) IsSmeshing

func (c WalletBackend) IsSmeshing() (*apitypes.IsSmeshingResponse, error)

IsSmeshing returns true iff the node is currently setup to smesh

func (*WalletBackend) ListAccounts

func (w *WalletBackend) ListAccounts() (res []string, err error)

func (*WalletBackend) NewWallet

func (w *WalletBackend) NewWallet() bool

func (WalletBackend) NodeInfo

func (c WalletBackend) NodeInfo() (*common.NodeInfo, error)

NodeInfo returns static node info such as build, version and api server url

func (WalletBackend) NodeStatus

func (c WalletBackend) NodeStatus() (*apitypes.NodeStatus, error)

NodeStatus returns dynamic node status such as sync status and number of connected peers

func (*WalletBackend) OpenWallet

func (w *WalletBackend) OpenWallet() bool

OpenWallet opens a wallet from file

func (WalletBackend) PostDataCreationProgressStream added in v0.1.30

func (c WalletBackend) PostDataCreationProgressStream() (apitypes.SmesherService_PostSetupStatusStreamClient, error)

PostDataCreationProgressStream returns a stram client for post status updates

func (WalletBackend) PostStatus added in v0.1.30

func (c WalletBackend) PostStatus() (*apitypes.PostSetupStatusResponse, error)

PostStatus returns the current proof of space time status

func (*WalletBackend) PrintWalletMnemonic added in v0.1.29

func (w *WalletBackend) PrintWalletMnemonic()

func (WalletBackend) ServerInfo

func (c WalletBackend) ServerInfo() string

ServerInfo returns basic api server and connection info

func (*WalletBackend) SetCurrentAccount

func (w *WalletBackend) SetCurrentAccount(accountNumber int) error

func (WalletBackend) SetRewardsAddress

func (c WalletBackend) SetRewardsAddress(address gosmtypes.Address) (*status.Status, error)

SetRewardsAddress sets the smesher's rewards address

func (WalletBackend) SmesherRewards

func (c WalletBackend) SmesherRewards(smesherId []byte, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)

SmesherRewards returns rewards for a smesher identified by a smesher id

func (WalletBackend) StartSmeshing

func (c WalletBackend) StartSmeshing(request *apitypes.StartSmeshingRequest) (*status.Status, error)

StartSmeshing instructs the node to start smeshing using user's provider params

func (WalletBackend) StopSmeshing

func (c WalletBackend) StopSmeshing(deleteFiles bool) (*status.Status, error)

StopSmeshing instructs the node to stop smeshing and optionally delete smeshing data file(s)

func (*WalletBackend) StoreAccounts

func (w *WalletBackend) StoreAccounts() error

func (WalletBackend) SubmitCoinTransaction

func (c WalletBackend) SubmitCoinTransaction(tx []byte) (*apitypes.TransactionState, error)

SubmitCoinTransaction submits a signed binary transaction to the node.

func (WalletBackend) TransactionState

func (c WalletBackend) TransactionState(txId []byte, includeTx bool) (*apitypes.TransactionState, *apitypes.Transaction, error)

TransactionState returns the state and optionally the transaction for a single transaction based on tx id

func (*WalletBackend) Transfer

func (w *WalletBackend) Transfer(recipient gosmtypes.Address, nonce, amount, gasPrice, gasLimit uint64, key ed25519.PrivateKey) (*pb.TransactionState, error)

Transfer creates a sign coin transaction and submits it

func (*WalletBackend) WalletInfo

func (w *WalletBackend) WalletInfo()

Jump to

Keyboard shortcuts

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