add some shortcut functions keyname_to_*port(keyname)
This commit is contained in:
parent
d57d7fffdb
commit
de930b47da
13
coretool.js
13
coretool.js
@ -126,6 +126,19 @@ module.exports = {
|
||||
return parseInt(port)
|
||||
},
|
||||
|
||||
keyname_to_apiport (keyname) {
|
||||
return this.BASEPORT_API_SERVER + parseInt(this.alpha_to_digit(keyname))
|
||||
},
|
||||
keyname_to_chainport (keyname) {
|
||||
return this.BASEPORT_CHAIN_SERVER + parseInt(this.alpha_to_digit(keyname))
|
||||
},
|
||||
keyname_to_netport (keyname) {
|
||||
return this.BASEPORT_NET_NODE + parseInt(this.alpha_to_digit(keyname))
|
||||
},
|
||||
keyname_to_webport (keyname) {
|
||||
return this.BASEPORT_WEB_SERVER + parseInt(this.alpha_to_digit(keyname))
|
||||
},
|
||||
|
||||
randomize_number ({ length, min, max } = {}) {
|
||||
// 长度为 length 的随机数字,或者 (min||0) <= num < max
|
||||
var num = 0
|
||||
|
Loading…
Reference in New Issue
Block a user