feat: lotus-lite - replace wallet StateManager with thin client to gateway

This commit is contained in:
Dirk McCormick
2020-10-09 11:43:03 +02:00
parent bacac245c7
commit e19cd9ed01
10 changed files with 163 additions and 15 deletions
+14
View File
@@ -82,3 +82,17 @@ func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (
return &res, closer, err
}
// NewGatewayRPC creates a new http jsonrpc client for a gateway node.
func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.GatewayAPI, jsonrpc.ClientCloser, error) {
var res apistruct.GatewayStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
[]interface{}{
&res.Internal,
},
requestHeader,
opts...,
)
return &res, closer, err
}