chore: add tooling and docs for hubl (#14743)

Co-authored-by: Aaron Craelius <aaron@regen.network>
This commit is contained in:
Julien Robert
2023-01-23 22:12:22 +01:00
committed by GitHub
co-authored by Aaron Craelius
parent 14c965920f
commit 98888e4ee7
18 changed files with 224 additions and 16 deletions
+21 -7
View File
@@ -58,13 +58,6 @@ updates:
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/cosmovisor"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/depinject"
schedule:
@@ -100,6 +93,13 @@ updates:
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/cosmovisor"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/rosetta"
schedule:
@@ -107,6 +107,20 @@ updates:
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/confix"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/hubl"
schedule:
interval: weekly
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/collections"
schedule:
+2
View File
@@ -50,6 +50,8 @@
- tools/rosetta/**/*
"C:Confix":
- tools/confix/**/*
"C:Hubl":
- tools/hubl/**/*
"C:Keys":
- client/keys/**/*
"Type: Build":
+3
View File
@@ -56,3 +56,6 @@ jobs:
- name: Build Confix
if: env.GIT_DIFF
run: GOARCH=${{ matrix.go-arch }} make confix
- name: Build Hubl
if: env.GIT_DIFF
run: GOARCH=${{ matrix.go-arch }} make hubl
+30
View File
@@ -552,6 +552,36 @@ jobs:
with:
projectBaseDir: tools/confix/
test-hubl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.4
cache: true
cache-dependency-path: tools/hubl/go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
tools/hubl/**/*.go
tools/hubl/go.mod
tools/hubl/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd tools/hubl
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
if: env.GIT_DIFF
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tools/hubl/
#############################
### Cosmos SDK x/{module} ###
#############################
+3
View File
@@ -143,6 +143,9 @@ rosetta:
confix:
$(MAKE) -C tools/confix confix
hubl:
$(MAKE) -C tools/hubl hubl
.PHONY: build build-linux-amd64 build-linux-arm64 cosmovisor rosetta confix
+1
View File
@@ -16,6 +16,7 @@ docs/docs/architecture
docs/docs/tooling/01-cosmovisor.md
docs/docs/tooling/02-depinject.md
docs/docs/tooling/03-confix.md
docs/docs/tooling/04-hubl.md
docs/run-node/04-rosetta.md
# Misc
+1
View File
@@ -10,3 +10,4 @@ This section provides documentation on various tooling used in development of a
* [Cosmovisor](./01-cosmovisor.md)
* [Depinject](./02-depinject.md)
* [Confix](./03-confix.md)
* [Hubl](./04-hubl.md)
+1
View File
@@ -4,6 +4,7 @@ find docs/modules ! -name '_category_.json' -type f -exec rm -rf {} +
rm -rf docs/tooling/01-cosmovisor.md
rm -rf docs/tooling/02-depinject.md
rm -rf docs/tooling/03-confix.md
rm -rf docs/tooling/04-hubl.md
rm -rf docs/run-node/04-rosetta.md
rm -rf docs/architecture
rm -rf docs/spec
+2 -1
View File
@@ -19,8 +19,9 @@ cat ../x/README.md | sed 's/\.\.\/docs\/building-modules\/README\.md/\/building-
## Add tooling documentation
cp ../tools/cosmovisor/README.md ./docs/tooling/01-cosmovisor.md
cp ../tools/confix/README.md ./docs/tooling/03-confix.md
cp ../depinject/README.md ./docs/tooling/02-depinject.md
cp ../tools/confix/README.md ./docs/tooling/03-confix.md
cp ../tools/hubl/README.md ./docs/tooling/04-hubl.md
## Add rosetta documentation
cp ../tools/rosetta/README.md ./docs/run-node/04-rosetta.md
+1
View File
@@ -15,6 +15,7 @@ use (
./tools/rosetta
./tools/cosmovisor
./tools/confix
./tools/hubl
./x/tx
./x/nft
./x/circuit
+1
View File
@@ -0,0 +1 @@
/hubl
+32
View File
@@ -0,0 +1,32 @@
<!--
Guiding Principles:
Changelogs are for humans, not machines.
There should be an entry for every single version.
The same types of changes should be grouped.
Versions and sections should be linkable.
The latest version comes first.
The release date of each version is displayed.
Mention whether you follow Semantic Versioning.
Usage:
Change log entries are to be added to the Unreleased section under the
appropriate stanza (see below). Each entry should ideally include a tag and
the Github issue reference in the following format:
* (<tag>) [#<issue-number>] Changelog message.
Types of changes (Stanzas):
"Features" for new features.
"Improvements" for changes in existing functionality.
"Deprecated" for soon-to-be removed features.
"Bug Fixes" for any bug fixes.
"API Breaking" for breaking exported APIs used by developers building on SDK.
Ref: https://keepachangelog.com/en/1.0.0/
-->
# Changelog
## [Unreleased]
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/make -f
all: hubl test
hubl:
go build -mod=readonly ./cmd/hubl
test:
go test -mod=readonly -race ./...
.PHONY: all hubl test
+68
View File
@@ -0,0 +1,68 @@
---
sidebar_position: 1
---
# Hubl
`Hubl` is a tool that allows you to query any Cosmos SDK based blockchain.
It takes advantage of the new [AutoCLI](https://pkg.go.dev/github.com/cosmos/cosmos-sdk/client/v2@v2.0.0-20220916140313-c5245716b516/cli) feature <!-- TODO replace with AutoCLI docs --> of the Cosmos SDK.
## Installation
Hubl can be installed using `go install`:
```shell
go install cosmossdk.io/tools/hubl/cmd/hubl@latest
```
Or build from source:
```shell
git clone --depth=1 https://github.com/cosmos/cosmos-sdk
make hubl
```
The binary will be located in `tools/hubl`.
## Usage
```shell
hubl --help
```
### Add chain
To configure a new chain just run this command using the --init flag and the name of the chain as it's listed in the chain registry (https://github.com/cosmos/chain-registry).
If the chain is not listed in the chain registry, you can use any unique name.
```shell
hubl --init [chain-name]
hubl --init regen
```
The chain configuration is stored in `~/.hubl/config.toml`.
:::tip
When using an unsecure gRPC endpoint, change the `insecure` field to `true` in the config file.
```toml
[chains]
[chains.regen]
[[chains.regen.trusted-grpc-endpoints]]
endpoint = 'localhost:9090'
insecure = true
```
:::
### Query
To query a chain, you can use the `query` command.
Then specify which module you want to query and the query itself.
```shell
hubl regen query auth module-accounts
```
+2 -4
View File
@@ -4,10 +4,11 @@ go 1.19
require (
cosmossdk.io/api v0.2.6
cosmossdk.io/client/v2 v2.0.0-20230120150717-4f6f6c00021f
cosmossdk.io/client/v2 v2.0.0-20230123200432-0d72b9039a54
github.com/cockroachdb/errors v1.9.0
github.com/hashicorp/go-multierror v1.1.1
github.com/manifoldco/promptui v0.9.0
github.com/pelletier/go-toml/v2 v2.0.6
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.6.1
google.golang.org/grpc v1.52.0
@@ -82,7 +83,6 @@ require (
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
@@ -122,5 +122,3 @@ require (
pgregory.net/rapid v0.5.5 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
replace cosmossdk.io/client/v2 => ../../client/v2
+2
View File
@@ -37,6 +37,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
cosmossdk.io/api v0.2.6 h1:AoNwaLLapcLsphhMK6+o0kZl+D6MMUaHVqSdwinASGU=
cosmossdk.io/api v0.2.6/go.mod h1:u/d+GAxil0nWpl1XnQL8nkziQDIWuBDhv8VnDm/s6dI=
cosmossdk.io/client/v2 v2.0.0-20230123200432-0d72b9039a54 h1:KvSz9SAdkMIW/xJyjfgGf3hFhL5hbYRwDduuouNvoco=
cosmossdk.io/client/v2 v2.0.0-20230123200432-0d72b9039a54/go.mod h1:ECtzZYhZ2rREL6AkuNMCyR6Ir+djK4xCAPbmtEYbBtg=
cosmossdk.io/core v0.4.1 h1:5icpjPmw8J4uFp6w8OoLJPxsw6X3kRi9nAtTr3qp2Ok=
cosmossdk.io/core v0.4.1/go.mod h1:Zqd1GB+krTF3bzhTnPNwzy3NTtXu+MKLX/9sPQXTIDE=
cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw=
+14
View File
@@ -0,0 +1,14 @@
sonar.projectKey=cosmos-sdk-tools-hubl
sonar.organization=cosmos
sonar.projectName=Cosmos SDK - Hubl
sonar.project.monorepo.enabled=true
sonar.sources=.
sonar.exclusions=**/*_test.go
sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out
sonar.sourceEncoding=UTF-8
sonar.scm.provider=git
+29 -4
View File
@@ -1,7 +1,32 @@
# CHANGELOG
<!--
Guiding Principles:
## Unreleased
Changelogs are for humans, not machines.
There should be an entry for every single version.
The same types of changes should be grouped.
Versions and sections should be linkable.
The latest version comes first.
The release date of each version is displayed.
Mention whether you follow Semantic Versioning.
### Features
Usage:
### Improvements
Change log entries are to be added to the Unreleased section under the
appropriate stanza (see below). Each entry should ideally include a tag and
the Github issue reference in the following format:
* (<tag>) [#<issue-number>] Changelog message.
Types of changes (Stanzas):
"Features" for new features.
"Improvements" for changes in existing functionality.
"Deprecated" for soon-to-be removed features.
"Bug Fixes" for any bug fixes.
"API Breaking" for breaking exported APIs used by developers building on SDK.
Ref: https://keepachangelog.com/en/1.0.0/
-->
# Changelog
## [Unreleased]