elementsd
is the daemon used to sync and verify the Liquid Network and is used for PeerSwap L-BTC swaps. To set up elementsd
for PeerSwap, follow the steps here.
Important
Musl-based Linux distributions such as Alpine Linux require manually building elementsd
with additional compile-time flags to account for musl's different stack size.
To compile elementsd
from source, follow the documentation for Linux.
If you would rather just download the binary instead, skip to the next section.
Download the latest elementsd
binary release here.
Extract the archive
tar xvf elements-*.tar.gz
Copy the binaries to your PATH
cp elements*/elementsd elements*/elements-cli /usr/local/bin
The default data directory for elementsd
is located in the home directory:
~/.elements
The config file is not created automatically. If one is created it should be placed inside the data directory as such:
~/.elements/elements.conf
If running elementsd
as the same user as PeerSwap, then configuration is not needed.
Otherwise, you need to set the rpcport
, rpcuser
, rpcpassword
, and other config options depending on how you're deploying, in both elements.conf
and peerswap.conf
.
More details:
Note
It's recommended to addtrim_headers=1
to the config file to reduce RAM usage by roughly 50%. However, this will also mean your node cannot help other nodes sync Liquid Network headers. This mode is not appropriate for "infrastructure" nodes which need to provide support for IBD or block/transaction propagation.
PeerSwap will automatically create a wallet if running as the same user as elementsd
.
This elementsd
wallet, used for L-BTC transfers and swaps, is located here for mainnet:
~/.elements/liquidv1/wallets/peerswap/wallet.dat
For Liquid testnet, it is located here:
~/.elements/liquidtestnet/wallets/peerswap/wallet.dat
The elementsd
wallet is normally automatically controlled by the PeerSwap plugin or standalone daemon (LND) when doing swaps. No user input is required.
However, if you need to manually use the elementsd
wallet, such as to swap with Boltz, you can use the elements-cli
utility:
Make sure the peerswap
wallet is loaded first:
elements-cli loadwallet peerswap
To create a new Liquid receiving address:
elements-cli -rpcwallet=peerswap getnewaddress
To send L-BTC to a Liquid address:
elements-cli -rpcwallet=peerswap sendtoaddress [address] [amount in decimal form, e.g. 0.1 for 0.10000000 L-BTC]