forked from cerc-io/plugeth
graphql, node, rpc: fix typos in comments (#20824)
This commit is contained in:
parent
d3c1e654f0
commit
d7851e6359
@ -35,7 +35,7 @@ type Service struct {
|
|||||||
cors []string // Allowed CORS domains
|
cors []string // Allowed CORS domains
|
||||||
vhosts []string // Recognised vhosts
|
vhosts []string // Recognised vhosts
|
||||||
timeouts rpc.HTTPTimeouts // Timeout settings for HTTP requests.
|
timeouts rpc.HTTPTimeouts // Timeout settings for HTTP requests.
|
||||||
backend ethapi.Backend // The backend that queries will operate onn.
|
backend ethapi.Backend // The backend that queries will operate on.
|
||||||
handler http.Handler // The `http.Handler` used to answer queries.
|
handler http.Handler // The `http.Handler` used to answer queries.
|
||||||
listener net.Listener // The listening socket.
|
listener net.Listener // The listening socket.
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ func (n *Node) Register(constructor ServiceConstructor) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start create a live P2P node and starts running it.
|
// Start creates a live P2P node and starts running it.
|
||||||
func (n *Node) Start() error {
|
func (n *Node) Start() error {
|
||||||
n.lock.Lock()
|
n.lock.Lock()
|
||||||
defer n.lock.Unlock()
|
defer n.lock.Unlock()
|
||||||
@ -235,7 +235,7 @@ func (n *Node) Start() error {
|
|||||||
// Mark the service started for potential cleanup
|
// Mark the service started for potential cleanup
|
||||||
started = append(started, kind)
|
started = append(started, kind)
|
||||||
}
|
}
|
||||||
// Lastly start the configured RPC interfaces
|
// Lastly, start the configured RPC interfaces
|
||||||
if err := n.startRPC(services); err != nil {
|
if err := n.startRPC(services); err != nil {
|
||||||
for _, service := range services {
|
for _, service := range services {
|
||||||
service.Stop()
|
service.Stop()
|
||||||
@ -274,7 +274,7 @@ func (n *Node) openDataDir() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// startRPC is a helper method to start all the various RPC endpoint during node
|
// startRPC is a helper method to start all the various RPC endpoints during node
|
||||||
// startup. It's not meant to be called at any time afterwards as it makes certain
|
// startup. It's not meant to be called at any time afterwards as it makes certain
|
||||||
// assumptions about the state of the node.
|
// assumptions about the state of the node.
|
||||||
func (n *Node) startRPC(services map[reflect.Type]Service) error {
|
func (n *Node) startRPC(services map[reflect.Type]Service) error {
|
||||||
|
@ -103,7 +103,6 @@ func StartWSEndpoint(endpoint string, apis []API, modules []string, wsOrigins []
|
|||||||
}
|
}
|
||||||
go NewWSServer(wsOrigins, handler).Serve(listener)
|
go NewWSServer(wsOrigins, handler).Serve(listener)
|
||||||
return listener, handler, err
|
return listener, handler, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartIPCEndpoint starts an IPC endpoint.
|
// StartIPCEndpoint starts an IPC endpoint.
|
||||||
|
@ -250,8 +250,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, err.Error(), code)
|
http.Error(w, err.Error(), code)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// All checks passed, create a codec that reads direct from the request body
|
// All checks passed, create a codec that reads directly from the request body
|
||||||
// until EOF, write the response to w, and order the server to process a
|
// until EOF, writes the response to w, and orders the server to process a
|
||||||
// single request.
|
// single request.
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
ctx = context.WithValue(ctx, "remote", r.RemoteAddr)
|
ctx = context.WithValue(ctx, "remote", r.RemoteAddr)
|
||||||
|
@ -153,7 +153,7 @@ func (n *Notifier) takeSubscription() *Subscription {
|
|||||||
return n.sub
|
return n.sub
|
||||||
}
|
}
|
||||||
|
|
||||||
// acticate is called after the subscription ID was sent to client. Notifications are
|
// activate is called after the subscription ID was sent to client. Notifications are
|
||||||
// buffered before activation. This prevents notifications being sent to the client before
|
// buffered before activation. This prevents notifications being sent to the client before
|
||||||
// the subscription ID is sent to the client.
|
// the subscription ID is sent to the client.
|
||||||
func (n *Notifier) activate() error {
|
func (n *Notifier) activate() error {
|
||||||
@ -179,7 +179,7 @@ func (n *Notifier) send(sub *Subscription, data json.RawMessage) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Subscription is created by a notifier and tight to that notifier. The client can use
|
// A Subscription is created by a notifier and tied to that notifier. The client can use
|
||||||
// this subscription to wait for an unsubscribe request for the client, see Err().
|
// this subscription to wait for an unsubscribe request for the client, see Err().
|
||||||
type Subscription struct {
|
type Subscription struct {
|
||||||
ID ID
|
ID ID
|
||||||
|
Loading…
Reference in New Issue
Block a user