filters

package
v2.6.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: GPL-3.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBlock

type AccountBlock struct {
	Hash    types.Hash `json:"hash"`
	Removed bool       `json:"removed"`
}

type AccountBlockWithHeight

type AccountBlockWithHeight struct {
	Hash      types.Hash `json:"hash"`
	Height    uint64     `json:"height"` // Deprecated
	HeightStr string     `json:"heightStr"`
	Removed   bool       `json:"removed"`
}

type AccountBlockWithHeightV2

type AccountBlockWithHeightV2 struct {
	Hash    types.Hash `json:"hash"`
	Height  string     `json:"height"`
	Removed bool       `json:"removed"`
}

type AccountBlocksMsg

type AccountBlocksMsg struct {
	Blocks []*AccountBlock `json:"result"`
	Id     rpc.ID          `json:"subscription"`
}

type AccountBlocksWithHeightMsg

type AccountBlocksWithHeightMsg struct {
	Blocks []*AccountBlockWithHeight `json:"result"`
	Id     rpc.ID                    `json:"subscription"`
}

type AccountBlocksWithHeightMsgV2

type AccountBlocksWithHeightMsgV2 struct {
	Blocks []*AccountBlockWithHeightV2 `json:"result"`
	Id     rpc.ID                      `json:"subscription"`
}

type AccountChainEvent

type AccountChainEvent struct {
	BlockType     byte
	FromBlockHash types.Hash
	Hash          types.Hash
	Height        uint64
	Addr          types.Address
	ToAddr        types.Address
	Logs          []*ledger.VmLog
	SendBlockList []*SendBlock
}

func NewAccountChainEvent

func NewAccountChainEvent(block *ledger.AccountBlock, logs []*ledger.VmLog) *AccountChainEvent

type ChainSubscribe

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

func NewChainSubscribe

func NewChainSubscribe(v *vite.Vite, e *EventSystem) *ChainSubscribe

func (*ChainSubscribe) DeleteAccountBlocks

func (c *ChainSubscribe) DeleteAccountBlocks(blocks []*ledger.AccountBlock) error

func (*ChainSubscribe) DeleteSnapshotBlocks

func (c *ChainSubscribe) DeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error

func (*ChainSubscribe) InsertAccountBlocks

func (c *ChainSubscribe) InsertAccountBlocks(blocks []*vm_db.VmAccountBlock) error

func (*ChainSubscribe) InsertSnapshotBlocks

func (c *ChainSubscribe) InsertSnapshotBlocks(chunks []*ledger.SnapshotChunk) error

func (*ChainSubscribe) PrepareDeleteAccountBlocks

func (c *ChainSubscribe) PrepareDeleteAccountBlocks(blocks []*ledger.AccountBlock) error

func (*ChainSubscribe) PrepareDeleteSnapshotBlocks

func (c *ChainSubscribe) PrepareDeleteSnapshotBlocks(chunks []*ledger.SnapshotChunk) error

func (*ChainSubscribe) PrepareInsertAccountBlocks

func (c *ChainSubscribe) PrepareInsertAccountBlocks(blocks []*vm_db.VmAccountBlock) error

func (*ChainSubscribe) PrepareInsertSnapshotBlocks

func (c *ChainSubscribe) PrepareInsertSnapshotBlocks(chunks []*ledger.SnapshotChunk) error

func (*ChainSubscribe) Stop

func (c *ChainSubscribe) Stop()

type EventSystem

type EventSystem struct {
	// contains filtered or unexported fields
}
var Es *EventSystem

func NewEventSystem

func NewEventSystem(v *vite.Vite) *EventSystem

func (*EventSystem) Start

func (es *EventSystem) Start()

func (*EventSystem) Stop

func (es *EventSystem) Stop()

func (*EventSystem) SubscribeAccountBlocks

func (es *EventSystem) SubscribeAccountBlocks(ch chan []*AccountBlock) *RpcSubscription

func (*EventSystem) SubscribeAccountBlocksByAddr

func (es *EventSystem) SubscribeAccountBlocksByAddr(addr types.Address, ch chan []*AccountBlockWithHeight, ft FilterType) *RpcSubscription

func (*EventSystem) SubscribeLogs

func (es *EventSystem) SubscribeLogs(p *api.FilterParam, ch chan []*Logs, ft FilterType) *RpcSubscription

func (*EventSystem) SubscribeOnroadBlocksByAddr

func (es *EventSystem) SubscribeOnroadBlocksByAddr(addr types.Address, ch chan []*OnroadMsg, ft FilterType) *RpcSubscription

func (*EventSystem) SubscribeSnapshotBlocks

