apistruct

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermRead  api.Permission = "read" // default
	PermWrite api.Permission = "write"
	PermSign  api.Permission = "sign"  // Use wallet keys for signing
	PermAdmin api.Permission = "admin" // Manage permissions
)

Variables

Functions

func HasPerm

func HasPerm(ctx context.Context, perm api.Permission) bool

func PermissionedFullAPI

func PermissionedFullAPI(a api.FullNode) api.FullNode

func PermissionedStorMinerAPI

func PermissionedStorMinerAPI(a api.StorageMiner) api.StorageMiner

func WithPerm

func WithPerm(ctx context.Context, perms []api.Permission) context.Context

Types

type CommonStruct

type CommonStruct struct {
	Internal struct {
		AuthVerify func(ctx context.Context, token string) ([]api.Permission, error) `perm:"read"`
		AuthNew    func(ctx context.Context, perms []api.Permission) ([]byte, error) `perm:"admin"`

		NetConnectedness func(context.Context, peer.ID) (network.Connectedness, error) `perm:"read"`
		NetPeers         func(context.Context) ([]peer.AddrInfo, error)                `perm:"read"`
		NetConnect       func(context.Context, peer.AddrInfo) error                    `perm:"write"`
		NetAddrsListen   func(context.Context) (peer.AddrInfo, error)                  `perm:"read"`
		NetDisconnect    func(context.Context, peer.ID) error                          `perm:"write"`

		ID      func(context.Context) (peer.ID, error)     `perm:"read"`
		Version func(context.Context) (api.Version, error) `perm:"read"`
	}
}

func (*CommonStruct) AuthNew

func (c *CommonStruct) AuthNew(ctx context.Context, perms []api.Permission) ([]byte, error)

func (*CommonStruct) AuthVerify

func (c *CommonStruct) AuthVerify(ctx context.Context, token string) ([]api.Permission, error)

func (*CommonStruct) ID

func (c *CommonStruct) ID(ctx context.Context) (peer.ID, error)

ID implements API.ID

func (*CommonStruct) NetAddrsListen

func (c *CommonStruct) NetAddrsListen(ctx context.Context) (peer.AddrInfo, error)

func (*CommonStruct) NetConnect

func (c *CommonStruct) NetConnect(ctx context.Context, p peer.AddrInfo) error

func (*CommonStruct) NetConnectedness

func (c *CommonStruct) NetConnectedness(ctx context.Context, pid peer.ID) (network.Connectedness, error)

func (*CommonStruct) NetDisconnect

func (c *CommonStruct) NetDisconnect(ctx context.Context, p peer.ID) error

func (*CommonStruct) NetPeers

func (c *CommonStruct) NetPeers(ctx context.Context) ([]peer.AddrInfo, error)

func (*CommonStruct) Version

func (c *CommonStruct) Version(ctx context.Context) (api.Version, error)

Version implements API.Version

type FullNodeStruct

