Documentation ¶
Index ¶
- Variables
- type Argument
- func (arg *Argument) Float32(index int) (float32, error)
- func (arg *Argument) Float64(index int) (float64, error)
- func (arg *Argument) Int(index int) (int, error)
- func (arg *Argument) Len() int
- func (arg *Argument) String(index int) (string, error)
- func (arg *Argument) Uint16(index int) (uint16, error)
- func (arg *Argument) Uint32(index int) (uint32, error)
- func (arg *Argument) Uint64(index int) (uint64, error)
- func (arg *Argument) Uint8(index int) (uint8, error)
- type EventNotify
- type Handler
- type JRPCRequest
- type JRPCResponse
- type Manager
- func (rm *Manager) Add(Method string, fn Handler)
- func (rm *Manager) AfterProcessBlock(kn *kernel.Kernel, b *block.Block, s *block.ObserverSigned, ctx *data.Context)
- func (rm *Manager) AfterPushTransaction(kn *kernel.Kernel, tx transaction.Transaction, sigs []common.Signature)
- func (rm *Manager) Close()
- func (rm *Manager) DebugLog(kn *kernel.Kernel, args ...interface{})
- func (rm *Manager) DoTransactionBroadcast(kn *kernel.Kernel, msg *message_def.TransactionMessage)
- func (rm *Manager) OnProcessBlock(kn *kernel.Kernel, b *block.Block, s *block.ObserverSigned, ctx *data.Context) error
- func (rm *Manager) OnPushTransaction(kn *kernel.Kernel, tx transaction.Transaction, sigs []common.Signature) error
- func (rm *Manager) Run(kn *kernel.Kernel, Bind string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidArgument = errors.New("invalid argument") ErrInvalidArgumentIndex = errors.New("invalid argument index") ErrInvalidArgumentType = errors.New("invalid argument type") ErrInvalidMethod = errors.New("invalid method") )
errors
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument struct {
// contains filtered or unexported fields
}
Argument parses rpc arguments
type EventNotify ¶
type EventNotify struct { Type string `json:"type"` Timestamp int64 `json:"timestamp"` Data map[string]interface{} `json:"data"` }
EventNotify is a notification of events
type JRPCRequest ¶
type JRPCRequest struct { JSONRPC string `json:"jsonrpc"` ID interface{} `json:"id"` Method string `json:"method"` Params []*json.Number `json:"params"` }
JRPCRequest is a jrpc request
type JRPCResponse ¶
type JRPCResponse struct { JSONRPC string `json:"jsonrpc"` ID interface{} `json:"id"` Result interface{} `json:"result"` Error interface{} `json:"error"` }
JRPCResponse is a jrpc response
type Manager ¶
Manager provides a rpc server
func (*Manager) AfterProcessBlock ¶
func (rm *Manager) AfterProcessBlock(kn *kernel.Kernel, b *block.Block, s *block.ObserverSigned, ctx *data.Context)
AfterProcessBlock called when processed block to the chain
func (*Manager) AfterPushTransaction ¶
func (rm *Manager) AfterPushTransaction(kn *kernel.Kernel, tx transaction.Transaction, sigs []common.Signature)
AfterPushTransaction called when pushed a transaction to the transaction pool
func (*Manager) DoTransactionBroadcast ¶
func (rm *Manager) DoTransactionBroadcast(kn *kernel.Kernel, msg *message_def.TransactionMessage)
DoTransactionBroadcast called when a transaction need to be broadcast
func (*Manager) OnProcessBlock ¶
func (rm *Manager) OnProcessBlock(kn *kernel.Kernel, b *block.Block, s *block.ObserverSigned, ctx *data.Context) error
OnProcessBlock called when processing a block to the chain (error prevent processing block)
func (*Manager) OnPushTransaction ¶
func (rm *Manager) OnPushTransaction(kn *kernel.Kernel, tx transaction.Transaction, sigs []common.Signature) error
OnPushTransaction called when pushing a transaction to the transaction pool (error prevent push transaction)
Click to show internal directories.
Click to hide internal directories.