diff options
Diffstat (limited to 'bitcoind.install')
-rw-r--r-- | bitcoind.install | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bitcoind.install b/bitcoind.install new file mode 100644 index 000000000000..fc8c1e075a76 --- /dev/null +++ b/bitcoind.install @@ -0,0 +1,44 @@ +post_install() { + # Create data directory if it doesn't exist yet + mkdir -p -m 755 /var/lib/bitcoind + printf "%b\n" "$bitcoin" +} + +post_upgrade() { + # Ensure a previous blockchain in the old datadir is kept in use + if [ -f /srv/bitcoin/peers.dat ] && [ ! -d /var/lib/bitcoind ]; then + ln -s /srv/bitcoin /var/lib/bitcoind + fi + post_install +} + +read -d '' bitcoin <<'EOF' +######################################################################## +######################################################################## +## ## +## Bitcoin Core ## +## ____________ ## +## ## +## To start bitcoin-core: ## +## ## +## # systemctl start bitcoind ## +## ## +## To communicate with bitcoin-core as a normal user: ## +## ## +## $ mkdir -p ~/.bitcoin ## +## $ cat > ~/.bitcoin/bitcoin.conf <<'CFG' ## +## rpcconnect=127.0.0.1 ## +## rpcport=8332 ## +## rpcuser=bitcoin ## +## rpcpassword=secret ## +## CFG ## +## ## +## $ bitcoin-cli getmininginfo ## +## ## +## Config: /etc/bitcoin/bitcoin.conf ## +## Blockchain: /var/lib/bitcoind ## +## Documentation: /usr/share/doc/bitcoin ## +## ## +######################################################################## +######################################################################## +EOF |