type FullNodeStruct struct {
	CommonStruct

	Internal struct {
		ChainNotify            func(context.Context) (<-chan []*store.HeadChange, error)           `perm:"read"`
		ChainHead              func(context.Context) (*types.TipSet, error)                        `perm:"read"`
		ChainGetRandomness     func(context.Context, types.TipSetKey, int64) ([]byte, error)       `perm:"read"`
		ChainGetBlock          func(context.Context, cid.Cid) (*types.BlockHeader, error)          `perm:"read"`
		ChainGetTipSet         func(context.Context, types.TipSetKey) (*types.TipSet, error)       `perm:"read"`
		ChainGetBlockMessages  func(context.Context, cid.Cid) (*api.BlockMessages, error)          `perm:"read"`
		ChainGetParentReceipts func(context.Context, cid.Cid) ([]*types.MessageReceipt, error)     `perm:"read"`
		ChainGetParentMessages func(context.Context, cid.Cid) ([]api.Message, error)               `perm:"read"`
		ChainGetTipSetByHeight func(context.Context, uint64, *types.TipSet) (*types.TipSet, error) `perm:"read"`
		ChainReadObj           func(context.Context, cid.Cid) ([]byte, error)                      `perm:"read"`
		ChainSetHead           func(context.Context, *types.TipSet) error                          `perm:"admin"`
		ChainGetGenesis        func(context.Context) (*types.TipSet, error)                        `perm:"read"`
		ChainTipSetWeight      func(context.Context, *types.TipSet) (types.BigInt, error)          `perm:"read"`
		ChainGetNode           func(ctx context.Context, p string) (interface{}, error)            `perm:"read"`

		SyncState          func(context.Context) (*api.SyncState, error)                `perm:"read"`
		SyncSubmitBlock    func(ctx context.Context, blk *types.BlockMsg) error         `perm:"write"`
		SyncIncomingBlocks func(ctx context.Context) (<-chan *types.BlockHeader, error) `perm:"read"`

		MpoolPending     func(context.Context, *types.TipSet) ([]*types.SignedMessage, error) `perm:"read"`
		MpoolPush        func(context.Context, *types.SignedMessage) error                    `perm:"write"`
		MpoolPushMessage func(context.Context, *types.Message) (*types.SignedMessage, error)  `perm:"sign"`
		MpoolGetNonce    func(context.Context, address.Address) (uint64, error)               `perm:"read"`
		MpoolSub         func(context.Context) (<-chan api.MpoolUpdate, error)                `perm:"read"`

		MinerCreateBlock func(context.Context, address.Address, *types.TipSet, *types.Ticket, *types.EPostProof, []*types.SignedMessage, uint64, uint64) (*types.BlockMsg, error) `perm:"write"`

		WalletNew            func(context.Context, string) (address.Address, error)                               `perm:"write"`
		WalletHas            func(context.Context, address.Address) (bool, error)                                 `perm:"write"`
		WalletList           func(context.Context) ([]address.Address, error)                                     `perm:"write"`
		WalletBalance        func(context.Context, address.Address) (types.BigInt, error)                         `perm:"read"`
		WalletSign           func(context.Context, address.Address, []byte) (*types.Signature, error)             `perm:"sign"`
		WalletSignMessage    func(context.Context, address.Address, *types.Message) (*types.SignedMessage, error) `perm:"sign"`
		WalletDefaultAddress func(context.Context) (address.Address, error)                                       `perm:"write"`
		WalletSetDefault     func(context.Context, address.Address) error                                         `perm:"admin"`
		WalletExport         func(context.Context, address.Address) (*types.KeyInfo, error)                       `perm:"admin"`
		WalletImport         func(context.Context, *types.KeyInfo) (address.Address, error)                       `perm:"admin"`

		ClientImport      func(ctx context.Context, path string) (cid.Cid, error)                                                                                           `perm:"admin"`
		ClientListImports func(ctx context.Context) ([]api.Import, error)                                                                                                   `perm:"write"`
		ClientHasLocal    func(ctx context.Context, root cid.Cid) (bool, error)                                                                                             `perm:"write"`
		ClientFindData    func(ctx context.Context, root cid.Cid) ([]api.QueryOffer, error)                                                                                 `perm:"read"`
		ClientStartDeal   func(ctx context.Context, data cid.Cid, addr address.Address, miner address.Address, price types.BigInt, blocksDuration uint64) (*cid.Cid, error) `perm:"admin"`
		ClientGetDealInfo func(context.Context, cid.Cid) (*api.DealInfo, error)                                                                                             `perm:"read"`
		ClientListDeals   func(ctx context.Context) ([]api.DealInfo, error)                                                                                                 `perm:"write"`
		ClientRetrieve    func(ctx context.Context, order api.RetrievalOrder, path string) error                                                                            `perm:"admin"`
		ClientQueryAsk    func(ctx context.Context, p peer.ID, miner address.Address) (*types.SignedStorageAsk, error)                                                      `perm:"read"`

		StateMinerSectors             func(context.Context, address.Address, *types.TipSet) ([]*api.ChainSectorInfo, error)           `perm:"read"`
		StateMinerProvingSet          func(context.Context, address.Address, *types.TipSet) ([]*api.ChainSectorInfo, error)           `perm:"read"`
		StateMinerPower               func(context.Context, address.Address, *types.TipSet) (api.MinerPower, error)                   `perm:"read"`
		StateMinerWorker              func(context.Context, address.Address, *types.TipSet) (address.Address, error)                  `perm:"read"`
		StateMinerPeerID              func(ctx context.Context, m address.Address, ts *types.TipSet) (peer.ID, error)                 `perm:"read"`
		StateMinerElectionPeriodStart func(ctx context.Context, actor address.Address, ts *types.TipSet) (uint64, error)              `perm:"read"`
		StateMinerSectorSize          func(context.Context, address.Address, *types.TipSet) (uint64, error)                           `perm:"read"`
		StateCall                     func(context.Context, *types.Message, *types.TipSet) (*types.MessageReceipt, error)             `perm:"read"`
		StateReplay                   func(context.Context, *types.TipSet, cid.Cid) (*api.ReplayResults, error)                       `perm:"read"`
		StateGetActor                 func(context.Context, address.Address, *types.TipSet) (*types.Actor, error)                     `perm:"read"`
		StateReadState                func(context.Context, *types.Actor, *types.TipSet) (*api.ActorState, error)                     `perm:"read"`
		StatePledgeCollateral         func(context.Context, *types.TipSet) (types.BigInt, error)                                      `perm:"read"`
		StateWaitMsg                  func(context.Context, cid.Cid) (*api.MsgWait, error)                                            `perm:"read"`
		StateListMiners               func(context.Context, *types.TipSet) ([]address.Address, error)                                 `perm:"read"`
		StateListActors               func(context.Context, *types.TipSet) ([]address.Address, error)                                 `perm:"read"`
		StateMarketBalance            func(context.Context, address.Address, *types.TipSet) (actors.StorageParticipantBalance, error) `perm:"read"`
		StateMarketParticipants       func(context.Context, *types.TipSet) (map[string]actors.StorageParticipantBalance, error)       `perm:"read"`
		StateMarketDeals              func(context.Context, *types.TipSet) (map[string]actors.OnChainDeal, error)                     `perm:"read"`
		StateMarketStorageDeal        func(context.Context, uint64, *types.TipSet) (*actors.OnChainDeal, error)                       `perm:"read"`
		StateLookupID                 func(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)      `perm:"read"`
		StateChangedActors            func(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error)                         `perm:"read"`
		StateGetReceipt               func(context.Context, cid.Cid, *types.TipSet) (*types.MessageReceipt, error)                    `perm:"read"`
		StateMinerSectorCount         func(context.Context, address.Address, *types.TipSet) (api.MinerSectors, error)                 `perm:"read"`

		MarketEnsureAvailable func(context.Context, address.Address, types.BigInt) error `perm:"sign"`

		PaychGet                   func(ctx context.Context, from, to address.Address, ensureFunds types.BigInt) (*api.ChannelInfo, error)   `perm:"sign"`
		PaychList                  func(context.Context) ([]address.Address, error)                                                          `perm:"read"`
		PaychStatus                func(context.Context, address.Address) (*api.PaychStatus, error)                                          `perm:"read"`
		PaychClose                 func(context.Context, address.Address) (cid.Cid, error)                                                   `perm:"sign"`
		PaychAllocateLane          func(context.Context, address.Address) (uint64, error)                                                    `perm:"sign"`
		PaychNewPayment            func(ctx context.Context, from, to address.Address, vouchers []api.VoucherSpec) (*api.PaymentInfo, error) `perm:"sign"`
		PaychVoucherCheck          func(context.Context, *types.SignedVoucher) error                                                         `perm:"read"`
		PaychVoucherCheckValid     func(context.Context, address.Address, *types.SignedVoucher) error                                        `perm:"read"`
		PaychVoucherCheckSpendable func(context.Context, address.Address, *types.SignedVoucher, []byte, []byte) (bool, error)                `perm:"read"`
		PaychVoucherAdd            func(context.Context, address.Address, *types.SignedVoucher, []byte, types.BigInt) (types.BigInt, error)  `perm:"write"`
		PaychVoucherCreate         func(context.Context, address.Address, types.BigInt, uint64) (*types.SignedVoucher, error)                `perm:"sign"`
		PaychVoucherList           func(context.Context, address.Address) ([]*types.SignedVoucher, error)                                    `perm:"write"`
		PaychVoucherSubmit         func(context.Context, address.Address, *types.SignedVoucher) (cid.Cid, error)                             `perm:"sign"`
	}
}

