Skip to content

knarfytrebil/rust-lightning-bitcoinrpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustbolt

██████╗ ██╗   ██╗███████╗████████╗██████╗  ██████╗ ██╗  ████████╗
██╔══██╗██║   ██║██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗██║  ╚══██╔══╝
██████╔╝██║   ██║███████╗   ██║   ██████╔╝██║   ██║██║     ██║   
██╔══██╗██║   ██║╚════██║   ██║   ██╔══██╗██║   ██║██║     ██║   
██║  ██║╚██████╔╝███████║   ██║   ██████╔╝╚██████╔╝███████╗██║   
╚═╝  ╚═╝ ╚═════╝ ╚══════╝   ╚═╝   ╚═════╝  ╚═════╝ ╚══════╝╚═╝   

Experiemental Implementation of Lightining based on

Caution:

Currently the project is still unstable, please DO NOT use this in production !

Project Status

Build Status codecov PRs Welcome

The rustbolt is an experimental implementation of a Lightning Network node in rust. rustbolt depends on bitcoind, and uses the rust-bitcoin set of Bitcoin libraries. In the current state rustbolt is capable of:

  • Creating channels.
  • Closing channels.
  • List channel status.
  • Routing within the network, passively forwarding incoming payments.
  • Creating / Paying invoices.

Getting Started

rustbolt works on Linux & MacOS, it requires a running bitcoind.

Compiling and Installation

Premises

rustbot is written in Rust. You will need rustc version nightly. The recommended way to install Rust is from the official download page. Or using rustup, the official rust toolchain installer. After getting rust, use the following command to upgrade to nightly.

rustup toolchain install nightly && \
rustup target add wasm32-unknown-unknown --toolchain nightly && \
rustup default nightly && \

Compiling

cd into either server or cli to build executable binary for the Server or Cli. Or, otherwize into ln-manager for the library.

cd server && cargo build # gets binary file for rustbolt
cd cli && cargo build # gets binary file for rbcli

Running the Server

Configuration files:

ln.conf.toml

[lightning]
lndata = "ln/data_1"                       # local path for storing lightning data
port = 9735                                # port of lightning node

[bitcoind]
rpc_url = "<usr>:<pwd>@<interface>:<port>" # url of bitcoind to connect to.

node.conf.toml

[server]
address = "0.0.0.0:8123"                   # interface for udp server

Running

rustbolt ln.conf.toml node.conf.toml       # server starts

Using Rustbolt

Get node Information:

# Returns public key of the node
rbcli info -n

Connect to a Peer:

# Connects to another peer on the lightning network
rbcli peer -c <node_id>@<interface>:<port>

List Peers:

# list all peers
rbcli peer -l

Create Channel:

# Creates a payment channel with another peer on the network
rbcli channel -c <node_id>@<interface>:<port> 2000000 100500000

Sending and Receiving Payments:

# Creates an Invoice
rbcli invoice -c 1001000
# Pays an Invoice
rbcli invoice -p <bolt11>

Developers

Pull requests are welcomed, and feel free to raise issues.

Testing

sudo docker-compose -f test/integration/docker-compose.yml down && 
sudo docker-compose -f test/integration/docker-compose.yml up --exit-code-from lightning

About

Experiemental Implementation of Lightining in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 83.6%
  • Python 14.5%
  • Dockerfile 1.4%
  • Other 0.5%