subscription

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2020 ChainSafe Systems (ON) Corp. This file is part of gossamer.

The gossamer library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The gossamer library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the gossamer library. If not, see <http://www.gnu.org/licenses/>.

Copyright 2020 ChainSafe Systems (ON) Corp. This file is part of gossamer.

The gossamer library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The gossamer library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the gossamer library. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const AuthorExtrinsicUpdates = "author_extrinsicUpdate"

AuthorExtrinsicUpdates method name

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponseJSON

type BaseResponseJSON struct {
	Jsonrpc string `json:"jsonrpc"`
	Method  string `json:"method"`
	Params  Params `json:"params"`
}

BaseResponseJSON for base json response

type BlockFinalizedListener

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

BlockFinalizedListener to handle listening for finalized blocks

func (*BlockFinalizedListener) Listen

func (l *BlockFinalizedListener) Listen()

Listen implementation of Listen interface to listen for importedChan changes

type BlockListener

type BlockListener struct {
	Channel chan *types.Block

	ChanID byte
	// contains filtered or unexported fields
}

BlockListener to handle listening for blocks importedChan

func (*BlockListener) Listen

func (l *BlockListener) Listen()

Listen implementation of Listen interface to listen for importedChan changes

type ErrorMessageJSON

type ErrorMessageJSON struct {
	Code    *big.Int `json:"code"`
	Message string   `json:"message"`
}

ErrorMessageJSON json for error messages

type ErrorResponseJSON

type ErrorResponseJSON struct {
	Jsonrpc string            `json:"jsonrpc"`
	Error   *ErrorMessageJSON `json:"error"`
	ID      float64           `json:"id"`
}

ErrorResponseJSON json for error responses

type ExtrinsicSubmitListener

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

ExtrinsicSubmitListener to handle listening for extrinsic events

func (*ExtrinsicSubmitListener) Listen

func (l *ExtrinsicSubmitListener) Listen()

Listen implementation of Listen interface to listen for importedChan changes

type Listener

type Listener interface {
	Listen()
}

Listener interface for functions that define Listener related functions

type Params

type Params struct {
	Result         interface{} `json:"result"`
	SubscriptionID int         `json:"subscription"`
}

Params for json param response

type ResponseJSON

type ResponseJSON struct {
	Jsonrpc string  `json:"jsonrpc"`
	Result  int     `json:"result"`
	ID      float64 `json:"id"`
}

ResponseJSON for json subscription responses

type RuntimeVersionListener

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

RuntimeVersionListener to handle listening for Runtime Version

func (*RuntimeVersionListener) Listen

func (l *RuntimeVersionListener) Listen()

Listen implementation of Listen interface to listen for runtime version changes

type StorageChangeListener

type StorageChangeListener struct {
	Channel chan *state.SubscriptionResult

	ChanID byte
	// contains filtered or unexported fields
}

StorageChangeListener for listening to state change channels

func (*StorageChangeListener) Listen

func (l *StorageChangeListener) Listen()

Listen implementation of Listen interface to listen for importedChan changes

type WSConn

type WSConn struct {
	Wsconn *websocket.Conn

	BlockSubChannels   map[int]byte
	StorageSubChannels map[int]byte

	Subscriptions map[int]Listener
	StorageAPI    modules.StorageAPI
	BlockAPI      modules.BlockAPI
	RuntimeAPI    modules.RuntimeAPI
	CoreAPI       modules.CoreAPI
	TxStateAPI    modules.TransactionStateAPI
	RPCHost       string
	// contains filtered or unexported fields
}

WSConn struct to hold WebSocket Connection references

func (*WSConn) HandleComm

func (c *WSConn) HandleComm()

HandleComm handles messages received on websocket connections

Jump to

Keyboard shortcuts

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