我是先河系统CTO杨尉,欢迎大加关注的的Github: waynewyang,本文是filecoin技术架构分析系列文章第十二章源码分析之内部接口层plumbing&porcelain接口。
我是先河系统CTO杨尉,欢迎大加关注的的Github: waynewyang,本文是filecoin技术架构分析系列文章第十二章源码分析之内部接口层plumbing&porcelain接口。
目前官方正在将api包解耦,往plumbing、porcelain中迁移
porcelain主要依赖于plumbing接口
上一章所述的api包将会被废除
说明
提供的具体功能接口
具体的方法如下
▼ package
plumbing
▶ imports
▼+API : struct
[fields]
-chain : chain.ReadStore
-config : *cfg.Config
-logger : logging.EventLogger
-msgPool : *core.MessagePool
-msgPreviewer : *msg.Previewer
-msgQueryer : *msg.Queryer
-msgSender : *msg.Sender
-msgWaiter : *msg.Waiter
-network : *ntwk.Network
-sigGetter : *mthdsig.Getter
-wallet : *wallet.Wallet
[methods]
+ActorGet(ctx context.Context, addr address.Address) : *actor.Actor, error
+ActorGetSignature(ctx context.Context, actorAddr address.Address, method string) : *exec.FunctionSignature, error
+BlockGet(ctx context.Context, id cid.Cid) : *types.Block, error
+ChainHead(ctx context.Context) : types.TipSet
+ChainLs(ctx context.Context) : chan interface{}
+ConfigGet(dottedPath string) : interface{}, error
+ConfigSet(dottedPath string, paramJSON string) : error
+MessagePoolGet(cid cid.Cid) : *types.SignedMessage, bool
+MessagePoolPending() : []*types.SignedMessage
+MessagePoolRemove(cid cid.Cid)
+MessagePreview(ctx context.Context, from, to address.Address, method string, params ...interface{}) : types.GasUnits, error
+MessageQuery(ctx context.Context, optFrom, to address.Address, method string, params ...interface{}) : [][]byte, *exec.FunctionSignature, error
+MessageSend(ctx context.Context, from, to address.Address, value *types.AttoFIL, gasPrice types.AttoFIL, gasLimit types.GasUnits, method string, params ...interface{}) : cid.Cid, error
+MessageWait(ctx context.Context, msgCid cid.Cid, cb func(*types.Block, *types.SignedMessage, *types.MessageReceipt) error) : error
+NetworkFindProvidersAsync(ctx context.Context, key cid.Cid, count int) : chan pstore.PeerInfo
+NetworkGetPeerID() : peer.ID
+PubSubPublish(topic string, data []byte) : error
+PubSubSubscribe(topic string) : pubsub.Subscription, error
+SignBytes(data []byte, addr address.Address) : types.Signature, error
+WalletAddresses() : []address.Address
+WalletFind(address address.Address) : wallet.Backend, error
+WalletNewAddress() : address.Address, error
[functions]
+New(deps *APIDeps) : *API
说明
提供功能
▼ package
porcelain
▶ imports
▼+API : struct
[embedded]
+*plumbing.API : *plumbing.API
[methods]
+ChainBlockHeight(ctx context.Context) : *types.BlockHeight, error
+CreatePayments(ctx context.Context, config CreatePaymentsParams) : *CreatePaymentsReturn, error
+GetAndMaybeSetDefaultSenderAddress() : address.Address, error
+MessagePoolWait(ctx context.Context, messageCount uint) : []*types.SignedMessage, error
+MessageSendWithDefaultAddress(ctx context.Context, from, to address.Address, value *types.AttoFIL, gasPrice types.AttoFIL, gasLimit types.GasUnits, method string, params ...interface{}) : cid.Cid, error
+MinerGetAsk(ctx context.Context, minerAddr address.Address, askID uint64) : minerActor.Ask, error
+MinerGetOwnerAddress(ctx context.Context, minerAddr address.Address) : address.Address, error
+MinerGetPeerID(ctx context.Context, minerAddr address.Address) : peer.ID, error
+MinerPreviewCreate(ctx context.Context, fromAddr address.Address, pledge uint64, pid peer.ID, collateral *types.AttoFIL) : types.GasUnits, error
+MinerPreviewSetPrice(ctx context.Context, from address.Address, miner address.Address, price *types.AttoFIL, expiry *big.Int) : types.GasUnits, error
+MinerSetPrice(ctx context.Context, from address.Address, miner address.Address, gasPrice types.AttoFIL, gasLimit types.GasUnits, price *types.AttoFIL, expiry *big.Int) : MinerSetPriceResponse, error
+PaymentChannelLs(ctx context.Context, fromAddr address.Address, payerAddr address.Address) : map[string]*paymentbroker.PaymentChannel, error
+PaymentChannelVoucher(ctx context.Context, fromAddr address.Address, channel *types.ChannelID, amount *types.AttoFIL, validAt *types.BlockHeight) : *paymentbroker.PaymentVoucher, error
+WalletBalance(ctx context.Context, address address.Address) : *types.AttoFIL, error
[functions]
+New(plumbing *plumbing.API) : *API
深入浅出区块链 - 系统学习区块链,打造最好的区块链技术博客
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!