diff options
author | Dimitry <dimitry@ethdev.com> | 2017-01-25 05:31:44 +0800 |
---|---|---|
committer | Dimitry <dimitry@ethdev.com> | 2017-01-25 05:31:44 +0800 |
commit | bc8ad7422d32a940bab194173083a684adcc2706 (patch) | |
tree | b951c685b5c44ab7ce5618b275da19dbbf8ec157 /RPCTests/main.js | |
parent | 3035858d203314f3e83c4e898a7c3e78c1d287fa (diff) | |
download | dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.tar dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.tar.gz dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.tar.bz2 dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.tar.lz dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.tar.xz dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.tar.zst dexon-tests-bc8ad7422d32a940bab194173083a684adcc2706.zip |
RPC tests
Diffstat (limited to 'RPCTests/main.js')
-rw-r--r-- | RPCTests/main.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/RPCTests/main.js b/RPCTests/main.js new file mode 100644 index 000000000..0cba752eb --- /dev/null +++ b/RPCTests/main.js @@ -0,0 +1,66 @@ +var exec = require('child_process').exec; + +var utils = require('./modules/utils.js'); +var startNode = require('./modules/startnode.js'); + +var ethpath = '/home/wins/Ethereum/cpp-ethereum/build/eth/eth'; +var testdir = process.env.ETHEREUM_TEST_PATH + "/RPCTests/dynamic"; + +var async = require("./modules/async"); + +function cb(err, data) +{ +console.log(data); +} + +function main(goto, args) +{ + +async.series([ +function(cb) { utils.readFile('./scripts/genesis.json', cb); }, +function(cb) { cb(); console.log("as2"); }, +function(cb) { cb(); console.log("as3"); } +], function() { console.log("as4") }) + +/*utils.sleep(2000).then(() => { + console.log('Result: '); +});*/ + +/*switch(goto) +{ +case 1: utils.mkdir('./dynamic', main, 2); break; +case 2: utils.readFile('./scripts/genesis.json', main, 3); break; +case 3: console.log(args); break; +}*/ + + +//utils.writeFile('./dynamic/genesis.json', data, (err) => { if (err) throw err;}); +//startNode(ethpath, testdir + "/ethnode1", testdir + "/genesis.json", 30305); +} + +/*var callback1 = function (err, data) {}; +fs.readFile('./scripts/genesis.json', 'utf8', (err, data) => { callback1 (err,data) }); +startNode = require('./modules/startnode.js'); + + + +callback1 = function (err, data) +{ + if (err) throw err; + data = data.replace("[ADDRESS]", "0x112233445566778899"); + mkdir('./dynamic'); + fs.writeFile('./dynamic/genesis.json', data, (err) => { if (err) throw err;}); + + + exec('pwd', function callback(error, stdout, stderr){ + dir = stdout; + startNode(ethpath, 'privatechain', testdir + "/ethnode1", 30305); + }); + + //rmdir('./dynamic'); +}*/ + + +main(1); + + |