nodeapi

package
v0.0.0-...-0d2a5dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2020 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStorageDeal

func GetStorageDeal(ctx context.Context, client Node, dealID abi.DealID, ts *types.TipSet) (*api.MarketDeal, error)

func NewStorageProviderInfo

func NewStorageProviderInfo(address address.Address, miner address.Address, sectorSize abi.SectorSize, peer peer.ID, addrs []abi.Multiaddrs) storagemarket.StorageProviderInfo

func StateMinerInfo

func StateMinerInfo(ctx context.Context, client Node, ts *types.TipSet, maddr address.Address) (api.MinerInfo, error)

Types

type ApiBStore

type ApiBStore struct{}

func (*ApiBStore) ChainHasObj

func (a *ApiBStore) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error)

func (*ApiBStore) ChainReadObj

func (a *ApiBStore) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error)

type Chain

type Chain struct{}

func (*Chain) ChainGetBlockMessages

func (c *Chain) ChainGetBlockMessages(ctx context.Context, blockCid cid.Cid) (*api.BlockMessages, error)

func (*Chain) ChainGetTipSet

func (c *Chain) ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error)

func (*Chain) ChainGetTipSetByHeight

func (c *Chain) ChainGetTipSetByHeight(ctx context.Context, e abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)

func (*Chain) ChainHead

func (c *Chain) ChainHead(ctx context.Context) (*types.TipSet, error)

func (*Chain) ChainNotify

func (c *Chain) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error)

type ChainAPI

type ChainAPI struct {
	ChainHead              func(ctx context.Context) (*types.TipSet, error)
	ChainGetTipSet         func(ctx context.Context, key types.TipSetKey) (*types.TipSet, error)
	ChainNotify            func(context.Context) (<-chan []*api.HeadChange, error)
	ChainGetBlockMessages  func(ctx context.Context, blockCid cid.Cid) (*api.BlockMessages, error)
	ChainGetTipSetByHeight func(ctx context.Context, e abi.ChainEpoch, ts types.TipSetKey) (*types.TipSet, error)
	ChainReadObj           func(context.Context, cid.Cid) ([]byte, error)
	ChainHasObj            func(context.Context, cid.Cid) (bool, error)
}

type ChainStore

type ChainStore struct{}

func (*ChainStore) GetHeaviestTipSet

func (cs *ChainStore) GetHeaviestTipSet() *types.TipSet

func (*ChainStore) GetMessage

func (cs *ChainStore) GetMessage(c cid.Cid) (*types.Message, error)

type ChainStoreAPI

type ChainStoreAPI struct {
	ChainGetMessage func(ctx context.Context, c cid.Cid) (*types.Message, error)
	ChainHead       func(ctx context.Context) *types.TipSet
}

type Mpool

type Mpool struct{}

func (*Mpool) EnsureAvailable

func (a *Mpool) EnsureAvailable(ctx context.Context, addr, wallet address.Address, amt types.BigInt) (cid.Cid, error)

func (*Mpool) MpoolPushMessage

func (a *Mpool) MpoolPushMessage(ctx context.Context, msg *types.Message) (*types.SignedMessage, error)

type MpoolAPI

type MpoolAPI struct {
	MpoolPushMessage      func(ctx context.Context, msg *types.Message) (*types.SignedMessage, error)
	MarketEnsureAvailable func(ctx context.Context, addr, wallet address.Address, amt types.BigInt) (cid.Cid, error)
}

type Node

var NodeClient *Node // TODO(arijit): Clean this up.

func GetNodeAPI

func GetNodeAPI(ctx *cli.Context) (*Node, jsonrpc.ClientCloser, error)

func NewNodeClient

func NewNodeClient(addr string, requestHeader http.Header) (*Node, jsonrpc.ClientCloser, error)

type PaymentManager

type PaymentManager struct{}

func (*PaymentManager) AllocateLane

func (pm *PaymentManager) AllocateLane(ctx context.Context, ch address.Address) (uint64, error)

func (*PaymentManager) GetPaych

func (pm *PaymentManager) GetPaych(ctx context.Context, from, to address.Address, ensureFree types.BigInt) (*api.ChannelInfo, error)

func (*PaymentManager) PaychVoucherCreate

func (pm *PaymentManager) PaychVoucherCreate(ctx context.Context, pch address.Address, amt types.BigInt, lane uint64) (*paych.SignedVoucher, error)

