diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index b55941b48..6f90e24a0 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -18,12 +18,13 @@ import ( ) const ( - initOptionKwd = "init" - gcrKwd = "gcr" - mountKwd = "mount" - writableKwd = "writable" - ipfsMountKwd = "mount-ipfs" - ipnsMountKwd = "mount-ipns" + initOptionKwd = "init" + routingOptionKwd = "routing" + routingOptionSupernodeKwd = "supernode" + mountKwd = "mount" + writableKwd = "writable" + ipfsMountKwd = "mount-ipfs" + ipnsMountKwd = "mount-ipns" // apiAddrKwd = "address-api" // swarmAddrKwd = "address-swarm" ) @@ -42,7 +43,7 @@ the daemon. Options: []cmds.Option{ cmds.BoolOption(initOptionKwd, "Initialize IPFS with default settings if not already initialized"), - cmds.BoolOption(gcrKwd, "Enables Grandcentral Routing"), + cmds.StringOption(routingOptionKwd, "Overrides the routing option (dht, supernode)"), cmds.BoolOption(mountKwd, "Mounts IPFS to the filesystem"), cmds.BoolOption(writableKwd, "Enable writing objects (with POST, PUT and DELETE)"), cmds.StringOption(ipfsMountKwd, "Path to the mountpoint for IPFS (if using --mount)"), @@ -107,12 +108,12 @@ func daemonFunc(req cmds.Request, res cmds.Response) { nb := core.NewNodeBuilder().Online() nb.SetRepo(repo) - useGCR, _, err := req.Option(gcrKwd).Bool() + routingOption, _, err := req.Option(routingOptionKwd).String() if err != nil { res.SetError(err, cmds.ErrNormal) return } - if useGCR { + if routingOption == routingOptionSupernodeKwd { servers, err := repo.Config().GCR.ServerIPFSAddrs() if err != nil { res.SetError(err, cmds.ErrNormal)