diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 6f90e24a0..e7a7a1e78 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -114,7 +114,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) { return } if routingOption == routingOptionSupernodeKwd { - servers, err := repo.Config().GCR.ServerIPFSAddrs() + servers, err := repo.Config().SupernodeRouting.ServerIPFSAddrs() if err != nil { res.SetError(err, cmds.ErrNormal) repo.Close() // because ownership hasn't been transferred to the node diff --git a/repo/config/config.go b/repo/config/config.go index 54473df10..eec25d8cd 100644 --- a/repo/config/config.go +++ b/repo/config/config.go @@ -16,16 +16,16 @@ var log = u.Logger("config") // Config is used to load IPFS config files. type Config struct { - Identity Identity // local node's peer identity - Datastore Datastore // local node's storage - Addresses Addresses // local node's addresses - Mounts Mounts // local node's mount points - Version Version // local node's version management - Bootstrap []string // local nodes's bootstrap peer addresses - Tour Tour // local node's tour position - Gateway Gateway // local node's gateway server options - GCR GCR // local node's routing servers (if GCR enabled) - Log Log + Identity Identity // local node's peer identity + Datastore Datastore // local node's storage + Addresses Addresses // local node's addresses + Mounts Mounts // local node's mount points + Version Version // local node's version management + Bootstrap []string // local nodes's bootstrap peer addresses + Tour Tour // local node's tour position + Gateway Gateway // local node's gateway server options + SupernodeRouting SupernodeClientConfig // local node's routing servers (if SupernodeRouting enabled) + Log Log } const ( diff --git a/repo/config/init.go b/repo/config/init.go index bbd82c448..34ebcebef 100644 --- a/repo/config/init.go +++ b/repo/config/init.go @@ -26,7 +26,7 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { return nil, err } - gcr, err := initGCR() + snr, err := initSNRConfig() if err != nil { return nil, err } @@ -45,7 +45,7 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { }, Bootstrap: BootstrapPeerStrings(bootstrapPeers), - GCR: *gcr, + SupernodeRouting: *snr, Datastore: *ds, Identity: identity, Log: Log{ diff --git a/repo/config/gcr_servers.go b/repo/config/supernode.go similarity index 75% rename from repo/config/gcr_servers.go rename to repo/config/supernode.go index a6aae090a..a812b7a5e 100644 --- a/repo/config/gcr_servers.go +++ b/repo/config/supernode.go @@ -5,7 +5,7 @@ import "github.com/jbenet/go-ipfs/util/ipfsaddr" // TODO replace with final servers before merge // TODO rename -type GCR struct { +type SupernodeClientConfig struct { Servers []string } @@ -14,14 +14,14 @@ var DefaultGCRServers = []string{ "/ip4/107.170.215.87/tcp/4001/ipfs/QmZDYP9GBjkAmZrS5usSzPnLf41haq6jJhJDmWgnSM4zvW", } -func initGCR() (*GCR, error) { +func initSNRConfig() (*SupernodeClientConfig, error) { // TODO perform validation - return &GCR{ + return &SupernodeClientConfig{ Servers: DefaultGCRServers, }, nil } -func (gcr *GCR) ServerIPFSAddrs() ([]ipfsaddr.IPFSAddr, error) { +func (gcr *SupernodeClientConfig) ServerIPFSAddrs() ([]ipfsaddr.IPFSAddr, error) { var addrs []ipfsaddr.IPFSAddr for _, server := range gcr.Servers { addr, err := ipfsaddr.ParseString(server)