Progress pill
Element

Configuring Nodes and Networking

Building with Elements and Liquid Network

Configuring Nodes and Networking

  • Basic Operations Using the Command Line
Configuration settings can be passed to an Elements node on startup in order to change the way it runs, validates data, connects to other nodes, and initializes its blockchain data.
Settings are either loaded from the designated elements.conf file or passed in as parameters via the command line.
Some of the things can be changed using these parameters:
  • The name of the default asset used in a standalone blockchain implementation.
  • The number of the initial asset created.
  • The asset to be used when paying transaction fees on the network.
  • The storage location of the blockchain data files.
  • The RPC credentials used to connect to a Bitcoin node.
  • The n of m threshold to be met and the valid public keys that can sign blocks.
  • The script that needs to be satisfied in order to transfer assets in and out of a sidechain.
  • Whether to connect to a Bitcoin node as a sidechain or not.
Many of these form part of the network's consensus rules, so it is important that they are applied across all nodes on startup. Some can be changed after a chain has been initialized, but some need to be fixed after they are used to initialize a chain.
The use of parameters will be covered later in the course as and when they relate to each section.

Basic Operations Using the Command Line

This course will show examples that use the elements-cli program to make RPC calls to one or more Elements nodes. This is done within a terminal session, and to make the commands briefer, an alias will be used. By this convention, when you see something like the following commands:
e1-dae e1-cli getnewaddress
The e1-dae and e1-cli are actually typographic shortcuts that utilize the terminal's alias feature. The e1-dae and e1-cli will actually be substituted when the command is executed, and the command that will run will be similar to:
$HOME/elements/src/elementsd -datadir=$HOME/elementsdir1 $HOME/elements/src/elements-cli -datadir=$HOME/elementsdir1 getnewaddress
What we see above is a call to start the Elements daemon, a call to the elements-cli programs located in the $HOME/elements/src directory, and a value for the datadir parameter. The datadir parameter enables us to specify the location of config files for both the daemon and client instances, and in the case of the daemon, where to store its copy of the blockchain. As they share a config file, the client will be able to make RPC calls to the daemon.
By running the above command again, but with a different datadir value, we can start more than one instance of Elements, each with its own separate copy of the blockchain and config settings. By this convention, we will use the aliases e2-dae and e2-cli in the course to refer to a different datadir directory than e1's. So the above example for our second e2 instance would be:
$HOME/elements/src/elementsd -datadir=$HOME/elementsdir2 $HOME/elements/src/elements-cli -datadir=$HOME/elementsdir2 getnewaddress
This will enable us to perform various operations, such as transacting assets between nodes, issuing assets, and verifying the use of blinding in Confidential Transactions across different nodes on the same network.