2 ## bitcoin disabled. fees too high
4 if [[ $HOSTNAME == frodo
]]; then
7 if [[ `debian-archive` == testing
]]; then
8 # has no unstable dependencies
10 src
=/a
/opt
/bitcoin
/contrib
/init
/bitcoind.service
11 s
cp $src /etc
/systemd
/system
12 p
=/etc
/bitcoin
/bitcoin
13 dst
=/etc
/systemd
/system
/bitcoinjm.service
15 $sed -r "/^\s*ExecStart/s,${p}.conf,${p}jm.conf," $src \
16 >/etc
/systemd
/system
/bitcoinjm.service
18 d
=jm
; jm
=d
# being clever for succinctness
20 s
$sed -ri "/^\s*\[Unit\]/a Conflicts=bitcoin${!s}.service" \
21 /etc
/systemd
/system
/bitcoin
${s}.service
28 s chown
-R bitcoin
:bitcoin
$dir
31 s chown
-R root
:bitcoin
$dir
34 # pruning decreases the bitcoin dir to 2 gb, keeps
35 # just the recent blocks. can\'t do a few things like
36 # import a wallet dump.
37 # pruning works, but people had to do
38 # some manual stuff in joinmarket. I dun need the
39 # disk space, so not bothering yet, maybe in a year or so.
40 # https://github.com/JoinMarket-Org/joinmarket/issues/431
41 #https://bitcoin.org/en/release/v0.12.0#wallet-pruning
47 # necessary for joinmarket, not bad in general
48 rpcpassword=$(openssl rand -base64 32)
49 rpcuser=$(openssl rand -base64 32)
52 # dunno about sharing a wallet between multiple instances
53 # manually did, wallet.dat symlinked in /nocow/.bitcoin
57 # other distros unknown
62 ## disabling joinmarket, its too expensive
63 ### begin joinmarket setup ###
68 f2
=$dir/bitcoinjm.conf
70 s
tee -a $f2 >/dev
/null
<<EOF
72 walletnotify=curl -sI --connect-timeout 1 http://localhost:62602/walletnotify?%s
73 alertnotify=curl -sI --connect-timeout 1 http://localhost:62602/alertnotify?%s
78 # other distros unknown
81 pi libsodium-dev python-pip
83 # using develop branch, as it seems to be mostly bug fixes,
84 # and this is quite new software.
85 # note: python3 does not work.
86 # has seg fault error due to some bug, but it still works
87 pip
install -r requirements.txt ||
[[ $?
== 139 ]]
88 # note, the target must exist ahead of time, or bitcoin
89 # just overwrites the link, and it\'s not happy with an empty file,
90 # so we have to create the wallet, then move and link it.
91 s lnf
-T /q
/bitcoin
/wallet.dat
/nocow
/.bitcoin
/wallet.dat
92 s lnf
-T /q
/bitcoin
/joinmarket.dat
/nocow
/.bitcoin
/joinmarket.dat
93 # not technically needed, but seems cleaner not to have
94 # symlinks be root owned unlike everything else
95 s chown
-h bitcoin
:bitcoin
/nocow
/.bitcoin
/*
97 for var
in rpcuser rpcpassword
; do
98 u
="$(s sed -rn "s
/^
$var=(.
*)/\
1/p
" /etc/bitcoin/bitcoin.conf)"
100 u
="${u//\\/\\\\\\\\}"
103 sed -ri "s,^(rpc_${var#rpc}\s*=).*,\1 $u," joinmarket.cfg
105 sed -ri "s/^\s*(blockchain_source\s*=).*/\1 bitcoin-rpc/" joinmarket.cfg
106 ### end joinmarket setup ###