Skip to content

Instantly share code, notes, and snippets.

@evd0kim
Forked from akumaigorodski/plugin.md
Created April 22, 2022 16:19
Show Gist options
  • Save evd0kim/42680d26dde80b1e1032b5d1511d94b5 to your computer and use it in GitHub Desktop.
Save evd0kim/42680d26dde80b1e1032b5d1511d94b5 to your computer and use it in GitHub Desktop.

To make automated tests work in Idea:

  1. Download https://github.com/ACINQ/eclair/commit/98bb7be70a4fc96242409b90fbf1ec9c5ff470e6 (latest release).
  2. Compile Eclair with $ '/home/anton/apache-maven-3.6.3/bin/mvn' install -DskipTests (things need to be done this way to get eclair-tests jar file which is not included in prebuilt download package).
  3. Download https://github.com/btcontract/plugin-hosted-channels.
  4. Create a folder <HC>/lib/
  5. Go to <Eclair> folder with compiled stuff.
  6. Copy <Eclair>/eclair-core/target/eclair-core_2.13-0.5.1-tests.jar to <HC>/lib/.
  7. Unpack <Eclair>/eclair-node/target/eclair-node-0.5.1-98bb7be-bin.zip, copy all <UNPACKED>/lib/*.jar to <HC>/lib/.
  8. Open HC in Idea, go to File -> Project structure -> Modules -> Dependencies.
  9. Tap +, locate <HC>/lib/, add all jar files, apply.
  10. Copy <HC>/src/main/resouces/hc.conf into <HC>/plugin-resources/hosted-channels/hc.conf.
  11. 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 using pgadmin4 web interface for local stuff).
  12. 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:

  1. Download https://github.com/ACINQ/eclair/commit/98bb7be70a4fc96242409b90fbf1ec9c5ff470e6 (latest release).
  2. Compile Eclair with $ '/home/anton/apache-maven-3.6.3/bin/mvn' install -DskipTests.
  3. 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).
  4. Copy <HC>/src/main/resouces/hc.conf into .eclair/plugin-resources/hosted-channels/hc.conf.
  5. Get up local postgre cluster, make database named hc.
  6. Run $ './bin/eclair-node.sh' './hc-assembly-0.1.jar', an .eclair/eclair.log file should contain a line INFO fr.acinq.eclair.Boot - loaded plugin HC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment