Skip to content

Commit

Permalink
fixing minor typo, pr comments, updating rpc-spec.yaml, creating serv…
Browse files Browse the repository at this point in the history
…ice metrics on error from hot reload
  • Loading branch information
Otto V authored and oten91 committed Apr 6, 2022
1 parent a762dc1 commit 3f833bd
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/cmd/cli/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
6 changes: 3 additions & 3 deletions doc/guides/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ git checkout tags/<release tag>
Example:

```text
git checkout tags/RC-0.6.3
git checkout tags/RC-0.8.0
```

#### Build
Expand All @@ -61,7 +61,7 @@ pocket version

{% tab title="Response" %}
```
> RC 0.6.3
> RC 0.8.0
```
{% endtab %}
{% endtabs %}
Expand All @@ -83,7 +83,7 @@ pocket version

{% tab title="Response" %}
```
> RC-0.6.3
> RC-0.8.0
```
{% endtab %}
{% endtabs %}
Expand Down
85 changes: 85 additions & 0 deletions doc/specs/rpc-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions x/pocketcore/types/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3f833bd

Please sign in to comment.