lotus/daemon/rpc.go
Łukasz Magiera b1cea1b3ca RPC Client / tests
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-07-01 23:11:33 +02:00

26 lines
468 B
Go

package daemon
import (
"fmt"
"net/http"
"github.com/filecoin-project/go-lotus/build"
"github.com/filecoin-project/go-lotus/rpclib"
)
type Filecoin struct{}
func (*Filecoin) ServerVersion(in int) (string, error) {
fmt.Println(in)
return build.Version, nil
}
func serveRPC() error {
fc := new(Filecoin)
rpcServer := rpclib.NewServer()
rpcServer.Register(fc)
http.Handle("/rpc/v0", rpcServer)
return http.ListenAndServe(":1234", http.DefaultServeMux)
}