FullNodeStruct implements API passing calls to user-provided function values.

func (*FullNodeStruct) ChainGetBlock

func (c *FullNodeStruct) ChainGetBlock(ctx context.Context, b cid.Cid) (*types.BlockHeader, error)

func (*FullNodeStruct) ChainGetBlockMessages

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

func (*FullNodeStruct) ChainGetGenesis

func (c *FullNodeStruct) ChainGetGenesis(ctx context.Context) (*types.TipSet, error)

func (*FullNodeStruct) ChainGetNode added in v0.1.5

func (c *FullNodeStruct) ChainGetNode(ctx context.Context, p string) (interface{}, error)

func (*FullNodeStruct) ChainGetParentMessages

func (c *FullNodeStruct) ChainGetParentMessages(ctx context.Context, b cid.Cid) ([]api.Message, error)

func (*FullNodeStruct) ChainGetParentReceipts

func (c *FullNodeStruct) ChainGetParentReceipts(ctx context.Context, b cid.Cid) ([]*types.MessageReceipt, error)

func (*FullNodeStruct) ChainGetRandomness

func (c *FullNodeStruct) ChainGetRandomness(ctx context.Context, pts types.TipSetKey, round int64) ([]byte, error)

func (*FullNodeStruct) ChainGetTipSet

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

func (*FullNodeStruct) ChainGetTipSetByHeight

func (c *FullNodeStruct) ChainGetTipSetByHeight(ctx context.Context, h uint64, ts *types.TipSet) (*types.TipSet, error)

func (*FullNodeStruct) ChainHead

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

func (*FullNodeStruct) ChainNotify

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

func (*FullNodeStruct) ChainReadObj

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

func (*FullNodeStruct) ChainSetHead

func (c *FullNodeStruct) ChainSetHead(ctx context.Context, ts *types.TipSet) error

func (*FullNodeStruct) ChainTipSetWeight

func (c *FullNodeStruct) ChainTipSetWeight(ctx context.Context, ts *types.TipSet) (types.BigInt, error)

func (*FullNodeStruct) ClientFindData

func (c *FullNodeStruct) ClientFindData(ctx context.Context, root cid.Cid) ([]api.QueryOffer, error)

func (*FullNodeStruct) ClientGetDealInfo

func (c *FullNodeStruct) ClientGetDealInfo(ctx context.Context, deal cid.Cid) (*api.DealInfo, error)

func (*FullNodeStruct) ClientHasLocal

func (c *FullNodeStruct) ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error)

func (*FullNodeStruct) ClientImport

func (c *FullNodeStruct) ClientImport(ctx context.Context, path string) (cid.Cid, error)

func (*FullNodeStruct) ClientListDeals

func (c *FullNodeStruct) ClientListDeals(ctx context.Context) ([]api.DealInfo, error)

func (*FullNodeStruct) ClientListImports

func (c *FullNodeStruct) ClientListImports(ctx context.Context) ([]api.Import, error)

func (*FullNodeStruct) ClientQueryAsk

func (c *FullNodeStruct) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*types.SignedStorageAsk, error)

func (*FullNodeStruct) ClientRetrieve

func (c *FullNodeStruct) ClientRetrieve(ctx context.Context, order api.RetrievalOrder, path string) error

func (*FullNodeStruct) ClientStartDeal

func (c *FullNodeStruct) ClientStartDeal(ctx context.Context, data cid.Cid, addr address.Address, miner address.Address, price types.BigInt, blocksDuration uint64) (*cid.Cid, error)

func (*FullNodeStruct) MarketEnsureAvailable

