node-red-contrib-nem2 create mosaic example template

Description

Alt text

The flow will send two transactions bundled in on aggregate complete transaction to create a mosaic definition and set the mosaic supply. The flow also opens 2 listeners.

  • Error listener.
  • Confirmed transaction listener

note: The publicAccount need to be send first.

Requirements

Mandatory

  • Public account
    • publicKey that is linked to the privateKey in the account node.
  • account
    • privateKey that is linked to the publicKey in the public account node.
  • createMosaicDefinitionTransaction
    • Registered namespace name (optional subnamespace with ”.” as delimiter)
    • Mosaic name
    • Duration expressed in NEM blockchain blocks
  • mosaicSupplyChangeTransaction
    • Full mosaic name (e.g namespace.optionalsubnamespace:mosaicname)
    • Amount
    • Direction (increase or decrease amount)
  • aggregateCompleteTransaction
    • Trigger, when the trigger is received the transactions will be bundled in an aggregateComplete transaction
  • announce transaction
    • url to a catapult server
  • listeners
    • url to a catapult server
[{"id":"ce341506.754568","type":"createMosaicDefinition","z":"cc26cffa.2b224","name":"","namespace":"","mosaic":"","supplyMutable":false,"transferable":true,"levyMutable":false,"divisibility":"0","duration":"1000","network":"dbf1a14a.ab0c","x":464.4444580078125,"y":77.11111450195312,"wires":[["ef8af4c2.3fdbd8"]]},{"id":"108e0748.0a4299","type":"signTransaction","z":"cc26cffa.2b224","name":"","privateKey":"","network":"dbf1a14a.ab0c","x":1026.3333129882812,"y":149.7777557373047,"wires":[["b70464c3.b79498"]]},{"id":"b70464c3.b79498","type":"announce","z":"cc26cffa.2b224","name":"","server":"551021ac.e378e","announceType":"announce","x":1038.1111450195312,"y":241.66665649414062,"wires":[[]]},{"id":"e5d90994.4c96d8","type":"listener","z":"cc26cffa.2b224","name":"listen for errors","server":"551021ac.e378e","address":"","listenerType":"status","x":431.11109924316406,"y":338.88888454437256,"wires":[["d386266e.062118"]]},{"id":"d386266e.062118","type":"debug","z":"cc26cffa.2b224","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":644.444450378418,"y":338.8888816833496,"wires":[]},{"id":"43d23fda.3af1c","type":"listener","z":"cc26cffa.2b224","name":"","server":"551021ac.e378e","address":"","listenerType":"confirmed","x":442.2222213745117,"y":406.6666374206543,"wires":[["d635393d.cadee8"]]},{"id":"d635393d.cadee8","type":"debug","z":"cc26cffa.2b224","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":642.2222213745117,"y":406.6666374206543,"wires":[]},{"id":"230d3165.49915e","type":"mosaicSupplyChange","z":"cc26cffa.2b224","name":"","amount":"100000000","mosaic":"","direction":"1","network":"dbf1a14a.ab0c","x":464.9999694824219,"y":157.11109924316406,"wires":[["a07534c2.a93e28"]]},{"id":"ef8af4c2.3fdbd8","type":"aggregateComplete","z":"cc26cffa.2b224","name":"","trigger":"bundle","network":"dbf1a14a.ab0c","x":918.2222290039062,"y":77.77779388427734,"wires":[["108e0748.0a4299"]]},{"id":"2a367946.b7a826","type":"publicAccount","z":"cc26cffa.2b224","name":"","publicKey":"","network":"dbf1a14a.ab0c","x":147.44444274902344,"y":78.22222137451172,"wires":[["ce341506.754568"]]},{"id":"bdccf172.650ba","type":"comment","z":"cc26cffa.2b224","name":"Create mosaic","info":"The flow will send two transactions bundled in on aggregate complete transaction to create a mosaic definition and set the mosaic supply. The flow also opens 2 listeners.\n\nError listener.\nConfirmed transaction listener\nnote: The publicAccount need to be send first.","x":144.1111068725586,"y":36.888885498046875,"wires":[]},{"id":"a07534c2.a93e28","type":"change","z":"cc26cffa.2b224","name":"set trigger","rules":[{"t":"set","p":"nem.trigger","pt":"msg","to":"bundle","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":158,"wires":[["ef8af4c2.3fdbd8"]]},{"id":"cc920042.a8e8a","type":"account","z":"cc26cffa.2b224","name":"","privateKey":"","network":"dbf1a14a.ab0c","x":127.55555725097656,"y":156.44444274902344,"wires":[["230d3165.49915e","e5d90994.4c96d8","43d23fda.3af1c"]]},{"id":"dbf1a14a.ab0c","type":"networkConfig","z":"","network":"MIJIN_TEST","customNetwork":""},{"id":"551021ac.e378e","type":"serverConfig","z":"","url":"http://localhost","customUrl":"","network":"2b9cf13.9eaf90e","port":"3000"},{"id":"2b9cf13.9eaf90e","type":"networkConfig","z":"","network":"MIJIN_TEST","customNetwork":""}]
jorisadri

Flow Info

created 9 months, 3 weeks ago
updated 5 months, 2 weeks ago

Node Types

Core
  • change (x1)
  • comment (x1)
  • debug (x2)
Other

Tags

  • nem
  • nem2
  • blockchain
  • catapult
  • mosaic
  • transaction
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option