node

package
v0.0.0-...-0866dc8 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

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

Admin RPCs

func (*AdminClient) GetSyncStatus

func (c *AdminClient) GetSyncStatus(txSeq uint64) (status string, err error)

func (*AdminClient) Shutdown

func (c *AdminClient) Shutdown() (ret int, err error)

func (*AdminClient) StartSyncFile

func (c *AdminClient) StartSyncFile(txSeq uint64) (ret int, err error)

type Client

type Client struct {
	*providers.MiddlewarableProvider
	// contains filtered or unexported fields
}

func MustNewClient

func MustNewClient(url string, option ...providers.Option) *Client

func MustNewClients

func MustNewClients(urls []string, option ...providers.Option) []*Client

func NewClient

func NewClient(url string, option ...providers.Option) (*Client, error)

func (*Client) Admin

func (c *Client) Admin() *AdminClient

func (*Client) Ionian

func (c *Client) Ionian() *IonianClient

func (*Client) KV

func (c *Client) KV() *KvClient

func (*Client) URL

func (c *Client) URL() string

type FileInfo

type FileInfo struct {
	Tx             Transaction `json:"tx"`
	Finalized      bool        `json:"finalized"`
	IsCached       bool        `json:"isCached"`
	UploadedSegNum uint64      `json:"uploadedSegNum"`
}

type IonianClient

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

Ionian RPCs

func (*IonianClient) DownloadSegment

func (c *IonianClient) DownloadSegment(root common.Hash, startIndex, endIndex uint64) (data []byte, err error)

func (*IonianClient) DownloadSegmentWithProof

func (c *IonianClient) DownloadSegmentWithProof(root common.Hash, index uint64) (segment *SegmentWithProof, err error)

func (*IonianClient) GetFileInfo

func (c *IonianClient) GetFileInfo(root common.Hash) (file *FileInfo, err error)

func (*IonianClient) GetFileInfoByTxSeq

func (c *IonianClient) GetFileInfoByTxSeq(txSeq uint64) (file *FileInfo, err error)

func (*IonianClient) GetStatus

func (c *IonianClient) GetStatus() (status Status, err error)

func (*IonianClient) UploadSegment

func (c *IonianClient) UploadSegment(segment SegmentWithProof) (ret int, err error)

type KeyValue

type KeyValue struct {
	Version uint64 `json:"version"` // key version
	Key     []byte `json:"key"`     // value key
	Data    []byte `json:"data"`    // value data
	Size    uint64 `json:"size"`    // value total size
}

type KvClient

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

func (*KvClient) GetFirst

func (c *KvClient) GetFirst(streamId common.Hash, startIndex, length uint64, version ...uint64) (val *KeyValue, err error)

func (*KvClient) GetHoldingStreamIds

func (c *KvClient) GetHoldingStreamIds() (streamIds []common.Hash, err error)

func (*KvClient) GetLast

func (c *KvClient) GetLast(streamId common.Hash, startIndex, length uint64, version ...uint64) (val *KeyValue, err error)

func (*KvClient) GetNext

func (c *KvClient) GetNext(streamId common.Hash, key []byte, startIndex, length uint64, inclusive bool, version ...uint64) (val *KeyValue, err error)

func (*KvClient) GetPrev

func (c *KvClient) GetPrev(streamId common.Hash, key []byte, startIndex, length uint64, inclusive bool, version ...uint64) (val *KeyValue, err error)

func (*KvClient) GetTransactionResult

func (c *KvClient) GetTransactionResult(txSeq uint64) (result string, err error)

func (*KvClient) GetValue

func (c *KvClient) GetValue(streamId common.Hash, key []byte, startIndex, length uint64, version ...uint64) (val *Value, err error)

func (*KvClient) HasWritePermission

func (c *KvClient) HasWritePermission(account common.Address, streamId common.Hash, key []byte, version ...uint64) (hasPermission bool, err error)

func (*KvClient) IsAdmin

func (c *KvClient) IsAdmin(account common.Address, streamId common.Hash, version ...uint64) (isAdmin bool, err error)

func (*KvClient) IsSpecialKey

func (c *KvClient) IsSpecialKey(streamId common.Hash, key []byte, version ...uint64) (isSpecialKey bool, err error)

func (*KvClient) IsWriterOfKey

func (c *KvClient) IsWriterOfKey(account common.Address, streamId common.Hash, key []byte, version ...uint64) (isWriter bool, err error)

func (*KvClient) IsWriterOfStream

func (c *KvClient) IsWriterOfStream(account common.Address, streamId common.Hash, version ...uint64) (isWriter bool, err error)

type SegmentWithProof

type SegmentWithProof struct {
	Root     common.Hash  `json:"root"`     // file merkle root
	Data     []byte       `json:"data"`     // segment data
	Index    uint64       `json:"index"`    // segment index
	Proof    merkle.Proof `json:"proof"`    // segment merkle proof
	FileSize uint64       `json:"fileSize"` // file size
}

type Status

type Status struct {
	ConnectedPeers uint `json:"connectedPeers"`
}

type Transaction

type Transaction struct {
	StreamIds      []*hexutil.Big `json:"streamIds"`
	Data           []byte         `json:"data"` // in-place data
	DataMerkleRoot common.Hash    `json:"dataMerkleRoot"`
	Size           uint64         `json:"size"` // file size in bytes
	Seq            uint64         `json:"seq"`
}

type Value

type Value struct {
	Version uint64 `json:"version"` // key version
	Data    []byte `json:"data"`    // value data
	Size    uint64 `json:"size"`    // value total size
}

Jump to

Keyboard shortcuts

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