Documentation ¶
Index ¶
- Constants
- Variables
- func DoHttpCall(result interface{}, path string, body interface{}) error
- func NewClient(baseURL string) *client
- func PrintAccountResult(res *chain_plugin.GetAccountResult)
- type Approve
- type ApproveAndUnapproveParams
- type AssetPair
- type BidNameinfoParams
- type BidnameParams
- type BuyramParams
- type CancelParams
- type CanceldelayParams
- type ClaimrewardsParams
- type Config
- type Console
- type ConsoleInterface
- type CreateAccountParams
- type DelegatebwParams
- type ExecuteParams
- type GetCodeParams
- type GetScopeParams
- type GetTableParams
- type ListbwParams
- type ListproducersParams
- type Names
- type NetAPI
- type NewAccountParams
- type Prods
- type ProduceAPI
- func (p *ProduceAPI) GetWhitelistBlacklist(call otto.FunctionCall) (response otto.Value)
- func (p *ProduceAPI) Pause(call otto.FunctionCall) (response otto.Value)
- func (p *ProduceAPI) Paused(call otto.FunctionCall) (response otto.Value)
- func (p *ProduceAPI) Resume(call otto.FunctionCall) (response otto.Value)
- func (p *ProduceAPI) SetWhitelistBlacklist(call otto.FunctionCall) (response otto.Value)
- type ProposeParams
- type ProposeTrxParams
- type Proxy
- type PushAction
- type RegisterProducer
- type RegproxyParams
- type ReviewParams
- type SellRamParams
- type SetAccountPermissionParams
- type SetActionPermissionParams
- type SetContractParams
- type SetWhitelistBlacklistParams
- type StandardTransactionOptions
- type TransferParams
- type UnapproveProducer
- type UndelegatebwParams
- type UnregrodParams
- type UserPrompter
- type WordCompleter
Constants ¶
const DefaultPrompt = "eosgo > "
DefaultPrompt is the default prompt line prefix to use for user input querying.
const HistoryFile = "history"
HistoryFile is the file within the data directory to store input scrollback.
Variables ¶
var BaseUrl string
var Stdin = newTerminalPrompter()
Stdin holds the stdin line reader (also using stdout for printing prompts). Only this reader may be used for input because it keeps an js buffer.
Functions ¶
func DoHttpCall ¶
func PrintAccountResult ¶
func PrintAccountResult(res *chain_plugin.GetAccountResult)
Types ¶
type Approve ¶
type Approve struct { Voter common.Name `json:"voter"` ProducerName common.Name `json:"producer_name"` StandardTransactionOptions }
type ApproveAndUnapproveParams ¶
type ApproveAndUnapproveParams struct { Proposer string `json:"proposer"` ProposalName string `json:"proposal_name"` Perm string `json:"permissions"` StandardTransactionOptions }
type AssetPair ¶
type AssetPair struct { Name common.AccountName SymbolCode common.SymbolCode }
type BidNameinfoParams ¶
type BidnameParams ¶
type BidnameParams struct { Bidder string `json:"bidder"` NewName string `json:"newname"` BidAmount string `json:"bid_amount"` StandardTransactionOptions }
type BuyramParams ¶
type CancelParams ¶
type CancelParams struct { Proposer string `json:"proposer"` ProposalName string `json:"proposal_name"` Canceler string `json:"canceler"` StandardTransactionOptions }
type CanceldelayParams ¶
type CanceldelayParams struct { CancelingAccount string `json:"canceling_account"` CanclingPermission string `json:"canceling_permission"` TrxID string `json:"trx_id"` StandardTransactionOptions }
type ClaimrewardsParams ¶
type ClaimrewardsParams struct { Owner string `json:"owner"` StandardTransactionOptions }
type Config ¶
type Config struct { DataDir string // Data directory to store the console history at DocRoot string // Filesystem path from where to load JavaScript files from Client *client // RPC client to execute EOSGO requests through Prompt string // Input prompt prefix string (defaults to DefaultPrompt) Prompter UserPrompter // Input prompter to allow interactive user feedback (defaults to TerminalPrompter) Printer io.Writer // Output writer to serialize any display strings to (defaults to os.Stdout) Preload []string // Absolute paths to JavaScript files to preload }
Config is the collection of configurations to fine tune the behavior of the JavaScript console.
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console is a JavaScript interpreted runtime environment. It is a fully fledged JavaScript console attached to a running node via an external or in-process RPC client.
func New ¶
New initializes a JavaScript interpreted runtime environment and sets defaults with the config struct.
func (*Console) AutoCompleteInput ¶
AutoCompleteInput is a pre-assembled word completer to be used by the user input prompter to provide hints to the user about the methods available.
func (*Console) Evaluate ¶
Evaluate executes code and pretty prints the result to the specified output stream.
func (*Console) Interactive ¶
func (c *Console) Interactive()
Interactive starts an interactive user session, where input is propted from the configured user prompter.
type ConsoleInterface ¶
type ConsoleInterface interface {
// contains filtered or unexported methods
}
type CreateAccountParams ¶
type DelegatebwParams ¶
type DelegatebwParams struct { From string `json:"from"` Receiver string `json:"receiver"` StakeNetAmount string `json:"stake_net_amount"` StakeCpuAmount string `json:"stake_cpu_amount"` StakeStorageAmount string `json:"stake_storage_amount"` BuyRamAmount string `json:"buy_ram_amount"` BuyRamBytes uint32 `json:"buy_ram_bytes"` Transfer bool `json:"transfer"` StandardTransactionOptions }
type ExecuteParams ¶
type ExecuteParams struct { Proposer string `json:"proposer"` ProposalName string `json:"proposal_name"` Executer string `json:"executer"` StandardTransactionOptions }
type GetCodeParams ¶
type GetCodeParams struct { AccountName string `json:"name"` CodeFileName string `json:"code"` AbiFileName string `json:"abi"` CodeAsWasm bool `json:"wasm"` }
chain
type GetScopeParams ¶
type GetTableParams ¶
type GetTableParams struct { Code string `json:"code"` Scope string `json:"scope"` Table string `json:"table"` Binary bool `json:"binary"` Limit uint32 `json:"limit"` //default =10 TableKey string `json:"key"` Lower string `json:"lower"` Upper string `json:"upper"` IndexPosition string `json:"index"` KeyType string `json:"key_type"` EncodeType string `json:"encode_type"` //default ='dec' }
type ListbwParams ¶
type ListproducersParams ¶
type NetAPI ¶
type NetAPI struct {
// contains filtered or unexported fields
}
NetAPI interacts with local p2p network connections
func (*NetAPI) Connect ¶
func (n *NetAPI) Connect(call otto.FunctionCall) (response otto.Value)
Connect starts a new connection to a peer
func (*NetAPI) Disconnect ¶
func (n *NetAPI) Disconnect(call otto.FunctionCall) (response otto.Value)
Disconnect closes an existing connection
type NewAccountParams ¶
type NewAccountParams struct { Creator common.Name `json:"creator"` Name common.Name `json:"name"` OwnerKey string `json:"owner"` ActiveKey string `json:"active"` StakeNet string `json:"stake_net"` StakeCpu string `json:"stake_cpu"` BuyRamBytesInKbytes uint32 `json:"buy_ram_kbytes"` BuyRamBytes uint32 `json:"buy_ram_bytes"` BuyRamEos string `json:"buy_ram"` Transfer bool `json:"transfer"` StandardTransactionOptions }
system
type Prods ¶
type Prods struct { Voter string `json:"voter"` ProducerNames Names `json:"producer_names"` StandardTransactionOptions }
type ProduceAPI ¶
type ProduceAPI struct {
// contains filtered or unexported fields
}
func (*ProduceAPI) GetWhitelistBlacklist ¶
func (p *ProduceAPI) GetWhitelistBlacklist(call otto.FunctionCall) (response otto.Value)
func (*ProduceAPI) Pause ¶
func (p *ProduceAPI) Pause(call otto.FunctionCall) (response otto.Value)
func (*ProduceAPI) Paused ¶
func (p *ProduceAPI) Paused(call otto.FunctionCall) (response otto.Value)
func (*ProduceAPI) Resume ¶
func (p *ProduceAPI) Resume(call otto.FunctionCall) (response otto.Value)
func (*ProduceAPI) SetWhitelistBlacklist ¶
func (p *ProduceAPI) SetWhitelistBlacklist(call otto.FunctionCall) (response otto.Value)
type ProposeParams ¶
type ProposeParams struct { ProposalName string `json:"proposal_name"` RequestedPerm string `json:"requested_permissions"` TransactionPerm string `json:"trx_permissions"` ProposedContract string `json:"contract"` ProposedAction string `json:"action"` ProposedTransaction string `json:"data"` Proposer string `json:"proposer"` ProposalExpirationHours int `json:"proposal_expiration"` //TODO default 24 StandardTransactionOptions }
type ProposeTrxParams ¶
type ProposeTrxParams struct { ProposalName string `json:"proposal_name"` RequestedPerm string `json:"requested_permissions"` Proposer string `json:"proposer"` TrxToPush string `json:"transaction"` StandardTransactionOptions }
type Proxy ¶
type Proxy struct { Voter string `json:"voter"` Proxy string `json:"proxy"` StandardTransactionOptions }
type PushAction ¶
type PushAction struct { ContractAccount string `json:"account"` Action string `json:"action"` Data string `json:"data"` StandardTransactionOptions }
type RegisterProducer ¶
type RegisterProducer struct { Producer string `json:"producer"` Key string `json:"key"` Url string `json:"url"` Loc uint16 `json:"loc"` StandardTransactionOptions }
type RegproxyParams ¶
type RegproxyParams struct { Proxy string `json:"proxy"` StandardTransactionOptions }
type ReviewParams ¶
type SellRamParams ¶
type SellRamParams struct { From string `json:"from"` Receiver string `json:"receiver"` Amount uint64 `json:"amount"` StandardTransactionOptions }
type SetAccountPermissionParams ¶
type SetAccountPermissionParams struct { Account string `json:"account"` Permission string `json:"permission"` AuthorityJsonOrFile string `json:"authority"` Parent string `json:"parent"` StandardTransactionOptions }
type SetActionPermissionParams ¶
type SetActionPermissionParams struct { Account string `json:"account"` Code string `json:"code"` TypeStr string `json:"type"` Requirement string `json:"requirement"` StandardTransactionOptions }
type SetContractParams ¶
type SetWhitelistBlacklistParams ¶
type SetWhitelistBlacklistParams struct { ActorWhitelist []common.AccountName `json:"actorWhitelist"` ActorBlacklist []common.AccountName `json:"actorBlacklist"` ContractWhitelist []common.AccountName `json:"contractWhitelist"` ContractBlacklist []common.AccountName `json:"contractBlacklist"` ActionBlacklist []common.NamePair `json:"actionBlacklist"` KeyBlacklist []string `json:"keyBlacklist"` }
type StandardTransactionOptions ¶
type StandardTransactionOptions struct { Expiration uint64 `json:"expiration"` TxForceUnique bool `json:"force_unique"` TxSkipSign bool `json:"skip_sign"` TxPrintJson bool `json:"json"` TxDontBroadcast bool `json:"dont_broadcast"` TxReturnPacked bool `json:"return_packed"` TxRefBlockNumOrId string `json:"ref_block"` TxPermission []string `json:"p"` TxMaxCpuUsage uint8 `json:"max_cpu_usage_ms"` TxMaxNetUsage uint32 `json:"max_net_usage"` DelaySec uint32 `json:"delay_sec"` }
type TransferParams ¶
type UnapproveProducer ¶
type UnapproveProducer struct { Voter common.Name `json:"voter"` ProducerName common.Name `json:"producer_name"` StandardTransactionOptions }
type UndelegatebwParams ¶
type UndelegatebwParams struct { From string `json:"from"` Receive string `json:"receive"` UnstakeNetAmount string `json:"unstake_net_amount"` UnstakeCpuAmount string `json:"unstake_cpu_amount"` StandardTransactionOptions }
type UnregrodParams ¶
type UnregrodParams struct { Producer string `json:"producer"` StandardTransactionOptions }
type UserPrompter ¶
type UserPrompter interface { // PromptInput displays the given prompt to the user and requests some textual // data to be entered, returning the input of the user. PromptInput(prompt string) (string, error) // PromptPassword displays the given prompt to the user and requests some textual // data to be entered, but one which must not be echoed out into the terminal. // The method returns the input provided by the user. PromptPassword(prompt string) (string, error) // PromptConfirm displays the given prompt to the user and requests a boolean // choice to be made, returning that choice. PromptConfirm(prompt string) (bool, error) // SetHistory sets the the input scrollback history that the prompter will allow // the user to scroll back to. SetHistory(history []string) // AppendHistory appends an entry to the scrollback history. It should be called // if and only if the prompt to append was a valid command. AppendHistory(command string) // ClearHistory clears the entire history ClearHistory() // SetWordCompleter sets the completion function that the prompter will call to // fetch completion candidates when the user presses tab. SetWordCompleter(completer WordCompleter) }
UserPrompter defines the methods needed by the console to promt the user for various types of inputs.
type WordCompleter ¶
WordCompleter takes the currently edited line with the cursor position and returns the completion candidates for the partial word to be completed. If the line is "Hello, wo!!!" and the cursor is before the first '!', ("Hello, wo!!!", 9) is passed to the completer which may returns ("Hello, ", {"world", "Word"}, "!!!") to have "Hello, world!!!".