diff --git a/examples/non-fungible/README.md b/examples/non-fungible/README.md index 00090b48e758..8056a8a94248 100644 --- a/examples/non-fungible/README.md +++ b/examples/non-fungible/README.md @@ -26,16 +26,44 @@ NFTs can be transferred to various destinations, including: ### Setting Up -Most of this can be referred to the [fungible app README](https://github.com/linera-io/linera-protocol/blob/main/examples/fungible/README.md#setting-up), except for at the end when compiling and publishing the bytecode, what you'll need to do will be slightly different. +Before getting started, make sure that the binary tools `linera*` corresponding to +your version of `linera-sdk` are in your PATH. For scripting purposes, we also assume +that the BASH function `linera_spawn` is defined. + +From the root of Linera repository, this can be achieved as follows: ```bash export PATH="$PWD/target/debug:$PATH" source /dev/stdin <<<"$(linera net helper 2>/dev/null)" +``` -linera_spawn_and_read_wallet_variables linera net up --testing-prng-seed 37 +Next, start the local Linera network and run a faucet: + +```bash +FAUCET_PORT=8079 +FAUCET_URL=http://localhost:$FAUCET_PORT +linera_spawn linera net up --with-faucet --faucet-port $FAUCET_PORT + +# If you're using a testnet, run this instead: +# LINERA_TMP_DIR=$(mktemp -d) +# FAUCET_URL=https://faucet.testnet-XXX.linera.net # for some value XXX ``` -Compile the `non-fungible` application WebAssembly binaries, and publish them as an application bytecode: +Create the user wallet and add chains to it: + +```bash +export LINERA_WALLET="$LINERA_TMP_DIR/wallet.json" +export LINERA_STORAGE="rocksdb:$LINERA_TMP_DIR/client.db" + +linera wallet init --faucet $FAUCET_URL + +INFO_1=($(linera wallet request-chain --faucet $FAUCET_URL)) +INFO_2=($(linera wallet request-chain --faucet $FAUCET_URL)) +CHAIN_1="${INFO_1[0]}" +CHAIN_2="${INFO_2[0]}" +OWNER_1="${INFO_1[3]}" +OWNER_2="${INFO_2[3]}" +``` ```bash (cd examples/non-fungible && cargo build --release --target wasm32-unknown-unknown) @@ -52,15 +80,6 @@ Unlike fungible tokens, each NFT is unique and identified by a unique token ID. Refer to the [fungible app README](https://github.com/linera-io/linera-protocol/blob/main/examples/fungible/README.md#creating-a-token) to figure out how to list the chains created for the test in the default wallet, as well as defining some variables corresponding to these values. -```bash -linera wallet show - -CHAIN_1=aee928d4bf3880353b4a3cd9b6f88e6cc6e5ed050860abae439e7782e9b2dfe8 # default chain for the wallet -OWNER_1=de166237331a2966d8cf6778e81a8c007b4084be80dc1e0409d51f216c1deaa1 # owner of chain 1 -CHAIN_2=63620ea465af9e9e0e8e4dd8d21593cc3a719feac5f096df8440f90738f4dbd8 # another chain in the wallet -OWNER_2=598d18f67709fe76ed6a36b75a7c9889012d30b896800dfd027ee10e1afd49a3 # owner of chain 2 -``` - To create the NFT application, run the command below: ```bash