MCPcopy Create free account
hub / github.com/DOSNetwork/core / getBootIps

Function getBootIps

dosnode/dosnode.go:215–232  ·  view source on GitHub ↗
(bootStrapUrl string)

Source from the content-addressed store, hash-verified

213}
214
215func getBootIps(bootStrapUrl string) []string {
216 req, err := http.NewRequest("GET", bootStrapUrl, nil)
217 client := &http.Client{}
218 resp, err := client.Do(req)
219 if err != nil {
220 return nil
221 }
222 defer resp.Body.Close()
223 r, err := ioutil.ReadAll(resp.Body)
224
225 str := string(r)
226 strlist := strings.Split(str, ",")
227 nodeIPs := make([]string, len(strlist)-1)
228 for i := 0; i < len(strlist)-1; i++ {
229 nodeIPs[i] = strlist[i]
230 }
231 return nodeIPs
232}
233
234func unique(intSlice []string) []string {
235 keys := make(map[string]bool)

Callers 1

StartMethod · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected