feat: enhance gateway with commitizen, Makefile, and updated dependencies

This commit is contained in:
Prad N
2025-03-21 18:01:27 -04:00
parent a2bac08544
commit 121fa00454
11 changed files with 218 additions and 707 deletions

7
.cz.toml Normal file
View File

@@ -0,0 +1,7 @@
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version_provider = "scm"
update_changelog_on_bump = true
major_version_zero = true

4
.gitignore vendored
View File

@@ -11,6 +11,7 @@ dist
CONVENTIONS.md
.goreleaser.yaml
Taskfile.yml
dist
# Binaries
.task
@@ -122,3 +123,6 @@ interchaintest-downloader
.haptic
x/.DS_Store
dist/config.yaml
dist
dist

42
Makefile Normal file
View File

@@ -0,0 +1,42 @@
.PHONY: all build test release image
# Default target
all: deps build
# Install dependencies
deps:
@gum log --level info "Installing dependencies..."
@go mod tidy
@go mod download
# Build all main packages
build:
@gum log --level info "Building binaries..."
@for dir in $$(rg -t go "package main" --files-with-matches | xargs -I{} dirname {} | sort -u); do \
gum log --level info "Building $$dir"; \
go build -o bin/$$(basename $$dir) ./$$dir; \
done
# Run tests with gum logging
test:
@gum log --level info "Running tests..."
@gum log --level info "Starting tests"
@go test -v ./... || (gum log --level error "Tests failed" && exit 1)
@gum log --level debug "Tests completed successfully"
# Build Docker image if Dockerfile exists
image:
@if [ -f Dockerfile ]; then \
gum log --level info "Building Docker image..."; \
docker build -t $$(basename $$(pwd)) .; \
else \
gum log --level info "Error: Dockerfile not found"; \
exit 1; \
fi
# Release using goreleaser
release:
@gum log --level info "Preparing release..."
@curl -s -o .goreleaser.yml https://raw.githubusercontent.com/goreleaser/goreleaser/main/www/docs/static/examples/go-binary.yaml
@go install github.com/goreleaser/goreleaser@latest
@goreleaser release --rm-dist

194
dist/config.yaml vendored
View File

