Skip to content

Commit

Permalink
adding clean script
Browse files Browse the repository at this point in the history
  • Loading branch information
ethereumdegen committed May 9, 2018
1 parent 771c803 commit 6a5cd78
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 2 deletions.
31 changes: 31 additions & 0 deletions clean-redis.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var INFURA_MAINNET_URL = 'https://mainnet.infura.io/gmXEVo5luMPUGPqg6mhy';


var redisInterface = require('./lib/redis-interface')
var peerInterface = require('./lib/peer-interface')

var tokenInterface = require('./lib/token-interface')

var poolConfig = require('./pool.config').config
var accountConfig = require('./account.config').accounts;

var Web3 = require('web3')
var web3 = new Web3()
web3.setProvider(INFURA_MAINNET_URL)

var pool_env = "main"

async function init()
{

await redisInterface.init()
await tokenInterface.init(redisInterface,web3,accountConfig,poolConfig,pool_env)

await peerInterface.init(web3,accountConfig,poolConfig,redisInterface,tokenInterface,pool_env) //initJSONRPCServer();

await peerInterface.cleanRedisData();

process.exit()
}

init();
3 changes: 1 addition & 2 deletions lib/peer-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ module.exports = {

setTimeout(function(){self.updateVariableDifficultyPeriod()},0)

setTimeout(function(){self.cleanRedisData()},0)
},


Expand Down Expand Up @@ -552,7 +551,7 @@ module.exports = {



setTimeout(function(){self.cleanRedisData()},60 * 1000)
//setTimeout(function(){self.cleanRedisData()},60 * 1000)
},

async monitorMinedSolutions()
Expand Down
48 changes: 48 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
0 info it worked if it ends with ok
1 verbose cli [ '/home/andy/.nvm/versions/node/v6.12.2/bin/node',
1 verbose cli '/home/andy/.nvm/versions/node/v6.12.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'clean_redis' ]
2 info using npm@3.10.10
3 info using node@v6.12.2
4 verbose run-script [ 'preclean_redis', 'clean_redis', 'postclean_redis' ]
5 info lifecycle TokenPool@1.4.0~preclean_redis: TokenPool@1.4.0
6 silly lifecycle TokenPool@1.4.0~preclean_redis: no script for preclean_redis, continuing
7 info lifecycle TokenPool@1.4.0~clean_redis: TokenPool@1.4.0
8 verbose lifecycle TokenPool@1.4.0~clean_redis: unsafe-perm in lifecycle true
9 verbose lifecycle TokenPool@1.4.0~clean_redis: PATH: /home/andy/.nvm/versions/node/v6.12.2/lib/node_modules/npm/bin/node-gyp-bin:/home/andy/dev/tokenpool/node_modules/.bin:/home/andy/.rvm/gems/ruby-2.2.7/bin:/home/andy/.rvm/gems/ruby-2.2.7@global/bin:/home/andy/.rvm/rubies/ruby-2.2.7/bin:/home/andy/.nvm/versions/node/v6.12.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/andy/.rvm/bin
10 verbose lifecycle TokenPool@1.4.0~clean_redis: CWD: /home/andy/dev/tokenpool
11 silly lifecycle TokenPool@1.4.0~clean_redis: Args: [ '-c', 'node clean-redis.js' ]
12 silly lifecycle TokenPool@1.4.0~clean_redis: Returned: code: 1 signal: null
13 info lifecycle TokenPool@1.4.0~clean_redis: Failed to exec clean_redis script
14 verbose stack Error: TokenPool@1.4.0 clean_redis: `node clean-redis.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/home/andy/.nvm/versions/node/v6.12.2/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/home/andy/.nvm/versions/node/v6.12.2/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:920:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
15 verbose pkgid TokenPool@1.4.0
16 verbose cwd /home/andy/dev/tokenpool
17 error Linux 4.13.0-21-generic
18 error argv "/home/andy/.nvm/versions/node/v6.12.2/bin/node" "/home/andy/.nvm/versions/node/v6.12.2/bin/npm" "run" "clean_redis"
19 error node v6.12.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error TokenPool@1.4.0 clean_redis: `node clean-redis.js`
22 error Exit status 1
23 error Failed at the TokenPool@1.4.0 clean_redis script 'node clean-redis.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the TokenPool package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node clean-redis.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs TokenPool
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls TokenPool
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dev": "webpack-dev-server ",
"server": "node index.js",
"redis": "redis-server",
"clean_redis": "node clean-redis.js",
"payment_log": "node util/payment-log.js",
"fix_balance_transfers": "node util/fix_balance_transfers.js"
},
Expand Down

0 comments on commit 6a5cd78

Please sign in to comment.