aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/swarm.go
diff options
context:
space:
mode:
authorLewis Marshall <lewis@lmars.net>2017-04-07 06:22:22 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-07 06:22:22 +0800
commit71fdaa42386173da7bfa13f1728c394aeeb4eb01 (patch)
tree364a169f650982d3b2880c95e40e2c91cb27c86e /swarm/swarm.go
parent9aca9e6deb243b87cc75325be593a3b0c2f0a113 (diff)
downloaddexon-71fdaa42386173da7bfa13f1728c394aeeb4eb01.tar.gz
dexon-71fdaa42386173da7bfa13f1728c394aeeb4eb01.tar.zst
dexon-71fdaa42386173da7bfa13f1728c394aeeb4eb01.zip
swarm/api: refactor and improve HTTP API (#3773)
This PR deprecates the file related RPC calls in favour of an improved HTTP API. The main aim is to expose a simple to use API which can be consumed by thin clients (e.g. curl and HTML forms) without the need for complex logic (e.g. manipulating prefix trie manifests).
Diffstat (limited to 'swarm/swarm.go')
-rw-r--r--swarm/swarm.go30
1 files changed, 16 insertions, 14 deletions
diff --git a/swarm/swarm.go b/swarm/swarm.go
index add28d205..5a7f43f8b 100644
--- a/swarm/swarm.go
+++ b/swarm/swarm.go
@@ -53,8 +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
- sfs *api.SwarmFS // need this to cleanup all the active mounts on node exit
+ 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 {
@@ -244,13 +244,6 @@ func (self *Swarm) APIs() []rpc.API {
{
Namespace: "bzz",
Version: "0.1",
- Service: api.NewStorage(self.api),
- Public: true,
- },
-
- {
- Namespace: "bzz",
- Version: "0.1",
Service: &Info{self.config, chequebook.ContractParams},
Public: true,
},
@@ -258,11 +251,6 @@ func (self *Swarm) APIs() []rpc.API {
{
Namespace: "bzz",
Version: "0.1",
- Service: api.NewFileSystem(self.api),
- Public: false},
- {
- Namespace: "bzz",
- Version: "0.1",
Service: api.NewControl(self.api, self.hive),
Public: false,
},
@@ -278,6 +266,20 @@ func (self *Swarm) APIs() []rpc.API {
Service: self.sfs,
Public: false,
},
+ // storage APIs
+ // DEPRECATED: Use the HTTP API instead
+ {
+ Namespace: "bzz",
+ Version: "0.1",
+ Service: api.NewStorage(self.api),
+ Public: true,
+ },
+ {
+ Namespace: "bzz",
+ Version: "0.1",
+ Service: api.NewFileSystem(self.api),
+ Public: false,
+ },
// {Namespace, Version, api.NewAdmin(self), false},
}
}