Skip to content

Commit 24c4731

Browse files
committed
add v0 api for gateway
1 parent 631849c commit 24c4731

File tree

8 files changed

+692
-0
lines changed

8 files changed

+692
-0
lines changed

venus-devtool/api-gen/common.go

+11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"reflect"
1010

1111
"github.com/filecoin-project/venus/venus-devtool/util"
12+
gatewayv0 "github.com/filecoin-project/venus/venus-shared/api/gateway/v0"
1213
gatewayv1 "github.com/filecoin-project/venus/venus-shared/api/gateway/v1"
1314
"github.com/filecoin-project/venus/venus-shared/api/market"
1415
market_client "github.com/filecoin-project/venus/venus-shared/api/market/client"
@@ -49,6 +50,16 @@ func init() {
4950
MethodNamespace: "Gateway",
5051
},
5152
},
53+
util.APIMeta{
54+
Type: reflect.TypeOf((*gatewayv0.IGateway)(nil)).Elem(),
55+
ParseOpt: util.InterfaceParseOption{
56+
ImportPath: "github.com/filecoin-project/venus/venus-shared/api/gateway/v0",
57+
IncludeAll: true,
58+
},
59+
RPCMeta: util.RPCMeta{
60+
MethodNamespace: "Gateway",
61+
},
62+
},
5263
util.APIMeta{
5364
Type: reflect.TypeOf((*market.IMarket)(nil)).Elem(),
5465
ParseOpt: util.InterfaceParseOption{

venus-shared/api/gateway/v0/api.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package v0
2+
3+
type IGateway interface {
4+
IProofEvent
5+
IWalletEvent
6+
IMarketEvent
7+
}

venus-shared/api/gateway/v0/client_gen.go

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package v0
2+
3+
import (
4+
"context"
5+
6+
"github.com/filecoin-project/go-address"
7+
"github.com/filecoin-project/go-state-types/abi"
8+
"github.com/filecoin-project/specs-storage/storage"
9+
"github.com/filecoin-project/venus/venus-shared/types"
10+
gtypes "github.com/filecoin-project/venus/venus-shared/types/gateway"
11+
"github.com/ipfs/go-cid"
12+
)
13+
14+
type IMarketEvent interface {
15+
ListMarketConnectionsState(ctx context.Context) ([]gtypes.MarketConnectionState, error) //perm:admin
16+
IsUnsealed(ctx context.Context, miner address.Address, pieceCid cid.Cid, sector storage.SectorRef, offset types.PaddedByteIndex, size abi.PaddedPieceSize) (bool, error) //perm:admin
17+
SectorsUnsealPiece(ctx context.Context, miner address.Address, pieceCid cid.Cid, sector storage.SectorRef, offset types.PaddedByteIndex, size abi.PaddedPieceSize, dest string) error //perm:admin
18+
19+
ResponseMarketEvent(ctx context.Context, resp *gtypes.ResponseEvent) error //perm:read
20+
ListenMarketEvent(ctx context.Context, policy *gtypes.MarketRegisterPolicy) (<-chan *gtypes.RequestEvent, error) //perm:read
21+
}

0 commit comments

Comments
 (0)