Skip to content

Instantly share code, notes, and snippets.

@sstone
Created June 29, 2016 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sstone/b6e4d0b3abc12fe641093fafed609037 to your computer and use it in GitHub Desktop.
Save sstone/b6e4d0b3abc12fe641093fafed609037 to your computer and use it in GitHub Desktop.
eclair/lightnind automated interop testing

Prerequiste

You will need:

You need to start bitcoind in regtest mode, and have bitcoin-cli on the PATH. For example, you could use the following bitcoin.conf file:

regtest=1
server=1
txindex=1
rpcuser=foo
rpcpassword=bar

The first time you run bitcoind, you have to generate 500 blocks to activate segwit:

>bitcoin-cli generate 500

You can then check that segwit is active:

>bitcoin-cli getblockchaininfo

At the end of the info returned by bitcoind you should have something like:

  "bip9_softforks": {
    "csv": {
      "status": "active",
      "startTime": 0,
      "timeout": 999999999999
    },
    "segwit": {
      "status": "active",
      "startTime": 0,
      "timeout": 999999999999
    }
  }

Running the test

Start bitcoind:

>bitcoind

Start lightingd:

>lightningd

Lightingd will try and connect to bitcoind through bitcoin-cli (that's why it should be on the PATH) and stop if it cannot connect.

Run the automated test from eclair/eclair-demo:

mvn exec:java -Dexec.mainClass="org.scalatest.tools.Runner" -Dexec.classpathScope="test" \
-Dexec.args="-s fr.acinq.eclair.channel.InteroperabilitySpec" \
-Dlightning-cli.path=/home/fabrice/code/lightning.sstone/daemon/lightning-cli

Use the java environment variable lightning-cli.path to specify the location of lighting-cli

This test will:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment