Skip to content

Commit 93ae471

Browse files
Merge remote-tracking branch 'pokt/main' into docs/create-factory
* pokt/main: [E2E] adds in-cluster config for E2E tests (#689) [Makefile] fixes the localnet_db_cli target (#700) Update devlog6.md [CLI] Remove logging for end user focused messages (#698) [Testing (DUP)] Add /internal/testutil pkg & refactor mockdns test code (#696) [Infra] Adapt pocket helm chart for DevNets (#682) Update changelog-verify.yml (#691)
2 parents f77181a + 7e7017f commit 93ae471

46 files changed

Lines changed: 256 additions & 172 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ then
3030
fi
3131

3232
# Initialise arrays and script wide variables
33-
IGNORE_DIRS=(".github" ".githooks" "docs" "bin")
33+
IGNORE_DIRS=(".github" ".githooks" "docs" "bin" "internal")
3434
MODULES_EDITED=() # Modules are considered top-level directories directly under root
3535
MODULES_MISSING_CHANGELOG=()
3636
CHANGELOG_FILES=() # Full paths to CHANGELOG.md files

.githooks/pre-receive

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
BRANCH_CHANGED_FILES=($@)
55

66
# Initialise arrays and script wide variables
7-
IGNORE_DIRS=(".github" ".githooks" "docs" "bin")
7+
IGNORE_DIRS=(".github" ".githooks" "docs" "bin" "internal")
88
MODULES_EDITED=() # Modules are considered top-level directories directly under root
99
MODULES_MISSING_CHANGELOG=()
1010
CHANGELOG_FILES=() # Full paths to CHANGELOG.md files

.github/workflows/changelog-verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
# require the validate job to have ran
5353
needs: validate
54-
if: always()
54+
if: ${{ contains(github.event.pull_request.labels.*.name, 'cl validate') }}
5555
steps:
5656
- name: Verify changelogs Failed - Create review comment
5757
if: ${{ contains(needs.validate.outputs.all, 'failed') }}

.github/workflows/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
runs-on: ubuntu-latest
103103
needs: test-multiple-go-versions
104104
# Until we have developer environments, we don't need the images built on other that main branches.
105-
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'push-image')
105+
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'push-image') || contains(github.event.pull_request.labels.*.name, 'e2e-devnet-test')
106106
strategy:
107107
matrix:
108108
# Build dev & prod images
@@ -117,6 +117,8 @@ jobs:
117117
- name: Docker Metadata action
118118
id: meta
119119
uses: docker/metadata-action@v4
120+
env:
121+
DOCKER_METADATA_PR_HEAD_SHA: "true"
120122
with:
121123
images: |
122124
ghcr.io/pokt-network/pocket-v1
@@ -128,6 +130,7 @@ jobs:
128130
type=ref,event=branch${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }}
129131
type=ref,event=pr${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }}
130132
type=sha${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }}
133+
type=sha,format=long${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }}
131134
type=raw,value=latest,enable={{is_default_branch}}${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }}
132135
- name: Login to GitHub Container Registry
133136
uses: docker/login-action@v2
@@ -142,7 +145,7 @@ jobs:
142145
tags: ${{ steps.meta.outputs.tags }}
143146
labels: ${{ steps.meta.outputs.labels }}
144147
# NB: Uncomment below if arm64 build is needed; arm64 builds are off by default because build times are significant.
145-
platforms: linux/amd64 #,linux/arm64
148+
platforms: linux/amd64 #,linux/arm64
146149
file: build/Dockerfile.${{ matrix.osType }}.${{ matrix.imageType }}
147150
cache-from: type=gha
148151
cache-to: type=gha,mode=max

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,20 +506,20 @@ localnet_shell: ## Opens a shell in the pod that has the `client` cli available.
506506

507507
.PHONY: localnet_logs_validators
508508
localnet_logs_validators: ## Outputs logs from all validators
509-
kubectl logs -l v1-purpose=validator --all-containers=true --tail=-1
509+
kubectl logs -l "pokt.network/purpose=validator" --all-containers=true --tail=-1
510510