func (es *EventSystem) SubscribeSnapshotBlocks(ch chan []*SnapshotBlock, ft FilterType) *RpcSubscription

type FilterType

type FilterType byte
const (
	LogsSubscription FilterType = iota
	LogsSubscriptionV2
	AccountBlocksSubscription
	AccountBlocksWithHeightSubscription
	AccountBlocksWithHeightSubscriptionV2
	OnroadBlocksSubscription
	OnroadBlocksSubscriptionV2
	SnapshotBlocksSubscription
	SnapshotBlocksSubscriptionV2
)

type Logs

type Logs struct {
	Log              *ledger.VmLog  `json:"log"`
	AccountBlockHash types.Hash     `json:"accountBlockHash"`
	AccountHeight    string         `json:"accountHeight"`
	Addr             *types.Address `json:"addr"`
	Removed          bool           `json:"removed"`
}

type LogsMsg

type LogsMsg struct {
	Logs []*Logs `json:"result"`
	Id   rpc.ID  `json:"subscription"`
}

type LogsMsgV2

type LogsMsgV2 struct {
	Logs []*LogsV2 `json:"result"`
	Id   rpc.ID    `json:"subscription"`
}

type LogsV2

type LogsV2 struct {
	Log              *ledger.VmLog  `json:"vmlog"`
	AccountBlockHash types.Hash     `json:"accountBlockHash"`
	AccountHeight    string         `json:"accountBlockHeight"`
	Addr             *types.Address `json:"address"`
	Removed          bool           `json:"removed"`
}

type OnroadBlocksMsg

type OnroadBlocksMsg struct {
	Blocks []*OnroadMsg `json:"result"`
	Id     rpc.ID       `json:"subscription"`
}

type OnroadBlocksMsgV2

type OnroadBlocksMsgV2 struct {
	Blocks []*OnroadMsgV2 `json:"result"`
	Id     rpc.ID         `json:"subscription"`
}

type OnroadMsg

type OnroadMsg struct {
	Hash    types.Hash `json:"hash"`
	Closed  bool       `json:"closed"`
	Removed bool       `json:"removed"`
}

type OnroadMsgV2

type OnroadMsgV2 struct {
	Hash     types.Hash `json:"hash"`
	Received bool       `json:"received"`
	Removed  bool       `json:"removed"`
}

type RpcFilterParam

type RpcFilterParam struct {
	AddrRange map[string]*api.Range `json:"addrRange"`
	Topics    [][]types.Hash        `json:"topics"`
}

type RpcSubscription

type RpcSubscription struct {
	ID rpc.ID
	// contains filtered or unexported fields
}

func (*RpcSubscription) Err

func (s *RpcSubscription) Err() <-chan error

func (*RpcSubscription) Unsubscribe

func (s *RpcSubscription) Unsubscribe()

type SendBlock

type SendBlock struct {
	Hash   types.Hash
	ToAddr types.Address
}

type SnapshotBlock

type SnapshotBlock struct {
	Hash      types.Hash `json:"hash"`
	Height    uint64     `json:"height"` // Deprecated
	HeightStr string     `json:"heightStr"`
	Removed   bool       `json:"removed"`
}

type SnapshotBlockV2

type SnapshotBlockV2 struct {
	Hash    types.Hash `json:"hash"`
	Height  string     `json:"height"`
	Removed bool       `json:"removed"`
}

type SnapshotBlocksMsg

type SnapshotBlocksMsg struct {
	Blocks []*SnapshotBlock `json:"result"`
	Id     rpc.ID           `json:"subscription"`
}

type SnapshotBlocksMsgV2

type SnapshotBlocksMsgV2 struct {
	Blocks []*SnapshotBlockV2 `json:"result"`
	Id     rpc.ID             `json:"subscription"`
}

type SnapshotChainEvent

type SnapshotChainEvent struct {
	Hash   types.Hash
	Height uint64
}

type SubscribeApi

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

func NewSubscribeApi

func NewSubscribeApi(vite *vite.Vite) *SubscribeApi

func (*SubscribeApi) CreateAccountBlockFilter

func (s *SubscribeApi) CreateAccountBlockFilter() (rpc.ID, error)

func (*SubscribeApi) CreateAccountBlockFilterByAddress

func (s *SubscribeApi) CreateAccountBlockFilterByAddress(addr types.Address) (rpc.ID, error)

func (*SubscribeApi) CreateAccountBlockSubscription

func (s *SubscribeApi) CreateAccountBlockSubscription(ctx context.Context) (*rpc.Subscription, error)

func (*SubscribeApi) CreateAccountBlockSubscriptionByAddress

