Update docs/liquid/liquid-part2.md
This commit is contained in:
parent
c631cf52be
commit
6e95a0fd14
@ -57,30 +57,24 @@ 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 "Please supply PUBKEY before running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PUBKEY=$1
|
||||
|
||||
###EDIT THESE VALUES###
|
||||
|
||||
DOMAIN="nulldata.org"
|
||||
PUBKEY="032703d8249cd55935253a9ba504103a21ea71fa7268448f1bfb3edd9905c86c90"
|
||||
ASSET="2250b062c55b83f26e14bd370391b52a41c0620792e2b1315c1a25e851e33385"
|
||||
NAME="StackerNewsDemo-1"
|
||||
PRECISION=8
|
||||
TICKER="SND-1"
|
||||
ASSET="2250b062c55b83f26e14bd370391b52a41c0620792e2b1315c1a25e851e33385"
|
||||
### END EDITING HERE ###
|
||||
|
||||
CONTRACT='{""asset_id":"'$ASSET'","entity":{"domain":"'$DOMAIN'"},"issuer_pubkey":"'$PUBKEY'","name":"'$NAME'","precision":'$PRECISION',"ticker":"'$TICKER'","version":'0'}'
|
||||
### END EDITING HERE ###
|
||||
CONTRACT='{"entity":{"domain":"'$DOMAIN'"},"issuer_pubkey":"'$PUBKEY'","name":"'$NAME'","precision":'$PRECISION',"ticker":"'$TICKER'","version":'0'}'
|
||||
|
||||
CONTRACT_HASH=$(python3 -c 'import json,sys; sys.stdout.write(json.dumps(json.loads(sys.argv[1]), sort_keys=True, separators=(",",":")))' "$CONTRACT" | sha256sum | head -c64 | fold -w2 | tac | tr -d "\\n")
|
||||
|
||||
echo CONTRACT=$CONTRACT
|
||||
echo CONTRACT_HASH=$CONTRACT_HASH
|
||||
|
||||
```
|
||||
|
||||
* Now we can use the script we saved before to generate the contract:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user