2021-09-21 14:56:19 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Source env settings
|
|
|
|
. .env
|
|
|
|
|
|
|
|
# NeoGo binary path.
|
|
|
|
NEOGO="${NEOGO:-docker exec -it morph_chain neo-go}"
|
|
|
|
# NNS contract script hash
|
2022-03-03 12:54:27 +00:00
|
|
|
NNS_ADDR=`curl -s --data '{ "id": 1, "jsonrpc": "2.0", "method": "getcontractstate", "params": [1] }' http://morph-chain.${LOCAL_DOMAIN}:30333/ | jq -r '.result.hash'`
|
2021-09-21 14:56:19 +00:00
|
|
|
|
|
|
|
${NEOGO} contract testinvokefunction \
|
2022-03-03 12:54:27 +00:00
|
|
|
-r http://morph-chain.${LOCAL_DOMAIN}:30333 \
|
2021-10-12 12:27:55 +00:00
|
|
|
${NNS_ADDR} resolve string:${1} int:16 | jq -r '.stack[0].value | if type=="array" then .[0].value else . end' | base64 -d
|