summaryrefslogtreecommitdiff
path: root/script/prepare.sh
blob: 834c676f1eb4895c916e9e2faf4475fb752a0ae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash

## Install required dependencies to run tests without sudo

set -eu

DIR=$(mktemp -d)

function cleanup() {
    for n in `jobs -p`; do
        kill $n 2> /dev/null || true
    done
    rm -rf $DIR 2> /dev/null
    wait
}

trap cleanup EXIT

echo "Ⅰ - Find installed postgres version"
PG_VER=`pg_config --version | egrep -o '[0-9]{1,}' | head -1`
echo "Found version $PG_VER"

echo "Ⅱ - Install bitcoind version 25.1"
cd $DIR
curl -L https://bitcoincore.org/bin/bitcoin-core-25.1/bitcoin-25.1-x86_64-linux-gnu.tar.gz -o btc.tar.gz
tar xvzf btc.tar.gz
rm -rfv ~/bitcoin
mkdir -pv ~/bitcoin
mv -v bitcoin-25.1/* ~/bitcoin

echo "Ⅲ - Install Go Ethereum (Geth) v1.13.5"
cd $DIR
curl -L https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.13.5-916d6a44.tar.gz -o geth.tar.gz
tar xvzf geth.tar.gz
rm -rfv ~/geth
mkdir -pv ~/geth
mv -v geth-linux-amd64-1.13.5-916d6a44/* ~/geth

echo "Ⅳ - Install Lightning Network Daemon v0.15.5-beta"
cd $DIR
curl -L https://github.com/lightningnetwork/lnd/releases/download/v0.15.5-beta/lnd-linux-amd64-v0.15.5-beta.tar.gz -o lnd.tar.gz
tar xvzf lnd.tar.gz
rm -rfv ~/lnd
mkdir -pv ~/lnd
mv -v lnd-linux-amd64-v0.15.5-beta/* ~/lnd

echo "Ⅴ - PATH"

echo "Add PATH=\"\$HOME/geth:\$HOME/bitcoin/bin:\$HOME/lnd:/usr/lib/postgresql/$PG_VER/bin:\$PATH\" to your bash profile"