From 3f833bd9d3d367bdbe888fe3d2f1d9ef7b9acc73 Mon Sep 17 00:00:00 2001 From: Otto V Date: Wed, 6 Apr 2022 11:35:07 -0400 Subject: [PATCH] fixing minor typo, pr comments, updating rpc-spec.yaml, creating service metrics on error from hot reload --- app/cmd/cli/node.go | 2 +- doc/guides/quickstart.md | 6 +-- doc/specs/rpc-spec.yaml | 85 +++++++++++++++++++++++++++++++++++ x/pocketcore/types/metrics.go | 7 +++ 4 files changed, 96 insertions(+), 4 deletions(-) diff --git a/app/cmd/cli/node.go b/app/cmd/cli/node.go index 00df008a7..4f28775e2 100644 --- a/app/cmd/cli/node.go +++ b/app/cmd/cli/node.go @@ -46,7 +46,7 @@ If no changes are desired for the parameter, just enter the current param value Args: cobra.ExactArgs(6), Run: func(cmd *cobra.Command, args []string) { fmt.Println("### Warning ###") - fmt.Println("Using Legacy Command , this will not work after RC 0.8.0 upgrade is activated.") + fmt.Println("Using Legacy Command, this will not work after RC 0.8.0 upgrade is activated.") app.InitConfig(datadir, tmNode, persistentPeers, seeds, remoteCLIURL) fromAddr := args[0] amount, err := strconv.Atoi(args[1]) diff --git a/doc/guides/quickstart.md b/doc/guides/quickstart.md index 7afca08e5..65ffd2905 100644 --- a/doc/guides/quickstart.md +++ b/doc/guides/quickstart.md @@ -35,7 +35,7 @@ git checkout tags/ Example: ```text -git checkout tags/RC-0.6.3 +git checkout tags/RC-0.8.0 ``` #### Build @@ -61,7 +61,7 @@ pocket version {% tab title="Response" %} ``` -> RC 0.6.3 +> RC 0.8.0 ``` {% endtab %} {% endtabs %} @@ -83,7 +83,7 @@ pocket version {% tab title="Response" %} ``` -> RC-0.6.3 +> RC-0.8.0 ``` {% endtab %} {% endtabs %} diff --git a/doc/specs/rpc-spec.yaml b/doc/specs/rpc-spec.yaml index f90dcef7c..7a4849261 100644 --- a/doc/specs/rpc-spec.yaml +++ b/doc/specs/rpc-spec.yaml @@ -1285,8 +1285,93 @@ paths: message: type: string description: The error msg. + /private/chains: + post: + tags: + - private + parameters: + - in: query + name: authtoken + schema: + type: string + description: Current Authorization Token from pocket core. + responses: + '200': + description: Return the Current Hosted Chains map + content: + application/json: + schema: + type: object + additionalProperties: true + + '401': + description: Wrong Authtoken + content: + application/json: + schema: + type: object + properties: + code: + type: integer + description: The error code. + message: + type: string + description: The error msg. + /private/updatechains: + post: + tags: + - private + parameters: + - in: query + name: authtoken + schema: + type: string + description: Current Authorization Token from pocket core. + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chain' + required: true + responses: + '200': + description: Return the Current Hosted Chains map + content: + application/json: + schema: + type: object + additionalProperties: true + '401': + description: Wrong Authtoken + content: + application/json: + schema: + type: object + properties: + code: + type: integer + description: The error code. + message: + type: string + description: The error msg. components: schemas: + Chain: + type: object + properties: + id: + type: string + url: + type: string + basic_auth: + type: object + properties: + username: + type: string + password: + type: string ABCIEvent: type: object properties: diff --git a/x/pocketcore/types/metrics.go b/x/pocketcore/types/metrics.go index f0760ff0f..dbc5b6e4c 100644 --- a/x/pocketcore/types/metrics.go +++ b/x/pocketcore/types/metrics.go @@ -92,6 +92,7 @@ func (sm *ServiceMetrics) AddRelayFor(networkID string) { nnc, ok := sm.NonNativeChains[networkID] if !ok { sm.tmLogger.Error("unable to find corresponding networkID in service metrics: ", networkID) + sm.NonNativeChains[networkID] = NewServiceMetricsFor(networkID) return } // add relay to accumulated count @@ -109,6 +110,7 @@ func (sm *ServiceMetrics) AddChallengeFor(networkID string) { nnc, ok := sm.NonNativeChains[networkID] if !ok { sm.tmLogger.Error("unable to find corresponding networkID in service metrics: ", networkID) + sm.NonNativeChains[networkID] = NewServiceMetricsFor(networkID) return } // add to accumulated count @@ -126,6 +128,7 @@ func (sm *ServiceMetrics) AddErrorFor(networkID string) { nnc, ok := sm.NonNativeChains[networkID] if !ok { sm.tmLogger.Error("unable to find corresponding networkID in service metrics: ", networkID) + sm.NonNativeChains[networkID] = NewServiceMetricsFor(networkID) return } // add to accumulated count @@ -143,6 +146,7 @@ func (sm *ServiceMetrics) AddRelayTimingFor(networkID string, relayTime float64) nnc, ok := sm.NonNativeChains[networkID] if !ok { sm.tmLogger.Error("unable to find corresponding networkID in service metrics: ", networkID) + sm.NonNativeChains[networkID] = NewServiceMetricsFor(networkID) return } // add to accumulated hist @@ -160,6 +164,8 @@ func (sm *ServiceMetrics) AddSessionFor(networkID string) { nnc, ok := sm.NonNativeChains[networkID] if !ok { sm.tmLogger.Error("unable to find corresponding networkID in service metrics: ", networkID) + sm.NonNativeChains[networkID] = NewServiceMetricsFor(networkID) + return } // add to accumulated count @@ -177,6 +183,7 @@ func (sm *ServiceMetrics) AddUPOKTEarnedFor(networkID string, upoktEarned float6 nnc, ok := sm.NonNativeChains[networkID] if !ok { sm.tmLogger.Error("unable to find corresponding networkID in service metrics: ", networkID) + sm.NonNativeChains[networkID] = NewServiceMetricsFor(networkID) return } // add to accumulated count