511511
.PHONY: localnet_logs_validators_follow
512512
localnet_logs_validators_follow: ## Outputs logs from all validators and follows them (i.e. tail)
513-
kubectl logs -l v1-purpose=validator --all-containers=true --max-log-requests=1000 --tail=-1 -f
513+
kubectl logs -l "pokt.network/purpose=validator" --all-containers=true --max-log-requests=1000 --tail=-1 -f
514514

515515
.PHONY: localnet_down
516516
localnet_down: ## Stops LocalNet and cleans up dependencies (tl;dr `tilt down`)
517517
tilt down --file=build/localnet/Tiltfile
518518

519519
.PHONY: localnet_db_cli
520-
localnet_db_cli: ## Open a CLI to the local containerized postgres instancedb_cli:
520+
localnet_db_cli: ## Open a CLI to the local containerized postgres instance of validator 001:
521521
echo "View schema by running 'SELECT schema_name FROM information_schema.schemata;'"
522-
kubectl exec -it services/dependencies-postgresql -- bash -c "psql postgresql://postgres:LocalNetPassword@localhost"
522+
kubectl exec -it validator-001-postgresql-0 -- bash -c "psql postgresql://postgres:LocalNetPassword@localhost"
523523

524524
.PHONY: check_cross_module_imports
525525
check_cross_module_imports: ## Lists cross-module imports

app/client/cli/cmd.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var (
1818
dataDir string
1919
configPath string
2020
nonInteractive bool
21+
verbose bool
2122
cfg *configs.Config
2223
)
2324

@@ -31,6 +32,11 @@ func init() {
3132
if err := viper.BindPFlag("root_directory", rootCmd.PersistentFlags().Lookup("data_dir")); err != nil {
3233
panic(err)
3334
}
35+
36+
rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "Show verbose output")
37+
if err := viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose")); err != nil {
38+
panic(err)
39+
}
3440
}
3541

3642
var rootCmd = &cobra.Command{

app/client/cli/keys.go

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"strconv"
88
"strings"
99

10-
"github.com/pokt-network/pocket/logger"
1110
"github.com/pokt-network/pocket/shared/codec"
1211
coreTypes "github.com/pokt-network/pocket/shared/core/types"
1312
"github.com/pokt-network/pocket/shared/crypto"
@@ -81,7 +80,7 @@ func keysCreateCommands() []*cobra.Command {
8180
return err
8281
}
8382

84-
logger.Global.Info().Str("address", kp.GetAddressString()).Msg("New Key Created")
83+
fmt.Printf("New key created 🔐: %s\n", kp.GetAddressString())
8584

8685
return nil
8786
},
@@ -129,7 +128,7 @@ func keysUpdateCommands() []*cobra.Command {
129128
return err
130129
}
131130

132-
logger.Global.Info().Str("address", addrHex).Msg("Key updated")
131+
fmt.Printf("Key updated 🔐: %s\n", addrHex)
133132

134133
return nil
135134
},
@@ -176,7 +175,7 @@ func keysDeleteCommands() []*cobra.Command {
176175
return err
177176
}
178177

179-
logger.Global.Info().Str("address", addrHex).Msg("Key deleted")
178+
fmt.Printf("Key deleted ❌: %s\n", addrHex)
180179

181180
return nil
182181
},
@@ -215,7 +214,10 @@ func keysGetCommands() []*cobra.Command {
215214
return err
216215
}
217216

218-
logger.Global.Info().Strs("addresses", addresses).Msg("Get all keys")
217+
fmt.Println("All keys 🔑")
218+
for _, addr := range addresses {
219+
fmt.Println(addr)
220+
}
219221

220222
return nil
221223
},
@@ -244,7 +246,8 @@ func keysGetCommands() []*cobra.Command {
244246
return err
245247
}
246248

247-
logger.Global.Info().Str("address", addrHex).Str("public_key", kp.GetPublicKey().String()).Msg("Found key")
249+
fmt.Println("Key details 🕵️")
250+
fmt.Printf("Address: %s\nPublic Key: %s\n", addrHex, kp.GetPublicKey().String())
248251

