Web3-Blue: Remote Procedure Call Node

image

The RPC node can be used to start/stop and interact with an RPC server. This is done by deploying detached Ganache Instances that can run as background processes. The node offers utilities for getting the RPC's accounts, blocks and transactions. It also offers capabilities for performing a transaction on the RPC node.

[{"id":"833e7ec38d55cef4","type":"inject","z":"dd93eebb501089eb","name":"msg.start","props":[{"p":"list","v":"true","vt":"bool"},{"p":"start","v":"false","vt":"bool"},{"p":"port","v":"8085","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":80,"wires":[["2cb3258d2c4f7e11"]]},{"id":"92a159375dbca484","type":"inject","z":"dd93eebb501089eb","name":"msg.stop","props":[{"p":"list","v":"true","vt":"bool"},{"p":"stop","v":"true","vt":"bool"},{"p":"instance","v":"salted_cinnamon_mousse","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":120,"wires":[["2cb3258d2c4f7e11"]]},{"id":"2cb3258d2c4f7e11","type":"rpc","z":"dd93eebb501089eb","name":"","function":"Ganache Server","port":"8085","rpc":"http://localhost:8085","account":"0x3C6082Fed10af8B78C1c0e7058E4038989e8c8aE","block":"0","x":400,"y":100,"wires":[["6fc44d2b000c52cc"]]},{"id":"6fc44d2b000c52cc","type":"debug","z":"dd93eebb501089eb","name":"Print Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":100,"wires":[]},{"id":"a39105ccaaa1d976","type":"inject","z":"dd93eebb501089eb","name":"RPC Injector","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":180,"wires":[["875bf79238c00eb1"]]},{"id":"875bf79238c00eb1","type":"rpc","z":"dd93eebb501089eb","name":"","function":"Get Accounts","port":"8085","rpc":"http://localhost:8085","account":"0x3C6082Fed10af8B78C1c0e7058E4038989e8c8aE","block":"0","x":390,"y":180,"wires":[["b07543b493c1159d"]]},{"id":"b07543b493c1159d","type":"debug","z":"dd93eebb501089eb","name":"Print Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":180,"wires":[]},{"id":"0ddea5fb346a5229","type":"rpc","z":"dd93eebb501089eb","name":"","function":"Balance of","port":"8085","rpc":"http://localhost:8085","account":"","block":"0","x":390,"y":240,"wires":[["e3f388434a18ac6c"]]},{"id":"e3f388434a18ac6c","type":"debug","z":"dd93eebb501089eb","name":"Print Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":240,"wires":[]},{"id":"76ebf360c08cc8da","type":"inject","z":"dd93eebb501089eb","name":"msg.payload","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"from\":\"0x3E2a1dDC2BAf9CCcD620b9B43BC3670311A5C2a0\",\"to\":\"0xed34c488ee798B6481dF91CbA0a092e1F071c20b\",\"value\":1000}","payloadType":"json","x":190,"y":360,"wires":[["09b6bae552f904a7"]]},{"id":"09b6bae552f904a7","type":"rpc","z":"dd93eebb501089eb","name":"","function":"Send Transaction","port":"8085","rpc":"http://localhost:8085","account":"","block":"0","x":410,"y":360,"wires":[["34e30e62beb5a410"]]},{"id":"34e30e62beb5a410","type":"debug","z":"dd93eebb501089eb","name":"Print Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":360,"wires":[]},{"id":"d486f0b024e32797","type":"inject","z":"dd93eebb501089eb","name":"msg.account","props":[{"p":"account","v":"0x3E2a1dDC2BAf9CCcD620b9B43BC3670311A5C2a0","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":240,"wires":[["0ddea5fb346a5229"]]},{"id":"cf8441c7a09c2cd1","type":"inject","z":"dd93eebb501089eb","name":"msg.block","props":[{"p":"block","v":"0","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":300,"wires":[["abca8eaae38c221a"]]},{"id":"abca8eaae38c221a","type":"rpc","z":"dd93eebb501089eb","name":"","function":"Get Block","port":"8085","rpc":"http://localhost:8085","account":"","block":"0","x":380,"y":300,"wires":[["35ca4ddbc109a819"]]},{"id":"35ca4ddbc109a819","type":"debug","z":"dd93eebb501089eb","name":"Print Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":300,"wires":[]},{"id":"0dfc1fe4dbd6bcf0","type":"inject","z":"dd93eebb501089eb","name":"msg.block","props":[{"p":"block","v":"1","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":420,"wires":[["40778283e5dad936"]]},{"id":"40778283e5dad936","type":"rpc","z":"dd93eebb501089eb","name":"","function":"Get Transactions","port":"8085","rpc":"http://localhost:8085","account":"","block":"0","x":410,"y":420,"wires":[["dd6252bc14756cd3"]]},{"id":"dd6252bc14756cd3","type":"debug","z":"dd93eebb501089eb","name":"Print Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":420,"wires":[]},{"id":"29681356c2972519","type":"comment","z":"dd93eebb501089eb","name":"RPC Interaction Flows","info":"","x":380,"y":40,"wires":[]}]

Collection Info

Flow Info

Created 3 years, 3 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x6)
  • inject (x7)
Other

Tags

  • web3-blue
  • node-red
  • blue-sec
  • ganache
  • rpc
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option