func (c *FullNodeStruct) MarketEnsureAvailable(ctx context.Context, addr address.Address, amt types.BigInt) error

func (*FullNodeStruct) MinerCreateBlock

func (c *FullNodeStruct) MinerCreateBlock(ctx context.Context, addr address.Address, base *types.TipSet, ticket *types.Ticket, eproof *types.EPostProof, msgs []*types.SignedMessage, height, ts uint64) (*types.BlockMsg, error)

func (*FullNodeStruct) MpoolGetNonce

func (c *FullNodeStruct) MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error)

func (*FullNodeStruct) MpoolPending

func (c *FullNodeStruct) MpoolPending(ctx context.Context, ts *types.TipSet) ([]*types.SignedMessage, error)

func (*FullNodeStruct) MpoolPush

func (c *FullNodeStruct) MpoolPush(ctx context.Context, smsg *types.SignedMessage) error

func (*FullNodeStruct) MpoolPushMessage

func (c *FullNodeStruct) MpoolPushMessage(ctx context.Context, msg *types.Message) (*types.SignedMessage, error)

func (*FullNodeStruct) MpoolSub

func (c *FullNodeStruct) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error)

func (*FullNodeStruct) PaychAllocateLane

func (c *FullNodeStruct) PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error)

func (*FullNodeStruct) PaychClose

func (c *FullNodeStruct) PaychClose(ctx context.Context, a address.Address) (cid.Cid, error)

func (*FullNodeStruct) PaychGet

func (c *FullNodeStruct) PaychGet(ctx context.Context, from, to address.Address, ensureFunds types.BigInt) (*api.ChannelInfo, error)

func (*FullNodeStruct) PaychList

func (c *FullNodeStruct) PaychList(ctx context.Context) ([]address.Address, error)

func (*FullNodeStruct) PaychNewPayment

func (c *FullNodeStruct) PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []api.VoucherSpec) (*api.PaymentInfo, error)

func (*FullNodeStruct) PaychStatus

func (c *FullNodeStruct) PaychStatus(ctx context.Context, pch address.Address) (*api.PaychStatus, error)

func (*FullNodeStruct) PaychVoucherAdd

func (c *FullNodeStruct) PaychVoucherAdd(ctx context.Context, addr address.Address, sv *types.SignedVoucher, proof []byte, minDelta types.BigInt) (types.BigInt, error)

func (*FullNodeStruct) PaychVoucherCheckSpendable

func (c *FullNodeStruct) PaychVoucherCheckSpendable(ctx context.Context, addr address.Address, sv *types.SignedVoucher, secret []byte, proof []byte) (bool, error)

func (*FullNodeStruct) PaychVoucherCheckValid

func (c *FullNodeStruct) PaychVoucherCheckValid(ctx context.Context, addr address.Address, sv *types.SignedVoucher) error

func (*FullNodeStruct) PaychVoucherCreate

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

func (*FullNodeStruct) PaychVoucherList

func (c *FullNodeStruct) PaychVoucherList(ctx context.Context, pch address.Address) ([]*types.SignedVoucher, error)

func (*FullNodeStruct) PaychVoucherSubmit

func (c *FullNodeStruct) PaychVoucherSubmit(ctx context.Context, ch address.Address, sv *types.SignedVoucher) (cid.Cid, error)

func (*FullNodeStruct) StateCall

func (c *FullNodeStruct) StateCall(ctx context.Context, msg *types.Message, ts *types.TipSet) (*types.MessageReceipt, error)

func (*FullNodeStruct) StateChangedActors

func (c *FullNodeStruct) StateChangedActors(ctx context.Context, olnstate cid.Cid, newstate cid.Cid) (map[string]types.Actor, error)

func (*FullNodeStruct) StateGetActor

func (c *FullNodeStruct) StateGetActor(ctx context.Context, actor address.Address, ts *types.TipSet) (*types.Actor, error)

func (*FullNodeStruct) StateGetReceipt

func (c *FullNodeStruct) StateGetReceipt(ctx context.Context, msg cid.Cid, ts *types.TipSet) (*types.MessageReceipt, error)

