Compare commits

...
Author SHA1 Message Date
dependabot[bot]andGitHub 8e041b4c9a chore(ci): bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 03:02:28 +00:00
Prad NukalaandGitHub 6c6cec6326 ci: migrate workflows to tenki (#1309)
👋 Hey there, reviewer!

Experience the fastest GitHub Actions with
[Tenki](https://www.tenki.cloud/), built for performance and cost
efficiency.

## What does this PR do?

This pull request was automatically generated by Tenki's Migration
Wizard.

Here's what's new once you merge:

- ** Faster Runners:** Your workflows now use Tenki's high-performance
bare-metal infrastructure ~35% faster than
default GitHub-hosted runners. 
[Learn more about Tenki's instance types
→](https://www.tenki.cloud/docs/runner-offering)

- **💵 Cheaper Runners:** as you now use Tenki's high-performance
bare-metal infrastructure and WE manage the costs,
that means for you: 90% cheaper than default GitHub-hosted runners. 
[Learn more about Tenki's pricing
→](https://www.tenki.cloud/docs/runner-billing)

## Any questions ? 
**- Is this free?** 
Yes, your first 3,000 minutes per month are on us.

**- Do I need to complete any other steps to migrate to Tenki?**
Nope. Hit Merge, and you are good to go 🎊

**- Who's can I contact if I have any other questions?**
Reach out at [hello@tenki.cloud,](mailto:hello@tenki.cloud,) we will
answer you within 24hrs.
2025-11-19 17:45:53 -05:00
tenki-cloud[bot]andGitHub f4c7b72b3e chore: migrate runner to tenki 2025-11-19 22:44:40 +00:00
tenki-cloud[bot]andGitHub 5dbcc455e8 chore: migrate runner to tenki 2025-11-19 22:44:40 +00:00
181b10b6b2 Feat/noble ibc testnet (#1307)
* feat(dex): integrate Noble testnet for USDC cross-chain operations

This commit integrates the Noble testnet (grand-1) with Sonr's x/dex module,
enabling native USDC trading and liquidity operations across IBC-enabled chains.

Changes:
- Add default params configuration with Noble testnet in allowed connections
- Create Noble-specific helper types and functions for USDC operations
- Implement USDC conversion utilities (base units <-> USDC decimals)
- Add NobleSwapParams and NobleLiquidityParams for structured operations
- Update genesis state to use default params with validation
- Add comprehensive Noble integration documentation
- Create unit tests for params and Noble helpers

Noble Configuration:
- Chain ID: noble-grand-1 (testnet)
- USDC Denom: uusdc (6 decimals)
- RPC: https://noble-testnet-rpc.polkachu.com:443
- gRPC: noble-testnet-grpc.polkachu.com:21590

Module Parameters:
- Max accounts per DID: 5
- Default ICA timeout: 600 seconds
- Min swap amount: 1000 base units
- Max daily volume: 1T base units
- Rate limits: 10 ops/block, 100 ops/DID/day
- Fees: 0.3% swap, 0.2% liquidity, 0.1% orders

This integration enables Sonr users to:
- Register ICA accounts on Noble testnet
- Execute cross-chain swaps with USDC
- Provide/remove liquidity in USDC pairs
- Trade with slippage protection
- Route multi-hop swaps through USDC

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore(ci): migrate scopes to toml format

* feat(dex): add support for noble usdc swaps

##

feat(dex): add support for noble usdc swaps

* feat(test): add e2e tests for usdc swap with did

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-18 12:28:30 -05:00
Prad Nukala 4ddcd54558 Merge branch 'master' into feat/noble-ibc-testnet 2025-11-18 12:27:30 -05:00
Prad Nukala f71193674b feat(cmd): add ASCII art logo to CLI output 2025-11-18 12:27:01 -05:00
Prad Nukala ad69f0ac80 refactor(cmd): remove unnecessary logo print statement from main function 2025-11-18 12:20:40 -05:00
Prad Nukala 28eba5a3f3 feat(cmd): add ASCII art logo to snrd cli tool 2025-11-18 12:19:21 -05:00
Prad Nukala 99167120dc chore(.gitignore): add .claude to ignore list 2025-11-05 15:03:16 -05:00
Prad Nukala 93a5d8826d > Ran tool: github_create_or_update_file
>
> *Failed*:
> ```
> failed to create/update file: PUT https://api.github.com/repos/sonr-io/sonr-io.github.io/contents/docs/guides/decentralized-authentication.mdx: 401 Bad credentials []
> ```

> Ran tool: `github_create_or_update_file`
>
> *Failed*:
> ```
> failed to create/update file: PUT https://api.github.com/repos/sonr-io/sonr-io.github.io/contents/docs/guides/decentralized-authentication.mdx: 401 Bad credentials []
> ```

docs: Remove decentralized authentication guide
2025-10-28 10:39:59 -04:00
Prad NukalaandGitHub ae16bee0c1 Merge branch 'master' into feat/noble-ibc-testnet 2025-10-26 16:49:38 -04:00
Prad Nukala 6f93b63e4b feat(test): add e2e tests for usdc swap with did 2025-10-26 16:22:10 -04:00
Prad Nukala 3c682390a6 feat(dex): add support for noble usdc swaps
##

feat(dex): add support for noble usdc swaps
2025-10-26 16:22:07 -04:00
Prad Nukala 85304fd8b4 chore(ci): migrate scopes to toml format 2025-10-26 16:22:04 -04:00
Prad Nukala be4e4b8367 docs(src): add README file for sonrctl cli 2025-10-25 14:43:47 -04:00
Prad Nukala 88ca486108 chore(devbox): add dasel package and update devbox config 2025-10-25 14:43:46 -04:00
Prad Nukala 30635ba397 chore(ci): migrate scopes to toml format 2025-10-25 14:43:44 -04:00
Claude 9db77a2bf4 feat(dex): integrate Noble testnet for USDC cross-chain operations
This commit integrates the Noble testnet (grand-1) with Sonr's x/dex module,
enabling native USDC trading and liquidity operations across IBC-enabled chains.

Changes:
- Add default params configuration with Noble testnet in allowed connections
- Create Noble-specific helper types and functions for USDC operations
- Implement USDC conversion utilities (base units <-> USDC decimals)
- Add NobleSwapParams and NobleLiquidityParams for structured operations
- Update genesis state to use default params with validation
- Add comprehensive Noble integration documentation
- Create unit tests for params and Noble helpers

Noble Configuration:
- Chain ID: noble-grand-1 (testnet)
- USDC Denom: uusdc (6 decimals)
- RPC: https://noble-testnet-rpc.polkachu.com:443
- gRPC: noble-testnet-grpc.polkachu.com:21590

Module Parameters:
- Max accounts per DID: 5
- Default ICA timeout: 600 seconds
- Min swap amount: 1000 base units
- Max daily volume: 1T base units
- Rate limits: 10 ops/block, 100 ops/DID/day
- Fees: 0.3% swap, 0.2% liquidity, 0.1% orders

This integration enables Sonr users to:
- Register ICA accounts on Noble testnet
- Execute cross-chain swaps with USDC
- Provide/remove liquidity in USDC pairs
- Trade with slippage protection
- Route multi-hop swaps through USDC

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 18:32:48 +00:00
Prad Nukala 5fbcd85420 chore(ci): update scopes.json to reflect new repository structure 2025-10-23 15:03:46 -04:00
Prad Nukala 9438cb2fff docs: remove swagger generation config and docs 2025-10-23 10:18:27 -04:00
Prad Nukala ab44cf15eb chore(.gitignore): update gitignore to reflect removal of Highway and Vault components 2025-10-21 12:30:43 -04:00
Prad Nukala 3769d11f9f docs: remove hway documentation 2025-10-21 12:30:42 -04:00
Prad Nukala c49fead1d8 docs(dwn): clarify vault operations and remove motor client references 2025-10-21 12:30:40 -04:00
Prad Nukala 2241ac470b chore(docs): update README with new build commands and architecture information 2025-10-21 12:30:38 -04:00
Prad Nukala cf1712c2d8 docs(client): add OpenAPI/Swagger documentation for Sonr blockchain API 2025-10-21 12:04:31 -04:00
Prad Nukala 53a34171e8 style(proto): ignore tmp-swagger-gen/**/*.swagger.json 2025-10-21 12:04:29 -04:00
Prad Nukala e3b492f3b9 refactor(svc): re-order import sections in protobuf generated files 2025-10-21 12:04:27 -04:00
Prad Nukala e3e6b4c918 feat(dwn): update enclave wasm plugin for secure operations 2025-10-21 12:04:26 -04:00
Prad Nukala 782a93bae0 refactor(did): organize protobuf imports according to best practices 2025-10-21 12:04:25 -04:00
Prad Nukala 1c908fca36 refactor(dex): reorganize protobuf imports for consistency 2025-10-21 12:04:24 -04:00
Prad Nukala 30f6902e5f ci: update Makefile for consistent localnet and dockernet behavior 2025-10-21 12:04:23 -04:00
Prad Nukala d4b45bb9d7 chore(ci): remove mods.yml and scopes.yml files 2025-10-20 11:15:58 -04:00
Prad Nukala 3442afd407 No commit suggestions generated 2025-10-16 09:00:48 -04:00
Prad Nukala 5e113a8066 No commit suggestions generated 2025-10-15 15:31:10 -04:00
Prad Nukala 81a33f4541 Falling back to manual conventional commit...
fix(gitignore files):
2025-10-14 09:27:20 -04:00
Prad Nukala 6bd50128fb Falling back to manual conventional commit...
fix(Update gitignore):
2025-10-13 16:46:37 -04:00
Prad Nukala 6b4b1c42ed No commit suggestions generated 2025-10-12 21:10:32 -04:00
Prad NukalaandGitHub ebfa2b062a Feat/add networks (#1303)
* No commit suggestions generated

* No commit suggestions generated

* No commit suggestions generated
2025-10-12 11:23:20 -04:00
40eadc995e Feat/1285 es ucan formatting (#1302)
* feat: Add Enclave Usage Examples

* feat(es/ucan): Add comprehensive integration tests

- Create integration.test.ts with full UCAN token lifecycle testing
- Cover end-to-end token creation, parsing, and validation
- Test capability attenuation and delegation chains
- Validate multi-algorithm support and timestamp scenarios
- Implement error recovery and performance test scenarios

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

* No commit suggestions generated

* No commit suggestions generated

* chore: Remove migrated components and add migration documentation

Removed all code and references for components that have been moved to separate repositories:

**Moved to sonr-io/hway:**
- bridge/ - HTTP service with OAuth2/OIDC/WebAuthn handlers
- cmd/hway/ - Highway service binary
- internal/migrations/ - PostgreSQL schema migrations

**Moved to sonr-io/motr:**
- cmd/motr/ - Motor worker service (WASM vault operations)
- cmd/vault/ - Vault CLI tool
- crypto/ - Comprehensive cryptographic library
- packages/ - TypeScript SDK packages (es, sdk, ui, com, pkl)
- web/auth/ - Authentication web application
- web/dash/ - Dashboard web application

**Updated Configuration:**
- Makefile: Removed build/test/release targets for moved components
- CLAUDE.md: Simplified to focus on core blockchain components
- devbox.json: Removed scripts for moved services
- docker-compose.yml: Removed hway, postgres, redis, auth, dash services
- .github/scopes.yml: Removed CI scopes for migrated components
- .goreleaser.yml: Updated release configuration

**Added Migration Documentation:**
- MIGRATE_HWAY.md: Comprehensive Highway service architecture and migration guide
- MIGRATE_MOTR.md: Comprehensive Motor/Worker/Vault architecture and migration guide

These migration documents provide complete context for setting up the new repositories including architecture diagrams, component breakdowns, API documentation, and migration checklists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* No commit suggestions generated

* chore: Remove contracts references and documentation

Removed all references to the contracts directory that was migrated to a separate repository.

**Changes:**
- .gitignore: Removed contract-specific ignore patterns for DAO and wSNR contracts
- .gitignore: Removed hway and motr binary references (already migrated)
- .rgignore: Removed contracts, chains, and crypto directory references
- docs/reference/contracts/: Removed DAO.mdx and wSNR.mdx documentation files

This completes the cleanup of migrated components from the repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: add crypto library migration documentation

Added comprehensive migration documentation for the crypto library that was
moved to sonr-io/crypto repository. This documentation provides complete context
for understanding the cryptographic primitives and protocols used throughout
the Sonr ecosystem.

## Key Documentation Added

### MIGRATE_CRYPTO.md
Complete documentation of the crypto library covering:

**Core Cryptographic Primitives**
- Elliptic curve implementations (Ed25519, Secp256k1, P-256, BLS12-381, Pallas/Vesta)
- Native curve arithmetic with optimized field operations
- Pairing-friendly curves for BLS signatures

**Multi-Party Computation (MPC)**
- MPC enclave for vault key generation and management
- Threshold cryptography (TECDSA, TED25519 with FROST protocol)
- Distributed Key Generation (DKG) via Gennaro and FROST protocols
- Secret sharing schemes (Shamir, Feldman VSS, Pedersen VSS)

**Digital Signature Schemes**
- BLS signatures with aggregation support
- BBS+ signatures for selective disclosure
- Schnorr signatures (standard and Mina/NEM variants)
- ECDSA with deterministic nonce generation

**Zero-Knowledge Proofs**
- Bulletproofs for range proofs
- Inner Product Arguments (IPA)
- Batch verification support

**Advanced Cryptographic Protocols**
- Cryptographic accumulators for set membership proofs
- Paillier homomorphic encryption
- Oblivious Transfer (OT) protocols
- Verifiable Random Functions (VRF)

**Key Management & Identity**
- DID key management with multi-chain support
- Multi-algorithm public key handling
- Wallet address derivation (Bitcoin, Ethereum, Cosmos, Solana, etc.)

**UCAN Integration**
- User-Controlled Authorization Networks
- Capability delegation and attenuation
- JWT-based capability tokens
- MPC-enabled UCAN signing

**Security Utilities**
- AEAD encryption (AES-GCM, AES-SIV)
- Argon2 key derivation
- ECIES encryption
- Secure memory handling

### MIGRATE_MOTR.md Updates
Updated Motor migration documentation to clarify that the crypto library
is now a separate external dependency at github.com/sonr-io/crypto v1.0.1

## Repository Context

The crypto library has been successfully migrated to its own repository
and is published as a Go module. It serves as the foundational cryptographic
layer for:
- Sonr blockchain (snrd) - DID signatures, vault operations
- Highway service (hway) - UCAN token signing, WebAuthn
- Motor/Worker (motr) - MPC vault operations, threshold signatures

## Integration Impact

All Sonr ecosystem components now depend on the external crypto library:
```go
require github.com/sonr-io/crypto v1.0.1
```

The migration enables independent versioning and maintenance of cryptographic
primitives while maintaining security and compatibility across the ecosystem.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* No commit suggestions generated

* No commit suggestions generated

* No commit suggestions generated

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-10 11:47:18 -04:00
Prad Nukala 7570d67787 No commit suggestions generated 2025-10-05 12:44:08 -04:00
Prad Nukala d19e0b676b bump: version 0.0.1 → 0.0.2 2025-10-04 11:33:27 -04:00
Prad Nukala 08d4af2dc0 bump: version 0.0.2 → 0.0.3 2025-10-04 11:27:30 -04:00
Prad Nukala 7f8034ae44 bump: version 0.0.2 → 0.0.3 2025-10-04 11:27:21 -04:00
Prad Nukala 19ae52dd12 bump: version 0.0.2 → 0.0.3 2025-10-04 11:24:19 -04:00
Prad Nukala ee2ba1745e fix: License 2025-10-04 11:24:13 -04:00
Prad NukalaandGitHub 0bfaf26357 Create LICENSE
Signed-off-by: Prad Nukala <prad@sonr.io>
2025-10-04 11:21:29 -04:00
Prad Nukala 8ed37f02f3 bump: version 0.0.1 → 0.0.2 2025-10-04 08:58:48 -04:00
Prad Nukala c3dbb04f21 bump: version 0.0.1 → 0.0.2 2025-10-04 08:58:44 -04:00
Prad Nukala 5bc00c5481 bump: version 0.0.1 → 0.0.2 2025-10-04 08:58:16 -04:00
Prad Nukala 6ef7b8ea2d fix: Changelog 2025-10-04 08:58:06 -04:00
Prad Nukala 11d318dc00 bump: version 0.0.1 → 0.0.2 2025-10-04 08:56:10 -04:00
Prad NukalaandGitHub 6f6a20922c chore/devbox plugin (#1301)
* chore: Add Homebrew Casks for snrd/hway

* fix: Tag bump format for npm packages

* chore: Remove plugin setup
2025-10-04 08:55:54 -04:00
Prad Nukala e4450f52a4 fix: goreleaser nix build and url map 2025-10-03 15:10:29 -04:00
Prad Nukala eea48a43b4 bump: version 0.0.0 → 0.0.1 2025-10-03 14:59:45 -04:00
Prad Nukala 6595d4fde1 bump: version 0.0.0 → 0.0.1 2025-10-03 14:54:24 -04:00
Prad Nukala ce55341871 bump: version 0.0.0 → 0.0.1 2025-10-03 14:54:08 -04:00
Prad Nukala 4d0ec9f693 bump: version 0.0.0 → 0.0.1 2025-10-03 14:51:18 -04:00
Prad Nukala 8c31e71804 fix: Remove Changelogs 2025-10-03 14:49:51 -04:00
Prad NukalaandGitHub 13e6c3e84d Master (#1262)
* clear

* feat: Add everything

* fix: Commenht
2025-10-03 14:45:52 -04:00
Prad N 43b4a11c06 docs: add coding guidelines for contributors 2025-04-05 21:43:51 -04:00
Prad N c249c722e1 feat: enhance task management with Taskfile schema validation 2025-04-04 01:29:59 -04:00
Prad N 8b510c1db1 docs: establish codebase conventions and developer guidelines 2025-03-30 22:52:04 -04:00
Prad NukalaandGitHub d3346a6fe6 Update README.md
Signed-off-by: Prad Nukala <prad@sonr.io>
2025-03-27 04:37:54 -04:00
Prad N f0c3230a89 bump: version 0.6.3 → 0.6.4 2025-03-27 04:33:49 -04:00
Prad N 325b2fe4cb ci: remove release workflow 2025-03-27 04:27:03 -04:00
Prad N 85162f2ea6 ci: streamline release workflow triggers 2025-03-27 04:23:42 -04:00
Prad N 9208df92f3 feat: enable GitHub Actions to trigger releases 2025-03-27 04:23:02 -04:00
de72e6186f feat: enhance development environment with ripgrep and gh-milestone (#1252)
Co-authored-by: Prad N <prad@didao.xyz>
2025-03-27 04:21:05 -04:00
240fc5c1ef feat: enhance release process with Doppler integration (#1251)
Co-authored-by: Prad N <prad@didao.xyz>
2025-03-27 04:17:20 -04:00
836963163c Feature/auto releases (#1250)
* refactor: rename project from onsonr/sonr to sonr-io/snrd (#1249)

* refactor: rename project from onsonr/sonr to sonr-io/snrd

* refactor: update package paths to use sonr-io org

---------

Co-authored-by: Prad N <prad@didao.xyz>

* feat: introduce devbox for consistent development environment

* feat: integrate Doppler for secrets management

* feat: streamline release process with Devbox

* <no value>

* bump: version 0.6.3 → 0.6.4

* feat: enable commit-less version bumping

* bump: version 0.6.4 → 0.6.5

* feat: streamline release process and update project metadata

* feat: streamline build process and configuration

* feat: streamline build process by removing release target

* bump: version 0.6.5 → 0.6.6

* feat: upgrade to go 1.24 and align binary name

* bump: version 0.6.6 → 0.6.7

* feat: streamline release process and update project metadata

* bump: version 0.6.3 → 0.6.4

* feat: streamline development and release processes

* feat: streamline development and release processes

* refactor: streamline release process with Taskfile

* feat: enhance goreleaser output with title for better UX

* feat: consolidate release notes

* bump: version 0.6.3 → 0.6.4

* feat: streamline release process with improved automation

* feat: streamline development and release workflow

* bump: version 0.6.3 → 0.6.4

* feat: streamline release process with Taskfile and conventional commits

* bump: version 0.6.4 → 0.6.5

* feat: enhance Docker image publishing with piped credentials

* chore: remove outdated changelog entries

* bump: version 0.6.3 → 0.6.4

* feat: improve release process with interactive feedback

* feat: enhance release process with real-time version feedback

* bump: version 0.6.4 → 0.6.5

* feat: enhance release process with dynamic version display and streamlined automation

* bump: version 0.6.3 → 0.6.4

* refactor: streamline release process by removing redundant version display

* bump: version 0.6.4 → 0.6.5

* refactor: streamline release process and simplify dev environment

* bump: version 0.6.3 → 0.6.4

* ci: simplify PR checks by removing redundant release validation

* refactor: consolidate release workflows for improved maintainability

* ci: enhance release workflow for automated version publishing

---------

Co-authored-by: Prad N <prad@didao.xyz>
2025-03-27 04:14:38 -04:00
Prad N ff3fd631f7 chore: remove taskfile configurations 2025-03-21 21:27:38 -04:00
Prad N bf4a7440be feat: automate release process with conventional commits 2025-03-21 21:26:26 -04:00
Prad N 8b4d51ee30 feat: streamline app initialization and dependency management 2025-03-19 14:47:22 -04:00
Prad N 00b23353c9 fix: Refactor crypto 2025-03-11 13:57:03 -04:00
Prad N 090ee30ba3 feat: enable task management with Taskfile 2025-03-07 14:38:51 -05:00
Prad N 77bbf6bba7 feat: introduce Taskfile automation for build and deployment 2025-03-05 19:22:04 -05:00
root fcc915a115 fix: Deploy config 2025-01-16 18:22:14 -05:00
Prad N f566b7d6c1 refactor: remove evmos chain from deployment configuration 2025-01-11 23:27:50 -05:00
root b12bc88eda feat(deploy): add hdPath and coinType to sonr-1 chain config 2025-01-12 02:21:13 +00:00
Prad N 2892641f17 refactor: simplify deployment infrastructure using starship 2025-01-11 14:57:58 -05:00
Prad N 20317bbc91 style: improve release name format 2025-01-11 13:55:49 -05:00
Prad Nukala 8d218dddaa Add Slack notification workflow 2025-01-11 13:08:04 -05:00
Prad N d73f49bd24 refactor: remove unnecessary Caddyfile 2025-01-11 12:25:05 -05:00
Prad N bd9234572a ci: improve CI/CD process with devbox integration 2025-01-11 12:24:55 -05:00
Prad N 96eff9dffa fix: resolve minor formatting inconsistencies in Dockerfile and accumulator.go 2025-01-11 09:32:12 -05:00
Prad N a06bae6348 refactor: remove process-compose and individual start scripts 2025-01-09 20:09:16 -05:00
root 2d3d1929a0 docs: remove outdated testnet documentation 2025-01-07 11:19:04 -05:00
root 79706e32e3 feat: add go dependency and enhance devbox environment variables 2025-01-07 11:16:47 -05:00
root f8974b3d1f feat: implement HTMX for dynamic updates 2025-01-06 19:38:17 -05:00
root ddacc127c6 chore: update devbox packages to include Doppler 2025-01-06 18:14:55 -05:00
root edb02f3002 docs(scopes): improve keywords and add new documentation links 2025-01-06 15:10:10 -05:00
root 68e7cebb73 refactor: remove devnet and testnet network configurations 2025-01-06 14:46:39 -05:00
root eb2213f6a7 feat: add CI/CD infrastructure for development and deployment 2025-01-06 14:38:51 -05:00
root d137aa97f9 fix: correct typo in workflow name 2025-01-06 14:25:56 -05:00
github-actions[bot] b319fc5378 chore: sync version to 0.6.3 [skip ci] 2025-01-06 19:24:04 +00:00
989 changed files with 332030 additions and 115294 deletions
+14 -4
View File
@@ -1,8 +1,18 @@
[tool.commitizen] [tool.commitizen]
name = "cz_conventional_commits" name = "cz_customize"
tag_format = "v$version" tag_format = "snrd/v$version"
ignored_tag_formats = ["*/v${version}", "v${version}"]
version_scheme = "semver" version_scheme = "semver"
version = "0.6.2" version_provider = "scm"
update_changelog_on_bump = true update_changelog_on_bump = true
major_version_zero = true
changelog_file = "CHANGELOG.md" changelog_file = "CHANGELOG.md"
major_version_zero = true
annotated_tag = true
pre_bump_hooks = ["bash scripts/hook-bump-pre.sh"]
post_bump_hooks = ["goreleaser release --clean -f cmd/snrd/.goreleaser.yml"]
[tool.commitizen.customize]
bump_pattern = "^(feat|fix|refactor|perf|BREAKING CHANGE)"
bump_map = { "BREAKING CHANGE" = "MAJOR", "feat" = "MINOR", "fix" = "PATCH", "refactor" = "PATCH", "perf" = "PATCH" }
default_bump = "PATCH"
changelog_pattern = "^(feat|fix|refactor|docs|build)\\(core\\)(!)?:"
+15
View File
@@ -0,0 +1,15 @@
FROM jetpackio/devbox:latest
# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
RUN devbox run -- echo "Installed Packages." && nix-store --gc && nix-store --optimise
RUN devbox shellenv --init-hook >> ~/.profile
+14
View File
@@ -0,0 +1,14 @@
{
"name": "Devbox Remote Container",
"build": {
"dockerfile": "./Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": ["jetpack-io.devbox"]
}
},
"remoteUser": "devbox"
}
+6
View File
@@ -0,0 +1,6 @@
etc
web
packages
build
dist
test
+119
View File
@@ -0,0 +1,119 @@
# CI/CD Workflows
## Overview
Our CI/CD pipeline is optimized for speed and automation using:
- Self-hosted `builder` runner for better performance
- Smart scope detection via `github-env.sh`
- Automated versioning and releases via `devbox` commands
## Workflows
### PR CI (`pr.yml`)
**Trigger**: Pull requests
**Purpose**: Validate, test, and build changed components
**Features**:
- Only tests/builds affected scopes
- Runs linting first for fast feedback
- Cleans up artifacts after run
### Post-Merge Release (`merge.yml`)
**Trigger**: Push to master/main
**Purpose**: Automated version bumping and releases
**Features**:
- Auto-detects version increment from milestones
- Bumps versions, creates tags, and releases
- Publishes to package registries
### Nightly Snapshot (`nightly.yml`)
**Trigger**: Daily at 2 AM UTC or manual
**Purpose**: Build development snapshots
**Features**:
- Creates snapshot builds without version bumps
- Useful for testing bleeding-edge changes
### Manual Release (`manual-release.yml`)
**Trigger**: Manual workflow dispatch
**Purpose**: Override for emergency releases
**Features**:
- Select specific scope to release
- Choose version increment (patch/minor/major)
- Bypasses automatic detection
### CI Status (`ci-status.yml`)
**Trigger**: Other workflow completions
**Purpose**: Monitor CI health and report failures
## Key Commands
All workflows use these devbox commands that automatically detect changes:
```bash
devbox run test # Tests only affected scopes
devbox run build # Builds only affected scopes
devbox run bump # Bumps versions for affected scopes
devbox run release # Releases affected scopes
devbox run publish # Publishes affected scopes
devbox run snapshot # Creates snapshots for affected scopes
```
## Performance Optimizations
1. **Self-hosted Runner**: All workflows run on `builder` for:
- Local dependency caching
- No cold starts
- Unlimited build time
2. **Smart Caching**:
- Go modules cached at `~/go/pkg/mod`
- pnpm store cached at `~/.local/share/pnpm/store`
- Devbox packages cached at `~/.devbox`
3. **Scope Detection**: Only test/build what changed using `github-env.sh`
4. **Cleanup Steps**: Prevent disk fill on self-hosted runner
## Adding New Components
1. Add scope to `.github/scopes.json`:
```json
{
"name": "new-component",
"include": ["path/to/component/**"]
}
```
2. Add scripts to `devbox.json`:
```json
"test:new-component": "make test-new-component",
"build:new-component": "make build-new-component",
"bump:new-component": "make -C path/to/component bump",
"release:new-component": "make -C path/to/component release"
```
3. That's it! CI automatically picks up the new scope.
## Secrets Required
- `GH_PAT_TOKEN`: GitHub Personal Access Token for pushing tags
- `GORELEASER_KEY`: GoReleaser Pro license key
- `NPM_TOKEN`: NPM registry authentication
- `CLOUDFLARE_API_TOKEN`: For deploying web apps
- `AWS_ACCESS_KEY_ID` & `AWS_SECRET_ACCESS_KEY`: For S3 uploads
## Troubleshooting
### Workflow not detecting changes?
- Check `.github/scopes.json` includes the correct paths
- Verify `github-env.sh` is executable
- Ensure full git history with `fetch-depth: 0`
### Self-hosted runner issues?
- Check runner has required dependencies
- Verify disk space for builds
- Check runner is online in Settings > Actions > Runners
### Release not triggering?
- Verify component has `bump:*` and `release:*` scripts
- Check git permissions with PAT token
- Ensure commitizen config exists for component
+1
View File
@@ -0,0 +1 @@
@prnk28
-30
View File
@@ -1,30 +0,0 @@
title: "[Milestone] "
labels: ["#OKR", "#PLANNING"]
body:
- type: input
id: has-version
attributes:
label: Version
description: A tag for the associated milestone.
placeholder: v0.6.0
validations:
required: true
- type: textarea
attributes:
label: Objective
description: Explain the objective of the OKR in less than 100 characters.
placeholder: Ethereum IBC integration with Sonr.
render: markdown
validations:
required: true
- type: textarea
attributes:
label: Task List
description: |
Break down the objective into a list of tasks to be completed.
value: |
- [ ] #
- [ ] #
- [ ] #
validations:
required: true
-38
View File
@@ -1,38 +0,0 @@
name: Bug Report
description: File a bug report.
title: "ERROR: "
labels: ["#BUG", "#HELP"]
projects: ["onsonr/39"]
body:
- type: textarea
attributes:
label: Operating System
description: What operating system are you using?
placeholder: "Example: macOS Big Sur"
value: operating system
validations:
required: true
- type: dropdown
attributes:
label: Network
description: What network are you using?
multiple: false
options:
- LocalNet
- TestNet
- MainNet
default: 0
validations:
required: true
- type: checkboxes
attributes:
label: Code of Conduct
description:
The Code of Conduct helps create a safe space for everyone. We require
that everyone agrees to it.
options:
- label: I agree to follow this project's [Code of Conduct](link/to/coc)
required: true
- type: markdown
attributes:
value: "Thanks for completing our form!"
-5
View File
@@ -1,5 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Community Discussions
url: https://github.com/orgs/onsonr/discussions
about: Please submit ideas and suggestions here.
-22
View File
@@ -1,22 +0,0 @@
---
name: Default Todo
about: Break down feature requirements into tasks.
title: "Name of the new task"
labels:
- "#TODO"
- "#OKR"
assignees: "prnk28"
projects: "onsonr/37"
---
### Description
The expected deliverable of the task.
### Associated Files
These files will be modified by this task.
### References
Use these documents to help you complete the task.
-25
View File
@@ -1,25 +0,0 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Related Issue(s)
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
## Screenshots (if appropriate):
+317
View File
@@ -0,0 +1,317 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/sonr-io/sonr.svg)](https://pkg.go.dev/github.com/sonr-io/sonr)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/sonr-io/sonr)
[![Static Badge](https://img.shields.io/badge/homepage-sonr.io-blue?style=flat-square)](https://sonr.io)
[![Go Report Card](https://goreportcard.com/badge/github.com/sonr-io/sonr)](https://goreportcard.com/report/github.com/sonr-io/sonr)
[![Sonr](./banner.png)](https://sonr.io)
> **Sonr is a blockchain ecosystem combining decentralized identity, secure data storage, and multi-chain interoperability. Built on Cosmos SDK v0.50.14, it provides users with self-sovereign identity through W3C DIDs, WebAuthn authentication, and personal data vaults—all without requiring cryptocurrency for onboarding.**
## 💡 Key Features
### 🔐 Gasless Onboarding
Create your first decentralized identity without owning cryptocurrency:
```bash
# Register with WebAuthn (no tokens required!)
snrd auth register --username alice
# Register with automatic vault creation
snrd auth register --username bob --auto-vault
```
### 🌐 Multi-Chain Support
- **Cosmos SDK**: Native integration with IBC ecosystem
- **EVM Compatibility**: Ethereum smart contract support
- **External Wallets**: MetaMask, Keplr, and more
### 🔑 Advanced Authentication
- **WebAuthn/Passkeys**: Biometric authentication
- **Hardware Security Keys**: YubiKey, Titan Key support
- **Multi-Signature**: Multiple verification methods per DID
### 📦 Decentralized Storage
- **IPFS Integration**: Distributed file storage
- **Encrypted Vaults**: Hardware-backed encryption
- **Protocol Schemas**: Structured data validation
## 📚 Technical Specifications
- **Cosmos SDK**: v0.50.14
- **CometBFT**: v0.38.17
- **IBC**: v8.7.0
- **Go**: 1.24.1 (toolchain 1.24.4)
- **WebAssembly**: CosmWasm v1.5.8
- **Task Queue**: Asynq (Redis-based)
- **Actor System**: Proto.Actor
- **Storage**: IPFS, LevelDB
## 🔒 Security
### Gasless Transaction Security
- Limited to WebAuthn registration only
- Full cryptographic validation required
- Credential uniqueness enforcement
- Anti-replay protection
### WebAuthn Security
- Origin validation
- Challenge-response authentication
- Device binding
- Attestation verification
### Multi-Algorithm Support
- Ed25519 (quantum-resistant)
- ECDSA (secp256k1, P-256)
- RSA (2048, 3072, 4096 bits)
- WebAuthn (ES256, RS256)
## 🚀 Quick Start
### Installation
```bash
# Clone the repository
git clone https://github.com/sonr-io/sonr
cd sonr
# Install the binary
make install
# Verify installation
snrd version
```
### Running a Local Node
```bash
# Start single-node testnet (quick iteration)
make localnet
# Start multi-node testnet with Starship
make testnet-start
# Stop testnet
make testnet-stop
```
### Building from Source
```bash
# Build snrd blockchain node
make build
# Build Docker image
make docker
# Generate code from proto files
make proto-gen
```
### Local Development Network
```bash
# Standard localnet (auto-detects best method for your system)
make localnet # Works on Arch Linux, Ubuntu, macOS, etc.
# Docker-based localnet (requires Docker)
make dockernet # Runs in detached mode
# One-time setup for your system (optional)
./scripts/setup_localnet.sh # Installs dependencies and configures environment
```
### Testing
```bash
# Run all tests
make test-all
# Module-specific tests
make test-did # DID module tests
make test-dwn # DWN module tests
make test-svc # Service module tests
# E2E tests
make ictest-basic # Basic chain functionality
make ictest-ibc # IBC transfers
make ictest-wasm # CosmWasm integration
# Test with coverage
make test-cover
```
### Infrastructure
```bash
# IPFS for vault operations
make ipfs-up # Start IPFS infrastructure
make ipfs-down # Stop IPFS infrastructure
make ipfs-status # Check IPFS connectivity
```
## 🏗️ Architecture
Sonr is a Cosmos SDK-based blockchain with integrated IPFS storage and three custom modules:
### Core Components
#### **Blockchain Node (`snrd`)**
The main blockchain daemon built with Cosmos SDK v0.50.14, providing:
- AutoCLI for command generation
- EVM compatibility via Evmos integration
- IBC for cross-chain communication
- CosmWasm smart contract support
- IPFS integration for decentralized storage
## 📖 Module Documentation
### DID Module
W3C DID specification implementation with:
- **Gasless WebAuthn Registration**: Create DIDs without cryptocurrency
- **Multi-Algorithm Signatures**: Ed25519, ECDSA, RSA, WebAuthn
- **External Wallet Linking**: MetaMask, Keplr integration
- **Verifiable Credentials**: W3C-compliant credential issuance
```bash
# Create a DID
snrd tx did create-did did:sonr:alice '{"id":"did:sonr:alice",...}' --from alice
# Link external wallet
snrd tx did link-external-wallet did:sonr:alice \
--wallet-address 0x742d35Cc6635C0532925a3b8c17C6e583F4d6A42 \
--wallet-type ethereum \
--from alice
# Query DID
snrd query did resolve did:sonr:alice
```
[Full DID Module Documentation](x/did/README.md)
### DWN Module
Personal data stores with:
- **Structured Data Records**: Hierarchical data organization
- **Protocol-Based Interactions**: Enforceable data schemas
- **Secure Vaults**: Enclave-based key management
- **Multi-Chain Support**: Cosmos SDK and EVM transaction building
```bash
# Create a vault
snrd tx dwn create-vault --from alice
# Store a record
snrd tx dwn write-record '{"data":"...", "protocol":"example.com"}' --from alice
# Query records
snrd query dwn records --owner alice
```
[Full DWN Module Documentation](x/dwn/README.md)
### Service Module
Decentralized service registry featuring:
- **Domain Verification**: DNS-based ownership proof
- **Service Registration**: Verified service endpoints
- **Permission Management**: UCAN capability integration
```bash
# Verify domain ownership
snrd tx svc initiate-domain-verification example.com --from alice
snrd tx svc verify-domain example.com --from alice
# Register service
snrd tx svc register-service my-service example.com \
--permissions "read,write" --from alice
```
[Full Service Module Documentation](x/svc/README.md)
## 🔧 Configuration
### Environment Variables
Environment variables can be configured for local development:
```bash
# Chain configuration
export CHAIN_ID="localchain_9000-1"
export BLOCK_TIME="1000ms"
# Network selection for Starship
export NETWORK="devnet" # or "testnet"
# IPFS configuration
IPFS_API_URL=http://127.0.0.1:5001
```
Environment variables can be set directly or via a `.env` file in the project root.
### Starship Configuration
Edit `starship.yml` to configure multi-node testnets:
```yaml
chains:
- id: sonrtest_1-1
name: custom
numValidators: 3
image: onsonr/snrd:latest
# ... additional configuration
```
## 🏗️ Project Structure
```
sonr/
├── app/ # Application setup and module wiring
├── cmd/ # Binary entry points
│ └── snrd/ # Blockchain node
├── x/ # Custom chain modules
│ ├── did/ # W3C DID implementation
│ ├── dwn/ # Decentralized Web Nodes
│ └── svc/ # Service management
├── types/ # Internal packages
│ ├── coins/ # Coin utilities
│ └── ipfs/ # IPFS integration
├── proto/ # Protobuf definitions
├── scripts/ # Utility scripts
├── test/ # Integration tests
└── docs/ # Documentation site
```
## 🤝 Community & Support
- [GitHub Discussions](https://github.com/sonr-io/sonr/discussions) - Community forum
- [GitHub Issues](https://github.com/sonr-io/sonr/issues) - Bug reports and feature requests
- [Twitter](https://sonr.io/twitter) - Latest updates
- [Documentation Wiki](https://github.com/sonr-io/sonr/wiki) - Detailed guides
## 📄 License
Copyright © 2024 Sonr, Inc.
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for details.
---
<p align="center">
Built with ❤️ by the Sonr team
</p>
+18
View File
@@ -0,0 +1,18 @@
[scopes]
ante = ["app/ante"]
api = ["api/dex", "api/did", "api/dwn", "api/svc", "api"]
app = ["app/context", "app/decorators", "app/params", "app/upgrades", "app"]
chains = ["chains"]
ci = ["Makefile", ".github"]
cli = ["app/commands"]
cmd = ["cmd/snrd", "cmd"]
config = ["networks/localnet", "networks/testnet", "networks"]
deps = ["go.sum", "go.mod"]
dex = ["proto/dex", "x/dex"]
did = ["proto/did", "x/did"]
docs = ["docs"]
dwn = ["proto/dwn", "x/dwn"]
proto = ["proto"]
scripts = ["scripts"]
svc = ["proto/svc", "x/svc"]
test = ["test/e2e", "test/integration", "test/oauth", "test"]
Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

+28
View File
@@ -0,0 +1,28 @@
version: 2
updates:
# Go modules (main)
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
day: monday
time: "02:00"
labels:
- dependencies
- go
commit-message:
prefix: chore
include: scope
# GitHub Actions
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
day: monday
time: "03:00"
labels:
- dependencies
- ci
commit-message:
prefix: "chore(ci)"
-3
View File
@@ -1,3 +0,0 @@
"feature": ["feature/*", "feat/*"]
"bugfix": fix/*
"enhancement": enhancement/*
-249
View File
@@ -1,249 +0,0 @@
{
"scopes": [
"core-chain",
"core-ibc",
"x-did",
"x-dwn",
"x-svc",
"security-mpc",
"security-ucan",
"security-zkp",
"ci-cd",
"dev-ops"
],
"docs": [
{
"keywords": ["github", "actions", "workflows", "syntax"],
"url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions"
},
{
"keywords": ["cosmos", "tooling", "cosmovisor"],
"url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor"
},
{
"keywords": ["process-compose", "configuration"],
"url": "https://f1bonacc1.github.io/process-compose/configuration/"
},
{
"keywords": ["taskfile", "cli", "reference"],
"url": "https://taskfile.dev/reference/cli"
},
{
"keywords": [],
"url": "https://taskfile.dev/reference/schema"
},
{
"keywords": ["taskfile", "templating", "reference"],
"url": "https://taskfile.dev/reference/templating/"
},
{
"keywords": ["mkdocs", "material", "reference"],
"url": "https://squidfunk.github.io/mkdocs-material/reference/"
},
{
"keywords": ["pkl", "language", "reference"],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
},
{
"keywords": ["pwa", "service-workers", "web"],
"url": "https://web.dev/learn/pwa/service-workers/"
},
{
"keywords": ["service-workers", "web", "api"],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
},
{
"keywords": ["web-authentication", "web", "api"],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API"
},
{
"keywords": ["sdk", "modules", "cosmos", "manager"],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/module-manager"
},
{
"keywords": ["sdk", "modules", "cosmos", "messages", "queries"],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/messages-and-queries"
},
{
"keywords": ["sdk", "modules", "messages", "service", "cosmos"],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/msg-services"
},
{
"keywords": ["sdk", "modules", "services", "cosmos", "query"],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/query-services"
},
{
"keywords": ["cosmos", "depinject", "modules", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject"
},
{
"keywords": ["ibc", "apps", "sdk", "interchain-accounts"],
"url": "https://ibc.cosmos.network/v8/apps/interchain-accounts/overview/"
},
{
"keywords": ["ibc", "apps", "sdk", "transfer"],
"url": "https://ibc.cosmos.network/v8/apps/transfer/overview/"
},
{
"keywords": ["osmosis", "modules", "ibc", "assets"],
"url": "https://docs.osmosis.zone/osmosis-core/asset-info/"
},
{
"keywords": ["ibc", "osmosis", "tokenfactory", "modules", "assets"],
"url": "https://docs.osmosis.zone/osmosis-core/modules/tokenfactory"
},
{
"keywords": ["ibc", "mint", "cctp", "noble", "assets"],
"url": "https://docs.noble.xyz/cctp/mint"
},
{
"keywords": ["ibc", "relayer", "nomic", "assets"],
"url": "https://docs.nomic.io/network/ibc-relayer"
},
{
"keywords": ["ibc", "cctp", "noble", "mint_forward", "assets"],
"url": "https://docs.noble.xyz/cctp/mint_forward"
},
{
"keywords": ["evmos", "erc20", "assets"],
"url": "https://docs.evmos.org/protocol/modules/erc20"
},
{
"keywords": ["nomic", "nbtc", "assets"],
"url": "https://docs.nomic.io/nbtc"
},
{
"keywords": ["mpc", "wallet", "cryptography", "capability", "invokation"],
"url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
},
{
"keywords": ["ucan", "spec", "cryptography", "authorization"],
"url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
},
{
"keywords": ["zero-knowledge", "proofs", "cryptography", "privacy"],
"url": "https://eprint.iacr.org/2021/1672.pdf"
},
{
"keywords": ["gateway", "http", "sse"],
"url": "https://echo.labstack.com/docs/cookbook/sse"
},
{
"keywords": ["gateway", "http", "websocket"],
"url": "https://echo.labstack.com/docs/cookbook/websocket"
},
{
"keywords": ["gateway", "http", "subdomain"],
"url": "https://echo.labstack.com/docs/cookbook/subdomain"
},
{
"keywords": ["tigerbeetle", "models", "oracle"],
"url": "https://docs.tigerbeetle.com/coding/data-modeling"
},
{
"keywords": ["tigerbeetle", "two=phase", "transfers", "oracle"],
"url": "https://docs.tigerbeetle.com/coding/two-phase-transfers"
},
{
"keywords": [
"tigerbeetle",
"oracle",
"reliable",
"transaction",
"submission"
],
"url": "https://docs.tigerbeetle.com/coding/reliable-transaction-submission"
},
{
"keywords": ["currency", "exchange", "tigerbeetle", "oracle"],
"url": "https://docs.tigerbeetle.com/coding/recipes/currency-exchange"
},
{
"keywords": [
"balance",
"tigerbeetle",
"oracle",
"conditional",
"transfers"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/balance-conditional-transfers"
},
{
"keywords": ["tigerbeetle", "account", "oracle"],
"url": "https://docs.tigerbeetle.com/reference/account"
},
{
"keywords": ["tigerbeetle", "transfer", "oracle"],
"url": "https://docs.tigerbeetle.com/reference/transfer"
},
{
"keywords": ["substreams", "packages", "consumer", "oracle"],
"url": "https://docs.substreams.dev/documentation/consume/packages"
},
{
"keywords": ["substreams", "deploy", "service", "oracle"],
"url": "https://docs.substreams.dev/documentation/consume/sql/deployable-services/local-service"
},
{
"keywords": ["substreams", "tutorial", "cosmos", "injective"],
"url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
},
{
"keywords": ["worker", "http", "jwt"],
"url": "https://echo.labstack.com/docs/cookbook/jwt"
},
{
"keywords": ["worker", "http", "secure"],
"url": "https://echo.labstack.com/docs/middleware/secure"
},
{
"keywords": ["worker", "http", "service-workers", "web", "api"],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
},
{
"keywords": ["synapse", "matrix", "configuration", "usage"],
"url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html"
},
{
"keywords": ["cosmos", "protobuf", "orm", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/packages/orm"
},
{
"keywords": ["cosmos", "sdk", "modules", "auth"],
"url": "https://docs.cosmos.network/v0.50/build/modules/auth"
},
{
"keywords": ["cosmos", "sdk", "modules", "bank"],
"url": "https://docs.cosmos.network/v0.50/build/modules/bank"
},
{
"keywords": ["cosmos", "modules", "authz", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/modules/authz"
},
{
"keywords": ["cosmos", "protobuf", "collections", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/packages/collections"
},
{
"keywords": ["cosmos", "modules", "gov", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/modules/gov"
},
{
"keywords": ["cosmos", "modules", "staking", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/modules/staking"
},
{
"keywords": ["cosmos", "protobuf", "annotations", "sdk"],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations"
},
{
"keywords": ["cosmos", "sdk", "modules", "group"],
"url": "https://docs.cosmos.network/v0.50/build/modules/group"
},
{
"keywords": ["cosmos", "sdk", "modules", "nft"],
"url": "https://docs.cosmos.network/v0.50/build/modules/nft"
}
],
"next-milestone": "34"
}
@@ -0,0 +1,58 @@
[
{
"scope": "deps",
"path": "go.sum"
},
{
"scope": "deps",
"path": "go.mod"
},
{
"scope": "mdx",
"path": "docs"
},
{
"scope": "ci",
"path": "Makefile"
},
{
"scope": "ci",
"path": ".github"
},
{
"scope": "dex",
"path": "x/dex"
},
{
"scope": "dex",
"path": "proto/dex"
},
{
"scope": "did",
"path": "x/did"
},
{
"scope": "did",
"path": "proto/did"
},
{
"scope": "dwn",
"path": "x/dwn"
},
{
"scope": "dwn",
"path": "proto/dwn"
},
{
"scope": "svc",
"path": "x/svc"
},
{
"scope": "svc",
"path": "proto/svc"
},
{
"scope": "config",
"path": "networks"
}
]
-8
View File
@@ -1,8 +0,0 @@
---
title: New Testnet {{ date | date('dddd MMMM Do') }}
labels: enhancement
---
Server IP: {{ env.SERVER_IPV4_ADDR }}
SSH: `ssh -o StrictHostKeyChecking=no root@{{ env.SERVER_IPV4_ADDR }}`
Tag: {{ env.GITHUB_REF_NAME }} / Commit: {{ env.GITHUB_SHA }}
Local-Interchain API: http://{{ env.SERVER_IPV4_ADDR }}:{{ env.LOCALIC_PORT }}
+97
View File
@@ -0,0 +1,97 @@
name: Bump version
on:
push:
branches:
- master
env:
NODE_VERSION: 20
PNPM_VERSION: 10
jobs:
changes:
runs-on: ubuntu-latest
outputs:
minor: ${{ steps.check-milestone.outputs.minor }}
non-docs: ${{ steps.filter.outputs.non-docs }}
packages: ${{ steps.filter.outputs.packages }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
non-docs:
- '!docs/**'
- '!README.md'
packages:
- 'packages/**'
- 'cli/**'
- 'web/**'
- 'pnpm-lock.yaml'
# Check if any milestone has all issues closed
- name: Check milestone completion
id: check-milestone
run: |
# Get all open milestones and check if any have all issues closed
MILESTONES=$(gh api repos/${{ github.repository }}/milestones --jq '.[] | select(.state == "open") | {title, open_issues}')
# Check if any milestone has 0 open issues
MINOR_BUMP=false
while IFS= read -r milestone; do
if [ -n "$milestone" ]; then
OPEN_ISSUES=$(echo "$milestone" | jq -r '.open_issues')
TITLE=$(echo "$milestone" | jq -r '.title')
if [ "$OPEN_ISSUES" = "0" ]; then
echo "Milestone '$TITLE' is complete (0 open issues). Minor bump required."
MINOR_BUMP=true
break
fi
fi
done <<< "$(echo "$MILESTONES" | jq -c '.')"
echo "minor=$MINOR_BUMP" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GH_PAT_TOKEN }} # Handle Go/Binary versioning with commitizen
version-go:
needs: changes
if: "!startsWith(github.event.head_commit.message, 'bump:') && !startsWith(github.event.head_commit.message, 'hotfix:') && !startsWith(github.event.head_commit.message, 'Version Packages') && needs.changes.outputs.non-docs == 'true'"
runs-on: ubuntu-latest
name: "Bump Go binary version and create changelog"
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- name: Determine increment type
id: increment
run: |
# Use the version-bump.sh script to determine increment type
INCREMENT_TYPE=$(./scripts/version-bump.sh increment-type true ${{ github.repository }})
echo "type=$INCREMENT_TYPE" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
push: false
increment: ${{ steps.increment.outputs.type }}
- name: Push using ssh
run: |
git push origin master --tags
close-milestone:
needs: [changes, version-go]
if: "needs.changes.outputs.minor == 'true'"
runs-on: ubuntu-latest
name: "Close completed milestone"
steps:
- name: Check out
uses: actions/checkout@v4
- name: Close completed milestone
run: |
./scripts/version-bump.sh close-milestone ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
+129
View File
@@ -0,0 +1,129 @@
name: CD
on:
workflow_call:
inputs:
bump:
required: false
type: string
release:
required: false
type: string
publish:
required: false
type: string
deploy:
required: false
type: string
continue-on-error:
required: false
default: false
type: boolean
devbox-version:
required: false
default: 0.16.0
type: string
enable-cache:
required: false
default: false
type: boolean
fetch-depth:
required: false
default: 0
type: number
persist-credentials:
required: false
default: false
type: boolean
runs-on:
required: false
default: ubuntu-latest
type: string
jobs:
bump:
runs-on: ${{ inputs.runs-on }}
environment: staging - cd
if: ${{ inputs.test != '' }}
name: Bump
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Bump ${{ inputs.bump }}"
run: devbox run bump:${{ inputs.bump }}
if: ${{ inputs.bump != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
release:
runs-on: ${{ inputs.runs-on }}
environment: staging - cd
if: ${{ inputs.release != '' }}
name: Release
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Release ${{ inputs.release }}"
run: devbox run release:${{ inputs.release }}
if: ${{ inputs.release != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
publish:
runs-on: ${{ inputs.runs-on }}
environment: staging - publish
if: ${{ inputs.publish != '' }}
name: Publish
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Install ${{ inputs.install }}"
run: devbox run install:${{ inputs.install }}
- name: "Publish ${{ inputs.publish }}"
run: devbox run publish:${{ inputs.publish }}
if: ${{ inputs.publish != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
deploy:
runs-on: ${{ inputs.runs-on }}
environment: staging - deploy
if: ${{ inputs.deploy != '' }}
name: Deploy
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Install ${{ inputs.install }}"
run: devbox run install:${{ inputs.install }}
- name: "Deploy ${{ inputs.deploy }}"
run: devbox run deploy:${{ inputs.deploy }}
if: ${{ inputs.deploy != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
+136
View File
@@ -0,0 +1,136 @@
name: Changes
on:
workflow_call:
outputs:
modules:
description: "JSON array of changed modules"
value: ${{ jobs.detect.outputs.modules }}
core:
description: "True if core files changed"
value: ${{ jobs.detect.outputs.core }}
app:
description: "True if app files changed"
value: ${{ jobs.detect.outputs.app }}
crypto:
description: "True if crypto files changed"
value: ${{ jobs.detect.outputs.crypto }}
hway:
description: "True if highway files changed"
value: ${{ jobs.detect.outputs.hway }}
client:
description: "True if client files changed"
value: ${{ jobs.detect.outputs.client }}
packages-changes:
description: "True if JS packages changed"
value: ${{ jobs.detect.outputs.packages-changes }}
web-changes:
description: "True if web app files changed"
value: ${{ jobs.detect.outputs.web-changes }}
go-changes:
description: "True if Go files changed"
value: ${{ jobs.detect.outputs.go-changes }}
wasm-changes:
description: "True if WASM files changed"
value: ${{ jobs.detect.outputs.wasm-changes }}
docker-changes:
description: "True if Docker files changed"
value: ${{ jobs.detect.outputs.docker-changes }}
jobs:
detect:
name: Find Changes
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.set-modules.outputs.modules }}
core: ${{ steps.filter.outputs.core }}
app: ${{ steps.filter.outputs.app }}
crypto: ${{ steps.filter.outputs.crypto }}
hway: ${{ steps.filter.outputs.hway }}
client: ${{ steps.filter.outputs.client }}
packages-changes: ${{ steps.filter.outputs.packages-changes == 'true' }}
web-changes: ${{ steps.filter.outputs.web-changes == 'true' }}
go-changes: ${{ steps.filter.outputs.go-changes == 'true' }}
wasm-changes: ${{ steps.filter.outputs.wasm-changes == 'true' }}
docker-changes: ${{ steps.filter.outputs.docker-changes == 'true' }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Detect changed files
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
dex:
- 'x/dex/**'
- 'proto/sonr/dex/**'
did:
- 'x/did/**'
- 'proto/sonr/did/**'
dwn:
- 'x/dwn/**'
- 'proto/sonr/dwn/**'
svc:
- 'x/svc/**'
- 'proto/sonr/svc/**'
hway:
- 'cmd/hway/**'
- 'internal/bridge/**'
- 'internal/**'
crypto:
- 'crypto/**'
client:
- 'client/**'
- 'client/go.mod'
- 'client/go.sum'
core:
- 'app/**'
- 'cmd/**'
- 'go.mod'
- 'go.sum'
packages-changes:
- 'packages/**'
- 'pnpm-lock.yaml'
- 'package.json'
- 'tsconfig.json'
web-changes:
- 'web/**'
- 'pnpm-lock.yaml'
- 'package.json'
go-changes:
- 'app/**'
- 'x/**'
- 'cmd/**'
- 'client/**'
- 'go.mod'
- 'go.sum'
wasm-changes:
- 'cmd/vault/**'
- 'x/dwn/client/wasm/main.go'
- 'x/dwn/Makefile'
docker-changes:
- 'Dockerfile'
list-files: json
- name: Set module outputs
id: set-modules
run: |
modules=()
if [[ "${{ steps.filter.outputs.dex }}" == "true" ]]; then
modules+=("dex")
fi
if [[ "${{ steps.filter.outputs.did }}" == "true" ]]; then
modules+=("did")
fi
if [[ "${{ steps.filter.outputs.dwn }}" == "true" ]]; then
modules+=("dwn")
fi
if [[ "${{ steps.filter.outputs.svc }}" == "true" ]]; then
modules+=("svc")
fi
if [[ ${#modules[@]} -eq 0 ]]; then
echo "modules=[]" >> $GITHUB_OUTPUT
else
printf -v joined '"%s",' "${modules[@]}"
echo "modules=[${joined%,}]" >> $GITHUB_OUTPUT
fi
+101
View File
@@ -0,0 +1,101 @@
name: CI
on:
workflow_call:
inputs:
build:
required: false
type: string
snapshot:
required: false
type: string
test:
required: false
type: string
continue-on-error:
required: false
default: false
type: boolean
devbox-version:
required: false
default: 0.16.0
type: string
enable-cache:
required: false
default: false
type: boolean
fetch-depth:
required: false
default: 0
type: number
persist-credentials:
required: false
default: false
type: boolean
runs-on:
required: false
default: ubuntu-latest
type: string
jobs:
test:
runs-on: ${{ inputs.runs-on }}
environment: staging - ci
if: ${{ inputs.test != '' }}
name: Test
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Test ${{ inputs.test }}"
run: devbox run test:${{ inputs.test }}
if: ${{ inputs.test != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
build:
runs-on: ${{ inputs.runs-on }}
environment: staging - ci
if: ${{ inputs.build != '' }}
name: Build
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Build ${{ inputs.build }}"
run: devbox run build:${{ inputs.build }}
if: ${{ inputs.build != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
snapshot:
runs-on: ${{ inputs.runs-on }}
environment: staging - ci
if: ${{ inputs.snapshot != '' }}
name: Deploy
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Snapshot ${{ inputs.snapshot }}"
run: devbox run snapshot:${{ inputs.snapshot }}
if: ${{ inputs.snapshot != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
+137
View File
@@ -0,0 +1,137 @@
name: Devbox Run
on:
workflow_call:
inputs:
install:
required: true
default: go
type: string
build:
required: false
type: string
deploy:
required: false
type: string
publish:
required: false
type: string
test:
required: false
type: string
continue-on-error:
required: false
default: false
type: boolean
devbox-version:
required: false
default: 0.16.0
type: string
enable-cache:
required: false
default: false
type: boolean
fetch-depth:
required: false
default: 0
type: number
persist-credentials:
required: false
default: false
type: boolean
runs-on:
required: false
default: ubuntu-latest
type: string
jobs:
test:
runs-on: ${{ inputs.runs-on }}
environment: staging - test
if: ${{ inputs.test != '' }}
name: Test
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Install ${{ inputs.install }}"
run: devbox run install:${{ inputs.install }}
- name: "Test ${{ inputs.test }}"
run: devbox run test:${{ inputs.test }}
if: ${{ inputs.test != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
build:
runs-on: ${{ inputs.runs-on }}
environment: staging - build
if: ${{ inputs.build != '' }}
name: Build
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Install ${{ inputs.install }}"
run: devbox run install:${{ inputs.install }}
- name: "Build ${{ inputs.build }}"
run: devbox run build:${{ inputs.build }}
if: ${{ inputs.build != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
publish:
runs-on: ${{ inputs.runs-on }}
environment: staging - publish
if: ${{ inputs.publish != '' }}
name: Publish
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Install ${{ inputs.install }}"
run: devbox run install:${{ inputs.install }}
- name: "Publish ${{ inputs.publish }}"
run: devbox run publish:${{ inputs.publish }}
if: ${{ inputs.publish != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
deploy:
runs-on: ${{ inputs.runs-on }}
environment: staging - deploy
if: ${{ inputs.deploy != '' }}
name: Deploy
steps:
- name: Check out source
uses: actions/checkout@v4
with:
persist-credentials: ${{ inputs.persist-credentials }}
fetch-depth: ${{ inputs.fetch-depth }}
- name: Install devbox
uses: jetify-com/devbox-install-action@v0.13.0
with:
enable-cache: ${{ inputs.enable-cache }}
devbox-version: ${{ inputs.devbox-version }}
- name: "Install ${{ inputs.install }}"
run: devbox run install:${{ inputs.install }}
- name: "Deploy ${{ inputs.deploy }}"
run: devbox run deploy:${{ inputs.deploy }}
if: ${{ inputs.deploy != '' }}
continue-on-error: ${{ inputs.continue-on-error }}
+99
View File
@@ -0,0 +1,99 @@
name: CI
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.24.4
NODE_VERSION: 20
PNPM_VERSION: 10
permissions:
contents: read
pull-requests: read
packages: write
jobs:
detect-changes:
name: Analyze
uses: ./.github/workflows/changes.yml
client:
name: Client
needs: detect-changes
if: ${{ needs.detect-changes.outputs.client == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: go
test: client
build: client
core:
name: Core
needs: detect-changes
if: ${{ needs.detect-changes.outputs.go-changes == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: go
test: app
build: snrd
crypto:
name: Crypto
needs: detect-changes
if: ${{ needs.detect-changes.outputs.crypto == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: go
test: crypto
docker:
name: Docker
needs: detect-changes
if: ${{ needs.detect-changes.outputs.docker-changes == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: go
build: docker
hway:
name: Highway
needs: detect-changes
if: ${{ needs.detect-changes.outputs.hway == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: go
build: hway
packages:
name: Packages
needs: detect-changes
if: ${{ needs.detect-changes.outputs.packages-changes == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: pnpm
test: packages
web:
name: Web
needs: detect-changes
if: ${{ needs.detect-changes.outputs.web-changes == 'true' }}
uses: ./.github/workflows/devbox.yml
with:
install: pnpm
test: web
x-modules:
name: X
needs: detect-changes
if: ${{ needs.detect-changes.outputs.modules != '[]' && needs.detect-changes.outputs.modules != '' }}
strategy:
matrix:
module: ${{ fromJSON(needs.detect-changes.outputs.modules) }}
fail-fast: false
uses: ./.github/workflows/devbox.yml
with:
install: go
test: ${{ matrix.module }}
+406
View File
@@ -0,0 +1,406 @@
name: Release
# This workflow handles the complete release process:
# 1. Build binaries for multiple platforms (snrd, hway)
# 2. Build WASM modules (vault, motor)
# 3. Publish to GitHub releases, S3, and package registries
# 4. Build and push Docker images for all services
# 5. Publish NPM packages
# 6. Push protobuf definitions to Buf Schema Registry
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # ignore rc
workflow_dispatch:
permissions:
contents: write
packages: write
id-token: write
jobs:
# Prepare job runs on multiple OS for native builds
prepare:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
runs-on: ${{ matrix.os }}
env:
flags: ""
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: "**/*.sum"
- name: Install dependencies
run: |
go mod download
# Build WASM modules
make build-motr
make build-vault
# Set flags for workflow dispatch (nightly builds)
- if: ${{ github.event_name == 'workflow_dispatch' }}
shell: bash
run: |
echo "flags=--nightly" >> $GITHUB_ENV
# Generate cache key
- shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Cache the built artifacts
- uses: actions/cache@v4
with:
path: dist/${{ matrix.goos }}
key: ${{ matrix.goos }}-${{ matrix.goarch }}-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
# Run goreleaser in split mode for snrd
- name: Run GoReleaser for snrd (Split)
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: release --clean --split --config cmd/snrd/.goreleaser.yml ${{ env.flags }}
workdir: cmd/snrd
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GGOOS: ${{ matrix.goos }}
GGOARCH: ${{ matrix.goarch }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Run goreleaser in split mode for hway
- name: Run GoReleaser for hway (Split)
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: release --clean --split --config cmd/hway/.goreleaser.yml ${{ env.flags }}
workdir: cmd/hway
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GGOOS: ${{ matrix.goos }}
GGOARCH: ${{ matrix.goarch }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# WASM modules build job
wasm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
- name: Setup TinyGo
uses: acifani/setup-tinygo@v2
with:
tinygo-version: '0.32.0'
- name: Build WASM modules
run: |
# Build vault WASM
cd cmd/vault
make build
cd ../..
# Build motor WASM
cd cmd/motr
make build
cd ../..
- name: Run GoReleaser for WASM modules
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: release --clean --config cmd/vault/.goreleaser.yml
workdir: cmd/vault
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Run GoReleaser for Motor WASM
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: release --clean --config cmd/motr/.goreleaser.yml
workdir: cmd/motr
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Merge and release job combines all artifacts
release:
runs-on: ubuntu-latest
needs: [prepare, wasm]
env:
flags: ""
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
cache-dependency-path: "**/*.sum"
# Set flags for workflow dispatch
- if: ${{ github.event_name == 'workflow_dispatch' }}
shell: bash
run: |
echo "flags=--nightly" >> $GITHUB_ENV
# Generate cache key
- shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Restore all cached artifacts from prepare jobs
- name: Restore Linux AMD64 artifacts
uses: actions/cache@v4
with:
path: dist/linux
key: linux-amd64-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Restore Linux ARM64 artifacts
uses: actions/cache@v4
with:
path: dist/linux
key: linux-arm64-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Restore Darwin AMD64 artifacts
uses: actions/cache@v4
with:
path: dist/darwin
key: darwin-amd64-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
- name: Restore Darwin ARM64 artifacts
uses: actions/cache@v4
with:
path: dist/darwin
key: darwin-arm64-${{ env.sha_short }}${{ env.flags }}
enableCrossOsArchive: true
# Merge and publish the release for snrd
- name: Run GoReleaser for snrd (Merge)
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: continue --merge --config cmd/snrd/.goreleaser.yml ${{ env.flags }}
workdir: cmd/snrd
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Merge and publish the release for hway
- name: Run GoReleaser for hway (Merge)
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: continue --merge --config cmd/hway/.goreleaser.yml ${{ env.flags }}
workdir: cmd/hway
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Protobuf publishing job
protobuf:
runs-on: ubuntu-latest
needs: release
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Buf
uses: bufbuild/buf-setup-action@v1
with:
version: latest
- name: Push to Buf Schema Registry
uses: bufbuild/buf-push-action@v1
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
github_token: ${{ secrets.GH_PAT_TOKEN }}
# NPM packages publishing job
npm:
runs-on: ubuntu-latest
needs: release
if: github.event_name == 'push' # Only on tag push, not workflow_dispatch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Publish packages
run: |
# Update package versions to match git tag
export VERSION=${GITHUB_REF#refs/tags/v}
bash scripts/version-bump.sh sync-packages all
# Publish to npm
pnpm --filter "./packages/*" publish --access public --no-git-checks
pnpm --filter "./cli/*" publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Docker multi-platform build job
docker:
runs-on: ubuntu-latest
needs: release
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- service: snrd
dockerfile: cmd/snrd/Dockerfile
description: "Sonr blockchain daemon"
- service: hway
dockerfile: cmd/hway/Dockerfile
description: "Highway service - task processor"
- service: auth
dockerfile: web/auth/Dockerfile
description: "Authentication web application"
- service: dash
dockerfile: web/dash/Dockerfile
description: "Dashboard web application"
- service: postgres
dockerfile: etc/postgres/Dockerfile
description: "PostgreSQL with extensions"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/sonr-io/${{ matrix.service }}
onsonr/${{ matrix.service }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
type=raw,value=${{ inputs.tag || 'latest' }},enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Build and push ${{ matrix.service }}
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.description=${{ matrix.description }}
cache-from: type=gha,scope=${{ matrix.service }}
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
-98
View File
@@ -1,98 +0,0 @@
name: Check PR
on:
pull_request:
merge_group:
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
jobs:
verify-pr:
name: Test Lints
if: github.event_name == 'pull_request'
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to fetch all history for merging
- uses: TimonVS/pr-labeler-action@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
- name: Trunk Check
uses: trunk-io/trunk-action@v1
test-builds:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Test Builds
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Run Sonrd Build
run: make build
test-unit:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Test Unit
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- run: make test-unit
validate-release:
if: github.event_name == 'merge_group' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Test Version
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Version Check
run: make validate-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check GoReleaser Config
run: make release-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+18
View File
@@ -0,0 +1,18 @@
name: CI Status
on:
workflow_run:
workflows: ["PR CI", "Post-Merge Release", "Nightly Snapshot"]
types: [completed]
jobs:
report:
name: Report CI Status
runs-on: tenki-standard-autoscale
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Report Failure
run: |
echo "❌ Workflow Failed: ${{ github.event.workflow_run.name }}"
echo "Branch: ${{ github.event.workflow_run.head_branch }}"
echo "Commit: ${{ github.event.workflow_run.head_sha }}"
echo "URL: ${{ github.event.workflow_run.html_url }}"
-68
View File
@@ -1,68 +0,0 @@
name: Merge Group
on:
merge_group:
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
jobs:
test-race:
runs-on: ubuntu-latest
if: github.event_name == 'merge_group'
name: Test Race
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- run: make test-race
test-cover:
runs-on: ubuntu-latest
if: github.event_name == 'merge_group'
name: Test Coverage
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- run: make test-cover
test-release:
runs-on: ubuntu-latest
name: Test Release
if: github.event_name == 'merge_group'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Release Dry Run
run: make release-dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-124
View File
@@ -1,124 +0,0 @@
name: Post Merge
on:
pull_request:
types: [closed]
push:
tags:
- v*
branches:
- main
permissions:
contents: write
issues: write
jobs:
sync-version:
name: Sync Version
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
branch: main
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
fetch-tags: true
- name: Update Version
run: |
# Get tag without 'v' prefix
TAG_VERSION=${GITHUB_REF#refs/tags/v}
# Checkout main branch
git fetch origin main
git checkout main
# Update version in .cz.toml
sed -i "s/^version = \".*\"/version = \"$TAG_VERSION\"/" .cz.toml
# Configure git
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Commit and push if there are changes
if git diff --quiet; then
echo "Version already synchronized"
else
git add .cz.toml
git commit -m "chore: sync version to ${TAG_VERSION} [skip ci]"
git push origin main
fi
bump-version:
name: Cz Bump
if: |
github.event.pull_request.merged == true &&
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.event.pull_request.user.login != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
push: false
increment: patch
branch: main
- name: Push using ssh
run: |
git push origin main --tags
new-release:
name: Create Release
needs: [sync-version]
if: startsWith(github.ref, 'refs/tags/')
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Fetch Release Date
run: |
echo "RELEASE_DATE=$(date +%Y).$(date +%V).$(date +%u)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
GITHUB_PERSONAL_AUTH_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
REDDIT_APP_ID: ${{ secrets.REDDIT_APP_ID }}
REDDIT_SECRET: ${{ secrets.REDDIT_SECRET }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
RELEASE_DATE: ${{ env.RELEASE_DATE }}
+60
View File
@@ -0,0 +1,60 @@
name: PR CI
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: pr-${{ github.head_ref }}
cancel-in-progress: true
env:
DEVBOX_VERSION: 0.16.0
jobs:
validate:
name: Validate & Test
runs-on: tenki-standard-autoscale
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Required for github-env.sh comparisons
# Cache can be local on self-hosted runner for better performance
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.devbox
key: deps-builder-${{ hashFiles('go.sum', 'devbox.json') }}
restore-keys: deps-builder-
- name: Install Dependencies
run: devbox install
- name: Test Affected Scopes
run: |
echo "🔍 Analyzing changes..."
./scripts/github-env.sh git-context
echo ""
devbox run test
- name: Build Affected Scopes
run: devbox run build
- name: Verify Build Artifacts
run: |
# Verify critical build outputs exist
if [ -d "build/" ]; then
ls -la build/
fi
# Cleanup workspace for self-hosted runner
- name: Cleanup
if: always()
run: |
# Clean build artifacts to prevent disk fill
make clean || true
# Keep caches but remove build outputs
rm -rf dist/ build/ || true
-66
View File
@@ -1,66 +0,0 @@
name: Post Release
on:
release:
types: [published]
permissions:
contents: write
issues: write
jobs:
buf_push:
name: Publish Protobufs
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v4
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
# Push only the Input in `proto` to the BSR
- uses: bufbuild/buf-push-action@v1
continue-on-error: true
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
container-push:
name: Publish Docker Images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/onsonr/sonr:latest
docs-push:
runs-on: ubuntu-latest
name: Publish Tech Docs
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
Regular → Executable
+106 -92
View File
@@ -1,111 +1,125 @@
# Aider related generated files # ======================================
.aider-context # Sonr Blockchain & Monorepo .gitignore
# ======================================
# Binaries # ===== Operating System Files =====
.task
no
.data
schemas
*.db
tools-stamp
*.exe
*.exe~
*.dll
*.so
*.dylib
*.app
.DS_Store .DS_Store
.session.vim Thumbs.db
aof* *~
dist *.swp
**/.haptic *.swo
static .logs/
pkg/webapp/dist .venv/
.agent services/
Taskfile*
mprocs*
.claude*
# Test binary # ===== IDE & Editor Files =====
.vscode/
.idea/
*.tmp
.aider*
.opencode
# ===== Build Artifacts & Binaries =====
*.wasm
bin/
dist/
dist*/
build/
out/
*.test *.test
.devon* *.wasm
**/.DS_Store
.task
.wrangler
# Output of the go coverage tool # Go binaries (but allow docs references)
*.out snrd
tmp !cmd/snrd/
# Exclude embedded files
!internal/files/dist
# Dependency directories # Allow specific CLI binaries
node_modules/ !cli/join-testnet/bin/
!cli/install/bin/
# Go workspace file # ===== Removed: Node.js & Frontend (no longer needed for blockchain-only repo) =====
# node_modules/
# .pnpm-debug.log*
# pnpm-debug.log*
# package-lock.json
# yarn.lock
# *.tsbuildinfo
# .next/
# .vercel/
# **/.open-next
# ===== Go Development =====
pkg/mod/
go.work go.work
go.work.sum go.work.sum
go.work.mod
coverage.out
coverage.txt
profile.out
*.cover
# Environment files # ===== Rust/CosmWasm Development =====
.env target/
**/*.env Cargo.lock
**/sonr.log artifacts/
**/target/
**/Cargo.lock
# ===== Blockchain & Cosmos SDK =====
.snrd/
keyring-test/
mytestnet/
docker/testnet/testnet-data
# Terraform # ===== Build Tools =====
**/.terraform/* .devbox/
.terraform .task*
*.tfstate Taskfile.yml
*.tfstate.*
crash.log
crash.*.log
*.tfvars
*.tfvars.json
override.tf
override.tf.json
*_override.tf
*_override.tf.json
.terraformrc # ===== Testing & Coverage =====
terraform.rc testdata/
flake.lock coverage/
# Misc # ===== Logs & Temporary Files =====
.DS_Store logs/
.tmp/
tmp/
**/*tmp*/
*.tmp
*.log *.log
*.dot
*.pem
dist/
bin/
build/
.devbox
.ignore
.opencommitignore
heighliner*
sonr
deploy/**/data
x/.DS_Store
.aider*
buildenv*
node_modules
cmd/gateway/node_modules
pkg/nebula/node_modules
configs/logs.json configs/logs.json
tmp/
tmp*
tmp-openapi-gen/
mprocs.yaml # ===== Environment & Secrets =====
build .env
sonr.wiki .env.local
.env.production
.env.development
*.key
*.pem
!devbox.lock # ===== Documentation & Planning =====
!buf.lock PLAN.md
ANALYSIS.md
COMPLETION_SUMMARY.md
**/CLAUDE.md
.air.toml # ===== Miscellaneous =====
mprocs.yaml .claude/
mprocs.log **/.claude
tools-stamp .gmap
sonr.log .aim
deploy/conf .spawn
.wrangler/
interchaintest-downloader .browser-echo-mcp.json
.haptic data/
compose/
heighliner*
# Ignore individual module OpenAPI files (generated in tmp directory)
tmp-openapi-gen/**/*.json
# Allow the final combined openapi.yml
!docs/static/openapi.yml
.mcp.json
node_modules
.claude
+91
View File
@@ -0,0 +1,91 @@
#jsonschema:https://golangci-lint.run/jsonschema/golangci.jsonschema.json
version: "2"
linters:
enable:
- govet
- ineffassign
- misspell
- unconvert
- staticcheck
- errcheck
- gosec
- goconst
- prealloc
- dupl
- whitespace
disable:
- exhaustruct
settings:
govet:
enable-all: true
disable:
- fieldalignment
gocyclo:
min-complexity: 15
dupl:
threshold: 100
goconst:
min-len: 3
min-occurrences: 3
funlen:
lines: 100
statements: 50
gocognit:
min-complexity: 20
gocritic:
enabled-checks:
- nilValReturn
- rangeExprCopy
revive:
confidence: 0.8
rules:
- name: exported
arguments: [checkPrivateReceivers, sayRepetitiveInsteadOfStutters]
staticcheck:
checks:
[
"all",
"-SA1019",
"-SA1029",
"-SA2002",
"-SA4006",
"-ST1021",
"-S1004",
"-ST1003",
"-ST1005",
"-ST1016",
]
gosec:
excludes:
- G204 # Subprocess launched with function call as argument or cmd arguments
- G404 # Weak random number generator
- G115 # Weak random number generator
formatters:
enable:
- gofmt
- gofumpt
- goimports
- golines
exclusions:
warn-unused: true
generated: strict
paths:
- ".*\\.pb\\.go$"
- ".*\\.pulsar\\.go$"
- ".*\\.cosmos_orm\\.go$"
- ".*\\._orm\\.go$"
- "types/webauthn/.*\\.go$"
issues:
max-issues-per-linter: 0
max-same-issues: 0
new: true
fix: true
run:
timeout: 5m
relative-path-mode: gomod
issues-exit-code: 2
tests: true
modules-download-mode: readonly
allow-parallel-runners: true
allow-serial-runners: true
concurrency: 8
-106
View File
@@ -1,106 +0,0 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
version: 2
project_name: sonr
before:
hooks:
- echo "Release date is {{ .Env.RELEASE_DATE }}"
builds:
- id: sonr
main: ./cmd/sonrd
binary: sonrd
mod_timestamp: "{{ .CommitTimestamp }}"
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goamd64:
- v1
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sonr
- -X github.com/cosmos/cosmos-sdk/version.AppName=sonrd
- -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
tags:
- netgo
- ledger
archives:
- id: sonr
builds: [sonr]
name_template: >-
sonr_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format: tar.gz
files:
- src: README*
wrap_in_directory: true
nfpms:
- id: sonr
package_name: sonrd
file_name_template: "sonrd_{{ .Os }}_{{ .Arch }}{{ .ConventionalExtension }}"
builds: [sonr]
vendor: Sonr
homepage: "https://onsonr.dev"
maintainer: "Sonr <support@onsonr.dev>"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
license: "Apache 2.0"
formats:
- rpm
- deb
- apk
dependencies:
- ipfs
contents:
- src: README*
dst: /usr/share/doc/sonrd
bindir: /usr/bin
section: net
priority: optional
# Add these lines to match build config
brews:
- name: sonr
ids: [sonr]
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
directory: Formula
caveats: "Run a local sonr node and access it with the hway proxy"
homepage: "https://onson.dev"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
dependencies:
- name: ipfs
repository:
owner: onsonr
name: homebrew-tap
branch: master
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
release:
github:
owner: onsonr
name: sonr
name_template: "{{ .Tag }} | {{ .Env.RELEASE_DATE }}"
draft: false
replace_existing_draft: true
replace_existing_artifacts: true
extra_files:
- glob: ./README*
- glob: ./scripts/install.sh
- glob: ./scripts/test_node.sh
- glob: ./scripts/test_ics_node.sh
announce:
telegram:
enabled: true
chat_id: -1002222617755
+329
View File
@@ -0,0 +1,329 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
---
version: 2
dist: dist/snrd
project_name: snrd
before:
hooks:
- go mod download
builds:
# Darwin AMD64 Build
- id: snrd-darwin-amd64
main: ./cmd/snrd
binary: snrd
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
- CGO_LDFLAGS=-lm
goos:
- darwin
goarch:
- amd64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sonr
- -X github.com/cosmos/cosmos-sdk/version.AppName=snrd
- -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
- -s -w
tags:
- netgo
- ledger
# Darwin ARM64 Build
- id: snrd-darwin-arm64
main: ./cmd/snrd
binary: snrd
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
- CGO_LDFLAGS=-lm
goos:
- darwin
goarch:
- arm64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sonr
- -X github.com/cosmos/cosmos-sdk/version.AppName=snrd
- -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
- -s -w
tags:
- netgo
- ledger
# Linux AMD64 Build
- id: snrd-linux-amd64
main: ./cmd/snrd
binary: snrd
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
- CGO_LDFLAGS=-lm
goos:
- linux
goarch:
- amd64
goamd64:
- v1
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sonr
- -X github.com/cosmos/cosmos-sdk/version.AppName=snrd
- -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
- -s -w
tags:
- netgo
- ledger
# Linux ARM64 Build
- id: snrd-linux-arm64
main: ./cmd/snrd
binary: snrd
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- CGO_LDFLAGS=-lm
goos:
- linux
goarch:
- arm64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sonr
- -X github.com/cosmos/cosmos-sdk/version.AppName=snrd
- -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
- -s -w
tags:
- netgo
- ledger
aur_sources:
- name: snrd
disable: true
homepage: "https://sonr.io"
description: "Sonr blockchain daemon - decentralized identity and data storage network"
maintainers:
- "Sonr <support@sonr.io>"
license: "GPL-3.0"
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://[email protected]/snrd.git"
skip_upload: auto
provides:
- snrd
conflicts:
- snrd-bin
depends:
- glibc
makedepends:
- go
- git
- make
commit_msg_template: "Update to {{ .Tag }}"
commit_author:
name: goreleaserbot
email: "prad@sonr.io"
prepare: |-
cd "${pkgname}_${pkgver}"
go mod download
build: |-
cd "${pkgname}_${pkgver}"
export CGO_ENABLED=1
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
go build \
-ldflags="-w -s -buildid='' -linkmode=external \
-X github.com/cosmos/cosmos-sdk/version.Name=sonr \
-X github.com/cosmos/cosmos-sdk/version.AppName=snrd \
-X github.com/cosmos/cosmos-sdk/version.Version=${pkgver} \
-X 'github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger'" \
-tags "netgo,ledger" \
-o snrd ./cmd/snrd
chmod +x ./snrd
package: |-
cd "${pkgname}_${pkgver}"
# bin
install -Dm755 "./snrd" "${pkgdir}/usr/bin/snrd"
# license
if [ -f "./LICENSE" ]; then
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/snrd/LICENSE"
fi
# readme
if [ -f "./README.md" ]; then
install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/snrd/README.md"
fi
# config directory
install -dm755 "${pkgdir}/etc/snrd"
install -dm755 "${pkgdir}/var/lib/snrd"
backup:
- /etc/snrd/config.toml
- /etc/snrd/app.toml
nix:
- name: snrd
ids:
- snrd
homepage: "https://sonr.io"
description: "Sonr blockchain daemon - decentralized identity network"
license: "gpl3"
path: pkgs/snrd/default.nix
commit_msg_template: "snrd: {{ .Tag }}"
dependencies:
- stdenv
- glibc
extra_install: |-
wrapProgram $out/bin/snrd --prefix PATH : ${lib.makeBinPath [ glibc stdenv.cc.cc.lib ]}
repository:
owner: sonr-io
name: nur
branch: main
token: "{{ .Env.GITHUB_TOKEN }}"
archives:
- id: snrd
ids:
- snrd-linux-amd64
- snrd-linux-arm64
- snrd-darwin-amd64
- snrd-darwin-arm64
name_template: >-
snrd_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }}
formats: ["tar.gz"]
files:
- src: README*
wrap_in_directory: false
homebrew_casks:
- name: snrd
ids:
- snrd
homepage: "https://sonr.io"
description: "Sonr blockchain daemon - decentralized identity and data storage network"
commit_msg_template: "Brew cask update for {{ .ProjectName }} version {{ .Tag }}"
directory: Casks
repository:
owner: sonr-io
name: homebrew-tap
branch: main
token: "{{ .Env.GITHUB_TOKEN }}"
commit_author:
name: goreleaserbot
email: "prad@sonr.io"
hooks:
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/snrd"]
end
nfpms:
- id: snrd
package_name: snrd
ids:
- snrd-linux-amd64
- snrd-linux-arm64
file_name_template: "snrd_{{ .Os }}_{{ .Arch }}{{ .ConventionalExtension }}"
vendor: Sonr
homepage: "https://sonr.io"
maintainer: "Sonr <support@sonr.io>"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
license: "GPL-3.0"
formats:
- rpm
- deb
- apk
- archlinux
contents:
- src: README*
dst: /usr/share/doc/snrd
bindir: /usr/bin
section: net
priority: optional
blobs:
- provider: s3
endpoint: https://eb37925850388bca807b7fab964c12bb.r2.cloudflarestorage.com
bucket: releases
region: auto
directory: "snrd/{{ .Tag }}"
ids:
- snrd
release:
disable: false
github:
owner: sonr-io
name: sonr
name_template: "{{ .Tag }}"
draft: false
replace_existing_draft: false # Don't replace drafts
replace_existing_artifacts: false # Append, don't replace
mode: append # Explicitly set to append mode
checksum:
name_template: "snrd_checksums.txt"
npms:
- name: "@sonr.io/snrd"
ids:
- snrd
description: "Sonr blockchain daemon - decentralized identity and data storage network"
homepage: "https://sonr.io"
license: "GPL-3.0"
author: "Sonr <support@sonr.io>"
repository: "https://github.com/sonr-io/sonr"
bugs: "https://github.com/sonr-io/sonr/issues"
keywords:
- blockchain
- cosmos
- did
- identity
- web3
- sonr
access: public
format: tar.gz
snapshot:
version_template: "{{ .Branch }}-{{ .ShortCommit }}-dev"
# Changelog configuration
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
+14
View File
@@ -0,0 +1,14 @@
.dockerignore
.goreleaser.yml
api
proto
test
**/_test.go
.golangci.yml
tsconfig.json
pnpm-workspace.yaml
biome.json
CLAUDE.md
CONSTITUTION.md
CHANGELOG.md
Caddyfile
-9
View File
@@ -1,9 +0,0 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
-27
View File
@@ -1,27 +0,0 @@
linters:
disable:
- unused # Disables unreachable code checking
run:
# Exclude test files from analysis
tests: false
# Define which files and directories to exclude
issues:
exclude-rules:
# Exclude all test files
- path: _test\.go
linters:
- all
# Exclude specific directories
exclude-dirs:
- api/did/v1
- api/dwn/v1
- api/svc/v1
- internal
# Exclude specific file patterns
exclude-files:
- ".*\\.pb\\.go$"
- ".*_templ\\.go$"
-4
View File
@@ -1,4 +0,0 @@
# Following source doesn't work in most setups
ignored:
- SC1090
- SC1091
-2
View File
@@ -1,2 +0,0 @@
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier
-1
View File
@@ -1 +0,0 @@
edition = "2021"
-7
View File
@@ -1,7 +0,0 @@
enable=all
source-path=SCRIPTDIR
disable=SC2154
# If you're having issues with shellcheck following source, disable the errors via:
# disable=SC1090
# disable=SC1091
-7
View File
@@ -1,7 +0,0 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
-41
View File
@@ -1,41 +0,0 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.8
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.6.6
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- go@1.23.0
- node@18.20.5
- python@3.10.8
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- actionlint@1.7.6
- checkov@3.2.347
- clippy@1.65.0
- git-diff-check
- gofmt@1.20.4
- golangci-lint@1.62.2
- hadolint@2.12.1-beta
# - markdownlint@0.43.0
- osv-scanner@1.9.2
- prettier@3.4.2
- rustfmt@1.65.0
# - shellcheck@0.10.0
# - shfmt@3.6.0
- taplo@0.9.3
- trufflehog@3.88.0
actions:
enabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available
+769 -562
View File
File diff suppressed because it is too large Load Diff
+197
View File
@@ -0,0 +1,197 @@
# Sonr Blockchain Constitution
## Preamble
We, the members of the Sonr Network Community, establish this Constitution to govern the decentralized ecosystem built upon the principles of self-sovereign identity, user-controlled authentication, and distributed consensus. This Constitution defines the governance framework for the Sonr blockchain, operated under the stewardship of the Decentralized Identity DAO LC (diDAO), a Wyoming Decentralized Unincorporated Nonprofit Association (DUNA), dedicated to advancing decentralized identity infrastructure for the benefit of all participants.
The Sonr Network operates through a dual-token system, with SNR serving as the governance token and uSNR as the base denomination, enabling democratic participation while maintaining operational efficiency through authentication-based revenue generation and cryptographic security anchored in users personal Motr vaults.
This Constitution serves as the immutable foundation of our governance, establishing the rights, responsibilities, and procedures that will guide Sonr through technological evolution, regulatory changes, and societal transformation while maintaining our core mission of human-centric identity protection for the next 100 years and beyond.
## Article I: Mission, Values, and Foundational Principles
### Section 1: Constitutional Mission
The Sonr Network commits to building a Digital Identity System capable of protecting humanity for the next 100 years and beyond. This network serves as a perpetual guardian of human digital identity, balancing technological innovation with fundamental rights protection through democratic governance, technical excellence, and unwavering commitment to privacy.
### Section 2: Core Values and Inviolable Principles
The Sonr Network operates on these inviolable principles that form the bedrock of all network operations.
Human Sovereignty establishes that every individual possesses inherent rights to control their digital identity and personal data. The network recognizes that identity ownership represents a fundamental human right that cannot be compromised, transferred to third parties, or subjected to external control mechanisms.
Privacy by Design requires that privacy protection must be embedded at the protocol level, not added as an afterthought. All network operations implement privacy-preserving technologies by default, ensuring user data remains confidential and secure throughout all interactions and transactions.
Decentralization mandates that no single entity shall control identity verification, data access, or governance processes. The network maintains distributed control across validators, token holders, and the broader community to prevent centralized points of failure or manipulation.
Interoperability ensures that identity solutions must work seamlessly across all chains and systems. Users maintain consistent identity across different platforms and applications while preserving privacy and security, enabling universal digital identity portability.
Perpetual Accessibility requires that the network must remain accessible to all humanity regardless of technological sophistication, economic status, geographic location, or any other discriminating factors. Universal usability and inclusion remain paramount design considerations.
Quantum Resilience mandates that all cryptographic systems must evolve proactively to maintain security against emerging threats, including quantum computing advances and other technological developments that could compromise traditional security models.
### Section 3: Rights and Obligations
All users of the Sonr Network possess these inalienable rights. Identity Sovereignty encompasses complete ownership and control over ones digital identity and associated data, with no external entity possessing override authority over individual identity decisions. Selective Disclosure provides the ability to share only necessary information for specific purposes, maintaining privacy while enabling required verifications and interactions. Data Portability ensures freedom to export identity data and migrate between systems without restriction or penalty, preventing vendor lock-in and maintaining user autonomy. Consent Granularity delivers fine-grained control over data usage permissions, allowing users to specify exactly how, when, and where their information may be utilized. Erasure Rights enable users to request deletion of personal data in compliance with privacy regulations while maintaining network integrity and security. Access Equality guarantees equal access to network services regardless of stake size, geographic location, or socioeconomic status, ensuring universal participation opportunities.
All network participants accept these fundamental obligations. Privacy Protection requires commitment to protecting user privacy and data sovereignty through both technical implementation and operational practices. Network Security encompasses responsibility to maintain network integrity, report vulnerabilities through appropriate channels, and contribute to overall system resilience. Governance Participation mandates active participation in governance processes when holding staked tokens, ensuring democratic legitimacy through stakeholder engagement. Regulatory Compliance involves adherence to applicable laws while preserving user privacy and maintaining the networks decentralized character. Transparency requires open communication about network operations, decision-making processes, and any conflicts of interest that might affect network governance.
### Section 4: Identity-Specific Governance Framework
The network implements multi-level verification tiers ranging from self-attested to cryptographically verified credentials. Privacy-preserving verification utilizes zero-knowledge proofs to enable authentication without revealing underlying personal data. Decentralized reputation systems provide community-driven trust mechanisms while maintaining user anonymity. Biometric data protection standards ensure the highest level of security for biological identifiers. Recovery mechanisms for compromised identities include social recovery protocols and hardware security module integration.
Governance approval processes determine authorization for trusted credential issuers within the network ecosystem. Standardized schemas for common credentials enable interoperability while maintaining flexibility for emerging use cases. Privacy-preserving credential revocation mechanisms allow for credential invalidation without compromising user privacy. Cross-chain recognition agreements establish mutual credential recognition with other blockchain networks and traditional identity systems.
All network operations collect only essential data required for stated purposes, implementing selective disclosure by default across all interactions. Zero-knowledge proofs enable verification without data revelation whenever technically feasible. Sensitive data receives encryption protection both at rest and in transit using industry-leading cryptographic standards. Users maintain granular consent management systems enabling fine-tuned control over data access and usage permissions. Real-time data access logs provide complete transparency regarding who accessed what information and when. Immediate revocation capabilities allow users to withdraw consent and access permissions instantly. Complete data portability ensures users can export their identity data and migrate between systems without restrictions.
### Section 5: Long-Term Sustainability and Evolution
The network commits to hundred-year sustainability through establishment of endowment funds sourced from the community treasury. Technology-agnostic governance frameworks ensure adaptability as underlying technologies evolve over decades. Succession planning addresses all critical roles to prevent single points of failure across extended timeframes. Regular ten-year strategic reviews assess network direction and adjust long-term planning accordingly.
Annual governance effectiveness reviews evaluate and improve decision-making processes based on outcomes and community feedback. Adaptive parameter adjustment mechanisms enable network optimization based on growth patterns and usage metrics. Continuous integration of privacy-enhancing technologies ensures the network remains at the forefront of privacy protection. Proactive regulatory compliance updates anticipate and address changing legal landscapes across multiple jurisdictions.
Emergency response protocols address potential network disruptions, security breaches, and governance attacks. Crisis management procedures enable rapid response while maintaining democratic oversight and accountability. Validator coordination mechanisms ensure network continuity during technical emergencies or coordinated attacks. Recovery procedures establish clear processes for restoring normal operations following any network disruption.
### Section 6: Technical Standards and Compliance
Full compliance with W3C Decentralized Identifier specifications includes proper DID Method implementation and registration with appropriate standards bodies. Verifiable Credentials standards adherence ensures interoperability with existing and emerging digital credential ecosystems. Resolution and dereferencing compatibility enables seamless integration with external systems and applications. Cross-platform interoperability requirements ensure broad accessibility across different technological platforms.
Implementation of NIST post-quantum standards including FIPS 203, 204, and 205 algorithms ensures long-term security against quantum computing threats. Cryptographic agility enables smooth transitions between cryptographic algorithms as new standards emerge. Emergency upgrade procedures address immediate cryptographic threats through rapid deployment mechanisms. Regular security audits verify quantum resistance and overall cryptographic security posture.
GDPR data protection requirements integration ensures European privacy standard compliance while maintaining decentralized architecture. CCPA privacy rights implementation provides California residents with required privacy protections and controls. Cross-jurisdictional privacy standards ensure broad regulatory compliance across multiple legal frameworks. User consent and data sovereignty mechanisms provide granular control while meeting regulatory requirements.
### Section 7: Constitutional Supremacy and Immutable Provisions
This Constitution represents the supreme governance document of the Sonr Network. Any governance proposal, validator action, network upgrade, or diDAO decision that contradicts these constitutional provisions shall be considered null and void.
The following provisions cannot be amended through any governance mechanism: the core mission of protecting human digital identity sovereignty for the next century and beyond, privacy-by-design requirements embedded in all network operations and future developments, user data ownership rights and control mechanisms ensuring individual autonomy, decentralization principles preventing any form of centralized control or authority, and the commitment to serve all of humanitys identity needs regardless of technological evolution.
## Article II: Token Economics
### Section 1: Token Structure
The governance token SNR serves as the primary token for network governance, staking, and ecosystem participation. The base denomination uSNR represents the smallest unit of account, where 1 SNR equals 1,000,000 uSNR. The network maintains a fixed maximum supply of 1,000,000,000 SNR tokens to ensure economic predictability and scarcity preservation.
### Section 2: Token Distribution
The genesis distribution of SNR tokens shall be allocated across four primary categories to ensure balanced ecosystem development and sustainable growth.
Community and Ecosystem allocation of 45% supports broad network adoption and long-term sustainability. Public Distribution receives 15% to ensure democratic access and widespread token ownership. Community Treasury obtains 15% for governance-directed initiatives and ecosystem development. Ecosystem Development Fund captures 10% for strategic partnerships, integrations, and technology advancement. Validator Rewards Pool secures 5% for initial network security incentives.
Network Development allocation of 25% ensures continued technical advancement and operational excellence. Core Protocol Development receives 10% for fundamental blockchain infrastructure and identity protocol enhancement. Infrastructure and Operations obtains 8% for network maintenance, security monitoring, and operational support. Security and Audits captures 4% for comprehensive security assessments, penetration testing, and vulnerability remediation. Research and Innovation secures 3% for experimental technologies and future-oriented development initiatives.
The diDAO Foundation allocation of 15% provides institutional stability and strategic guidance. Foundation Reserve receives 10% for long-term operational sustainability and emergency response capabilities. Strategic Partnerships obtains 5% for critical alliance formation and ecosystem expansion initiatives.
Contributors and Team allocation of 15% recognizes the human capital essential for network success. Core Team receives 10% acknowledging the foundational work and ongoing commitment of primary developers and leaders. Advisors obtain 3% compensating strategic guidance and domain expertise. Early Contributors secure 2% recognizing initial community builders and supporters.
### Section 3: Vesting and Unlock Schedules
Community allocations provide immediate availability for public distribution while treasury and ecosystem funds remain subject to governance proposals ensuring democratic control over resource allocation. Network Development follows a six-month cliff period followed by linear vesting over 36 months to align long-term incentives with network development goals. The diDAO Foundation implements a twelve-month cliff followed by linear vesting over 48 months ensuring institutional stability while preventing premature token concentration. Contributors and Team follow a twelve-month cliff with linear vesting over 48 months aligning personal incentives with long-term network success.
### Section 4: Revenue Mechanisms
The network generates sustainable revenue through authentication service fees paid in uSNR, creating direct utility for the native token. Motr vault operation fees provide enhanced security features while maintaining basic functionality accessibility. Verification and attestation services offer tiered pricing based on verification complexity and security requirements. Cross-chain identity bridge operations generate fees for interoperability services across different blockchain ecosystems. Smart contract execution fees for identity operations ensure computational resources remain fairly compensated.
## Article III: Governance Structure
### Section 1: The diDAO Foundation
The Decentralized Identity DAO LC, organized as a Wyoming DUNA, serves as the steward of the Sonr Network. The foundation assumes responsibility for protocol governance coordination ensuring democratic processes remain effective and inclusive. Treasury management oversight provides fiscal responsibility while maintaining transparency and accountability. Ecosystem development initiatives support strategic growth and partnership formation. Legal representation and compliance ensure regulatory adherence while protecting network decentralization. Strategic partnership facilitation connects the network with compatible organizations and technologies.
### Section 2: Governance Bodies
SNR Token Holders possess ultimate decision-making authority within the governance framework. Proposal voting rights operate proportionally to staked SNR holdings ensuring democratic representation while incentivizing network participation. A minimum requirement of 100 SNR enables proposal submission, maintaining accessibility while preventing spam and frivolous governance actions.
The Validator Assembly handles technical governance and protocol upgrades ensuring network security and performance optimization. Network security and performance monitoring provides continuous oversight of critical infrastructure. A minimum self-bonded stake requirement of 50,000 SNR ensures validator commitment and alignment with network success.
The Identity Council comprises seven elected members serving twelve-month terms providing specialized governance oversight. The council oversees identity standards and authentication protocols ensuring technical excellence and user protection. Council members review and recommend governance proposals offering expert analysis and community guidance.
### Section 3: Voting Mechanisms
Standard Proposals require simple majority approval exceeding 50% with a 20% quorum ensuring broad community participation in routine governance decisions. Protocol Upgrades demand supermajority approval exceeding 66.7% with a 33% quorum reflecting the critical nature of technical changes. Constitutional Amendments require supermajority approval exceeding 75% with a 40% quorum protecting fundamental network principles from hasty modification. Emergency Actions enable Identity Council approval through 5 of 7 members for time-sensitive security matters requiring rapid response capabilities.
### Section 4: Proposal Process
Submission requires a 100 SNR deposit returned upon proposal reaching quorum, ensuring serious proposals while maintaining accessibility. A seven-day discussion period enables community review and debate fostering informed decision-making. A seven-day voting period provides token holder participation opportunities while maintaining governance efficiency. Implementation includes a 48-hour timelock for non-emergency proposals ensuring final review and preventing malicious governance attacks.
## Article IV: Network Operations
### Section 1: Validation and Consensus
Validator requirements include a minimum self-bonded stake of 50,000 SNR ensuring significant skin in the game for network security participants. Maximum total delegation caps at 10% of total staked SNR preventing excessive centralization and maintaining distributed control. Technical specifications remain determined by the Validator Assembly ensuring expertise guides infrastructure requirements.
The consensus mechanism implements Proof-of-Stake consensus with Byzantine Fault Tolerance ensuring network security and finality. Block time targets and finality parameters operate under protocol control enabling optimization based on network performance and user experience requirements.
### Section 2: Staking and Rewards
Staking parameters establish a minimum delegation of 10 SNR ensuring broad accessibility while maintaining meaningful participation thresholds. The unbonding period extends 21 days providing security against rapid stake manipulation while enabling legitimate validator changes. Automatic compounding remains available for delegators seeking to maximize staking returns through compound interest effects.
Reward distribution includes block rewards sourced from the Validator Rewards Pool ensuring sustainable validator compensation. Transaction fees distribute proportionally to validators and delegators aligning incentives with network usage and security provision. Authentication service revenue sharing with active validators creates additional income streams beyond traditional staking rewards.
### Section 3: Motr Vault Integration
The Motr serves as users personal cryptographic key vault providing fundamental identity infrastructure. Secure key generation and storage ensures cryptographic security while maintaining user control and accessibility. Authentication credential management enables seamless interaction with applications and services across the ecosystem. Cross-application identity portability allows users to maintain consistent identity across different platforms and use cases. Recovery mechanisms through social recovery or hardware security modules provide security without sacrificing usability. Integration with the networks UCAN authorization system enables granular permission management and secure authentication flows.
## Article V: Treasury and Funding
### Section 1: Community Treasury
The Community Treasury receives initial funding of 15% of total supply supporting ecosystem development and community initiatives. Ecosystem development grants provide funding for projects advancing network adoption and technological innovation. Security audits and bug bounties ensure network security through professional assessment and community-driven vulnerability discovery. Community initiatives and events foster engagement and education within the ecosystem. Emergency response funding enables rapid action during critical situations requiring immediate resource deployment. Strategic acquisitions or partnerships support network growth through consolidation or alliance formation.
### Section 2: Treasury Management
Disbursement limits ensure appropriate oversight commensurate with funding amounts. Expenditures below 10,000 SNR require Identity Council approval enabling efficient small-scale funding decisions. Expenditures between 10,000 and 100,000 SNR require standard proposal approval ensuring democratic oversight of moderate expenditures. Expenditures exceeding 100,000 SNR demand supermajority proposal approval protecting community assets from inappropriate large-scale spending.
Transparency requirements include quarterly treasury reports providing regular community updates on fund utilization and remaining resources. Real-time on-chain tracking enables continuous monitoring of treasury activities and expenditures. Annual third-party audits ensure fiscal responsibility and identify potential improvements in treasury management practices.
### Section 3: Fee Structure
Network fees collected in uSNR create sustainable revenue streams for network operations and development. Base Transaction Fees adjust dynamically based on network congestion ensuring fair pricing while maintaining network accessibility. Authentication Service Fees operate under service provider control with minimum network fees applied ensuring baseline revenue generation. Storage Fees calculate based on data size and retention period reflecting actual resource consumption and infrastructure costs. Identity Verification Fees implement tiered pricing based on verification level ensuring appropriate compensation for different security and verification requirements.
## Article VI: Security and Compliance
### Section 1: Security Measures
Slashing conditions protect network integrity through economic penalties for malicious or negligent behavior. Double signing results in a 5% stake slash ensuring validators maintain proper key security and operational procedures. Prolonged downtime triggers a 0.1% stake slash incentivizing reliable validator performance and network availability. Governance attacks may result in stake slashing up to 100% protecting democratic processes from manipulation or coordinated attacks.
Emergency response capabilities enable rapid action during critical situations. Identity Council emergency powers address critical vulnerabilities requiring immediate intervention beyond normal governance timelines. Validator Assembly coordination manages network halts and recovery procedures ensuring orderly response to technical emergencies. Emergency action periods limit to maximum 72 hours preventing abuse while enabling necessary rapid response capabilities.
### Section 2: Compliance Framework
The diDAO ensures regulatory compliance through structured legal and operational frameworks. KYC and AML procedures apply to high-value transactions where required by applicable law ensuring legal compliance while preserving network accessibility. Sanctions screening for validator operations ensures compliance with international law while maintaining decentralized operation principles. Tax reporting assistance supports network participants in meeting legal obligations while preserving privacy where legally permissible. Regulatory liaison and legal representation provide professional advocacy and compliance guidance across multiple jurisdictions.
## Article VII: Amendments and Governance Evolution
### Section 1: Amendment Process
Constitutional amendments require formal proposal submission with detailed rationale ensuring thoughtful consideration of fundamental changes. A thirty-day discussion period enables comprehensive community review and debate fostering informed democratic decision-making. Approval requires 75% support with 40% quorum protecting constitutional stability while enabling necessary evolution. A seven-day implementation timelock provides final review opportunity and prevents malicious constitutional manipulation.
### Section 2: Transition Provisions
The initial parameter adjustment period spanning the first 180 days allows parameter changes via supermajority vote enabling network optimization during early operation. Foundation transition processes transfer diDAO operational control to full DAO governance after 24 months ensuring decentralization progression while maintaining initial stability. Vesting acceleration through governance vote may occur during extraordinary circumstances providing flexibility while protecting long-term incentive alignment.
### Section 3: Dispute Resolution
Technical disputes receive resolution through Validator Assembly expertise ensuring appropriate technical knowledge guides infrastructure decisions. Governance disputes undergo arbitration by Identity Council providing specialized oversight of democratic processes and constitutional interpretation. Constitutional disputes require referral to external arbitration under Wyoming DUNA framework ensuring neutral resolution of fundamental disagreements. User disputes utilize community-selected arbitrators providing peer-based resolution mechanisms for interpersonal conflicts.
## Article VIII: Implementation and Final Provisions
### Section 1: Effective Date and Ratification
This Constitution becomes effective upon mainnet genesis block production and ratification by the initial validator set ensuring democratic legitimacy from network inception.
### Section 2: Legal Framework
If any provision of this Constitution becomes invalid or unenforceable, the remaining provisions shall continue in full force and effect ensuring constitutional stability despite potential legal challenges. The Identity Council provides non-binding interpretative guidance for constitutional questions while maintaining democratic oversight of interpretation. Ambiguities receive resolution favoring decentralization and user sovereignty ensuring alignment with fundamental network principles. Technical specifications undergo interpretation by Validator Assembly ensuring appropriate expertise guides infrastructure decisions.
### Section 3: Legacy and Evolution
This Constitution establishes Sonr as a perpetual guardian of human digital identity, balancing technological innovation with fundamental rights protection. Through democratic governance, technical excellence, and unwavering commitment to privacy, the Sonr Network shall serve humanitys identity needs for the next century and beyond. The provisions herein create a resilient framework capable of evolving with technology while maintaining core principles that respect human dignity, ensure data sovereignty, and enable secure digital interactions for all.
By ratifying this Constitution, the Sonr community commits to building and maintaining a digital identity system that respects human dignity, ensures data sovereignty, and enables secure digital interactions for all participants while maintaining democratic governance and technological excellence throughout the networks centennial mission.
---
- _Ratified by the Sonr Network Community_
- _Stewarded by the Decentralized Identity DAO LC (diDAO)_
- _**Empowering Self-Sovereign Identity Through Distributed Consensus**_
Regular → Executable
+71 -33
View File
@@ -1,54 +1,92 @@
FROM golang:1.23-alpine AS go-builder # Use build argument for base image to allow using pre-cached base
ARG BASE_IMAGE=golang:1.25-alpine3.22
FROM ${BASE_IMAGE} AS builder
SHELL ["/bin/sh", "-ecuxo", "pipefail"] SHELL ["/bin/sh", "-ecuxo", "pipefail"]
RUN apk add --no-cache ca-certificates build-base git # Install build dependencies
RUN apk add --no-cache \
ca-certificates \
build-base \
git \
linux-headers \
bash \
binutils-gold \
wget
WORKDIR /code WORKDIR /code
COPY go.mod go.sum ./ # Copy entire source code
RUN set -eux; \ COPY . .
# Fix git ownership issue
RUN git config --global --add safe.directory /code
# Download WasmVM library
RUN --mount=type=cache,target=/tmp/wasmvm \
set -eux; \
export ARCH=$(uname -m); \ export ARCH=$(uname -m); \
WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm || true); \ WASM_VERSION=$(GOTOOLCHAIN=auto go list -m all | grep github.com/CosmWasm/wasmvm | head -1 || echo ""); \
if [ ! -z "${WASM_VERSION}" ]; then \ if [ ! -z "${WASM_VERSION}" ]; then \
WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}'); \ WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}'); \
WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}'); \ WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}'); \
wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\ WASMVM_FILE="libwasmvm_muslc.${ARCH}.a"; \
if [ ! -f "/tmp/wasmvm/${WASMVM_FILE}" ]; then \
wget -O "/tmp/wasmvm/${WASMVM_FILE}" "https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/${WASMVM_FILE}"; \
fi; \ fi; \
go mod download; cp "/tmp/wasmvm/${WASMVM_FILE}" /lib/libwasmvm_muslc.a; \
fi
# Copy over code # Download Go modules
COPY . /code RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GOTOOLCHAIN=auto go mod download
# force it to use static lib (from above) not standard libgo_cosmwasm.so file # Build binary with optimizations
# then log output of file /code/bin/sonrd RUN --mount=type=cache,target=/go/pkg/mod \
# then ensure static linking --mount=type=cache,target=/root/.cache/go-build \
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \ set -eux; \
&& file /code/build/sonrd \ VERSION=$(git describe --tags --always 2>/dev/null || echo "dev"); \
&& echo "Ensuring binary is statically linked ..." \ COMMIT=$(git log -1 --format='%H' 2>/dev/null || echo "unknown"); \
&& (file /code/build/sonrd | grep "statically linked") LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true \
CGO_ENABLED=1 GOOS=linux \
GOTOOLCHAIN=auto go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags "-X github.com/cosmos/cosmos-sdk/version.Name=sonr \
-X github.com/cosmos/cosmos-sdk/version.AppName=snrd \
-X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-buildvcs=false \
-trimpath \
-o /code/build/snrd \
./cmd/snrd; \
file /code/build/snrd; \
echo "Ensuring binary is statically linked ..."; \
(file /code/build/snrd | grep "statically linked")
# -------------------------------------------------------- # --------------------------------------------------------
FROM debian:11-slim # Final minimal runtime image (default target for snrd)
FROM alpine:3.17
LABEL org.opencontainers.image.source https://github.com/onsonr/sonr LABEL org.opencontainers.image.title="Sonr Daemon"
LABEL org.opencontainers.image.source="https://github.com/sonr-io/sonr"
COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd # Copy binary from build stage
COPY --from=builder /code/build/snrd /usr/bin
COPY --from=builder /lib/libwasmvm_muslc.a /lib/libwasmvm_muslc.a
# Install dependencies for Debian 11 # Copy runtime scripts and make them executable
RUN apt-get update && apt-get install -y \ COPY --from=builder /code/scripts/test_node.sh /usr/bin/devnet
curl \ COPY --from=builder /code/scripts/testnet-setup.sh /usr/bin/testnet
make \ COPY --from=builder /code/scripts/lib/ /usr/local/lib/sonr-scripts/
bash \
jq \
sed \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/test_node.sh /usr/bin/test_node.sh # Set up dependencies
ENV PACKAGES="curl make bash jq sed"
# Install minimum necessary dependencies
RUN apk add --no-cache $PACKAGES
WORKDIR /opt WORKDIR /opt
# rest server, tendermint p2p, tendermint rpc
EXPOSE 1317 26656 26657 6060
ENTRYPOINT ["/usr/bin/sonrd"]
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+308 -240
View File
@@ -1,26 +1,34 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# Default target - show help when no target specified
.DEFAULT_GOAL := help
PACKAGE_NAME := github.com/sonr-io/sonr
GORELEASER_VERSION ?= latest
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation') PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H') COMMIT := $(shell git log -1 --format='%H')
GOLANGCI_VERSION := v1.62.2
LEDGER_ENABLED ?= true LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
BINDIR ?= $(GOPATH)/bin BINDIR ?= $(GOPATH)/bin
SIMAPP = ./app SIMAPP = ./app
GIT_ROOT := $(shell git rev-parse --show-toplevel)
# Fetch from env # Git configuration
RELEASE_DATE ?= $(shell date +%Y).$(shell date +%V).$(shell date +%u) HTTPS_GIT := github.com/sonr-io/sonr.git
VERSION ?= $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT ?= $(shell git log -1 --format='%H')
OS ?= $(shell uname -s)
ROOT ?= $(shell git rev-parse --show-toplevel)
# for dockerized protobuf tools
DOCKER := $(shell which docker)
HTTPS_GIT := github.com/onsonr/sonr.git
export GO111MODULE = on export GO111MODULE = on
# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell git describe --tags --always)
# if VERSION is empty, then populate it with branch's name and raw commit hash
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif
# process build tags # process build tags
build_tags = netgo build_tags = netgo
@@ -59,11 +67,16 @@ comma := ,
build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags)) build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))
# process linker flags # process linker flags
# flags '-s -w' resolves an issue with xcode 16 and signing of go binaries
# ref: https://github.com/golang/go/issues/63997
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=sonr \ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=sonr \
-X github.com/cosmos/cosmos-sdk/version.AppName=sonrd \ -X github.com/cosmos/cosmos-sdk/version.AppName=snrd \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-checklinkname=0 \
-s -w
ifeq ($(WITH_CLEVELDB),yes) ifeq ($(WITH_CLEVELDB),yes)
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
@@ -76,288 +89,343 @@ ldflags := $(strip $(ldflags))
BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' -trimpath BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' -trimpath
# The below include contains the tools and runsim targets.
all: install lint test
build: go.sum all: help
ifeq ($(OS),Windows_NT)
$(error wasmd server not supported. Use "make build-windows-client" for client)
exit 1
else
go build -mod=readonly $(BUILD_FLAGS) -o build/sonrd ./cmd/sonrd
endif
build-motr: go.sum start: docker
GOOS=js GOARCH=wasm go build -o static/wasm/app.wasm ./cmd/motr/main.go @gum log --level info "Starting all services..."
@devbox services up
build-hway: go.sum
go build -o build/hway ./cmd/hway
build-windows-client: go.sum
GOOS=windows GOARCH=amd64 go build -mod=readonly $(BUILD_FLAGS) -o build/sonrd.exe ./cmd/sonrd
build-contract-tests-hooks:
ifeq ($(OS),Windows_NT)
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests.exe ./cmd/contract_tests
else
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests ./cmd/contract_tests
endif
install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/sonrd
install-hway: go.sum
go install -mod=readonly ./cmd/hway
release: fmt-date
@go install github.com/goreleaser/goreleaser/v2@latest
RELEASE_DATE=$(RELEASE_DATE) goreleaser release --clean
stop:
@gum log --level info "Stopping all services..."
@devbox services stop
@$(MAKE) clean-docker
######################################## ########################################
### Tools & dependencies ### Tools & dependencies
######################################## ########################################
format: go-format
go-format:
@gum log --level info "Formatting Go code with gofumpt and goimports..."
@if command -v gofumpt > /dev/null; then \
gofumpt -w .; \
else \
go run -mod=readonly mvdan.cc/gofumpt@latest -w .; \
fi
@if command -v goimports > /dev/null; then \
goimports -w .; \
else \
go run -mod=readonly golang.org/x/tools/cmd/goimports@latest -w .; \
fi
@gum log --level info "✅ Code formatted"
lint: go-lint
go-lint:
@gum log --level info "Running golangci-lint..."
@if command -v golangci-lint > /dev/null; then \
golangci-lint run --timeout=10m; \
else \
docker run --rm -v $$(pwd):/app -w /app \
-v ~/.cache/golangci-lint:/root/.cache/golangci-lint \
golangci/golangci-lint:$(GOLANGCI_VERSION) \
golangci-lint run --timeout=10m; \
fi
.PHONY: lint go-lint format
go-mod-cache: go.sum go-mod-cache: go.sum
@echo "--> Download go modules to local cache" @gum log --level info "Download go modules to local cache"
@go mod download @go mod download
go.sum: go.mod go.sum: go.mod
@echo "--> Ensure dependencies have not been modified" @gum log --level info "Ensure dependencies have not been modified"
@go mod tidy
@go mod verify @go mod verify
draw-deps: draw-deps:
@# requires brew install graphviz or apt-get install graphviz @# requires brew install graphviz or apt-get install graphviz
go install github.com/RobotsAndPencils/goviz@latest go install github.com/RobotsAndPencils/goviz@latest
@goviz -i ./cmd/sonrd -d 2 | dot -Tpng -o dependency-graph.png @goviz -i ./cmd/snrd -d 2 | dot -Tpng -o .github/assets/dependency-graph.png
clean:
rm -rf .aider*
rm -rf static
rm -rf .out
rm -rf hway.db
rm -rf snapcraft-local.yaml build/
rm -rf build
distclean: clean tidy:
rm -rf vendor/ @go mod tidy
@make -C client tidy
clean: tidy
@gum log --level info "Cleaning build artifacts..."
rm -rf snapcraft-local.yaml build/ dist/
@$(MAKE) -C cmd/snrd clean
clean-docker:
@gum log --level info "Removing all Docker volumes and networks..."
@rm -rf .logs
@docker compose down -v
@docker network prune -f
@docker volume prune -f
###############################################################################
### Build Targets ###
###############################################################################
install: go.sum
@$(MAKE) -C cmd/snrd install LEDGER_ENABLED=$(LEDGER_ENABLED) WITH_CLEVELDB=$(WITH_CLEVELDB) LINK_STATICALLY=$(LINK_STATICALLY) BUILD_TAGS="$(BUILD_TAGS)"
build: go.sum
@$(MAKE) -C cmd/snrd build LEDGER_ENABLED=$(LEDGER_ENABLED) WITH_CLEVELDB=$(WITH_CLEVELDB) LINK_STATICALLY=$(LINK_STATICALLY) BUILD_TAGS="$(BUILD_TAGS)"
build-snrd: build
build-client: go.sum
@$(MAKE) -C client build
@cd /tmp && go mod init test || true
@cd /tmp && go get github.com/sonr-io/sonr/client@main || true
@cd /tmp && gum log --level info "Client SDK import successful"
# Build all components in parallel
build-all: go.sum
@gum log --level info "Building all components in parallel..."
@$(MAKE) -j2 build build-client
@gum log --level info "✅ All components built successfully"
.PHONY: install build build-client build-snrd build-all
######################################## ########################################
### Testing ### Docker & Services
######################################## ########################################
docker:
@gum log --level info "Building Docker images..."
@docker buildx build -t onsonr/snrd:latest -f Dockerfile .
localnet: ## Start single-node localnet with Docker (cleans HOME_DIR first)
@gum log --level info "Cleaning HOME_DIR (~/.sonr)..."
@chmod -R u+rwX $(HOME)/.sonr 2>/dev/null || true
@rm -rf $(HOME)/.sonr 2>/dev/null || true
@$(MAKE) dockernet
dockernet:
@gum log --level info "Starting network with Docker in detached mode..."
@docker stop sonr-testnode 2>/dev/null || true
@docker rm sonr-testnode 2>/dev/null || true
@sleep 3
@HOME_DIR=$(HOME)/.sonr CHAIN_ID="sonrtest_1-1" BLOCK_TIME="1000ms" CLEAN=true FORCE_DOCKER=true DOCKER_DETACHED=true bash scripts/test_node.sh
.PHONY: docker localnet dockernet
########################################
### Prepare Scripts - AI & Release Automation
########################################
# Smart component release detection and automation
release:
@$(MAKE) -C cmd/snrd release
# Snapshot builds for development
snapshot:
@gum log --level info "📦 Preparing component snapshot..."
@$(MAKE) -C cmd/snrd snapshot
.PHONY: release snapshot
########################################
### Testing - Simplified
########################################
# Main test targets
test: test-unit test: test-unit
test-all: test-race test-cover test-system test-all: test-race test-cover
test-unit: test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./... @VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock test' ./...
test-race: test-race:
@VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' ./... @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock test' ./...
test-cover: test-cover:
@go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./... @go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock test' ./...
benchmark: test-e2e:
@gum log --level info "Running basic e2e tests"
@cd test/e2e && go test -race -v -run TestBasic ./tests/basic
test-e2e-all:
@gum log --level info "Running all e2e tests"
@cd test/e2e && go test -race -v ./tests/...
e2e-usdc-swap-did:
@gum log --level info "Running USDC Swap E2E tests with DID integration"
@gum log --level warn "Note: These tests require manual setup. See test/e2e/usdc-swap-did/README.md"
@cd test/e2e/usdc-swap-did && make test
e2e-usdc-swap-did-setup:
@gum log --level info "Running USDC Swap E2E test setup..."
@cd test/e2e/usdc-swap-did && bash setup.sh
e2e-usdc-swap-did-verbose:
@gum log --level info "Running USDC Swap E2E tests (verbose mode)"
@cd test/e2e/usdc-swap-did && make test-verbose
test-build-snrd: build
@ls -la build/snrd
@chmod +x build/snrd
@./build/snrd version
test-tdd:
go test -json ./... 2>&1 | tdd-guard-go -project-root ${GIT_ROOT}
test-app:
@VERSION=$(VERSION) CGO_LDFLAGS="-lm" go test -C . -mod=readonly -tags='ledger test_ledger_mock test' github.com/sonr-io/sonr/app/... github.com/sonr-io/sonr/x/... github.com/sonr-io/common/... github.com/sonr-io/sonr/internal/...
test-devops:
@echo "No devops tests"
test-client:
@$(MAKE) -C client test
test-dwn-ci:
@go test -mod=readonly -tags='ledger test_ledger_mock test' -run='!IPFS' ./x/dwn/...
test-internal:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock test' ./internal/...
# Module testing - Simplified
# MODULE=did|dwn|svc VARIANT=unit|race|cover|bench
test-module:
@if [ -z "$(MODULE)" ]; then \
gum log --level info "Testing all modules..."; \
$(MAKE) test-module MODULE=did; \
$(MAKE) test-module MODULE=dwn; \
$(MAKE) test-module MODULE=svc; \
else \
if [ "$(VARIANT)" = "cover" ]; then \
gum log --level info "Testing x/$(MODULE) with coverage..."; \
go test -mod=readonly -timeout 30m -race -coverprofile=x/$(MODULE)/coverage.txt -covermode=atomic -tags='ledger test_ledger_mock test' ./x/$(MODULE)/...; \
elif [ "$(VARIANT)" = "race" ]; then \
gum log --level info "Testing x/$(MODULE) with race detector..."; \
VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock test' ./x/$(MODULE)/...; \
elif [ "$(VARIANT)" = "bench" ]; then \
gum log --level info "Running x/$(MODULE) benchmarks..."; \
go test -mod=readonly -bench=. ./x/$(MODULE)/...; \
else \
gum log --level info "Testing x/$(MODULE) module..."; \
VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock test' ./x/$(MODULE)/...; \
fi \
fi
test-proto:
@$(MAKE) -C proto lint
@$(MAKE) -C proto check-breaking
test-benchmark:
@go test -mod=readonly -bench=. ./... @go test -mod=readonly -bench=. ./...
test-sim-import-export: runsim .PHONY: test test-all test-unit test-race test-cover test-tdd test-module test-benchmark test-e2e test-e2e-all e2e-usdc-swap-did e2e-usdc-swap-did-setup e2e-usdc-swap-did-verbose
@echo "Running application import/export simulation. This may take several minutes..."
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppImportExport
test-sim-multi-seed-short: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestFullAppSimulation
test-sim-deterministic: runsim
@echo "Running application deterministic simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 1 1 TestAppStateDeterminism
test-system: install
$(MAKE) -C tests/system/ test
###############################################################################
### Linting ###
###############################################################################
format-tools:
go install mvdan.cc/gofumpt@v0.4.0
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install github.com/daixiang0/gci@v0.11.2
lint: format-tools
golangci-lint run --tests=false
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d
format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/CosmWasm/wasmd)" --custom-order
mod-tidy:
go mod tidy
.PHONY: format-tools lint format mod-tidy
############################################################################### ###############################################################################
### Protobuf ### ### Protobuf ###
############################################################################### ###############################################################################
protoVer=0.15.1 climd-gen:
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) @gum log --level info "Generating MD Docs from snrd CLI..."
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) @sh ./scripts/cli-docgen.sh
proto-gen: proto-gen:
@echo "Generating Protobuf files" @gum log --level info "Generating Go protobuf files..."
@go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest @$(MAKE) -C proto gen
@$(protoImage) sh ./scripts/protocgen.sh @gum log --level info "Auto-formatting generated protobuf files..."
spawn stub-gen @$(MAKE) format
proto-format: openapi-gen:
@echo "Formatting Protobuf files" @$(MAKE) -C proto openapi-gen
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \; @gum log --level info "✅ OpenAPI generation complete. Output: docs/static/openapi.yml"
proto-lint: # Backwards compatibility alias
@$(protoImage) buf lint --error-format=json swagger-gen: openapi-gen
proto-check-breaking: templ-gen:
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=master @docker run --rm -v `pwd`:/code -w=/code --user $(shell id -u):$(shell id -g) ghcr.io/a-h/templ:latest generate
.PHONY: all install install-debug \ .PHONY: proto-gen proto-openapi-gen openapi-gen swagger-gen proto-lint proto-check-breaking proto-publish
go-mod-cache draw-deps clean build format \
test test-all test-build test-cover test-unit test-race \
test-sim-import-export build-windows-client \
test-system
## --- Testnet Utilities ---
get-localic:
@echo "Installing local-interchain"
git clone --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader
cd interchaintest-downloader/local-interchain && make install
@echo ✅ local-interchain installed $(shell which local-ic)
is-localic-installed:
ifeq (,$(shell which local-ic))
make get-localic
endif
get-heighliner:
git clone https://github.com/strangelove-ventures/heighliner.git
cd heighliner && go install
local-image:
ifeq (,$(shell which heighliner))
echo 'heighliner' binary not found. Consider running `make get-heighliner`
else
heighliner build -c sonrd --local -f chains.yaml
endif
.PHONY: get-heighliner local-image is-localic-installed
############################################################################### ###############################################################################
### e2e ### ### Network Operations ###
############################################################################### ###############################################################################
ictest-basic: # Starship network management
@echo "Running basic interchain tests" testnet: testnet-restart
@cd interchaintest && go test -race -v -run TestBasicChain .
ictest-ibc: testnet-restart: testnet-stop testnet-start
@echo "Running IBC interchain tests" @gum log --level info "✅ Starship network restarted"
@cd interchaintest && go test -race -v -run TestIBC .
ictest-wasm: testnet-start:
@echo "Running cosmwasm interchain tests" @gum log --level info "Starting Starship network..."
@cd interchaintest && go test -race -v -run TestCosmWasmIntegration . @if [ -z "$(NETWORK)" ]; then \
NETWORK=devnet; \
fi; \
bash scripts/run.sh $$NETWORK
ictest-packetforward: testnet-stop:
@echo "Running packet forward middleware interchain tests" @gum log --level info "Stopping Starship network..."
@cd interchaintest && go test -race -v -run TestPacketForwardMiddleware . @helm delete -n ci sonr-testnet 2>/dev/null || true
@kubectl delete namespace ci --ignore-not-found=true 2>/dev/null || true
@sleep 2
ictest-poa: .PHONY: testnet testnet-restart testnet-start testnet-stop
@echo "Running proof of authority interchain tests"
@cd interchaintest && go test -race -v -run TestPOA .
ictest-tokenfactory:
@echo "Running token factory interchain tests"
@cd interchaintest && go test -race -v -run TestTokenFactory .
############################################################################### ###############################################################################
### testnet ### ### Help ###
###############################################################################
setup-ipfs:
./scripts/ipfs_config.sh
setup-testnet: mod-tidy is-localic-installed install local-image set-testnet-configs setup-testnet-keys
# Run this before testnet keys are added
# chainid-1 is used in the testnet.json
set-testnet-configs:
sonrd config set client chain-id sonr-testnet-1
sonrd config set client keyring-backend test
sonrd config set client output text
# import keys from testnet.json into test keyring
setup-testnet-keys:
-`echo "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" | sonrd keys add acc0 --recover`
-`echo "wealth flavor believe regret funny network recall kiss grape useless pepper cram hint member few certain unveil rather brick bargain curious require crowd raise" | sonrd keys add acc1 --recover`
# default testnet is with IBC
testnet: setup-testnet
spawn local-ic start ibc-testnet
testnet-basic: setup-testnet
spawn local-ic start testnet
sh-testnet: mod-tidy
CHAIN_ID="sonr-testnet-1" BLOCK_TIME="1000ms" CLEAN=true sh scripts/test_node.sh
.PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet dop-testnet
###############################################################################
### extra utils ###
###############################################################################
push-docker:
@docker build -t ghcr.io/onsonr/sonr:latest .
@docker tag ghcr.io/onsonr/sonr:latest ghcr.io/onsonr/sonr:$(VERSION)
@docker push ghcr.io/onsonr/sonr:latest
@docker push ghcr.io/onsonr/sonr:$(VERSION)
status:
@gh run ls -L 3
@gum format -- "# Sonr ($OS-$VERSION)" "- ($(COMMIT)) $ROOT" "- $(RELEASE_DATE)"
@sleep 3
release:
@go install github.com/goreleaser/goreleaser/v2@latest
@RELEASE_DATE=$(RELEASE_DATE) goreleaser release --clean
release-dry:
@go install github.com/goreleaser/goreleaser/v2@latest
@RELEASE_DATE=$(RELEASE_DATE) goreleaser release --snapshot --clean --skip=publish
release-check:
@go install github.com/goreleaser/goreleaser/v2@latest
@RELEASE_DATE=$(RELEASE_DATE) goreleaser check
validate-tag:
@sh ./scripts/validate_tag.sh
###############################################################################
### help ###
############################################################################### ###############################################################################
help: help:
@echo "Usage: make <target>" @gum log --level info "Sonr Blockchain Makefile"
@echo "" @gum log --level info "========================"
@echo "Available targets:" @gum log --level info ""
@echo " install : Install the binary" @gum log --level info "🛠️ Build & Install:"
@echo " local-image : Install the docker image" @gum log --level info " install Install snrd binary"
@echo " proto-gen : Generate code from proto files" @gum log --level info " build Build snrd binary"
@echo " testnet : Local devnet with IBC" @gum log --level info " build-all Build all components in parallel"
@echo " sh-testnet : Shell local devnet" @gum log --level info " build-client Build client SDK"
@echo " ictest-basic : Basic end-to-end test" @gum log --level info " docker Build Docker images"
@echo " ictest-ibc : IBC end-to-end test" @gum log --level info ""
@gum log --level info "📦 Release & Distribution:"
@gum log --level info " release Create production release with GoReleaser"
@gum log --level info " snapshot Create development snapshot builds"
@gum log --level info ""
@gum log --level info "🚀 Local Development:"
@gum log --level info " localnet Start single-node testnet"
@gum log --level info " start Start backend services"
@gum log --level info " stop Stop backend services"
@gum log --level info " status Check service health"
@gum log --level info " testnet Manage Starship network (start/stop/restart)"
@gum log --level info ""
@gum log --level info "📦 Code Generation:"
@gum log --level info " proto-gen Generate protobuf code"
@gum log --level info " openapi-gen Generate OpenAPI documentation"
@gum log --level info ""
@gum log --level info "🔧 Development Tools:"
@gum log --level info " format Format code (Go + TypeScript)"
@gum log --level info " lint Run all linters"
@gum log --level info " clean Remove build artifacts"
@gum log --level info ""
@gum log --level info "🧪 Testing:"
@gum log --level info " benchmark Run benchmarks"
@gum log --level info " test Run unit tests"
@gum log --level info " test-all Run all test variants"
@gum log --level info " test-cover Generate coverage report"
@gum log --level info " test-e2e Run e2e tests"
@gum log --level info " test-e2e-all Run all e2e tests"
@gum log --level info " test-module Test specific module (MODULE=did|dwn|svc)"
@gum log --level info ""
@gum log --level info "🔄 E2E Test Suites:"
@gum log --level info " e2e-usdc-swap-did Run USDC swap E2E tests"
@gum log --level info " e2e-usdc-swap-did-setup Interactive setup for USDC swap tests"
@gum log --level info " e2e-usdc-swap-did-verbose Run USDC swap tests with verbose output"
@gum log --level info ""
@gum log --level info "📚 Module Testing Examples:"
@gum log --level info " make test-module MODULE=did # Test DID module"
@gum log --level info " make test-module MODULE=dwn VARIANT=cover # DWN with coverage"
@gum log --level info " make test-module MODULE=svc VARIANT=race # SVC with race detector"
@gum log --level info " make test-module MODULE=did VARIANT=bench # DID benchmarks"
@gum log --level info ""
@gum log --level info "For more detailed options, see the Makefile source."
.PHONY: help .PHONY: help release release-platform snapshot snapshot-platform
+341 -27
View File
@@ -1,39 +1,353 @@
# `sonr` - Sonr Chain
[![Go Reference](https://pkg.go.dev/badge/github.com/onsonr/sonr.svg)](https://pkg.go.dev/github.com/onsonr/sonr) [![Go Reference](https://pkg.go.dev/badge/github.com/sonr-io/sonr.svg)](https://pkg.go.dev/github.com/sonr-io/sonr)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/onsonr/sonr) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/sonr-io/sonr)
![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/onsonr/sonr)
[![Static Badge](https://img.shields.io/badge/homepage-sonr.io-blue?style=flat-square)](https://sonr.io) [![Static Badge](https://img.shields.io/badge/homepage-sonr.io-blue?style=flat-square)](https://sonr.io)
[![Go Report Card](https://goreportcard.com/badge/github.com/onsonr/sonr)](https://goreportcard.com/report/github.com/onsonr/sonr) [![Go Report Card](https://goreportcard.com/badge/github.com/sonr-io/sonr)](https://goreportcard.com/report/github.com/sonr-io/sonr)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=sonrhq_sonr&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr)
> Sonr is a combination of decentralized primitives. Fundamentally, it is a peer-to-peer identity and asset management system that leverages DID documents, Webauthn, and IPFS—providing users with a secure, portable decentralized identity. [![Sonr](.github/banner.png)](https://sonr.io)
# Documentation > **Sonr is a blockchain ecosystem combining decentralized identity, secure data storage, and multi-chain interoperability. Built on Cosmos SDK v0.50.14, it provides users with self-sovereign identity through W3C DIDs, WebAuthn authentication, and personal data vaults—all without requiring cryptocurrency for onboarding.**
1. [Quick Start](https://github.com/onsonr/sonr/wiki/1-%E2%80%90-Quick-Start) ## 💡 Key Features
2. [Chain Modules](https://github.com/onsonr/sonr/wiki/2-%E2%80%90-Chain-Modules)
3. [System Architecture](https://github.com/onsonr/sonr/wiki/3-%E2%80%90-System-Architecture)
4. [Token Economy](https://github.com/onsonr/sonr/wiki/4-%E2%80%90-Token-Economy)
5. [Service Mangement](https://github.com/onsonr/sonr/wiki/5-%E2%80%90-Service-Management)
6. [Design System](https://github.com/onsonr/sonr/wiki/6-%E2%80%90-Design-System)
7. [Self Custody](https://github.com/onsonr/sonr/wiki/7-%E2%80%90-Self-Custody)
# Stats ### 🔐 Gasless Onboarding
![Alt](https://repobeats.axiom.co/api/embed/8d0b17e889942889c5b6e632da09bd597efd84c4.svg "Repobeats analytics image") Create your first decentralized identity without owning cryptocurrency:
# Acknowledgements ```bash
# Register with WebAuthn (no tokens required!)
snrd auth register --username alice
Sonr would not have been possible without the direct and indirect support of the following individuals: # Register with automatic vault creation
snrd auth register --username bob --auto-vault
```
- **Juan Benet**: For the IPFS Ecosystem. ### 🌐 Multi-Chain Support
- **Satoshi Nakamoto**: For Bitcoin.
- **Steve Jobs**: For User first UX.
- **Tim Berners-Lee**: For the Internet.
# Community & Support - **Cosmos SDK**: Native integration with IBC ecosystem
- **EVM Compatibility**: Ethereum smart contract support
- **External Wallets**: MetaMask, Keplr, and more
- [Forum](https://github.com/onsonr/sonr/discussions) ### 🔑 Advanced Authentication
- [Issues](https://github.com/onsonr/sonr/issues)
- [Twitter](https://sonr.io/twitter) - **WebAuthn/Passkeys**: Biometric authentication
- **Hardware Security Keys**: YubiKey, Titan Key support
- **Multi-Signature**: Multiple verification methods per DID
### 📦 Decentralized Storage
- **IPFS Integration**: Distributed file storage
- **Encrypted Vaults**: Hardware-backed encryption
- **Protocol Schemas**: Structured data validation
## 📚 Technical Specifications
- **Cosmos SDK**: v0.50.14
- **CometBFT**: v0.38.17
- **IBC**: v8.7.0
- **Go**: 1.24.1 (toolchain 1.24.4)
- **WebAssembly**: CosmWasm v1.5.8
- **Task Queue**: Asynq (Redis-based)
- **Actor System**: Proto.Actor
- **Storage**: IPFS, LevelDB
## 🔒 Security
### Gasless Transaction Security
- Limited to WebAuthn registration only
- Full cryptographic validation required
- Credential uniqueness enforcement
- Anti-replay protection
### WebAuthn Security
- Origin validation
- Challenge-response authentication
- Device binding
- Attestation verification
### Multi-Algorithm Support
- Ed25519 (quantum-resistant)
- ECDSA (secp256k1, P-256)
- RSA (2048, 3072, 4096 bits)
- WebAuthn (ES256, RS256)
## 🚀 Quick Start
### Installation
```bash
# Clone the repository
git clone https://github.com/sonr-io/sonr
cd sonr
# Install the binary
make install
# Verify installation
snrd version
```
### Running a Local Node
```bash
# Start single-node testnet (quick iteration)
make localnet
# Start multi-node testnet with Starship
make testnet-start
# Stop testnet
make testnet-stop
```
### Building from Source
```bash
# Build blockchain node
make build
# Build Docker image
make docker
# Generate code from proto files
make proto-gen
```
### Local Development Network
```bash
# Standard localnet (auto-detects best method for your system)
make localnet # Works on Arch Linux, Ubuntu, macOS, etc.
# Docker-based localnet (requires Docker)
make dockernet # Runs in detached mode
# One-time setup for your system (optional)
./scripts/setup_localnet.sh # Installs dependencies and configures environment
```
### Testing
```bash
# Run all tests
make test-all
# Module-specific tests
make test-did # DID module tests
make test-dwn # DWN module tests
make test-svc # Service module tests
# E2E tests
make ictest-basic # Basic chain functionality
make ictest-ibc # IBC transfers
make ictest-wasm # CosmWasm integration
# Test with coverage
make test-cover
```
### Infrastructure
```bash
# IPFS for vault operations
make ipfs-up # Start IPFS infrastructure
make ipfs-down # Stop IPFS infrastructure
make ipfs-status # Check IPFS connectivity
```
## 🏗️ Architecture
Sonr is a Cosmos SDK-based blockchain with integrated IPFS storage and three custom modules:
### Core Components
#### **Blockchain Node (`snrd`)**
The main blockchain daemon built with Cosmos SDK v0.50.14, providing:
- AutoCLI for command generation
- EVM compatibility via Evmos integration
- IBC for cross-chain communication
- CosmWasm smart contract support
- IPFS integration for decentralized storage
### Cross-Platform Support
The `localnet` target automatically detects and uses the best available method:
1. Checks for local binary (built with `make install`)
2. Falls back to Docker if available
3. Handles permission issues on systems like Arch Linux
4. Supports systemd service installation (see `etc/systemd/`)
## 📖 Module Documentation
### DID Module
W3C DID specification implementation with:
- **Gasless WebAuthn Registration**: Create DIDs without cryptocurrency
- **Multi-Algorithm Signatures**: Ed25519, ECDSA, RSA, WebAuthn
- **External Wallet Linking**: MetaMask, Keplr integration
- **Verifiable Credentials**: W3C-compliant credential issuance
```bash
# Create a DID
snrd tx did create-did did:sonr:alice '{"id":"did:sonr:alice",...}' --from alice
# Link external wallet
snrd tx did link-external-wallet did:sonr:alice \
--wallet-address 0x742d35Cc6635C0532925a3b8c17C6e583F4d6A42 \
--wallet-type ethereum \
--from alice
# Query DID
snrd query did resolve did:sonr:alice
```
[Full DID Module Documentation](x/did/README.md)
### DWN Module
Personal data stores with:
- **Structured Data Records**: Hierarchical data organization
- **Protocol-Based Interactions**: Enforceable data schemas
- **Secure Vaults**: Enclave-based key management
- **Multi-Chain Support**: Cosmos SDK and EVM transaction building
```bash
# Create a vault
snrd tx dwn create-vault --from alice
# Store a record
snrd tx dwn write-record '{"data":"...", "protocol":"example.com"}' --from alice
# Query records
snrd query dwn records --owner alice
```
[Full DWN Module Documentation](x/dwn/README.md)
### Service Module
Decentralized service registry featuring:
- **Domain Verification**: DNS-based ownership proof
- **Service Registration**: Verified service endpoints
- **Permission Management**: UCAN capability integration
```bash
# Verify domain ownership
snrd tx svc initiate-domain-verification example.com --from alice
snrd tx svc verify-domain example.com --from alice
# Register service
snrd tx svc register-service my-service example.com \
--permissions "read,write" --from alice
```
[Full Service Module Documentation](x/svc/README.md)
## 🔧 Configuration
### Environment Variables
Environment variables can be configured via Docker Compose:
```bash
# Chain configuration
export CHAIN_ID="localchain_9000-1"
export BLOCK_TIME="1000ms"
# Network selection for Starship
export NETWORK="devnet" # or "testnet"
# IPFS configuration
IPFS_API_URL=http://ipfs:5001
```
Environment variables can be set directly or via a `.env` file in the project root.
### Starship Configuration
Edit `starship.yml` to configure multi-node testnets:
```yaml
chains:
- id: sonrtest_1-1
name: custom
numValidators: 3
image: onsonr/snrd:latest
# ... additional configuration
```
### Troubleshooting
**IPFS not accessible:**
```bash
# Verify IPFS is running
curl http://127.0.0.1:5001/api/v0/version
# Check IPFS status
make ipfs-status
```
**Port conflicts:**
- IPFS API: 5001
- IPFS Gateway: 8080
- Node gRPC: 9090
- Node REST API: 1317
Stop conflicting services or modify ports in configuration files.
## 🏗️ Project Structure
Sonr is a focused Cosmos SDK blockchain implementation:
```
sonr/
├── app/ # Application setup and module wiring
├── cmd/ # Binary entry points
│ └── snrd/ # Blockchain node daemon
├── x/ # Custom Cosmos SDK modules
│ ├── did/ # W3C DID implementation
│ ├── dwn/ # Decentralized Web Nodes
│ └── svc/ # Service management
├── types/ # Internal Go packages
├── proto/ # Protobuf definitions
├── scripts/ # Utility scripts
├── test/ # Integration tests
├── docs/ # Documentation
└── client/ # Client libraries and tooling
```
### Key Technologies
- **Cosmos SDK v0.50.14**: Blockchain framework
- **CometBFT v0.38.17**: Byzantine fault-tolerant consensus
- **IBC v8.7.0**: Inter-blockchain communication
- **CosmWasm v1.5.8**: Smart contract support
- **IPFS**: Decentralized storage integration
## 🤝 Community & Support
- [GitHub Discussions](https://github.com/sonr-io/sonr/discussions) - Community forum
- [GitHub Issues](https://github.com/sonr-io/sonr/issues) - Bug reports and feature requests
- [Twitter](https://sonr.io/twitter) - Latest updates
- [Documentation Wiki](https://github.com/sonr-io/sonr/wiki) - Detailed guides
## 📄 License
Copyright © 2024 Sonr, Inc.
Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for details.
---
<p align="center">
Built with ❤️ by the Sonr team
</p>
+498
View File
@@ -0,0 +1,498 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package modulev1
import (
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
fmt "fmt"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"
sync "sync"
)
var (
md_Module protoreflect.MessageDescriptor
)
func init() {
file_dex_module_v1_module_proto_init()
md_Module = File_dex_module_v1_module_proto.Messages().ByName("Module")
}
var _ protoreflect.Message = (*fastReflection_Module)(nil)
type fastReflection_Module Module
func (x *Module) ProtoReflect() protoreflect.Message {
return (*fastReflection_Module)(x)
}
func (x *Module) slowProtoReflect() protoreflect.Message {
mi := &file_dex_module_v1_module_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Module_messageType fastReflection_Module_messageType
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
type fastReflection_Module_messageType struct{}
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
return (*fastReflection_Module)(nil)
}
func (x fastReflection_Module_messageType) New() protoreflect.Message {
return new(fastReflection_Module)
}
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Module) Type() protoreflect.MessageType {
return _fastReflection_Module_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Module) New() protoreflect.Message {
return new(fastReflection_Module)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
return (*Module)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: dex.module.v1.Module"))
}
panic(fmt.Errorf("message dex.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: dex.module.v1.Module"))
}
panic(fmt.Errorf("message dex.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: dex.module.v1.Module"))
}
panic(fmt.Errorf("message dex.module.v1.Module does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: dex.module.v1.Module"))
}
panic(fmt.Errorf("message dex.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: dex.module.v1.Module"))
}
panic(fmt.Errorf("message dex.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: dex.module.v1.Module"))
}
panic(fmt.Errorf("message dex.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in dex.module.v1.Module", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Module) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: dex/module/v1/module.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Module is the app config object of the module.
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
type Module struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Module) Reset() {
*x = Module{}
if protoimpl.UnsafeEnabled {
mi := &file_dex_module_v1_module_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Module) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Module) ProtoMessage() {}
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
func (*Module) Descriptor() ([]byte, []int) {
return file_dex_module_v1_module_proto_rawDescGZIP(), []int{0}
}
var File_dex_module_v1_module_proto protoreflect.FileDescriptor
var file_dex_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x1a, 0x64, 0x65, 0x78, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x65,
0x78, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a,
0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1f, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x19, 0x0a,
0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72,
0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xaa, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d,
0x2e, 0x64, 0x65, 0x78, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b,
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2d, 0x69,
0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x65, 0x78, 0x2f, 0x6d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76,
0x31, 0xa2, 0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x65, 0x78, 0x2e, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x65, 0x78, 0x5c, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x65, 0x78, 0x5c, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x44, 0x65, 0x78, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_dex_module_v1_module_proto_rawDescOnce sync.Once
file_dex_module_v1_module_proto_rawDescData = file_dex_module_v1_module_proto_rawDesc
)
func file_dex_module_v1_module_proto_rawDescGZIP() []byte {
file_dex_module_v1_module_proto_rawDescOnce.Do(func() {
file_dex_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_dex_module_v1_module_proto_rawDescData)
})
return file_dex_module_v1_module_proto_rawDescData
}
var file_dex_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_dex_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: dex.module.v1.Module
}
var file_dex_module_v1_module_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_dex_module_v1_module_proto_init() }
func file_dex_module_v1_module_proto_init() {
if File_dex_module_v1_module_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_dex_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Module); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_dex_module_v1_module_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_dex_module_v1_module_proto_goTypes,
DependencyIndexes: file_dex_module_v1_module_proto_depIdxs,
MessageInfos: file_dex_module_v1_module_proto_msgTypes,
}.Build()
File_dex_module_v1_module_proto = out.File
file_dex_module_v1_module_proto_rawDesc = nil
file_dex_module_v1_module_proto_goTypes = nil
file_dex_module_v1_module_proto_depIdxs = nil
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+415
View File
@@ -0,0 +1,415 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: dex/v1/query.proto
package dexv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Query_Params_FullMethodName = "/dex.v1.Query/Params"
Query_Account_FullMethodName = "/dex.v1.Query/Account"
Query_Accounts_FullMethodName = "/dex.v1.Query/Accounts"
Query_Balance_FullMethodName = "/dex.v1.Query/Balance"
Query_Pool_FullMethodName = "/dex.v1.Query/Pool"
Query_Orders_FullMethodName = "/dex.v1.Query/Orders"
Query_History_FullMethodName = "/dex.v1.Query/History"
)
// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type QueryClient interface {
// Params queries the parameters of the module
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Account queries a DEX account by DID and connection
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error)
// Accounts queries all DEX accounts for a DID
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error)
// Balance queries remote chain balance
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error)
// Pool queries pool information
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error)
// Orders queries orders for a DID
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Orders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error)
// History queries transaction history
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
History(ctx context.Context, in *QueryHistoryRequest, opts ...grpc.CallOption) (*QueryHistoryResponse, error)
}
type queryClient struct {
cc grpc.ClientConnInterface
}
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) {
out := new(QueryAccountResponse)
err := c.cc.Invoke(ctx, Query_Account_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) {
out := new(QueryAccountsResponse)
err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) {
out := new(QueryBalanceResponse)
err := c.cc.Invoke(ctx, Query_Balance_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) {
out := new(QueryPoolResponse)
err := c.cc.Invoke(ctx, Query_Pool_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Orders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error) {
out := new(QueryOrdersResponse)
err := c.cc.Invoke(ctx, Query_Orders_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) History(ctx context.Context, in *QueryHistoryRequest, opts ...grpc.CallOption) (*QueryHistoryResponse, error) {
out := new(QueryHistoryResponse)
err := c.cc.Invoke(ctx, Query_History_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility
type QueryServer interface {
// Params queries the parameters of the module
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// Account queries a DEX account by DID and connection
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error)
// Accounts queries all DEX accounts for a DID
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error)
// Balance queries remote chain balance
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error)
// Pool queries pool information
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error)
// Orders queries orders for a DID
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
Orders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error)
// History queries transaction history
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_query_docs.md"}}
History(context.Context, *QueryHistoryRequest) (*QueryHistoryResponse, error)
mustEmbedUnimplementedQueryServer()
}
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
type UnimplementedQueryServer struct {
}
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Account not implemented")
}
func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented")
}
func (UnimplementedQueryServer) Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented")
}
func (UnimplementedQueryServer) Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Pool not implemented")
}
func (UnimplementedQueryServer) Orders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Orders not implemented")
}
func (UnimplementedQueryServer) History(context.Context, *QueryHistoryRequest) (*QueryHistoryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method History not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to QueryServer will
// result in compilation errors.
type UnsafeQueryServer interface {
mustEmbedUnimplementedQueryServer()
}
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
s.RegisterService(&Query_ServiceDesc, srv)
}
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryParamsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Params(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Params_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryAccountRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Account(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Account_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Account(ctx, req.(*QueryAccountRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryAccountsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Accounts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Accounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Balance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Balance_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Pool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryPoolRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Pool(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Pool_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Pool(ctx, req.(*QueryPoolRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Orders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryOrdersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Orders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Orders_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Orders(ctx, req.(*QueryOrdersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryHistoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).History(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_History_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).History(ctx, req.(*QueryHistoryRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Query_ServiceDesc = grpc.ServiceDesc{
ServiceName: "dex.v1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
{
MethodName: "Account",
Handler: _Query_Account_Handler,
},
{
MethodName: "Accounts",
Handler: _Query_Accounts_Handler,
},
{
MethodName: "Balance",
Handler: _Query_Balance_Handler,
},
{
MethodName: "Pool",
Handler: _Query_Pool_Handler,
},
{
MethodName: "Orders",
Handler: _Query_Orders_Handler,
},
{
MethodName: "History",
Handler: _Query_History_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "dex/v1/query.proto",
}
File diff suppressed because it is too large Load Diff
+366
View File
@@ -0,0 +1,366 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: dex/v1/tx.proto
package dexv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Msg_RegisterDEXAccount_FullMethodName = "/dex.v1.Msg/RegisterDEXAccount"
Msg_ExecuteSwap_FullMethodName = "/dex.v1.Msg/ExecuteSwap"
Msg_ProvideLiquidity_FullMethodName = "/dex.v1.Msg/ProvideLiquidity"
Msg_RemoveLiquidity_FullMethodName = "/dex.v1.Msg/RemoveLiquidity"
Msg_CreateLimitOrder_FullMethodName = "/dex.v1.Msg/CreateLimitOrder"
Msg_CancelOrder_FullMethodName = "/dex.v1.Msg/CancelOrder"
)
// MsgClient is the client API for Msg service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MsgClient interface {
// RegisterDEXAccount creates a new ICA account for DEX operations
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
RegisterDEXAccount(ctx context.Context, in *MsgRegisterDEXAccount, opts ...grpc.CallOption) (*MsgRegisterDEXAccountResponse, error)
// ExecuteSwap performs a token swap on a remote chain
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
ExecuteSwap(ctx context.Context, in *MsgExecuteSwap, opts ...grpc.CallOption) (*MsgExecuteSwapResponse, error)
// ProvideLiquidity adds liquidity to a pool
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
ProvideLiquidity(ctx context.Context, in *MsgProvideLiquidity, opts ...grpc.CallOption) (*MsgProvideLiquidityResponse, error)
// RemoveLiquidity removes liquidity from a pool
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
RemoveLiquidity(ctx context.Context, in *MsgRemoveLiquidity, opts ...grpc.CallOption) (*MsgRemoveLiquidityResponse, error)
// CreateLimitOrder creates a limit order
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
CreateLimitOrder(ctx context.Context, in *MsgCreateLimitOrder, opts ...grpc.CallOption) (*MsgCreateLimitOrderResponse, error)
// CancelOrder cancels an existing order
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
CancelOrder(ctx context.Context, in *MsgCancelOrder, opts ...grpc.CallOption) (*MsgCancelOrderResponse, error)
}
type msgClient struct {
cc grpc.ClientConnInterface
}
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
return &msgClient{cc}
}
func (c *msgClient) RegisterDEXAccount(ctx context.Context, in *MsgRegisterDEXAccount, opts ...grpc.CallOption) (*MsgRegisterDEXAccountResponse, error) {
out := new(MsgRegisterDEXAccountResponse)
err := c.cc.Invoke(ctx, Msg_RegisterDEXAccount_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) ExecuteSwap(ctx context.Context, in *MsgExecuteSwap, opts ...grpc.CallOption) (*MsgExecuteSwapResponse, error) {
out := new(MsgExecuteSwapResponse)
err := c.cc.Invoke(ctx, Msg_ExecuteSwap_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) ProvideLiquidity(ctx context.Context, in *MsgProvideLiquidity, opts ...grpc.CallOption) (*MsgProvideLiquidityResponse, error) {
out := new(MsgProvideLiquidityResponse)
err := c.cc.Invoke(ctx, Msg_ProvideLiquidity_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RemoveLiquidity(ctx context.Context, in *MsgRemoveLiquidity, opts ...grpc.CallOption) (*MsgRemoveLiquidityResponse, error) {
out := new(MsgRemoveLiquidityResponse)
err := c.cc.Invoke(ctx, Msg_RemoveLiquidity_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) CreateLimitOrder(ctx context.Context, in *MsgCreateLimitOrder, opts ...grpc.CallOption) (*MsgCreateLimitOrderResponse, error) {
out := new(MsgCreateLimitOrderResponse)
err := c.cc.Invoke(ctx, Msg_CreateLimitOrder_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) CancelOrder(ctx context.Context, in *MsgCancelOrder, opts ...grpc.CallOption) (*MsgCancelOrderResponse, error) {
out := new(MsgCancelOrderResponse)
err := c.cc.Invoke(ctx, Msg_CancelOrder_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MsgServer is the server API for Msg service.
// All implementations must embed UnimplementedMsgServer
// for forward compatibility
type MsgServer interface {
// RegisterDEXAccount creates a new ICA account for DEX operations
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
RegisterDEXAccount(context.Context, *MsgRegisterDEXAccount) (*MsgRegisterDEXAccountResponse, error)
// ExecuteSwap performs a token swap on a remote chain
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
ExecuteSwap(context.Context, *MsgExecuteSwap) (*MsgExecuteSwapResponse, error)
// ProvideLiquidity adds liquidity to a pool
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
ProvideLiquidity(context.Context, *MsgProvideLiquidity) (*MsgProvideLiquidityResponse, error)
// RemoveLiquidity removes liquidity from a pool
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
RemoveLiquidity(context.Context, *MsgRemoveLiquidity) (*MsgRemoveLiquidityResponse, error)
// CreateLimitOrder creates a limit order
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
CreateLimitOrder(context.Context, *MsgCreateLimitOrder) (*MsgCreateLimitOrderResponse, error)
// CancelOrder cancels an existing order
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dex_tx_docs.md"}}
CancelOrder(context.Context, *MsgCancelOrder) (*MsgCancelOrderResponse, error)
mustEmbedUnimplementedMsgServer()
}
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
type UnimplementedMsgServer struct {
}
func (UnimplementedMsgServer) RegisterDEXAccount(context.Context, *MsgRegisterDEXAccount) (*MsgRegisterDEXAccountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterDEXAccount not implemented")
}
func (UnimplementedMsgServer) ExecuteSwap(context.Context, *MsgExecuteSwap) (*MsgExecuteSwapResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExecuteSwap not implemented")
}
func (UnimplementedMsgServer) ProvideLiquidity(context.Context, *MsgProvideLiquidity) (*MsgProvideLiquidityResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProvideLiquidity not implemented")
}
func (UnimplementedMsgServer) RemoveLiquidity(context.Context, *MsgRemoveLiquidity) (*MsgRemoveLiquidityResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveLiquidity not implemented")
}
func (UnimplementedMsgServer) CreateLimitOrder(context.Context, *MsgCreateLimitOrder) (*MsgCreateLimitOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateLimitOrder not implemented")
}
func (UnimplementedMsgServer) CancelOrder(context.Context, *MsgCancelOrder) (*MsgCancelOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented")
}
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MsgServer will
// result in compilation errors.
type UnsafeMsgServer interface {
mustEmbedUnimplementedMsgServer()
}
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
s.RegisterService(&Msg_ServiceDesc, srv)
}
func _Msg_RegisterDEXAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRegisterDEXAccount)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RegisterDEXAccount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RegisterDEXAccount_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RegisterDEXAccount(ctx, req.(*MsgRegisterDEXAccount))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_ExecuteSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgExecuteSwap)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ExecuteSwap(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ExecuteSwap_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ExecuteSwap(ctx, req.(*MsgExecuteSwap))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_ProvideLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgProvideLiquidity)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ProvideLiquidity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ProvideLiquidity_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ProvideLiquidity(ctx, req.(*MsgProvideLiquidity))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RemoveLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRemoveLiquidity)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RemoveLiquidity(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RemoveLiquidity_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RemoveLiquidity(ctx, req.(*MsgRemoveLiquidity))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_CreateLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgCreateLimitOrder)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).CreateLimitOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_CreateLimitOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).CreateLimitOrder(ctx, req.(*MsgCreateLimitOrder))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgCancelOrder)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).CancelOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_CancelOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).CancelOrder(ctx, req.(*MsgCancelOrder))
}
return interceptor(ctx, in, info, handler)
}
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Msg_ServiceDesc = grpc.ServiceDesc{
ServiceName: "dex.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterDEXAccount",
Handler: _Msg_RegisterDEXAccount_Handler,
},
{
MethodName: "ExecuteSwap",
Handler: _Msg_ExecuteSwap_Handler,
},
{
MethodName: "ProvideLiquidity",
Handler: _Msg_ProvideLiquidity_Handler,
},
{
MethodName: "RemoveLiquidity",
Handler: _Msg_RemoveLiquidity_Handler,
},
{
MethodName: "CreateLimitOrder",
Handler: _Msg_CreateLimitOrder_Handler,
},
{
MethodName: "CancelOrder",
Handler: _Msg_CancelOrder_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "dex/v1/tx.proto",
}
+15 -15
View File
@@ -417,21 +417,21 @@ var file_did_module_v1_module_proto_rawDesc = []byte{
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x69, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x69,
0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a,
0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1f, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x19, 0x0a,
0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72,
0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xa9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xaa, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d,
0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2d, 0x69,
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d,
0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76,
0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x2e, 0x4d, 0x6f,
0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f,
0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f,
0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0xea, 0x02, 0x0f, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
File diff suppressed because it is too large Load Diff
+1623 -2244
View File
File diff suppressed because it is too large Load Diff
+12254 -1831
View File
File diff suppressed because it is too large Load Diff
+409 -66
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.3.0
// - protoc (unknown) // - protoc (unknown)
// source: did/v1/query.proto // source: did/v1/query.proto
@@ -15,27 +15,57 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( const (
Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Params_FullMethodName = "/did.v1.Query/Params"
Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" Query_ResolveDID_FullMethodName = "/did.v1.Query/ResolveDID"
Query_Verify_FullMethodName = "/did.v1.Query/Verify" Query_GetDIDDocument_FullMethodName = "/did.v1.Query/GetDIDDocument"
Query_ListDIDDocuments_FullMethodName = "/did.v1.Query/ListDIDDocuments"
Query_GetDIDDocumentsByController_FullMethodName = "/did.v1.Query/GetDIDDocumentsByController"
Query_GetVerificationMethod_FullMethodName = "/did.v1.Query/GetVerificationMethod"
Query_GetService_FullMethodName = "/did.v1.Query/GetService"
Query_GetVerifiableCredential_FullMethodName = "/did.v1.Query/GetVerifiableCredential"
Query_ListVerifiableCredentials_FullMethodName = "/did.v1.Query/ListVerifiableCredentials"
Query_GetCredentialsByDID_FullMethodName = "/did.v1.Query/GetCredentialsByDID"
Query_RegisterStart_FullMethodName = "/did.v1.Query/RegisterStart"
Query_LoginStart_FullMethodName = "/did.v1.Query/LoginStart"
) )
// QueryClient is the client API for Query service. // QueryClient is the client API for Query service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Query provides defines the gRPC querier service.
type QueryClient interface { type QueryClient interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Resolve queries the DID document by its id. // ResolveDID resolves a DID to its DID document
Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) //
// Verify verifies a message with the DID document // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_query_docs.md"}}
ResolveDID(ctx context.Context, in *QueryResolveDIDRequest, opts ...grpc.CallOption) (*QueryResolveDIDResponse, error)
// GetDIDDocument retrieves a DID document by its ID
GetDIDDocument(ctx context.Context, in *QueryGetDIDDocumentRequest, opts ...grpc.CallOption) (*QueryGetDIDDocumentResponse, error)
// ListDIDDocuments lists all DID documents with pagination
ListDIDDocuments(ctx context.Context, in *QueryListDIDDocumentsRequest, opts ...grpc.CallOption) (*QueryListDIDDocumentsResponse, error)
// GetDIDDocumentsByController retrieves DID documents by controller
GetDIDDocumentsByController(ctx context.Context, in *QueryGetDIDDocumentsByControllerRequest, opts ...grpc.CallOption) (*QueryGetDIDDocumentsByControllerResponse, error)
// GetVerificationMethod retrieves a specific verification method
GetVerificationMethod(ctx context.Context, in *QueryGetVerificationMethodRequest, opts ...grpc.CallOption) (*QueryGetVerificationMethodResponse, error)
// GetService retrieves a specific service endpoint
GetService(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error)
// GetVerifiableCredential retrieves a verifiable credential by ID
GetVerifiableCredential(ctx context.Context, in *QueryGetVerifiableCredentialRequest, opts ...grpc.CallOption) (*QueryGetVerifiableCredentialResponse, error)
// ListVerifiableCredentials lists all verifiable credentials with filtering options
ListVerifiableCredentials(ctx context.Context, in *QueryListVerifiableCredentialsRequest, opts ...grpc.CallOption) (*QueryListVerifiableCredentialsResponse, error)
// GetCredentialsByDID retrieves all credentials (verifiable and WebAuthn) associated with a DID
GetCredentialsByDID(ctx context.Context, in *QueryGetCredentialsByDIDRequest, opts ...grpc.CallOption) (*QueryGetCredentialsByDIDResponse, error)
// RegisterStart represents the start of the registration process
RegisterStart(ctx context.Context, in *QueryRegisterStartRequest, opts ...grpc.CallOption) (*QueryRegisterStartResponse, error)
// LoginStart represents the start of the login process
LoginStart(ctx context.Context, in *QueryLoginStartRequest, opts ...grpc.CallOption) (*QueryLoginStartResponse, error)
} }
type queryClient struct { type queryClient struct {
@@ -46,30 +76,108 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc} return &queryClient{cc}
} }
func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(QueryParamsResponse) out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { func (c *queryClient) ResolveDID(ctx context.Context, in *QueryResolveDIDRequest, opts ...grpc.CallOption) (*QueryResolveDIDResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryResolveDIDResponse)
out := new(QueryResolveResponse) err := c.cc.Invoke(ctx, Query_ResolveDID_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *queryClient) Verify(ctx context.Context, in *QueryVerifyRequest, opts ...grpc.CallOption) (*QueryVerifyResponse, error) { func (c *queryClient) GetDIDDocument(ctx context.Context, in *QueryGetDIDDocumentRequest, opts ...grpc.CallOption) (*QueryGetDIDDocumentResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryGetDIDDocumentResponse)
out := new(QueryVerifyResponse) err := c.cc.Invoke(ctx, Query_GetDIDDocument_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Query_Verify_FullMethodName, in, out, cOpts...) if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ListDIDDocuments(ctx context.Context, in *QueryListDIDDocumentsRequest, opts ...grpc.CallOption) (*QueryListDIDDocumentsResponse, error) {
out := new(QueryListDIDDocumentsResponse)
err := c.cc.Invoke(ctx, Query_ListDIDDocuments_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetDIDDocumentsByController(ctx context.Context, in *QueryGetDIDDocumentsByControllerRequest, opts ...grpc.CallOption) (*QueryGetDIDDocumentsByControllerResponse, error) {
out := new(QueryGetDIDDocumentsByControllerResponse)
err := c.cc.Invoke(ctx, Query_GetDIDDocumentsByController_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetVerificationMethod(ctx context.Context, in *QueryGetVerificationMethodRequest, opts ...grpc.CallOption) (*QueryGetVerificationMethodResponse, error) {
out := new(QueryGetVerificationMethodResponse)
err := c.cc.Invoke(ctx, Query_GetVerificationMethod_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetService(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) {
out := new(QueryGetServiceResponse)
err := c.cc.Invoke(ctx, Query_GetService_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetVerifiableCredential(ctx context.Context, in *QueryGetVerifiableCredentialRequest, opts ...grpc.CallOption) (*QueryGetVerifiableCredentialResponse, error) {
out := new(QueryGetVerifiableCredentialResponse)
err := c.cc.Invoke(ctx, Query_GetVerifiableCredential_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ListVerifiableCredentials(ctx context.Context, in *QueryListVerifiableCredentialsRequest, opts ...grpc.CallOption) (*QueryListVerifiableCredentialsResponse, error) {
out := new(QueryListVerifiableCredentialsResponse)
err := c.cc.Invoke(ctx, Query_ListVerifiableCredentials_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) GetCredentialsByDID(ctx context.Context, in *QueryGetCredentialsByDIDRequest, opts ...grpc.CallOption) (*QueryGetCredentialsByDIDResponse, error) {
out := new(QueryGetCredentialsByDIDResponse)
err := c.cc.Invoke(ctx, Query_GetCredentialsByDID_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) RegisterStart(ctx context.Context, in *QueryRegisterStartRequest, opts ...grpc.CallOption) (*QueryRegisterStartResponse, error) {
out := new(QueryRegisterStartResponse)
err := c.cc.Invoke(ctx, Query_RegisterStart_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) LoginStart(ctx context.Context, in *QueryLoginStartRequest, opts ...grpc.CallOption) (*QueryLoginStartResponse, error) {
out := new(QueryLoginStartResponse)
err := c.cc.Invoke(ctx, Query_LoginStart_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -78,37 +186,81 @@ func (c *queryClient) Verify(ctx context.Context, in *QueryVerifyRequest, opts .
// QueryServer is the server API for Query service. // QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer // All implementations must embed UnimplementedQueryServer
// for forward compatibility. // for forward compatibility
//
// Query provides defines the gRPC querier service.
type QueryServer interface { type QueryServer interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// Resolve queries the DID document by its id. // ResolveDID resolves a DID to its DID document
Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) //
// Verify verifies a message with the DID document // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_query_docs.md"}}
ResolveDID(context.Context, *QueryResolveDIDRequest) (*QueryResolveDIDResponse, error)
// GetDIDDocument retrieves a DID document by its ID
GetDIDDocument(context.Context, *QueryGetDIDDocumentRequest) (*QueryGetDIDDocumentResponse, error)
// ListDIDDocuments lists all DID documents with pagination
ListDIDDocuments(context.Context, *QueryListDIDDocumentsRequest) (*QueryListDIDDocumentsResponse, error)
// GetDIDDocumentsByController retrieves DID documents by controller
GetDIDDocumentsByController(context.Context, *QueryGetDIDDocumentsByControllerRequest) (*QueryGetDIDDocumentsByControllerResponse, error)
// GetVerificationMethod retrieves a specific verification method
GetVerificationMethod(context.Context, *QueryGetVerificationMethodRequest) (*QueryGetVerificationMethodResponse, error)
// GetService retrieves a specific service endpoint
GetService(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error)
// GetVerifiableCredential retrieves a verifiable credential by ID
GetVerifiableCredential(context.Context, *QueryGetVerifiableCredentialRequest) (*QueryGetVerifiableCredentialResponse, error)
// ListVerifiableCredentials lists all verifiable credentials with filtering options
ListVerifiableCredentials(context.Context, *QueryListVerifiableCredentialsRequest) (*QueryListVerifiableCredentialsResponse, error)
// GetCredentialsByDID retrieves all credentials (verifiable and WebAuthn) associated with a DID
GetCredentialsByDID(context.Context, *QueryGetCredentialsByDIDRequest) (*QueryGetCredentialsByDIDResponse, error)
// RegisterStart represents the start of the registration process
RegisterStart(context.Context, *QueryRegisterStartRequest) (*QueryRegisterStartResponse, error)
// LoginStart represents the start of the login process
LoginStart(context.Context, *QueryLoginStartRequest) (*QueryLoginStartResponse, error)
mustEmbedUnimplementedQueryServer() mustEmbedUnimplementedQueryServer()
} }
// UnimplementedQueryServer must be embedded to have // UnimplementedQueryServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedQueryServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedQueryServer struct{}
func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
} }
func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) { func (UnimplementedQueryServer) ResolveDID(context.Context, *QueryResolveDIDRequest) (*QueryResolveDIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") return nil, status.Errorf(codes.Unimplemented, "method ResolveDID not implemented")
} }
func (UnimplementedQueryServer) Verify(context.Context, *QueryVerifyRequest) (*QueryVerifyResponse, error) { func (UnimplementedQueryServer) GetDIDDocument(context.Context, *QueryGetDIDDocumentRequest) (*QueryGetDIDDocumentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetDIDDocument not implemented")
}
func (UnimplementedQueryServer) ListDIDDocuments(context.Context, *QueryListDIDDocumentsRequest) (*QueryListDIDDocumentsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListDIDDocuments not implemented")
}
func (UnimplementedQueryServer) GetDIDDocumentsByController(context.Context, *QueryGetDIDDocumentsByControllerRequest) (*QueryGetDIDDocumentsByControllerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDIDDocumentsByController not implemented")
}
func (UnimplementedQueryServer) GetVerificationMethod(context.Context, *QueryGetVerificationMethodRequest) (*QueryGetVerificationMethodResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVerificationMethod not implemented")
}
func (UnimplementedQueryServer) GetService(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented")
}
func (UnimplementedQueryServer) GetVerifiableCredential(context.Context, *QueryGetVerifiableCredentialRequest) (*QueryGetVerifiableCredentialResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVerifiableCredential not implemented")
}
func (UnimplementedQueryServer) ListVerifiableCredentials(context.Context, *QueryListVerifiableCredentialsRequest) (*QueryListVerifiableCredentialsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListVerifiableCredentials not implemented")
}
func (UnimplementedQueryServer) GetCredentialsByDID(context.Context, *QueryGetCredentialsByDIDRequest) (*QueryGetCredentialsByDIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCredentialsByDID not implemented")
}
func (UnimplementedQueryServer) RegisterStart(context.Context, *QueryRegisterStartRequest) (*QueryRegisterStartResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterStart not implemented")
}
func (UnimplementedQueryServer) LoginStart(context.Context, *QueryLoginStartRequest) (*QueryLoginStartResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LoginStart not implemented")
} }
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
func (UnimplementedQueryServer) testEmbeddedByValue() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to QueryServer will // Use of this interface is not recommended, as added methods to QueryServer will
@@ -118,18 +270,11 @@ type UnsafeQueryServer interface {
} }
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
// If the following call pancis, it indicates UnimplementedQueryServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Query_ServiceDesc, srv) s.RegisterService(&Query_ServiceDesc, srv)
} }
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRequest) in := new(QueryParamsRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@@ -141,43 +286,205 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
FullMethod: Query_Params_FullMethodName, FullMethod: Query_Params_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Params(ctx, req.(*QueryRequest)) return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_ResolveDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRequest) in := new(QueryResolveDIDRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(QueryServer).Resolve(ctx, in) return srv.(QueryServer).ResolveDID(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Query_Resolve_FullMethodName, FullMethod: Query_ResolveDID_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Resolve(ctx, req.(*QueryRequest)) return srv.(QueryServer).ResolveDID(ctx, req.(*QueryResolveDIDRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_GetDIDDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryVerifyRequest) in := new(QueryGetDIDDocumentRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(QueryServer).Verify(ctx, in) return srv.(QueryServer).GetDIDDocument(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Query_Verify_FullMethodName, FullMethod: Query_GetDIDDocument_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Verify(ctx, req.(*QueryVerifyRequest)) return srv.(QueryServer).GetDIDDocument(ctx, req.(*QueryGetDIDDocumentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ListDIDDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryListDIDDocumentsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ListDIDDocuments(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ListDIDDocuments_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ListDIDDocuments(ctx, req.(*QueryListDIDDocumentsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetDIDDocumentsByController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetDIDDocumentsByControllerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetDIDDocumentsByController(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetDIDDocumentsByController_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetDIDDocumentsByController(ctx, req.(*QueryGetDIDDocumentsByControllerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetVerificationMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetVerificationMethodRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetVerificationMethod(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetVerificationMethod_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetVerificationMethod(ctx, req.(*QueryGetVerificationMethodRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetServiceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetService_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetService(ctx, req.(*QueryGetServiceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetVerifiableCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetVerifiableCredentialRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetVerifiableCredential(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetVerifiableCredential_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetVerifiableCredential(ctx, req.(*QueryGetVerifiableCredentialRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ListVerifiableCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryListVerifiableCredentialsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ListVerifiableCredentials(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ListVerifiableCredentials_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ListVerifiableCredentials(ctx, req.(*QueryListVerifiableCredentialsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_GetCredentialsByDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetCredentialsByDIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetCredentialsByDID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_GetCredentialsByDID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetCredentialsByDID(ctx, req.(*QueryGetCredentialsByDIDRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_RegisterStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRegisterStartRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).RegisterStart(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_RegisterStart_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).RegisterStart(ctx, req.(*QueryRegisterStartRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_LoginStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryLoginStartRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).LoginStart(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_LoginStart_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).LoginStart(ctx, req.(*QueryLoginStartRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@@ -194,12 +501,48 @@ var Query_ServiceDesc = grpc.ServiceDesc{
Handler: _Query_Params_Handler, Handler: _Query_Params_Handler,
}, },
{ {
MethodName: "Resolve", MethodName: "ResolveDID",
Handler: _Query_Resolve_Handler, Handler: _Query_ResolveDID_Handler,
}, },
{ {
MethodName: "Verify", MethodName: "GetDIDDocument",
Handler: _Query_Verify_Handler, Handler: _Query_GetDIDDocument_Handler,
},
{
MethodName: "ListDIDDocuments",
Handler: _Query_ListDIDDocuments_Handler,
},
{
MethodName: "GetDIDDocumentsByController",
Handler: _Query_GetDIDDocumentsByController_Handler,
},
{
MethodName: "GetVerificationMethod",
Handler: _Query_GetVerificationMethod_Handler,
},
{
MethodName: "GetService",
Handler: _Query_GetService_Handler,
},
{
MethodName: "GetVerifiableCredential",
Handler: _Query_GetVerifiableCredential_Handler,
},
{
MethodName: "ListVerifiableCredentials",
Handler: _Query_ListVerifiableCredentials_Handler,
},
{
MethodName: "GetCredentialsByDID",
Handler: _Query_GetCredentialsByDID_Handler,
},
{
MethodName: "RegisterStart",
Handler: _Query_RegisterStart_Handler,
},
{
MethodName: "LoginStart",
Handler: _Query_LoginStart_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
File diff suppressed because it is too large Load Diff
+8057 -2084
View File
File diff suppressed because it is too large Load Diff
+12782 -6457
View File
File diff suppressed because it is too large Load Diff
+471 -226
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.3.0
// - protoc (unknown) // - protoc (unknown)
// source: did/v1/tx.proto // source: did/v1/tx.proto
@@ -15,37 +15,69 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( const (
Msg_ExecuteTx_FullMethodName = "/did.v1.Msg/ExecuteTx"
Msg_LinkAssertion_FullMethodName = "/did.v1.Msg/LinkAssertion"
Msg_LinkAuthentication_FullMethodName = "/did.v1.Msg/LinkAuthentication"
Msg_UnlinkAssertion_FullMethodName = "/did.v1.Msg/UnlinkAssertion"
Msg_UnlinkAuthentication_FullMethodName = "/did.v1.Msg/UnlinkAuthentication"
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams" Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
Msg_CreateDID_FullMethodName = "/did.v1.Msg/CreateDID"
Msg_UpdateDID_FullMethodName = "/did.v1.Msg/UpdateDID"
Msg_DeactivateDID_FullMethodName = "/did.v1.Msg/DeactivateDID"
Msg_AddVerificationMethod_FullMethodName = "/did.v1.Msg/AddVerificationMethod"
Msg_RemoveVerificationMethod_FullMethodName = "/did.v1.Msg/RemoveVerificationMethod"
Msg_AddService_FullMethodName = "/did.v1.Msg/AddService"
Msg_RemoveService_FullMethodName = "/did.v1.Msg/RemoveService"
Msg_IssueVerifiableCredential_FullMethodName = "/did.v1.Msg/IssueVerifiableCredential"
Msg_RevokeVerifiableCredential_FullMethodName = "/did.v1.Msg/RevokeVerifiableCredential"
Msg_LinkExternalWallet_FullMethodName = "/did.v1.Msg/LinkExternalWallet"
Msg_RegisterWebAuthnCredential_FullMethodName = "/did.v1.Msg/RegisterWebAuthnCredential"
) )
// MsgClient is the client API for Msg service. // MsgClient is the client API for Msg service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Msg defines the Msg service.
type MsgClient interface { type MsgClient interface {
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
// Macaroon for verification.
ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error)
// LinkAssertion links an assertion to a controller.
LinkAssertion(ctx context.Context, in *MsgLinkAssertion, opts ...grpc.CallOption) (*MsgLinkAssertionResponse, error)
// LinkAuthentication links an authentication to a controller.
LinkAuthentication(ctx context.Context, in *MsgLinkAuthentication, opts ...grpc.CallOption) (*MsgLinkAuthenticationResponse, error)
// UnlinkAssertion unlinks an assertion from a controller.
UnlinkAssertion(ctx context.Context, in *MsgUnlinkAssertion, opts ...grpc.CallOption) (*MsgUnlinkAssertionResponse, error)
// UnlinkAuthentication unlinks an authentication from a controller.
UnlinkAuthentication(ctx context.Context, in *MsgUnlinkAuthentication, opts ...grpc.CallOption) (*MsgUnlinkAuthenticationResponse, error)
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// CreateDID creates a new DID document
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_tx_docs.md"}}
CreateDID(ctx context.Context, in *MsgCreateDID, opts ...grpc.CallOption) (*MsgCreateDIDResponse, error)
// UpdateDID updates an existing DID document
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_tx_docs.md"}}
UpdateDID(ctx context.Context, in *MsgUpdateDID, opts ...grpc.CallOption) (*MsgUpdateDIDResponse, error)
// DeactivateDID deactivates a DID document
DeactivateDID(ctx context.Context, in *MsgDeactivateDID, opts ...grpc.CallOption) (*MsgDeactivateDIDResponse, error)
// AddVerificationMethod adds a new verification method to a DID document
AddVerificationMethod(ctx context.Context, in *MsgAddVerificationMethod, opts ...grpc.CallOption) (*MsgAddVerificationMethodResponse, error)
// RemoveVerificationMethod removes a verification method from a DID document
RemoveVerificationMethod(ctx context.Context, in *MsgRemoveVerificationMethod, opts ...grpc.CallOption) (*MsgRemoveVerificationMethodResponse, error)
// AddService adds a new service endpoint to a DID document
AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error)
// RemoveService removes a service endpoint from a DID document
RemoveService(ctx context.Context, in *MsgRemoveService, opts ...grpc.CallOption) (*MsgRemoveServiceResponse, error)
// IssueVerifiableCredential issues a new verifiable credential
IssueVerifiableCredential(ctx context.Context, in *MsgIssueVerifiableCredential, opts ...grpc.CallOption) (*MsgIssueVerifiableCredentialResponse, error)
// RevokeVerifiableCredential revokes a verifiable credential
RevokeVerifiableCredential(ctx context.Context, in *MsgRevokeVerifiableCredential, opts ...grpc.CallOption) (*MsgRevokeVerifiableCredentialResponse, error)
// LinkExternalWallet links an external wallet as an assertion method
LinkExternalWallet(ctx context.Context, in *MsgLinkExternalWallet, opts ...grpc.CallOption) (*MsgLinkExternalWalletResponse, error)
// RegisterWebAuthnCredential registers a new WebAuthn credential and creates a DID
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_tx_docs.md"}}
RegisterWebAuthnCredential(ctx context.Context, in *MsgRegisterWebAuthnCredential, opts ...grpc.CallOption) (*MsgRegisterWebAuthnCredentialResponse, error)
} }
type msgClient struct { type msgClient struct {
@@ -56,60 +88,108 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
return &msgClient{cc} return &msgClient{cc}
} }
func (c *msgClient) ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgExecuteTxResponse)
err := c.cc.Invoke(ctx, Msg_ExecuteTx_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) LinkAssertion(ctx context.Context, in *MsgLinkAssertion, opts ...grpc.CallOption) (*MsgLinkAssertionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgLinkAssertionResponse)
err := c.cc.Invoke(ctx, Msg_LinkAssertion_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) LinkAuthentication(ctx context.Context, in *MsgLinkAuthentication, opts ...grpc.CallOption) (*MsgLinkAuthenticationResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgLinkAuthenticationResponse)
err := c.cc.Invoke(ctx, Msg_LinkAuthentication_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) UnlinkAssertion(ctx context.Context, in *MsgUnlinkAssertion, opts ...grpc.CallOption) (*MsgUnlinkAssertionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgUnlinkAssertionResponse)
err := c.cc.Invoke(ctx, Msg_UnlinkAssertion_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) UnlinkAuthentication(ctx context.Context, in *MsgUnlinkAuthentication, opts ...grpc.CallOption) (*MsgUnlinkAuthenticationResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgUnlinkAuthenticationResponse)
err := c.cc.Invoke(ctx, Msg_UnlinkAuthentication_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgUpdateParamsResponse) out := new(MsgUpdateParamsResponse)
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) CreateDID(ctx context.Context, in *MsgCreateDID, opts ...grpc.CallOption) (*MsgCreateDIDResponse, error) {
out := new(MsgCreateDIDResponse)
err := c.cc.Invoke(ctx, Msg_CreateDID_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) UpdateDID(ctx context.Context, in *MsgUpdateDID, opts ...grpc.CallOption) (*MsgUpdateDIDResponse, error) {
out := new(MsgUpdateDIDResponse)
err := c.cc.Invoke(ctx, Msg_UpdateDID_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) DeactivateDID(ctx context.Context, in *MsgDeactivateDID, opts ...grpc.CallOption) (*MsgDeactivateDIDResponse, error) {
out := new(MsgDeactivateDIDResponse)
err := c.cc.Invoke(ctx, Msg_DeactivateDID_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) AddVerificationMethod(ctx context.Context, in *MsgAddVerificationMethod, opts ...grpc.CallOption) (*MsgAddVerificationMethodResponse, error) {
out := new(MsgAddVerificationMethodResponse)
err := c.cc.Invoke(ctx, Msg_AddVerificationMethod_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RemoveVerificationMethod(ctx context.Context, in *MsgRemoveVerificationMethod, opts ...grpc.CallOption) (*MsgRemoveVerificationMethodResponse, error) {
out := new(MsgRemoveVerificationMethodResponse)
err := c.cc.Invoke(ctx, Msg_RemoveVerificationMethod_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) AddService(ctx context.Context, in *MsgAddService, opts ...grpc.CallOption) (*MsgAddServiceResponse, error) {
out := new(MsgAddServiceResponse)
err := c.cc.Invoke(ctx, Msg_AddService_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RemoveService(ctx context.Context, in *MsgRemoveService, opts ...grpc.CallOption) (*MsgRemoveServiceResponse, error) {
out := new(MsgRemoveServiceResponse)
err := c.cc.Invoke(ctx, Msg_RemoveService_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) IssueVerifiableCredential(ctx context.Context, in *MsgIssueVerifiableCredential, opts ...grpc.CallOption) (*MsgIssueVerifiableCredentialResponse, error) {
out := new(MsgIssueVerifiableCredentialResponse)
err := c.cc.Invoke(ctx, Msg_IssueVerifiableCredential_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RevokeVerifiableCredential(ctx context.Context, in *MsgRevokeVerifiableCredential, opts ...grpc.CallOption) (*MsgRevokeVerifiableCredentialResponse, error) {
out := new(MsgRevokeVerifiableCredentialResponse)
err := c.cc.Invoke(ctx, Msg_RevokeVerifiableCredential_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) LinkExternalWallet(ctx context.Context, in *MsgLinkExternalWallet, opts ...grpc.CallOption) (*MsgLinkExternalWalletResponse, error) {
out := new(MsgLinkExternalWalletResponse)
err := c.cc.Invoke(ctx, Msg_LinkExternalWallet_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RegisterWebAuthnCredential(ctx context.Context, in *MsgRegisterWebAuthnCredential, opts ...grpc.CallOption) (*MsgRegisterWebAuthnCredentialResponse, error) {
out := new(MsgRegisterWebAuthnCredentialResponse)
err := c.cc.Invoke(ctx, Msg_RegisterWebAuthnCredential_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -118,53 +198,93 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
// MsgServer is the server API for Msg service. // MsgServer is the server API for Msg service.
// All implementations must embed UnimplementedMsgServer // All implementations must embed UnimplementedMsgServer
// for forward compatibility. // for forward compatibility
//
// Msg defines the Msg service.
type MsgServer interface { type MsgServer interface {
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
// Macaroon for verification.
ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error)
// LinkAssertion links an assertion to a controller.
LinkAssertion(context.Context, *MsgLinkAssertion) (*MsgLinkAssertionResponse, error)
// LinkAuthentication links an authentication to a controller.
LinkAuthentication(context.Context, *MsgLinkAuthentication) (*MsgLinkAuthenticationResponse, error)
// UnlinkAssertion unlinks an assertion from a controller.
UnlinkAssertion(context.Context, *MsgUnlinkAssertion) (*MsgUnlinkAssertionResponse, error)
// UnlinkAuthentication unlinks an authentication from a controller.
UnlinkAuthentication(context.Context, *MsgUnlinkAuthentication) (*MsgUnlinkAuthenticationResponse, error)
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// CreateDID creates a new DID document
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_tx_docs.md"}}
CreateDID(context.Context, *MsgCreateDID) (*MsgCreateDIDResponse, error)
// UpdateDID updates an existing DID document
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_tx_docs.md"}}
UpdateDID(context.Context, *MsgUpdateDID) (*MsgUpdateDIDResponse, error)
// DeactivateDID deactivates a DID document
DeactivateDID(context.Context, *MsgDeactivateDID) (*MsgDeactivateDIDResponse, error)
// AddVerificationMethod adds a new verification method to a DID document
AddVerificationMethod(context.Context, *MsgAddVerificationMethod) (*MsgAddVerificationMethodResponse, error)
// RemoveVerificationMethod removes a verification method from a DID document
RemoveVerificationMethod(context.Context, *MsgRemoveVerificationMethod) (*MsgRemoveVerificationMethodResponse, error)
// AddService adds a new service endpoint to a DID document
AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error)
// RemoveService removes a service endpoint from a DID document
RemoveService(context.Context, *MsgRemoveService) (*MsgRemoveServiceResponse, error)
// IssueVerifiableCredential issues a new verifiable credential
IssueVerifiableCredential(context.Context, *MsgIssueVerifiableCredential) (*MsgIssueVerifiableCredentialResponse, error)
// RevokeVerifiableCredential revokes a verifiable credential
RevokeVerifiableCredential(context.Context, *MsgRevokeVerifiableCredential) (*MsgRevokeVerifiableCredentialResponse, error)
// LinkExternalWallet links an external wallet as an assertion method
LinkExternalWallet(context.Context, *MsgLinkExternalWallet) (*MsgLinkExternalWalletResponse, error)
// RegisterWebAuthnCredential registers a new WebAuthn credential and creates a DID
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "did_tx_docs.md"}}
RegisterWebAuthnCredential(context.Context, *MsgRegisterWebAuthnCredential) (*MsgRegisterWebAuthnCredentialResponse, error)
mustEmbedUnimplementedMsgServer() mustEmbedUnimplementedMsgServer()
} }
// UnimplementedMsgServer must be embedded to have // UnimplementedMsgServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedMsgServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedMsgServer struct{}
func (UnimplementedMsgServer) ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExecuteTx not implemented")
}
func (UnimplementedMsgServer) LinkAssertion(context.Context, *MsgLinkAssertion) (*MsgLinkAssertionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LinkAssertion not implemented")
}
func (UnimplementedMsgServer) LinkAuthentication(context.Context, *MsgLinkAuthentication) (*MsgLinkAuthenticationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LinkAuthentication not implemented")
}
func (UnimplementedMsgServer) UnlinkAssertion(context.Context, *MsgUnlinkAssertion) (*MsgUnlinkAssertionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnlinkAssertion not implemented")
}
func (UnimplementedMsgServer) UnlinkAuthentication(context.Context, *MsgUnlinkAuthentication) (*MsgUnlinkAuthenticationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnlinkAuthentication not implemented")
}
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
} }
func (UnimplementedMsgServer) CreateDID(context.Context, *MsgCreateDID) (*MsgCreateDIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateDID not implemented")
}
func (UnimplementedMsgServer) UpdateDID(context.Context, *MsgUpdateDID) (*MsgUpdateDIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateDID not implemented")
}
func (UnimplementedMsgServer) DeactivateDID(context.Context, *MsgDeactivateDID) (*MsgDeactivateDIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeactivateDID not implemented")
}
func (UnimplementedMsgServer) AddVerificationMethod(context.Context, *MsgAddVerificationMethod) (*MsgAddVerificationMethodResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddVerificationMethod not implemented")
}
func (UnimplementedMsgServer) RemoveVerificationMethod(context.Context, *MsgRemoveVerificationMethod) (*MsgRemoveVerificationMethodResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveVerificationMethod not implemented")
}
func (UnimplementedMsgServer) AddService(context.Context, *MsgAddService) (*MsgAddServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented")
}
func (UnimplementedMsgServer) RemoveService(context.Context, *MsgRemoveService) (*MsgRemoveServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented")
}
func (UnimplementedMsgServer) IssueVerifiableCredential(context.Context, *MsgIssueVerifiableCredential) (*MsgIssueVerifiableCredentialResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IssueVerifiableCredential not implemented")
}
func (UnimplementedMsgServer) RevokeVerifiableCredential(context.Context, *MsgRevokeVerifiableCredential) (*MsgRevokeVerifiableCredentialResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RevokeVerifiableCredential not implemented")
}
func (UnimplementedMsgServer) LinkExternalWallet(context.Context, *MsgLinkExternalWallet) (*MsgLinkExternalWalletResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LinkExternalWallet not implemented")
}
func (UnimplementedMsgServer) RegisterWebAuthnCredential(context.Context, *MsgRegisterWebAuthnCredential) (*MsgRegisterWebAuthnCredentialResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterWebAuthnCredential not implemented")
}
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
func (UnimplementedMsgServer) testEmbeddedByValue() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MsgServer will // Use of this interface is not recommended, as added methods to MsgServer will
@@ -174,106 +294,9 @@ type UnsafeMsgServer interface {
} }
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
// If the following call pancis, it indicates UnimplementedMsgServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Msg_ServiceDesc, srv) s.RegisterService(&Msg_ServiceDesc, srv)
} }
func _Msg_ExecuteTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgExecuteTx)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ExecuteTx(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ExecuteTx_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ExecuteTx(ctx, req.(*MsgExecuteTx))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_LinkAssertion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgLinkAssertion)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).LinkAssertion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_LinkAssertion_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).LinkAssertion(ctx, req.(*MsgLinkAssertion))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_LinkAuthentication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgLinkAuthentication)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).LinkAuthentication(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_LinkAuthentication_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).LinkAuthentication(ctx, req.(*MsgLinkAuthentication))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_UnlinkAssertion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgUnlinkAssertion)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).UnlinkAssertion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_UnlinkAssertion_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).UnlinkAssertion(ctx, req.(*MsgUnlinkAssertion))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_UnlinkAuthentication_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgUnlinkAuthentication)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).UnlinkAuthentication(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_UnlinkAuthentication_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).UnlinkAuthentication(ctx, req.(*MsgUnlinkAuthentication))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgUpdateParams) in := new(MsgUpdateParams)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -292,6 +315,204 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Msg_CreateDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgCreateDID)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).CreateDID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_CreateDID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).CreateDID(ctx, req.(*MsgCreateDID))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_UpdateDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgUpdateDID)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).UpdateDID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_UpdateDID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).UpdateDID(ctx, req.(*MsgUpdateDID))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_DeactivateDID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgDeactivateDID)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).DeactivateDID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_DeactivateDID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).DeactivateDID(ctx, req.(*MsgDeactivateDID))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_AddVerificationMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAddVerificationMethod)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).AddVerificationMethod(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_AddVerificationMethod_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).AddVerificationMethod(ctx, req.(*MsgAddVerificationMethod))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RemoveVerificationMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRemoveVerificationMethod)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RemoveVerificationMethod(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RemoveVerificationMethod_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RemoveVerificationMethod(ctx, req.(*MsgRemoveVerificationMethod))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAddService)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).AddService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_AddService_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).AddService(ctx, req.(*MsgAddService))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRemoveService)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RemoveService(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RemoveService_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RemoveService(ctx, req.(*MsgRemoveService))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_IssueVerifiableCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgIssueVerifiableCredential)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).IssueVerifiableCredential(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_IssueVerifiableCredential_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).IssueVerifiableCredential(ctx, req.(*MsgIssueVerifiableCredential))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RevokeVerifiableCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRevokeVerifiableCredential)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RevokeVerifiableCredential(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RevokeVerifiableCredential_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RevokeVerifiableCredential(ctx, req.(*MsgRevokeVerifiableCredential))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_LinkExternalWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgLinkExternalWallet)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).LinkExternalWallet(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_LinkExternalWallet_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).LinkExternalWallet(ctx, req.(*MsgLinkExternalWallet))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RegisterWebAuthnCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRegisterWebAuthnCredential)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RegisterWebAuthnCredential(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RegisterWebAuthnCredential_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RegisterWebAuthnCredential(ctx, req.(*MsgRegisterWebAuthnCredential))
}
return interceptor(ctx, in, info, handler)
}
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@@ -299,30 +520,54 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
ServiceName: "did.v1.Msg", ServiceName: "did.v1.Msg",
HandlerType: (*MsgServer)(nil), HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{
MethodName: "ExecuteTx",
Handler: _Msg_ExecuteTx_Handler,
},
{
MethodName: "LinkAssertion",
Handler: _Msg_LinkAssertion_Handler,
},
{
MethodName: "LinkAuthentication",
Handler: _Msg_LinkAuthentication_Handler,
},
{
MethodName: "UnlinkAssertion",
Handler: _Msg_UnlinkAssertion_Handler,
},
{
MethodName: "UnlinkAuthentication",
Handler: _Msg_UnlinkAuthentication_Handler,
},
{ {
MethodName: "UpdateParams", MethodName: "UpdateParams",
Handler: _Msg_UpdateParams_Handler, Handler: _Msg_UpdateParams_Handler,
}, },
{
MethodName: "CreateDID",
Handler: _Msg_CreateDID_Handler,
},
{
MethodName: "UpdateDID",
Handler: _Msg_UpdateDID_Handler,
},
{
MethodName: "DeactivateDID",
Handler: _Msg_DeactivateDID_Handler,
},
{
MethodName: "AddVerificationMethod",
Handler: _Msg_AddVerificationMethod_Handler,
},
{
MethodName: "RemoveVerificationMethod",
Handler: _Msg_RemoveVerificationMethod_Handler,
},
{
MethodName: "AddService",
Handler: _Msg_AddService_Handler,
},
{
MethodName: "RemoveService",
Handler: _Msg_RemoveService_Handler,
},
{
MethodName: "IssueVerifiableCredential",
Handler: _Msg_IssueVerifiableCredential_Handler,
},
{
MethodName: "RevokeVerifiableCredential",
Handler: _Msg_RevokeVerifiableCredential_Handler,
},
{
MethodName: "LinkExternalWallet",
Handler: _Msg_LinkExternalWallet_Handler,
},
{
MethodName: "RegisterWebAuthnCredential",
Handler: _Msg_RegisterWebAuthnCredential_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "did/v1/tx.proto", Metadata: "did/v1/tx.proto",
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -417,21 +417,21 @@ var file_dwn_module_v1_module_proto_rawDesc = []byte{
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x77, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x64, 0x77,
0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a,
0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1f, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x19, 0x0a,
0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72,
0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xa9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xaa, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d,
0x64, 0x77, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x2e, 0x64, 0x77, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2d, 0x69,
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x77, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x77, 0x6e, 0x2f, 0x6d,
0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76,
0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x77, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x44, 0x77, 0x6e, 0x2e, 0x4d, 0x6f,
0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x77, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x44, 0x77, 0x6e, 0x5c, 0x4d, 0x6f,
0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x77, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x44, 0x77, 0x6e, 0x5c, 0x4d, 0x6f,
0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0xea, 0x02, 0x0f, 0x44, 0x77, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x44, 0x77, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
File diff suppressed because it is too large Load Diff
+1543 -1631
View File
File diff suppressed because it is too large Load Diff
+14522 -34
View File
File diff suppressed because it is too large Load Diff
+486 -24
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.3.0
// - protoc (unknown) // - protoc (unknown)
// source: dwn/v1/query.proto // source: dwn/v1/query.proto
@@ -15,21 +15,60 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( const (
Query_Params_FullMethodName = "/dwn.v1.Query/Params" Query_Params_FullMethodName = "/dwn.v1.Query/Params"
Query_IPFS_FullMethodName = "/dwn.v1.Query/IPFS"
Query_CID_FullMethodName = "/dwn.v1.Query/CID"
Query_Records_FullMethodName = "/dwn.v1.Query/Records"
Query_Record_FullMethodName = "/dwn.v1.Query/Record"
Query_Protocols_FullMethodName = "/dwn.v1.Query/Protocols"
Query_Protocol_FullMethodName = "/dwn.v1.Query/Protocol"
Query_Permissions_FullMethodName = "/dwn.v1.Query/Permissions"
Query_Vault_FullMethodName = "/dwn.v1.Query/Vault"
Query_Vaults_FullMethodName = "/dwn.v1.Query/Vaults"
Query_EncryptedRecord_FullMethodName = "/dwn.v1.Query/EncryptedRecord"
Query_EncryptionStatus_FullMethodName = "/dwn.v1.Query/EncryptionStatus"
Query_VRFContributions_FullMethodName = "/dwn.v1.Query/VRFContributions"
) )
// QueryClient is the client API for Query service. // QueryClient is the client API for Query service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Query provides defines the gRPC querier service.
type QueryClient interface { type QueryClient interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// IPFS queries the status of the IPFS node
IPFS(ctx context.Context, in *QueryIPFSRequest, opts ...grpc.CallOption) (*QueryIPFSResponse, error)
// CID returns the data for a given CID
CID(ctx context.Context, in *QueryCIDRequest, opts ...grpc.CallOption) (*QueryCIDResponse, error)
// Records queries DWN records with filters
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dwn_docs.md"}}
Records(ctx context.Context, in *QueryRecordsRequest, opts ...grpc.CallOption) (*QueryRecordsResponse, error)
// Record queries a specific DWN record by ID
Record(ctx context.Context, in *QueryRecordRequest, opts ...grpc.CallOption) (*QueryRecordResponse, error)
// Protocols queries DWN protocols
Protocols(ctx context.Context, in *QueryProtocolsRequest, opts ...grpc.CallOption) (*QueryProtocolsResponse, error)
// Protocol queries a specific DWN protocol
Protocol(ctx context.Context, in *QueryProtocolRequest, opts ...grpc.CallOption) (*QueryProtocolResponse, error)
// Permissions queries DWN permissions
Permissions(ctx context.Context, in *QueryPermissionsRequest, opts ...grpc.CallOption) (*QueryPermissionsResponse, error)
// Vault queries a specific vault
Vault(ctx context.Context, in *QueryVaultRequest, opts ...grpc.CallOption) (*QueryVaultResponse, error)
// Vaults queries vaults by owner
Vaults(ctx context.Context, in *QueryVaultsRequest, opts ...grpc.CallOption) (*QueryVaultsResponse, error)
// EncryptedRecord queries a specific encrypted record with automatic decryption
EncryptedRecord(ctx context.Context, in *QueryEncryptedRecordRequest, opts ...grpc.CallOption) (*QueryEncryptedRecordResponse, error)
// EncryptionStatus queries current encryption key state and version
EncryptionStatus(ctx context.Context, in *QueryEncryptionStatusRequest, opts ...grpc.CallOption) (*QueryEncryptionStatusResponse, error)
// VRFContributions lists VRF contributions for current consensus round
VRFContributions(ctx context.Context, in *QueryVRFContributionsRequest, opts ...grpc.CallOption) (*QueryVRFContributionsResponse, error)
} }
type queryClient struct { type queryClient struct {
@@ -41,9 +80,116 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
} }
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(QueryParamsResponse) out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) IPFS(ctx context.Context, in *QueryIPFSRequest, opts ...grpc.CallOption) (*QueryIPFSResponse, error) {
out := new(QueryIPFSResponse)
err := c.cc.Invoke(ctx, Query_IPFS_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) CID(ctx context.Context, in *QueryCIDRequest, opts ...grpc.CallOption) (*QueryCIDResponse, error) {
out := new(QueryCIDResponse)
err := c.cc.Invoke(ctx, Query_CID_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Records(ctx context.Context, in *QueryRecordsRequest, opts ...grpc.CallOption) (*QueryRecordsResponse, error) {
out := new(QueryRecordsResponse)
err := c.cc.Invoke(ctx, Query_Records_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Record(ctx context.Context, in *QueryRecordRequest, opts ...grpc.CallOption) (*QueryRecordResponse, error) {
out := new(QueryRecordResponse)
err := c.cc.Invoke(ctx, Query_Record_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Protocols(ctx context.Context, in *QueryProtocolsRequest, opts ...grpc.CallOption) (*QueryProtocolsResponse, error) {
out := new(QueryProtocolsResponse)
err := c.cc.Invoke(ctx, Query_Protocols_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Protocol(ctx context.Context, in *QueryProtocolRequest, opts ...grpc.CallOption) (*QueryProtocolResponse, error) {
out := new(QueryProtocolResponse)
err := c.cc.Invoke(ctx, Query_Protocol_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Permissions(ctx context.Context, in *QueryPermissionsRequest, opts ...grpc.CallOption) (*QueryPermissionsResponse, error) {
out := new(QueryPermissionsResponse)
err := c.cc.Invoke(ctx, Query_Permissions_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Vault(ctx context.Context, in *QueryVaultRequest, opts ...grpc.CallOption) (*QueryVaultResponse, error) {
out := new(QueryVaultResponse)
err := c.cc.Invoke(ctx, Query_Vault_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Vaults(ctx context.Context, in *QueryVaultsRequest, opts ...grpc.CallOption) (*QueryVaultsResponse, error) {
out := new(QueryVaultsResponse)
err := c.cc.Invoke(ctx, Query_Vaults_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) EncryptedRecord(ctx context.Context, in *QueryEncryptedRecordRequest, opts ...grpc.CallOption) (*QueryEncryptedRecordResponse, error) {
out := new(QueryEncryptedRecordResponse)
err := c.cc.Invoke(ctx, Query_EncryptedRecord_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) EncryptionStatus(ctx context.Context, in *QueryEncryptionStatusRequest, opts ...grpc.CallOption) (*QueryEncryptionStatusResponse, error) {
out := new(QueryEncryptionStatusResponse)
err := c.cc.Invoke(ctx, Query_EncryptionStatus_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) VRFContributions(ctx context.Context, in *QueryVRFContributionsRequest, opts ...grpc.CallOption) (*QueryVRFContributionsResponse, error) {
out := new(QueryVRFContributionsResponse)
err := c.cc.Invoke(ctx, Query_VRFContributions_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -52,27 +198,86 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
// QueryServer is the server API for Query service. // QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer // All implementations must embed UnimplementedQueryServer
// for forward compatibility. // for forward compatibility
//
// Query provides defines the gRPC querier service.
type QueryServer interface { type QueryServer interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// IPFS queries the status of the IPFS node
IPFS(context.Context, *QueryIPFSRequest) (*QueryIPFSResponse, error)
// CID returns the data for a given CID
CID(context.Context, *QueryCIDRequest) (*QueryCIDResponse, error)
// Records queries DWN records with filters
//
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dwn_docs.md"}}
Records(context.Context, *QueryRecordsRequest) (*QueryRecordsResponse, error)
// Record queries a specific DWN record by ID
Record(context.Context, *QueryRecordRequest) (*QueryRecordResponse, error)
// Protocols queries DWN protocols
Protocols(context.Context, *QueryProtocolsRequest) (*QueryProtocolsResponse, error)
// Protocol queries a specific DWN protocol
Protocol(context.Context, *QueryProtocolRequest) (*QueryProtocolResponse, error)
// Permissions queries DWN permissions
Permissions(context.Context, *QueryPermissionsRequest) (*QueryPermissionsResponse, error)
// Vault queries a specific vault
Vault(context.Context, *QueryVaultRequest) (*QueryVaultResponse, error)
// Vaults queries vaults by owner
Vaults(context.Context, *QueryVaultsRequest) (*QueryVaultsResponse, error)
// EncryptedRecord queries a specific encrypted record with automatic decryption
EncryptedRecord(context.Context, *QueryEncryptedRecordRequest) (*QueryEncryptedRecordResponse, error)
// EncryptionStatus queries current encryption key state and version
EncryptionStatus(context.Context, *QueryEncryptionStatusRequest) (*QueryEncryptionStatusResponse, error)
// VRFContributions lists VRF contributions for current consensus round
VRFContributions(context.Context, *QueryVRFContributionsRequest) (*QueryVRFContributionsResponse, error)
mustEmbedUnimplementedQueryServer() mustEmbedUnimplementedQueryServer()
} }
// UnimplementedQueryServer must be embedded to have // UnimplementedQueryServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedQueryServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedQueryServer struct{}
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
} }
func (UnimplementedQueryServer) IPFS(context.Context, *QueryIPFSRequest) (*QueryIPFSResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IPFS not implemented")
}
func (UnimplementedQueryServer) CID(context.Context, *QueryCIDRequest) (*QueryCIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CID not implemented")
}
func (UnimplementedQueryServer) Records(context.Context, *QueryRecordsRequest) (*QueryRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Records not implemented")
}
func (UnimplementedQueryServer) Record(context.Context, *QueryRecordRequest) (*QueryRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Record not implemented")
}
func (UnimplementedQueryServer) Protocols(context.Context, *QueryProtocolsRequest) (*QueryProtocolsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Protocols not implemented")
}
func (UnimplementedQueryServer) Protocol(context.Context, *QueryProtocolRequest) (*QueryProtocolResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Protocol not implemented")
}
func (UnimplementedQueryServer) Permissions(context.Context, *QueryPermissionsRequest) (*QueryPermissionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Permissions not implemented")
}
func (UnimplementedQueryServer) Vault(context.Context, *QueryVaultRequest) (*QueryVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Vault not implemented")
}
func (UnimplementedQueryServer) Vaults(context.Context, *QueryVaultsRequest) (*QueryVaultsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Vaults not implemented")
}
func (UnimplementedQueryServer) EncryptedRecord(context.Context, *QueryEncryptedRecordRequest) (*QueryEncryptedRecordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EncryptedRecord not implemented")
}
func (UnimplementedQueryServer) EncryptionStatus(context.Context, *QueryEncryptionStatusRequest) (*QueryEncryptionStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EncryptionStatus not implemented")
}
func (UnimplementedQueryServer) VRFContributions(context.Context, *QueryVRFContributionsRequest) (*QueryVRFContributionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method VRFContributions not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
func (UnimplementedQueryServer) testEmbeddedByValue() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to QueryServer will // Use of this interface is not recommended, as added methods to QueryServer will
@@ -82,13 +287,6 @@ type UnsafeQueryServer interface {
} }
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
// If the following call pancis, it indicates UnimplementedQueryServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Query_ServiceDesc, srv) s.RegisterService(&Query_ServiceDesc, srv)
} }
@@ -110,6 +308,222 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_IPFS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryIPFSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).IPFS(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_IPFS_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).IPFS(ctx, req.(*QueryIPFSRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_CID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryCIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).CID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_CID_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).CID(ctx, req.(*QueryCIDRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Records_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRecordsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Records(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Records_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Records(ctx, req.(*QueryRecordsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Record_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRecordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Record(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Record_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Record(ctx, req.(*QueryRecordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Protocols_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryProtocolsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Protocols(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Protocols_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Protocols(ctx, req.(*QueryProtocolsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Protocol_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryProtocolRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Protocol(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Protocol_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Protocol(ctx, req.(*QueryProtocolRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Permissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryPermissionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Permissions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Permissions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Permissions(ctx, req.(*QueryPermissionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Vault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryVaultRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Vault(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Vault_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Vault(ctx, req.(*QueryVaultRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Vaults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryVaultsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Vaults(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Vaults_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Vaults(ctx, req.(*QueryVaultsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_EncryptedRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryEncryptedRecordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).EncryptedRecord(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_EncryptedRecord_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).EncryptedRecord(ctx, req.(*QueryEncryptedRecordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_EncryptionStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryEncryptionStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).EncryptionStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_EncryptionStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).EncryptionStatus(ctx, req.(*QueryEncryptionStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_VRFContributions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryVRFContributionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).VRFContributions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_VRFContributions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).VRFContributions(ctx, req.(*QueryVRFContributionsRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service. // Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@@ -121,6 +535,54 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Params", MethodName: "Params",
Handler: _Query_Params_Handler, Handler: _Query_Params_Handler,
}, },
{
MethodName: "IPFS",
Handler: _Query_IPFS_Handler,
},
{
MethodName: "CID",
Handler: _Query_CID_Handler,
},
{
MethodName: "Records",
Handler: _Query_Records_Handler,
},
{
MethodName: "Record",
Handler: _Query_Record_Handler,
},
{
MethodName: "Protocols",
Handler: _Query_Protocols_Handler,
},
{
MethodName: "Protocol",
Handler: _Query_Protocol_Handler,
},
{
MethodName: "Permissions",
Handler: _Query_Permissions_Handler,
},
{
MethodName: "Vault",
Handler: _Query_Vault_Handler,
},
{
MethodName: "Vaults",
Handler: _Query_Vaults_Handler,
},
{
MethodName: "EncryptedRecord",
Handler: _Query_EncryptedRecord_Handler,
},
{
MethodName: "EncryptionStatus",
Handler: _Query_EncryptionStatus_Handler,
},
{
MethodName: "VRFContributions",
Handler: _Query_VRFContributions_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "dwn/v1/query.proto", Metadata: "dwn/v1/query.proto",
File diff suppressed because it is too large Load Diff
+11801 -477
View File
File diff suppressed because it is too large Load Diff
+8184 -254
View File
File diff suppressed because it is too large Load Diff
+226 -46
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.3.0
// - protoc (unknown) // - protoc (unknown)
// source: dwn/v1/tx.proto // source: dwn/v1/tx.proto
@@ -15,26 +15,40 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( const (
Msg_UpdateParams_FullMethodName = "/dwn.v1.Msg/UpdateParams" Msg_UpdateParams_FullMethodName = "/dwn.v1.Msg/UpdateParams"
Msg_Initialize_FullMethodName = "/dwn.v1.Msg/Initialize" Msg_RecordsWrite_FullMethodName = "/dwn.v1.Msg/RecordsWrite"
Msg_RecordsDelete_FullMethodName = "/dwn.v1.Msg/RecordsDelete"
Msg_ProtocolsConfigure_FullMethodName = "/dwn.v1.Msg/ProtocolsConfigure"
Msg_PermissionsGrant_FullMethodName = "/dwn.v1.Msg/PermissionsGrant"
Msg_PermissionsRevoke_FullMethodName = "/dwn.v1.Msg/PermissionsRevoke"
Msg_RotateVaultKeys_FullMethodName = "/dwn.v1.Msg/RotateVaultKeys"
) )
// MsgClient is the client API for Msg service. // MsgClient is the client API for Msg service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Msg defines the Msg service.
type MsgClient interface { type MsgClient interface {
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// Spawn spawns a new Vault // DWN Records Operations
Initialize(ctx context.Context, in *MsgInitialize, opts ...grpc.CallOption) (*MsgInitializeResponse, error) //
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dwn_docs.md"}}
RecordsWrite(ctx context.Context, in *MsgRecordsWrite, opts ...grpc.CallOption) (*MsgRecordsWriteResponse, error)
RecordsDelete(ctx context.Context, in *MsgRecordsDelete, opts ...grpc.CallOption) (*MsgRecordsDeleteResponse, error)
// DWN Protocols Operations
ProtocolsConfigure(ctx context.Context, in *MsgProtocolsConfigure, opts ...grpc.CallOption) (*MsgProtocolsConfigureResponse, error)
// DWN Permissions Operations
PermissionsGrant(ctx context.Context, in *MsgPermissionsGrant, opts ...grpc.CallOption) (*MsgPermissionsGrantResponse, error)
PermissionsRevoke(ctx context.Context, in *MsgPermissionsRevoke, opts ...grpc.CallOption) (*MsgPermissionsRevokeResponse, error)
// DWN Vault Operations
RotateVaultKeys(ctx context.Context, in *MsgRotateVaultKeys, opts ...grpc.CallOption) (*MsgRotateVaultKeysResponse, error)
} }
type msgClient struct { type msgClient struct {
@@ -46,19 +60,62 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
} }
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgUpdateParamsResponse) out := new(MsgUpdateParamsResponse)
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *msgClient) Initialize(ctx context.Context, in *MsgInitialize, opts ...grpc.CallOption) (*MsgInitializeResponse, error) { func (c *msgClient) RecordsWrite(ctx context.Context, in *MsgRecordsWrite, opts ...grpc.CallOption) (*MsgRecordsWriteResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgRecordsWriteResponse)
out := new(MsgInitializeResponse) err := c.cc.Invoke(ctx, Msg_RecordsWrite_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Msg_Initialize_FullMethodName, in, out, cOpts...) if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RecordsDelete(ctx context.Context, in *MsgRecordsDelete, opts ...grpc.CallOption) (*MsgRecordsDeleteResponse, error) {
out := new(MsgRecordsDeleteResponse)
err := c.cc.Invoke(ctx, Msg_RecordsDelete_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) ProtocolsConfigure(ctx context.Context, in *MsgProtocolsConfigure, opts ...grpc.CallOption) (*MsgProtocolsConfigureResponse, error) {
out := new(MsgProtocolsConfigureResponse)
err := c.cc.Invoke(ctx, Msg_ProtocolsConfigure_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) PermissionsGrant(ctx context.Context, in *MsgPermissionsGrant, opts ...grpc.CallOption) (*MsgPermissionsGrantResponse, error) {
out := new(MsgPermissionsGrantResponse)
err := c.cc.Invoke(ctx, Msg_PermissionsGrant_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) PermissionsRevoke(ctx context.Context, in *MsgPermissionsRevoke, opts ...grpc.CallOption) (*MsgPermissionsRevokeResponse, error) {
out := new(MsgPermissionsRevokeResponse)
err := c.cc.Invoke(ctx, Msg_PermissionsRevoke_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RotateVaultKeys(ctx context.Context, in *MsgRotateVaultKeys, opts ...grpc.CallOption) (*MsgRotateVaultKeysResponse, error) {
out := new(MsgRotateVaultKeysResponse)
err := c.cc.Invoke(ctx, Msg_RotateVaultKeys_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -67,34 +124,54 @@ func (c *msgClient) Initialize(ctx context.Context, in *MsgInitialize, opts ...g
// MsgServer is the server API for Msg service. // MsgServer is the server API for Msg service.
// All implementations must embed UnimplementedMsgServer // All implementations must embed UnimplementedMsgServer
// for forward compatibility. // for forward compatibility
//
// Msg defines the Msg service.
type MsgServer interface { type MsgServer interface {
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// Spawn spawns a new Vault // DWN Records Operations
Initialize(context.Context, *MsgInitialize) (*MsgInitializeResponse, error) //
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "dwn_docs.md"}}
RecordsWrite(context.Context, *MsgRecordsWrite) (*MsgRecordsWriteResponse, error)
RecordsDelete(context.Context, *MsgRecordsDelete) (*MsgRecordsDeleteResponse, error)
// DWN Protocols Operations
ProtocolsConfigure(context.Context, *MsgProtocolsConfigure) (*MsgProtocolsConfigureResponse, error)
// DWN Permissions Operations
PermissionsGrant(context.Context, *MsgPermissionsGrant) (*MsgPermissionsGrantResponse, error)
PermissionsRevoke(context.Context, *MsgPermissionsRevoke) (*MsgPermissionsRevokeResponse, error)
// DWN Vault Operations
RotateVaultKeys(context.Context, *MsgRotateVaultKeys) (*MsgRotateVaultKeysResponse, error)
mustEmbedUnimplementedMsgServer() mustEmbedUnimplementedMsgServer()
} }
// UnimplementedMsgServer must be embedded to have // UnimplementedMsgServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedMsgServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedMsgServer struct{}
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
} }
func (UnimplementedMsgServer) Initialize(context.Context, *MsgInitialize) (*MsgInitializeResponse, error) { func (UnimplementedMsgServer) RecordsWrite(context.Context, *MsgRecordsWrite) (*MsgRecordsWriteResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented") return nil, status.Errorf(codes.Unimplemented, "method RecordsWrite not implemented")
}
func (UnimplementedMsgServer) RecordsDelete(context.Context, *MsgRecordsDelete) (*MsgRecordsDeleteResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RecordsDelete not implemented")
}
func (UnimplementedMsgServer) ProtocolsConfigure(context.Context, *MsgProtocolsConfigure) (*MsgProtocolsConfigureResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProtocolsConfigure not implemented")
}
func (UnimplementedMsgServer) PermissionsGrant(context.Context, *MsgPermissionsGrant) (*MsgPermissionsGrantResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PermissionsGrant not implemented")
}
func (UnimplementedMsgServer) PermissionsRevoke(context.Context, *MsgPermissionsRevoke) (*MsgPermissionsRevokeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PermissionsRevoke not implemented")
}
func (UnimplementedMsgServer) RotateVaultKeys(context.Context, *MsgRotateVaultKeys) (*MsgRotateVaultKeysResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RotateVaultKeys not implemented")
} }
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
func (UnimplementedMsgServer) testEmbeddedByValue() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MsgServer will // Use of this interface is not recommended, as added methods to MsgServer will
@@ -104,13 +181,6 @@ type UnsafeMsgServer interface {
} }
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
// If the following call pancis, it indicates UnimplementedMsgServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Msg_ServiceDesc, srv) s.RegisterService(&Msg_ServiceDesc, srv)
} }
@@ -132,20 +202,110 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Msg_Initialize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_RecordsWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgInitialize) in := new(MsgRecordsWrite)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(MsgServer).Initialize(ctx, in) return srv.(MsgServer).RecordsWrite(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Msg_Initialize_FullMethodName, FullMethod: Msg_RecordsWrite_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).Initialize(ctx, req.(*MsgInitialize)) return srv.(MsgServer).RecordsWrite(ctx, req.(*MsgRecordsWrite))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RecordsDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRecordsDelete)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RecordsDelete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RecordsDelete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RecordsDelete(ctx, req.(*MsgRecordsDelete))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_ProtocolsConfigure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgProtocolsConfigure)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ProtocolsConfigure(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ProtocolsConfigure_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ProtocolsConfigure(ctx, req.(*MsgProtocolsConfigure))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_PermissionsGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgPermissionsGrant)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).PermissionsGrant(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_PermissionsGrant_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).PermissionsGrant(ctx, req.(*MsgPermissionsGrant))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_PermissionsRevoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgPermissionsRevoke)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).PermissionsRevoke(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_PermissionsRevoke_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).PermissionsRevoke(ctx, req.(*MsgPermissionsRevoke))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RotateVaultKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRotateVaultKeys)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).RotateVaultKeys(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_RotateVaultKeys_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RotateVaultKeys(ctx, req.(*MsgRotateVaultKeys))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@@ -162,8 +322,28 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
Handler: _Msg_UpdateParams_Handler, Handler: _Msg_UpdateParams_Handler,
}, },
{ {
MethodName: "Initialize", MethodName: "RecordsWrite",
Handler: _Msg_Initialize_Handler, Handler: _Msg_RecordsWrite_Handler,
},
{
MethodName: "RecordsDelete",
Handler: _Msg_RecordsDelete_Handler,
},
{
MethodName: "ProtocolsConfigure",
Handler: _Msg_ProtocolsConfigure_Handler,
},
{
MethodName: "PermissionsGrant",
Handler: _Msg_PermissionsGrant_Handler,
},
{
MethodName: "PermissionsRevoke",
Handler: _Msg_PermissionsRevoke_Handler,
},
{
MethodName: "RotateVaultKeys",
Handler: _Msg_RotateVaultKeys_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
+15 -15
View File
@@ -417,21 +417,21 @@ var file_svc_module_v1_module_proto_rawDesc = []byte{
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x76, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x76,
0x63, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x63, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a,
0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1f, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x19, 0x0a,
0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x17, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72,
0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xa9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x2d, 0x69, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xaa, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d,
0x73, 0x76, 0x63, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x2e, 0x73, 0x76, 0x63, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2d, 0x69,
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x76, 0x63, 0x2f, 0x6d, 0x6f, 0x64, 0x6f, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x76, 0x63, 0x2f, 0x6d,
0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76,
0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x76, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x76, 0x63, 0x2e, 0x4d, 0x6f,
0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x53, 0x76, 0x63, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x53, 0x76, 0x63, 0x5c, 0x4d, 0x6f,
0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x53, 0x76, 0x63, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x53, 0x76, 0x63, 0x5c, 0x4d, 0x6f,
0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0xea, 0x02, 0x0f, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
File diff suppressed because it is too large Load Diff
+1357 -3026
View File
File diff suppressed because it is too large Load Diff
+8840 -1112
View File
File diff suppressed because it is too large Load Diff
+247 -60
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.3.0
// - protoc (unknown) // - protoc (unknown)
// source: svc/v1/query.proto // source: svc/v1/query.proto
@@ -15,27 +15,45 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( const (
Query_Params_FullMethodName = "/svc.v1.Query/Params" Query_Params_FullMethodName = "/svc.v1.Query/Params"
Query_OriginExists_FullMethodName = "/svc.v1.Query/OriginExists" Query_DomainVerification_FullMethodName = "/svc.v1.Query/DomainVerification"
Query_ResolveOrigin_FullMethodName = "/svc.v1.Query/ResolveOrigin" Query_Service_FullMethodName = "/svc.v1.Query/Service"
Query_ServicesByOwner_FullMethodName = "/svc.v1.Query/ServicesByOwner"
Query_ServicesByDomain_FullMethodName = "/svc.v1.Query/ServicesByDomain"
Query_ServiceOIDCDiscovery_FullMethodName = "/svc.v1.Query/ServiceOIDCDiscovery"
Query_ServiceOIDCJWKS_FullMethodName = "/svc.v1.Query/ServiceOIDCJWKS"
Query_ServiceOIDCMetadata_FullMethodName = "/svc.v1.Query/ServiceOIDCMetadata"
) )
// QueryClient is the client API for Query service. // QueryClient is the client API for Query service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Query provides defines the gRPC querier service.
type QueryClient interface { type QueryClient interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// OriginExists queries if a given origin exists. // DomainVerification queries domain verification status by domain name.
OriginExists(ctx context.Context, in *QueryOriginExistsRequest, opts ...grpc.CallOption) (*QueryOriginExistsResponse, error) //
// ResolveOrigin queries the domain of a given service and returns its record with capabilities. // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
ResolveOrigin(ctx context.Context, in *QueryResolveOriginRequest, opts ...grpc.CallOption) (*QueryResolveOriginResponse, error) // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "svc_docs.md"}}
DomainVerification(ctx context.Context, in *QueryDomainVerificationRequest, opts ...grpc.CallOption) (*QueryDomainVerificationResponse, error)
// Service queries service information by service ID.
Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error)
// ServicesByOwner queries all services owned by a specific address.
ServicesByOwner(ctx context.Context, in *QueryServicesByOwnerRequest, opts ...grpc.CallOption) (*QueryServicesByOwnerResponse, error)
// ServicesByDomain queries services bound to a specific domain.
ServicesByDomain(ctx context.Context, in *QueryServicesByDomainRequest, opts ...grpc.CallOption) (*QueryServicesByDomainResponse, error)
// ServiceOIDCDiscovery queries OIDC discovery configuration for a service
ServiceOIDCDiscovery(ctx context.Context, in *QueryServiceOIDCDiscoveryRequest, opts ...grpc.CallOption) (*QueryServiceOIDCDiscoveryResponse, error)
// ServiceOIDCJWKS queries OIDC JWKS for a service
ServiceOIDCJWKS(ctx context.Context, in *QueryServiceOIDCJWKSRequest, opts ...grpc.CallOption) (*QueryServiceOIDCJWKSResponse, error)
// ServiceOIDCMetadata queries OIDC metadata for a service
ServiceOIDCMetadata(ctx context.Context, in *QueryServiceOIDCMetadataRequest, opts ...grpc.CallOption) (*QueryServiceOIDCMetadataResponse, error)
} }
type queryClient struct { type queryClient struct {
@@ -47,29 +65,71 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
} }
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(QueryParamsResponse) out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *queryClient) OriginExists(ctx context.Context, in *QueryOriginExistsRequest, opts ...grpc.CallOption) (*QueryOriginExistsResponse, error) { func (c *queryClient) DomainVerification(ctx context.Context, in *QueryDomainVerificationRequest, opts ...grpc.CallOption) (*QueryDomainVerificationResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDomainVerificationResponse)
out := new(QueryOriginExistsResponse) err := c.cc.Invoke(ctx, Query_DomainVerification_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Query_OriginExists_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *queryClient) ResolveOrigin(ctx context.Context, in *QueryResolveOriginRequest, opts ...grpc.CallOption) (*QueryResolveOriginResponse, error) { func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryServiceResponse)
out := new(QueryResolveOriginResponse) err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Query_ResolveOrigin_FullMethodName, in, out, cOpts...) if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ServicesByOwner(ctx context.Context, in *QueryServicesByOwnerRequest, opts ...grpc.CallOption) (*QueryServicesByOwnerResponse, error) {
out := new(QueryServicesByOwnerResponse)
err := c.cc.Invoke(ctx, Query_ServicesByOwner_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ServicesByDomain(ctx context.Context, in *QueryServicesByDomainRequest, opts ...grpc.CallOption) (*QueryServicesByDomainResponse, error) {
out := new(QueryServicesByDomainResponse)
err := c.cc.Invoke(ctx, Query_ServicesByDomain_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ServiceOIDCDiscovery(ctx context.Context, in *QueryServiceOIDCDiscoveryRequest, opts ...grpc.CallOption) (*QueryServiceOIDCDiscoveryResponse, error) {
out := new(QueryServiceOIDCDiscoveryResponse)
err := c.cc.Invoke(ctx, Query_ServiceOIDCDiscovery_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ServiceOIDCJWKS(ctx context.Context, in *QueryServiceOIDCJWKSRequest, opts ...grpc.CallOption) (*QueryServiceOIDCJWKSResponse, error) {
out := new(QueryServiceOIDCJWKSResponse)
err := c.cc.Invoke(ctx, Query_ServiceOIDCJWKS_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) ServiceOIDCMetadata(ctx context.Context, in *QueryServiceOIDCMetadataRequest, opts ...grpc.CallOption) (*QueryServiceOIDCMetadataResponse, error) {
out := new(QueryServiceOIDCMetadataResponse)
err := c.cc.Invoke(ctx, Query_ServiceOIDCMetadata_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -78,37 +138,61 @@ func (c *queryClient) ResolveOrigin(ctx context.Context, in *QueryResolveOriginR
// QueryServer is the server API for Query service. // QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer // All implementations must embed UnimplementedQueryServer
// for forward compatibility. // for forward compatibility
//
// Query provides defines the gRPC querier service.
type QueryServer interface { type QueryServer interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// OriginExists queries if a given origin exists. // DomainVerification queries domain verification status by domain name.
OriginExists(context.Context, *QueryOriginExistsRequest) (*QueryOriginExistsResponse, error) //
// ResolveOrigin queries the domain of a given service and returns its record with capabilities. // {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
ResolveOrigin(context.Context, *QueryResolveOriginRequest) (*QueryResolveOriginResponse, error) // It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "svc_docs.md"}}
DomainVerification(context.Context, *QueryDomainVerificationRequest) (*QueryDomainVerificationResponse, error)
// Service queries service information by service ID.
Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error)
// ServicesByOwner queries all services owned by a specific address.
ServicesByOwner(context.Context, *QueryServicesByOwnerRequest) (*QueryServicesByOwnerResponse, error)
// ServicesByDomain queries services bound to a specific domain.
ServicesByDomain(context.Context, *QueryServicesByDomainRequest) (*QueryServicesByDomainResponse, error)
// ServiceOIDCDiscovery queries OIDC discovery configuration for a service
ServiceOIDCDiscovery(context.Context, *QueryServiceOIDCDiscoveryRequest) (*QueryServiceOIDCDiscoveryResponse, error)
// ServiceOIDCJWKS queries OIDC JWKS for a service
ServiceOIDCJWKS(context.Context, *QueryServiceOIDCJWKSRequest) (*QueryServiceOIDCJWKSResponse, error)
// ServiceOIDCMetadata queries OIDC metadata for a service
ServiceOIDCMetadata(context.Context, *QueryServiceOIDCMetadataRequest) (*QueryServiceOIDCMetadataResponse, error)
mustEmbedUnimplementedQueryServer() mustEmbedUnimplementedQueryServer()
} }
// UnimplementedQueryServer must be embedded to have // UnimplementedQueryServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedQueryServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedQueryServer struct{}
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
} }
func (UnimplementedQueryServer) OriginExists(context.Context, *QueryOriginExistsRequest) (*QueryOriginExistsResponse, error) { func (UnimplementedQueryServer) DomainVerification(context.Context, *QueryDomainVerificationRequest) (*QueryDomainVerificationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OriginExists not implemented") return nil, status.Errorf(codes.Unimplemented, "method DomainVerification not implemented")
} }
func (UnimplementedQueryServer) ResolveOrigin(context.Context, *QueryResolveOriginRequest) (*QueryResolveOriginResponse, error) { func (UnimplementedQueryServer) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResolveOrigin not implemented") return nil, status.Errorf(codes.Unimplemented, "method Service not implemented")
}
func (UnimplementedQueryServer) ServicesByOwner(context.Context, *QueryServicesByOwnerRequest) (*QueryServicesByOwnerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServicesByOwner not implemented")
}
func (UnimplementedQueryServer) ServicesByDomain(context.Context, *QueryServicesByDomainRequest) (*QueryServicesByDomainResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServicesByDomain not implemented")
}
func (UnimplementedQueryServer) ServiceOIDCDiscovery(context.Context, *QueryServiceOIDCDiscoveryRequest) (*QueryServiceOIDCDiscoveryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceOIDCDiscovery not implemented")
}
func (UnimplementedQueryServer) ServiceOIDCJWKS(context.Context, *QueryServiceOIDCJWKSRequest) (*QueryServiceOIDCJWKSResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceOIDCJWKS not implemented")
}
func (UnimplementedQueryServer) ServiceOIDCMetadata(context.Context, *QueryServiceOIDCMetadataRequest) (*QueryServiceOIDCMetadataResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceOIDCMetadata not implemented")
} }
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
func (UnimplementedQueryServer) testEmbeddedByValue() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to QueryServer will // Use of this interface is not recommended, as added methods to QueryServer will
@@ -118,13 +202,6 @@ type UnsafeQueryServer interface {
} }
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
// If the following call pancis, it indicates UnimplementedQueryServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Query_ServiceDesc, srv) s.RegisterService(&Query_ServiceDesc, srv)
} }
@@ -146,38 +223,128 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_OriginExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_DomainVerification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryOriginExistsRequest) in := new(QueryDomainVerificationRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(QueryServer).OriginExists(ctx, in) return srv.(QueryServer).DomainVerification(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Query_OriginExists_FullMethodName, FullMethod: Query_DomainVerification_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).OriginExists(ctx, req.(*QueryOriginExistsRequest)) return srv.(QueryServer).DomainVerification(ctx, req.(*QueryDomainVerificationRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_ResolveOrigin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryResolveOriginRequest) in := new(QueryServiceRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(QueryServer).ResolveOrigin(ctx, in) return srv.(QueryServer).Service(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Query_ResolveOrigin_FullMethodName, FullMethod: Query_Service_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ResolveOrigin(ctx, req.(*QueryResolveOriginRequest)) return srv.(QueryServer).Service(ctx, req.(*QueryServiceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ServicesByOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryServicesByOwnerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ServicesByOwner(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ServicesByOwner_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ServicesByOwner(ctx, req.(*QueryServicesByOwnerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ServicesByDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryServicesByDomainRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ServicesByDomain(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ServicesByDomain_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ServicesByDomain(ctx, req.(*QueryServicesByDomainRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ServiceOIDCDiscovery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryServiceOIDCDiscoveryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ServiceOIDCDiscovery(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ServiceOIDCDiscovery_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ServiceOIDCDiscovery(ctx, req.(*QueryServiceOIDCDiscoveryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ServiceOIDCJWKS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryServiceOIDCJWKSRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ServiceOIDCJWKS(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ServiceOIDCJWKS_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ServiceOIDCJWKS(ctx, req.(*QueryServiceOIDCJWKSRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_ServiceOIDCMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryServiceOIDCMetadataRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).ServiceOIDCMetadata(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_ServiceOIDCMetadata_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ServiceOIDCMetadata(ctx, req.(*QueryServiceOIDCMetadataRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@@ -194,12 +361,32 @@ var Query_ServiceDesc = grpc.ServiceDesc{
Handler: _Query_Params_Handler, Handler: _Query_Params_Handler,
}, },
{ {
MethodName: "OriginExists", MethodName: "DomainVerification",
Handler: _Query_OriginExists_Handler, Handler: _Query_DomainVerification_Handler,
}, },
{ {
MethodName: "ResolveOrigin", MethodName: "Service",
Handler: _Query_ResolveOrigin_Handler, Handler: _Query_Service_Handler,
},
{
MethodName: "ServicesByOwner",
Handler: _Query_ServicesByOwner_Handler,
},
{
MethodName: "ServicesByDomain",
Handler: _Query_ServicesByDomain_Handler,
},
{
MethodName: "ServiceOIDCDiscovery",
Handler: _Query_ServiceOIDCDiscovery_Handler,
},
{
MethodName: "ServiceOIDCJWKS",
Handler: _Query_ServiceOIDCJWKS_Handler,
},
{
MethodName: "ServiceOIDCMetadata",
Handler: _Query_ServiceOIDCMetadata_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
File diff suppressed because it is too large Load Diff
+7593 -1051
View File
File diff suppressed because it is too large Load Diff
+2705 -217
View File
File diff suppressed because it is too large Load Diff
+99 -30
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.3.0
// - protoc (unknown) // - protoc (unknown)
// source: svc/v1/tx.proto // source: svc/v1/tx.proto
@@ -15,26 +15,34 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( const (
Msg_UpdateParams_FullMethodName = "/svc.v1.Msg/UpdateParams" Msg_UpdateParams_FullMethodName = "/svc.v1.Msg/UpdateParams"
Msg_InitiateDomainVerification_FullMethodName = "/svc.v1.Msg/InitiateDomainVerification"
Msg_VerifyDomain_FullMethodName = "/svc.v1.Msg/VerifyDomain"
Msg_RegisterService_FullMethodName = "/svc.v1.Msg/RegisterService" Msg_RegisterService_FullMethodName = "/svc.v1.Msg/RegisterService"
) )
// MsgClient is the client API for Msg service. // MsgClient is the client API for Msg service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// Msg defines the Msg service.
type MsgClient interface { type MsgClient interface {
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
// //
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// RegisterService initializes a Service with a given permission scope and // InitiateDomainVerification starts the domain verification process
// URI. The domain must have a valid TXT record containing the public key. //
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "svc_docs.md"}}
InitiateDomainVerification(ctx context.Context, in *MsgInitiateDomainVerification, opts ...grpc.CallOption) (*MsgInitiateDomainVerificationResponse, error)
// VerifyDomain completes domain verification by checking DNS TXT records
VerifyDomain(ctx context.Context, in *MsgVerifyDomain, opts ...grpc.CallOption) (*MsgVerifyDomainResponse, error)
// RegisterService registers a new service with verified domain binding
RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error)
} }
@@ -47,9 +55,26 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
} }
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgUpdateParamsResponse) out := new(MsgUpdateParamsResponse)
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) InitiateDomainVerification(ctx context.Context, in *MsgInitiateDomainVerification, opts ...grpc.CallOption) (*MsgInitiateDomainVerificationResponse, error) {
out := new(MsgInitiateDomainVerificationResponse)
err := c.cc.Invoke(ctx, Msg_InitiateDomainVerification_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) VerifyDomain(ctx context.Context, in *MsgVerifyDomain, opts ...grpc.CallOption) (*MsgVerifyDomainResponse, error) {
out := new(MsgVerifyDomainResponse)
err := c.cc.Invoke(ctx, Msg_VerifyDomain_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -57,9 +82,8 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
} }
func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) { func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MsgRegisterServiceResponse) out := new(MsgRegisterServiceResponse)
err := c.cc.Invoke(ctx, Msg_RegisterService_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, Msg_RegisterService_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -68,35 +92,43 @@ func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService,
// MsgServer is the server API for Msg service. // MsgServer is the server API for Msg service.
// All implementations must embed UnimplementedMsgServer // All implementations must embed UnimplementedMsgServer
// for forward compatibility. // for forward compatibility
//
// Msg defines the Msg service.
type MsgServer interface { type MsgServer interface {
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
// //
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// RegisterService initializes a Service with a given permission scope and // InitiateDomainVerification starts the domain verification process
// URI. The domain must have a valid TXT record containing the public key. //
// {{.MethodDescriptorProto.Name}} is a call with the method(s) {{$first := true}}{{range .Bindings}}{{if $first}}{{$first = false}}{{else}}, {{end}}{{.HTTPMethod}}{{end}} within the "{{.Service.Name}}" service.
// It takes in "{{.RequestType.Name}}" and returns a "{{.ResponseType.Name}}".
//
// {{import "svc_docs.md"}}
InitiateDomainVerification(context.Context, *MsgInitiateDomainVerification) (*MsgInitiateDomainVerificationResponse, error)
// VerifyDomain completes domain verification by checking DNS TXT records
VerifyDomain(context.Context, *MsgVerifyDomain) (*MsgVerifyDomainResponse, error)
// RegisterService registers a new service with verified domain binding
RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error)
mustEmbedUnimplementedMsgServer() mustEmbedUnimplementedMsgServer()
} }
// UnimplementedMsgServer must be embedded to have // UnimplementedMsgServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedMsgServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedMsgServer struct{}
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
} }
func (UnimplementedMsgServer) InitiateDomainVerification(context.Context, *MsgInitiateDomainVerification) (*MsgInitiateDomainVerificationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method InitiateDomainVerification not implemented")
}
func (UnimplementedMsgServer) VerifyDomain(context.Context, *MsgVerifyDomain) (*MsgVerifyDomainResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyDomain not implemented")
}
func (UnimplementedMsgServer) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) { func (UnimplementedMsgServer) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterService not implemented") return nil, status.Errorf(codes.Unimplemented, "method RegisterService not implemented")
} }
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
func (UnimplementedMsgServer) testEmbeddedByValue() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MsgServer will // Use of this interface is not recommended, as added methods to MsgServer will
@@ -106,13 +138,6 @@ type UnsafeMsgServer interface {
} }
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
// If the following call pancis, it indicates UnimplementedMsgServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Msg_ServiceDesc, srv) s.RegisterService(&Msg_ServiceDesc, srv)
} }
@@ -134,6 +159,42 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Msg_InitiateDomainVerification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgInitiateDomainVerification)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).InitiateDomainVerification(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_InitiateDomainVerification_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).InitiateDomainVerification(ctx, req.(*MsgInitiateDomainVerification))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_VerifyDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgVerifyDomain)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).VerifyDomain(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_VerifyDomain_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).VerifyDomain(ctx, req.(*MsgVerifyDomain))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgRegisterService) in := new(MsgRegisterService)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -163,6 +224,14 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
MethodName: "UpdateParams", MethodName: "UpdateParams",
Handler: _Msg_UpdateParams_Handler, Handler: _Msg_UpdateParams_Handler,
}, },
{
MethodName: "InitiateDomainVerification",
Handler: _Msg_InitiateDomainVerification_Handler,
},
{
MethodName: "VerifyDomain",
Handler: _Msg_VerifyDomain_Handler,
},
{ {
MethodName: "RegisterService", MethodName: "RegisterService",
Handler: _Msg_RegisterService_Handler, Handler: _Msg_RegisterService_Handler,
-74
View File
@@ -1,74 +0,0 @@
package app
import (
"errors"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
"github.com/cosmos/ibc-go/v8/modules/core/keeper"
circuitante "cosmossdk.io/x/circuit/ante"
circuitkeeper "cosmossdk.io/x/circuit/keeper"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
sdkmath "cosmossdk.io/math"
poaante "github.com/strangelove-ventures/poa/ante"
globalfeeante "github.com/strangelove-ventures/globalfee/x/globalfee/ante"
globalfeekeeper "github.com/strangelove-ventures/globalfee/x/globalfee/keeper"
)
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions
IBCKeeper *keeper.Keeper
CircuitKeeper *circuitkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
GlobalFeeKeeper globalfeekeeper.Keeper
BypassMinFeeMsgTypes []string
}
// NewAnteHandler constructor
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, errors.New("account keeper is required for ante builder")
}
if options.BankKeeper == nil {
return nil, errors.New("bank keeper is required for ante builder")
}
if options.SignModeHandler == nil {
return nil, errors.New("sign mode handler is required for ante builder")
}
if options.CircuitKeeper == nil {
return nil, errors.New("circuit keeper is required for ante builder")
}
poaDoGenTxRateValidation := false
poaRateFloor := sdkmath.LegacyMustNewDecFromStr("0.05")
poaRateCeil := sdkmath.LegacyMustNewDecFromStr("0.25")
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
// ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
globalfeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeKeeper, 2_000_000),
// ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
poaante.NewPOADisableStakingDecorator(),
poaante.NewCommissionLimitDecorator(poaDoGenTxRateValidation, poaRateFloor, poaRateCeil),
}
return sdk.ChainAnteDecorators(anteDecorators...), nil
}
+60
View File
@@ -0,0 +1,60 @@
// Package ante provides ante handler implementations for transaction processing
// in the Sonr blockchain. It supports both Cosmos SDK and Ethereum transactions.
package ante
import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
)
// NewAnteHandler returns an ante handler responsible for attempting to route an
// Ethereum or SDK transaction to an internal ante handler for performing
// transaction-level processing (e.g. fee payment, signature verification) before
// being passed onto it's respective handler.
//
// The handler inspects the transaction type and extension options to determine
// the appropriate processing path:
// - Ethereum transactions with ExtensionOptionsEthereumTx
// - Cosmos SDK transactions with ExtensionOptionDynamicFeeTx
// - Standard Cosmos SDK transactions
func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
return func(
ctx sdk.Context, tx sdk.Tx, sim bool,
) (newCtx sdk.Context, err error) {
var anteHandler sdk.AnteHandler
txWithExtensions, ok := tx.(authante.HasExtensionOptionsTx)
if ok {
opts := txWithExtensions.GetExtensionOptions()
if len(opts) > 0 {
switch typeURL := opts[0].GetTypeUrl(); typeURL {
case "/cosmos.evm.vm.v1.ExtensionOptionsEthereumTx":
// handle as *evmtypes.MsgEthereumTx
anteHandler = newMonoEVMAnteHandler(options)
case "/cosmos.evm.vm.v1.ExtensionOptionDynamicFeeTx":
// cosmos-sdk tx with dynamic fee extension
anteHandler = NewCosmosAnteHandler(options)
default:
return ctx, errorsmod.Wrapf(
errortypes.ErrUnknownExtensionOptions,
"rejecting tx with unsupported extension option: %s", typeURL,
)
}
return anteHandler(ctx, tx, sim)
}
}
// handle as totally normal Cosmos SDK tx
switch tx.(type) {
case sdk.Tx:
anteHandler = NewCosmosAnteHandler(options)
default:
return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid transaction type: %T", tx)
}
return anteHandler(ctx, tx, sim)
}
}
+107
View File
@@ -0,0 +1,107 @@
package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
sdkvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
evmoscosmosante "github.com/cosmos/evm/ante/cosmos"
evmante "github.com/cosmos/evm/ante/evm"
evmtypes "github.com/cosmos/evm/x/vm/types"
circuitante "cosmossdk.io/x/circuit/ante"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
)
// NewCosmosAnteHandler creates the default ante handler for Cosmos SDK transactions.
// It sets up a chain of decorators that perform various checks and operations:
// - Rejects Ethereum transactions in Cosmos context
// - Enforces authz limitations
// - Sets up transaction context
// - Validates basic transaction properties
// - Handles WebAuthn gasless transactions
// - Handles gas consumption and fee deduction
// - Performs signature verification
// - Manages account sequences
// - Handles IBC-specific checks
func NewCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
// Determine if we should use enhanced gasless mode
// Enhanced mode allows address generation from credentials for true gasless onboarding
enhancedGaslessMode := options.EnableEnhancedGasless
// Build the decorator chain
decorators := []sdk.AnteDecorator{
// WebAuthn bypass - must be first to intercept WebAuthn transactions
NewWebAuthnBypassDecorator(),
evmoscosmosante.NewRejectMessagesDecorator(), // reject MsgEthereumTxs
evmoscosmosante.NewAuthzLimiterDecorator( // disable the Msg types that cannot be included on an authz.MsgExec msgs field
sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}),
sdk.MsgTypeURL(&sdkvesting.MsgCreateVestingAccount{}),
),
ante.NewSetUpContextDecorator(),
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
// UCAN validation - must come before fee deduction for gasless support
NewConditionalUCANDecorator(NewUCANDecorator()),
evmoscosmosante.NewMinGasPriceDecorator(
options.FeeMarketKeeper,
options.EvmKeeper,
options.ControlPanelKeeper,
),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
// WebAuthn gasless transaction support - must come before fee deduction
// Enhanced mode allows true gasless onboarding without pre-existing accounts
NewWebAuthnGaslessDecorator(options.AccountKeeper, options.DidKeeper, enhancedGaslessMode),
// Conditional fee deduction - skips fees for gasless WebAuthn and UCAN
NewUCANGaslessDecorator(
NewConditionalFeeDecorator(ante.NewDeductFeeDecorator(
options.AccountKeeper,
options.BankKeeper,
options.FeegrantKeeper,
options.TxFeeChecker,
)),
),
}
// Add signature verification decorators
// In enhanced gasless mode, we wrap these to be conditional
if enhancedGaslessMode {
// Conditional decorators that skip verification for gasless transactions
decorators = append(
decorators,
NewConditionalPubKeyDecorator(ante.NewSetPubKeyDecorator(options.AccountKeeper)),
NewConditionalSigCountDecorator(
ante.NewValidateSigCountDecorator(options.AccountKeeper),
),
NewConditionalSigGasDecorator(
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
),
NewConditionalSignatureDecorator(
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
),
)
} else {
// Standard signature verification decorators
decorators = append(decorators,
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
)
}
// Add remaining decorators
decorators = append(decorators,
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
evmante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper),
)
return sdk.ChainAnteDecorators(decorators...)
}
+23
View File
@@ -0,0 +1,23 @@
package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
evmante "github.com/cosmos/evm/ante/evm"
)
// newMonoEVMAnteHandler creates the ante handler for Ethereum Virtual Machine transactions.
// It uses a single decorator that handles all EVM-specific validation and processing,
// including gas calculation, fee market dynamics, and account management.
//
// The mono decorator performs all EVM ante operations in a single pass for efficiency.
func newMonoEVMAnteHandler(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
evmante.NewEVMMonoDecorator(
options.AccountKeeper,
options.FeeMarketKeeper,
options.EvmKeeper,
options.ControlPanelKeeper,
options.MaxTxGasWanted,
),
)
}
+59
View File
@@ -0,0 +1,59 @@
package ante
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
)
// Ensure ControlPanelKeeper implements the interface
var _ anteinterfaces.ControlPanelKeeper = (*ControlPanelKeeper)(nil)
// ControlPanelKeeper provides control panel functionality for sponsored transactions.
// This is a simple implementation that can be extended to support sponsored addresses
// and custom transaction priorities in the future.
type ControlPanelKeeper struct {
// sponsoredAddresses could be loaded from state or configuration
sponsoredAddresses map[string]bool
// priority for sponsored transactions
sponsoredTxPriority int64
}
// NewControlPanelKeeper creates a new ControlPanelKeeper instance
func NewControlPanelKeeper() *ControlPanelKeeper {
return &ControlPanelKeeper{
sponsoredAddresses: make(map[string]bool),
sponsoredTxPriority: 0, // Default priority
}
}
// IsSponsoredAddress checks if an address is sponsored for gasless transactions
func (k *ControlPanelKeeper) IsSponsoredAddress(ctx context.Context, addr []byte) bool {
// For now, return false for all addresses
// This can be extended to check against a whitelist or state
return false
}
// GetSponsoredTransactionPriority returns the priority for sponsored transactions
func (k *ControlPanelKeeper) GetSponsoredTransactionPriority(ctx context.Context) int64 {
// Return default priority
// This can be made configurable or dynamic based on chain state
return k.sponsoredTxPriority
}
// SetSponsoredAddress adds or removes an address from the sponsored list
// This is a helper method for future use
func (k *ControlPanelKeeper) SetSponsoredAddress(addr sdk.AccAddress, sponsored bool) {
if sponsored {
k.sponsoredAddresses[addr.String()] = true
} else {
delete(k.sponsoredAddresses, addr.String())
}
}
// SetSponsoredTransactionPriority updates the priority for sponsored transactions
// This is a helper method for future use
func (k *ControlPanelKeeper) SetSponsoredTransactionPriority(priority int64) {
k.sponsoredTxPriority = priority
}
+129
View File
@@ -0,0 +1,129 @@
package ante
import (
"context"
addresscodec "cosmossdk.io/core/address"
errorsmod "cosmossdk.io/errors"
storetypes "cosmossdk.io/store/types"
circuitkeeper "cosmossdk.io/x/circuit/keeper"
txsigning "cosmossdk.io/x/tx/signing"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
)
// WebAuthnKeeperInterface defines the required methods from the DID keeper for WebAuthn gasless processing
type WebAuthnKeeperInterface interface {
// HasExistingCredential checks if this credential ID already exists
HasExistingCredential(ctx sdk.Context, credentialId string) bool
}
// BankKeeper defines the contract needed for supply related APIs.
// It provides methods for checking send permissions and transferring coins
// between accounts and modules.
type BankKeeper interface {
IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error
SendCoins(ctx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromAccountToModule(
ctx context.Context,
senderAddr sdk.AccAddress,
recipientModule string,
amt sdk.Coins,
) error
}
// AccountKeeper defines the account management interface required by ante handlers.
// It provides methods for account creation, retrieval, modification, and
// sequence number management.
type AccountKeeper interface {
NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
GetModuleAddress(moduleName string) sdk.AccAddress
GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
SetAccount(ctx context.Context, account sdk.AccountI)
RemoveAccount(ctx context.Context, account sdk.AccountI)
GetParams(ctx context.Context) (params authtypes.Params)
GetSequence(ctx context.Context, addr sdk.AccAddress) (uint64, error)
AddressCodec() addresscodec.Codec
}
// HandlerOptions defines the list of module keepers and configurations required
// to run the ante handler decorators. It includes both standard Cosmos SDK
// keepers and EVM-specific components for processing different transaction types.
type HandlerOptions struct {
Cdc codec.BinaryCodec
AccountKeeper AccountKeeper
BankKeeper BankKeeper
FeegrantKeeper ante.FeegrantKeeper
ExtensionOptionChecker ante.ExtensionOptionChecker
SignModeHandler *txsigning.HandlerMap
SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
TxFeeChecker ante.TxFeeChecker // safe to be nil
MaxTxGasWanted uint64
FeeMarketKeeper anteinterfaces.FeeMarketKeeper
EvmKeeper anteinterfaces.EVMKeeper
ControlPanelKeeper anteinterfaces.ControlPanelKeeper
IBCKeeper *ibckeeper.Keeper
CircuitKeeper *circuitkeeper.Keeper
// WebAuthn gasless transaction support
DidKeeper WebAuthnKeeperInterface
EnableEnhancedGasless bool // Enable enhanced gasless mode for true onboarding without pre-existing accounts
// UCAN module keepers for permission validation
DwnKeeper interface{} // Will be cast to proper type in decorator
DexKeeper interface{} // Will be cast to proper type in decorator
SvcKeeper interface{} // Will be cast to proper type in decorator
}
// Validate checks if all required keepers and handlers are properly initialized.
// It ensures that the HandlerOptions struct has all necessary components to
// process transactions without nil pointer errors.
func (options HandlerOptions) Validate() error {
if options.Cdc == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "codec is required for AnteHandler")
}
if options.AccountKeeper == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SigGasConsumer == nil {
return errorsmod.Wrap(
errortypes.ErrLogic,
"signature gas consumer is required for AnteHandler",
)
}
if options.SignModeHandler == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "sign mode handler is required for AnteHandler")
}
if options.CircuitKeeper == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "circuit keeper is required for ante builder")
}
if options.TxFeeChecker == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "tx fee checker is required for AnteHandler")
}
if options.FeeMarketKeeper == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "fee market keeper is required for AnteHandler")
}
if options.EvmKeeper == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "evm keeper is required for AnteHandler")
}
if options.ControlPanelKeeper == nil {
return errorsmod.Wrap(
errortypes.ErrLogic,
"control panel keeper is required for AnteHandler",
)
}
return nil
}
+127
View File
@@ -0,0 +1,127 @@
package ante
import (
"context"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/sonr-io/crypto/keys"
"github.com/sonr-io/crypto/ucan"
)
// UCANDecorator validates UCAN tokens in transactions
// This is a placeholder implementation that sets up the infrastructure
// for UCAN validation. In production, UCAN tokens would be passed
// in message fields or transaction extensions.
type UCANDecorator struct {
verifier *ucan.Verifier
}
// NewUCANDecorator creates a new UCAN decorator
func NewUCANDecorator() UCANDecorator {
// Create a basic DID resolver
didResolver := &BasicDIDResolver{}
verifier := ucan.NewVerifier(didResolver)
return UCANDecorator{
verifier: verifier,
}
}
// AnteHandle validates UCAN tokens for transactions requiring authorization
func (ud UCANDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// Skip validation in simulation mode
if simulate {
return next(ctx, tx, simulate)
}
// Check if transaction has UCAN extension
// This is where we would extract and validate UCAN tokens
// For now, this is a placeholder that demonstrates the structure
// Future implementation would:
// 1. Extract UCAN token from transaction extensions or memo
// 2. Validate the token using the verifier
// 3. Check capabilities against message types
// 4. Mark transaction as gasless if appropriate
// Check if transaction qualifies for gasless execution
if ud.isGaslessTransaction(ctx, tx) {
// Mark context for gasless processing
ctx = ctx.WithValue("gasless_ucan", true)
}
return next(ctx, tx, simulate)
}
// isGaslessTransaction checks if transaction qualifies for gasless execution
// This is a placeholder implementation
func (ud UCANDecorator) isGaslessTransaction(ctx sdk.Context, tx sdk.Tx) bool {
// In production, this would check for UCAN tokens with gasless capabilities
// For now, return false to maintain normal fee processing
return false
}
// CheckTokenExpiration checks if UCAN token has expired
func (ud UCANDecorator) CheckTokenExpiration(ctx sdk.Context, token *ucan.Token) error {
if token.ExpiresAt > 0 {
currentTime := ctx.BlockTime().Unix()
if currentTime > token.ExpiresAt {
return fmt.Errorf("UCAN token has expired")
}
}
// Check NotBefore
if token.NotBefore > 0 {
currentTime := ctx.BlockTime().Unix()
if currentTime < token.NotBefore {
return fmt.Errorf("UCAN token is not yet valid")
}
}
return nil
}
// ValidateCapabilities validates UCAN capabilities against required permissions
func (ud UCANDecorator) ValidateCapabilities(token *ucan.Token, requiredCapabilities []string) error {
// Check if token grants required capabilities
for _, att := range token.Attenuations {
if att.Capability.Grants(requiredCapabilities) {
return nil
}
}
return fmt.Errorf("UCAN token does not grant required capabilities")
}
// BasicDIDResolver implements ucan.DIDResolver for the ante handler
type BasicDIDResolver struct{}
// ResolveDIDKey resolves DID to public key for UCAN verification
func (r *BasicDIDResolver) ResolveDIDKey(ctx context.Context, did string) (keys.DID, error) {
// This is a basic implementation that accepts all DIDs
// In production, this would query the DID module
return keys.Parse(did)
}
// ConditionalUCANDecorator wraps UCAN decorator to skip for certain transactions
type ConditionalUCANDecorator struct {
decorator sdk.AnteDecorator
}
// NewConditionalUCANDecorator creates a conditional UCAN decorator
func NewConditionalUCANDecorator(decorator sdk.AnteDecorator) ConditionalUCANDecorator {
return ConditionalUCANDecorator{decorator: decorator}
}
// AnteHandle conditionally applies UCAN validation
func (cud ConditionalUCANDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// Skip UCAN validation if already marked as gasless WebAuthn
if ctx.Value("bypass_ucan") != nil {
return next(ctx, tx, simulate)
}
// Apply UCAN validation
return cud.decorator.AnteHandle(ctx, tx, simulate, next)
}
+124
View File
@@ -0,0 +1,124 @@
package ante
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/sonr-io/crypto/ucan"
)
// TestUCANDecorator tests the UCAN decorator functionality
func TestUCANDecorator(t *testing.T) {
// Test decorator creation
decorator := NewUCANDecorator()
assert.NotNil(t, decorator)
}
// TestUCANGaslessDecorator tests the gasless decorator
func TestUCANGaslessDecorator(t *testing.T) {
// Create mock fee decorator
mockFeeDecorator := &mockAnteDecorator{}
// Test gasless decorator creation
gaslessDecorator := NewUCANGaslessDecorator(mockFeeDecorator)
assert.NotNil(t, gaslessDecorator)
}
// TestConditionalUCANDecorator tests conditional UCAN decorator
func TestConditionalUCANDecorator(t *testing.T) {
// Create mock UCAN decorator
mockUCANDecorator := &mockAnteDecorator{}
// Test conditional decorator creation
conditionalDecorator := NewConditionalUCANDecorator(mockUCANDecorator)
assert.NotNil(t, conditionalDecorator)
}
// TestTokenExpiration tests UCAN token expiration validation
func TestTokenExpiration(t *testing.T) {
decorator := NewUCANDecorator()
ctx := sdk.Context{}.WithBlockTime(time.Now())
// Test expired token
expiredToken := &ucan.Token{
ExpiresAt: time.Now().Unix() - 3600, // 1 hour ago
}
err := decorator.CheckTokenExpiration(ctx, expiredToken)
require.Error(t, err)
assert.Contains(t, err.Error(), "UCAN token has expired")
// Test valid token
validToken := &ucan.Token{
ExpiresAt: time.Now().Unix() + 3600, // 1 hour from now
}
err = decorator.CheckTokenExpiration(ctx, validToken)
require.NoError(t, err)
// Test token not yet valid
futureToken := &ucan.Token{
NotBefore: time.Now().Unix() + 3600, // 1 hour from now
}
err = decorator.CheckTokenExpiration(ctx, futureToken)
require.Error(t, err)
assert.Contains(t, err.Error(), "UCAN token is not yet valid")
}
// TestValidateCapabilities tests capability validation
func TestValidateCapabilities(t *testing.T) {
decorator := NewUCANDecorator()
// Create token with single capability
token := &ucan.Token{
Attenuations: []ucan.Attenuation{
{
Capability: &ucan.SimpleCapability{
Action: "did/update",
},
},
},
}
// Test with matching capability
err := decorator.ValidateCapabilities(token, []string{"did/update"})
require.NoError(t, err)
// Test with non-matching capability
err = decorator.ValidateCapabilities(token, []string{"did/delete"})
require.Error(t, err)
assert.Contains(t, err.Error(), "UCAN token does not grant required capabilities")
// Test with multiple capabilities
multiToken := &ucan.Token{
Attenuations: []ucan.Attenuation{
{
Capability: &ucan.MultiCapability{
Actions: []string{"did/update", "did/create"},
},
},
},
}
err = decorator.ValidateCapabilities(multiToken, []string{"did/update"})
require.NoError(t, err)
err = decorator.ValidateCapabilities(multiToken, []string{"did/create"})
require.NoError(t, err)
err = decorator.ValidateCapabilities(multiToken, []string{"did/delete"})
require.Error(t, err)
}
// mockAnteDecorator is a helper for testing
type mockAnteDecorator struct{}
func (m *mockAnteDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
return next(ctx, tx, simulate)
}
+29
View File
@@ -0,0 +1,29 @@
package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// UCANGaslessDecorator allows gasless transactions for UCAN-authorized operations
type UCANGaslessDecorator struct {
feeDecorator sdk.AnteDecorator
}
// NewUCANGaslessDecorator creates a new UCAN gasless decorator
func NewUCANGaslessDecorator(feeDecorator sdk.AnteDecorator) UCANGaslessDecorator {
return UCANGaslessDecorator{
feeDecorator: feeDecorator,
}
}
// AnteHandle conditionally skips fee deduction for UCAN gasless transactions
func (ugd UCANGaslessDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// Check if transaction is marked as UCAN gasless
if ctx.Value("gasless_ucan") != nil {
// Skip fee deduction for gasless UCAN transaction
return next(ctx, tx, simulate)
}
// Apply normal fee deduction
return ugd.feeDecorator.AnteHandle(ctx, tx, simulate, next)
}
+81
View File
@@ -0,0 +1,81 @@
package ante
import (
sdk "github.com/cosmos/cosmos-sdk/types"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
didtypes "github.com/sonr-io/sonr/x/did/types"
)
// WebAuthnBypassDecorator completely bypasses signature verification for WebAuthn registration.
// This decorator must be placed FIRST in the ante handler chain to intercept WebAuthn
// transactions before any signature validation occurs.
type WebAuthnBypassDecorator struct{}
// NewWebAuthnBypassDecorator creates a new WebAuthnBypassDecorator
func NewWebAuthnBypassDecorator() WebAuthnBypassDecorator {
return WebAuthnBypassDecorator{}
}
// AnteHandle validates WebAuthn transactions and marks them for controlled processing
// This decorator performs essential security checks while allowing gasless processing
func (wbd WebAuthnBypassDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
msgs := tx.GetMsgs()
// Check if this is a single WebAuthn registration transaction
if len(msgs) != 1 {
// Not a single message transaction, proceed normally
return next(ctx, tx, sim)
}
msg, ok := msgs[0].(*didtypes.MsgRegisterWebAuthnCredential)
if !ok {
// Not a WebAuthn registration, proceed normally
return next(ctx, tx, sim)
}
// This is a WebAuthn registration - perform security validation
ctx.Logger().Info("Processing WebAuthn registration with controlled bypass",
"username", msg.Username,
"credential_id", msg.WebauthnCredential.CredentialId)
// CRITICAL SECURITY CHECK 1: Validate the WebAuthn credential structure
if err := msg.WebauthnCredential.ValidateStructure(); err != nil {
ctx.Logger().Error("WebAuthn credential structure validation failed", "error", err)
return ctx, err
}
// CRITICAL SECURITY CHECK 2: Handle signatures (dummy signatures are allowed for mempool validation)
if sigTx, ok := tx.(authsigning.SigVerifiableTx); ok {
sigs, err := sigTx.GetSignaturesV2()
if err != nil {
ctx.Logger().Error("Failed to get signatures from WebAuthn transaction", "error", err)
return ctx, err
}
if len(sigs) > 0 {
ctx.Logger().
Debug("WebAuthn transaction has dummy signatures for mempool validation", "sig_count", len(sigs))
// This is expected - dummy signatures are used to pass mempool validation
// The actual signature verification will be bypassed by conditional decorators
} else {
ctx.Logger().Debug("WebAuthn transaction has no signatures - gasless flow")
}
}
// CRITICAL SECURITY CHECK 3: Validate credential uniqueness to prevent replay attacks
// Note: This will be enforced in the WebAuthnGaslessDecorator with keeper access
// Mark context for controlled WebAuthn processing
// These flags will be checked by conditional decorators
ctx = ctx.WithValue("webauthn_bypass_validated", true)
ctx.Logger().Info("WebAuthn transaction validated - proceeding with controlled processing",
"credential_id", msg.WebauthnCredential.CredentialId,
"username", msg.Username)
// Continue to next decorator (WebAuthnGaslessDecorator) for full processing
return next(ctx, tx, sim)
}
+359
View File
@@ -0,0 +1,359 @@
// Package ante provides ante handler implementations for transaction processing
// in the Sonr blockchain. It supports both Cosmos SDK and Ethereum transactions.
package ante
import (
"crypto/sha256"
"encoding/hex"
"fmt"
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
didtypes "github.com/sonr-io/sonr/x/did/types"
)
// WebAuthnGaslessDecorator provides gasless transaction processing for WebAuthn registration.
// This decorator identifies WebAuthn credential registration messages and bypasses fee deduction,
// enabling users to create their first decentralized identity without requiring existing tokens.
//
// The decorator supports two modes:
// 1. Standard mode: Requires a controller address (for users with existing accounts)
// 2. Enhanced mode: Generates controller address from credential (for brand new users)
//
// Security considerations:
// - Only applies to MsgRegisterWebAuthnCredential messages
// - Validates WebAuthn credential authenticity before fee waiving
// - Prevents abuse through cryptographic WebAuthn requirements
// - Limited to one gasless transaction per unique credential
type WebAuthnGaslessDecorator struct {
accountKeeper AccountKeeper
didKeeper WebAuthnKeeperInterface
enhancedMode bool // If true, allows address generation from credentials
}
// NewWebAuthnGaslessDecorator creates a new WebAuthn gasless transaction decorator.
// This decorator must be placed in the ante handler chain BEFORE the fee deduction decorator
// to effectively bypass fee requirements for qualifying WebAuthn transactions.
//
// Set enhancedMode to true to enable automatic address generation from credentials,
// allowing truly gasless onboarding without pre-existing accounts.
func NewWebAuthnGaslessDecorator(
accountKeeper AccountKeeper,
didKeeper WebAuthnKeeperInterface,
enhancedMode bool,
) WebAuthnGaslessDecorator {
return WebAuthnGaslessDecorator{
accountKeeper: accountKeeper,
didKeeper: didKeeper,
enhancedMode: enhancedMode,
}
}
// AnteHandle processes the transaction and determines if WebAuthn gasless processing applies.
// For qualifying WebAuthn registration transactions, it sets transaction fees to zero
// and validates the WebAuthn credential to prevent abuse.
//
// Gasless criteria:
// 1. Transaction contains exactly one MsgRegisterWebAuthnCredential
// 2. WebAuthn credential passes cryptographic validation
// 3. Credential ID has not been used before (prevents replay attacks)
// 4. Transaction sender account exists or can be created
//
// In enhanced mode, if no controller is provided, it generates one from the credential.
func (wgd WebAuthnGaslessDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
// Process during both CheckTx (simulation) and DeliverTx (execution)
// This ensures gasless flags are set during mempool validation
msgs := tx.GetMsgs()
// Debug: Log entry into gasless decorator
ctx.Logger().Debug("WebAuthnGaslessDecorator: processing transaction",
"msg_count", len(msgs), "sim", sim)
// Check if this is a single WebAuthn registration transaction
if len(msgs) != 1 {
// Multi-message transactions don't qualify for gasless processing
return next(ctx, tx, sim)
}
msg, ok := msgs[0].(*didtypes.MsgRegisterWebAuthnCredential)
if !ok {
// Not a WebAuthn registration message
return next(ctx, tx, sim)
}
// Check if WebAuthn bypass validation already occurred
if bypassed, ok := ctx.Value("webauthn_bypass_validated").(bool); !ok || !bypassed {
// Validate the WebAuthn credential to prevent abuse (if not already validated)
if err := msg.WebauthnCredential.ValidateStructure(); err != nil {
return ctx, errorsmod.Wrapf(
errortypes.ErrInvalidRequest,
"invalid WebAuthn credential for gasless transaction: %v", err,
)
}
}
// Prevent credential reuse (anti-replay protection)
if wgd.didKeeper.HasExistingCredential(ctx, msg.WebauthnCredential.CredentialId) {
return ctx, errorsmod.Wrapf(
errortypes.ErrInvalidRequest,
"WebAuthn credential already registered: %s", msg.WebauthnCredential.CredentialId,
)
}
// Handle controller address
var controllerAddr sdk.AccAddress
// Enhanced mode: Generate address from credential if not provided
if wgd.enhancedMode && msg.GetController() == "" {
// Generate deterministic address from credential ID
controllerAddr = GenerateAddressFromCredential(msg.WebauthnCredential.CredentialId)
// Note: We can't modify the message directly in most cases,
// but we can pass the generated address through context
ctx = ctx.WithValue("generated_controller", controllerAddr.String())
ctx.Logger().Info(
"Generated controller address for gasless WebAuthn registration",
"generated_address", controllerAddr.String(),
"credential_id", msg.WebauthnCredential.CredentialId,
)
} else {
// Standard mode or enhanced mode with provided controller
controllerStr := msg.GetController()
if controllerStr == "" {
return ctx, errorsmod.Wrap(
errortypes.ErrInvalidAddress,
"controller address required for WebAuthn registration",
)
}
controllerAddr, err = sdk.AccAddressFromBech32(controllerStr)
if err != nil {
return ctx, errorsmod.Wrapf(
errortypes.ErrInvalidAddress,
"invalid controller address: %v", err,
)
}
}
// Ensure the account exists (simulation-safe)
account := wgd.accountKeeper.GetAccount(ctx, controllerAddr)
if account == nil {
// Create account if it doesn't exist (common for first-time WebAuthn users)
// Only actually create during execution, not simulation
if !sim {
account = wgd.accountKeeper.NewAccountWithAddress(ctx, controllerAddr)
wgd.accountKeeper.SetAccount(ctx, account)
ctx.Logger().Info(
"Created new account for gasless WebAuthn registration",
"address", controllerAddr.String(),
)
} else {
// During simulation (CheckTx), just create a temporary account for validation
// We don't assign it back to account variable since it's only for validation
wgd.accountKeeper.NewAccountWithAddress(ctx, controllerAddr)
}
}
// Mark this transaction as gasless
gaslessCtx := ctx.WithValue("webauthn_gasless", true)
// In enhanced mode, also mark to skip signature verification
if wgd.enhancedMode {
gaslessCtx = gaslessCtx.WithValue("skip_sig_verification", true)
gaslessCtx = gaslessCtx.WithValue("skip_pubkey_verification", true)
}
// Log the gasless transaction for monitoring and security purposes
ctx.Logger().Info(
"Processing gasless WebAuthn registration",
"controller", controllerAddr.String(),
"credential_id", msg.WebauthnCredential.CredentialId,
"username", msg.Username,
"auto_vault", msg.AutoCreateVault,
"enhanced_mode", wgd.enhancedMode,
)
return next(gaslessCtx, tx, sim)
}
// GenerateAddressFromCredential generates a deterministic address from a WebAuthn credential ID.
// This ensures the same credential always generates the same address, allowing for
// predictable account creation without requiring pre-existing blockchain state.
func GenerateAddressFromCredential(credentialID string) sdk.AccAddress {
// Create a deterministic hash from the credential ID
// Add a domain separator to prevent collisions with other address generation methods
domainSeparator := "webauthn_gasless_v1"
data := domainSeparator + credentialID
// Generate SHA256 hash
hash := sha256.Sum256([]byte(data))
// Take the first 20 bytes for the address (Ethereum-compatible)
return sdk.AccAddress(hash[:20])
}
// GenerateDIDFromCredential generates a deterministic DID from a WebAuthn credential.
// This creates a unique, reproducible DID for each WebAuthn credential.
func GenerateDIDFromCredential(credentialID string, username string) string {
// Create a deterministic hash from credential ID and username
data := credentialID + ":" + username
hash := sha256.Sum256([]byte(data))
// Create a DID with the sonr method
// Format: did:sonr:<hex-encoded-hash-prefix>
didSuffix := hex.EncodeToString(hash[:16]) // Use first 16 bytes for shorter DIDs
return fmt.Sprintf("did:sonr:%s", didSuffix)
}
// ConditionalFeeDecorator wraps the standard fee deduction decorator to conditionally
// skip fee deduction for gasless WebAuthn transactions marked by WebAuthnGaslessDecorator.
// This is the simplest possible implementation that reuses all existing SDK infrastructure.
type ConditionalFeeDecorator struct {
standardFeeDecorator sdk.AnteDecorator
}
// NewConditionalFeeDecorator creates a decorator that conditionally skips fee deduction
// for gasless transactions while maintaining all standard fee logic for other transactions.
func NewConditionalFeeDecorator(standardFeeDecorator sdk.AnteDecorator) ConditionalFeeDecorator {
return ConditionalFeeDecorator{
standardFeeDecorator: standardFeeDecorator,
}
}
// AnteHandle processes transactions and conditionally skips fee deduction for gasless WebAuthn transactions.
func (cfd ConditionalFeeDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
// Check if this transaction was marked as gasless by WebAuthnGaslessDecorator
if gasless, ok := ctx.Value("webauthn_gasless").(bool); ok && gasless {
// Skip fee deduction for gasless WebAuthn transactions
ctx.Logger().Info("Waiving fees for gasless WebAuthn registration")
return next(ctx, tx, sim)
}
// For all other transactions, use the standard fee deduction decorator
return cfd.standardFeeDecorator.AnteHandle(ctx, tx, sim, next)
}
// ConditionalSignatureDecorator wraps signature verification to skip it for gasless transactions
// This is used in enhanced mode where WebAuthn itself is the authentication mechanism.
type ConditionalSignatureDecorator struct {
sigVerifyDecorator sdk.AnteDecorator
}
// NewConditionalSignatureDecorator creates a decorator that conditionally skips signature verification
func NewConditionalSignatureDecorator(
sigVerifyDecorator sdk.AnteDecorator,
) ConditionalSignatureDecorator {
return ConditionalSignatureDecorator{
sigVerifyDecorator: sigVerifyDecorator,
}
}
// AnteHandle conditionally skips signature verification for gasless transactions
func (csd ConditionalSignatureDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
// Check if signature verification should be skipped
if skip, ok := ctx.Value("skip_sig_verification").(bool); ok && skip {
ctx.Logger().Debug("Skipping signature verification for gasless transaction")
return next(ctx, tx, sim)
}
// For all other transactions, use the standard signature verification
return csd.sigVerifyDecorator.AnteHandle(ctx, tx, sim, next)
}
// ConditionalPubKeyDecorator wraps pubkey setting to skip it for gasless transactions
// This is used in enhanced mode where accounts are created without pre-existing keys.
type ConditionalPubKeyDecorator struct {
setPubKeyDecorator sdk.AnteDecorator
}
// NewConditionalPubKeyDecorator creates a decorator that conditionally skips pubkey setting
func NewConditionalPubKeyDecorator(
setPubKeyDecorator sdk.AnteDecorator,
) ConditionalPubKeyDecorator {
return ConditionalPubKeyDecorator{
setPubKeyDecorator: setPubKeyDecorator,
}
}
// AnteHandle conditionally skips pubkey setting for gasless transactions
func (cpd ConditionalPubKeyDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
// Check if pubkey verification should be skipped
if skip, ok := ctx.Value("skip_pubkey_verification").(bool); ok && skip {
ctx.Logger().Debug("Skipping pubkey setting for gasless transaction")
return next(ctx, tx, sim)
}
// For all other transactions, use the standard pubkey decorator
return cpd.setPubKeyDecorator.AnteHandle(ctx, tx, sim, next)
}
// ConditionalSigCountDecorator wraps signature count validation to skip it for gasless transactions
// This is critical for gasless WebAuthn transactions which have no signatures to validate.
type ConditionalSigCountDecorator struct {
sigCountDecorator sdk.AnteDecorator
}
// NewConditionalSigCountDecorator creates a decorator that conditionally skips signature count validation
func NewConditionalSigCountDecorator(
sigCountDecorator sdk.AnteDecorator,
) ConditionalSigCountDecorator {
return ConditionalSigCountDecorator{
sigCountDecorator: sigCountDecorator,
}
}
// AnteHandle conditionally skips signature count validation for gasless transactions
func (cscd ConditionalSigCountDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
// Check if signature verification should be skipped (implies no signatures to count)
if skip, ok := ctx.Value("skip_sig_verification").(bool); ok && skip {
ctx.Logger().Debug("Skipping signature count validation for gasless transaction")
return next(ctx, tx, sim)
}
// For all other transactions, use the standard signature count validator
return cscd.sigCountDecorator.AnteHandle(ctx, tx, sim, next)
}
// ConditionalSigGasDecorator wraps signature gas consumption to skip it for gasless transactions
// This prevents "no signatures supplied" errors for gasless WebAuthn transactions.
type ConditionalSigGasDecorator struct {
sigGasDecorator sdk.AnteDecorator
}
// NewConditionalSigGasDecorator creates a decorator that conditionally skips signature gas consumption
func NewConditionalSigGasDecorator(
sigGasDecorator sdk.AnteDecorator,
) ConditionalSigGasDecorator {
return ConditionalSigGasDecorator{
sigGasDecorator: sigGasDecorator,
}
}
// AnteHandle conditionally skips signature gas consumption for gasless transactions
func (csgd ConditionalSigGasDecorator) AnteHandle(
ctx sdk.Context, tx sdk.Tx, sim bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error) {
// Check if signature verification should be skipped (implies no signature gas consumption needed)
if skip, ok := ctx.Value("skip_sig_verification").(bool); ok && skip {
ctx.Logger().Debug("Skipping signature gas consumption for gasless transaction")
return next(ctx, tx, sim)
}
// For all other transactions, use the standard signature gas decorator
return csgd.sigGasDecorator.AnteHandle(ctx, tx, sim, next)
}
+271
View File
@@ -0,0 +1,271 @@
package ante_test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/sonr-io/sonr/app/ante"
)
// MockWebAuthnKeeper implements the WebAuthnKeeperInterface for testing
type MockWebAuthnKeeper struct {
existingCredentials map[string]bool
}
func NewMockWebAuthnKeeper() *MockWebAuthnKeeper {
return &MockWebAuthnKeeper{
existingCredentials: make(map[string]bool),
}
}
func (m *MockWebAuthnKeeper) HasExistingCredential(ctx sdk.Context, credentialId string) bool {
return m.existingCredentials[credentialId]
}
func (m *MockWebAuthnKeeper) AddCredential(credentialId string) {
m.existingCredentials[credentialId] = true
}
// MockAccountKeeper - Simple mock without complex interface implementation
// For comprehensive testing, we'd implement the full AccountKeeper interface
// MockTransaction implements sdk.Tx for testing
type MockTransaction struct {
messages []sdk.Msg
}
func (m *MockTransaction) GetMsgs() []sdk.Msg {
return m.messages
}
func (m *MockTransaction) ValidateBasic() error {
return nil
}
// WebAuthnGaslessTestSuite tests the WebAuthn gasless decorator
type WebAuthnGaslessTestSuite struct {
suite.Suite
didKeeper *MockWebAuthnKeeper
}
func TestWebAuthnGaslessTestSuite(t *testing.T) {
suite.Run(t, new(WebAuthnGaslessTestSuite))
}
func (suite *WebAuthnGaslessTestSuite) SetupTest() {
// Setup minimal test context and keepers
suite.didKeeper = NewMockWebAuthnKeeper()
// We'll focus on testing the logic without complex keeper setup
}
func (suite *WebAuthnGaslessTestSuite) TestGenerateAddressFromCredential() {
// Test that the same credential always generates the same address
credentialID := "test-credential-id-123"
addr1 := ante.GenerateAddressFromCredential(credentialID)
addr2 := ante.GenerateAddressFromCredential(credentialID)
suite.Require().Equal(addr1, addr2, "Same credential should generate same address")
suite.Require().NotNil(addr1, "Generated address should not be nil")
suite.Require().Equal(20, len(addr1), "Address should be 20 bytes")
}
func (suite *WebAuthnGaslessTestSuite) TestGenerateDIDFromCredential() {
// Test DID generation
credentialID := "test-credential-id-123"
username := "testuser"
did1 := ante.GenerateDIDFromCredential(credentialID, username)
did2 := ante.GenerateDIDFromCredential(credentialID, username)
suite.Require().Equal(did1, did2, "Same inputs should generate same DID")
suite.Require().Contains(did1, "did:sonr:", "DID should have correct prefix")
// Different username should generate different DID
did3 := ante.GenerateDIDFromCredential(credentialID, "differentuser")
suite.Require().NotEqual(did1, did3, "Different username should generate different DID")
}
func (suite *WebAuthnGaslessTestSuite) TestWebAuthnGaslessDecorator_StandardMode() {
// Test standard mode behavior
decorator := ante.NewWebAuthnGaslessDecorator(
nil, // accountKeeper would be mocked in full test
suite.didKeeper,
false, // standard mode
)
suite.Require().NotNil(decorator, "Decorator should be created")
}
func (suite *WebAuthnGaslessTestSuite) TestWebAuthnGaslessDecorator_EnhancedMode() {
// Test enhanced mode behavior
decorator := ante.NewWebAuthnGaslessDecorator(
nil, // accountKeeper would be mocked in full test
suite.didKeeper,
true, // enhanced mode
)
suite.Require().NotNil(decorator, "Decorator should be created in enhanced mode")
}
func (suite *WebAuthnGaslessTestSuite) TestConditionalDecorators() {
// Test that conditional decorators are created properly
// We'll use a simple mock decorator for testing
mockDecorator := &MockAnteDecorator{}
feeDecorator := ante.NewConditionalFeeDecorator(mockDecorator)
suite.Require().NotNil(feeDecorator, "Conditional fee decorator should be created")
sigDecorator := ante.NewConditionalSignatureDecorator(mockDecorator)
suite.Require().NotNil(sigDecorator, "Conditional signature decorator should be created")
pubKeyDecorator := ante.NewConditionalPubKeyDecorator(mockDecorator)
suite.Require().NotNil(pubKeyDecorator, "Conditional pubkey decorator should be created")
}
func (suite *WebAuthnGaslessTestSuite) TestWebAuthnCredentialValidation() {
// Test WebAuthn credential structure validation
// This tests the core logic without full ante handler setup
testCases := []struct {
name string
credentialID string
expectError bool
}{
{
name: "valid credential ID",
credentialID: "valid-credential-123",
expectError: false,
},
{
name: "empty credential ID should be caught by message validation",
credentialID: "",
expectError: true, // This would be caught by ValidateStructure
},
{
name: "duplicate credential",
credentialID: "duplicate-cred",
expectError: true,
},
}
// Add a duplicate credential
suite.didKeeper.AddCredential("duplicate-cred")
for _, tc := range testCases {
suite.Run(tc.name, func() {
hasExisting := suite.didKeeper.HasExistingCredential(sdk.Context{}, tc.credentialID)
switch tc.credentialID {
case "duplicate-cred":
suite.Require().True(hasExisting, "Duplicate credential should exist")
case "valid-credential-123":
suite.Require().False(hasExisting, "New credential should not exist")
}
})
}
}
func (suite *WebAuthnGaslessTestSuite) TestEnhancedModeAddressGeneration() {
// Test enhanced mode functionality for address generation
testCredentialID := "test-enhanced-credential"
// Test that the same credential always generates the same address
addr1 := ante.GenerateAddressFromCredential(testCredentialID)
addr2 := ante.GenerateAddressFromCredential(testCredentialID)
suite.Require().Equal(addr1, addr2, "Same credential should generate same address")
suite.Require().Equal(20, len(addr1), "Address should be 20 bytes")
// Test that different credentials generate different addresses
addr3 := ante.GenerateAddressFromCredential("different-credential")
suite.Require().
NotEqual(addr1, addr3, "Different credentials should generate different addresses")
}
// MockAnteDecorator is a simple mock implementation of sdk.AnteDecorator for testing
type MockAnteDecorator struct{}
func (m *MockAnteDecorator) AnteHandle(
ctx sdk.Context,
tx sdk.Tx,
simulate bool,
next sdk.AnteHandler,
) (sdk.Context, error) {
return next(ctx, tx, simulate)
}
// TestAddressGeneration tests the deterministic address generation
func TestAddressGeneration(t *testing.T) {
testCases := []struct {
name string
credentialID string
expectSame bool
}{
{
name: "same credential generates same address",
credentialID: "credential-1",
expectSame: true,
},
{
name: "different credential generates different address",
credentialID: "credential-2",
expectSame: false,
},
}
baseAddr := ante.GenerateAddressFromCredential("base-credential")
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
addr := ante.GenerateAddressFromCredential(tc.credentialID)
require.NotNil(t, addr)
require.Equal(t, 20, len(addr))
if tc.expectSame && tc.credentialID == "base-credential" {
require.Equal(t, baseAddr, addr)
} else if !tc.expectSame {
require.NotEqual(t, baseAddr, addr)
}
})
}
}
// TestDIDGeneration tests the deterministic DID generation
func TestDIDGeneration(t *testing.T) {
testCases := []struct {
name string
credentialID string
username string
expectedPrefix string
}{
{
name: "generates valid DID",
credentialID: "cred-1",
username: "user1",
expectedPrefix: "did:sonr:",
},
{
name: "different username generates different DID",
credentialID: "cred-1",
username: "user2",
expectedPrefix: "did:sonr:",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
did := ante.GenerateDIDFromCredential(tc.credentialID, tc.username)
require.NotEmpty(t, did)
require.Contains(t, did, tc.expectedPrefix)
// Verify deterministic generation
did2 := ante.GenerateDIDFromCredential(tc.credentialID, tc.username)
require.Equal(t, did, did2)
})
}
}
+593 -316
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More