mirror of
https://github.com/arnaucube/blockchainIDsystem.git
synced 2026-02-07 02:56:43 +01:00
peers propagation working fine, started to implement serverCA
This commit is contained in:
16
serverCA/peersPetitions.go
Normal file
16
serverCA/peersPetitions.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user