aboutsummaryrefslogtreecommitdiffstats
path: root/dex/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'dex/backend.go')
-rw-r--r--dex/backend.go39
1 files changed, 38 insertions, 1 deletions
diff --git a/dex/backend.go b/dex/backend.go
index 81ac272a0..ecc8ace2d 100644
--- a/dex/backend.go
+++ b/dex/backend.go
@@ -35,6 +35,7 @@ import (
"github.com/dexon-foundation/dexon/core/vm"
"github.com/dexon-foundation/dexon/dex/gasprice"
"github.com/dexon-foundation/dexon/eth/downloader"
+ "github.com/dexon-foundation/dexon/eth/filters"
"github.com/dexon-foundation/dexon/ethdb"
"github.com/dexon-foundation/dexon/event"
"github.com/dexon-foundation/dexon/internal/ethapi"
@@ -177,7 +178,43 @@ func (s *Dexon) Protocols() []p2p.Protocol {
}
func (s *Dexon) APIs() []rpc.API {
- return nil
+ apis := ethapi.GetAPIs(s.APIBackend)
+
+ // Append any APIs exposed explicitly by the consensus engine
+ apis = append(apis, s.engine.APIs(s.BlockChain())...)
+
+ // Append all the local APIs and return
+ return append(apis, []rpc.API{
+ {
+ Namespace: "eth",
+ Version: "1.0",
+ Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux),
+ Public: true,
+ }, {
+ Namespace: "eth",
+ Version: "1.0",
+ Service: filters.NewPublicFilterAPI(s.APIBackend, false),
+ Public: true,
+ }, {
+ Namespace: "admin",
+ Version: "1.0",
+ Service: NewPrivateAdminAPI(s),
+ }, {
+ Namespace: "debug",
+ Version: "1.0",
+ Service: NewPublicDebugAPI(s),
+ Public: true,
+ }, {
+ Namespace: "debug",
+ Version: "1.0",
+ Service: NewPrivateDebugAPI(s.chainConfig, s),
+ }, {
+ Namespace: "net",
+ Version: "1.0",
+ Service: s.netRPCService,
+ Public: true,
+ },
+ }...)
}
func (s *Dexon) Start(srvr *p2p.Server) error {