aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/swarm.go
diff options
context:
space:
mode:
authorZahoor Mohamed <zahoor@zahoor.in>2017-03-23 21:56:06 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-03-23 21:56:06 +0800
commit11e7a712f469fb24ddb88ecebcefab6ed8880eb8 (patch)
treec052776c80475767eb7a038bef99ff784b071ef7 /swarm/swarm.go
parent61d2150a0750a554250c3bf090ef994be6c060f0 (diff)
downloaddexon-11e7a712f469fb24ddb88ecebcefab6ed8880eb8.tar.gz
dexon-11e7a712f469fb24ddb88ecebcefab6ed8880eb8.tar.zst
dexon-11e7a712f469fb24ddb88ecebcefab6ed8880eb8.zip
swarm/api: support mounting manifests via FUSE (#3690)
Diffstat (limited to 'swarm/swarm.go')
-rw-r--r--swarm/swarm.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/swarm/swarm.go b/swarm/swarm.go
index bd256edaa..0ce31bcad 100644
--- a/swarm/swarm.go
+++ b/swarm/swarm.go
@@ -53,7 +53,8 @@ type Swarm struct {
privateKey *ecdsa.PrivateKey
corsString string
swapEnabled bool
- lstore *storage.LocalStore // local store, needs to store for releasing resources after node stopped
+ 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
}
type SwarmAPI struct {
@@ -142,6 +143,9 @@ 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)
+ log.Debug("-> Initializing Fuse file system")
+
return self, nil
}
@@ -216,7 +220,7 @@ func (self *Swarm) Stop() error {
if self.lstore != nil {
self.lstore.DbStore.Close()
}
-
+ self.sfs.Stop()
return self.config.Save()
}
@@ -240,6 +244,7 @@ func (self *Swarm) APIs() []rpc.API {
Service: api.NewStorage(self.api),
Public: true,
},
+
{
Namespace: "bzz",
Version: "0.1",
@@ -264,6 +269,12 @@ func (self *Swarm) APIs() []rpc.API {
Service: chequebook.NewApi(self.config.Swap.Chequebook),
Public: false,
},
+ {
+ Namespace: "swarmfs",
+ Version: api.Swarmfs_Version,
+ Service: self.sfs,
+ Public: false,
+ },
// {Namespace, Version, api.NewAdmin(self), false},
}
}