mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 04:41:22 +00:00
added Moniker as config, available in RPC.
This commit is contained in:
@ -35,6 +35,7 @@ func SetApp(a *confer.Config) {
|
|||||||
var defaultConfig = `# This is a TOML config file.
|
var defaultConfig = `# This is a TOML config file.
|
||||||
# For more information, see https://github.com/toml-lang/toml
|
# For more information, see https://github.com/toml-lang/toml
|
||||||
|
|
||||||
|
Moniker = "anonymous"
|
||||||
Network = "tendermint_testnet0"
|
Network = "tendermint_testnet0"
|
||||||
ListenAddr = "0.0.0.0:8080"
|
ListenAddr = "0.0.0.0:8080"
|
||||||
# First node to connect to. Command-line overridable.
|
# First node to connect to. Command-line overridable.
|
||||||
@ -86,6 +87,7 @@ var DefaultGenesis = `{
|
|||||||
|
|
||||||
// NOTE: If you change this, maybe also change defaultConfig
|
// NOTE: If you change this, maybe also change defaultConfig
|
||||||
func initDefaults(rootDir string) {
|
func initDefaults(rootDir string) {
|
||||||
|
app.SetDefault("Moniker", "anonymous")
|
||||||
app.SetDefault("Network", "tendermint_testnet0")
|
app.SetDefault("Network", "tendermint_testnet0")
|
||||||
app.SetDefault("ListenAddr", "0.0.0.0:8080")
|
app.SetDefault("ListenAddr", "0.0.0.0:8080")
|
||||||
app.SetDefault("DB.Backend", "leveldb")
|
app.SetDefault("DB.Backend", "leveldb")
|
||||||
|
@ -33,6 +33,7 @@ func Status() (*ctypes.ResponseStatus, error) {
|
|||||||
|
|
||||||
func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
||||||
listening := p2pSwitch.IsListening()
|
listening := p2pSwitch.IsListening()
|
||||||
|
moniker := config.App().GetString("Moniker")
|
||||||
network := config.App().GetString("Network")
|
network := config.App().GetString("Network")
|
||||||
listeners := []string{}
|
listeners := []string{}
|
||||||
for _, listener := range p2pSwitch.Listeners() {
|
for _, listener := range p2pSwitch.Listeners() {
|
||||||
@ -46,6 +47,7 @@ func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return &ctypes.ResponseNetInfo{
|
return &ctypes.ResponseNetInfo{
|
||||||
|
Moniker: moniker,
|
||||||
Network: network,
|
Network: network,
|
||||||
Listening: listening,
|
Listening: listening,
|
||||||
Listeners: listeners,
|
Listeners: listeners,
|
||||||
|
@ -70,6 +70,7 @@ type ResponseStatus struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ResponseNetInfo struct {
|
type ResponseNetInfo struct {
|
||||||
|
Moniker string
|
||||||
Network string
|
Network string
|
||||||
Listening bool
|
Listening bool
|
||||||
Listeners []string
|
Listeners []string
|
||||||
|
Reference in New Issue
Block a user