bitcoin-s/docs/rpc/eclair.md
Chris Stewart 65ddeb6798 Make imports in chain.md invisible (#1213)
* Make imports in chain.md invisible

* Hide imports in wallet.md

* Make all core module md files imports hidden

* Cleanup imports on rpc markdown docs

* Try and figure weird travis behavior

* Get rid of uneeded nest qualifiers on mdoc
2020-03-10 12:49:22 -05:00

2.7 KiB

id title
rpc-eclair Eclair

This is a RPC client for Eclair. It assumes that a bitcoind instance is running.

Currently this RPC client is written for v0.3.3 version of Eclair.

Configuration of Eclair

Please see the configuration secion of the Eclair README.

You can find the configuration we use for our testing infrastrture for eclair here.

Starting the jar

You need to download the jar from the eclair's github.

To run Eclair you can use this command:

$ java -jar eclair-node-0.3.3-12ac145.jar &

If you wish to start Eclair from the RPC client, you can do one of the following:

  1. Construct a EclairRpcClient.binary field set
  2. Set the ECLAIR_PATH environment variable to the directory where the Eclair Jar is located.

We will default to using the binary field first when trying to start the jar, and the fallback to ECLAIR_PATH.

Here is an example of how to start eclair:

import akka.actor.ActorSystem
import org.bitcoins.eclair.rpc.client.EclairRpcClient
import org.bitcoins.eclair.rpc.config.EclairInstance
import java.nio.file.Paths

implicit val system = ActorSystem(s"eclair-rpc-${System.currentTimeMillis}")
implicit val ec = system.dispatcher

val datadirPath = Paths.get("path", "to", "datadir")
val binaryPath = Paths.get("path", "to", "eclair-node-0.3.3-12ac145.jar")
val instance = EclairInstance.fromDatadir(datadirPath.toFile,None)
val client = new EclairRpcClient(instance, Some(binaryPath.toFile))

val startedF = client.start()

for {
  eclair <- startedF
  info <- eclair.getInfo
} yield {
  println(s"Eclair info: $info")
}

Connecting to the websocket

As of v0.3.3 eclair supports a websocket endpoint. This means you can receive updates of what is happening with eclair in real time. You can see an example of us testing this here