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-testsjar 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.jarto<HC>/lib/. - Unpack
<Eclair>/eclair-node/target/eclair-node-0.5.1-98bb7be-bin.zip, copy all<UNPACKED>/lib/*.jarto<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.confinto<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 usingpgadmin4web 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
.eclairfolder in home, extract<Eclair>/eclair-node/target/eclair-node-0.5.1-98bb7be-bin.zipcontents into it, copy<HC>/target/scala-2.13/hc-assembly-0.1.jarinto it (to have all files in one place). - Copy
<HC>/src/main/resouces/hc.confinto.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.logfile should contain a lineINFO fr.acinq.eclair.Boot - loaded plugin HC.
- On first run, set
attemptCreateTables = truein.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
apiblock in Eclair'sreference.confand 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