Get Node Addresses
Requirements
- IDE or text editor
- Have one owner or Storage Replicator Node node
Example
The simple example of getting adresses of some node.
import (
"context"
apihttp "github.com/proximax-storage/go-xpx-dfms-api-http"
)
func main() {
// Create a new client API by given address
client := apihttp.NewClientAPI("127.0.0.1:63666")
//Get addresses
addrs, err := client.Network().Addrs(context.Background())
if err != nil {
panic(err)
}
//Print addresses
for _, addr := range addrs {
println(addr.String())
}
}