Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClientQuit = errors.New("client quit")
ErrClientQuit describes the error where a client send is not processed due to the client having already been disconnected or dropped.
var ( // ErrRPCUnimplemented is an error returned to RPC clients when the // provided command is recognized, but not implemented. ErrRPCUnimplemented = &btcjson.RPCError{ Code: btcjson.ErrRPCUnimplemented, Message: "Command unimplemented", } )
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides a concurrent safe RPC server to a chain server.
func NewRPCServer ¶
func NewRPCServer( startupTime int64, p2pServer *p2p.Server, db database.DB, blockTemplateGenerator *mining.BlkTmplGenerator, cpuminer *cpuminer.CPUMiner, ) (*Server, error)
NewRPCServer returns a new instance of the rpcServer struct.
func (*Server) NotifyNewTransactions ¶
NotifyNewTransactions notifies both websocket and getBlockTemplate long poll clients of the passed transactions. This function should be called whenever new transactions are added to the mempool.
func (*Server) RequestedProcessShutdown ¶
func (s *Server) RequestedProcessShutdown() <-chan struct{}
RequestedProcessShutdown returns a channel that is sent to when an authorized RPC client requests the process to shutdown. If the request can not be read immediately, it is dropped.
func (*Server) Start ¶
func (s *Server) Start()
Start is used by server.go to start the rpc listener.
func (*Server) WebsocketHandler ¶
func (s *Server) WebsocketHandler(conn *websocket.Conn, remoteAddr string, authenticated bool, isAdmin bool)
WebsocketHandler handles a new websocket client by creating a new wsClient, starting it, and blocking until the connection closes. Since it blocks, it must be run in a separate goroutine. It should be invoked from the websocket server handler which runs each new connection in a new goroutine thereby satisfying the requirement.
Source Files ¶
- common.go
- handle_add_manual_node.go
- handle_create_raw_transaction.go
- handle_debug_level.go
- handle_decode_raw_transaction.go
- handle_decode_script.go
- handle_generate.go
- handle_get_all_manual_nodes_info.go
- handle_get_best_block.go
- handle_get_best_block_hash.go
- handle_get_block.go
- handle_get_block_count.go
- handle_get_block_dag_info.go
- handle_get_block_header.go
- handle_get_block_template.go
- handle_get_blocks.go
- handle_get_cf_filter.go
- handle_get_cf_filter_header.go
- handle_get_chain_from_block.go
- handle_get_connection_count.go
- handle_get_current_net.go
- handle_get_difficulty.go
- handle_get_generate.go
- handle_get_hashes_per_sec.go
- handle_get_headers.go
- handle_get_info.go
- handle_get_manual_node_info.go
- handle_get_mempool_info.go
- handle_get_mining_info.go
- handle_get_net_totals.go
- handle_get_network_hash_ps.go
- handle_get_peer_info.go
- handle_get_raw_mempool.go
- handle_get_raw_transaction.go
- handle_get_subnetwork.go
- handle_get_top_headers.go
- handle_get_tx_out.go
- handle_help.go
- handle_load_tx_filter.go
- handle_node.go
- handle_notify_blocks.go
- handle_notify_chain_changes.go
- handle_notify_new_transactions.go
- handle_ping.go
- handle_remove_manual_node.go
- handle_rescan_block_filter.go
- handle_rescan_blocks.go
- handle_search_raw_transactions.go
- handle_send_raw_transaction.go
- handle_session.go
- handle_set_generate.go
- handle_stop.go
- handle_stop_notify_blocks.go
- handle_stop_notify_chain_changes.go
- handle_stop_notify_new_transactions.go
- handle_submit_block.go
- handle_uptime.go
- handle_validate_address.go
- handle_verify_message.go
- handle_version.go
- handle_websocket_help.go
- log.go
- rpcadapters.go
- rpcserver.go
- rpcserverhelp.go
- rpcwebsocket.go