UNPKG

@siglesiasg/node-red-hyperledger-fabric-gateway

Version:

Hyperledger Fabric 2.x nodes for node-red with latest fabric-gateway library

887 lines 22.5 kB
[ { "id": "6c6e63a00c517697", "type": "tab", "label": "Flow Microfab", "disabled": false, "info": "", "env": [] }, { "id": "abafb1d456037c1e", "type": "fabric-peer", "name": "Microfab - Peer 1", "url": "nodered-testpeer-api.127-0-0-1.nip.io:9999", "tls": "", "grpcOptions": "{\n \"grpc.default_authority\": \"nodered-testpeer-api.127-0-0-1.nip.io:9999\",\n \"grpc.ssl_target_name_override\": \"nodered-testpeer-api.127-0-0-1.nip.io\"\n}" }, { "id": "351176dfd3b410a7", "type": "fabric-gateway", "name": "Microfab GW", "peerSelectorGw": "abafb1d456037c1e" }, { "id": "4c5c4259b27b7979", "type": "fabric-identity", "name": "Microfab - nodered-test Admin", "mspIdSelector": "46df964accc9dc05", "certType": "microfab", "certPath": "./config/identity.pem", "privateKeyPath": "./config/identity.key", "microfabUrl": "http://client.127-0-0-1.nip.io:9999", "microfabId": "nodered-testadmin" }, { "id": "95a7c9887a800091", "type": "fabric-channel", "name": "Microfab Test", "channel": "nodered-test" }, { "id": "5f1b46cce5ffeabb", "type": "fabric-contract", "name": "", "contract": "fabcar" }, { "id": "46df964accc9dc05", "type": "fabric-mspid", "name": "Microfab MSP", "mspId": "noderedtestMSP" }, { "id": "6e8b76b1d125d156", "type": "fabric-block-listener", "z": "6c6e63a00c517697", "name": "Block Listener", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "sendTransactions": "false", "checkpointerPath": "./local-env/test-config/checkpointer.ser", "x": 110, "y": 760, "wires": [ [ "b50bff98d7b19767", "cd3714a252f11441", "26d8e3a82dcc4220" ] ] }, { "id": "1118d44d3aa2895d", "type": "inject", "z": "6c6e63a00c517697", "name": "Inject", "props": [], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 240, "wires": [ [ "8ce4212f64675485", "28d8d2aeb46df630", "6f24989ca3a34edf", "9d6a20d32dc6a24e" ] ] }, { "id": "aee187ea32a2f54f", "type": "fabric-cc-submit", "z": "6c6e63a00c517697", "name": "Submit Asset", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "contractSelector": "5f1b46cce5ffeabb", "transaction": "CreateAsset", "args": "", "transientData": "[\"TEST_VALUE\"]", "x": 850, "y": 240, "wires": [ [ "4f7463d7aa133df3" ] ] }, { "id": "4f7463d7aa133df3", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 1", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1040, "y": 240, "wires": [] }, { "id": "a800c7f70cdc2c4b", "type": "fabric-cc-evaluate", "z": "6c6e63a00c517697", "name": "Query All Assets", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "contractSelector": "5f1b46cce5ffeabb", "transaction": "GetAllAssets", "args": "", "transientData": "", "x": 420, "y": 560, "wires": [ [ "1aa3acbcccc9f71a" ] ] }, { "id": "ac7dc754347f81fd", "type": "inject", "z": "6c6e63a00c517697", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 560, "wires": [ [ "a800c7f70cdc2c4b" ] ] }, { "id": "d487177454017313", "type": "change", "z": "6c6e63a00c517697", "name": "asset1 - in payload", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "[$string(rand),\"Red\",\"5\",\"Yo\",\"50\"]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 450, "y": 180, "wires": [ [ "aee187ea32a2f54f" ] ] }, { "id": "dff29e2564453d83", "type": "change", "z": "6c6e63a00c517697", "name": "asset2 - in payload.transaction", "rules": [ { "t": "delete", "p": "payload", "pt": "msg" }, { "t": "set", "p": "payload.transaction", "pt": "msg", "to": "[$string(rand),\"Red\",\"5\",\"Yo\",\"50\"]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 490, "y": 220, "wires": [ [ "aee187ea32a2f54f" ] ] }, { "id": "adcd7d91b29959df", "type": "fabric-block-listener", "z": "6c6e63a00c517697", "name": "Tx Listener", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "sendTransactions": "true", "checkpointerPath": "./local-env/test-config/checkpointer-tx1.ser", "x": 100, "y": 860, "wires": [ [ "26d8e3a82dcc4220", "9a819be0e7c1d60a", "f1f5de34aad44248" ] ] }, { "id": "26d8e3a82dcc4220", "type": "fabric-block-listener-commit", "z": "6c6e63a00c517697", "name": "", "x": 610, "y": 800, "wires": [] }, { "id": "7a838ee205893b44", "type": "catch", "z": "6c6e63a00c517697", "name": "", "scope": null, "uncaught": false, "x": 100, "y": 60, "wires": [ [ "71dc0dbe6384a169" ] ] }, { "id": "4f8cd8ba32a6e2b8", "type": "fabric-channel-info", "z": "6c6e63a00c517697", "name": "Get Channel Info", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "x": 430, "y": 980, "wires": [ [ "7e279e342ca57abf" ] ] }, { "id": "1aa3acbcccc9f71a", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 2", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 700, "y": 560, "wires": [] }, { "id": "71dc0dbe6384a169", "type": "debug", "z": "6c6e63a00c517697", "name": "debug error", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "auto", "x": 750, "y": 60, "wires": [] }, { "id": "91cc936434aa0392", "type": "inject", "z": "6c6e63a00c517697", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 980, "wires": [ [ "4f8cd8ba32a6e2b8" ] ] }, { "id": "7e279e342ca57abf", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 3", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload.result.height", "statusType": "msg", "x": 700, "y": 980, "wires": [] }, { "id": "b50bff98d7b19767", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 4", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 360, "y": 700, "wires": [] }, { "id": "9a819be0e7c1d60a", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 5", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 360, "y": 920, "wires": [] }, { "id": "2ec94290e2c7ec7c", "type": "fabric-block-info", "z": "6c6e63a00c517697", "name": "Get Block By Number", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "method": "number", "blockNumber": "2", "blockHash": "", "txId": "", "x": 440, "y": 1040, "wires": [ [ "863543ac8b5745df" ] ] }, { "id": "097b8282bc982e17", "type": "inject", "z": "6c6e63a00c517697", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 1040, "wires": [ [ "2ec94290e2c7ec7c" ] ] }, { "id": "863543ac8b5745df", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 7", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 700, "y": 1040, "wires": [] }, { "id": "9392986e6570ee55", "type": "change", "z": "6c6e63a00c517697", "name": "asset3 - in payload.transaction.args", "rules": [ { "t": "set", "p": "payload.transaction.args", "pt": "msg", "to": "[$string(rand),\"Red\",\"25\",\"Yo\",\"50\"]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 500, "y": 260, "wires": [ [ "aee187ea32a2f54f" ] ] }, { "id": "62d4510a3997bb57", "type": "change", "z": "6c6e63a00c517697", "name": "asset4 - with transient data", "rules": [ { "t": "set", "p": "payload.transaction.args", "pt": "msg", "to": "[$string(rand),\"Red\",\"15\",\"Yo\",\"50\"]", "tot": "jsonata" }, { "t": "set", "p": "payload.transaction.transient", "pt": "msg", "to": "[\"transient\"]", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 480, "y": 300, "wires": [ [ "aee187ea32a2f54f" ] ] }, { "id": "8ce4212f64675485", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 180, "wires": [ [ "d487177454017313" ] ] }, { "id": "28d8d2aeb46df630", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 220, "wires": [ [ "dff29e2564453d83" ] ] }, { "id": "6f24989ca3a34edf", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 260, "wires": [ [ "9392986e6570ee55" ] ] }, { "id": "9d6a20d32dc6a24e", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 300, "wires": [ [ "62d4510a3997bb57" ] ] }, { "id": "78e08fd769f1ef77", "type": "comment", "z": "6c6e63a00c517697", "name": "Blockchain Events & Data", "info": "", "x": 150, "y": 660, "wires": [] }, { "id": "89fb4afa817f4099", "type": "comment", "z": "6c6e63a00c517697", "name": "Chaincode", "info": "", "x": 100, "y": 120, "wires": [] }, { "id": "c44b76442fe8b4a1", "type": "inject", "z": "6c6e63a00c517697", "name": "Inject", "props": [], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 110, "y": 420, "wires": [ [ "d0a55683c292e7dd", "9f8e6780c98ca2bb", "eed9e3483738b425" ] ] }, { "id": "922bd1f77f7902c3", "type": "fabric-cc-submit", "z": "6c6e63a00c517697", "name": "Submit Asset Optional Tx", "gatewaySelector": "351176dfd3b410a7", "identitySelector": "4c5c4259b27b7979", "channelSelector": "95a7c9887a800091", "contractSelector": "5f1b46cce5ffeabb", "transaction": "", "args": "", "transientData": "[\"TEST_VALUE\"]", "x": 850, "y": 420, "wires": [ [ "1bbd5261cac4c478" ] ] }, { "id": "1bbd5261cac4c478", "type": "debug", "z": "6c6e63a00c517697", "name": "debug 8", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1040, "y": 420, "wires": [] }, { "id": "4501781afd237b74", "type": "change", "z": "6c6e63a00c517697", "name": "asset2 - tx name in payload.transactionName", "rules": [ { "t": "delete", "p": "payload", "pt": "msg" }, { "t": "set", "p": "payload.transactionName", "pt": "msg", "to": "CreateAsset", "tot": "str" }, { "t": "set", "p": "payload.transaction", "pt": "msg", "to": "[$string(rand),\"Red\",\"5\",\"Yo\",\"50\"]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 530, "y": 400, "wires": [ [ "922bd1f77f7902c3" ] ] }, { "id": "878b9d71f1e6b6ac", "type": "change", "z": "6c6e63a00c517697", "name": "asset3 - tx name in payload.transaction.name", "rules": [ { "t": "set", "p": "payload.transaction.name", "pt": "msg", "to": "CreateAsset", "tot": "str" }, { "t": "set", "p": "payload.transaction.args", "pt": "msg", "to": "[$string(rand),\"Red\",\"25\",\"Yo\",\"50\"]", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 530, "y": 440, "wires": [ [ "922bd1f77f7902c3" ] ] }, { "id": "154881b6bffb2b66", "type": "change", "z": "6c6e63a00c517697", "name": "asset4 - tx name with transient data", "rules": [ { "t": "set", "p": "payload.transaction.name", "pt": "msg", "to": "CreateAsset", "tot": "str" }, { "t": "set", "p": "payload.transaction.args", "pt": "msg", "to": "[$string(rand),\"Red\",\"15\",\"Yo\",\"50\"]", "tot": "jsonata" }, { "t": "set", "p": "payload.transaction.transient", "pt": "msg", "to": "[\"transient\"]", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 500, "y": 480, "wires": [ [ "922bd1f77f7902c3" ] ] }, { "id": "d0a55683c292e7dd", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 400, "wires": [ [ "4501781afd237b74" ] ] }, { "id": "9f8e6780c98ca2bb", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 440, "wires": [ [ "878b9d71f1e6b6ac" ] ] }, { "id": "eed9e3483738b425", "type": "random", "z": "6c6e63a00c517697", "name": "", "low": "0", "high": "999999999", "inte": "true", "property": "rand", "x": 260, "y": 480, "wires": [ [ "154881b6bffb2b66" ] ] }, { "id": "f1f5de34aad44248", "type": "delay", "z": "6c6e63a00c517697", "name": "test duplicated", "pauseType": "delay", "timeout": "100", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 380, "y": 860, "wires": [ [ "26d8e3a82dcc4220" ] ] }, { "id": "cd3714a252f11441", "type": "delay", "z": "6c6e63a00c517697", "name": "test duplicated", "pauseType": "delay", "timeout": "100", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 380, "y": 740, "wires": [ [ "26d8e3a82dcc4220" ] ] } ]