@@ -1,194 +0,0 @@
version: 2
project_name: sonr
release:
github:
owner: onsonr
name: sonr
replace_existing_draft: true
tag: '{{ .PrefixedTag }}'
name_template: '{{ .Tag }} | {{ .Env.RELEASE_DATE }}'
extra_files:
- glob: ./README*
replace_existing_artifacts: true
brews:
- name: hway
repository:
owner: onsonr
name: homebrew-tap
token: '{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}'
branch: master
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
commit_msg_template: Brew formula update for {{ .ProjectName }} version {{ .PrefixedTag }}
directory: Formula
caveats: Run a local hway node and access it with the hway proxy
dependencies:
- name: ipfs
description: Sonr is a decentralized, permissionless, and censorship-resistant identity network.
homepage: https://onsonr.dev
ids:
- hway
goarm: "6"
goamd64: v1
builds:
- id: hway
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goamd64:
- v1
go386:
- sse2
goarm:
- "6"
goarm64:
- v8.0
gomips:
- hardfloat
goppc64:
- power8
goriscv64:
- rva20u64
targets:
- linux_amd64_v1
- linux_arm64_v8.0
- darwin_amd64_v1
- darwin_arm64_v8.0
dir: .
main: ./cmd
binary: hway
builder: go
mod_timestamp: '{{ .CommitTimestamp }}'
gobinary: go
command: build
ldflags:
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
flags:
- -mod=readonly
- -trimpath
archives:
- id: hway
builds:
- hway
name_template: hway_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }}
format: tar.gz
wrap_in_directory: "true"
files:
- src: README*
nfpms:
- file_name_template: hway_{{ .Os }}_{{ .Arch }}{{ .ConventionalExtension }}
package_name: hway
dependencies:
- ipfs
contents:
- src: README*
dst: /usr/share/doc/hway
id: hway
builds:
- hway
formats:
- rpm
- deb
- apk
section: net
priority: optional
vendor: Sonr
homepage: https://onsonr.dev
maintainer: Sonr <support@onsonr.dev>
description: Sonr Highway is a decentralized, permissionless, and censorship-resistant identity network proxy.
license: Apache 2.0
bindir: /usr/bin
libdirs:
header: /usr/include
carchive: /usr/lib
cshared: /usr/lib
snapshot:
version_template: '{{ .Version }}-SNAPSHOT-{{ .ShortCommit }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
algorithm: sha256
dockers:
- goos: linux
goarch: amd64
goarm: "6"
goamd64: v1
dockerfile: Dockerfile
image_templates:
- onsonr/hway:{{ .Tag }}
- onsonr/hway:latest
- ghcr.io/onsonr/hway:{{ .Tag }}
- ghcr.io/onsonr/hway:latest
use: docker
changelog:
format: '{{ .SHA }}: {{ .Message }} ({{ with .AuthorUsername }}@{{ . }}{{ else }}{{ .AuthorName }} <{{ .AuthorEmail }}>{{ end }})'
dist: dist
env_files:
github_token: ~/.config/goreleaser/github_token
gitlab_token: ~/.config/goreleaser/gitlab_token
gitea_token: ~/.config/goreleaser/gitea_token
source:
name_template: '{{ .ProjectName }}-{{ .Version }}'
format: tar.gz
gomod:
gobinary: go
announce:
twitter:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
mastodon:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
server: ""
reddit:
title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
url_template: '{{ .ReleaseURL }}'
slack:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
username: GoReleaser
discord:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
author: GoReleaser
color: "3888754"
icon_url: https://goreleaser.com/static/avatar.png
teams:
title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
color: '#2D313E'
icon_url: https://goreleaser.com/static/avatar.png
smtp:
subject_template: '{{ .ProjectName }} {{ .Tag }} is out!'
body_template: 'You can view details from: {{ .ReleaseURL }}'
mattermost:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
username: GoReleaser
linkedin:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
telegram:
enabled: true
message_template: '{{ mdv2escape .ProjectName }} {{ mdv2escape .Tag }} is out{{ mdv2escape "!" }} Check it out at {{ mdv2escape .ReleaseURL }}'
chat_id: "-1002222617755"
parse_mode: MarkdownV2
webhook:
message_template: '{ "message": "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}"}'
content_type: application/json; charset=utf-8
opencollective:
title_template: '{{ .Tag }}'
message_template: '{{ .ProjectName }} {{ .Tag }} is out!<br/>Check it out at <a href="{{ .ReleaseURL }}">{{ .ReleaseURL }}</a>'
bluesky:
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
git:
tag_sort: -version:refname
github_urls:
download: https://github.com
gitlab_urls:
download: https://gitlab.com
partial:
by: goos
nightly:
version_template: '{{ incpatch .Version }}-{{ .ShortCommit }}-nightly'
tag_name: nightly

12
dist/metadata.json vendored
View File

@@ -1,12 +0,0 @@
{
"project_name": "sonr",
"tag": "v0.0.0",
"previous_tag": "",
"version": "0.0.0-SNAPSHOT-21ff6cb",
"commit": "21ff6cbf305410a6059e489c369c268fa6cb2b1d",
"date": "2025-01-04T21:15:36.339986-05:00",
"runtime": {
"goos": "darwin",
"goarch": "arm64"
}
}

149
go.mod
View File

