forked from mempool/electrs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mempool#14 from mempool/ops/add-electrs-start-scripts
ops: Add electrs start scripts
- Loading branch information
Showing
6 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env zsh | ||
#source "${HOME}/.cargo/env" | ||
#export PATH="${HOME}/.cargo/bin:${PATH}" | ||
|
||
ELEMENTS_RPC_USER=$(grep 'rpcuser=' ${HOME}/elements.conf|cut -d = -f2|head -1) | ||
ELEMENTS_RPC_PASS=$(grep 'rpcpassword=' ${HOME}/elements.conf|cut -d = -f2|head -1) | ||
|
||
until false | ||
do | ||
cd "${HOME}/electrs" | ||
cargo run \ | ||
--release \ | ||
--features liquid \ | ||
--bin electrs \ | ||
-- \ | ||
--network liquid \ | ||
--http-socket-file "${HOME}/socket/esplora-liquid-mainnet" \ | ||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt" \ | ||
--asset-db-path "${HOME}/asset_registry_db" \ | ||
--daemon-dir "${HOME}" \ | ||
--db-dir /electrs \ | ||
--cookie "${ELEMENTS_RPC_USER}:${ELEMENTS_RPC_PASS}" \ | ||
--address-search \ | ||
--cors '*' \ | ||
-vvv | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env zsh | ||
#source "${HOME}/.cargo/env" | ||
#export PATH="${HOME}/.cargo/bin:${PATH}" | ||
|
||
ELEMENTS_RPC_USER=$(grep 'rpcuser=' "${HOME}/elements.conf"|cut -d = -f2|head -1) | ||
ELEMENTS_RPC_PASS=$(grep 'rpcpassword=' "${HOME}/elements.conf"|cut -d = -f2|head -1) | ||
|
||
until false | ||
do | ||
cd "${HOME}/electrs" | ||
cargo run \ | ||
--release \ | ||
--features liquid \ | ||
--bin electrs \ | ||
-- \ | ||
--network liquidtestnet \ | ||
--http-socket-file "${HOME}/socket/esplora-liquid-testnet" \ | ||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt" \ | ||
--asset-db-path "${HOME}/asset_registry_testnet_db" \ | ||
--daemon-dir "${HOME}" \ | ||
--db-dir "/electrs" \ | ||
--cookie "${ELEMENTS_RPC_USER}:${ELEMENTS_RPC_PASS}" \ | ||
--cors '*' \ | ||
--address-search \ | ||
-vvv | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env zsh | ||
#source "${HOME}/.cargo/env" | ||
#export PATH="${HOME}/.cargo/bin:${PATH}" | ||
|
||
BITCOIN_RPC_USER=$(grep 'rpcuser=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1) | ||
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1) | ||
|
||
until false | ||
do | ||
cd "${HOME}/electrs" | ||
cargo run \ | ||
--release \ | ||
--bin electrs \ | ||
-- \ | ||
--http-socket-file "${HOME}/socket/esplora-bitcoin-mainnet" \ | ||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt" \ | ||
--daemon-dir "${HOME}" \ | ||
--db-dir "/electrs" \ | ||
--cookie "${BITCOIN_RPC_USER}:${BITCOIN_RPC_PASS}" \ | ||
--cors '*' \ | ||
--address-search \ | ||
-vvv | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env zsh | ||
#source "${HOME}/.cargo/env" | ||
#export PATH="${HOME}/.cargo/bin:${PATH}" | ||
|
||
BITCOIN_RPC_USER=$(grep 'rpcuser=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1) | ||
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' "${HOME}/bitcoin.conf"|cut -d = -f2|head -1) | ||
|
||
until false | ||
do | ||
cd "${HOME}/electrs" | ||
cargo run \ | ||
--release \ | ||
--bin electrs \ | ||
-- \ | ||
--network signet \ | ||
--http-socket-file "${HOME}/socket/esplora-bitcoin-signet" \ | ||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt" \ | ||
--daemon-dir "${HOME}" \ | ||
--db-dir "/electrs" \ | ||
--cookie "${BITCOIN_RPC_USER}:${BITCOIN_RPC_PASS}" \ | ||
--cors '*' \ | ||
--address-search \ | ||
-vvv | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env zsh | ||
#source "${HOME}/.cargo/env" | ||
#export PATH="${HOME}/.cargo/bin:${PATH}" | ||
|
||
BITCOIN_RPC_USER=$(grep 'rpcuser=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1) | ||
BITCOIN_RPC_PASS=$(grep 'rpcpassword=' ${HOME}/bitcoin.conf|cut -d = -f2|head -1) | ||
|
||
until false | ||
do | ||
cd "${HOME}/electrs" | ||
cargo run \ | ||
--release \ | ||
--bin electrs \ | ||
-- \ | ||
--network testnet \ | ||
--http-socket-file "${HOME}/socket/esplora-bitcoin-testnet" \ | ||
--precache-scripts "${HOME}/electrs/contrib/popular-scripts.txt" \ | ||
--daemon-dir "${HOME}" \ | ||
--db-dir "/electrs" \ | ||
--cookie "${BITCOIN_RPC_USER}:${BITCOIN_RPC_PASS}" \ | ||
--cors '*' \ | ||
--address-search \ | ||
-vvv | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env zsh | ||
export ZPOOL=nvm | ||
|
||
export BITCOIN_HOME=/bitcoin | ||
export BITCOIN_USER=bitcoin | ||
export BITCOIN_GROUP=bitcoin | ||
|
||
export ELEMENTS_HOME=/elements | ||
export ELEMENTS_USER=elements | ||
export ELEMENTS_GROUP=elements | ||
|
||
# create /bitcoin/socket with custom ACL for electrs unix sockets | ||
zfs create -o "mountpoint=${BITCOIN_HOME}/socket" "${ZPOOL}/bitcoin/socket" | ||
|
||
# create /elements/socket with custom ACL for electrs unix sockets | ||
zfs create -o "mountpoint=${ELEMENTS_HOME}/socket" "${ZPOOL}/elements/socket" | ||
|
||
setfacl -m "user:bitcoin:full_set:f:allow,user:mempool:full_set:f:allow,user:www:full_set:f:allow,everyone@::f:allow" "${BITCOIN_HOME}/socket" | ||
|
||
chown "${BITCOIN_USER}:${BITCOIN_GROUP}" "${BITCOIN_HOME}/socket" | ||
|
||
setfacl -m "user:elements:full_set:f:allow,user:mempool:full_set:f:allow,user:www:full_set:f:allow,everyone@::f:allow" "${ELEMENTS_HOME}/socket" | ||
|
||
chown "${ELEMENTS_USER}:${ELEMENTS_GROUP}" "${ELEMENTS_HOME}/socket" |