Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cm/puppeth: fix the issue of ethstats maybe doesn't contains : #25405

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/puppeth/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,12 @@ func checkPort(host string, port int) error {
conn.Close()
return nil
}

// getEthName gets the Ethereum Name from ethstats
func getEthName(s string) string {
n := strings.Index(s, ":")
if n >= 0 {
return s[:n]
}
return s
}
2 changes: 1 addition & 1 deletion cmd/puppeth/module_explorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func deployExplorer(client *sshClient, network string, bootnodes []string, confi
"Datadir": config.node.datadir,
"DBDir": config.dbdir,
"EthPort": config.node.port,
"EthName": config.node.ethstats[:strings.Index(config.node.ethstats, ":")],
"EthName": getEthName(config.node.ethstats),
"WebPort": config.port,
"Transformer": transformer,
})
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/module_faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func deployFaucet(client *sshClient, network string, bootnodes []string, config
"VHost": config.host,
"ApiPort": config.port,
"EthPort": config.node.port,
"EthName": config.node.ethstats[:strings.Index(config.node.ethstats, ":")],
"EthName": getEthName(config.node.ethstats),
"CaptchaToken": config.captchaToken,
"CaptchaSecret": config.captchaSecret,
"FaucetAmount": config.amount,
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/module_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func deployNode(client *sshClient, network string, bootnodes []string, config *n
"TotalPeers": config.peersTotal,
"Light": config.peersLight > 0,
"LightPeers": config.peersLight,
"Ethstats": config.ethstats[:strings.Index(config.ethstats, ":")],
"Ethstats": getEthName(config.ethstats),
"Etherbase": config.etherbase,
"GasTarget": config.gasTarget,
"GasLimit": config.gasLimit,
Expand Down