repl

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestMode = false

TestMode variable used for check if unit test is running

Functions

func Start

func Start(c Client)

Start starts the REPL

Types

type Client

type Client interface {
	PrintWalletMnemonic()
	WalletInfo()
	IsOpen() bool
	OpenWallet() bool
	NewWallet() bool
	CloseWallet()

	CreateAccount(alias string) (*common.LocalAccount, error)
	CurrentAccount() (*common.LocalAccount, error)
	SetCurrentAccount(accountNumber int) error
	ListAccounts() ([]string, error)
	GetAccount(name string) (*common.LocalAccount, error)
	StoreAccounts() error

	ServerInfo() string

	NodeStatus() (*apitypes.NodeStatus, error)
	NodeInfo() (*common.NodeInfo, error)
	Echo() error

	GetMeshTransactions(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.MeshTransaction, uint32, error)
	GetMeshActivations(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Activation, uint32, error)
	GetMeshInfo() (*common.NetInfo, error)

	Transfer(recipient gosmtypes.Address, nonce, amount, gasPrice, gasLimit uint64, key ed25519.PrivateKey) (*apitypes.TransactionState, error)
	TransactionState(txId []byte, includeTx bool) (*apitypes.TransactionState, *apitypes.Transaction, error)

	IsSmeshing() (*apitypes.IsSmeshingResponse, error)
	StartSmeshing(request *apitypes.StartSmeshingRequest) (*status.Status, error)
	StopSmeshing(deleteFiles bool) (*status.Status, error)
	GetPostComputeProviders(benchmark bool) ([]*apitypes.PostSetupComputeProvider, error)
	GetSmesherId() ([]byte, error)
	GetRewardsAddress() (*gosmtypes.Address, error)
	SetRewardsAddress(coinbase gosmtypes.Address) (*status.Status, error)
	Config() (*apitypes.PostConfigResponse, error)
	PostStatus() (*apitypes.PostSetupStatusResponse, error)
	PostDataCreationProgressStream() (apitypes.SmesherService_PostSetupStatusStreamClient, error)

	DebugAllAccounts() ([]*apitypes.Account, error)

	AccountState(address gosmtypes.Address) (*apitypes.Account, error)
	AccountRewards(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)
	AccountRewardsStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)
	AccountUpdatesStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)
	AccountTransactionsReceipts(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.TransactionReceipt, uint32, error)
	GlobalStateHash() (*apitypes.GlobalStateHash, error)
	SmesherRewards(smesherId []byte, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)
}

Client interface to REPL clients.

type Mock

type Mock struct{}

Mock struct created temporarily while node doesn't implement the methods.

func (Mock) AccountInfo

func (Mock) AccountInfo(id string)

AccountInfo prints accountInfo info.

func (Mock) CreateAccount

func (Mock) CreateAccount(generatePassphrase bool, accountInfo string) error

CreateAccount creates accountInfo

func (Mock) GetVariable

func (Mock) GetVariable(key string) string

GetVariable gets variable in node by key

func (Mock) IsAccountUnLock

func (Mock) IsAccountUnLock(id string) bool

IsAccountUnLock checks if the accountInfo with id is unlock

func (Mock) LocalAccount

func (Mock) LocalAccount() common.LocalAccount

LocalAccount returns local accountInfo

func (Mock) Lock

func (Mock) Lock(passphrase string) error

Lock locks local accountInfo or the accountInfo by passphrase

func (Mock) NeedRestartNode

func (Mock) NeedRestartNode(params, flags []string) bool

NeedRestartNode checks if the params and flags that will be set need restart the node

func (Mock) Restart

func (Mock) Restart(params, flags []string) error

Restart restarts node

func (Mock) SetVariables

func (Mock) SetVariables(params, flags []string) error

SetVariables sets params or CLI flags values

func (Mock) Setup

func (Mock) Setup(allocation string) error

Setup setup POST

func (Mock) Transfer

func (Mock) Transfer(from, to, amount, passphrase string) error

Transfer transfers the amount from an accountInfo to the other

func (Mock) Unlock

func (Mock) Unlock(passphrase string) error

Unlock unlock local accountInfo or the accountInfo by passphrase

Jump to

Keyboard shortcuts

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