@@ -1,16 +1,16 @@
module github.com/onsonr/hway
go 1.23.4
go 1.24.1
require (
cosmossdk.io/api v0.7.6
git.sonr.io/pkg/crypto v0.0.3
github.com/a-h/templ v0.3.819
github.com/apple/pkl-go v0.9.0
github.com/cosmos/cosmos-sdk v0.50.11
github.com/go-webauthn/webauthn v0.11.2
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/ipfs/boxo v0.24.3
github.com/ipfs/go-cid v0.4.1
github.com/ipfs/go-cid v0.5.0
github.com/ipfs/kubo v0.32.1
github.com/labstack/echo-contrib v0.17.2
github.com/labstack/echo/v4 v4.13.3
@@ -20,36 +20,24 @@ require (
github.com/segmentio/ksuid v1.0.4
github.com/spf13/cobra v1.8.1
google.golang.org/grpc v1.69.2
lukechampine.com/blake3 v1.3.0
lukechampine.com/blake3 v1.4.0
)
require (
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.12.0 // indirect
cosmossdk.io/depinject v1.1.0 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.4.1 // indirect
cosmossdk.io/math v1.4.0 // indirect
cosmossdk.io/orm v1.0.0-beta.3 // indirect
cosmossdk.io/store v1.1.1 // indirect
cosmossdk.io/x/tx v0.13.7 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.19.1 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/boyter/go-string v1.0.5 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/bwesterb/go-ristretto v1.2.3 // indirect
github.com/caddyserver/certmagic v0.21.4 // indirect
github.com/caddyserver/zerossl v0.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
@@ -57,69 +45,42 @@ require (
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft v0.38.12 // indirect
github.com/cometbft/cometbft-db v0.11.0 // indirect
github.com/consensys/bavard v0.1.24 // indirect
github.com/consensys/gnark-crypto v0.14.0 // indirect
github.com/consensys/bavard v0.1.27 // indirect
github.com/consensys/gnark-crypto v0.16.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.1.1 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/cosmos-sdk v0.50.12 // indirect
github.com/cosmos/gogoproto v1.7.0 // indirect
github.com/cosmos/iavl v1.2.2 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/crackcomm/go-gitignore v0.0.0-20241020182519-7843d2ba8fdf // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-webauthn/x v0.1.14 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-tpm v0.9.1 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/pprof v0.0.0-20250208200701-d0013a598941 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-metrics v0.5.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/go-bitfield v1.1.0 // indirect
@@ -143,10 +104,9 @@ require (
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
github.com/koron/go-ssdp v0.0.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
@@ -154,31 +114,28 @@ require (
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.2.0 // indirect
github.com/libp2p/go-libp2p v0.38.1 // indirect
github.com/libp2p/go-libp2p v0.41.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.28.1 // indirect
github.com/libp2p/go-libp2p-kbucket v0.6.4 // indirect
github.com/libp2p/go-libp2p-record v0.2.0 // indirect
github.com/libp2p/go-libp2p-routing-helpers v0.7.4 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.2 // indirect
github.com/libp2p/go-reuseport v0.4.0 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mholt/acmez/v2 v2.0.3 // indirect
github.com/miekg/dns v1.1.62 // indirect
github.com/miekg/dns v1.1.63 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.14.0 // indirect
github.com/multiformats/go-multiaddr v0.15.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.4.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
@@ -187,59 +144,45 @@ require (
github.com/multiformats/go-multistream v0.6.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/onsi/ginkgo/v2 v2.22.0 // indirect
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect
github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
github.com/pion/datachannel v1.5.10 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/ice/v2 v2.3.37 // indirect
github.com/pion/dtls/v3 v3.0.4 // indirect
github.com/pion/ice/v4 v4.0.6 // indirect
github.com/pion/interceptor v0.1.37 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/logging v0.2.3 // indirect
github.com/pion/mdns/v2 v2.0.7 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.15 // indirect
github.com/pion/rtp v1.8.10 // indirect
github.com/pion/sctp v1.8.35 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.20 // indirect
github.com/pion/rtp v1.8.11 // indirect
github.com/pion/sctp v1.8.36 // indirect
github.com/pion/sdp/v3 v3.0.10 // indirect
github.com/pion/srtp/v3 v3.0.4 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/stun/v3 v3.0.0 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.3.5 // indirect
github.com/pion/turn/v4 v4.0.0 // indirect
github.com/pion/webrtc/v4 v4.0.10 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polydawn/refmt v0.89.0 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_golang v1.21.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.48.2 // indirect
github.com/quic-go/quic-go v0.50.0 // indirect
github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/stretchr/testify v1.10.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
@@ -251,9 +194,6 @@ require (
github.com/wlynxg/anet v0.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/zeebo/blake3 v0.2.4 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
@@ -264,26 +204,19 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/tools v0.28.0 // indirect
golang.org/x/tools v0.30.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
pgregory.net/rapid v1.1.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

431
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@ package common
import (
bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
nodev1beta1 "github.com/cosmos/cosmos-sdk/client/grpc/node"
// nodev1beta1 "github.com/cosmos/cosmos-sdk/client/grpc/node"
didv1 "github.com/onsonr/sonr/api/did/v1"
dwnv1 "github.com/onsonr/sonr/api/dwn/v1"
svcv1 "github.com/onsonr/sonr/api/svc/v1"
@@ -10,8 +10,8 @@ import (
)
type (
StatusResponse = nodev1beta1.StatusResponse // StatusResponse is the response type for the Service.Status RPC method.
StatusRequest = nodev1beta1.StatusRequest // StatusRequest is the request type for the Service.Status RPC method.
// StatusResponse = nodev1beta1.StatusResponse // StatusResponse is the response type for the Service.Status RPC method.
// StatusRequest = nodev1beta1.StatusRequest // StatusRequest is the request type for the Service.Status RPC method.
BalanceRequest = bankv1beta1.QueryBalanceRequest // BalanceRequest is the request type for the Bank.Balance RPC method.
BalanceResponse = bankv1beta1.QueryBalanceResponse // BalanceResponse is the response type for the Bank.Balance RPC method.
AllBalancesRequest = bankv1beta1.QueryAllBalancesRequest // AllBalancesRequest is the request type for the Bank.AllBalances RPC method.
@@ -63,13 +63,14 @@ func NewDWNClient(addr string) (dwnv1.QueryClient, error) {
return dwnv1.NewQueryClient(conn), nil
}
func NewNodeClient(addr string) (nodev1beta1.ServiceClient, error) {
conn, err := conn(addr)
if err != nil {
return nil, err
}
return nodev1beta1.NewServiceClient(conn), nil
}
//
// func NewNodeClient(addr string) (nodev1beta1.ServiceClient, error) {
// conn, err := conn(addr)
// if err != nil {
// return nil, err
// }
// return nodev1beta1.NewServiceClient(conn), nil
// }
func NewSVCClient(addr string) (svcv1.QueryClient, error) {
conn, err := conn(addr)

View File

@@ -4,12 +4,12 @@ import (
gocontext "context"
"net/http"
"git.sonr.io/pkg/crypto/mpc"
"github.com/labstack/echo/v4"
"github.com/medama-io/go-useragent"
"github.com/onsonr/hway/pkg/common"
hway "github.com/onsonr/hway/pkg/config"
hwayorm "github.com/onsonr/hway/pkg/models"
"github.com/onsonr/sonr/crypto/mpc"
)
type GatewayContext struct {

View File

@@ -1,8 +1,6 @@
package context
import (
"fmt"
"github.com/onsonr/hway/pkg/common"
)
@@ -58,31 +56,31 @@ func (cc *GatewayContext) ParamsSVC() (*common.SVCParamsResponse, error) {
return resp, nil
}
// StatusBlock returns the current block
func (cc *GatewayContext) StatusBlock() string {
qc, err := common.NewNodeClient(cc.grpcAddr)
if err != nil {
return "-1"
}
resp, err := qc.Status(bgCtx(), &common.StatusRequest{})
if err != nil {
return "-1"
}
return fmt.Sprintf("%d", resp.GetHeight())
}
// StatusNode returns the node status
func (cc *GatewayContext) StatusNode() (*common.StatusResponse, error) {
cl, err := common.NewNodeClient(cc.grpcAddr)
if err != nil {
return nil, err
}
resp, err := cl.Status(bgCtx(), &common.StatusRequest{})
if err != nil {
return nil, err
}
return resp, nil
}
// // StatusBlock returns the current block
// func (cc *GatewayContext) StatusBlock() string {
// qc, err := common.NewNodeClient(cc.grpcAddr)
// if err != nil {
// return "-1"
// }
// resp, err := qc.Status(bgCtx(), &common.StatusRequest{})
// if err != nil {
// return "-1"
// }
// return fmt.Sprintf("%d", resp.GetHeight())
// }
//
// // StatusNode returns the node status
// func (cc *GatewayContext) StatusNode() (*common.StatusResponse, error) {
// cl, err := common.NewNodeClient(cc.grpcAddr)
// if err != nil {
// return nil, err
// }
// resp, err := cl.Status(bgCtx(), &common.StatusRequest{})
// if err != nil {
// return nil, err
// }
// return resp, nil
// }
// TxBroadcast broadcasts a transaction to the network
func (cc *GatewayContext) TxBroadcast() error {

View File

@@ -1,8 +1,8 @@
package context
import (
"git.sonr.io/pkg/crypto/mpc"
"github.com/onsonr/hway/pkg/common"
"github.com/onsonr/sonr/crypto/mpc"
"lukechampine.com/blake3"
)
@@ -20,11 +20,10 @@ func (cc *GatewayContext) Spawn(handle, origin string) (*CreatePasskeyParams, er
cc.stagedEnclaves[sid] = encl
common.WriteCookie(cc, common.SonrAddress, encl.Address())
return &CreatePasskeyParams{
Address: encl.Address(),
Handle: handle,
Name: origin,
Challenge: challenge,
CreationBlock: cc.StatusBlock(),
Address: encl.Address(),
Handle: handle,
Name: origin,
Challenge: challenge,
}, nil
}