Faraday
Time: 5 minutes
Faraday is an accounting tool for Lightning and on-chain. Useful, because you're always losing sats on things like transaction fees that often go unnoticed. Among other things, it offers the possibility to create a printout to CSV format.
Requirements
- Golang (update to the latest version before you start).
Installation
Navigate to your home directory.
cd ~
Download the source code.
git clone https://github.com/lightninglabs/faraday
Go to the faraday directory.
cd faraday
Grab the latest version/tag/release.
git checkout v0.2.11-alpha
Install the faraday software.
make && make install
There are two tools that have been installed: faraday
and frcli
. Faraday is the program itself and frcli is a way to communicate with Faraday. Test both to see if installation was successful.
faraday --versionfrcli --version
You can go a step further by starting Faraday with the correct settings. In the text below, in the spots "FILL_USERNAME_IN" and "FILL_PASSWORD_IN" you need to enter the data you created during the configuration of Knots.
faraday --lnd.macaroondir=/home/ubuntu/.lnd/data/chain/bitcoin/mainnet --lnd.tlscertpath=/home/ubuntu/.lnd/tls.cert --lnd.rpcserver=127.0.0.1:10009 --connect_bitcoin --bitcoin.host=127.0.0.1:8332 --bitcoin.user=ENTER_USERNAME_HERE--bitcoin.password=ENTER_PASSWORD_HERE
Once you see that everything is working, you can close faraday again with Ctrl + C
.
Firewall
You can access faraday via gRPC on port 8465.
sudo ufw allow 8465 comment "Port for Faraday"
Automation
Automating Faraday cannot be done very neatly. This is due to the fact that Faraday does not use a configuration file that contains the settings. Instead, you have to pass all the settings along at startup.
sudo nano /etc/systemd/system/faraday.service
Paste this in.
[Unit]Description=FaradayRequires=lnd.serviceAfter=lnd.service[Service]User=ubuntuExecStart=/home/ubuntu/go/bin/faraday --lnd.macaroondir=/home/ubuntu/.lnd/data/chain/bitcoin/mainnet --lnd.tlscertpath=/home/ubuntu/.lnd/tls. cert --lnd.rpcserver=127.0.0.1:10009 --connect_bitcoin --bitcoin.host=127.0.0.1:8332 --bitcoin.user=ENTER_USERNAME_HERE--bitcoin.password=ENTER_PASSWORD_HERERestart=alwaysTimeoutSec=120RestartSec=30[Install]WantedBy=multi-user.target
Save the changes with Ctrl + X
and confirm with Y
.
Notify the system of the new service.
sudo systemctl enable faraday
Start the Faraday service as follows.
sudo systemctl start faraday
If you want to see if the service is started, run this.
systemctl status faraday
If you want a view of the status across multiple sessions, use this command.
sudo journalctl -f -u faraday
Updating
Go to the application directory.
cd ~/faraday
Update the repository with the latest changes via Git.
git fetch --all
Show the latest version/tag/release.
git describe --tags `git rev-list --tags --max-count=1`
Retrieve the changes from the latest release.
git checkout -f <OUTPUT FROM PREVIOUS STEP> #e.g. v0.2.11-alpha
Install the faraday software.
make && make install
Restart the faraday and LiT services (if you have that running).
sudo systemctl restart faradaysudo systemctl restart lit