rpc

package
v0.0.0-...-e1deddf Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlsMessages

type BlsMessages struct {
	Version  int
	To       string
	From     string
	Nonce    int64
	GasPrice string
	GasLimit int64
	Method   int
	Params   string
}

type CID

type CID struct {
	Cid string `json:"/"`
}

type ChainDataResult

type ChainDataResult struct {
	Error        error
	Height       int
	MessagesList []Messages
}

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (Error) Error

func (err Error) Error() string

type FilRPC

type FilRPC struct {
	// contains filtered or unexported fields
}

func New

func New(url string, options ...func(rpc *FilRPC)) *FilRPC

func (*FilRPC) FilGetActor

func (e *FilRPC) FilGetActor(to address.Address, ts chaintypes.TipSetKey) (*chaintypes.Actor, error)

func (*FilRPC) FilGetDealStatus

func (e *FilRPC) FilGetDealStatus(miner address.Address, propCid cid.Cid, dealUUID *uuid.UUID) (*storagemarket.ProviderDealState, error)

func (*FilRPC) FilGetMarketListIncompleteDeals

func (e *FilRPC) FilGetMarketListIncompleteDeals() (*[]storagemarket.MinerDeal, error)

func (*FilRPC) FilGetMessages

func (e *FilRPC) FilGetMessages(blockcid cid.Cid) (*chaintypes.Message, error)

func (*FilRPC) FilGetMessagesByCID

func (e *FilRPC) FilGetMessagesByCID(blockcid string) (Messages, error)

func (*FilRPC) FilGetMinerVersion

func (e *FilRPC) FilGetMinerVersion(m address.Address) (string, error)

func (*FilRPC) FilGetOriTipsetByHeight

func (e *FilRPC) FilGetOriTipsetByHeight(number int) (*chaintypes.TipSet, error)

func (*FilRPC) FilGetStateNetworkVersion

func (e *FilRPC) FilGetStateNetworkVersion() (uint, error)

func (*FilRPC) FilGetStateSearchMsg

func (e *FilRPC) FilGetStateSearchMsg(number cid.Cid, ts chaintypes.TipSetKey) (*api.MsgLookup, error)

func (*FilRPC) FilGetTipsetByHeight

func (e *FilRPC) FilGetTipsetByHeight(number int) (*chaintypes.ExpTipSet, error)

func (*FilRPC) FilGetWorkerStats

func (e *FilRPC) FilGetWorkerStats() (*map[uuid.UUID]storiface.WorkerStats, error)

func (*FilRPC) FilMinerGetBaseInfo

func (e *FilRPC) FilMinerGetBaseInfo(params ...interface{}) error

func (*FilRPC) FilPostStartApi

func (e *FilRPC) FilPostStartApi(payload []byte) error

func (*FilRPC) FilPostStartC1

func (e *FilRPC) FilPostStartC1(payload []byte) error

func (*FilRPC) FilPostStartP1

func (e *FilRPC) FilPostStartP1(payload []byte) error

func (*FilRPC) FilPostWriteBack

func (e *FilRPC) FilPostWriteBack(payload []byte) error

func (*FilRPC) FilWalletSign

func (e *FilRPC) FilWalletSign(params ...interface{}) error

type HTTPRpc

type HTTPRpc struct {
	Url    string
	Token  string
	Client httpClient
	Log    *zap.SugaredLogger
}

func NewRPC

func NewRPC(url string, token string, options ...func(rpc *HTTPRpc)) *HTTPRpc

func (*HTTPRpc) Call

func (rpc *HTTPRpc) Call(method string, params ...interface{}) (json.RawMessage, error)

func (*HTTPRpc) CallDo

func (rpc *HTTPRpc) CallDo(method string, params ...interface{}) (json.RawMessage, error)

func (*HTTPRpc) CallDoBody

func (rpc *HTTPRpc) CallDoBody(method string, body []byte) (json.RawMessage, error)

func (*HTTPRpc) CallWithResult

func (rpc *HTTPRpc) CallWithResult(method string, target interface{}, params ...interface{}) error

func (*HTTPRpc) URL

func (rpc *HTTPRpc) URL() string

type Messages

type Messages struct {
	Blockcid string
	api.BlockMessages
}

type Request

type Request struct {
	ID      int           `json:"id"`
	JSONRPC string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

type Response

type Response struct {
	ID      int             `json:"id"`
	JSONRPC string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Error   *Error          `json:"error"`
}

type SecpkMessages

type SecpkMessages struct {
	Version  int
	To       string
	From     string
	Nonce    int64
	GasPrice string
	GasLimit int64
	Method   int
	Params   string
}

type Tipset

type Tipset struct {
	Cids []CID `json:"Cids"`
}

Jump to

Keyboard shortcuts

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