add websocket config to blockchain config
This commit is contained in:
parent
471fb1a061
commit
9fd39f36ba
|
@ -28,6 +28,7 @@ var Blockchain = function(options) {
|
|||
maxpeers: ((this.blockchainConfig.maxpeers === 0) ? 0 : (this.blockchainConfig.maxpeers || 25)),
|
||||
bootnodes: this.blockchainConfig.bootnodes || "",
|
||||
rpcApi: (this.blockchainConfig.rpcApi || ['eth', 'web3', 'net']),
|
||||
wsRPC: (this.blockchainConfig.wsRPC === undefined) || this.blockchainConfig.wsRPC,
|
||||
wsHost: this.blockchainConfig.wsHost || 'localhost',
|
||||
wsPort: this.blockchainConfig.wsPort || 8546,
|
||||
wsOrigins: this.blockchainConfig.wsOrigins || false,
|
||||
|
|
|
@ -96,6 +96,7 @@ class GethCommands {
|
|||
determineWsOptions(config) {
|
||||
let cmd = "";
|
||||
|
||||
if (config.wsRPC) {
|
||||
cmd += "--ws ";
|
||||
cmd += "--wsport " + config.wsPort + " ";
|
||||
cmd += "--wsaddr " + config.wsHost + " ";
|
||||
|
@ -112,6 +113,7 @@ class GethCommands {
|
|||
console.log('warning: cors is not set');
|
||||
console.log('==================================');
|
||||
}
|
||||
}
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,11 @@
|
|||
"account": {
|
||||
"password": "config/development/password"
|
||||
},
|
||||
"wsOrigins": "http://localhost:8000"
|
||||
"wsOrigins": "http://localhost:8000",
|
||||
"wsRPC": true,
|
||||
"wsHost": "localhost",
|
||||
"wsPort": 8546
|
||||
|
||||
},
|
||||
"testnet": {
|
||||
"networkType": "testnet",
|
||||
|
|
Loading…
Reference in New Issue