Client import
This commit is contained in:
+11
-1
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/filecoin-project/go-lotus/chain"
|
||||
"github.com/filecoin-project/go-lotus/chain/address"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
)
|
||||
|
||||
@@ -81,7 +82,16 @@ type API interface {
|
||||
|
||||
// Other
|
||||
|
||||
// // ID (on cli - print with other info)
|
||||
// ClientImport imports file under the specified path into filestore
|
||||
ClientImport(ctx context.Context, path string) (cid.Cid, error)
|
||||
|
||||
// ClientUnimport removes references to the specified file from filestore
|
||||
//ClientUnimport(path string)
|
||||
|
||||
// ClientListImports lists imported files and their root CIDs
|
||||
//ClientListImports() []Import
|
||||
|
||||
//ClientListAsks() []Ask
|
||||
|
||||
// ID returns peerID of libp2p node backing this API
|
||||
ID(context.Context) (peer.ID, error)
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/filecoin-project/go-lotus/chain"
|
||||
"github.com/filecoin-project/go-lotus/chain/address"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
)
|
||||
|
||||
@@ -27,12 +28,18 @@ type Struct struct {
|
||||
WalletNew func(context.Context, string) (address.Address, error)
|
||||
WalletList func(context.Context) ([]address.Address, error)
|
||||
|
||||
ClientImport func(ctx context.Context, path string) (cid.Cid, error)
|
||||
|
||||
NetPeers func(context.Context) ([]peer.AddrInfo, error)
|
||||
NetConnect func(context.Context, peer.AddrInfo) error
|
||||
NetAddrsListen func(context.Context) (peer.AddrInfo, error)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Struct) ClientImport(ctx context.Context, path string) (cid.Cid, error) {
|
||||
return c.Internal.ClientImport(ctx, path)
|
||||
}
|
||||
|
||||
func (c *Struct) MpoolPending(ctx context.Context, ts *chain.TipSet) ([]*chain.SignedMessage, error) {
|
||||
return c.Internal.MpoolPending(ctx, ts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user