Commit 69baa09e authored by Iuri Matias's avatar Iuri Matias

add net methods

parent 0412ea4a
var Net = function() {
}
Net.prototype.methods = function() {
return {
net_version: this.net_version,
net_listening: this.net_listening,
net_peerCount: this.net_peerCount
}
}
Net.prototype.net_version = function(payload, cb) {
// should be configured networkId
cb(null, 1337)
}
Net.prototype.net_listening = function(payload, cb) {
cb(null, true)
}
Net.prototype.net_peerCount = function(payload, cb) {
cb(null, 0)
}
module.exports = Net
...@@ -4,6 +4,7 @@ const merge = require('merge') ...@@ -4,6 +4,7 @@ const merge = require('merge')
const Accounts = require('./methods/accounts.js') const Accounts = require('./methods/accounts.js')
const Blocks = require('./methods/blocks.js') const Blocks = require('./methods/blocks.js')
const Misc = require('./methods/misc.js') const Misc = require('./methods/misc.js')
const Net = require('./methods/net.js')
const Transactions = require('./methods/transactions.js') const Transactions = require('./methods/transactions.js')
const Whisper = require('./methods/whisper.js') const Whisper = require('./methods/whisper.js')
...@@ -14,6 +15,7 @@ var Provider = function () { ...@@ -14,6 +15,7 @@ var Provider = function () {
this.methods = merge(this.methods, this.Accounts.methods()) this.methods = merge(this.methods, this.Accounts.methods())
this.methods = merge(this.methods, (new Blocks()).methods()) this.methods = merge(this.methods, (new Blocks()).methods())
this.methods = merge(this.methods, (new Misc()).methods()) this.methods = merge(this.methods, (new Misc()).methods())
this.methods = merge(this.methods, (new Net()).methods())
this.methods = merge(this.methods, (new Transactions(this.Accounts.accounts)).methods()) this.methods = merge(this.methods, (new Transactions(this.Accounts.accounts)).methods())
this.methods = merge(this.methods, (new Whisper()).methods()) this.methods = merge(this.methods, (new Whisper()).methods())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment