summaryrefslogtreecommitdiff
path: root/script/prepare.sh
blob: 72adb5d2e5c8ea15a7a966c7cabd2f8c9ca8cc65 (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 24.1"
cd $DIR
curl -L https://bitcoincore.org/bin/bitcoin-core-24.1/bitcoin-24.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-24.1/* ~/bitcoin

echo "Ⅲ - Install Go Ethereum (Geth) v1.10.26"
cd $DIR
curl -L https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.10.26-e5eb32ac.tar.gz -o geth.tar.gz
tar xvzf geth.tar.gz
rm -rfv ~/geth
mkdir -pv ~/geth
mv -v geth-alltools-linux-amd64-1.10.26-e5eb32ac/* ~/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"