Developing lightweight computation at the DSG edge

Commit 40511d81 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[fetch] Save last CNML data structure to AntidoteDB



This allows the assign application to know whether there is something
new to fetch or not.
Signed-off-by: default avatarRoger Pueyo Centelles <roger.pueyo@guifi.net>
parent cbee281f
......@@ -171,30 +171,12 @@ func main() {
}
}
//daChecksumFile.WriteString(fmt.Sprintf("%x\n", sha256.Sum256([]byte(fmt.Sprintf("%+v", devsadds)))))
dasChecksumFile.WriteString(fmt.Sprintf("%x\n", sha256.Sum256([]byte(fmt.Sprintf("%+v", devsIpv4sGraphs)))))
fmt.Println(len(devsIpv4sGraphs), "devices exported to", dasfile.Name())
// Test some well-known nodes and devices
// node_id := []int{53475, 53537}
// for _, u := range node_id {
// for _, v := range allnodes {
// if v.ID == u {
// fmt.Println(getNodeZonesPath(v, GuifiCnml.Network.Zone))
// fmt.Println(getGraphServerOfNodeInZone(v, GuifiCnml.Network.Zone))
// }
// }
// }
//
// dev_id := []int{58266, 62313}
// for _, u := range dev_id {
// for _, v := range alldevices {
// if v.ID == u {
// fmt.Println(getGraphServerOfDeviceInZone(v, GuifiCnml.Network.Zone))
// }
// }
// }
// Generate the SHA256 checksum of the cnmlDevsIpv4sGraphs data structure printout
cnmlDevsIpv4sGraphsChecksum := fmt.Sprintf("%x\n", sha256.Sum256([]byte(fmt.Sprintf("%+v", cnmlDevsIpv4sGraphs))))
dasChecksumFile.WriteString(cnmlDevsIpv4sGraphsChecksum)
fmt.Println(len(cnmlDevsIpv4sGraphs), "devices exported to", dasfile.Name())
// Read current AntidoteDB devices
antidoteDevices := apidote.ReadDevicesFromAntidote()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment