Documentation ¶
Overview ¶
Package console provides javascript-enabled console environment for interacting with the client. It includes pre-loaded methods that access the node's RPC interface allowing access to the state and condition of the client.
Index ¶
- func RPCClientError(msg string) error
- type Console
- func (c *Console) APIs() jsonrpc.APISet
- func (c *Console) OnStop(f func())
- func (c *Console) Prepare() error
- func (c *Console) Run()
- func (c *Console) SetRPCServer(rpcServer *rpc.Server, secured bool)
- func (c *Console) SetRPCServerAddr(addr string, secured bool)
- func (c *Console) SetVersions(protocol, client, runtime, commit string)
- func (c *Console) Stop(immediately bool)
- type Executor
- type RPCClient
- type RPCConfig
- type SuggestionManager
- type TxBalanceBuilder
- func (o *TxBalanceBuilder) Fee(amount string) *TxBalanceBuilder
- func (o *TxBalanceBuilder) Finalize() map[string]interface{}
- func (o *TxBalanceBuilder) From(address string) *TxBalanceBuilder
- func (o *TxBalanceBuilder) Nonce(nonce int64) *TxBalanceBuilder
- func (o *TxBalanceBuilder) Packed() string
- func (o *TxBalanceBuilder) Payload(finalize bool) map[string]interface{}
- func (o *TxBalanceBuilder) Reset()
- func (o *TxBalanceBuilder) Send() map[string]interface{}
- func (o *TxBalanceBuilder) SenderPubKey(pk string) *TxBalanceBuilder
- func (o *TxBalanceBuilder) To(address string) *TxBalanceBuilder
- func (o *TxBalanceBuilder) Value(amount string) *TxBalanceBuilder
- type TxBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RPCClientError ¶
RPCClientError creates an error describing an issue with the rpc client.
Types ¶
type Console ¶
Console defines functionalities for create and using an interactive Javascript console to perform and query the system.
func New ¶
func New(coinbase *crypto.Key, historyPath string, cfg *config.EngineConfig, log logger.Logger) *Console
New creates a new Console instance. signatory is the address
func NewAttached ¶
func NewAttached(coinbase *crypto.Key, historyPath string, cfg *config.EngineConfig, log logger.Logger) *Console
NewAttached is like New but enables attach mode
func (*Console) OnStop ¶
func (c *Console) OnStop(f func())
OnStop sets a function that is called when the console is stopped
func (*Console) SetRPCServer ¶
SetRPCServer sets the rpc server so we can start and stop it. It will panic if this is called on a console with attach mode enabled.
func (*Console) SetRPCServerAddr ¶
SetRPCServerAddr sets the address of the RPC server to be dialled
func (*Console) SetVersions ¶
SetVersions sets the versions of components
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor is responsible for executing operations inside a javascript VM.
type RPCClient ¶
type RPCClient struct {
Address string
}
RPCClient provides the ability to call methods of an rpc server.
type RPCConfig ¶
type RPCConfig struct {
Client RPCClient
}
RPCConfig holds information required to create an rpc client
type SuggestionManager ¶
type SuggestionManager struct {
// contains filtered or unexported fields
}
SuggestionManager manages suggestions
type TxBalanceBuilder ¶
type TxBalanceBuilder struct {
// contains filtered or unexported fields
}
TxBalanceBuilder provides methods for building a balance transaction.
func (*TxBalanceBuilder) Fee ¶
func (o *TxBalanceBuilder) Fee(amount string) *TxBalanceBuilder
Fee sets the fee
func (*TxBalanceBuilder) Finalize ¶
func (o *TxBalanceBuilder) Finalize() map[string]interface{}
Finalize returns the transaction payload with nonce, timestamp, hash and signature computed and ready for broadcast.
func (*TxBalanceBuilder) From ¶
func (o *TxBalanceBuilder) From(address string) *TxBalanceBuilder
From sets the sender's address
func (*TxBalanceBuilder) Nonce ¶
func (o *TxBalanceBuilder) Nonce(nonce int64) *TxBalanceBuilder
Nonce sets the nonce
func (*TxBalanceBuilder) Packed ¶
func (o *TxBalanceBuilder) Packed() string
Packed returns a base58check encode equivalent of the signed payload.
func (*TxBalanceBuilder) Payload ¶
func (o *TxBalanceBuilder) Payload(finalize bool) map[string]interface{}
Payload returns the transaction being built. If finalize is true, the builder attempts to compute the hash, sign and other fields before returning the transaction
func (*TxBalanceBuilder) Send ¶
func (o *TxBalanceBuilder) Send() map[string]interface{}
Send signs, compute hash and signature and sends the payload to the transaction handling RPC API.
func (*TxBalanceBuilder) SenderPubKey ¶
func (o *TxBalanceBuilder) SenderPubKey(pk string) *TxBalanceBuilder
SenderPubKey sets the senders public key
func (*TxBalanceBuilder) To ¶
func (o *TxBalanceBuilder) To(address string) *TxBalanceBuilder
To sets the recipient's address
func (*TxBalanceBuilder) Value ¶
func (o *TxBalanceBuilder) Value(amount string) *TxBalanceBuilder
Value sets the amount to be sent
type TxBuilder ¶
type TxBuilder struct {
// contains filtered or unexported fields
}
TxBuilder provides methods for building and executing a transaction
func (*TxBuilder) Balance ¶
func (o *TxBuilder) Balance() *TxBalanceBuilder
Balance creates a balance transaction builder. It will attempt to fetch the address