aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/swarm.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/swarm.go')
-rw-r--r--swarm/swarm.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/swarm/swarm.go b/swarm/swarm.go
index 5a7f43f8b..442e68d51 100644
--- a/swarm/swarm.go
+++ b/swarm/swarm.go
@@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/contracts/chequebook"
"github.com/ethereum/go-ethereum/contracts/ens"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
@@ -34,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/swarm/api"
httpapi "github.com/ethereum/go-ethereum/swarm/api/http"
+ "github.com/ethereum/go-ethereum/swarm/fuse"
"github.com/ethereum/go-ethereum/swarm/network"
"github.com/ethereum/go-ethereum/swarm/storage"
)
@@ -54,7 +56,7 @@ type Swarm struct {
corsString string
swapEnabled bool
lstore *storage.LocalStore // local store, needs to store for releasing resources after node stopped
- sfs *api.SwarmFS // need this to cleanup all the active mounts on node exit
+ sfs *fuse.SwarmFS // need this to cleanup all the active mounts on node exit
}
type SwarmAPI struct {
@@ -133,9 +135,13 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
// set up high level api
transactOpts := bind.NewKeyedTransactor(self.privateKey)
- self.dns, err = ens.NewENS(transactOpts, config.EnsRoot, self.backend)
- if err != nil {
- return nil, err
+ if backend == (*ethclient.Client)(nil) {
+ log.Warn("No ENS, please specify non-empty --ethapi to use domain name resolution")
+ } else {
+ self.dns, err = ens.NewENS(transactOpts, config.EnsRoot, self.backend)
+ if err != nil {
+ return nil, err
+ }
}
log.Debug(fmt.Sprintf("-> Swarm Domain Name Registrar @ address %v", config.EnsRoot.Hex()))
@@ -143,7 +149,7 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
// Manifests for Smart Hosting
log.Debug(fmt.Sprintf("-> Web3 virtual server API"))
- self.sfs = api.NewSwarmFS(self.api)
+ self.sfs = fuse.NewSwarmFS(self.api)
log.Debug("-> Initializing Fuse file system")
return self, nil
@@ -262,7 +268,7 @@ func (self *Swarm) APIs() []rpc.API {
},
{
Namespace: "swarmfs",
- Version: api.Swarmfs_Version,
+ Version: fuse.Swarmfs_Version,
Service: self.sfs,
Public: false,
},