mirror of
https://github.com/arnaucube/blockchainIDsystem.git
synced 2026-02-07 02:56:43 +01:00
17 lines
289 B
Go
17 lines
289 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io/ioutil"
|
|
"net/http"
|
|
)
|
|
|
|
func getPeers() {
|
|
res, err := http.Get("http://" + config.IP + ":" + config.ServerRESTPort + "/peers")
|
|
check(err)
|
|
body, err := ioutil.ReadAll(res.Body)
|
|
check(err)
|
|
err = json.Unmarshal(body, &peersList)
|
|
check(err)
|
|
}
|