Skip to content

Commit

Permalink
Merge pull request #23 from adambor/master
Browse files Browse the repository at this point in the history
Update versions in install.sh, fix demo-rgb.sh
  • Loading branch information
dr-orlovsky authored Jul 8, 2023
2 parents 2f47683 + 4f441c6 commit a783a17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
22 changes: 14 additions & 8 deletions contrib/demo-rgb.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# There might be a need to download build-essentials, cmake, python3 and python3-dev
sudo apt install -y build-essentials cmake python3 python3-dev

# --- INITIAL SETUP

# Run separate install script
Expand Down Expand Up @@ -29,7 +32,7 @@ lnpd -vvv --network testnet init

tmux new-session -d -s store stored -vvv
tmux new-session -d -s lnp lnpd -vvv --network testnet
tmux new-session -d -s rgb rgbd -vvv --network testnet
tmux new-session -d -s rgb rgbd -vvv --network testnet --electrum-server electrum.blockstream.info --electrum-port 60001
tmux new-session -d -s storm stormd -vvv --chat --downpour --msg ~/.lnp_node/testnet/msg
# -OR- run all the daemons within the same terminal (processes must be exited using process manager)
# Note: Try all these commands separately first to ensure they can run
Expand All @@ -51,6 +54,9 @@ rgb-cli -n testnet contract state ${CONTRACT_ID}
# ----------------------------------------------------------
# Go to a remote server / other machine and do the following

# There might be a need to download build-essentials, cmake, python3 and python3-dev
sudo apt install -y build-essentials cmake python3 python3-dev

# Run separate install script
./install.sh

Expand All @@ -74,7 +80,7 @@ lnpd -vvv --network testnet init

tmux new-session -d -s store stored -vvv
tmux new-session -d -s lnp lnpd -vvv --network testnet --listen-all --bifrost
tmux new-session -d -s rgb rgbd -vvv --network testnet
tmux new-session -d -s rgb rgbd -vvv --network testnet --electrum-server electrum.blockstream.info --electrum-port 60001
tmux new-session -d -s storm storm -vvv --chat --downpour

# Copy the contract we issued on the other machine
Expand All @@ -100,7 +106,7 @@ UTXO_SRC=$UTXO_ISSUE # We will transfer issued funds, but in fact it can be any
CONSIGNMENT=${DIR}/demo.rgbc
rgb-cli -n testnet transfer compose ${CONTRACT_ID} ${UTXO_SRC} ${CONSIGNMENT}
# We can verify that the consignment is correct
rgb consignment validate ${CONSIGNMENT}
rgb consignment validate ${CONSIGNMENT} electrum.blockstream.info:60001

# Next, we need to compose state transition performing the transfer for our contract.
# We do not need stash for that, since the base consignment we just created contains
Expand Down Expand Up @@ -157,14 +163,14 @@ rgb consignment inspect ${CONSIGNMENT}
# If we validate the consignment now, we will see that it will report absence
# of the mined endpoint transaction, which is correct - we have not yet published
# witness transaction from the PSBT file
rgb consignment validate ${CONSIGNMENT}
rgb consignment validate ${CONSIGNMENT} electrum.blockstream.info:60001

# Lets finalize, sign & publish the witness transaction
btc-hot sign ${PSBT} ${DIR}/testnet
btc-cold finalize --publish testnet ${PSBT}

# Now, once the transaction will be mined, the verification should pass
rgb consignment validate ${CONSIGNMENT}
rgb consignment validate ${CONSIGNMENT} electrum.blockstream.info:60001

# -- CONSUME AND UNLOCK ASSET ------------------------------------------------
# Go to a remote server / other machine and do the following
Expand All @@ -183,15 +189,15 @@ CLOSE_METHOD="tapret1st"
REVEAL="$CLOSE_METHOD@$RECEIVE_UXTO#$BLINDING_FACTOR"

# Let's consume and reveal the concealed seal inside the consignment file.
rgb -n testnet transfer consume ${CONSIGNMENT} --reveal ${REVEAL}
rgb-cli -n testnet transfer consume ${CONSIGNMENT} --reveal ${REVEAL}

# Now, we need to check if contract state has changed.
# First, get the contract ID
rgb -n testnet contract list
rgb-cli -n testnet contract list
CONTRACT_ID="rgb1...."

# Next, check the new contract state
rgb -n testnet contract state ${CONTRACT_ID}
rgb-cli -n testnet contract state ${CONTRACT_ID}

# Finally, if all works correctly, we can spend the received asset.
# This process equals the PAYMENT operation above, except that this time
Expand Down
24 changes: 12 additions & 12 deletions contrib/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ rustup toolchain install nightly
rustup update nightly
# This installs all 5 LNP/BP nodes
cargo install --force --all-features bp_node --version "0.8.0-alpha.2"
cargo install --force --all-features lnp_node --version "0.8.0"
cargo install --force --all-features rgb_node --version "0.8.1"
cargo install --force --all-features storm_node --version "0.8.0"
cargo install --force --all-features store_daemon --version "0.8.0"
cargo install --force --all-features lnp_node --version "0.9.1"
cargo install --force --all-features rgb_node --version "0.9.2"
cargo install --force --all-features storm_node --version "0.9.0"
cargo install --force --all-features store_daemon --version "0.9.0"
# This install --forces a dozen of command-line tools for working with LNP/BP stack
cargo install --force --all-features descriptor-wallet --version "0.8.3"
cargo install --force --all-features bp-core --version "0.8.1"
cargo install --force --all-features rgb-std --version "0.8.1"
cargo install --force --all-features rgb20 --version "0.8.0"
cargo install --force --all-features descriptor-wallet --version "0.10.0"
cargo install --force --all-features bp-core --version "0.9.0"
cargo install --force --all-features rgb-std --version "0.9.0"
cargo install --force --all-features rgb20 --version "0.9.0"
cargo install --force --all-features bp-cli --version "0.8.0-alpha.2"
cargo install --force --all-features lnp-cli --version "0.8.0"
cargo install --force --all-features rgb-cli --version "0.8.1"
cargo install --force --all-features storm-cli --version "0.8.0"
cargo install --force --all-features store-cli --version "0.8.0"
cargo install --force --all-features lnp-cli --version "0.9.1"
cargo install --force --all-features rgb-cli --version "0.9.1"
cargo install --force --all-features storm-cli --version "0.9.0"
cargo install --force --all-features store-cli --version "0.9.0"

0 comments on commit a783a17

Please sign in to comment.