diff --git a/docs/liquid/liquid-part2.md b/docs/liquid/liquid-part2.md index becd9f9..4450bb1 100644 --- a/docs/liquid/liquid-part2.md +++ b/docs/liquid/liquid-part2.md @@ -56,11 +56,18 @@ Issuing assets is pretty straight forward, it can be roughly broken down into 3 shopt -s expand_aliases ### FILENAME: gen_asset_contract.sh +### USAGE: ./gen_asset_contract.sh PUBKEY + +if [ -z "$1" ]; then + echo "Missing PUBKEY: Usage ./gen_asset_contract.sh PUBKEY" + exit 1 +fi + ###EDIT THESE VALUES### DOMAIN="coins.b0xxy.net" -PUBKEY="02fc3b404d9785d2dc26ea1867e25cf047702e45d29559a4657fafe8c0dd53877e" +PUBKEY=$1 NAME="StackerNewsDemo-1" PRECISION=8 TICKER="SND-1" @@ -72,11 +79,12 @@ CONTRACT_HASH=$(python3 -c 'import json,sys; sys.stdout.write(json.dumps(json.lo echo CONTRACT=$CONTRACT echo CONTRACT_HASH=$CONTRACT_HASH + ``` * Now we can use the script we saved before to generate the contract: - - `$ ./gen_asset_contract.sh` + - `$ ./gen_asset_contract.sh 02fc3b404d9785d2dc26ea1867e25cf047702e45d29559a4657fafe8c0dd53877e` CONTRACT={"entity":{"domain":"coins.b0xxy.net"},"issuer_pubkey":"02fc3b404d9785d2dc26ea1867e25cf047702e45d29559a4657fafe8c0dd53877e","name":"StackerNewsDemo-1","precision":8,"ticker":"SND-1","version":0} @@ -131,10 +139,13 @@ It is possible to 'unblind' this information to clients, but that would involve ``` $ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getnewaddress "" legacy) - lq1qq0tnptphkrl5pyjszzpawtkgvayd2q0cnr3dcrpuyfclm729xnt63p36033xaqq270kfkr6tceqms2xr043j556dhu29s25qh +lq1qq0tnptphkrl5pyjszzpawtkgvayd2q0cnr3dcrpuyfclm729xnt63p36033xaqq270kfkr6tceqms2xr043j556dhu29s25qh $ export NEWADD='lq1qq0tn...' $ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getaddressinfo $NEWADD | jq '.pubkey' - 027bc5811ace27c847351801a92b9f4bd8683001367f6f359f3846ae9b7a5a637c +027bc5811ace27c847351801a92b9f4bd8683001367f6f359f3846ae9b7a5a637c +# ./gen_asset_contract.sh 027bc5811ace27c847351801a92b9f4bd8683001367f6f359f3846ae9b7a5a637c +CONTRACT={"entity":{"domain":"coins.b0xxy.net"},"issuer_pubkey":"027bc5811ace27c847351801a92b9f4bd8683001367f6f359f3846ae9b7a5a637c","name":"StackerNewsDemo-1","precision":8,"ticker":"SND-1","version":0} +CONTRACT_HASH=7278642440b14e436fdea271e1170371839db2697c8f0345c6e0f05cf0ccbd72 ``` ...and checking again what [the Liquid network knows about it](https://blockstream.info/liquid/asset/027bc5811ace27c847351801a92b9f4bd8683001367f6f359f3846ae9b7a5a637c)