lotus/api/client/client.go

16 lines
370 B
Go
Raw Normal View History

package client
import (
2019-07-23 18:49:09 +00:00
"net/http"
"github.com/filecoin-project/go-lotus/api"
2019-07-08 12:46:30 +00:00
"github.com/filecoin-project/go-lotus/lib/jsonrpc"
)
2019-07-02 17:45:03 +00:00
// NewRPC creates a new http jsonrpc client.
2019-07-23 18:49:09 +00:00
func NewRPC(addr string, requestHeader http.Header) (api.API, error) {
var res api.Struct
2019-07-23 18:49:09 +00:00
_, err := jsonrpc.NewClient(addr, "Filecoin", &res.Internal, requestHeader)
2019-07-12 15:29:41 +00:00
return &res, err
}