func (*FullNodeStruct) StateListActors

func (c *FullNodeStruct) StateListActors(ctx context.Context, ts *types.TipSet) ([]address.Address, error)

func (*FullNodeStruct) StateListMiners

func (c *FullNodeStruct) StateListMiners(ctx context.Context, ts *types.TipSet) ([]address.Address, error)

func (*FullNodeStruct) StateLookupID

func (c *FullNodeStruct) StateLookupID(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)

func (*FullNodeStruct) StateMarketBalance

func (*FullNodeStruct) StateMarketDeals

func (c *FullNodeStruct) StateMarketDeals(ctx context.Context, ts *types.TipSet) (map[string]actors.OnChainDeal, error)

func (*FullNodeStruct) StateMarketParticipants

func (c *FullNodeStruct) StateMarketParticipants(ctx context.Context, ts *types.TipSet) (map[string]actors.StorageParticipantBalance, error)

func (*FullNodeStruct) StateMarketStorageDeal

func (c *FullNodeStruct) StateMarketStorageDeal(ctx context.Context, dealid uint64, ts *types.TipSet) (*actors.OnChainDeal, error)

func (*FullNodeStruct) StateMinerElectionPeriodStart

func (c *FullNodeStruct) StateMinerElectionPeriodStart(ctx context.Context, actor address.Address, ts *types.TipSet) (uint64, error)

func (*FullNodeStruct) StateMinerPeerID

func (c *FullNodeStruct) StateMinerPeerID(ctx context.Context, m address.Address, ts *types.TipSet) (peer.ID, error)

func (*FullNodeStruct) StateMinerPower

func (c *FullNodeStruct) StateMinerPower(ctx context.Context, a address.Address, ts *types.TipSet) (api.MinerPower, error)

func (*FullNodeStruct) StateMinerProvingSet

func (c *FullNodeStruct) StateMinerProvingSet(ctx context.Context, addr address.Address, ts *types.TipSet) ([]*api.ChainSectorInfo, error)

func (*FullNodeStruct) StateMinerSectorCount added in v0.1.5

func (c *FullNodeStruct) StateMinerSectorCount(ctx context.Context, addr address.Address, ts *types.TipSet) (api.MinerSectors, error)

func (*FullNodeStruct) StateMinerSectorSize

func (c *FullNodeStruct) StateMinerSectorSize(ctx context.Context, actor address.Address, ts *types.TipSet) (uint64, error)

func (*FullNodeStruct) StateMinerSectors

func (c *FullNodeStruct) StateMinerSectors(ctx context.Context, addr address.Address, ts *types.TipSet) ([]*api.ChainSectorInfo, error)

func (*FullNodeStruct) StateMinerWorker

func (c *FullNodeStruct) StateMinerWorker(ctx context.Context, m address.Address, ts *types.TipSet) (address.Address, error)

func (*FullNodeStruct) StatePledgeCollateral

func (c *FullNodeStruct) StatePledgeCollateral(ctx context.Context, ts *types.TipSet) (types.BigInt, error)

func (*FullNodeStruct) StateReadState

func (c *FullNodeStruct) StateReadState(ctx context.Context, act *types.Actor, ts *types.TipSet) (*api.ActorState, error)

func (*FullNodeStruct) StateReplay

func (c *FullNodeStruct) StateReplay(ctx context.Context, ts *types.TipSet, mc cid.Cid) (*api.ReplayResults, error)

func (*FullNodeStruct) StateWaitMsg

func (c *FullNodeStruct) StateWaitMsg(ctx context.Context, msgc cid.Cid) (*api.MsgWait, error)

func (*FullNodeStruct) SyncIncomingBlocks

func (c *FullNodeStruct) SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error)

func (*FullNodeStruct) SyncState

func (c *FullNodeStruct) SyncState(ctx context.Context) (*api.SyncState, error)

func (*FullNodeStruct) SyncSubmitBlock

func (c *FullNodeStruct) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error

func (*FullNodeStruct) WalletBalance

func (c *FullNodeStruct) WalletBalance(ctx context.Context, a address.Address) (types.BigInt, error)

