Maintenance server for Lightning Wallet
-
Install Java by following steps described at https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
-
Install Bitcoin Core:
sudo apt-get update
sudo apt-get install bitcoind
- Bitcoin config file should contain the following lines:
daemon=1
server=1
rpcuser=foo # set your own
rpcpassword=bar # set your own
rpcport=18332
port=8333
txindex=1 # recommended but not necessary
# prune=100000 not recommended but won't break anything if turned on, useful if you have less than 200Gb of disk space
zmqpubrawtx=tcp://127.0.0.1:29000
zmqpubhashblock=tcp://127.0.0.1:29000
zmqpubrawblock=tcp://127.0.0.1:29000
-
Install and run a MongoDB by following steps described at https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
-
Open MongoDB console and issue the following commands:
$ mongo
> use btc-olympus
> db.spentTxs.createIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 * 24 * 90 } )
> db.spentTxs.createIndex( { "prefix": 1 }, { unique: true } )
> db.spentTxs.createIndex( { "txids": 1 } )
> db.scheduledTxs.createIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 * 24 * 30 } )
> db.scheduledTxs.createIndex( { "cltv": 1 } )
> db.userData.createIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 * 24 * 365 * 5 } )
> db.userData.createIndex( { "key": 1 } )
> use btc-blindSignatures
> db.blindTokens.createIndex( { "createdAt": 1 }, { expireAfterSeconds: 3600 * 24 * 365 } )
> db.blindTokens.createIndex( { "seskey": 1 }, { unique: true } )
> "0123456789".split('').forEach(function(v) { db["clearTokens" + v].createIndex( { "token": 1 }, { unique: true } ) })
- Get Eclair fat JAR file, either by downloading it directly from a repository or by compiling from source:
git clone https://github.com/ACINQ/eclair.git
cd eclair
mvn package
- Create an
eclairdata
directory and put aneclair.conf
file there with the following lines:
eclair {
chain = "test"
spv = false
server {
public-ips = ["127.0.0.1"]
binding-ip = "0.0.0.0"
port = 9096
}
api {
enabled = true
binding-ip = "127.0.0.1"
port = 8086
password = "pass"
}
bitcoind {
host = "localhost"
rpcport = 18332
rpcuser = "foo"
rpcpassword = "bar"
zmq = "tcp://127.0.0.1:29000"
}
}
-
Run Ecliar instance by issuing
java -Declair.datadir=eclairdata/ -jar eclair-node.jar
-
Get Olympus fat JAR file, either by downloading it directly from a repository or by compiling from source:
git clone https://github.com/btcontract/olympus.git
cd olympus
sbt
assembly
- Run Olympus instance by issuing:
$ java -jar olympus-assembly-1.0.jar production "{\"zmqApi\":\"tcp://127.0.0.1:29000\",\"ip\":\"127.0.0.1\",\"privKey\":\"17237641984433455757821928886025053286790003625266087739786982589470995742521\",\"btcApi\":\"http://foo:bar@127.0.0.1:18332\",\"eclairSockPort\":9735,\"rewindRange\":1,\"eclairSockIp\":\"127.0.0.1\",\"eclairNodeId\":\"03dc39d7f43720c2c0f86778dfd2a77049fa4a44b4f0a8afb62f3921567de41375\",\"paymentProvider\":{\"quantity\":50,\"priceMsat\":2000000,\"url\":\"http://127.0.0.1:8080\",\"description\":\"Storage tokens for backup Olympus server at 127.0.0.1\",\"tag\":\"EclairProvider\",\"pass\":\"pass\"}}"
Note: Olympus config is provided as a command line argument instead of a file because it contains private keys (the one for storage tokens and for Strike). Don't forget to use space before issuing a command (i.e. $ java -jar ...
, NOT $java - jar ...
) so it does not get recorded in history.