forked from peterzen/decred-pi-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (47 loc) · 1.4 KB
/
install.sh
File metadata and controls
executable file
·62 lines (47 loc) · 1.4 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
DECRED_RELEASE=v1.0.3
DIST=decred-linux-arm-$DECRED_RELEASE
TARBALL=$DIST.tar.gz
DCRURL=https://github.com/decred/decred-binaries/releases/download/${DECRED_RELEASE}/${TARBALL}
# update distro to latest
sudo apt-get update
sudo apt-get -qy dist-upgrade
# install required packages
sudo apt-get -qy install rng-tools rpi-update jq
# set up hardware RNG generator
# http://fios.sector16.net/hardware-rng-on-raspberry-pi/
echo 'HRNGDEVICE=/dev/hwrng' | sudo tee -a /etc/default/rng-tools
echo bcm2708_rng | sudo tee -a /etc/modules
# update kernel to latest, this includes the RNG driver as well
sudo rpi-update
# create & populate decred configuration directories
mkdir ~/.dcrd ~/.dcrwallet ~/.dcrctl
RPC_PASSWORD=$(openssl rand -hex 32)
tee .dcrd/dcrd.conf > /dev/null <<DCRD_CONF
rpcuser=rpc
rpcpass=$RPC_PASSWORD
DCRD_CONF
tee .dcrctl/dcrctl.conf > /dev/null <<DCRCTL_CONF
rpcuser=rpc
rpcpass=$RPC_PASSWORD
DCRCTL_CONF
tee .dcrwallet/dcrwallet.conf > /dev/null <<DCRWALLET_CONF
username=rpc
password=$RPC_PASSWORD
DCRWALLET_CONF
# set up Decred tools
echo 'export PATH=/home/pi/decred:$PATH' >> ~/.bashrc
. ~/.bashrc
echo Downloading Decred $DECRED_RELEASE binary
rm -f decred
wget -q $DCRURL && \
tar xzf $TARBALL && \
ln -s $DIST decred && \
rm -f $TARBALL
echo
echo Installation completed, you can disconnect your network cable now.
echo
echo -n Press any key to reboot:
read
echo Rebooting...
sudo reboot