-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package metrics | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/skip-mev/connect/v2/oracle/config" | ||
slinkygrpc "github.com/skip-mev/connect/v2/pkg/grpc" | ||
"google.golang.org/grpc" | ||
"google.golang.org/grpc/credentials/insecure" | ||
|
||
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" | ||
Check warning on line 13 in oracle/metrics/node.go GitHub Actions / Spell checking
|
||
) | ||
|
||
type NodeClient struct { | ||
conn *grpc.ClientConn | ||
} | ||
|
||
func NewNodeClient(endpoint config.Endpoint) (*NodeClient, error) { | ||
conn, err := slinkygrpc.NewClient( | ||
endpoint.URL, | ||
grpc.WithTransportCredentials(insecure.NewCredentials()), | ||
grpc.WithNoProxy(), | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &NodeClient{ | ||
conn, | ||
}, nil | ||
} | ||
|
||
func (nc *NodeClient) DeriveNodeIdentifier() (string, error) { | ||
svcclient := cmtservice.NewServiceClient(nc.conn) | ||
Check warning on line 36 in oracle/metrics/node.go GitHub Actions / Spell checking
Check warning on line 36 in oracle/metrics/node.go GitHub Actions / Spell checking
Check warning on line 36 in oracle/metrics/node.go GitHub Actions / Spell checking
Check warning on line 36 in oracle/metrics/node.go GitHub Actions / Spell checking
|
||
|
||
info, err := svcclient.GetNodeInfo(context.Background(), &cmtservice.GetNodeInfoRequest{}) | ||
Check warning on line 38 in oracle/metrics/node.go GitHub Actions / Spell checking
Check warning on line 38 in oracle/metrics/node.go GitHub Actions / Spell checking
Check warning on line 38 in oracle/metrics/node.go GitHub Actions / Spell checking
Check warning on line 38 in oracle/metrics/node.go GitHub Actions / Spell checking
|
||
|
||
if err != nil { | ||
return "", err | ||
} | ||
|
||
moniker := strings.ReplaceAll(info.DefaultNodeInfo.Moniker, " ", "-") | ||
network := info.DefaultNodeInfo.Network | ||
|
||
identifier := fmt.Sprintf("%s_%s", network, moniker) | ||
|
||
return identifier, nil | ||
} |
c62c2d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@check-spelling-bot Report
🔴 Please review
See the 📜action log or 📝 job summary for details.
Unrecognized words (2)
cmtservice
svcclient
These words are not needed and should be removed
goautoneg munnerz promqlTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands
... in a clone of the [email protected]:skip-mev/connect.git repository
on the
wesl-ee/namespace-published-metrics
branch (ℹ️ how do I use this?):Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary
This includes both expected items (814) from .github/actions/spelling/expect.txt and unrecognized words (2)
Consider adding them (in
.github/workflows/spell.yml
) injobs:
/build:
toextra_dictionaries
:To stop checking additional dictionaries, add (in
.github/workflows/spell.yml
):Warnings (1)
See the 📜action log or 📝 job summary for details.
See⚠️ Event descriptions for more information.
If the flagged items are 🤯 false positives
If items relate to a ...
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txt
file matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^
refers to the file's path from the root of the repository, so^README\.md$
would exclude README.md (on whichever branch you're using).well-formed pattern.
If you can write a pattern that would match it,
try adding it to the
patterns.txt
file.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
🚂 If you're seeing this message and your PR is from a branch that doesn't have check-spelling,
please merge to your PR's base branch to get the version configured for your repository.