import "github.com/ethereum/go-ethereum/console"
const DefaultPrompt = "> "
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.
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 *rpc.Client // RPC client to execute Ethereum requests through Prompt string // Input prompt prefix string (defaults to DefaultPrompt) Prompter prompt.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 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.
New initializes a JavaScript interpreted runtime environment and sets defaults with the config struct.
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.
Evaluate executes code and pretty prints the result to the specified output stream.
Execute runs the JavaScript file specified as the argument.
Interactive starts an interactive user session, where input is propted from the configured user prompter.
Stop cleans up the console and terminates the runtime environment.
Welcome show summary of current Geth instance and some metadata about the console's available modules.
Path | Synopsis |
---|---|
prompt |
Package console imports 24 packages (graph) and is imported by 18 packages. Updated 2020-11-28. Refresh now. Tools for package owners.