From 0ee8a31c9464fb24b5cf0bc4aa8b296d6412f837 Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Fri, 28 Feb 2020 13:57:12 +0100 Subject: [PATCH 1/7] errors in comments for http.go --- rpc/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/http.go b/rpc/http.go index 0de127c80809..10d388d9ca98 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -251,7 +251,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } // All checks passed, create a codec that reads direct from the request body - // untilEOF and writes the response to w and order the server to process a + // until EOF, writes the response to w and order the server to process a // single request. ctx := r.Context() ctx = context.WithValue(ctx, "remote", r.RemoteAddr) @@ -338,7 +338,7 @@ func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - // Not an ip address, but a hostname. Need to validate + // Not an IP address, but a hostname. Need to validate if _, exist := h.vhosts["*"]; exist { h.next.ServeHTTP(w, r) return From b8aaf2441022914338ca48784b33bd54de33439a Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Fri, 28 Feb 2020 13:58:41 +0100 Subject: [PATCH 2/7] consistency --- rpc/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/http.go b/rpc/http.go index 10d388d9ca98..40810c7b448e 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -251,7 +251,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } // All checks passed, create a codec that reads direct from the request body - // until EOF, writes the response to w and order the server to process a + // until EOF, write the response to w, and order the server to process a // single request. ctx := r.Context() ctx = context.WithValue(ctx, "remote", r.RemoteAddr) From 8911212a2cfcca74b3bb64d8e45e591551961cc7 Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Sun, 1 Mar 2020 16:35:44 +0100 Subject: [PATCH 3/7] correcting typos in documentation for subscription.go --- rpc/subscription.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/subscription.go b/rpc/subscription.go index 8992bfc5e19a..f9d60dcb984b 100644 --- a/rpc/subscription.go +++ b/rpc/subscription.go @@ -153,7 +153,7 @@ func (n *Notifier) takeSubscription() *Subscription { 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 // the subscription ID is sent to the client. 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(). type Subscription struct { ID ID From a01770babd10ffd7c48f35ce20a29a56a3082a0e Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Mon, 23 Mar 2020 12:16:45 +0100 Subject: [PATCH 4/7] node.go --- node/api.go | 2 +- node/node.go | 8 ++++---- rpc/endpoints.go | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/node/api.go b/node/api.go index 66cd1dde3354..60e207932dc9 100644 --- a/node/api.go +++ b/node/api.go @@ -232,7 +232,7 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *int, allowedOrigins *str } } - modules := api.node.config.WSModules + modules := api.node.config.WSModxules if apis != nil { modules = nil for _, m := range strings.Split(*apis, ",") { diff --git a/node/node.go b/node/node.go index 1bdd5af7d2f1..cfa6234f6627 100644 --- a/node/node.go +++ b/node/node.go @@ -158,7 +158,7 @@ func (n *Node) Register(constructor ServiceConstructor) error { 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 { n.lock.Lock() defer n.lock.Unlock() @@ -235,7 +235,7 @@ func (n *Node) Start() error { // Mark the service started for potential cleanup started = append(started, kind) } - // Lastly start the configured RPC interfaces + // Lastly, start the configured RPC interfaces if err := n.startRPC(services); err != nil { for _, service := range services { service.Stop() @@ -274,8 +274,8 @@ func (n *Node) openDataDir() error { return nil } -// startRPC is a helper method to start all the various RPC endpoint during node -// startup. It's not meant to be called at any time afterwards as it makes certain +// 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 // assumptions about the state of the node. func (n *Node) startRPC(services map[reflect.Type]Service) error { // Gather all the possible APIs to surface diff --git a/rpc/endpoints.go b/rpc/endpoints.go index ed295adfc0d3..1f473be6ba50 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -102,7 +102,6 @@ func StartWSEndpoint(endpoint string, apis []API, modules []string, wsOrigins [] } go NewWSServer(wsOrigins, handler).Serve(listener) return listener, handler, err - } // StartIPCEndpoint starts an IPC endpoint. From 9be013cf7448a8cd4170a88c87c054725bafddb9 Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Fri, 28 Feb 2020 13:57:12 +0100 Subject: [PATCH 5/7] cleaned up comment in http.go --- rpc/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/http.go b/rpc/http.go index 40810c7b448e..1cf6d903937f 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -250,8 +250,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), code) return } - // All checks passed, create a codec that reads direct from the request body - // until EOF, write the response to w, and order the server to process a + // All checks passed, create a codec that reads directly from the request body + // until EOF, writes the response to w, and orders the server to process a // single request. ctx := r.Context() ctx = context.WithValue(ctx, "remote", r.RemoteAddr) From f21e840586ab3a8f573fb4b9dccbecee4bd55d47 Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Fri, 27 Mar 2020 09:28:12 +0100 Subject: [PATCH 6/7] fixed a typo in graphql service --- graphql/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql/service.go b/graphql/service.go index f64075680634..21892402db41 100644 --- a/graphql/service.go +++ b/graphql/service.go @@ -35,7 +35,7 @@ type Service struct { cors []string // Allowed CORS domains vhosts []string // Recognised vhosts 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. listener net.Listener // The listening socket. } From 74cd5de7f19c2c017d436921e42238ac61a140f1 Mon Sep 17 00:00:00 2001 From: renaynay <41963722+renaynay@users.noreply.github.com> Date: Fri, 27 Mar 2020 09:58:02 +0100 Subject: [PATCH 7/7] fixed typos in my own changes --- node/api.go | 2 +- node/node.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node/api.go b/node/api.go index 60e207932dc9..66cd1dde3354 100644 --- a/node/api.go +++ b/node/api.go @@ -232,7 +232,7 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *int, allowedOrigins *str } } - modules := api.node.config.WSModxules + modules := api.node.config.WSModules if apis != nil { modules = nil for _, m := range strings.Split(*apis, ",") { diff --git a/node/node.go b/node/node.go index c49a3448a8e0..39e15e0a7473 100644 --- a/node/node.go +++ b/node/node.go @@ -275,7 +275,7 @@ func (n *Node) openDataDir() error { } // 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. func (n *Node) startRPC(services map[reflect.Type]Service) error { // Gather all the possible APIs to surface