More WIP on new installation scripts
This commit is contained in:
46
production/electrs-build-bitcoin
Executable file
46
production/electrs-build-bitcoin
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/local/bin/zsh
|
||||
# add rust and llvm90 to rpi pkg
|
||||
|
||||
# load rust cargo if installed from rustup
|
||||
if [ -f "${HOME}/.cargo/env" ];then
|
||||
source "${HOME}/.cargo/env"
|
||||
export PATH="${HOME}/.cargo/bin:${PATH}"
|
||||
fi
|
||||
|
||||
# detect architecture
|
||||
case `uname -m` in
|
||||
amd64)
|
||||
TARGET=x86_64-unknown-freebsd
|
||||
;;
|
||||
arm64) # rpi4
|
||||
TARGET=aarch64-unknown-freebsd
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown Architecture!"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
# run electrs in a loop
|
||||
until false
|
||||
do
|
||||
# patch electrs source if necessary
|
||||
cd "${HOME}"/.cargo/registry/src/github.com-*/sysconf-0.3.*/
|
||||
patch -p1 < "$HOME/sysconf.patch"
|
||||
|
||||
# go home
|
||||
cd "${HOME}/electrs"
|
||||
cargo build \
|
||||
--target "${TARGET}" \
|
||||
--release \
|
||||
--bin electrs \
|
||||
-- \
|
||||
-vvvv \
|
||||
--address-search \
|
||||
--daemon-dir "${HOME}" \
|
||||
--http-addr '[::]:3000' \
|
||||
--cookie "${BITCOIN_MAINNET_RPC_USER}:${BITCOIN_MAINNET_RPC_PASS}" \
|
||||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user