lotus/daemon/rpc.go

16 lines
327 B
Go
Raw Normal View History

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