249252
return nil
250253
},
@@ -301,11 +304,11 @@ func keysExportCommands() []*cobra.Command {
301304

302305
// Write to stdout or file
303306
if outputFile == "" {
304-
logger.Global.Info().Str("private_key", exportString).Msg("Key exported")
307+
fmt.Printf("Private Key 🔒: %s\n", exportString)
305308
return nil
306309
}
307310

308-
logger.Global.Info().Str("output_file", outputFile).Msg("Exporting private key string to file...")
311+
fmt.Println("Writing private key to file")
309312

310313
return utils.WriteOutput(exportString, outputFile)
311314
},
@@ -380,7 +383,7 @@ func keysImportCommands() []*cobra.Command {
380383
return err
381384
}
382385

383-
logger.Global.Info().Str("address", kp.GetAddressString()).Msg("Key imported")
386+
fmt.Printf("Key imported 📥: %s\n", kp.GetAddressString())
384387

385388
return nil
386389
},
@@ -436,7 +439,7 @@ func keysSignMsgCommands() []*cobra.Command {
436439

437440
sigHex := hex.EncodeToString(sigBz)
438441

439-
logger.Global.Info().Str("signature", sigHex).Str("address", addrHex).Msg("Message signed")
442+
fmt.Printf("Message signed 🔏\nSignature: %s\n", sigHex)
440443

441444
return nil
442445
},
@@ -475,7 +478,12 @@ func keysSignMsgCommands() []*cobra.Command {
475478
return err
476479
}
477480

478-
logger.Global.Info().Str("address", addrHex).Bool("valid", valid).Msg("Signature checked")
481+
if !valid {
482+
fmt.Println("Signature is not valid ❌")
483+
return nil
484+
}
485+
486+
fmt.Println("Signature is valid ✅")
479487

480488
return nil
481489
},
@@ -563,7 +571,7 @@ func keysSignTxCommands() []*cobra.Command {
563571
return err
564572
}
565573

566-
logger.Global.Info().Str("signed_transaction_file", outputFile).Str("address", addrHex).Msg("Message signed")
574+
fmt.Printf("Message signed 🔏\nKey Address: %s\nSignature file: %s\n", addrHex, outputFile)
567575

568576
return nil
569577
},
@@ -627,7 +635,12 @@ func keysSignTxCommands() []*cobra.Command {
627635
return err
628636
}
629637

630-
logger.Global.Info().Str("address", addrHex).Bool("valid", valid).Msg("Signature checked")
638+
if !valid {
639+
fmt.Println("Signature is not valid ❌")
640+
return nil
641+
}
642+
643+
fmt.Println("Signature is valid ✅")
631644

632645
return nil
633646
},
@@ -679,7 +692,10 @@ func keysSlipCommands() []*cobra.Command {
679692
return err
680693
}
681694

682-
logger.Global.Info().Str("address", kp.GetAddressString()).Str("parent", parentAddr).Uint32("index", index).Bool("stored", storeChild).Msg("Child key derived")
695+
fmt.Printf("Child key created 🚸\nChild Address: %s\nParent Address: %s\n", kp.GetAddressString(), parentAddr)
696+
if storeChild {
697+
fmt.Println("Child key stored in the Keybase 🔐")
698+
}
683699

684700
return nil
685701
},

app/client/cli/query.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"io"
66
"net/http"
7+
"os"
78

8-
"github.com/pokt-network/pocket/logger"
99
"github.com/pokt-network/pocket/rpc"
1010
"github.com/spf13/cobra"
1111
)
@@ -47,7 +47,7 @@ func queryCommands() []*cobra.Command {
4747
statusCode := response.StatusCode
4848
body, err := io.ReadAll(response.Body)
4949
if err != nil {
50-
logger.Global.Error().Err(err).Msg("Error reading response body")
50+
fmt.Fprintf(os.Stderr, "❌ Error reading response body: %s\n", err.Error())
5151
return err
5252
}
5353
if statusCode == http.StatusOK {

build/Dockerfile.debian.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ENV PATH $PATH:$HOME/.local/bin
1313
### Install dependencies
1414
# Debian packages
1515
RUN apt-get update -qq && \
16-
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential zip wget ca-certificates curl net-tools dnsutils && \
16+
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential zip wget ca-certificates curl net-tools dnsutils kubernetes-client && \
1717
rm -rf /var/lib/apt/lists/* /var/cache/apt
1818

1919
# protoc
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)