go-eth-proxy

Transparent proxy server for eth-cache
Info | Log | Files | Refs

geth.go (349B)


      1 package geth
      2 
      3 import (
      4 	"net/http"
      5 
      6 	gethrpc "github.com/ethereum/go-ethereum/rpc"
      7 
      8 	"defalsify.org/go-eth-proxy/store"
      9 )
     10 
     11 func NewGethBackend(db store.Store) (http.Handler, error) {
     12 	var err error
     13 
     14 	svc := NewProxyService(db)
     15 	srv := gethrpc.NewServer()
     16 	err = srv.RegisterName("eth", svc)
     17 	if err != nil {
     18 		return nil, err
     19 	}
     20 	return srv, nil
     21 
     22 }