enhancing the client to accept multipl rpc server addresses

This commit is contained in:
2024-12-08 16:06:18 +09:00
parent 3d19576905
commit 7479cc0f3a
3 changed files with 31 additions and 36 deletions

View File

@ -214,10 +214,6 @@ func client_main(ctl_addrs []string, rpc_addrs []string, peer_addrs []string, cf
if len(rpc_addrs) <= 0 {
return fmt.Errorf("no rpc server address specified")
} else if len(rpc_addrs) > 1 {
// TODO: instead of returning an error here,
// support multiple endpoint addresses. round-robin or something to a working server?
return fmt.Errorf("too many rpc server addresses specified")
}
c = hodu.NewClient(
@ -228,7 +224,7 @@ func client_main(ctl_addrs []string, rpc_addrs []string, peer_addrs []string, cf
ctltlscfg,
rpctlscfg)
cc.ServerAddr = rpc_addrs[0]
cc.ServerAddrs = rpc_addrs
cc.PeerAddrs = peer_addrs
c.StartService(&cc)