2019-06-25 11:42:17 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2019-06-29 09:19:06 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/api"
|
2019-06-28 09:03:28 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/rpclib"
|
2019-06-25 11:42:17 +00:00
|
|
|
)
|
|
|
|
|
2019-06-29 09:19:06 +00:00
|
|
|
func serveRPC(api api.API) error {
|
2019-06-28 09:03:28 +00:00
|
|
|
rpcServer := rpclib.NewServer()
|
2019-06-29 09:19:06 +00:00
|
|
|
rpcServer.Register("Filecoin", api)
|
2019-06-25 11:42:17 +00:00
|
|
|
http.Handle("/rpc/v0", rpcServer)
|
|
|
|
return http.ListenAndServe(":1234", http.DefaultServeMux)
|
|
|
|
}
|