func (s *SubscribeApi) CreateAccountBlockSubscriptionByAddress(ctx context.Context, addr types.Address) (*rpc.Subscription, error)

func (*SubscribeApi) CreateSnapshotBlockFilter

func (s *SubscribeApi) CreateSnapshotBlockFilter() (rpc.ID, error)

func (*SubscribeApi) CreateSnapshotBlockSubscription

func (s *SubscribeApi) CreateSnapshotBlockSubscription(ctx context.Context) (*rpc.Subscription, error)

func (*SubscribeApi) CreateUnreceivedBlockFilterByAddress

func (s *SubscribeApi) CreateUnreceivedBlockFilterByAddress(addr types.Address) (rpc.ID, error)

func (*SubscribeApi) CreateUnreceivedBlockSubscriptionByAddress

func (s *SubscribeApi) CreateUnreceivedBlockSubscriptionByAddress(ctx context.Context, addr types.Address) (*rpc.Subscription, error)

func (*SubscribeApi) CreateVmLogFilter

func (s *SubscribeApi) CreateVmLogFilter(param api.VmLogFilterParam) (rpc.ID, error)

func (*SubscribeApi) CreateVmlogSubscription

func (s *SubscribeApi) CreateVmlogSubscription(ctx context.Context, param api.VmLogFilterParam) (*rpc.Subscription, error)

func (*SubscribeApi) GetChangesByFilterId

func (s *SubscribeApi) GetChangesByFilterId(id rpc.ID) (interface{}, error)

func (*SubscribeApi) GetFilterChanges deprecated

func (s *SubscribeApi) GetFilterChanges(id rpc.ID) (interface{}, error)

Deprecated: use subscribe_getChangesByFilterId instead

func (*SubscribeApi) GetLogs deprecated

func (s *SubscribeApi) GetLogs(param RpcFilterParam) ([]*Logs, error)

Deprecated: use ledger_getVmLogsByFilter instead

func (*SubscribeApi) NewAccountBlocks deprecated

func (s *SubscribeApi) NewAccountBlocks(ctx context.Context) (*rpc.Subscription, error)

Deprecated: use subscribe_createAccountBlockSubscription instead

func (*SubscribeApi) NewAccountBlocksByAddr deprecated

func (s *SubscribeApi) NewAccountBlocksByAddr(ctx context.Context, addr types.Address) (*rpc.Subscription, error)

Deprecated: use subscribe_createAccountBlockSubscriptionByAddress instead

func (*SubscribeApi) NewAccountBlocksByAddrFilter deprecated

func (s *SubscribeApi) NewAccountBlocksByAddrFilter(addr types.Address) (rpc.ID, error)

Deprecated: use subscribe_createAccountBlockFilterByAddress instead

func (*SubscribeApi) NewAccountBlocksFilter deprecated

func (s *SubscribeApi) NewAccountBlocksFilter() (rpc.ID, error)

Deprecated: use subscribe_createAccountBlockFilter instead

func (*SubscribeApi) NewLogs

func (s *SubscribeApi) NewLogs(ctx context.Context, param RpcFilterParam) (*rpc.Subscription, error)

Deprevated: use subscribe_createVmLogSubscription instead

func (*SubscribeApi) NewLogsFilter deprecated

func (s *SubscribeApi) NewLogsFilter(param RpcFilterParam) (rpc.ID, error)

Deprecated: use subscribe_createVmLogFilter instead

func (*SubscribeApi) NewOnroadBlocksByAddr deprecated

func (s *SubscribeApi) NewOnroadBlocksByAddr(ctx context.Context, addr types.Address) (*rpc.Subscription, error)

Deprecated: use subscribe_createUnreceivedBlockSubscriptionByAddress instead

func (*SubscribeApi) NewOnroadBlocksByAddrFilter deprecated

func (s *SubscribeApi) NewOnroadBlocksByAddrFilter(addr types.Address) (rpc.ID, error)

Deprecated: use subscribe_createUnreceivedBlockFilterByAddress instead

func (*SubscribeApi) NewSnapshotBlocks deprecated

func (s *SubscribeApi) NewSnapshotBlocks(ctx context.Context) (*rpc.Subscription, error)

Deprecated: use subscribe_createSnapshotBlockSubscription instead

func (*SubscribeApi) NewSnapshotBlocksFilter deprecated

func (s *SubscribeApi) NewSnapshotBlocksFilter() (rpc.ID, error)

Deprecated: use subscribe_createSnapshotBlockFilter instead

func (*SubscribeApi) UninstallFilter

func (s *SubscribeApi) UninstallFilter(id rpc.ID) bool

Jump to

Keyboard shortcuts

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