lotus/daemon/rpc.go
2019-07-03 19:39:07 +02:00

16 lines
335 B
Go

package daemon
import (
"net/http"
"github.com/filecoin-project/go-lotus/api"
"github.com/filecoin-project/go-lotus/jsonrpc"
)
func serveRPC(api api.API) error {
rpcServer := jsonrpc.NewServer()
rpcServer.Register("Filecoin", api)
http.Handle("/rpc/v0", rpcServer)
return http.ListenAndServe(":1234", http.DefaultServeMux)
}