adminclient

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeStateStringMap = func(m map[string]NodeState) map[NodeState]string {
	rt := make(map[NodeState]string)
	for k, v := range m {
		rt[v] = k
	}
	return rt
}(StringNodeStateMap)
View Source
var StringNodeStateMap = map[string]NodeState{
	"POW_SUBMISSION":            POW_SUBMISSION,
	"DSBLOCK_CONSENSUS_PREP":    DSBLOCK_CONSENSUS_PREP,
	"DSBLOCK_CONSENSUS":         DSBLOCK_CONSENSUS,
	"MICROBLOCK_SUBMISSION":     MICROBLOCK_SUBMISSION,
	"FINALBLOCK_CONSENSUS_PREP": FINALBLOCK_CONSENSUS_PREP,
	"FINALBLOCK_CONSENSUS":      FINALBLOCK_CONSENSUS,
	"VIEWCHANGE_CONSENSUS_PREP": VIEWCHANGE_CONSENSUS_PREP,
	"VIEWCHANGE_CONSENSUS":      VIEWCHANGE_CONSENSUS,
	"ERROR":                     ERROR,
	"SYNC":                      SYNC,
}
View Source
var UnknownResultType = errors.New("unknown result type")

method names

Functions

func NewAddToBlacklistExclusionReq

func NewAddToBlacklistExclusionReq(ip string) *jsonrpc.Request

func NewDisablePoWReq

func NewDisablePoWReq() *jsonrpc.Request

func NewGetCurrentDSEpochReq

func NewGetCurrentDSEpochReq() *jsonrpc.Request

func NewGetCurrentMiniEpochReq

func NewGetCurrentMiniEpochReq() *jsonrpc.Request

func NewGetDSCommitteeReq

func NewGetDSCommitteeReq() *jsonrpc.Request

func NewGetNodeStateReq

func NewGetNodeStateReq() *jsonrpc.Request

func NewGetNodeTypeReq

func NewGetNodeTypeReq() *jsonrpc.Request

func NewGetPrevDSDifficultyReq

func NewGetPrevDSDifficultyReq() *jsonrpc.Request

func NewGetPrevDifficultyReq

func NewGetPrevDifficultyReq() *jsonrpc.Request

func NewGetSendSCCallsToDSReq

func NewGetSendSCCallsToDSReq() *jsonrpc.Request

func NewIsTxnInMemPoolReq

func NewIsTxnInMemPoolReq(txn string) *jsonrpc.Request

func NewRemoveFromBlacklistExclusionReq

func NewRemoveFromBlacklistExclusionReq(ip string) *jsonrpc.Request

func NewReq

func NewReq(method MethodName, params interface{}) *jsonrpc.Request

func NewToggleDisableTxnsReq

func NewToggleDisableTxnsReq() *jsonrpc.Request

func NewToggleSendSCCallsToDSReq

func NewToggleSendSCCallsToDSReq() *jsonrpc.Request

Types

type Client

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

func New

func New(addr string, timeout time.Duration) *Client

func (*Client) CallBatch

func (c *Client) CallBatch(req ...*jsonrpc.Request) ([]*jsonrpc.Response, error)

func (*Client) CallBatchContext

func (c *Client) CallBatchContext(ctx context.Context, req ...*jsonrpc.Request) ([]*jsonrpc.Response, error)

func (*Client) GetCurrentDSEpoch

func (c *Client) GetCurrentDSEpoch() (int64, error)

func (*Client) GetCurrentDSEpochContext

func (c *Client) GetCurrentDSEpochContext(ctx context.Context) (int64, error)

func (*Client) GetCurrentMiniEpoch

func (c *Client) GetCurrentMiniEpoch() (int64, error)

func (*Client) GetCurrentMiniEpochContext

func (c *Client) GetCurrentMiniEpochContext(ctx context.Context) (int64, error)

func (*Client) GetNodeState

func (c *Client) GetNodeState() (NodeState, error)

func (*Client) GetNodeStateContext

func (c *Client) GetNodeStateContext(ctx context.Context) (NodeState, error)

func (*Client) GetNodeType

func (c *Client) GetNodeType() (NodeType, error)

func (*Client) GetNodeTypeContext

func (c *Client) GetNodeTypeContext(ctx context.Context) (NodeType, error)

func (*Client) GetPrevDSDifficulty

func (c *Client) GetPrevDSDifficulty() (int64, error)

func (*Client) GetPrevDSDifficultyContext

func (c *Client) GetPrevDSDifficultyContext(ctx context.Context) (int64, error)

func (*Client) GetPrevDifficulty

func (c *Client) GetPrevDifficulty() (int64, error)

func (*Client) GetPrevDifficultyContext

func (c *Client) GetPrevDifficultyContext(ctx context.Context) (int64, error)

type MethodName

type MethodName string
const (
	GetCurrentMiniEpoch MethodName = "GetCurrentMiniEpoch"
	GetCurrentDSEpoch   MethodName = "GetCurrentDSEpoch"
	GetNodeType         MethodName = "GetNodeType"
	GetDSCommittee      MethodName = "GetDSCommittee"
	GetNodeState        MethodName = "GetNodeState"
	GetPrevDifficulty   MethodName = "GetPrevDifficulty"
	GetPrevDSDifficulty MethodName = "GetPrevDSDifficulty"
	GetSendSCCallsToDS  MethodName = "GetSendSCCallsToDS"

	IsTxnInMemPool MethodName = "IsTxnInMemPool"

	AddToBlacklistExclusion      MethodName = "AddToBlacklistExclusion"
	RemoveFromBlacklistExclusion MethodName = "RemoveFromBlacklistExclusion"
	ToggleSendSCCallsToDS        MethodName = "ToggleSendSCCallsToDS"
	DisablePoW                   MethodName = "DisablePoW"
	ToggleDisableTxns            MethodName = "ToggleDisableTxns"
)

type NodeState

type NodeState int
const (
	POW_SUBMISSION NodeState = iota
	DSBLOCK_CONSENSUS_PREP
	DSBLOCK_CONSENSUS
	MICROBLOCK_SUBMISSION
	FINALBLOCK_CONSENSUS_PREP
	FINALBLOCK_CONSENSUS
	VIEWCHANGE_CONSENSUS_PREP
	VIEWCHANGE_CONSENSUS
	ERROR
	SYNC
)

func (NodeState) String

func (n NodeState) String() string

func (*NodeState) UnmarshalJSON

func (n *NodeState) UnmarshalJSON(data []byte) error

type NodeType

type NodeType struct {
	Type      NodeTypeName
	ShardId   int
	TillEpoch int
}

func (NodeType) String

func (n NodeType) String() string

func (*NodeType) UnmarshalJSON

func (n *NodeType) UnmarshalJSON(data []byte) error

type NodeTypeName

type NodeTypeName int
const (
	NotInNetwork NodeTypeName = iota
	Seed
	Lookup
	DSNode
	ShardNode
)

func (NodeTypeName) String

func (n NodeTypeName) String() string

Jump to

Keyboard shortcuts

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