PaychVoucherCreate creates a new signed voucher on the given payment channel with the given lane and amount. The value passed in is exactly the value that will be used to create the voucher, so if previous vouchers exist, the actual additional value of this voucher will only be the difference between the two.

type PaymentManagerAPI

type PaymentManagerAPI struct {
	PaychGet           func(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error)
	PaychAllocateLane  func(ctx context.Context, ch address.Address) (uint64, error)
	PaychVoucherCreate func(ctx context.Context, pch address.Address, amt types.BigInt, lane uint64) (*paych.SignedVoucher, error)
}

type State

type State struct{}

func (*State) StateAccountKey

func (s *State) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func (*State) StateDealProviderCollateralBounds

func (s *State) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)

func (*State) StateGetActor

func (s *State) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)

func (*State) StateGetReceipt

func (s *State) StateGetReceipt(ctx context.Context, cid cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error)

func (*State) StateListMiners

func (s *State) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)

func (*State) StateLookupID

func (s *State) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func (*State) StateMarketBalance

func (s *State) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)

func (*State) StateMarketDeals

func (s *State) StateMarketDeals(ctx context.Context, tsk types.TipSetKey) (map[string]api.MarketDeal, error)

func (*State) StateMarketStorageDeal

func (s *State) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)

func (*State) StateMinerInfo

func (s *State) StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (api.MinerInfo, error)

func (*State) StateMinerProvingDeadline

func (s *State) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*miner.DeadlineInfo, error)

func (*State) StateWaitMsg

func (s *State) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error)

type StateAPI

type StateAPI struct {
	StateMarketBalance                func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
	StateAccountKey                   func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
	WaitForMessage                    func(ctx context.Context) error
	StateWaitMsg                      func(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error)
	StateMarketDeals                  func(ctx context.Context, tsk types.TipSetKey) (map[string]api.MarketDeal, error)
	StateListMiners                   func(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
	StateMinerInfo                    func(ctx context.Context, actor address.Address, tsk types.TipSetKey) (api.MinerInfo, error)
	StateLookupID                     func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
	StateMarketStorageDeal            func(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
	StateMinerProvingDeadline         func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*miner.DeadlineInfo, error)
	StateGetActor                     func(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)
	StateGetReceipt                   func(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
	StateDealProviderCollateralBounds func(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (api.DealCollateralBounds, error)
	StateVerifiedClientStatus         func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*verifreg.DataCap, error)
}

type StateManager

type StateManager struct{}

func (*StateManager) ResolveToKeyAddress

func (sm *StateManager) ResolveToKeyAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)

func (*StateManager) WaitForMessage

func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confidence uint64) (*types.TipSet, *types.MessageReceipt, error)

type StateManagerAPI

type StateManagerAPI struct {
	StateWaitMsg    func(ctx context.Context, mcid cid.Cid, confidence uint64) (*api.MsgLookup, error)
	StateAccountKey func(ctx context.Context, addr address.Address, ts types.TipSetKey) (address.Address, error)
}

type UtilsAPI

type UtilsAPI struct {
	StateMarketStorageDeal func(ctx context.Context, dealID abi.DealID, ts types.TipSetKey) (*api.MarketDeal, error)
	StateMinerInfo         func(ctx context.Context, addr address.Address, ts types.TipSetKey) (api.MinerInfo, error)
	NetFindPeer            func(context.Context, peer.ID) (peer.AddrInfo, error)
	ClientFindData         func(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error)
	ClientRetrieve         func(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error
	Version                func(ctx context.Context) (api.Version, error)
}

type Wallet

type Wallet struct{}

func (*Wallet) GetDefault

func (w *Wallet) GetDefault() (address.Address, error)

func (*Wallet) Sign

func (w *Wallet) Sign(ctx context.Context, addr address.Address, msg []byte) (*crypto.Signature, error)

func (*Wallet) WalletHas

func (w *Wallet) WalletHas(ctx context.Context, addr address.Address) (bool, error)

type WalletAPI

type WalletAPI struct {
	WalletSign           func(ctx context.Context, addr address.Address, msg []byte) (*crypto.Signature, error)
	WalletDefaultAddress func(ctx context.Context) (address.Address, error)
	WalletHas            func(ctx context.Context, addr address.Address) (bool, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL