Lightning Network Client for Elixir using grpc bindings
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is work in progress. It is functional but I would be careful using it in production. If you want to help, please drop me a message. Any help is greatly appreciated!

This is a gRPC client for lnd (0.5-beta). It is generated code from rpc.proto


  1. Install deps and compile
$ mix do deps.get, compile,
  1. set the macaroon.txt and tls.cert and get the hostname
  2. start the script
$ ./ex_lndclient --macaroonpath=macaroon.txt --tlscertpath=tls.cert --rpcserver=


You need the elixir implementation of gRPC

If available in Hex, the package can be installed by adding ex_lndclient to your list of dependencies in mix.exs:

def deps do
    {:ex_lndclient, "~> 0.1.0"}

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at

Lightning network

  1. Convert the macaroon to txt format
$ xxd -p -c2000 admin.macaroon > macaroon.txt
  1. And get the tls.cert
  2. Copy the files

Generate Elixir code from proto

  1. Install priv/protos/lndrpc/rpc.proto here
  2. Get priv/protos/google/api/http.proto and priv/protos/google/api/annotations.proto here
  3. Install protoc here
  4. Install protoc-gen-elixir
mix escript.install hex protobuf
  1. Generate the code:
$ protoc -I priv/protos --elixir_out=plugins=grpc:./lib/ priv/protos/lnrpc/rpc.proto

Refer to protobuf-elixir for more information. And for lightningnetwork grpc lnd


  • Connect to a lightning network server via gRPC
  • Subscribe to transaction stream
  • Enhance your calm too many pings (old server?)
  • Command line version
  • Elixir module for reuse
  • Add support for macaroon to the grpc library

More Info


  1. ex_lndclient Copyright (c) 2018 David Rasch Licensed under the MIT License
  2. Google Protos Licensed under the Apache 2.0 License
  3. lnrpc Lightningnetwork Protos Licensed under the MIT License