mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
cmd/swarm: include localhost flag
This commit is contained in:
parent
52148f6a93
commit
4e882674e0
2 changed files with 16 additions and 6 deletions
|
|
@ -27,12 +27,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
endpoints []string
|
endpoints []string
|
||||||
cluster string
|
includeLocalhost bool
|
||||||
scheme string
|
cluster string
|
||||||
filesize int
|
scheme string
|
||||||
from int
|
filesize int
|
||||||
to int
|
from int
|
||||||
|
to int
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
@ -68,6 +69,11 @@ func main() {
|
||||||
Usage: "http or https",
|
Usage: "http or https",
|
||||||
Destination: &scheme,
|
Destination: &scheme,
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "include-localhost",
|
||||||
|
Usage: "whether to include localhost:8500 as an endpoint",
|
||||||
|
Destination: &includeLocalhost,
|
||||||
|
},
|
||||||
cli.IntFlag{
|
cli.IntFlag{
|
||||||
Name: "filesize",
|
Name: "filesize",
|
||||||
Value: 1,
|
Value: 1,
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@ func generateEndpoints(scheme string, cluster string, from int, to int) {
|
||||||
for port := from; port <= to; port++ {
|
for port := from; port <= to; port++ {
|
||||||
endpoints = append(endpoints, fmt.Sprintf("%s://%v.%s.swarm-gateways.net", scheme, port, cluster))
|
endpoints = append(endpoints, fmt.Sprintf("%s://%v.%s.swarm-gateways.net", scheme, port, cluster))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if includeLocalhost {
|
||||||
|
endpoints = append(endpoints, "http://localhost:8500")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func cliUploadAndSync(c *cli.Context) error {
|
func cliUploadAndSync(c *cli.Context) error {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue