To make automated tests work in Idea:
- Download https://github.com/ACINQ/eclair/commit/98bb7be70a4fc96242409b90fbf1ec9c5ff470e6 (latest release).
- Compile Eclair with
$ '/home/anton/apache-maven-3.6.3/bin/mvn' install -DskipTests
(things need to be done this way to geteclair-tests
jar file which is not included in prebuilt download package). - Download https://github.com/btcontract/plugin-hosted-channels.
- Create a folder
<HC>/lib/
- Go to
<Eclair>
folder with compiled stuff. - Copy
<Eclair>/eclair-core/target/eclair-core_2.13-0.5.1-tests.jar
to<HC>/lib/
. - Unpack
<Eclair>/eclair-node/target/eclair-node-0.5.1-98bb7be-bin.zip
, copy all<UNPACKED>/lib/*.jar
to<HC>/lib/
. - Open HC in Idea, go to
File -> Project structure -> Modules -> Dependencies
. - Tap
+
, locate<HC>/lib/
, add all jar files, apply. - Copy
<HC>/src/main/resouces/hc.conf
into<HC>/plugin-resources/hosted-channels/hc.conf
. - Get up local postgre cluster, make databases named
hc
,hcalice
,hcbob
(last two are needed for testing, first one will be storing production data, I recommend usingpgadmin4
web interface for local stuff). - To make a plugin jar: go to
<HC>
in console, then$ sbt
, then$sbt> assembly
, jar file can be found at<HC>/target/scala-2.13/
.
To make production work:
- Download https://github.com/ACINQ/eclair/commit/98bb7be70a4fc96242409b90fbf1ec9c5ff470e6 (latest release).
- Compile Eclair with
$ '/home/anton/apache-maven-3.6.3/bin/mvn' install -DskipTests
. - Create an
.eclair
folder in home, extract<Eclair>/eclair-node/target/eclair-node-0.5.1-98bb7be-bin.zip
contents into it, copy<HC>/target/scala-2.13/hc-assembly-0.1.jar
into it (to have all files in one place). - Copy
<HC>/src/main/resouces/hc.conf
into.eclair/plugin-resources/hosted-channels/hc.conf
. - Get up local postgre cluster, make database named
hc
. - Run
$ './bin/eclair-node.sh' './hc-assembly-0.1.jar'
, an.eclair/eclair.log
file should contain a lineINFO fr.acinq.eclair.Boot - loaded plugin HC
.
- On first run, set
attemptCreateTables = true
in.eclair/plugin-resources/hosted-channels/hc.conf
, for subsequent runs update it toattemptCreateTables = false
. If not updated Eclair will be failing on startup, but HC data won't be lost. - Enable
api
block in Eclair'sreference.conf
and then configure HC API inhc.conf
. HC API is not documented yet but tl/dr HC plugin supports its own set of API endpoints to manage stuff, they can be seen at https://github.com/btcontract/plugin-hosted-channels/blob/master/src/main/scala/fr/acinq/hc/app/api/HCService.scala