func (*FullNodeStruct) WalletDefaultAddress

func (c *FullNodeStruct) WalletDefaultAddress(ctx context.Context) (address.Address, error)

func (*FullNodeStruct) WalletExport

func (c *FullNodeStruct) WalletExport(ctx context.Context, a address.Address) (*types.KeyInfo, error)

func (*FullNodeStruct) WalletHas

func (c *FullNodeStruct) WalletHas(ctx context.Context, addr address.Address) (bool, error)

func (*FullNodeStruct) WalletImport

func (c *FullNodeStruct) WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error)

func (*FullNodeStruct) WalletList

func (c *FullNodeStruct) WalletList(ctx context.Context) ([]address.Address, error)

func (*FullNodeStruct) WalletNew

func (c *FullNodeStruct) WalletNew(ctx context.Context, typ string) (address.Address, error)

func (*FullNodeStruct) WalletSetDefault

func (c *FullNodeStruct) WalletSetDefault(ctx context.Context, a address.Address) error

func (*FullNodeStruct) WalletSign

func (c *FullNodeStruct) WalletSign(ctx context.Context, k address.Address, msg []byte) (*types.Signature, error)

func (*FullNodeStruct) WalletSignMessage

func (c *FullNodeStruct) WalletSignMessage(ctx context.Context, k address.Address, msg *types.Message) (*types.SignedMessage, error)

type StorageMinerStruct

type StorageMinerStruct struct {
	CommonStruct

	Internal struct {
		ActorAddress    func(context.Context) (address.Address, error)         `perm:"read"`
		ActorSectorSize func(context.Context, address.Address) (uint64, error) `perm:"read"`

		PledgeSector func(context.Context) error `perm:"write"`

		SectorsStatus func(context.Context, uint64) (api.SectorInfo, error)     `perm:"read"`
		SectorsList   func(context.Context) ([]uint64, error)                   `perm:"read"`
		SectorsRefs   func(context.Context) (map[string][]api.SealedRef, error) `perm:"read"`
		SectorsUpdate func(context.Context, uint64, api.SectorState) error      `perm:"write"`

		WorkerStats func(context.Context) (sectorbuilder.WorkerStats, error) `perm:"read"`

		WorkerQueue func(ctx context.Context, cfg sectorbuilder.WorkerCfg) (<-chan sectorbuilder.WorkerTask, error) `perm:"admin"` // TODO: worker perm
		WorkerDone  func(ctx context.Context, task uint64, res sectorbuilder.SealRes) error                         `perm:"admin"`
	}
}

func (*StorageMinerStruct) ActorAddress

func (c *StorageMinerStruct) ActorAddress(ctx context.Context) (address.Address, error)

func (*StorageMinerStruct) ActorSectorSize

func (c *StorageMinerStruct) ActorSectorSize(ctx context.Context, addr address.Address) (uint64, error)

func (*StorageMinerStruct) PledgeSector

func (c *StorageMinerStruct) PledgeSector(ctx context.Context) error

func (*StorageMinerStruct) SectorsList

func (c *StorageMinerStruct) SectorsList(ctx context.Context) ([]uint64, error)

List all staged sectors

func (*StorageMinerStruct) SectorsRefs

func (c *StorageMinerStruct) SectorsRefs(ctx context.Context) (map[string][]api.SealedRef, error)

func (*StorageMinerStruct) SectorsStatus

func (c *StorageMinerStruct) SectorsStatus(ctx context.Context, sid uint64) (api.SectorInfo, error)

Get the status of a given sector by ID

func (*StorageMinerStruct) SectorsUpdate

func (c *StorageMinerStruct) SectorsUpdate(ctx context.Context, id uint64, state api.SectorState) error

func (*StorageMinerStruct) WorkerDone

func (c *StorageMinerStruct) WorkerDone(ctx context.Context, task uint64, res sectorbuilder.SealRes) error

func (*StorageMinerStruct) WorkerQueue

func (*StorageMinerStruct) WorkerStats

Jump to

Keyboard shortcuts

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