Console Mode

This page describes Elld Javascript console


Elld comes with a Javascript environment designed to allow users interact with the client, blockchain state and the network. With the console, you will be able to write and execute complex scripts in Javascript.

Start the Console

Starting the Elld in console mode is simple. You only need to use the console command instead of the start command.
elld console -a ""
The command above will start the client and immediately present you with a prompt to type arbitrary Javascript expressions expressions and call in-built functions.

Attach To A Running Client

Elld provides the ability to start a console that attaches to a remote node. Using attach command instead of console starts the console in attach mode.
In attach mode, only the console and a RPC client is enabled. You can call most functions that are available in the un-attached mode.
elld attach
The command above will attach to the local Elld instance running on the default RPC address Use --rpcaddress to specify a different address.

Console APIs

The console environment includes in-built, helper methods for interacting with the client, blockchain state and the network. These methods are categorized into namespaces according to their functions and similarities.
Includes convenience methods that are commonly used.
Perform administrative functions.
Includes methods that access or interact with node's accounts.
Includes methods that access and interact with an accounts balance.
Includes methods that starts, stops and checks the status of the RPC server.
Includes non-user friendly methods that are directly bound to native functions.

RPC Namespaces

RPC namespaces provides access to services offered by the RPC server. They are not available in the console until the RPC server starts to run. These are the namespaces:
Access the blockchain state (e.g blocks, branches etc)
Access account balance and send balance.
Includes methods to access client information (e.g configs, sync state etc).
Access the transaction pool.
Manage the CPU miner.
Includes methods that access or interact with node's accounts.
Perform administrative functions
Manage and access the clients peers and network functions.
Update log level (useful for debugging)

Start RPC Service

By default, RPC namespaces will not be accessible in the console when the RPC server is not turned on. To turn on the RPC server within the console, call the rpc.start method:
> rpc.start()
Which should produce the log output below:
> INFO[0008] RPC service started Address=""