I have a JS filter which checks for the ether transferred in a recent transaction. I have loaded this script from the interactive JS console and it's working fine. Based on the ether in the transaction, I want to run external python scripts. For e.g.(Not actual code):
if (ether = 10){
test1();
}
And the node.js code for these functions:
function test1() {
var spawn = require("child_process").spawn;
var pc1 = spawn("python",["/path/to/test1.py"]);
}
This code is working fine when I execute it separately. But when I include this in the JS snippet and reload it to the console(using loadScript()
), I get the following error:
err: cannot find module 'child_process'
child_process is a default node.js module. I understand that this is not a problem with the code but with the integration of node.js into geth client. Is this not possible at all or are there any workarounds?