summaryrefslogtreecommitdiff
path: root/script/prepare.sh
blob: 5791065d80e910972f98f0421aa6587a7fbc2859 (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 0.23"
cd $DIR
curl -L https://bitcoincore.org/bin/bitcoin-core-23.0/bitcoin-23.0-x86_64-linux-gnu.tar.gz -o btc.tar.gz
rm -rfv ~/bitcoin
mkdir -pv ~/bitcoin
tar xvzf btc.tar.gz
mv -v bitcoin-23.0/* ~/bitcoin

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

echo "Ⅳ - Install Core Lightning v22.11.1"
cd $DIR
curl -L https://github.com/ElementsProject/lightning/releases/download/v22.11.1/clightning-v22.11.1-Ubuntu-22.04.tar.xz -o clightning.tar.gz
tar xvf clightning.tar.gz
rm -rfv ~/clightning
mkdir -pv ~/clightning
mv -v usr/* ~/clightning

echo "Ⅴ - PATH"

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