Client import

This commit is contained in:
Łukasz Magiera
2019-07-15 16:17:34 +02:00
parent 9102b03e50
commit 97c61d4ce5
11 changed files with 447 additions and 10 deletions
+11 -1
View File
@@ -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)
+7
View File
@@ -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)
}