2019-06-25 11:42:17 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
2019-07-08 11:02:02 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/lib"
|
2019-06-25 11:42:17 +00:00
|
|
|
"net/http"
|
|
|
|
|
2019-06-29 09:19:06 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/api"
|
2019-06-25 11:42:17 +00:00
|
|
|
)
|
|
|
|
|
2019-06-29 09:19:06 +00:00
|
|
|
func serveRPC(api api.API) error {
|
2019-07-08 11:02:02 +00:00
|
|
|
rpcServer := lib.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)
|
|
|
|
}
|