Documentation ¶
Index ¶
- Variables
- type APIServer
- func (s *APIServer) Init(pm types.ProcessManager, cn types.Provider) error
- func (s *APIServer) JRPC(SubName string) (*JRPCSub, error)
- func (s *APIServer) Name() string
- func (s *APIServer) OnBlockConnected(b *types.Block, events []types.Event, loader types.Loader)
- func (s *APIServer) OnLoadChain(loader types.Loader) error
- func (s *APIServer) OnTransactionInPoolExpired(txs []types.Transaction)
- func (s *APIServer) Run(BindAddress string) error
- 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 Handler
- type JRPCRequest
- type JRPCResponse
- type JRPCSub
- type ReqData
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") ErrExistSubName = errors.New("exist sub name") )
errors
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct { types.ServiceBase sync.Mutex // contains filtered or unexported fields }
APIServer provides json rpc and web service for the chain
func (*APIServer) OnBlockConnected ¶
OnBlockConnected called when a block is connected to the chain
func (*APIServer) OnLoadChain ¶
OnLoadChain called when the chain loaded
func (*APIServer) OnTransactionInPoolExpired ¶
func (s *APIServer) OnTransactionInPoolExpired(txs []types.Transaction)
OnLoadChain called when the chain loaded
type Argument ¶
type Argument struct {
// contains filtered or unexported fields
}
Argument parses rpc arguments
type JRPCRequest ¶
type JRPCRequest struct { JSONRPC string `json:"jsonrpc"` ID interface{} `json:"id"` Method string `json:"method"` Params []interface{} `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
Click to show internal directories.
Click to hide internal directories.