Skip to content

Instantly share code, notes, and snippets.

@Hribek25
Created May 3, 2021 16:22
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hribek25/4a6f9ac279c3ae0a1f6dad1097d7d114 to your computer and use it in GitHub Desktop.
Save Hribek25/4a6f9ac279c3ae0a1f6dad1097d7d114 to your computer and use it in GitHub Desktop.
How to send IOTA non-value message via simple bash
INDEX_PAYLOAD=$(printf "hello-world-index" | xxd -ps)\
&& DATA_PAYLOAD=$(printf "some data" | xxd -ps)\
&& PAYLOAD=$(echo -e "{\"payload\": {\"type\": 2,\"index\": \"$INDEX_PAYLOAD\", \"data\": \"$DATA_PAYLOAD\"}}")\
&& curl --request POST --header "Content-Type: application/json" --data "$PAYLOAD" --url https://api.lb-0.testnet.chrysalis2.com/api/v1/messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment