Created
June 3, 2021 19:24
-
-
Save danielabrozzoni/f8d29422c8d02db63bfc9a3f0dd088ff to your computer and use it in GitHub Desktop.
Spin up a Revault deployment!
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
daemon = false | |
log_level = "trace" | |
data_dir = "./data/coordinatord_data" | |
postgres_uri = "postgresql://revault:revault@localhost/postgres" | |
managers = [ | |
# REPLACE ME | |
"60eefc8ffef57c9e3d36d68a7ffdde21b10d3ec5cdcfa9e9a5e24349ef51cc0a", | |
] | |
stakeholders = [ | |
# REPLACE ME | |
"60eefc8ffef57c9e3d36d68a7ffdde21b10d3ec5cdcfa9e9a5e24349ef51cc0a", | |
# REPLACE ME | |
"601a8eb0f61ac7c24ee38d49695da3faccaa56154b5edd6fa87eba97fab52461", | |
] | |
watchtowers = [ | |
"85609a8249d27aa94488f61e17bced8c31a90b74c68c870fa36c525c4e54817e", | |
"85609a8249d27aa94488f61e17bced8c31a90b74c68c870fa36c525c4e54817e" | |
] |
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
daemon = true | |
log_level = "trace" | |
data_dir = "./data/cosignerd1_data" | |
listen="127.0.0.1:10001" | |
managers = [ | |
# REPLACE MY NOISE KEY | |
{ xpub = "xpub6CZFHPW1GiB8YgV7zGpeQDB6mMHZYPQyUaHrM1nMvKMgLxwok4xCtnzjuxQ3p1LHJUkz5i1Y7bRy5fmGrdg8UBVb39XdXNtWWd2wTsNd7T9", noise_key = "60eefc8ffef57c9e3d36d68a7ffdde21b10d3ec5cdcfa9e9a5e24349ef51cc0a" } | |
] |
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
daemon = true | |
log_level = "trace" | |
data_dir = "./data/cosignerd2_data" | |
listen="127.0.0.1:10002" | |
managers = [ | |
# REPLACE MY NOISE KEY | |
{ xpub = "xpub6CZFHPW1GiB8YgV7zGpeQDB6mMHZYPQyUaHrM1nMvKMgLxwok4xCtnzjuxQ3p1LHJUkz5i1Y7bRy5fmGrdg8UBVb39XdXNtWWd2wTsNd7T9", noise_key = "60eefc8ffef57c9e3d36d68a7ffdde21b10d3ec5cdcfa9e9a5e24349ef51cc0a" } | |
] |
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
revaultd_config_path="./configuration_files/revaultd_stake2.toml" | |
revaultd_path="./revaultd/target/debug/revaultd" | |
log_level="info" | |
debug=true |
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
revaultd_config_path="./configuration_files/revaultd_stake_man.toml" | |
revaultd_path="./revaultd/target/debug/revaultd" | |
log_level="info" | |
debug=true |
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
# If `true`, revaultd will start as a daemon. If you're using revaultd with revault-gui, you might want to keep it to `true`, so that the gui can start revaultd on its own. If you're starting `revaultd` for the first time, you may want to change it to `false`, so that you can see if something goes wrong. | |
daemon = true | |
log_level = "debug" | |
# The directory where all your revault data will be saved | |
data_dir = "./data/revaultd_stake2_data" | |
coordinator_host = "127.0.0.1:8383" | |
# REPLACE ME | |
coordinator_noise_key = "03f43f61648a26c7ab7fc47002bc84a1f80429781f4198b6cf50cd722747f145" | |
# The specifications of the Bitcoin Script that we are going to be tracking onchain, put here your own that you can | |
# generate with the `mscompiler` tool (in `contrib/tools`). | |
# These MUST NOT be changed after running revaultd for the first time, or you'll have to re-generate the database. | |
# If you have to change it, be sure to remove the previous db at `/path/to/your/data_dir/network/revaultd.sqlite3`. | |
[scripts_config] | |
deposit_descriptor = "wsh(multi(2,xpub6DEzq5DNPx2rPiZJ7wvFhxRKUKDoV1GwjFmFdaxFfbsw9HsHyxc9usoRUMxqJaMrwoXh4apahsGEnjAS4cVCBDgqsx5Groww22AdHbgxVDg/*,xpub6F7Ltmsut73cbUNAzh44DkxncMeQfPtRzx7aoXjFbUdd7yofR2intU4b6QcsXot1jgmVjHB3iMybCLhtqvhAx3L4VPbGUz5fwuyNeTkypUP/*))#asfyu8z9" | |
unvault_descriptor = "wsh(andor(thresh(1,pk(xpub6CZFHPW1GiB8YgV7zGpeQDB6mMHZYPQyUaHrM1nMvKMgLxwok4xCtnzjuxQ3p1LHJUkz5i1Y7bRy5fmGrdg8UBVb39XdXNtWWd2wTsNd7T9/*)),and_v(v:multi(2,030f64b922aee2fd597f104bc6cb3b670f1ca2c6c49b1071a1a6c010575d94fe5a,02abe475b199ec3d62fa576faee16a334fdb86ffb26dce75becebaaedf328ac3fe),older(3)),thresh(2,pkh(xpub6DEzq5DNPx2rPiZJ7wvFhxRKUKDoV1GwjFmFdaxFfbsw9HsHyxc9usoRUMxqJaMrwoXh4apahsGEnjAS4cVCBDgqsx5Groww22AdHbgxVDg/*),a:pkh(xpub6F7Ltmsut73cbUNAzh44DkxncMeQfPtRzx7aoXjFbUdd7yofR2intU4b6QcsXot1jgmVjHB3iMybCLhtqvhAx3L4VPbGUz5fwuyNeTkypUP/*))))#f5l5qsjt" | |
cpfp_descriptor = "wsh(thresh(1,pk(xpub6DoAecs8NFwcTQtUR9vGACodaa3245VuDQi3ubtE8TWV7swH7ZDWCYcuVNDRMpZjFekyU1uFPpMcZe8vgJ23h7FrZEnEtmNeFNCTgpPzJ79/*)))#4cxyfeck" | |
# The private version of the above keys: | |
# Stakeholders: | |
# xprv9zFeRZgUZaUZBEUq1vPFLpUavHPK5YZ6N2qeqCYe7GLxGVY9SRHuN5Uwd5YN56tMUKe2qPhmvP8fC1GBEAFRAwbJQi86swWvvGM5tXBpJt6 | |
# xprvA27zVGM23jVKNzHhtfX3rd244KovFwAadjBz19Ke396eFBUWsVQYLfk7FAK6dENumsrtd8mJCSFxnm9BkyaWXuBVSd5tZ2c9r5tjPNkz7A9 | |
# Cosigning servers: | |
# L1h54b51ky7gPhQi2etvJtiLqCUfWzLthjWjszSmz1S9e9EvvaHd | |
# KyUa6WXsxax4aqx5ggsDfSTGGc6rW8K1AMmDpoiGLFGPP7Ab4sXZ | |
# Managers: | |
# xprv9yZtssy7SLcqLCQetFHe35ENDKT58vh87MNFYdNkMyphUAcfCXdxLzgG4enc7ZT8NXjBtivtLrtpjZAJzyiTEAKM6NKUeFerP97DZdctJPr | |
# CPFP: | |
# xprv9zopF7LEXtPKEvp1K8PFo4ru2YCXecn3rBnT7DUca7yWF5c8a1uFekJRe68Dt3tSJAEifz4Bm28BYm4zuRintyhrJT2fC29pDwxf6DBiViY | |
[bitcoind_config] | |
network = "regtest" | |
# REPLACE ME | |
cookie_path = "/home/daniela/Developer/Revault/DemoMiami/bitcoin_data/regtest/.cookie" | |
addr = "127.0.0.1:9000" | |
poll_interval_secs = 3 | |
# This section must be copied only if you're a stakeholder. Put here your xpub, watchtower configuration and Emergency address. | |
[stakeholder_config] | |
# This MUST NOT be changed after running revaultd for the first time, or you'll have to re-generate the database. | |
# If you have to change it, be sure to remove the previous db at `/path/to/your/data_dir/network/revaultd.sqlite3`. | |
xpub = "xpub6F7Ltmsut73cbUNAzh44DkxncMeQfPtRzx7aoXjFbUdd7yofR2intU4b6QcsXot1jgmVjHB3iMybCLhtqvhAx3L4VPbGUz5fwuyNeTkypUP" | |
# At the moment this is unused | |
watchtowers = [ { host = "127.0.0.1:1", noise_key = "46084f8a7da40ef7ffc38efa5af8a33a742b90f920885d17c533bb2a0b680cb3" } ] | |
emergency_address = "bcrt1qewc2348370pgw8kjz8gy09z8xyh0d9fxde6nzamd3txc9gkmjqmq8m4cdq" |
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
# If `true`, revaultd will start as a daemon. If you're using revaultd with revault-gui, you might want to keep it to `true`, so that the gui can start revaultd on its own. If you're starting `revaultd` for the first time, you may want to change it to `false`, so that you can see if something goes wrong. | |
daemon = true | |
log_level = "debug" | |
# The directory where all your revault data will be saved | |
data_dir = "./data/revaultd_stake_man_data" | |
coordinator_host = "127.0.0.1:8383" | |
# REPLACE ME | |
coordinator_noise_key = "03f43f61648a26c7ab7fc47002bc84a1f80429781f4198b6cf50cd722747f145" | |
# The specifications of the Bitcoin Script that we are going to be tracking onchain, put here your own that you can | |
# generate with the `mscompiler` tool (in `contrib/tools`). | |
# These MUST NOT be changed after running revaultd for the first time, or you'll have to re-generate the database. | |
# If you have to change it, be sure to remove the previous db at `/path/to/your/data_dir/network/revaultd.sqlite3`. | |
[scripts_config] | |
deposit_descriptor = "wsh(multi(2,xpub6DEzq5DNPx2rPiZJ7wvFhxRKUKDoV1GwjFmFdaxFfbsw9HsHyxc9usoRUMxqJaMrwoXh4apahsGEnjAS4cVCBDgqsx5Groww22AdHbgxVDg/*,xpub6F7Ltmsut73cbUNAzh44DkxncMeQfPtRzx7aoXjFbUdd7yofR2intU4b6QcsXot1jgmVjHB3iMybCLhtqvhAx3L4VPbGUz5fwuyNeTkypUP/*))#asfyu8z9" | |
unvault_descriptor = "wsh(andor(thresh(1,pk(xpub6CZFHPW1GiB8YgV7zGpeQDB6mMHZYPQyUaHrM1nMvKMgLxwok4xCtnzjuxQ3p1LHJUkz5i1Y7bRy5fmGrdg8UBVb39XdXNtWWd2wTsNd7T9/*)),and_v(v:multi(2,030f64b922aee2fd597f104bc6cb3b670f1ca2c6c49b1071a1a6c010575d94fe5a,02abe475b199ec3d62fa576faee16a334fdb86ffb26dce75becebaaedf328ac3fe),older(3)),thresh(2,pkh(xpub6DEzq5DNPx2rPiZJ7wvFhxRKUKDoV1GwjFmFdaxFfbsw9HsHyxc9usoRUMxqJaMrwoXh4apahsGEnjAS4cVCBDgqsx5Groww22AdHbgxVDg/*),a:pkh(xpub6F7Ltmsut73cbUNAzh44DkxncMeQfPtRzx7aoXjFbUdd7yofR2intU4b6QcsXot1jgmVjHB3iMybCLhtqvhAx3L4VPbGUz5fwuyNeTkypUP/*))))#f5l5qsjt" | |
cpfp_descriptor = "wsh(thresh(1,pk(xpub6DoAecs8NFwcTQtUR9vGACodaa3245VuDQi3ubtE8TWV7swH7ZDWCYcuVNDRMpZjFekyU1uFPpMcZe8vgJ23h7FrZEnEtmNeFNCTgpPzJ79/*)))#4cxyfeck" | |
# The private version of the above keys: | |
# Stakeholders: | |
# xprv9zFeRZgUZaUZBEUq1vPFLpUavHPK5YZ6N2qeqCYe7GLxGVY9SRHuN5Uwd5YN56tMUKe2qPhmvP8fC1GBEAFRAwbJQi86swWvvGM5tXBpJt6 | |
# xprvA27zVGM23jVKNzHhtfX3rd244KovFwAadjBz19Ke396eFBUWsVQYLfk7FAK6dENumsrtd8mJCSFxnm9BkyaWXuBVSd5tZ2c9r5tjPNkz7A9 | |
# Cosigning servers: | |
# L1h54b51ky7gPhQi2etvJtiLqCUfWzLthjWjszSmz1S9e9EvvaHd | |
# KyUa6WXsxax4aqx5ggsDfSTGGc6rW8K1AMmDpoiGLFGPP7Ab4sXZ | |
# Managers: | |
# xprv9yZtssy7SLcqLCQetFHe35ENDKT58vh87MNFYdNkMyphUAcfCXdxLzgG4enc7ZT8NXjBtivtLrtpjZAJzyiTEAKM6NKUeFerP97DZdctJPr | |
# CPFP: | |
# xprv9zopF7LEXtPKEvp1K8PFo4ru2YCXecn3rBnT7DUca7yWF5c8a1uFekJRe68Dt3tSJAEifz4Bm28BYm4zuRintyhrJT2fC29pDwxf6DBiViY | |
[bitcoind_config] | |
network = "regtest" | |
cookie_path = "/home/daniela/Developer/Revault/DemoMiami/bitcoin_data/regtest/.cookie" | |
addr = "127.0.0.1:9000" | |
poll_interval_secs = 3 | |
# This section must be copied only if you're a stakeholder. Put here your xpub, watchtower configuration and Emergency address. | |
[stakeholder_config] | |
# This MUST NOT be changed after running revaultd for the first time, or you'll have to re-generate the database. | |
# If you have to change it, be sure to remove the previous db at `/path/to/your/data_dir/network/revaultd.sqlite3`. | |
xpub = "xpub6DEzq5DNPx2rPiZJ7wvFhxRKUKDoV1GwjFmFdaxFfbsw9HsHyxc9usoRUMxqJaMrwoXh4apahsGEnjAS4cVCBDgqsx5Groww22AdHbgxVDg" | |
# At the moment this is unused | |
watchtowers = [ { host = "127.0.0.1:1", noise_key = "46084f8a7da40ef7ffc38efa5af8a33a742b90f920885d17c533bb2a0b680cb3" } ] | |
emergency_address = "bcrt1qewc2348370pgw8kjz8gy09z8xyh0d9fxde6nzamd3txc9gkmjqmq8m4cdq" | |
# This section must be copied only if you're a manager. Put here your xpub and cosigning servers configuration. | |
[manager_config] | |
# This MUST NOT be changed after running revaultd for the first time, or you'll have to re-generate the database. | |
# If you have to change it, be sure to remove the previous db at `/path/to/your/data_dir/network/revaultd.sqlite3`. | |
xpub = "xpub6CZFHPW1GiB8YgV7zGpeQDB6mMHZYPQyUaHrM1nMvKMgLxwok4xCtnzjuxQ3p1LHJUkz5i1Y7bRy5fmGrdg8UBVb39XdXNtWWd2wTsNd7T9" | |
# REPLACE ME | |
cosigners = [ { host = "127.0.0.1:10001", noise_key = "181556bf0e88b3f0204e7e3aeb804e0438c35d63878629c25e05cee46ee5c625" }, { host = "127.0.0.1:10002", noise_key = "12fafa9fe001f39db2aab3492e51d9c0b7f3d25813ef8120a5a7cd6df7df7e7d" } ] |
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
Color_Off='\033[0m' # Text Reset | |
Green='\033[0;32m' # Green | |
Yellow='\033[0;33m' # Yellow | |
Blue='\033[0;34m' # Blue | |
Purple='\033[0;35m' # Purple | |
download_repos() { | |
mkdir data | |
git clone https://github.com/revault/coordinatord | |
cd coordinatord | |
git checkout 8178de74ca7d2958b13f208db60d55a3d3ebf2d9 | |
cargo build | |
cd .. | |
git clone https://github.com/revault/revault-gui/ | |
cd revault-gui | |
git checkout d0524f72b8595f3a26813d5e5b8c2a4185f243b2 | |
cargo build --release | |
cd .. | |
git clone https://github.com/revault/revaultd | |
cd revaultd | |
git checkout 062abff12e2dc3800b2bdf21b8853adae6a6df92 | |
cargo build | |
cd contrib/tools/psbtsigner/ | |
cargo build | |
cd ../../../../ | |
mkdir data/cosignerd1_data | |
cd data/cosignerd1_data | |
python3 -c 'import os; import base58; open("bitcoin_secret", "wb").write(base58.b58decode_check("L1h54b51ky7gPhQi2etvJtiLqCUfWzLthjWjszSmz1S9e9EvvaHd")[1:-1])' | |
cd ../../ | |
mkdir data/cosignerd2_data | |
cd data/cosignerd2_data | |
python3 -c 'import os; import base58; open("bitcoin_secret", "wb").write(base58.b58decode_check("KyUa6WXsxax4aqx5ggsDfSTGGc6rW8K1AMmDpoiGLFGPP7Ab4sXZ")[1:-1])' | |
cd ../../ | |
git clone https://github.com/revault/cosignerd | |
cd cosignerd | |
git checkout 33bcc1fa1e07066e9448d04b0af2fb95aa49d218 | |
cargo build | |
cd .. | |
} | |
create_regtest() { | |
mkdir -p bitcoin_data | |
cat <<EOF > bitcoin_data/bitcoin.conf | |
regtest=1 | |
[regtest] | |
rpcport=9000 | |
bind=127.0.0.1:9001 | |
daemon=1 | |
txindex=1 | |
whitelist=127.0.0.1 | |
fallbackfee=0.00001 | |
debug=1 | |
EOF | |
echo "Created datadir at ./bitcoin_data" | |
} | |
setup_aliases() { | |
SM_KEY="xprv9zFeRZgUZaUZBEUq1vPFLpUavHPK5YZ6N2qeqCYe7GLxGVY9SRHuN5Uwd5YN56tMUKe2qPhmvP8fC1GBEAFRAwbJQi86swWvvGM5tXBpJt6" | |
S2_KEY="xprvA27zVGM23jVKNzHhtfX3rd244KovFwAadjBz19Ke396eFBUWsVQYLfk7FAK6dENumsrtd8mJCSFxnm9BkyaWXuBVSd5tZ2c9r5tjPNkz7A9" | |
M_KEY="xprv9yZtssy7SLcqLCQetFHe35ENDKT58vh87MNFYdNkMyphUAcfCXdxLzgG4enc7ZT8NXjBtivtLrtpjZAJzyiTEAKM6NKUeFerP97DZdctJPr" | |
alias rsm="./revaultd/target/debug/revault-cli --conf ./configuration_files/revaultd_stake_man.toml"; | |
alias rs2="./revaultd/target/debug/revault-cli --conf ./configuration_files/revaultd_stake2.toml"; | |
alias bcli="bitcoin-cli -regtest -datadir=bitcoin_data -rpcwallet=\"test\"" | |
alias sm_gui="./revault-gui/target/release/revault-gui --conf ./configuration_files/gui_stake_man.toml" | |
alias s2_gui="./revault-gui/target/release/revault-gui --conf ./configuration_files/gui_stake2.toml" | |
alias psbtsigner="./revaultd/contrib/tools/psbtsigner/target/debug/psbtsigner" | |
alias psbtsigner_m="./revaultd/contrib/tools/psbtsigner/target/debug/psbtsigner $M_KEY/0 $M_KEY/1 $M_KEY/2 $M_KEY/3 $M_KEY/4 $M_KEY/5 $M_KEY/6 $M_KEY/7 $M_KEY/8 $M_KEY/9 $M_KEY/10 $M_KEY/11" | |
} | |
start_regtest() { | |
setup_aliases | |
bitcoind -regtest -datadir=bitcoin_data | |
echo "Started bitcoind with P2P port 9000, RPC port 9001 and datadir bitcoin_data" | |
if [ $(bcli -named createwallet wallet_name="test" descriptors=true load_on_startup=true &> /dev/null; echo $?) -eq 0 ];then | |
echo "Created descriptor wallet 'test'"; | |
fi | |
while [ $(bcli getblockchaininfo &> /dev/null; echo $?) -ne 0 ];do | |
echo "Waiting for bitcoind to warmup.." | |
sleep 0.5 | |
done | |
} | |
start_revaultd() { | |
setup_aliases | |
echo "${Yellow}=== REVAULTD ===${Color_Off}" | |
./revaultd/target/debug/revaultd --conf "./configuration_files/revaultd_stake_man.toml"; | |
./revaultd/target/debug/revaultd --conf "./configuration_files/revaultd_stake2.toml"; | |
} | |
fund_regtest() { | |
setup_aliases | |
for i in $(seq 105);do | |
if [ $(bcli generatetoaddress 1 $(bcli getnewaddress 2> /dev/null) &> /dev/null; echo $?) -ne 0 ];then | |
return | |
fi | |
done | |
} | |
start_coordinatord() { | |
setup_aliases | |
# TODO: add a docker volume to persist data | |
if [ $(docker ps --filter "name=postgres-coordinatord" -q | wc -l) -ne 1 ]; then | |
echo "${Yellow}=== COORDINATORD DATABASE ===${Color_Off}" | |
docker run --rm -d -p 5432:5432 --name postgres-coordinatord -e POSTGRES_PASSWORD=revault -e POSTGRES_USER=revault -e POSTGRES_DB=coordinator_db postgres:alpine | |
echo "Waiting for the database to warm up..." | |
# TODO: find a smarter way... | |
sleep 5 | |
fi | |
echo "${Yellow}=== COORDINATORD ===${Color_Off}" | |
./coordinatord/target/debug/revault_coordinatord --conf ./configuration_files/coordinatord.toml | |
} | |
start_cosigners() { | |
setup_aliases | |
echo "${Yellow}=== COSIGNER1 ===${Color_Off}" | |
./cosignerd/target/debug/cosignerd --conf ./configuration_files/cosignerd1.toml | |
echo "${Yellow}=== COSIGNER2 ===${Color_Off}" | |
./cosignerd/target/debug/cosignerd --conf ./configuration_files/cosignerd2.toml | |
} | |
create_vaults() { | |
setup_aliases | |
address=$(rsm getdepositaddress | jq -r .result.address) | |
for i in $(seq 5); do | |
bcli -named sendtoaddress address=$address amount=$(($RANDOM / 1000)) fee_rate="1" | |
done | |
fund_regtest | |
} | |
ack_vaults() { | |
setup_aliases | |
for i in $(seq 4); do | |
vault=$(rsm listvaults '["funded"]' | jq ".result.vaults[0]") | |
echo "Securing $vault" | |
outpoint=$(echo $vault | jq -r .txid):$(echo $vault | jq -r .vout) | |
txs=$(rsm getrevocationtxs $outpoint | jq .result) | |
index=$(echo $vault | jq -r .derivation_index) | |
cancel=$(tail -n +2 <<< $(psbtsigner $SM_KEY/$index $S2_KEY/$index $(echo $txs | jq -r .cancel_tx) 0)) | |
emergency=$(tail -n +2 <<< $(psbtsigner $SM_KEY/$index $S2_KEY/$index $(echo $txs | jq -r .emergency_tx) 0)) | |
emergency_unvault=$(tail -n +2 <<< $(psbtsigner $SM_KEY/$index $S2_KEY/$index $(echo $txs | jq -r .emergency_unvault_tx) 0)) | |
rsm revocationtxs $outpoint $cancel $emergency $emergency_unvault | |
done | |
} | |
delegate_vaults() { | |
setup_aliases | |
vault=$(rsm listvaults '["secured"]' | jq ".result.vaults[0]") | |
echo "Delegating $vault" | |
outpoint=$(echo $vault | jq -r .txid):$(echo $vault | jq -r .vout) | |
unvault=$(rsm getunvaulttx $(echo $vault | jq -r .txid):$(echo $vault | jq -r .vout) | jq -r .result.unvault_tx) | |
index=$(echo $vault | jq -r .derivation_index) | |
unvault=$(tail -n +2 <<< $(psbtsigner $SM_KEY/$index $S2_KEY/$index $unvault 0)) | |
rsm unvaulttx $outpoint $unvault | |
} | |
setup() { | |
setup_aliases | |
download_repos | |
create_regtest | |
start_regtest | |
fund_regtest | |
echo "${Green}Setup done! Make sure to properly modify the the configuration files (see #REPLACE ME comments) before calling start_env${Color_Off}" | |
} | |
start_env() { | |
start_regtest | |
setup_aliases | |
start_revaultd | |
start_cosigners | |
start_coordinatord | |
} | |
fund_revaultd() { | |
setup_aliases | |
create_vaults | |
ack_vaults | |
delegate_vaults | |
} | |
echo "Hola!" | |
echo "functions:" | |
echo "${Purple}setup()${Color_Off}\tTo be called only the first time you use the script. It will download the repos, create the regtest, start it and fund it." | |
echo "${Purple}start_env()${Color_Off}\tIt will start the environment: the regtest, 2 cosigners, 2 revaultd daemon (one stakeholder-manager and one manager), 1 coordinator" | |
echo "${Purple}fund_revaultd()${Color_Off}\tSends some sats to the deposit addresses, acks and delegates some vaults" | |
echo "" | |
echo "aliases:" | |
echo "${Blue}rsm${Color_Off}\tRevaultd stakeholder-manager cli" echo "${Blue}rs2${Color_Off}\tRevaultd second stakeholder cli" | |
echo "${Blue}bcli${Color_Off}\tThe regtest's bitcoin-cli" | |
echo "${Blue}sm_gui${Color_Off}\tStakeholder-manager GUI" | |
echo "${Blue}s2_gui${Color_Off}\tStakeholder2 GUI" | |
echo "${Blue}psbtsigner${Color_Off}" | |
echo "${Blue}psbtsigner_m${Color_Off} psbtsigner binary, followed by the manager key with the index from 0 to 11. Useful for when you don't know the derivation index used" | |
echo "" | |
echo "Variables:" | |
echo "${Green}M_KEY${Color_Off} Manager private key" | |
echo "${Green}SM_KEY${Color_Off} Stakeholder1 private key" | |
echo "${Green}S2_KEY${Color_Off} Stakeholder2 private key" | |
setup_aliases |
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
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
pkgs.mkShell { | |
buildInputs = [ | |
pkg-config | |
gtk3-x11 | |
libelf | |
vulkan-loader | |
sqlite | |
python3 | |
python38Packages.base58 | |
#python38Packages.binascii | |
]; | |
shellHook = '' | |
export LD_LIBRARY_PATH=${pkgs.vulkan-loader}/lib | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment