aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreth.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/coreth.go b/coreth.go
index c4cbf09..0dbb226 100644
--- a/coreth.go
+++ b/coreth.go
@@ -15,6 +15,7 @@ import (
"github.com/ava-labs/go-ethereum/crypto"
"github.com/ava-labs/go-ethereum/event"
"github.com/ava-labs/go-ethereum/log"
+ "github.com/ava-labs/go-ethereum/rpc"
"github.com/mattn/go-isatty"
)
@@ -134,6 +135,22 @@ func (self *ETHChain) InsertChain(chain []*types.Block) (int, error) {
return self.backend.BlockChain().InsertChain(chain)
}
+func (self *ETHChain) NewRPCHandler() *rpc.Server {
+ return rpc.NewServer()
+}
+
+func (self *ETHChain) AttachEthService(handler *rpc.Server, namespaces []string) {
+ nsmap := make(map[string]bool)
+ for _, ns := range namespaces {
+ nsmap[ns] = true
+ }
+ for _, api := range self.backend.APIs() {
+ if nsmap[api.Namespace] {
+ handler.RegisterName(api.Namespace, api.Service)
+ }
+ }
+}
+
type Key struct {
Address common.Address
PrivateKey *ecdsa.PrivateKey