Feature/update dockerfile (#6)

* chore: remove unused new.Dockerfile

* feat: add DID model definitions

* fix: Fix EncodePublicKey method in KeyInfo struct

* feat: Update `EncodePublicKey` to be the inverse of `DecodePublicKey`

* refactor: update AssetInfo protobuf definition

* fix: update default assets with correct asset types

* fix: Initialize IPFS client and check for mounted directories

* feat: Improve IPFS client initialization and mount checking

* feat: Add local filesystem check for IPFS and IPNS

* fix: Use Unixfs().Get() instead of Cat() for IPFS and IPNS content retrieval

* feat: Update GetCID and GetIPNS functions to read data from IPFS node

* fix: Ensure IPFS client is initialized before pinning CID

* feat: Add AddFile and AddFolder methods

* feat: add IPFS file system abstraction

* feat: Implement IPFS file, location, and filesystem abstractions

* refactor: remove unused functions and types

* refactor: remove unused FileSystem interface

* feat: add initial wasm entrypoint

* feat: add basic vault command operations

* docs: add vault module features

* test: remove test for MsgUpdateParams

* refactor: Replace PrimaryKey with Property struct in zkprop.go

* feat: Update the `CreateWitness` and `CreateAccumulator` and `VerifyWitness` and `UpdateAccumulator` to Use the new `Accumulator` and `Witness` types. Then Clean up the code in the file and refactor the marshalling methods

* <no value>

* feat: add KeyCurve and KeyType to KeyInfo in genesis

* feat: add WASM build step to devbox.json

* feat: Add zkgate.go file

* feat: Uncomment and modify zkgate code to work with Property struct

* feat: Merge zkgate.go and zkprop.go logic

* feat: implement API endpoints for profile management

* refactor: remove unused template file

* feat(orm): remove unused ORM models

* feat: add persistent SQLite database support in WASM

* fix: Update module names in protobuf files

* feat: Add method to initialize SQLite database

* fix: update go-sqlite3 dependency to version 1.14.23

* feat: introduce database layer

* feat: Implement database layer for Vault node

* feature/update-dockerfile

* feat: Add keyshares table

* fix: Reorder the SQL statements in the tables.go file

* feat: Update the `createCredentialsTable` method to match the proper Credential struct

* feat: Update createProfilesTable and add createPropertiesTable

* feat: Add constant SQL queries to queries.go and use prepared statements in db.go

* feat: Add createKeysharesTable to internal/db/db.go

* feat: Update `createPermissionsTable` to match Permissions struct

* feat: Add database enum types

* feat: Add DIDNamespace and PermissionScope enums

* feat: Add DBConfig and DBOption types

* feat: Update the db implementation to use the provided go library

* fix: update db implementation to use go-sqlite3 v0.18.2

* fix: Refactor database connection and statement handling

* feat: Simplify db.go implementation

* feat: Convert constant SQL queries to functions in queries.go and update db.go to use prepared statements

* feat: Add models.go file with database table structs

* fix: Remove unused statement map and prepare statements

diff --git a/internal/db/db.go b/internal/db/db.go
index 201d09b..d4d4d4e 100644
--- a/internal/db/db.go
+++ b/internal/db/db.go
@@ -32,11 +32,6 @@ func Open(config *DBConfig) (*DB, error) {
 		Conn: conn,
 	}

-	if err := createTables(db); err != nil {
-		conn.Close()
-		return nil, fmt.Errorf("failed to create tables: %w", err)
-	}
-
 	return db, nil
 }

@@ -61,114 +56,3 @@ func createTables(db *DB) error {
 	return nil
 }

-// AddAccount adds a new account to the database
-func (db *DB) AddAccount(name, address string) error {
-	return db.Exec(insertAccountQuery(name, address))
-}
-
-// AddAsset adds a new asset to the database
-func (db *DB) AddAsset(name, symbol string, decimals int, chainID int64) error {
-	return db.Exec(insertAssetQuery(name, symbol, decimals, chainID))
-}
-
-// AddChain adds a new chain to the database
-func (db *DB) AddChain(name, networkID string) error {
-	return db.Exec(insertChainQuery(name, networkID))
-}
-
-// AddCredential adds a new credential to the database
-func (db *DB) AddCredential(
-	handle, controller, attestationType, origin string,
-	credentialID, publicKey []byte,
-	transport string,
-	signCount uint32,
-	userPresent, userVerified, backupEligible, backupState, cloneWarning bool,
-) error {
-	return db.Exec(insertCredentialQuery(
-		handle,
-		controller,
-		attestationType,
-		origin,
-		credentialID,
-		publicKey,
-		transport,
-		signCount,
-		userPresent,
-		userVerified,
-		backupEligible,
-		backupState,
-		cloneWarning,
-	))
-}
-
-// AddProfile adds a new profile to the database
-func (db *DB) AddProfile(
-	id, subject, controller, originURI, publicMetadata, privateMetadata string,
-) error {
-	return db.statements["insertProfile"].Exec(
-		id, subject, controller, originURI, publicMetadata, privateMetadata,
-	)
-}
-
-// AddProperty adds a new property to the database
-func (db *DB) AddProperty(
-	profileID, key, accumulator, propertyKey string,
-) error {
-	return db.statements["insertProperty"].Exec(
-		profileID, key, accumulator, propertyKey,
-	)
-}
-
-// AddPermission adds a new permission to the database
-func (db *DB) AddPermission(
-	serviceID string,
-	grants []DIDNamespace,
-	scopes []PermissionScope,
-) error {
-	grantsJSON, err := json.Marshal(grants)
-	if err != nil {
-		return fmt.Errorf("failed to marshal grants: %w", err)
-	}
-
-	scopesJSON, err := json.Marshal(scopes)
-	if err != nil {
-		return fmt.Errorf("failed to marshal scopes: %w", err)
-	}
-
-	return db.statements["insertPermission"].Exec(
-		serviceID, string(grantsJSON), string(scopesJSON),
-	)
-}
-
-// GetPermission retrieves the permission for the given service ID
-func (db *DB) GetPermission(serviceID string) ([]DIDNamespace, []PermissionScope, error) {
-	row := db.statements["getPermission"].QueryRow(serviceID)
-
-	var grantsJSON, scopesJSON string
-	if err := row.Scan(&grantsJSON, &scopesJSON); err != nil {
-		return nil, nil, fmt.Errorf("failed to get permission: %w", err)
-	}
-
-	var grants []DIDNamespace
-	if err := json.Unmarshal([]byte(grantsJSON), &grants); err != nil {
-		return nil, nil, fmt.Errorf("failed to unmarshal grants: %w", err)
-	}
-
-	var scopes []PermissionScope
-	if err := json.Unmarshal([]byte(scopesJSON), &scopes); err != nil {
-		return nil, nil, fmt.Errorf("failed to unmarshal scopes: %w", err)
-	}
-
-	return grants, scopes, nil
-}
-
-// Close closes the database connection and finalizes all prepared statements
-func (db *DB) Close() error {
-	for _, stmt := range db.statements {
-		stmt.Finalize()
-	}
-	return db.Conn.Close()
-}
diff --git a/internal/db/queries.go b/internal/db/queries.go
index 807d701..e69de29 100644
--- a/internal/db/queries.go
+++ b/internal/db/queries.go
@@ -1,79 +0,0 @@
-package db
-
-import "fmt"
-
-// Account queries
-func insertAccountQuery(name, address string) string {
-	return fmt.Sprintf(`INSERT INTO accounts (name, address) VALUES (%s, %s)`, name, address)
-}
-
-// Asset queries
-func insertAssetQuery(name, symbol string, decimals int, chainID int64) string {
-	return fmt.Sprintf(
-		`INSERT INTO assets (name, symbol, decimals, chain_id) VALUES (%s, %s, %d, %d)`,
-		name,
-		symbol,
-		decimals,
-		chainID,
-	)
-}
-
-// Chain queries
-func insertChainQuery(name string, networkID string) string {
-	return fmt.Sprintf(`INSERT INTO chains (name, network_id) VALUES (%s, %d)`, name, networkID)
-}
-
-// Credential queries
-func insertCredentialQuery(
-	handle, controller, attestationType, origin string,
-	credentialID, publicKey []byte,
-	transport string,
-	signCount uint32,
-	userPresent, userVerified, backupEligible, backupState, cloneWarning bool,
-) string {
-	return fmt.Sprintf(`INSERT INTO credentials (
-		handle, controller, attestation_type, origin,
-		credential_id, public_key, transport, sign_count,
-		user_present, user_verified, backup_eligible,
-		backup_state, clone_warning
-	) VALUES (%s, %s, %s, %s, %s, %s, %s, %d, %t, %t, %t, %t, %t)`,
-		handle, controller, attestationType, origin,
-		credentialID, publicKey, transport, signCount,
-		userPresent, userVerified, backupEligible,
-		backupState, cloneWarning)
-}
-
-// Profile queries
-func insertProfileQuery(
-	id, subject, controller, originURI, publicMetadata, privateMetadata string,
-) string {
-	return fmt.Sprintf(`INSERT INTO profiles (
-		id, subject, controller, origin_uri,
-		public_metadata, private_metadata
-	) VALUES (%s, %s, %s, %s, %s, %s)`,
-		id, subject, controller, originURI,
-		publicMetadata, privateMetadata)
-}
-
-// Property queries
-func insertPropertyQuery(profileID, key, accumulator, propertyKey string) string {
-	return fmt.Sprintf(`INSERT INTO properties (
-		profile_id, key, accumulator, property_key
-	) VALUES (%s, %s, %s, %s)`,
-		profileID, key, accumulator, propertyKey)
-}
-
-// Permission queries
-func insertPermissionQuery(serviceID, grants, scopes string) string {
-	return fmt.Sprintf(
-		`INSERT INTO permissions (service_id, grants, scopes) VALUES (%s, %s, %s)`,
-		serviceID,
-		grants,
-		scopes,
-	)
-}
-
-// GetPermission query
-func getPermissionQuery(serviceID string) string {
-	return fmt.Sprintf(`SELECT grants, scopes FROM permissions WHERE service_id = %s`, serviceID)
-}

* fix: update Makefile to use sonrd instead of wasmd

* feat: Add targets for templ and vault in Makefile and use only make in devbox.json

* feat: add SQLite database support

* bump: version 0.6.0 → 0.7.0

* refactor: upgrade actions to latest versions
This commit is contained in:
Prad Nukala 2024-09-05 01:24:57 -04:00 committed by GitHub
parent fd82cf4f3d
commit 8010e6b069
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
123 changed files with 24666 additions and 14591 deletions

View File

@ -1,72 +0,0 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"
[build]
# Array of commands to run before each build
pre_cmd = ["task templ"]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -o ./tmp/vltd ./cmd/vltd"
# Array of commands to run after ^C
bin = "tmp/vltd"
# Watch these filename extensions.
include_ext = ["go", "proto", "templ"]
# Ignore these filename extensions or directories.
exclude_dir = ["api", "crypto", "pkl", "scripts", "tmp", ".github"]
# Watch these directories if you specified.
include_dir = ["pkg", "x", "internal", ".github"]
# Watch these files.
include_file = []
# Exclude files.
exclude_file = []
# Exclude specific regular expressions.
exclude_regex = ["_test\\.go"]
# Exclude unchanged files.
exclude_unchanged = true
# Follow symlink for directories
follow_symlink = true
# This log file places in your tmp_dir.
log = "air.log"
# Poll files for changes instead of using fsnotify.
poll = false
# Poll interval (defaults to the minimum interval of 500ms).
poll_interval = 500 # ms
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 0 # ms
# Stop running old binary when build errors occur.
stop_on_error = true
# Send Interrupt signal before killing process (windows does not support this feature)
send_interrupt = false
# Delay after sending Interrupt signal
kill_delay = 500 # nanosecond
# Rerun binary or not
rerun = false
# Delay after each execution
rerun_delay = 500
[log]
# Show log time
time = false
# Only show main log (silences watcher, build, runner)
main_only = false
[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"
[misc]
# Delete tmp directory on exit
clean_on_exit = true
[screen]
clear_on_rebuild = true
keep_scroll = true
# Enable live-reloading on the browser.
[proxy]
enabled = true
proxy_port = 8090
app_port = 8080

View File

@ -2,6 +2,6 @@
name = "cz_conventional_commits" name = "cz_conventional_commits"
tag_format = "$version" tag_format = "$version"
version_scheme = "semver" version_scheme = "semver"
version = "0.6.0" version = "0.7.0"
update_changelog_on_bump = true update_changelog_on_bump = true
major_version_zero = true major_version_zero = true

View File

@ -1,26 +0,0 @@
name: Automatic Tag Bump
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: "0"
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: true
PRERELEASE: true

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Run `git checkout` # Run `git checkout`
- uses: actions/checkout@v2 - uses: actions/checkout@v3
# Install the `buf` CLI # Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1 - uses: bufbuild/buf-setup-action@v1
# Push only the Input in `proto` to the BSR # Push only the Input in `proto` to the BSR

View File

@ -1,4 +1,4 @@
name: docker image release name: Publish Docker Image
# NOTE: For this action to work, you must enable write permissions in your github repository settings. # NOTE: For this action to work, you must enable write permissions in your github repository settings.
# Settings -> Actions -> General. "Workflow Permissions". Select "Read and write permissions". # Settings -> Actions -> General. "Workflow Permissions". Select "Read and write permissions".

48
.github/workflows/docker-vm-release.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Publish VM Image
on:
push:
branches: [master, develop, feature/*]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.22
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release-image:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# all lowercase ghcr registry
- run: |
DOCKER_REGISTRY=`echo "${{ env.REGISTRY }}/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV
REPO_NAME=`echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]'`
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
- name: Parse tag
id: tag
run: |
# v0.0.1
VERSION=$(echo ${{ github.ref_name }} | sed "s/v//")
# 0.0.1
echo "VERSION=$VERSION" >> $GITHUB_ENV
# build and publish package to ghcr (public) with codebase remaining private
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

View File

@ -5,10 +5,7 @@ name: "Release Binary"
on: on:
push: push:
tags: tags:
- '**' - "**"
# Test Locally with:
# goreleaser build --skip-validate --snapshot --clean
jobs: jobs:
goreleaser: goreleaser:
@ -20,9 +17,9 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-go@v2 - uses: actions/setup-go@v3
with: with:
go-version: '1.21' go-version: "1.21"
- name: Clean up dist directory - name: Clean up dist directory
run: rm -rf dist run: rm -rf dist

62
.github/workflows/tag-on-merge.yml vendored Normal file
View File

@ -0,0 +1,62 @@
name: Automatic Tag Bump
on:
pull_request:
types:
- closed
branches:
- develop
- master
permissions:
contents: write
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: "0"
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: true
release-image:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# all lowercase ghcr registry
- run: |
DOCKER_REGISTRY=`echo "${{ env.REGISTRY }}/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV
REPO_NAME=`echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]'`
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
- name: Parse tag
id: tag
run: |
# v0.0.1
VERSION=$(echo ${{ github.ref_name }} | sed "s/v//")
# 0.0.1
echo "VERSION=$VERSION" >> $GITHUB_ENV
# build and publish package to ghcr (public) with codebase remaining private
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
# Binaries # Binaries
.data
*.exe *.exe
*.exe~ *.exe~
*.dll *.dll

114
CHANGELOG.md Normal file
View File

@ -0,0 +1,114 @@
## 0.7.0 (2024-09-05)
### Feat
- add SQLite database support
- Add targets for templ and vault in Makefile and use only make in devbox.json
- Add models.go file with database table structs
- Convert constant SQL queries to functions in queries.go and update db.go to use prepared statements
- Simplify db.go implementation
- Update the db implementation to use the provided go library
- Add DBConfig and DBOption types
- Add DIDNamespace and PermissionScope enums
- Add database enum types
- Update `createPermissionsTable` to match Permissions struct
- Add createKeysharesTable to internal/db/db.go
- Add constant SQL queries to queries.go and use prepared statements in db.go
- Update createProfilesTable and add createPropertiesTable
- Update the `createCredentialsTable` method to match the proper Credential struct
- Add keyshares table
- Implement database layer for Vault node
- introduce database layer
- Add method to initialize SQLite database
- add persistent SQLite database support in WASM
- **orm**: remove unused ORM models
- implement API endpoints for profile management
- Merge zkgate.go and zkprop.go logic
- Uncomment and modify zkgate code to work with Property struct
- Add zkgate.go file
- add WASM build step to devbox.json
- add KeyCurve and KeyType to KeyInfo in genesis
- Update the `CreateWitness` and `CreateAccumulator` and `VerifyWitness` and `UpdateAccumulator` to Use the new `Accumulator` and `Witness` types. Then Clean up the code in the file and refactor the marshalling methods
- add basic vault command operations
- add initial wasm entrypoint
- Implement IPFS file, location, and filesystem abstractions
- add IPFS file system abstraction
- Add AddFile and AddFolder methods
- Update GetCID and GetIPNS functions to read data from IPFS node
- Add local filesystem check for IPFS and IPNS
- Improve IPFS client initialization and mount checking
- Update `EncodePublicKey` to be the inverse of `DecodePublicKey`
- add DID model definitions
- add DID method for each coin
- Expand KeyType enum and update KeyInfo message in genesis.proto
- Add whitelisted key types to genesis params
- Add DID grants protobuf definition
- Add fields to KeyInfo struct to distinguish CBOR and standard blockchain key types
- Add new message types for AssetInfo, ChainInfo, Endpoint, ExplorerInfo, FeeInfo, and KeyInfo
- run sonr-node container in testnet network and make network external
- Add docker-compose.yaml file to start a Sonr testnet node
### Fix
- update Makefile to use sonrd instead of wasmd
- Remove unused statement map and prepare statements
- Refactor database connection and statement handling
- update db implementation to use go-sqlite3 v0.18.2
- Reorder the SQL statements in the tables.go file
- update go-sqlite3 dependency to version 1.14.23
- Update module names in protobuf files
- Ensure IPFS client is initialized before pinning CID
- Use Unixfs().Get() instead of Cat() for IPFS and IPNS content retrieval
- Initialize IPFS client and check for mounted directories
- update default assets with correct asset types
- Fix EncodePublicKey method in KeyInfo struct
- remove unused imports and simplify KeyInfo message
- bind node ports to localhost
- Update docker-compose network name to dokploy-network
- Update network name to dokploy
- remove unused port mapping
- Update docker-compose.yaml to use correct volume path
- update docker-compose volume name
- Update docker-compose.yaml to use shell directly for sonrd command
- replace "sh" with "/bin/sh" in docker-compose.yaml command
### Refactor
- remove unused template file
- Replace PrimaryKey with Property struct in zkprop.go
- remove unused FileSystem interface
- remove unused functions and types
- update AssetInfo protobuf definition
- add field to
- Update KeyKind Enum to have proper naming conventions
- Update `DIDNamespace` to have proper naming convention
- expose ports directly in docker-compose
- remove unused port mappings
- streamline script execution
- use CMD instead of ENTRYPOINT in Dockerfile
## v0.0.1 (2024-08-28)
### Feat
- configure Sonr testnet environment
- Update Dockerfile to start and run a testnet
- add Equal methods for AssetInfo and ChainInfo types
- Add ProveWitness and SyncVault RPCs
- Add MsgRegisterService to handle service registration
- Add MsgRegisterService to handle service registration
- add enums.pulsar.go file for PermissionScope enum
### Fix
- Update runner image dependencies for debian-11
- **deps**: update golang image to 1.21
- **chains**: update nomic chain build target
- Remove unused `Meta` message from `genesis.proto`
- Add ProveWitness and SyncVault RPCs
### Refactor
- **deps**: Upgrade Debian base image to 11
- Simplify the types and properties to keep a consistent structure for the blockchain
- remove PERMISSION_SCOPE_IDENTIFIERS_ENS enum value

View File

@ -1,3 +1,20 @@
FROM jetpackio/devbox:latest as sonrvm
# 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
RUN devbox run -- echo "Installed Packages."
ENTRYPOINT ["devbox", "run"]
# --------------------------------------------------------
FROM golang:1.22-alpine AS go-builder FROM golang:1.22-alpine AS go-builder
SHELL ["/bin/sh", "-ecuxo", "pipefail"] SHELL ["/bin/sh", "-ecuxo", "pipefail"]
@ -33,7 +50,6 @@ FROM debian:11-slim
COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd
# Install dependencies for Debian 11 # Install dependencies for Debian 11
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
curl \ curl \

View File

@ -10,7 +10,7 @@ SIMAPP = ./app
# for dockerized protobuf tools # for dockerized protobuf tools
DOCKER := $(shell which docker) DOCKER := $(shell which docker)
HTTPS_GIT := github.com/onsonr/hway.git HTTPS_GIT := github.com/onsonr/sonr.git
export GO111MODULE = on export GO111MODULE = on
@ -213,7 +213,7 @@ proto-check-breaking:
## --- Testnet Utilities --- ## --- Testnet Utilities ---
get-localic: get-localic:
@echo "Installing local-interchain" @echo "Installing local-interchain"
git clone --branch v8.2.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader git clone --branch v8.7.0 https://github.com/strangelove-ventures/interchaintest.git interchaintest-downloader
cd interchaintest-downloader/local-interchain && make install cd interchaintest-downloader/local-interchain && make install
@echo ✅ local-interchain installed $(shell which local-ic) @echo ✅ local-interchain installed $(shell which local-ic)
@ -230,7 +230,7 @@ local-image:
ifeq (,$(shell which heighliner)) ifeq (,$(shell which heighliner))
echo 'heighliner' binary not found. Consider running `make get-heighliner` echo 'heighliner' binary not found. Consider running `make get-heighliner`
else else
heighliner build -c sonr --local -f chains.yaml heighliner build -c sonrd --local -f chains.yaml
endif endif
.PHONY: get-heighliner local-image is-localic-installed .PHONY: get-heighliner local-image is-localic-installed
@ -292,3 +292,43 @@ sh-testnet: mod-tidy
CHAIN_ID="sonr-testnet-1" BLOCK_TIME="1000ms" CLEAN=true sh scripts/test_node.sh 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 .PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet
###############################################################################
### templ & vault ###
###############################################################################
.PHONY: templ vault
templ:
@echo "Generating templ files"
templ generate
vault:
@echo "Building vault.wasm"
GOOS=js GOARCH=wasm go build -o ./internal/files/vault.wasm ./cmd/vault/main.go
###############################################################################
### help ###
###############################################################################
.PHONY: explorer
explorer:
docker compose up
help:
@echo "Usage: make <target>"
@echo ""
@echo "Available targets:"
@echo " install : Install the binary"
@echo " local-image : Install the docker image"
@echo " proto-gen : Generate code from proto files"
@echo " testnet : Local devnet with IBC"
@echo " sh-testnet : Shell local devnet"
@echo " ictest-basic : Basic end-to-end test"
@echo " ictest-ibc : IBC end-to-end test"
@echo " templ : Generate templ files"
@echo " vault : Build vault.wasm"
.PHONY: help

View File

@ -3,13 +3,13 @@
# `sonr` - Sonr Chain # `sonr` - Sonr Chain
[![Go Reference](https://pkg.go.dev/badge/github.com/didao-org/sonr.svg)](https://pkg.go.dev/github.com/didao-org/sonr) [![Go Reference](https://pkg.go.dev/badge/github.com/onsonr/sonr.svg)](https://pkg.go.dev/github.com/onsonr/sonr)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/didao-org/sonr) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/onsonr/sonr)
![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/didao-org/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)
![Discord](https://img.shields.io/discord/843061375160156170?logo=discord&label=Discord%20Chat) ![Discord](https://img.shields.io/discord/843061375160156170?logo=discord&label=Discord%20Chat)
[![Go Report Card](https://goreportcard.com/badge/github.com/didao-org/sonr)](https://goreportcard.com/report/github.com/didao-org/sonr) [![Go Report Card](https://goreportcard.com/badge/github.com/onsonr/sonr)](https://goreportcard.com/report/github.com/onsonr/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) [![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)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=sonrhq_sonr&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=sonrhq_sonr&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr)
[![Mutable.ai Auto Wiki](https://img.shields.io/badge/Auto_Wiki-Mutable.ai-blue)](https://wiki.mutable.ai/di-dao/sonr) [![Mutable.ai Auto Wiki](https://img.shields.io/badge/Auto_Wiki-Mutable.ai-blue)](https://wiki.mutable.ai/di-dao/sonr)
@ -21,6 +21,22 @@ Sonr is a combination of decentralized primitives. Fundamentally, it is a peer-t
<br /> <br />
## Components
### `sonrd`
The main blockchain node that runs the `sonr` chain. It is responsible for maintaining the state of the chain, including IPFS based vaults, and did documents.
### `vault`
The `vault` is a wasm module that is compiled and deployed to IPFS on behalf of the user. It is responsible for storing and retrieving encrypted data.
- SQLite Database backend
- Encryption via admonition
- Authentication via webauthn
- Authorization via Macroons
- HTTP API
## Acknowledgements ## Acknowledgements
Sonr would not have been possible without the direct and indirect support of the following organizations and individuals: Sonr would not have been possible without the direct and indirect support of the following organizations and individuals:
@ -35,7 +51,7 @@ Sonr would not have been possible without the direct and indirect support of the
## Community & Support ## Community & Support
- [Forum](https://github.com/onsonr/hway/discussions) - [Forum](https://github.com/onsonr/sonr/discussions)
- [Issues](https://github.com/onsonr/hway/issues) - [Issues](https://github.com/onsonr/sonr/issues)
- [Twitter](https://sonr.io/twitter) - [Twitter](https://sonr.io/twitter)
- [Dev Chat](https://sonr.io/discord) - [Dev Chat](https://sonr.io/discord)

View File

@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro
switch descriptor.FullName() { switch descriptor.FullName() {
default: default:
if descriptor.IsExtension() { if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", descriptor.FullName())) panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", descriptor.FullName()))
} }
} }
@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.did.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.did.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.did.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.did.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() { switch d.FullName() {
default: default:
panic(fmt.Errorf("%s is not a oneof field in onsonr.hway.did.module.v1.Module", d.FullName())) panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.did.module.v1.Module", d.FullName()))
} }
panic("unreachable") panic("unreachable")
} }
@ -415,26 +415,26 @@ var File_did_module_v1_module_proto protoreflect.FileDescriptor
var file_did_module_v1_module_proto_rawDesc = []byte{ var file_did_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x1a, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x0a, 0x1a, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x6e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x6f, 0x6e,
0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 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, 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, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64,
0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73,
0x77, 0x61, 0x79, 0x42, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6f, 0x6e, 0x72, 0x42, 0xe8, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f,
0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x48, 0x44, 0x4d, 0xaa, 0x02, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x44, 0x4d, 0xaa, 0x02,
0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x48, 0x77, 0x61, 0x79, 0x2e, 0x44, 0x69, 0x64, 0x19, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x44, 0x69, 0x64,
0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x4f, 0x6e, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x19, 0x4f, 0x6e, 0x73,
0x6f, 0x6e, 0x72, 0x5c, 0x48, 0x77, 0x61, 0x79, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x6f, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64,
0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x25, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x5c,
0x48, 0x77, 0x61, 0x79, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x44, 0x69, 0x64, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c,
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x48, 0x77, 0x61, 0x79, 0x3a, 0x3a, 0x44, 0x1d, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x44,
0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x69, 0x64, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
@ -453,7 +453,7 @@ func file_did_module_v1_module_proto_rawDescGZIP() []byte {
var file_did_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_did_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_did_module_v1_module_proto_goTypes = []interface{}{ var file_did_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: onsonr.hway.did.module.v1.Module (*Module)(nil), // 0: onsonr.sonr.did.module.v1.Module
} }
var file_did_module_v1_module_proto_depIdxs = []int32{ var file_did_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 output_type

View File

@ -1564,7 +1564,7 @@ var file_did_v1_accounts_proto_rawDesc = []byte{
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x7d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x7d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64,
0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x50, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2,
0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31,

View File

@ -0,0 +1,727 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package didv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: did/v1/constants.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)
)
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
type AssetType int32
const (
AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0
AssetType_ASSET_TYPE_NATIVE AssetType = 1
AssetType_ASSET_TYPE_WRAPPED AssetType = 2
AssetType_ASSET_TYPE_STAKING AssetType = 3
AssetType_ASSET_TYPE_POOL AssetType = 4
AssetType_ASSET_TYPE_IBC AssetType = 5
AssetType_ASSET_TYPE_CW20 AssetType = 6
)
// Enum value maps for AssetType.
var (
AssetType_name = map[int32]string{
0: "ASSET_TYPE_UNSPECIFIED",
1: "ASSET_TYPE_NATIVE",
2: "ASSET_TYPE_WRAPPED",
3: "ASSET_TYPE_STAKING",
4: "ASSET_TYPE_POOL",
5: "ASSET_TYPE_IBC",
6: "ASSET_TYPE_CW20",
}
AssetType_value = map[string]int32{
"ASSET_TYPE_UNSPECIFIED": 0,
"ASSET_TYPE_NATIVE": 1,
"ASSET_TYPE_WRAPPED": 2,
"ASSET_TYPE_STAKING": 3,
"ASSET_TYPE_POOL": 4,
"ASSET_TYPE_IBC": 5,
"ASSET_TYPE_CW20": 6,
}
)
func (x AssetType) Enum() *AssetType {
p := new(AssetType)
*p = x
return p
}
func (x AssetType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (AssetType) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[0].Descriptor()
}
func (AssetType) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[0]
}
func (x AssetType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use AssetType.Descriptor instead.
func (AssetType) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{0}
}
// DIDNamespace define the different namespaces of DID
type DIDNamespace int32
const (
DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0
DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1
DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2
DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3
DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4
DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5
DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6
DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7
DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8
)
// Enum value maps for DIDNamespace.
var (
DIDNamespace_name = map[int32]string{
0: "DID_NAMESPACE_UNSPECIFIED",
1: "DID_NAMESPACE_IPFS",
2: "DID_NAMESPACE_SONR",
3: "DID_NAMESPACE_BITCOIN",
4: "DID_NAMESPACE_ETHEREUM",
5: "DID_NAMESPACE_IBC",
6: "DID_NAMESPACE_WEBAUTHN",
7: "DID_NAMESPACE_DWN",
8: "DID_NAMESPACE_SERVICE",
}
DIDNamespace_value = map[string]int32{
"DID_NAMESPACE_UNSPECIFIED": 0,
"DID_NAMESPACE_IPFS": 1,
"DID_NAMESPACE_SONR": 2,
"DID_NAMESPACE_BITCOIN": 3,
"DID_NAMESPACE_ETHEREUM": 4,
"DID_NAMESPACE_IBC": 5,
"DID_NAMESPACE_WEBAUTHN": 6,
"DID_NAMESPACE_DWN": 7,
"DID_NAMESPACE_SERVICE": 8,
}
)
func (x DIDNamespace) Enum() *DIDNamespace {
p := new(DIDNamespace)
*p = x
return p
}
func (x DIDNamespace) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DIDNamespace) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[1].Descriptor()
}
func (DIDNamespace) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[1]
}
func (x DIDNamespace) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use DIDNamespace.Descriptor instead.
func (DIDNamespace) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{1}
}
// KeyAlgorithm defines the key algorithm
type KeyAlgorithm int32
const (
KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0
KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1
KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2
KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3
KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4
KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5
KeyAlgorithm_KEY_ALGORITHM_BLS12377 KeyAlgorithm = 6
KeyAlgorithm_KEY_ALGORITHM_KECCAK256 KeyAlgorithm = 7
)
// Enum value maps for KeyAlgorithm.
var (
KeyAlgorithm_name = map[int32]string{
0: "KEY_ALGORITHM_UNSPECIFIED",
1: "KEY_ALGORITHM_ES256",
2: "KEY_ALGORITHM_ES384",
3: "KEY_ALGORITHM_ES512",
4: "KEY_ALGORITHM_EDDSA",
5: "KEY_ALGORITHM_ES256K",
6: "KEY_ALGORITHM_BLS12377",
7: "KEY_ALGORITHM_KECCAK256",
}
KeyAlgorithm_value = map[string]int32{
"KEY_ALGORITHM_UNSPECIFIED": 0,
"KEY_ALGORITHM_ES256": 1,
"KEY_ALGORITHM_ES384": 2,
"KEY_ALGORITHM_ES512": 3,
"KEY_ALGORITHM_EDDSA": 4,
"KEY_ALGORITHM_ES256K": 5,
"KEY_ALGORITHM_BLS12377": 6,
"KEY_ALGORITHM_KECCAK256": 7,
}
)
func (x KeyAlgorithm) Enum() *KeyAlgorithm {
p := new(KeyAlgorithm)
*p = x
return p
}
func (x KeyAlgorithm) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyAlgorithm) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[2].Descriptor()
}
func (KeyAlgorithm) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[2]
}
func (x KeyAlgorithm) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyAlgorithm.Descriptor instead.
func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{2}
}
// KeyCurve defines the key curve
type KeyCurve int32
const (
KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0
KeyCurve_KEY_CURVE_P256 KeyCurve = 1
KeyCurve_KEY_CURVE_P384 KeyCurve = 2
KeyCurve_KEY_CURVE_P521 KeyCurve = 3
KeyCurve_KEY_CURVE_X25519 KeyCurve = 4
KeyCurve_KEY_CURVE_X448 KeyCurve = 5
KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6
KeyCurve_KEY_CURVE_ED448 KeyCurve = 7
KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8
)
// Enum value maps for KeyCurve.
var (
KeyCurve_name = map[int32]string{
0: "KEY_CURVE_UNSPECIFIED",
1: "KEY_CURVE_P256",
2: "KEY_CURVE_P384",
3: "KEY_CURVE_P521",
4: "KEY_CURVE_X25519",
5: "KEY_CURVE_X448",
6: "KEY_CURVE_ED25519",
7: "KEY_CURVE_ED448",
8: "KEY_CURVE_SECP256K1",
}
KeyCurve_value = map[string]int32{
"KEY_CURVE_UNSPECIFIED": 0,
"KEY_CURVE_P256": 1,
"KEY_CURVE_P384": 2,
"KEY_CURVE_P521": 3,
"KEY_CURVE_X25519": 4,
"KEY_CURVE_X448": 5,
"KEY_CURVE_ED25519": 6,
"KEY_CURVE_ED448": 7,
"KEY_CURVE_SECP256K1": 8,
}
)
func (x KeyCurve) Enum() *KeyCurve {
p := new(KeyCurve)
*p = x
return p
}
func (x KeyCurve) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyCurve) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[3].Descriptor()
}
func (KeyCurve) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[3]
}
func (x KeyCurve) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyCurve.Descriptor instead.
func (KeyCurve) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{3}
}
// KeyEncoding defines the key encoding
type KeyEncoding int32
const (
KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0
KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1
KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2
KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3
KeyEncoding_KEY_ENCODING_JWK KeyEncoding = 4
)
// Enum value maps for KeyEncoding.
var (
KeyEncoding_name = map[int32]string{
0: "KEY_ENCODING_UNSPECIFIED",
1: "KEY_ENCODING_RAW",
2: "KEY_ENCODING_HEX",
3: "KEY_ENCODING_MULTIBASE",
4: "KEY_ENCODING_JWK",
}
KeyEncoding_value = map[string]int32{
"KEY_ENCODING_UNSPECIFIED": 0,
"KEY_ENCODING_RAW": 1,
"KEY_ENCODING_HEX": 2,
"KEY_ENCODING_MULTIBASE": 3,
"KEY_ENCODING_JWK": 4,
}
)
func (x KeyEncoding) Enum() *KeyEncoding {
p := new(KeyEncoding)
*p = x
return p
}
func (x KeyEncoding) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyEncoding) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[4].Descriptor()
}
func (KeyEncoding) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[4]
}
func (x KeyEncoding) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyEncoding.Descriptor instead.
func (KeyEncoding) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{4}
}
// KeyRole defines the kind of key
type KeyRole int32
const (
KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0
// Blockchain key types
KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1 // Passkeys and FIDO
KeyRole_KEY_ROLE_ASSERTION KeyRole = 2 // Zk Identifiers
KeyRole_KEY_ROLE_DELEGATION KeyRole = 3 // ETH,BTC,IBC addresses
KeyRole_KEY_ROLE_INVOCATION KeyRole = 4 // DWN Controllers
)
// Enum value maps for KeyRole.
var (
KeyRole_name = map[int32]string{
0: "KEY_ROLE_UNSPECIFIED",
1: "KEY_ROLE_AUTHENTICATION",
2: "KEY_ROLE_ASSERTION",
3: "KEY_ROLE_DELEGATION",
4: "KEY_ROLE_INVOCATION",
}
KeyRole_value = map[string]int32{
"KEY_ROLE_UNSPECIFIED": 0,
"KEY_ROLE_AUTHENTICATION": 1,
"KEY_ROLE_ASSERTION": 2,
"KEY_ROLE_DELEGATION": 3,
"KEY_ROLE_INVOCATION": 4,
}
)
func (x KeyRole) Enum() *KeyRole {
p := new(KeyRole)
*p = x
return p
}
func (x KeyRole) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyRole) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[5].Descriptor()
}
func (KeyRole) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[5]
}
func (x KeyRole) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyRole.Descriptor instead.
func (KeyRole) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{5}
}
// KeyType defines the key type
type KeyType int32
const (
KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0
KeyType_KEY_TYPE_OCTET KeyType = 1
KeyType_KEY_TYPE_ELLIPTIC KeyType = 2
KeyType_KEY_TYPE_RSA KeyType = 3
KeyType_KEY_TYPE_SYMMETRIC KeyType = 4
KeyType_KEY_TYPE_HMAC KeyType = 5
)
// Enum value maps for KeyType.
var (
KeyType_name = map[int32]string{
0: "KEY_TYPE_UNSPECIFIED",
1: "KEY_TYPE_OCTET",
2: "KEY_TYPE_ELLIPTIC",
3: "KEY_TYPE_RSA",
4: "KEY_TYPE_SYMMETRIC",
5: "KEY_TYPE_HMAC",
}
KeyType_value = map[string]int32{
"KEY_TYPE_UNSPECIFIED": 0,
"KEY_TYPE_OCTET": 1,
"KEY_TYPE_ELLIPTIC": 2,
"KEY_TYPE_RSA": 3,
"KEY_TYPE_SYMMETRIC": 4,
"KEY_TYPE_HMAC": 5,
}
)
func (x KeyType) Enum() *KeyType {
p := new(KeyType)
*p = x
return p
}
func (x KeyType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyType) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[6].Descriptor()
}
func (KeyType) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[6]
}
func (x KeyType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyType.Descriptor instead.
func (KeyType) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{6}
}
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_RECORDS_READ PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_RECORDS_WRITE PermissionScope = 3
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5
PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6
PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7
PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8
PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11
PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12
PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13
)
// Enum value maps for PermissionScope.
var (
PermissionScope_name = map[int32]string{
0: "PERMISSION_SCOPE_UNSPECIFIED",
1: "PERMISSION_SCOPE_BASIC_INFO",
2: "PERMISSION_SCOPE_RECORDS_READ",
3: "PERMISSION_SCOPE_RECORDS_WRITE",
4: "PERMISSION_SCOPE_TRANSACTIONS_READ",
5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE",
6: "PERMISSION_SCOPE_WALLETS_READ",
7: "PERMISSION_SCOPE_WALLETS_CREATE",
8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE",
9: "PERMISSION_SCOPE_WALLETS_UPDATE",
10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY",
11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST",
12: "PERMISSION_SCOPE_ADMIN_USER",
13: "PERMISSION_SCOPE_ADMIN_VALIDATOR",
}
PermissionScope_value = map[string]int32{
"PERMISSION_SCOPE_UNSPECIFIED": 0,
"PERMISSION_SCOPE_BASIC_INFO": 1,
"PERMISSION_SCOPE_RECORDS_READ": 2,
"PERMISSION_SCOPE_RECORDS_WRITE": 3,
"PERMISSION_SCOPE_TRANSACTIONS_READ": 4,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5,
"PERMISSION_SCOPE_WALLETS_READ": 6,
"PERMISSION_SCOPE_WALLETS_CREATE": 7,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8,
"PERMISSION_SCOPE_WALLETS_UPDATE": 9,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11,
"PERMISSION_SCOPE_ADMIN_USER": 12,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": 13,
}
)
func (x PermissionScope) Enum() *PermissionScope {
p := new(PermissionScope)
*p = x
return p
}
func (x PermissionScope) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PermissionScope) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[7].Descriptor()
}
func (PermissionScope) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[7]
}
func (x PermissionScope) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PermissionScope.Descriptor instead.
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{7}
}
var File_did_v1_constants_proto protoreflect.FileDescriptor
var file_did_v1_constants_proto_rawDesc = []byte{
0x0a, 0x16, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e,
0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31,
0x2a, 0xac, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a,
0x0a, 0x16, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x53,
0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10,
0x01, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x57, 0x52, 0x41, 0x50, 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53,
0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x10,
0x03, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x50, 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53,
0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x30, 0x10, 0x06, 0x2a,
0xf9, 0x01, 0x0a, 0x0c, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x12, 0x1d, 0x0a, 0x19, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43,
0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45,
0x5f, 0x49, 0x50, 0x46, 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e,
0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x4e, 0x52, 0x10, 0x02, 0x12,
0x19, 0x0a, 0x15, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45,
0x5f, 0x42, 0x49, 0x54, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49,
0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x45, 0x54, 0x48, 0x45,
0x52, 0x45, 0x55, 0x4d, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41,
0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x1a, 0x0a,
0x16, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x57,
0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44,
0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x57, 0x4e, 0x10, 0x07,
0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43,
0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x2a, 0xe4, 0x01, 0x0a, 0x0c,
0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x19,
0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, 0x4e,
0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4b,
0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32,
0x35, 0x36, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f,
0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x17, 0x0a,
0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45,
0x53, 0x35, 0x31, 0x32, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c,
0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x44, 0x44, 0x53, 0x41, 0x10, 0x04, 0x12,
0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d,
0x5f, 0x45, 0x53, 0x32, 0x35, 0x36, 0x4b, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x4b, 0x45, 0x59,
0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x42, 0x4c, 0x53, 0x31, 0x32,
0x33, 0x37, 0x37, 0x10, 0x06, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47,
0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x32, 0x35, 0x36,
0x10, 0x07, 0x2a, 0xd0, 0x01, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x12,
0x19, 0x0a, 0x15, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45,
0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x12,
0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x33, 0x38, 0x34,
0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f,
0x50, 0x35, 0x32, 0x31, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55,
0x52, 0x56, 0x45, 0x5f, 0x58, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e,
0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x34, 0x34, 0x38, 0x10, 0x05,
0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44,
0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4b, 0x45, 0x59, 0x5f, 0x43,
0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44, 0x34, 0x34, 0x38, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13,
0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35,
0x36, 0x4b, 0x31, 0x10, 0x08, 0x2a, 0x89, 0x01, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63,
0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43,
0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44,
0x49, 0x4e, 0x47, 0x5f, 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59,
0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x58, 0x10, 0x02, 0x12,
0x1a, 0x0a, 0x16, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f,
0x4d, 0x55, 0x4c, 0x54, 0x49, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b,
0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4a, 0x57, 0x4b, 0x10,
0x04, 0x2a, 0x8a, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a,
0x14, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x52,
0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49,
0x4f, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45,
0x5f, 0x41, 0x53, 0x53, 0x45, 0x52, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13,
0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54,
0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c,
0x45, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0x8b,
0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45,
0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4c, 0x49, 0x50, 0x54, 0x49, 0x43, 0x10, 0x02, 0x12,
0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x10,
0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59,
0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x4b, 0x45, 0x59,
0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4d, 0x41, 0x43, 0x10, 0x05, 0x2a, 0x9f, 0x04, 0x0a,
0x0f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65,
0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53,
0x43, 0x4f, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e,
0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x46,
0x4f, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f,
0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x53, 0x5f,
0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53,
0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52,
0x44, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45,
0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54,
0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44,
0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e,
0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49,
0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12, 0x21, 0x0a, 0x1d, 0x50,
0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f,
0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x06, 0x12, 0x23,
0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f,
0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54,
0x45, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f,
0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f,
0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x08, 0x12, 0x23, 0x0a, 0x1f, 0x50,
0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f,
0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x09,
0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53,
0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e,
0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x0a, 0x12, 0x2b, 0x0a, 0x27, 0x50, 0x45,
0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54,
0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x42, 0x52, 0x4f, 0x41,
0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49,
0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49,
0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x0c, 0x12, 0x24, 0x0a, 0x20, 0x50, 0x45, 0x52, 0x4d,
0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x41, 0x44, 0x4d,
0x49, 0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x0d, 0x42, 0x7e,
0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x43, 0x6f,
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76,
0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06,
0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2,
0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_did_v1_constants_proto_rawDescOnce sync.Once
file_did_v1_constants_proto_rawDescData = file_did_v1_constants_proto_rawDesc
)
func file_did_v1_constants_proto_rawDescGZIP() []byte {
file_did_v1_constants_proto_rawDescOnce.Do(func() {
file_did_v1_constants_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_constants_proto_rawDescData)
})
return file_did_v1_constants_proto_rawDescData
}
var file_did_v1_constants_proto_enumTypes = make([]protoimpl.EnumInfo, 8)
var file_did_v1_constants_proto_goTypes = []interface{}{
(AssetType)(0), // 0: did.v1.AssetType
(DIDNamespace)(0), // 1: did.v1.DIDNamespace
(KeyAlgorithm)(0), // 2: did.v1.KeyAlgorithm
(KeyCurve)(0), // 3: did.v1.KeyCurve
(KeyEncoding)(0), // 4: did.v1.KeyEncoding
(KeyRole)(0), // 5: did.v1.KeyRole
(KeyType)(0), // 6: did.v1.KeyType
(PermissionScope)(0), // 7: did.v1.PermissionScope
}
var file_did_v1_constants_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_did_v1_constants_proto_init() }
func file_did_v1_constants_proto_init() {
if File_did_v1_constants_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_did_v1_constants_proto_rawDesc,
NumEnums: 8,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_did_v1_constants_proto_goTypes,
DependencyIndexes: file_did_v1_constants_proto_depIdxs,
EnumInfos: file_did_v1_constants_proto_enumTypes,
}.Build()
File_did_v1_constants_proto = out.File
file_did_v1_constants_proto_rawDesc = nil
file_did_v1_constants_proto_goTypes = nil
file_did_v1_constants_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

View File

@ -22,9 +22,9 @@ const (
Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Params_FullMethodName = "/did.v1.Query/Params"
Query_Accounts_FullMethodName = "/did.v1.Query/Accounts" Query_Accounts_FullMethodName = "/did.v1.Query/Accounts"
Query_Credentials_FullMethodName = "/did.v1.Query/Credentials" Query_Credentials_FullMethodName = "/did.v1.Query/Credentials"
Query_Identities_FullMethodName = "/did.v1.Query/Identities"
Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" Query_Resolve_FullMethodName = "/did.v1.Query/Resolve"
Query_Service_FullMethodName = "/did.v1.Query/Service" Query_Service_FullMethodName = "/did.v1.Query/Service"
Query_Token_FullMethodName = "/did.v1.Query/Token"
) )
// QueryClient is the client API for Query service. // QueryClient is the client API for Query service.
@ -32,17 +32,17 @@ const (
// 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.
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 *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Accounts returns associated wallet accounts with the DID. // Accounts returns associated wallet accounts with the DID.
Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error)
// Credentials returns associated credentials with the DID and Service Origin. // Credentials returns associated credentials with the DID and Service Origin.
Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error)
// Identities returns associated identity with the DID.
Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error)
// Resolve queries the DID document by its id. // Resolve queries the DID document by its id.
Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error)
// Service returns associated ServiceInfo for a given Origin // Service returns associated ServiceInfo for a given Origin
Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error)
// Token returns the current authentication token for the client.
Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error)
} }
type queryClient struct { type queryClient struct {
@ -53,7 +53,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc} return &queryClient{cc}
} }
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
out := new(QueryParamsResponse) out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
@ -62,7 +62,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil return out, nil
} }
func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { func (c *queryClient) Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) {
out := new(QueryAccountsResponse) out := new(QueryAccountsResponse)
err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
@ -71,7 +71,7 @@ func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, op
return out, nil return out, nil
} }
func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) { func (c *queryClient) Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) {
out := new(QueryCredentialsResponse) out := new(QueryCredentialsResponse)
err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
@ -80,16 +80,7 @@ func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsReque
return out, nil return out, nil
} }
func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) { func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) {
out := new(QueryIdentitiesResponse)
err := c.cc.Invoke(ctx, Query_Identities_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) {
out := new(QueryResolveResponse) out := new(QueryResolveResponse)
err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
@ -98,7 +89,7 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts
return out, nil return out, nil
} }
func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) { func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) {
out := new(QueryServiceResponse) out := new(QueryServiceResponse)
err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
@ -107,22 +98,31 @@ func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts
return out, nil return out, nil
} }
func (c *queryClient) Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error) {
out := new(QueryTokenResponse)
err := c.cc.Invoke(ctx, Query_Token_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// 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
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, *QueryRequest) (*QueryParamsResponse, error)
// Accounts returns associated wallet accounts with the DID. // Accounts returns associated wallet accounts with the DID.
Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) Accounts(context.Context, *QueryRequest) (*QueryAccountsResponse, error)
// Credentials returns associated credentials with the DID and Service Origin. // Credentials returns associated credentials with the DID and Service Origin.
Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error)
// Identities returns associated identity with the DID.
Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error)
// Resolve queries the DID document by its id. // Resolve queries the DID document by its id.
Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error)
// Service returns associated ServiceInfo for a given Origin // Service returns associated ServiceInfo for a given Origin
Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) Service(context.Context, *QueryRequest) (*QueryServiceResponse, error)
// Token returns the current authentication token for the client.
Token(context.Context, *QueryRequest) (*QueryTokenResponse, error)
mustEmbedUnimplementedQueryServer() mustEmbedUnimplementedQueryServer()
} }
@ -130,24 +130,24 @@ type QueryServer interface {
type UnimplementedQueryServer struct { type UnimplementedQueryServer struct {
} }
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
} }
func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) { func (UnimplementedQueryServer) Accounts(context.Context, *QueryRequest) (*QueryAccountsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented")
} }
func (UnimplementedQueryServer) Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) { func (UnimplementedQueryServer) Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented") return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented")
} }
func (UnimplementedQueryServer) Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) { func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Identities not implemented")
}
func (UnimplementedQueryServer) Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented")
} }
func (UnimplementedQueryServer) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) { func (UnimplementedQueryServer) Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Service not implemented") return nil, status.Errorf(codes.Unimplemented, "method Service not implemented")
} }
func (UnimplementedQueryServer) Token(context.Context, *QueryRequest) (*QueryTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Token not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// 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.
@ -162,7 +162,7 @@ func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
} }
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(QueryParamsRequest) in := new(QueryRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -174,13 +174,13 @@ 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.(*QueryParamsRequest)) return srv.(QueryServer).Params(ctx, req.(*QueryRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryAccountsRequest) in := new(QueryRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -192,13 +192,13 @@ func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(inte
FullMethod: Query_Accounts_FullMethodName, FullMethod: Query_Accounts_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest)) return srv.(QueryServer).Accounts(ctx, req.(*QueryRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryCredentialsRequest) in := new(QueryRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -210,31 +210,13 @@ func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(i
FullMethod: Query_Credentials_FullMethodName, FullMethod: Query_Credentials_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Credentials(ctx, req.(*QueryCredentialsRequest)) return srv.(QueryServer).Credentials(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Identities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryIdentitiesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Identities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Identities_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Identities(ctx, req.(*QueryIdentitiesRequest))
} }
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_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryResolveRequest) in := new(QueryRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -246,13 +228,13 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Query_Resolve_FullMethodName, FullMethod: Query_Resolve_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.(*QueryResolveRequest)) return srv.(QueryServer).Resolve(ctx, req.(*QueryRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_Service_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(QueryServiceRequest) in := new(QueryRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -264,7 +246,25 @@ func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Query_Service_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).Service(ctx, req.(*QueryServiceRequest)) return srv.(QueryServer).Service(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Token_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Token(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Token_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Token(ctx, req.(*QueryRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -288,10 +288,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Credentials", MethodName: "Credentials",
Handler: _Query_Credentials_Handler, Handler: _Query_Credentials_Handler,
}, },
{
MethodName: "Identities",
Handler: _Query_Identities_Handler,
},
{ {
MethodName: "Resolve", MethodName: "Resolve",
Handler: _Query_Resolve_Handler, Handler: _Query_Resolve_Handler,
@ -300,6 +296,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Service", MethodName: "Service",
Handler: _Query_Service_Handler, Handler: _Query_Service_Handler,
}, },
{
MethodName: "Token",
Handler: _Query_Token_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "did/v1/query.proto", Metadata: "did/v1/query.proto",

View File

@ -17,6 +17,15 @@ type AssertionTable interface {
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, id string) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Assertion, error) Get(ctx context.Context, id string) (*Assertion, error)
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Assertion, error)
HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error)
// GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Assertion, error)
HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error)
// GetByControllerCredentialLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Assertion, error)
List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error
@ -57,6 +66,60 @@ func (this AssertionIdIndexKey) WithId(id string) AssertionIdIndexKey {
return this return this
} }
type AssertionSubjectOriginIndexKey struct {
vs []interface{}
}
func (x AssertionSubjectOriginIndexKey) id() uint32 { return 1 }
func (x AssertionSubjectOriginIndexKey) values() []interface{} { return x.vs }
func (x AssertionSubjectOriginIndexKey) assertionIndexKey() {}
func (this AssertionSubjectOriginIndexKey) WithSubject(subject string) AssertionSubjectOriginIndexKey {
this.vs = []interface{}{subject}
return this
}
func (this AssertionSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AssertionSubjectOriginIndexKey {
this.vs = []interface{}{subject, origin}
return this
}
type AssertionControllerOriginIndexKey struct {
vs []interface{}
}
func (x AssertionControllerOriginIndexKey) id() uint32 { return 2 }
func (x AssertionControllerOriginIndexKey) values() []interface{} { return x.vs }
func (x AssertionControllerOriginIndexKey) assertionIndexKey() {}
func (this AssertionControllerOriginIndexKey) WithController(controller string) AssertionControllerOriginIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this AssertionControllerOriginIndexKey) WithControllerOrigin(controller string, origin string) AssertionControllerOriginIndexKey {
this.vs = []interface{}{controller, origin}
return this
}
type AssertionControllerCredentialLabelIndexKey struct {
vs []interface{}
}
func (x AssertionControllerCredentialLabelIndexKey) id() uint32 { return 3 }
func (x AssertionControllerCredentialLabelIndexKey) values() []interface{} { return x.vs }
func (x AssertionControllerCredentialLabelIndexKey) assertionIndexKey() {}
func (this AssertionControllerCredentialLabelIndexKey) WithController(controller string) AssertionControllerCredentialLabelIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this AssertionControllerCredentialLabelIndexKey) WithControllerCredentialLabel(controller string, credential_label string) AssertionControllerCredentialLabelIndexKey {
this.vs = []interface{}{controller, credential_label}
return this
}
type assertionTable struct { type assertionTable struct {
table ormtable.Table table ormtable.Table
} }
@ -93,6 +156,72 @@ func (this assertionTable) Get(ctx context.Context, id string) (*Assertion, erro
return &assertion, nil return &assertion, nil
} }
func (this assertionTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
subject,
origin,
)
}
func (this assertionTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Assertion, error) {
var assertion Assertion
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &assertion,
subject,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &assertion, nil
}
func (this assertionTable) HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
origin,
)
}
func (this assertionTable) GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Assertion, error) {
var assertion Assertion
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &assertion,
controller,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &assertion, nil
}
func (this assertionTable) HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error) {
return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx,
controller,
credential_label,
)
}
func (this assertionTable) GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Assertion, error) {
var assertion Assertion
found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &assertion,
controller,
credential_label,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &assertion, nil
}
func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) { func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return AssertionIterator{it}, err return AssertionIterator{it}, err
@ -134,6 +263,9 @@ type AttestationTable interface {
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error)
HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error)
// GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Attestation, error)
List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error)
ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error)
DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error
@ -192,6 +324,24 @@ func (this AttestationSubjectOriginIndexKey) WithSubjectOrigin(subject string, o
return this return this
} }
type AttestationControllerOriginIndexKey struct {
vs []interface{}
}
func (x AttestationControllerOriginIndexKey) id() uint32 { return 2 }
func (x AttestationControllerOriginIndexKey) values() []interface{} { return x.vs }
func (x AttestationControllerOriginIndexKey) attestationIndexKey() {}
func (this AttestationControllerOriginIndexKey) WithController(controller string) AttestationControllerOriginIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this AttestationControllerOriginIndexKey) WithControllerOrigin(controller string, origin string) AttestationControllerOriginIndexKey {
this.vs = []interface{}{controller, origin}
return this
}
type attestationTable struct { type attestationTable struct {
table ormtable.Table table ormtable.Table
} }
@ -250,6 +400,28 @@ func (this attestationTable) GetBySubjectOrigin(ctx context.Context, subject str
return &attestation, nil return &attestation, nil
} }
func (this attestationTable) HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
origin,
)
}
func (this attestationTable) GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Attestation, error) {
var attestation Attestation
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &attestation,
controller,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &attestation, nil
}
func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) { func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return AttestationIterator{it}, err return AttestationIterator{it}, err
@ -288,6 +460,12 @@ type ControllerTable interface {
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, id string) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Controller, error) Get(ctx context.Context, id string) (*Controller, error)
HasByAddress(ctx context.Context, address string) (found bool, err error)
// GetByAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByAddress(ctx context.Context, address string) (*Controller, error)
HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error)
// GetByVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error)
List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error)
ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error)
DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error
@ -328,6 +506,32 @@ func (this ControllerIdIndexKey) WithId(id string) ControllerIdIndexKey {
return this return this
} }
type ControllerAddressIndexKey struct {
vs []interface{}
}
func (x ControllerAddressIndexKey) id() uint32 { return 1 }
func (x ControllerAddressIndexKey) values() []interface{} { return x.vs }
func (x ControllerAddressIndexKey) controllerIndexKey() {}
func (this ControllerAddressIndexKey) WithAddress(address string) ControllerAddressIndexKey {
this.vs = []interface{}{address}
return this
}
type ControllerVaultCidIndexKey struct {
vs []interface{}
}
func (x ControllerVaultCidIndexKey) id() uint32 { return 2 }
func (x ControllerVaultCidIndexKey) values() []interface{} { return x.vs }
func (x ControllerVaultCidIndexKey) controllerIndexKey() {}
func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) ControllerVaultCidIndexKey {
this.vs = []interface{}{vault_cid}
return this
}
type controllerTable struct { type controllerTable struct {
table ormtable.Table table ormtable.Table
} }
@ -364,6 +568,46 @@ func (this controllerTable) Get(ctx context.Context, id string) (*Controller, er
return &controller, nil return &controller, nil
} }
func (this controllerTable) HasByAddress(ctx context.Context, address string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
address,
)
}
func (this controllerTable) GetByAddress(ctx context.Context, address string) (*Controller, error) {
var controller Controller
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &controller,
address,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &controller, nil
}
func (this controllerTable) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
vault_cid,
)
}
func (this controllerTable) GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) {
var controller Controller
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &controller,
vault_cid,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &controller, nil
}
func (this controllerTable) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) { func (this controllerTable) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return ControllerIterator{it}, err return ControllerIterator{it}, err
@ -402,6 +646,12 @@ type DelegationTable interface {
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, id string) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Delegation, error) Get(ctx context.Context, id string) (*Delegation, error)
HasByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (found bool, err error)
// GetByAccountAddressChainId returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (*Delegation, error)
HasByControllerAccountLabel(ctx context.Context, controller string, account_label string) (found bool, err error)
// GetByControllerAccountLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerAccountLabel(ctx context.Context, controller string, account_label string) (*Delegation, error)
List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error)
ListRange(ctx context.Context, from, to DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) ListRange(ctx context.Context, from, to DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error)
DeleteBy(ctx context.Context, prefixKey DelegationIndexKey) error DeleteBy(ctx context.Context, prefixKey DelegationIndexKey) error
@ -442,6 +692,60 @@ func (this DelegationIdIndexKey) WithId(id string) DelegationIdIndexKey {
return this return this
} }
type DelegationAccountAddressChainIdIndexKey struct {
vs []interface{}
}
func (x DelegationAccountAddressChainIdIndexKey) id() uint32 { return 1 }
func (x DelegationAccountAddressChainIdIndexKey) values() []interface{} { return x.vs }
func (x DelegationAccountAddressChainIdIndexKey) delegationIndexKey() {}
func (this DelegationAccountAddressChainIdIndexKey) WithAccountAddress(account_address string) DelegationAccountAddressChainIdIndexKey {
this.vs = []interface{}{account_address}
return this
}
func (this DelegationAccountAddressChainIdIndexKey) WithAccountAddressChainId(account_address string, chain_id string) DelegationAccountAddressChainIdIndexKey {
this.vs = []interface{}{account_address, chain_id}
return this
}
type DelegationControllerAccountLabelIndexKey struct {
vs []interface{}
}
func (x DelegationControllerAccountLabelIndexKey) id() uint32 { return 2 }
func (x DelegationControllerAccountLabelIndexKey) values() []interface{} { return x.vs }
func (x DelegationControllerAccountLabelIndexKey) delegationIndexKey() {}
func (this DelegationControllerAccountLabelIndexKey) WithController(controller string) DelegationControllerAccountLabelIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this DelegationControllerAccountLabelIndexKey) WithControllerAccountLabel(controller string, account_label string) DelegationControllerAccountLabelIndexKey {
this.vs = []interface{}{controller, account_label}
return this
}
type DelegationControllerChainIdIndexKey struct {
vs []interface{}
}
func (x DelegationControllerChainIdIndexKey) id() uint32 { return 3 }
func (x DelegationControllerChainIdIndexKey) values() []interface{} { return x.vs }
func (x DelegationControllerChainIdIndexKey) delegationIndexKey() {}
func (this DelegationControllerChainIdIndexKey) WithController(controller string) DelegationControllerChainIdIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this DelegationControllerChainIdIndexKey) WithControllerChainId(controller string, chain_id string) DelegationControllerChainIdIndexKey {
this.vs = []interface{}{controller, chain_id}
return this
}
type delegationTable struct { type delegationTable struct {
table ormtable.Table table ormtable.Table
} }
@ -478,6 +782,50 @@ func (this delegationTable) Get(ctx context.Context, id string) (*Delegation, er
return &delegation, nil return &delegation, nil
} }
func (this delegationTable) HasByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
account_address,
chain_id,
)
}
func (this delegationTable) GetByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (*Delegation, error) {
var delegation Delegation
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &delegation,
account_address,
chain_id,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &delegation, nil
}
func (this delegationTable) HasByControllerAccountLabel(ctx context.Context, controller string, account_label string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
account_label,
)
}
func (this delegationTable) GetByControllerAccountLabel(ctx context.Context, controller string, account_label string) (*Delegation, error) {
var delegation Delegation
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &delegation,
controller,
account_label,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &delegation, nil
}
func (this delegationTable) List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) { func (this delegationTable) List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return DelegationIterator{it}, err return DelegationIterator{it}, err
@ -508,118 +856,197 @@ func NewDelegationTable(db ormtable.Schema) (DelegationTable, error) {
return delegationTable{table}, nil return delegationTable{table}, nil
} }
type ServiceTable interface { type ServiceRecordTable interface {
Insert(ctx context.Context, service *Service) error Insert(ctx context.Context, serviceRecord *ServiceRecord) error
Update(ctx context.Context, service *Service) error Update(ctx context.Context, serviceRecord *ServiceRecord) error
Save(ctx context.Context, service *Service) error Save(ctx context.Context, serviceRecord *ServiceRecord) error
Delete(ctx context.Context, service *Service) error Delete(ctx context.Context, serviceRecord *ServiceRecord) error
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, id string) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Service, error) Get(ctx context.Context, id string) (*ServiceRecord, error)
List(ctx context.Context, prefixKey ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) HasByOriginUri(ctx context.Context, origin_uri string) (found bool, err error)
ListRange(ctx context.Context, from, to ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) // GetByOriginUri returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
DeleteBy(ctx context.Context, prefixKey ServiceIndexKey) error GetByOriginUri(ctx context.Context, origin_uri string) (*ServiceRecord, error)
DeleteRange(ctx context.Context, from, to ServiceIndexKey) error HasByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (found bool, err error)
// GetByControllerOriginUri returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (*ServiceRecord, error)
List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error)
ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error)
DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error
DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error
doNotImplement() doNotImplement()
} }
type ServiceIterator struct { type ServiceRecordIterator struct {
ormtable.Iterator ormtable.Iterator
} }
func (i ServiceIterator) Value() (*Service, error) { func (i ServiceRecordIterator) Value() (*ServiceRecord, error) {
var service Service var serviceRecord ServiceRecord
err := i.UnmarshalMessage(&service) err := i.UnmarshalMessage(&serviceRecord)
return &service, err return &serviceRecord, err
} }
type ServiceIndexKey interface { type ServiceRecordIndexKey interface {
id() uint32 id() uint32
values() []interface{} values() []interface{}
serviceIndexKey() serviceRecordIndexKey()
} }
// primary key starting index.. // primary key starting index..
type ServicePrimaryKey = ServiceIdIndexKey type ServiceRecordPrimaryKey = ServiceRecordIdIndexKey
type ServiceIdIndexKey struct { type ServiceRecordIdIndexKey struct {
vs []interface{} vs []interface{}
} }
func (x ServiceIdIndexKey) id() uint32 { return 0 } func (x ServiceRecordIdIndexKey) id() uint32 { return 0 }
func (x ServiceIdIndexKey) values() []interface{} { return x.vs } func (x ServiceRecordIdIndexKey) values() []interface{} { return x.vs }
func (x ServiceIdIndexKey) serviceIndexKey() {} func (x ServiceRecordIdIndexKey) serviceRecordIndexKey() {}
func (this ServiceIdIndexKey) WithId(id string) ServiceIdIndexKey { func (this ServiceRecordIdIndexKey) WithId(id string) ServiceRecordIdIndexKey {
this.vs = []interface{}{id} this.vs = []interface{}{id}
return this return this
} }
type serviceTable struct { type ServiceRecordOriginUriIndexKey struct {
vs []interface{}
}
func (x ServiceRecordOriginUriIndexKey) id() uint32 { return 1 }
func (x ServiceRecordOriginUriIndexKey) values() []interface{} { return x.vs }
func (x ServiceRecordOriginUriIndexKey) serviceRecordIndexKey() {}
func (this ServiceRecordOriginUriIndexKey) WithOriginUri(origin_uri string) ServiceRecordOriginUriIndexKey {
this.vs = []interface{}{origin_uri}
return this
}
type ServiceRecordControllerOriginUriIndexKey struct {
vs []interface{}
}
func (x ServiceRecordControllerOriginUriIndexKey) id() uint32 { return 2 }
func (x ServiceRecordControllerOriginUriIndexKey) values() []interface{} { return x.vs }
func (x ServiceRecordControllerOriginUriIndexKey) serviceRecordIndexKey() {}
func (this ServiceRecordControllerOriginUriIndexKey) WithController(controller string) ServiceRecordControllerOriginUriIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this ServiceRecordControllerOriginUriIndexKey) WithControllerOriginUri(controller string, origin_uri string) ServiceRecordControllerOriginUriIndexKey {
this.vs = []interface{}{controller, origin_uri}
return this
}
type serviceRecordTable struct {
table ormtable.Table table ormtable.Table
} }
func (this serviceTable) Insert(ctx context.Context, service *Service) error { func (this serviceRecordTable) Insert(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Insert(ctx, service) return this.table.Insert(ctx, serviceRecord)
} }
func (this serviceTable) Update(ctx context.Context, service *Service) error { func (this serviceRecordTable) Update(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Update(ctx, service) return this.table.Update(ctx, serviceRecord)
} }
func (this serviceTable) Save(ctx context.Context, service *Service) error { func (this serviceRecordTable) Save(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Save(ctx, service) return this.table.Save(ctx, serviceRecord)
} }
func (this serviceTable) Delete(ctx context.Context, service *Service) error { func (this serviceRecordTable) Delete(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Delete(ctx, service) return this.table.Delete(ctx, serviceRecord)
} }
func (this serviceTable) Has(ctx context.Context, id string) (found bool, err error) { func (this serviceRecordTable) Has(ctx context.Context, id string) (found bool, err error) {
return this.table.PrimaryKey().Has(ctx, id) return this.table.PrimaryKey().Has(ctx, id)
} }
func (this serviceTable) Get(ctx context.Context, id string) (*Service, error) { func (this serviceRecordTable) Get(ctx context.Context, id string) (*ServiceRecord, error) {
var service Service var serviceRecord ServiceRecord
found, err := this.table.PrimaryKey().Get(ctx, &service, id) found, err := this.table.PrimaryKey().Get(ctx, &serviceRecord, id)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !found { if !found {
return nil, ormerrors.NotFound return nil, ormerrors.NotFound
} }
return &service, nil return &serviceRecord, nil
} }
func (this serviceTable) List(ctx context.Context, prefixKey ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) { func (this serviceRecordTable) HasByOriginUri(ctx context.Context, origin_uri string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
origin_uri,
)
}
func (this serviceRecordTable) GetByOriginUri(ctx context.Context, origin_uri string) (*ServiceRecord, error) {
var serviceRecord ServiceRecord
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &serviceRecord,
origin_uri,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &serviceRecord, nil
}
func (this serviceRecordTable) HasByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
origin_uri,
)
}
func (this serviceRecordTable) GetByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (*ServiceRecord, error) {
var serviceRecord ServiceRecord
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &serviceRecord,
controller,
origin_uri,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &serviceRecord, nil
}
func (this serviceRecordTable) List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return ServiceIterator{it}, err return ServiceRecordIterator{it}, err
} }
func (this serviceTable) ListRange(ctx context.Context, from, to ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) { func (this serviceRecordTable) ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) {
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
return ServiceIterator{it}, err return ServiceRecordIterator{it}, err
} }
func (this serviceTable) DeleteBy(ctx context.Context, prefixKey ServiceIndexKey) error { func (this serviceRecordTable) DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error {
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
} }
func (this serviceTable) DeleteRange(ctx context.Context, from, to ServiceIndexKey) error { func (this serviceRecordTable) DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error {
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
} }
func (this serviceTable) doNotImplement() {} func (this serviceRecordTable) doNotImplement() {}
var _ ServiceTable = serviceTable{} var _ ServiceRecordTable = serviceRecordTable{}
func NewServiceTable(db ormtable.Schema) (ServiceTable, error) { func NewServiceRecordTable(db ormtable.Schema) (ServiceRecordTable, error) {
table := db.GetTable(&Service{}) table := db.GetTable(&ServiceRecord{})
if table == nil { if table == nil {
return nil, ormerrors.TableNotFound.Wrap(string((&Service{}).ProtoReflect().Descriptor().FullName())) return nil, ormerrors.TableNotFound.Wrap(string((&ServiceRecord{}).ProtoReflect().Descriptor().FullName()))
} }
return serviceTable{table}, nil return serviceRecordTable{table}, nil
} }
type StateStore interface { type StateStore interface {
@ -627,17 +1054,17 @@ type StateStore interface {
AttestationTable() AttestationTable AttestationTable() AttestationTable
ControllerTable() ControllerTable ControllerTable() ControllerTable
DelegationTable() DelegationTable DelegationTable() DelegationTable
ServiceTable() ServiceTable ServiceRecordTable() ServiceRecordTable
doNotImplement() doNotImplement()
} }
type stateStore struct { type stateStore struct {
assertion AssertionTable assertion AssertionTable
attestation AttestationTable attestation AttestationTable
controller ControllerTable controller ControllerTable
delegation DelegationTable delegation DelegationTable
service ServiceTable serviceRecord ServiceRecordTable
} }
func (x stateStore) AssertionTable() AssertionTable { func (x stateStore) AssertionTable() AssertionTable {
@ -656,8 +1083,8 @@ func (x stateStore) DelegationTable() DelegationTable {
return x.delegation return x.delegation
} }
func (x stateStore) ServiceTable() ServiceTable { func (x stateStore) ServiceRecordTable() ServiceRecordTable {
return x.service return x.serviceRecord
} }
func (stateStore) doNotImplement() {} func (stateStore) doNotImplement() {}
@ -685,7 +1112,7 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
return nil, err return nil, err
} }
serviceTable, err := NewServiceTable(db) serviceRecordTable, err := NewServiceRecordTable(db)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -695,6 +1122,6 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
attestationTable, attestationTable,
controllerTable, controllerTable,
delegationTable, delegationTable,
serviceTable, serviceRecordTable,
}, nil }, nil
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,8 @@ const _ = grpc.SupportPackageIsVersion7
const ( const (
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams" Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
Msg_Authenticate_FullMethodName = "/did.v1.Msg/Authenticate" Msg_Authorize_FullMethodName = "/did.v1.Msg/Authorize"
Msg_ProveWitness_FullMethodName = "/did.v1.Msg/ProveWitness" Msg_AllocateVault_FullMethodName = "/did.v1.Msg/AllocateVault"
Msg_SyncVault_FullMethodName = "/did.v1.Msg/SyncVault" Msg_SyncVault_FullMethodName = "/did.v1.Msg/SyncVault"
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController" Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService" Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService"
@ -35,10 +35,11 @@ type MsgClient interface {
// //
// 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)
// Authenticate asserts the given controller is the owner of the given address. // Authorize asserts the given controller is the owner of the given address.
Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) Authorize(ctx context.Context, in *MsgAuthorize, opts ...grpc.CallOption) (*MsgAuthorizeResponse, error)
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database.
ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error) // this operation is called by services initiating a controller registration.
AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error)
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet. // SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error) SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error)
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
@ -64,18 +65,18 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
return out, nil return out, nil
} }
func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) { func (c *msgClient) Authorize(ctx context.Context, in *MsgAuthorize, opts ...grpc.CallOption) (*MsgAuthorizeResponse, error) {
out := new(MsgAuthenticateResponse) out := new(MsgAuthorizeResponse)
err := c.cc.Invoke(ctx, Msg_Authenticate_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Msg_Authorize_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) ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error) { func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) {
out := new(MsgProveWitnessResponse) out := new(MsgAllocateVaultResponse)
err := c.cc.Invoke(ctx, Msg_ProveWitness_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -117,10 +118,11 @@ type MsgServer interface {
// //
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// Authenticate asserts the given controller is the owner of the given address. // Authorize asserts the given controller is the owner of the given address.
Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) Authorize(context.Context, *MsgAuthorize) (*MsgAuthorizeResponse, error)
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database.
ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error) // this operation is called by services initiating a controller registration.
AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error)
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet. // SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error) SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error)
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
@ -137,11 +139,11 @@ 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) Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) { func (UnimplementedMsgServer) Authorize(context.Context, *MsgAuthorize) (*MsgAuthorizeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented") return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
} }
func (UnimplementedMsgServer) ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error) { func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProveWitness not implemented") return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented")
} }
func (UnimplementedMsgServer) SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error) { func (UnimplementedMsgServer) SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SyncVault not implemented") return nil, status.Errorf(codes.Unimplemented, "method SyncVault not implemented")
@ -183,38 +185,38 @@ 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_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAuthenticate) in := new(MsgAuthorize)
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).Authenticate(ctx, in) return srv.(MsgServer).Authorize(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Msg_Authenticate_FullMethodName, FullMethod: Msg_Authorize_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).Authenticate(ctx, req.(*MsgAuthenticate)) return srv.(MsgServer).Authorize(ctx, req.(*MsgAuthorize))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgProveWitness) in := new(MsgAllocateVault)
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).ProveWitness(ctx, in) return srv.(MsgServer).AllocateVault(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Msg_ProveWitness_FullMethodName, FullMethod: Msg_AllocateVault_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ProveWitness(ctx, req.(*MsgProveWitness)) return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -285,12 +287,12 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
Handler: _Msg_UpdateParams_Handler, Handler: _Msg_UpdateParams_Handler,
}, },
{ {
MethodName: "Authenticate", MethodName: "Authorize",
Handler: _Msg_Authenticate_Handler, Handler: _Msg_Authorize_Handler,
}, },
{ {
MethodName: "ProveWitness", MethodName: "AllocateVault",
Handler: _Msg_ProveWitness_Handler, Handler: _Msg_AllocateVault_Handler,
}, },
{ {
MethodName: "SyncVault", MethodName: "SyncVault",

View File

@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.oracle.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.oracle.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.oracle.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.oracle.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.oracle.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.oracle.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.oracle.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.oracle.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro
switch descriptor.FullName() { switch descriptor.FullName() {
default: default:
if descriptor.IsExtension() { if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.oracle.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.oracle.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.oracle.module.v1.Module does not contain field %s", descriptor.FullName())) panic(fmt.Errorf("message onsonr.sonr.oracle.module.v1.Module does not contain field %s", descriptor.FullName()))
} }
} }
@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.oracle.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.oracle.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.oracle.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.oracle.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.oracle.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.oracle.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.oracle.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.oracle.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor
switch fd.FullName() { switch fd.FullName() {
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.hway.oracle.module.v1.Module")) panic(fmt.Errorf("proto3 declared messages do not support extensions: onsonr.sonr.oracle.module.v1.Module"))
} }
panic(fmt.Errorf("message onsonr.hway.oracle.module.v1.Module does not contain field %s", fd.FullName())) panic(fmt.Errorf("message onsonr.sonr.oracle.module.v1.Module does not contain field %s", fd.FullName()))
} }
} }
@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() { switch d.FullName() {
default: default:
panic(fmt.Errorf("%s is not a oneof field in onsonr.hway.oracle.module.v1.Module", d.FullName())) panic(fmt.Errorf("%s is not a oneof field in onsonr.sonr.oracle.module.v1.Module", d.FullName()))
} }
panic("unreachable") panic("unreachable")
} }
@ -415,28 +415,28 @@ var File_oracle_module_v1_module_proto protoreflect.FileDescriptor
var file_oracle_module_v1_module_proto_rawDesc = []byte{ var file_oracle_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x1d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x0a, 0x1d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f,
0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x1c, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x1c, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x6f, 0x72, 0x61,
0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x63, 0x6c, 0x65, 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, 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, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96, 0xda, 0x01,
0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e,
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x42, 0xfa, 0x01, 0x0a, 0x20, 0x63, 0x6f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xfa, 0x01, 0x0a, 0x20, 0x63, 0x6f,
0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x6f, 0x72, 0x6d, 0x2e, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x73, 0x6f, 0x6e, 0x72, 0x2e, 0x6f, 0x72,
0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x61, 0x63, 0x6c, 0x65, 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, 0x34, 0x67, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72,
0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x48, 0x4f, 0x4d, 0xaa, 0x02, 0x1c, 0x4f, 0x6e, 0x73, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x4f, 0x53, 0x4f, 0x4d, 0xaa, 0x02, 0x1c, 0x4f, 0x6e, 0x73,
0x6f, 0x6e, 0x72, 0x2e, 0x48, 0x77, 0x61, 0x79, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x6f, 0x6e, 0x72, 0x2e, 0x53, 0x6f, 0x6e, 0x72, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e,
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1c, 0x4f, 0x6e, 0x73, 0x6f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1c, 0x4f, 0x6e, 0x73, 0x6f,
0x6e, 0x72, 0x5c, 0x48, 0x77, 0x61, 0x79, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6e, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x28, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x28, 0x4f, 0x6e, 0x73, 0x6f, 0x6e,
0x72, 0x5c, 0x48, 0x77, 0x61, 0x79, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x72, 0x5c, 0x53, 0x6f, 0x6e, 0x72, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x4d, 0x6f,
0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x48, 0x77, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x4f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x3a, 0x3a, 0x53, 0x6f,
0x61, 0x79, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6e, 0x72, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
@ -454,7 +454,7 @@ func file_oracle_module_v1_module_proto_rawDescGZIP() []byte {
var file_oracle_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_oracle_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_oracle_module_v1_module_proto_goTypes = []interface{}{ var file_oracle_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: onsonr.hway.oracle.module.v1.Module (*Module)(nil), // 0: onsonr.sonr.oracle.module.v1.Module
} }
var file_oracle_module_v1_module_proto_depIdxs = []int32{ var file_oracle_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 output_type

View File

@ -420,7 +420,7 @@ var file_oracle_v1_genesis_proto_rawDesc = []byte{
0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65,
0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f,
0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f,
0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58,
0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09,
0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4f, 0x72, 0x61, 0x63,

View File

@ -30,7 +30,7 @@ var file_oracle_v1_query_proto_rawDesc = []byte{
0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x8f, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x8f, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d,
0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72,
0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f,
0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09,
0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63,

View File

@ -30,7 +30,7 @@ var file_oracle_v1_tx_proto_rawDesc = []byte{
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x8c, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x8c, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x72,
0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f,
0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76,
0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65,
0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2,

View File

@ -145,12 +145,12 @@ import (
tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper" tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper"
tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types" tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types"
did "github.com/onsonr/hway/x/did" did "github.com/onsonr/sonr/x/did"
didkeeper "github.com/onsonr/hway/x/did/keeper" didkeeper "github.com/onsonr/sonr/x/did/keeper"
didtypes "github.com/onsonr/hway/x/did/types" didtypes "github.com/onsonr/sonr/x/did/types"
oracle "github.com/onsonr/hway/x/oracle" oracle "github.com/onsonr/sonr/x/oracle"
oraclekeeper "github.com/onsonr/hway/x/oracle/keeper" oraclekeeper "github.com/onsonr/sonr/x/oracle/keeper"
oracletypes "github.com/onsonr/hway/x/oracle/types" oracletypes "github.com/onsonr/sonr/x/oracle/types"
) )
const appName = "sonr" const appName = "sonr"

View File

@ -10,8 +10,8 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
app "github.com/onsonr/hway/app" app "github.com/onsonr/sonr/app"
"github.com/onsonr/hway/app/decorators" "github.com/onsonr/sonr/app/decorators"
) )
type AnteTestSuite struct { type AnteTestSuite struct {

View File

@ -9,7 +9,7 @@ import (
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/onsonr/hway/app/params" "github.com/onsonr/sonr/app/params"
) )
// MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only // MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only

View File

@ -2,6 +2,7 @@ package app
import ( import (
"github.com/ipfs/kubo/client/rpc" "github.com/ipfs/kubo/client/rpc"
"github.com/onsonr/sonr/internal/files"
) )
var ( var (
@ -11,6 +12,10 @@ var (
// Initialize initializes the local configuration values // Initialize initializes the local configuration values
func init() { func init() {
err := files.Assemble(".data/vaults/0")
if err != nil {
panic(err)
}
} }
// SetLocalContextSessionID sets the session ID for the local context // SetLocalContextSessionID sets the session ID for the local context

View File

@ -5,8 +5,8 @@ import (
upgradetypes "cosmossdk.io/x/upgrade/types" upgradetypes "cosmossdk.io/x/upgrade/types"
"github.com/onsonr/hway/app/upgrades" "github.com/onsonr/sonr/app/upgrades"
"github.com/onsonr/hway/app/upgrades/noop" "github.com/onsonr/sonr/app/upgrades/noop"
) )
// Upgrades list of chain upgrades // Upgrades list of chain upgrades

View File

@ -8,7 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/module"
"github.com/onsonr/hway/app/upgrades" "github.com/onsonr/sonr/app/upgrades"
) )
// NewUpgrade constructor // NewUpgrade constructor

View File

@ -1,7 +1,10 @@
# This file is used to create docker images using the heighliner binary. # This file is used to create docker images using the heighliner binary.
# see: https://github.com/strangelove-ventures/heighliner # see: https://github.com/strangelove-ventures/heighliner
# Sonr Node - Identity
- name: sonr - name: sonr
github-organization: onsonr
github-repo: core
dockerfile: cosmos dockerfile: cosmos
build-target: make install build-target: make install
binaries: binaries:
@ -9,6 +12,8 @@
build-env: build-env:
- LEDGER_ENABLED=false - LEDGER_ENABLED=false
- BUILD_TAGS=muslc - BUILD_TAGS=muslc
# Ethereum Node - Web3
- name: evmos - name: evmos
github-organization: tharsis github-organization: tharsis
github-repo: evmos github-repo: evmos
@ -16,6 +21,8 @@
build-target: make install build-target: make install
binaries: binaries:
- /go/bin/evmosd - /go/bin/evmosd
# Bitcoin Node - Gold
- name: nomic - name: nomic
github-organization: nomic-io github-organization: nomic-io
github-repo: nomic github-repo: nomic
@ -26,7 +33,5 @@
cargo install --locked --path . -Zbuild-std cargo install --locked --path . -Zbuild-std
binaries: binaries:
- /build/nomic/target/${ARCH}-unknown-linux-gnu/release/nomic - /build/nomic/target/${ARCH}-unknown-linux-gnu/release/nomic
# TODO remove platforms here so that both linux/amd64 and linux/arm64 are built
# once these changes are merged: https://github.com/nomic-io/orga/pull/154
platforms: platforms:
- linux/amd64 - linux/amd64

View File

@ -1,3 +0,0 @@
module client
go 1.22.0

View File

@ -7,7 +7,7 @@ import (
cmtcfg "github.com/cometbft/cometbft/config" cmtcfg "github.com/cometbft/cometbft/config"
dbm "github.com/cosmos/cosmos-db" dbm "github.com/cosmos/cosmos-db"
"github.com/onsonr/hway/app" "github.com/onsonr/sonr/app"
"github.com/spf13/cast" "github.com/spf13/cast"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"

View File

@ -6,7 +6,7 @@ import (
"cosmossdk.io/log" "cosmossdk.io/log"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
_ "github.com/joho/godotenv/autoload" _ "github.com/joho/godotenv/autoload"
"github.com/onsonr/hway/app" "github.com/onsonr/sonr/app"
) )
func main() { func main() {

View File

@ -20,8 +20,8 @@ import (
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/onsonr/hway/app" "github.com/onsonr/sonr/app"
"github.com/onsonr/hway/app/params" "github.com/onsonr/sonr/app/params"
// NewRootCmd creates a new root command for chain app. It is called once in the // NewRootCmd creates a new root command for chain app. It is called once in the
// main function. // main function.
) )

View File

@ -39,7 +39,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/onsonr/hway/app" "github.com/onsonr/sonr/app"
) )
var ( var (

104
cmd/vault/main.go Normal file
View File

@ -0,0 +1,104 @@
//go:build js && wasm
// +build js,wasm
package main
import (
"database/sql"
"encoding/json"
"fmt"
"net/http"
_ "github.com/flimzy/go-sql.js"
wasmhttp "github.com/nlepage/go-wasm-http-server"
)
var db *sql.DB
func main() {
var err error
// Open a new in-memory SQLite database
db, err = sql.Open("sqljs", "")
if err != nil {
panic(err)
}
defer db.Close()
// Initialize the database
initDB()
// Define your handlers
http.HandleFunc("/", homeHandler)
http.HandleFunc("/api/items", itemsHandler)
// Use wasmhttp.Serve to start the server
wasmhttp.Serve(nil)
}
func initDB() {
_, err := db.Exec(`
CREATE TABLE IF NOT EXISTS items (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
)
`)
if err != nil {
panic(err)
}
}
func homeHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to the WASM SQLite Server!")
}
func itemsHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
getItems(w, r)
case "POST":
addItem(w, r)
default:
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
}
func getItems(w http.ResponseWriter, _ *http.Request) {
rows, err := db.Query("SELECT id, name FROM items")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
defer rows.Close()
var items []map[string]interface{}
for rows.Next() {
var id int
var name string
if err := rows.Scan(&id, &name); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
items = append(items, map[string]interface{}{"id": id, "name": name})
}
json.NewEncoder(w).Encode(items)
}
func addItem(w http.ResponseWriter, r *http.Request) {
var item struct {
Name string `json:"name"`
}
if err := json.NewDecoder(r.Body).Decode(&item); err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
result, err := db.Exec("INSERT INTO items (name) VALUES (?)", item.Name)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
id, _ := result.LastInsertId()
json.NewEncoder(w).Encode(map[string]interface{}{"id": id, "name": item.Name})
}

View File

@ -1,16 +1,30 @@
{ {
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
"packages": ["go@1.21", "air@latest"], "packages": [
"go@1.22",
"templ@latest",
"commitizen@latest",
"goreleaser@latest",
"go-task@latest"
],
"env": { "env": {
"GOPATH": "$HOME/go", "GOPATH": "$HOME/go",
"PATH": "$HOME/go/bin:$PATH" "PATH": "$HOME/go/bin:$PATH",
"CHAIN_ID": "sonr-testnet-1",
"DENOM": "usnr",
"KEYRING": "test",
"MONIKER": "florence",
"MIN_GAS_PRICES": "0.0001usnr"
}, },
"shell": { "shell": {
"scripts": { "scripts": {
"init": ["make install", "sonrd init"], "init": ["make install", "sonrd init"],
"proto": ["make proto-gen"], "gen": ["make proto-gen", "make vault", "make templ"],
"build": ["make build", "make local-image"], "build": ["make build", "make local-image"],
"testnet": ["make sh-testnet"] "testnet": ["make install", "make sh-testnet"],
"icnet": ["make install", "make testnet"],
"explorer": ["make explorer"],
"release": ["cz bump --yes", "goreleaser release --clean --dry-run"]
} }
} }
} }

View File

@ -6,7 +6,7 @@ services:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
- /home/prad/.core:/root/.sonr - /home/prad/.sonr:/root/.sonr
ports: ports:
- "26657:26657" - "26657:26657"
- "1317:1317" - "1317:1317"

50
go.mod
View File

@ -1,13 +1,19 @@
module github.com/onsonr/hway module github.com/onsonr/sonr
go 1.22 go 1.22.5
toolchain go1.23.0
// overrides // overrides
replace ( replace (
cosmossdk.io/core => cosmossdk.io/core v0.11.0 cosmossdk.io/core => cosmossdk.io/core v0.11.0
github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0 github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0
github.com/prometheus/common => github.com/prometheus/common v0.47.0 github.com/prometheus/common => github.com/prometheus/common v0.47.0
github.com/spf13/viper => github.com/spf13/viper v1.17.0 // v1.18+ breaks app overrides github.com/spf13/viper => github.com/spf13/viper v1.17.0 // v1.18+ breaks app overrides
github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7
) )
replace ( replace (
@ -42,6 +48,7 @@ require (
cosmossdk.io/x/nft v0.1.0 cosmossdk.io/x/nft v0.1.0
cosmossdk.io/x/tx v0.13.3 cosmossdk.io/x/tx v0.13.3
cosmossdk.io/x/upgrade v0.1.1 cosmossdk.io/x/upgrade v0.1.1
github.com/a-h/templ v0.2.771
github.com/btcsuite/btcd/btcec/v2 v2.3.3 github.com/btcsuite/btcd/btcec/v2 v2.3.3
github.com/cometbft/cometbft v0.38.8 github.com/cometbft/cometbft v0.38.8
github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-db v1.0.2
@ -51,13 +58,20 @@ require (
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2-0.20240228211029-91e486ec4dbb github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2-0.20240228211029-91e486ec4dbb
github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/cosmos/ibc-go/v8 v8.2.0 github.com/cosmos/ibc-go/v8 v8.2.0
github.com/flimzy/go-sql.js v0.0.0-20170413005827-c7e22c0fd6e9
github.com/go-webauthn/webauthn v0.10.2 github.com/go-webauthn/webauthn v0.10.2
github.com/golang/protobuf v1.5.4 github.com/golang/protobuf v1.5.4
github.com/gorilla/mux v1.8.1 github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/ipfs/boxo v0.21.0
github.com/ipfs/kubo v0.29.0 github.com/ipfs/kubo v0.29.0
github.com/joho/godotenv v1.5.1 github.com/joho/godotenv v1.5.1
github.com/onsonr/crypto v1.5.0 github.com/mattn/go-sqlite3 v1.14.23
github.com/mr-tron/base58 v1.2.0
github.com/ncruces/go-sqlite3 v0.18.2
github.com/ncruces/go-sqlite3/gormlite v0.18.0
github.com/nlepage/go-wasm-http-server v1.1.0
github.com/onsonr/crypto v1.23.0
github.com/spf13/cast v1.6.0 github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0 github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.5
@ -66,11 +80,13 @@ require (
github.com/strangelove-ventures/poa v0.50.0 github.com/strangelove-ventures/poa v0.50.0
github.com/strangelove-ventures/tokenfactory v0.50.0 github.com/strangelove-ventures/tokenfactory v0.50.0
github.com/stretchr/testify v1.9.0 github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.25.0 golang.org/x/crypto v0.26.0
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4
google.golang.org/grpc v1.64.0 google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.2 google.golang.org/protobuf v1.34.2
gopkg.in/macaroon-bakery.v2 v2.3.0 gopkg.in/macaroon-bakery.v2 v2.3.0
gorm.io/gorm v1.25.11
lukechampine.com/adiantum v1.1.1
) )
require ( require (
@ -79,10 +95,12 @@ require (
cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.38.0 // indirect cloud.google.com/go/storage v1.38.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect github.com/99designs/keyring v1.2.1 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect
github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
@ -124,9 +142,9 @@ require (
github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/emicklei/dot v1.6.1 // indirect github.com/emicklei/dot v1.6.1 // indirect
github.com/ethereum/go-ethereum v1.14.6 // indirect
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect
github.com/fatih/color v1.16.0 // indirect github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect
@ -156,6 +174,7 @@ require (
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/websocket v1.5.3 // indirect github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
@ -181,7 +200,6 @@ require (
github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/boxo v0.21.0 // indirect
github.com/ipfs/go-bitfield v1.1.0 // indirect github.com/ipfs/go-bitfield v1.1.0 // indirect
github.com/ipfs/go-block-format v0.2.0 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-cid v0.4.1 // indirect
@ -201,6 +219,8 @@ require (
github.com/ipld/go-codec-dagpb v1.6.0 // indirect github.com/ipld/go-codec-dagpb v1.6.0 // indirect
github.com/ipld/go-ipld-prime v0.21.0 // indirect github.com/ipld/go-ipld-prime v0.21.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/compress v1.17.9 // indirect
@ -230,7 +250,6 @@ require (
github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect github.com/mtibben/percent v0.2.1 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect
@ -241,6 +260,8 @@ require (
github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect github.com/multiformats/go-varint v0.0.7 // indirect
github.com/ncruces/julianday v1.0.0 // indirect
github.com/nlepage/go-js-promise v1.0.0 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/oklog/run v1.1.0 // indirect github.com/oklog/run v1.1.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/ginkgo v1.16.5 // indirect
@ -271,6 +292,7 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tetratelabs/wazero v1.8.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect github.com/tidwall/btree v1.7.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect github.com/ulikunitz/xz v0.5.11 // indirect
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect
@ -291,15 +313,15 @@ require (
go.uber.org/zap v1.27.0 // indirect go.uber.org/zap v1.27.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/mod v0.18.0 // indirect golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.26.0 // indirect golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.22.0 // indirect golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.22.0 // indirect golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.16.0 // indirect golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.5.0 // indirect golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect golang.org/x/tools v0.24.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/gonum v0.15.0 // indirect gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/api v0.169.0 // indirect google.golang.org/api v0.169.0 // indirect

80
go.sum
View File

@ -803,6 +803,9 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 h1:Ahny8Ud1LjVMMAlt8utUFKhhxJtwBAualvsbc/Sk7cE=
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA=
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs=
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4=
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M=
@ -830,6 +833,8 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/a-h/templ v0.2.771 h1:4KH5ykNigYGGpCe0fRJ7/hzwz72k3qFqIiiLLJskbSo=
github.com/a-h/templ v0.2.771/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w=
github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I=
github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
@ -1064,6 +1069,8 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 h1:I6KUy4CI6hHjqnyJLNCEi7YHVMkwwtfSr2k9splgdSM=
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564/go.mod h1:yekO+3ZShy19S+bsmnERmznGy9Rfg6dWWWpiGJjNAz8=
github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY=
github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo= github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
@ -1090,8 +1097,6 @@ github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6Ni
github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/ethereum/go-ethereum v1.14.6 h1:ZTxnErSopkDyxdvB8zW/KcK+/AVrdil/TzoWXVKaaC8=
github.com/ethereum/go-ethereum v1.14.6/go.mod h1:hglUZo/5pVIYXNyYjWzsAUDpT/zI+WbWo/Nih7ot+G0=
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A=
github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
@ -1102,6 +1107,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flimzy/go-sql.js v0.0.0-20170413005827-c7e22c0fd6e9 h1:rAjGCKhKN+iStQ250cH9J9vtW9ch8/g0SXaq7Hrz4aI=
github.com/flimzy/go-sql.js v0.0.0-20170413005827-c7e22c0fd6e9/go.mod h1:N12LGw7VcXxCm94kw4ePQPPnADHUqopSEO54v/jMERc=
github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=
github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
@ -1191,10 +1198,6 @@ github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
@ -1547,6 +1550,10 @@ github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls=
github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
@ -1573,8 +1580,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
@ -1687,6 +1692,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/mattn/go-sqlite3 v1.14.23 h1:gbShiuAP1W5j9UOksQ06aiiqPMxYecovVGwmTxWtuw0=
github.com/mattn/go-sqlite3 v1.14.23/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
@ -1764,7 +1771,17 @@ github.com/nats-io/nats.go v1.30.2/go.mod h1:dcfhUgmQNN4GJEfIb2f9R7Fow+gzBF4emzD
github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/ncruces/go-sqlite3 v0.18.2 h1:m7QXhBWIwXsp84HE11t+ze0n1v3LRU+zGFg4uHjBeFA=
github.com/ncruces/go-sqlite3 v0.18.2/go.mod h1:4sZHOm+b/FM8FJRVGN4TemkPPDq5JXGK/1EHIEWxsYo=
github.com/ncruces/go-sqlite3/gormlite v0.18.0 h1:KqP9a9wlX/Ba+yG+aeVX4pnNBNdaSO6xHdNDWzPxPnk=
github.com/ncruces/go-sqlite3/gormlite v0.18.0/go.mod h1:RXeT1hknrz3A0tBDL6IfluDHuNkHdJeImn5TBMQg9zc=
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M=
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nlepage/go-js-promise v1.0.0 h1:K7OmJ3+0BgWJ2LfXchg2sI6RDr7AW/KWR8182epFwGQ=
github.com/nlepage/go-js-promise v1.0.0/go.mod h1:bdOP0wObXu34euibyK39K1hoBCtlgTKXGc56AGflaRo=
github.com/nlepage/go-wasm-http-server v1.1.0 h1:phw2NtSp71m/6NmGjE2veQ41PBPzWFcnE614cKucy5M=
github.com/nlepage/go-wasm-http-server v1.1.0/go.mod h1:xpffUeN97vuv8CTlMJ2oC5tPsftfPoG9HkAgI9gkiPI=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
@ -1787,8 +1804,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
github.com/onsonr/crypto v1.5.0 h1:iAmjTdzuu6inJL48/gHsLcQsyq+GbnVaKSBxlkpkBnE= github.com/onsonr/crypto v1.23.0 h1:8YYDwja/tGpRaA2Tcoau3Rw5j1t/RfZkIcVacKIi7dI=
github.com/onsonr/crypto v1.5.0/go.mod h1:g77+cbK6mD5qILg4dN6d2X9fNtYrEUAOQ6JIlj12Um0= github.com/onsonr/crypto v1.23.0/go.mod h1:nPb9pp3n7kMl4/3l2sW3ZJWMU3DQsGoNzyYAqLwL+EY=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
@ -1898,6 +1915,8 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M=
github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
@ -2000,6 +2019,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g=
github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
@ -2150,8 +2171,8 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@ -2218,8 +2239,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20150829230318-ea47fc708ee3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20150829230318-ea47fc708ee3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -2296,8 +2317,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -2352,8 +2373,8 @@ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -2471,8 +2492,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@ -2489,8 +2510,8 @@ golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -2512,8 +2533,8 @@ golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -2522,11 +2543,9 @@ golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181008205924-a2b3f7f249e9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181008205924-a2b3f7f249e9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@ -2599,8 +2618,8 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -2715,6 +2734,7 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
@ -2980,6 +3000,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg=
gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
@ -2990,6 +3012,8 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
lukechampine.com/adiantum v1.1.1 h1:4fp6gTxWCqpEbLy40ExiYDDED3oUNWx5cTqBCtPdZqA=
lukechampine.com/adiantum v1.1.1/go.mod h1:LrAYVnTYLnUtE/yMp5bQr0HstAf060YUF8nM0B6+rUw=
lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE=
lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=

174
internal/db/db.go Normal file
View File

@ -0,0 +1,174 @@
package db
import (
"fmt"
"github.com/ncruces/go-sqlite3"
_ "github.com/ncruces/go-sqlite3/embed"
)
type DB struct {
*sqlite3.Conn
}
func New(opts ...DBOption) *DBConfig {
config := &DBConfig{
fileName: "vault.db",
}
for _, opt := range opts {
opt(config)
}
return config
}
func Open(config *DBConfig) (*DB, error) {
conn, err := sqlite3.Open(config.ConnectionString())
if err != nil {
return nil, fmt.Errorf("failed to open database: %w", err)
}
db := &DB{
Conn: conn,
}
if err := createTables(db); err != nil {
conn.Close()
return nil, fmt.Errorf("failed to create tables: %w", err)
}
return db, nil
}
func createTables(db *DB) error {
tables := []string{
createAccountsTable,
createAssetsTable,
createChainsTable,
createCredentialsTable,
createKeysharesTable,
createProfilesTable,
createPropertiesTable,
createPermissionsTable,
}
for _, table := range tables {
err := db.Exec(table)
if err != nil {
return fmt.Errorf("failed to create table: %w", err)
}
}
return nil
}
// AddAccount adds a new account to the database
func (db *DB) AddAccount(name, address string) error {
return db.Exec(insertAccountQuery(name, address))
}
// AddAsset adds a new asset to the database
func (db *DB) AddAsset(name, symbol string, decimals int, chainID int64) error {
return db.Exec(insertAssetQuery(name, symbol, decimals, chainID))
}
// AddChain adds a new chain to the database
func (db *DB) AddChain(name, networkID string) error {
return db.Exec(insertChainQuery(name, networkID))
}
// AddCredential adds a new credential to the database
func (db *DB) AddCredential(
handle, controller, attestationType, origin string,
credentialID, publicKey []byte,
transport string,
signCount uint32,
userPresent, userVerified, backupEligible, backupState, cloneWarning bool,
) error {
return db.Exec(insertCredentialQuery(
handle,
controller,
attestationType,
origin,
credentialID,
publicKey,
transport,
signCount,
userPresent,
userVerified,
backupEligible,
backupState,
cloneWarning,
))
}
//
// // AddProfile adds a new profile to the database
// func (db *DB) AddProfile(
// id, subject, controller, originURI string,
// publicMetadata, privateMetadata string,
// ) error {
// return db.statements["insertProfile"].Exec(
// id,
// subject,
// controller,
// originURI,
// publicMetadata,
// privateMetadata,
// )
// }
//
// // AddProperty adds a new property to the database
// func (db *DB) AddProperty(profileID, key string, accumulator, propertyKey []byte) error {
// return db.statements["insertProperty"].Exec(profileID, key, accumulator, propertyKey)
// }
//
// // AddPermission adds a new permission to the database
// func (db *DB) AddPermission(
// serviceID string,
// grants []DIDNamespace,
// scopes []PermissionScope,
// ) error {
// grantsJSON, err := json.Marshal(grants)
// if err != nil {
// return fmt.Errorf("failed to marshal grants: %w", err)
// }
//
// scopesJSON, err := json.Marshal(scopes)
// if err != nil {
// return fmt.Errorf("failed to marshal scopes: %w", err)
// }
//
// return db.statements["insertPermission"].Exec(
// serviceID,
// string(grantsJSON),
// string(scopesJSON),
// )
// }
//
// // GetPermission retrieves a permission from the database
// func (db *DB) GetPermission(serviceID string) ([]DIDNamespace, []PermissionScope, error) {
// stmt := db.statements["getPermission"]
// if err := stmt.Exec(serviceID); err != nil {
// return nil, nil, fmt.Errorf("failed to execute statement: %w", err)
// }
//
// if !stmt.Step() {
// return nil, nil, fmt.Errorf("permission not found")
// }
//
// grantsJSON := stmt.ColumnText(0)
// scopesJSON := stmt.ColumnText(1)
//
// var grants []DIDNamespace
// err := json.Unmarshal([]byte(grantsJSON), &grants)
// if err != nil {
// return nil, nil, fmt.Errorf("failed to unmarshal grants: %w", err)
// }
//
// var scopes []PermissionScope
// err = json.Unmarshal([]byte(scopesJSON), &scopes)
// if err != nil {
// return nil, nil, fmt.Errorf("failed to unmarshal scopes: %w", err)
// }
//
// return grants, scopes, nil
// }

36
internal/db/enums.go Normal file
View File

@ -0,0 +1,36 @@
package db
// DIDNamespace defines the different namespaces of DID
type DIDNamespace int
const (
DIDNamespaceUnspecified DIDNamespace = iota
DIDNamespaceIPFS
DIDNamespaceSonr
DIDNamespaceBitcoin
DIDNamespaceEthereum
DIDNamespaceIBC
DIDNamespaceWebauthn
DIDNamespaceDWN
DIDNamespaceService
)
// PermissionScope defines the Capabilities Controllers can grant for Services
type PermissionScope int
const (
PermissionScopeUnspecified PermissionScope = iota
PermissionScopeBasicInfo
PermissionScopeRecordsRead
PermissionScopeRecordsWrite
PermissionScopeTransactionsRead
PermissionScopeTransactionsWrite
PermissionScopeWalletsRead
PermissionScopeWalletsCreate
PermissionScopeWalletsSubscribe
PermissionScopeWalletsUpdate
PermissionScopeTransactionsVerify
PermissionScopeTransactionsBroadcast
PermissionScopeAdminUser
PermissionScopeAdminValidator
)

83
internal/db/options.go Normal file
View File

@ -0,0 +1,83 @@
package db
import (
"crypto/rand"
"github.com/ncruces/go-sqlite3/gormlite"
"github.com/ncruces/go-sqlite3/vfs"
"golang.org/x/crypto/argon2"
"gorm.io/gorm"
"lukechampine.com/adiantum/hbsh"
"lukechampine.com/adiantum/hpolyc"
)
type DBOption func(config *DBConfig)
func WithDir(dir string) DBOption {
return func(config *DBConfig) {
config.Dir = dir
}
}
func WithInMemory() DBOption {
return func(config *DBConfig) {
config.InMemory = true
}
}
func WithSecretKey(secretKey string) DBOption {
return func(config *DBConfig) {
config.SecretKey = secretKey
}
}
func WithOpenFlag(flag vfs.OpenFlag) DBOption {
return func(config *DBConfig) {
config.OpenFlag = flag
}
}
type DBConfig struct {
Dir string
InMemory bool
SecretKey string
OpenFlag vfs.OpenFlag
fileName string
}
func (config *DBConfig) ConnectionString() string {
connStr := "file:"
if config.InMemory {
connStr += ":memory:"
} else {
connStr += config.Dir + "/" + config.fileName
}
return connStr
}
// GormDialector creates a gorm dialector for the database.
func (config *DBConfig) GormDialector() (*gorm.DB, error) {
return gorm.Open(gormlite.Open(config.ConnectionString()))
}
// HBSH creates an HBSH cipher given a key.
func (c *DBConfig) HBSH(key []byte) *hbsh.HBSH {
if len(key) != 32 {
// Key is not appropriate, return nil.
return nil
}
return hpolyc.New(key)
}
// KDF gets a key from a secret.
func (c *DBConfig) KDF(secret string) []byte {
if secret == "" {
// No secret is given, generate a random key.
key := make([]byte, 32)
n, _ := rand.Read(key)
return key[:n]
}
// Hash the secret with a KDF.
return argon2.IDKey([]byte(secret), []byte("hpolyc"), 3, 64*1024, 4, 32)
}

79
internal/db/queries.go Normal file
View File

@ -0,0 +1,79 @@
package db
import "fmt"
// Account queries
func insertAccountQuery(name, address string) string {
return fmt.Sprintf(`INSERT INTO accounts (name, address) VALUES (%s, %s)`, name, address)
}
// Asset queries
func insertAssetQuery(name, symbol string, decimals int, chainID int64) string {
return fmt.Sprintf(
`INSERT INTO assets (name, symbol, decimals, chain_id) VALUES (%s, %s, %d, %d)`,
name,
symbol,
decimals,
chainID,
)
}
// Chain queries
func insertChainQuery(name string, networkID string) string {
return fmt.Sprintf(`INSERT INTO chains (name, network_id) VALUES (%s, %d)`, name, networkID)
}
// Credential queries
func insertCredentialQuery(
handle, controller, attestationType, origin string,
credentialID, publicKey []byte,
transport string,
signCount uint32,
userPresent, userVerified, backupEligible, backupState, cloneWarning bool,
) string {
return fmt.Sprintf(`INSERT INTO credentials (
handle, controller, attestation_type, origin,
credential_id, public_key, transport, sign_count,
user_present, user_verified, backup_eligible,
backup_state, clone_warning
) VALUES (%s, %s, %s, %s, %s, %s, %s, %d, %t, %t, %t, %t, %t)`,
handle, controller, attestationType, origin,
credentialID, publicKey, transport, signCount,
userPresent, userVerified, backupEligible,
backupState, cloneWarning)
}
// Profile queries
func insertProfileQuery(
id, subject, controller, originURI, publicMetadata, privateMetadata string,
) string {
return fmt.Sprintf(`INSERT INTO profiles (
id, subject, controller, origin_uri,
public_metadata, private_metadata
) VALUES (%s, %s, %s, %s, %s, %s)`,
id, subject, controller, originURI,
publicMetadata, privateMetadata)
}
// Property queries
func insertPropertyQuery(profileID, key, accumulator, propertyKey string) string {
return fmt.Sprintf(`INSERT INTO properties (
profile_id, key, accumulator, property_key
) VALUES (%s, %s, %s, %s)`,
profileID, key, accumulator, propertyKey)
}
// Permission queries
func insertPermissionQuery(serviceID, grants, scopes string) string {
return fmt.Sprintf(
`INSERT INTO permissions (service_id, grants, scopes) VALUES (%s, %s, %s)`,
serviceID,
grants,
scopes,
)
}
// GetPermission query
func getPermissionQuery(serviceID string) string {
return fmt.Sprintf(`SELECT grants, scopes FROM permissions WHERE service_id = %s`, serviceID)
}

104
internal/db/tables.go Normal file
View File

@ -0,0 +1,104 @@
package db
const (
createAccountsTable = `
CREATE TABLE IF NOT EXISTS accounts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
address TEXT NOT NULL UNIQUE,
public_key BLOB NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`
createAssetsTable = `
CREATE TABLE IF NOT EXISTS assets (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
symbol TEXT NOT NULL,
decimals INTEGER NOT NULL,
chain_id INTEGER,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (chain_id) REFERENCES chains(id)
)
`
createChainsTable = `
CREATE TABLE IF NOT EXISTS chains (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
network_id TEXT NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`
createCredentialsTable = `
CREATE TABLE IF NOT EXISTS credentials (
id INTEGER PRIMARY KEY AUTOINCREMENT,
handle TEXT NOT NULL,
controller TEXT NOT NULL,
attestation_type TEXT NOT NULL,
origin TEXT NOT NULL,
credential_id BLOB NOT NULL,
public_key BLOB NOT NULL,
transport TEXT NOT NULL,
sign_count INTEGER NOT NULL,
user_present BOOLEAN NOT NULL,
user_verified BOOLEAN NOT NULL,
backup_eligible BOOLEAN NOT NULL,
backup_state BOOLEAN NOT NULL,
clone_warning BOOLEAN NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`
createProfilesTable = `
CREATE TABLE IF NOT EXISTS profiles (
id TEXT PRIMARY KEY,
subject TEXT NOT NULL,
controller TEXT NOT NULL,
origin_uri TEXT,
public_metadata TEXT,
private_metadata TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`
createPropertiesTable = `
CREATE TABLE IF NOT EXISTS properties (
id INTEGER PRIMARY KEY AUTOINCREMENT,
profile_id TEXT NOT NULL,
key TEXT NOT NULL,
accumulator BLOB NOT NULL,
property_key BLOB NOT NULL,
FOREIGN KEY (profile_id) REFERENCES profiles(id)
)
`
createKeysharesTable = `
CREATE TABLE IF NOT EXISTS keyshares (
id INTEGER PRIMARY KEY AUTOINCREMENT,
metadata TEXT NOT NULL,
payloads TEXT NOT NULL,
protocol TEXT NOT NULL,
public_key BLOB NOT NULL,
role INTEGER NOT NULL,
version INTEGER NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`
createPermissionsTable = `
CREATE TABLE IF NOT EXISTS permissions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
service_id TEXT NOT NULL,
grants TEXT NOT NULL,
scopes TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (service_id) REFERENCES services(id)
)
`
)

View File

@ -0,0 +1,63 @@
package files
import (
"fmt"
"os"
"path/filepath"
_ "github.com/mattn/go-sqlite3"
"github.com/onsonr/sonr/internal/db"
)
var (
kServiceWorkerFileName = "sw.js"
kVaultFileName = "vault.wasm"
kIndexFileName = "index.html"
)
func Assemble(dir string) error {
err := os.MkdirAll(dir, 0o755)
if err != nil {
return err
}
// Write the vault file
if err := writeVaultWASM(filepath.Join(dir, kVaultFileName)); err != nil {
return err
}
// Write the service worker file
if err := writeServiceWorkerJS(filepath.Join(dir, kServiceWorkerFileName)); err != nil {
return err
}
// Write the index file
if err := writeIndexHTML(filepath.Join(dir, kIndexFileName)); err != nil {
return err
}
// Initialize the database
if err := initializeDatabase(dir); err != nil {
return err
}
return nil
}
func initializeDatabase(dir string) error {
db, err := db.Open(db.New(db.WithDir(dir)))
if err != nil {
return fmt.Errorf("failed to open database: %w", err)
}
defer db.Close()
// You can add some initial data here if needed
// For example:
// err = db.AddChain("Ethereum", "1")
// if err != nil {
// return fmt.Errorf("failed to add initial chain: %w", err)
// }
return nil
}

58
internal/files/embed.go Normal file
View File

@ -0,0 +1,58 @@
package files
import (
"context"
_ "embed"
"os"
)
//go:embed vault.wasm
var vaultWasmData []byte
func writeServiceWorkerJS(path string) error {
// Create the service worker file
file, err := os.Create(path)
if err != nil {
return err
}
defer file.Close()
// Write the service worker file to the specified path
err = VaultServiceWorker(kVaultFileName).Render(context.Background(), file)
if err != nil {
return err
}
return nil
}
func writeVaultWASM(path string) error {
// Create the vault file
file, err := os.Create(path)
if err != nil {
return err
}
defer file.Close()
// Write the embedded vault file to the specified path
err = os.WriteFile(file.Name(), vaultWasmData, 0o644)
if err != nil {
return err
}
return nil
}
func writeIndexHTML(path string) error {
// create the index file
file, err := os.Create(path)
if err != nil {
return err
}
defer file.Close()
// write the index file to the specified path
err = IndexHTML().Render(context.Background(), file)
if err != nil {
return err
}
return nil
}

32
internal/files/sw.templ Normal file
View File

@ -0,0 +1,32 @@
package files
templ VaultServiceWorker(path string) {
@serviceWorkerJS(path)
}
script serviceWorkerJS(path string) {
importScripts('https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js')
importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js')
}
templ IndexHTML() {
<html>
<head>
<title>Sonr ID</title>
<script>
navigator.serviceWorker.register('sw.js')
registerWasmHTTPListener(path)
// Skip installed stage and jump to activating stage
addEventListener('install', (event) => {
event.waitUntil(skipWaiting())
})
// Start controlling clients as soon as the SW is activated
addEventListener('activate', event => {
event.waitUntil(clients.claim())
})
</script>
</head>
</html>
}

View File

@ -0,0 +1,74 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.771
package files
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func VaultServiceWorker(path string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = serviceWorkerJS(path).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func serviceWorkerJS(path string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_serviceWorkerJS_2501`,
Function: `function __templ_serviceWorkerJS_2501(path){importScripts('https://cdn.jsdelivr.net/gh/golang/go@go1.18.4/misc/wasm/wasm_exec.js')
importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@v1.1.0/sw.js')
}`,
Call: templ.SafeScript(`__templ_serviceWorkerJS_2501`, path),
CallInline: templ.SafeScriptInline(`__templ_serviceWorkerJS_2501`, path),
}
}
func IndexHTML() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<html><head><title>Sonr ID</title><script>\n navigator.serviceWorker.register('sw.js')\n registerWasmHTTPListener(path)\n\n // Skip installed stage and jump to activating stage\n addEventListener('install', (event) => {\n event.waitUntil(skipWaiting())\n })\n\n // Start controlling clients as soon as the SW is activated\n addEventListener('activate', event => {\n event.waitUntil(clients.claim())\n })\n </script></head></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
var _ = templruntime.GeneratedTemplate

BIN
internal/files/vault.wasm Executable file

Binary file not shown.

88
internal/ipfs/base.go Normal file
View File

@ -0,0 +1,88 @@
package ipfs
import (
"fmt"
"io"
"time"
)
var (
ErrNotInitialized = fmt.Errorf("IPFS client not initialized")
ErrNotMounted = fmt.Errorf("IPFS client not mounted")
ErrCIDNotFound = fmt.Errorf("CID not found")
ErrIPNSNotFound = fmt.Errorf("IPNS not found")
ErrInternal = fmt.Errorf("internal error")
)
type FileSystem interface {
// NewFile initializes a File on the specified volume at path 'absFilePath'.
//
// * Accepts volume and an absolute file path.
// * Upon success, a vfs.File, representing the file's new path (location path + file relative path), will be returned.
// * On error, nil is returned for the file.
// * Note that not all file systems will have a "volume" and will therefore be "":
// file:///path/to/file has a volume of "" and name /path/to/file
// whereas
// s3://mybucket/path/to/file has a volume of "mybucket and name /path/to/file
// results in /tmp/dir1/newerdir/file.txt for the final vfs.File path.
// * The file may or may not already exist.
NewFile(volume string, absFilePath string) (File, error)
// Name returns the name of the FileSystem ie: Amazon S3, os, Google Cloud Storage, etc.
Name() string
}
type File interface {
io.Closer
io.Reader
io.Seeker
io.Writer
fmt.Stringer
// Exists returns boolean if the file exists on the file system. Returns an error, if any.
Exists() (bool, error)
// CopyToFile will copy the current file to the provided file instance.
//
// * In the case of an error, nil is returned for the file.
// * CopyToLocation should use native functions when possible within the same scheme.
// * If the file already exists, the contents will be overwritten with the current file's contents.
// * CopyToFile will Close both the source and target Files which therefore can't be appended to without first
// calling Seek() to move the cursor to the end of the file.
CopyToFile(file File) error
// MoveToFile will move the current file to the provided file instance.
//
// * If the file already exists, the contents will be overwritten with the current file's contents.
// * The current instance of the file will be removed.
// * MoveToFile will Close both the source and target Files which therefore can't be appended to without first
// calling Seek() to move the cursor to the end of the file.
MoveToFile(file File) error
// Delete unlinks the File on the file system.
Delete() error
// LastModified returns the timestamp the file was last modified (as *time.Time).
LastModified() (*time.Time, error)
// Size returns the size of the file in bytes.
Size() (uint64, error)
// Path returns absolute path, including filename, ie /some/path/to/file.txt
//
// If the directory portion of a file is desired, call
// someFile.Location().Path()
Path() string
// Name returns the base name of the file path.
//
// For file:///some/path/to/file.txt, it would return file.txt
Name() string
// Touch creates a zero-length file on the vfs.File if no File exists. Update File's last modified timestamp.
// Returns error if unable to touch File.
Touch() error
// URI returns the fully qualified absolute URI for the File. IE, s3://bucket/some/path/to/file.txt
URI() string
}

173
internal/ipfs/ipfs.go Normal file
View File

@ -0,0 +1,173 @@
package ipfs
import (
"context"
"fmt"
"io"
"os"
"path/filepath"
"github.com/ipfs/boxo/files"
"github.com/ipfs/boxo/path"
"github.com/ipfs/kubo/client/rpc"
)
var (
initialized bool
localMount bool
ipfsClient *rpc.HttpApi
ipfsFS FileSystem
)
// init initializes the IPFS client and checks for local mounts
func init() {
var err error
ipfsClient, err = rpc.NewLocalApi()
if err != nil {
initialized = false
localMount = false
return
}
initialized = true
ipfsFS = &IPFSFileSystem{client: ipfsClient}
// Check if /ipfs and /ipns are mounted using os package
_, errIPFS := os.Stat("/ipfs")
_, errIPNS := os.Stat("/ipns")
localMount = !os.IsNotExist(errIPFS) && !os.IsNotExist(errIPNS)
}
// GetFileSystem returns the IPFS FileSystem implementation
func GetFileSystem() FileSystem {
return ipfsFS
}
// AddFile adds a single file to IPFS and returns its CID
func AddFile(ctx context.Context, filePath string) (string, error) {
if !initialized {
return "", ErrNotInitialized
}
file, err := os.Open(filePath)
if err != nil {
return "", fmt.Errorf("failed to open file: %w", err)
}
defer file.Close()
fileNode := files.NewReaderFile(file)
cidFile, err := ipfsClient.Unixfs().Add(ctx, fileNode)
if err != nil {
return "", fmt.Errorf("failed to add file to IPFS: %w", err)
}
return cidFile.String(), nil
}
// AddFolder adds a folder and its contents to IPFS and returns the CID of the folder
func AddFolder(ctx context.Context, folderPath string) (string, error) {
if !initialized {
return "", ErrNotInitialized
}
stat, err := os.Stat(folderPath)
if err != nil {
return "", fmt.Errorf("failed to get folder info: %w", err)
}
if !stat.IsDir() {
return "", fmt.Errorf("provided path is not a directory")
}
folderNode, err := files.NewSerialFile(folderPath, false, stat)
if err != nil {
return "", fmt.Errorf("failed to create folder node: %w", err)
}
cidFolder, err := ipfsClient.Unixfs().Add(ctx, folderNode)
if err != nil {
return "", fmt.Errorf("failed to add folder to IPFS: %w", err)
}
return cidFolder.String(), nil
}
func GetCID(ctx context.Context, cid string) ([]byte, error) {
if !initialized {
return nil, ErrNotInitialized
}
if localMount {
// Try to read from local filesystem first
data, err := os.ReadFile(filepath.Join("/ipfs", cid))
if err == nil {
return data, nil
}
// If local read fails, fall back to IPFS client
}
// Use IPFS client to fetch the data
p, err := path.NewPath("/ipfs/" + cid)
if err != nil {
return nil, err
}
n, err := ipfsClient.Unixfs().Get(ctx, p)
if err != nil {
return nil, err
}
return readNodeData(n)
}
func GetIPNS(ctx context.Context, name string) ([]byte, error) {
if !initialized {
return nil, ErrNotInitialized
}
if localMount {
// Try to read from local filesystem first
data, err := os.ReadFile(filepath.Join("/ipns", name))
if err == nil {
return data, nil
}
// If local read fails, fall back to IPFS client
}
// Use IPFS client to fetch the data
p, err := path.NewPath("/ipns/" + name)
if err != nil {
return nil, err
}
n, err := ipfsClient.Unixfs().Get(ctx, p)
if err != nil {
return nil, err
}
return readNodeData(n)
}
func PinCID(ctx context.Context, cid string, name string) error {
if !initialized {
return ErrNotInitialized
}
p, err := path.NewPath(cid)
if err != nil {
return ErrNotInitialized
}
err = ipfsClient.Pin().Add(ctx, p)
if err != nil {
return ErrInternal
}
return nil
}
func readNodeData(n files.Node) ([]byte, error) {
switch n := n.(type) {
case files.File:
return io.ReadAll(n)
default:
return nil, fmt.Errorf("unsupported node type: %T", n)
}
}

119
internal/ipfs/vfs.go Normal file
View File

@ -0,0 +1,119 @@
package ipfs
import (
"context"
"fmt"
"time"
"github.com/ipfs/boxo/files"
"github.com/ipfs/boxo/path"
"github.com/ipfs/kubo/client/rpc"
)
type IPFSFile struct {
node files.Node
path string
name string
client *rpc.HttpApi
}
func (f *IPFSFile) Close() error {
return nil // IPFS nodes don't need to be closed
}
func (f *IPFSFile) Read(p []byte) (n int, err error) {
if file, ok := f.node.(files.File); ok {
return file.Read(p)
}
return 0, fmt.Errorf("not a file")
}
func (f *IPFSFile) Seek(offset int64, whence int) (int64, error) {
if file, ok := f.node.(files.File); ok {
return file.Seek(offset, whence)
}
return 0, fmt.Errorf("not a file")
}
func (f *IPFSFile) Write(p []byte) (n int, err error) {
return 0, fmt.Errorf("write operation not supported for IPFS files")
}
func (f *IPFSFile) String() string {
return f.path
}
func (f *IPFSFile) Exists() (bool, error) {
// In IPFS, if we have the node, it exists
return true, nil
}
func (f *IPFSFile) CopyToFile(file File) error {
// Implementation depends on how you want to handle copying between IPFS and other file types
return fmt.Errorf("CopyToFile not implemented for IPFS files")
}
func (f *IPFSFile) MoveToFile(file File) error {
// Moving files in IPFS doesn't make sense in the traditional way
return fmt.Errorf("MoveToFile not applicable for IPFS files")
}
func (f *IPFSFile) Delete() error {
// Deleting in IPFS is not straightforward, might need to implement unpinning
return fmt.Errorf("Delete operation not supported for IPFS files")
}
func (f *IPFSFile) LastModified() (*time.Time, error) {
// IPFS doesn't have a concept of last modified time
return nil, fmt.Errorf("LastModified not applicable for IPFS files")
}
func (f *IPFSFile) Size() (uint64, error) {
if file, ok := f.node.(files.File); ok {
s, _ := file.Size()
return uint64(s), nil
}
return 0, fmt.Errorf("not a file")
}
func (f *IPFSFile) Path() string {
return f.path
}
func (f *IPFSFile) Name() string {
return f.name
}
func (f *IPFSFile) Touch() error {
return fmt.Errorf("Touch operation not supported for IPFS files")
}
func (f *IPFSFile) URI() string {
return fmt.Sprintf("ipfs://%s", f.path)
}
type IPFSFileSystem struct {
client *rpc.HttpApi
}
func (fs *IPFSFileSystem) NewFile(volume string, absFilePath string) (File, error) {
p, err := path.NewPath(absFilePath)
if err != nil {
return nil, err
}
node, err := fs.client.Unixfs().Get(context.Background(), p)
if err != nil {
return nil, err
}
return &IPFSFile{
node: node,
path: absFilePath,
name: p.String(),
client: fs.client,
}, nil
}
func (fs *IPFSFileSystem) Name() string {
return "IPFS"
}

View File

@ -1,15 +0,0 @@
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
RUN devbox run -- echo "Installed Packages."
ENTRYPOINT ["devbox", "run"]

View File

@ -2,7 +2,7 @@ version: v1
managed: managed:
enabled: true enabled: true
go_package_prefix: go_package_prefix:
default: github.com/onsonr/hway/api default: github.com/onsonr/sonr/api
except: except:
- buf.build/googleapis/googleapis - buf.build/googleapis/googleapis
- buf.build/cosmos/gogo-proto - buf.build/cosmos/gogo-proto

View File

@ -1,5 +1,5 @@
version: v1 version: v1
name: buf.build/didao/sonr name: buf.build/onsonr/sonr
deps: deps:
- buf.build/cosmos/cosmos-sdk:9000fcc585a046c9881271d53dd40c34 - buf.build/cosmos/cosmos-sdk:9000fcc585a046c9881271d53dd40c34
- buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31 - buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31

View File

@ -1,6 +1,6 @@
syntax = "proto3"; syntax = "proto3";
package onsonr.hway.did.module.v1; package onsonr.sonr.did.module.v1;
import "cosmos/app/v1alpha1/module.proto"; import "cosmos/app/v1alpha1/module.proto";
@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto";
// Learn more: https://docs.cosmos.network/main/building-modules/depinject // Learn more: https://docs.cosmos.network/main/building-modules/depinject
message Module { message Module {
option (cosmos.app.v1alpha1.module) = { option (cosmos.app.v1alpha1.module) = {
go_import : "github.com/onsonr/hway" go_import : "github.com/onsonr/sonr"
}; };
} }

View File

@ -1,7 +1,7 @@
syntax = "proto3"; syntax = "proto3";
package did.v1; package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/sonr/x/did/types";
message BtcAccount {} message BtcAccount {}

View File

@ -0,0 +1,101 @@
syntax = "proto3";
package did.v1;
option go_package = "github.com/onsonr/sonr/x/did/types";
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
enum AssetType {
ASSET_TYPE_UNSPECIFIED = 0;
ASSET_TYPE_NATIVE = 1;
ASSET_TYPE_WRAPPED = 2;
ASSET_TYPE_STAKING = 3;
ASSET_TYPE_POOL = 4;
ASSET_TYPE_IBC = 5;
ASSET_TYPE_CW20 = 6;
}
// DIDNamespace define the different namespaces of DID
enum DIDNamespace {
DID_NAMESPACE_UNSPECIFIED = 0;
DID_NAMESPACE_IPFS = 1;
DID_NAMESPACE_SONR = 2;
DID_NAMESPACE_BITCOIN = 3;
DID_NAMESPACE_ETHEREUM = 4;
DID_NAMESPACE_IBC = 5;
DID_NAMESPACE_WEBAUTHN = 6;
DID_NAMESPACE_DWN = 7;
DID_NAMESPACE_SERVICE = 8;
}
// KeyAlgorithm defines the key algorithm
enum KeyAlgorithm {
KEY_ALGORITHM_UNSPECIFIED = 0;
KEY_ALGORITHM_ES256 = 1;
KEY_ALGORITHM_ES384 = 2;
KEY_ALGORITHM_ES512 = 3;
KEY_ALGORITHM_EDDSA = 4;
KEY_ALGORITHM_ES256K = 5;
KEY_ALGORITHM_BLS12377 = 6;
KEY_ALGORITHM_KECCAK256 = 7;
}
// KeyCurve defines the key curve
enum KeyCurve {
KEY_CURVE_UNSPECIFIED = 0;
KEY_CURVE_P256 = 1;
KEY_CURVE_P384 = 2;
KEY_CURVE_P521 = 3;
KEY_CURVE_X25519 = 4;
KEY_CURVE_X448 = 5;
KEY_CURVE_ED25519 = 6;
KEY_CURVE_ED448 = 7;
KEY_CURVE_SECP256K1 = 8;
}
// KeyEncoding defines the key encoding
enum KeyEncoding {
KEY_ENCODING_UNSPECIFIED = 0;
KEY_ENCODING_RAW = 1;
KEY_ENCODING_HEX = 2;
KEY_ENCODING_MULTIBASE = 3;
KEY_ENCODING_JWK = 4;
}
// KeyRole defines the kind of key
enum KeyRole {
KEY_ROLE_UNSPECIFIED = 0;
// Blockchain key types
KEY_ROLE_AUTHENTICATION = 1; // Passkeys and FIDO
KEY_ROLE_ASSERTION = 2; // Zk Identifiers
KEY_ROLE_DELEGATION = 3; // ETH,BTC,IBC addresses
KEY_ROLE_INVOCATION = 4; // DWN Controllers
}
// KeyType defines the key type
enum KeyType {
KEY_TYPE_UNSPECIFIED = 0;
KEY_TYPE_OCTET = 1;
KEY_TYPE_ELLIPTIC = 2;
KEY_TYPE_RSA = 3;
KEY_TYPE_SYMMETRIC = 4;
KEY_TYPE_HMAC = 5;
}
// PermissionScope define the Capabilities Controllers can grant for Services
enum PermissionScope {
PERMISSION_SCOPE_UNSPECIFIED = 0;
PERMISSION_SCOPE_BASIC_INFO = 1;
PERMISSION_SCOPE_RECORDS_READ = 2;
PERMISSION_SCOPE_RECORDS_WRITE = 3;
PERMISSION_SCOPE_TRANSACTIONS_READ = 4;
PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5;
PERMISSION_SCOPE_WALLETS_READ = 6;
PERMISSION_SCOPE_WALLETS_CREATE = 7;
PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8;
PERMISSION_SCOPE_WALLETS_UPDATE = 9;
PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10;
PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11;
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}

View File

@ -1,10 +1,11 @@
syntax = "proto3"; syntax = "proto3";
package did.v1; package did.v1;
import "gogoproto/gogo.proto";
import "amino/amino.proto"; import "amino/amino.proto";
import "did/v1/constants.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/sonr/x/did/types";
// GenesisState defines the module genesis state // GenesisState defines the module genesis state
message GenesisState { message GenesisState {
@ -27,117 +28,99 @@ message Params {
// Whitelisted Key Types // Whitelisted Key Types
repeated KeyInfo allowed_public_keys = 3; repeated KeyInfo allowed_public_keys = 3;
// Whitlested Validator nodes with Public DID Resolvers // OpenIDConfig defines the base openid configuration across all did services
repeated ValidatorInfo public_validators = 4; OpenIDConfig openid_config = 4;
} }
// AssetInfo defines the asset info // AssetInfo defines the asset info
message AssetInfo { message AssetInfo {
string id = 1; // The coin type index for bip44 path
string denom = 2; int64 index = 1;
string symbol = 3;
string asset_type = 4; // The hrp for bech32 address
string origin_chain = 5; string hrp = 2;
string origin_denom = 6;
int32 decimals = 7; // The coin symbol
string description = 8; string symbol = 3;
string image_url = 9;
string coingecko_id = 10; // The coin name
bool is_enabled = 11; AssetType asset_type = 4;
string ibc_path = 12;
string ibc_channel = 13; // The name of the asset
string ibc_port = 14; string name = 5;
// The Method of the did namespace
string method = 6;
// The icon url
string icon_url = 7;
} }
// ChainInfo defines the chain info // ChainInfo defines the chain info
message ChainInfo { message ChainInfo {
string id = 1; string id = 1;
string chain_id = 2; string chain_id = 2;
string name = 3; string name = 3;
string symbol = 4; string symbol = 4;
string bech32_prefix = 5; repeated ValidatorInfo validators = 5;
string genesis_time = 6; }
}
// KeyInfo defines information for accepted PubKey types // KeyInfo defines information for accepted PubKey types
message KeyInfo { message KeyInfo {
KeyType kind = 1; KeyRole role = 1;
string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" KeyAlgorithm algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K"
string curve = 3; // e.g., "P-256", "Ed25519", "secp256k1" KeyEncoding encoding = 3; // e.g., "hex", "base64", "multibase"
string encoding = 4; // e.g., "hex", "base64", "multibase" KeyCurve curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1"
KeyType type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC"
}
// OpenIDConfig defines the base openid configuration across all did services
message OpenIDConfig {
string issuer = 1;
string authorization_endpoint = 2;
string token_endpoint = 3;
string userinfo_endpoint = 4;
repeated string scopes_supported = 5;
repeated string response_types_supported = 6;
repeated string response_modes_supported = 7;
repeated string grant_types_supported = 8;
repeated string acr_values_supported = 9;
repeated string subject_types_supported = 10;
} }
// ValidatorInfo defines information for accepted Validator nodes // ValidatorInfo defines information for accepted Validator nodes
message ValidatorInfo { message ValidatorInfo {
repeated Endpoint grpc_endpoints = 5; string moniker = 1;
repeated Endpoint rest_endpoints = 6; repeated Endpoint grpc_endpoints = 2;
ExplorerInfo explorer = 7; repeated Endpoint rest_endpoints = 3;
FeeInfo fee_info = 8; ExplorerInfo explorer = 4;
FeeInfo fee_info = 5;
IBCChannel ibc_channel = 6;
// Endpoint defines an endpoint // Endpoint defines an endpoint
message Endpoint { message Endpoint {
string url = 1; string url = 1;
bool is_primary = 2; bool is_primary = 2;
} }
// ExplorerInfo defines the explorer info // ExplorerInfo defines the explorer info
message ExplorerInfo { message ExplorerInfo {
string name = 1; string name = 1;
string url = 2; string url = 2;
} }
// FeeInfo defines a fee info // FeeInfo defines a fee info
message FeeInfo { message FeeInfo {
string base_denom = 1; string base_denom = 1;
repeated string fee_rates = 2; repeated string fee_rates = 2;
int32 init_gas_limit = 3; int32 init_gas_limit = 3;
bool is_simulable = 4; bool is_simulable = 4;
double gas_multiply = 5; double gas_multiply = 5;
}
// IBCChannel defines the IBC channel info
message IBCChannel {
string id = 1;
string port = 2;
} }
} }
// DIDNamespace define the different namespaces of DID
enum DIDNamespace {
DID_NAMESPACE_UNSPECIFIED = 0;
DID_NAMESPACE_IPFS = 1;
DID_NAMESPACE_SONR = 2;
DID_NAMESPACE_BITCOIN = 3;
DID_NAMESPACE_ETHEREUM = 4;
DID_NAMESPACE_IBC = 5;
}
// KeyKTind defines the kind of key
enum KeyType {
KEY_TYPE_UNSPECIFIED = 0;
// Blockchain key types
KEY_TYPE_SECP256K1 = 1; // cross-chain
KEY_TYPE_ED25519 = 2; // validators
KEY_TYPE_KECCAK = 3; // ethereum addresses
KEY_TYPE_BLS12381 = 4; // zero-knowledge
KEY_TYPE_X25519 = 5; // multisig
KEY_TYPE_SCHNORR = 6; // mpc
// Webauthn and FIDO key types
KEY_TYPE_WEBAUTHN = 7; // passkey authentication
KEY_TYPE_FIDO = 8; // fido2 authentication
}
// PermissionScope define the Capabilities Controllers can grant for Services
enum PermissionScope {
PERMISSION_SCOPE_UNSPECIFIED = 0;
PERMISSION_SCOPE_BASIC_INFO = 1;
PERMISSION_SCOPE_RECORDS_READ = 2;
PERMISSION_SCOPE_RECORDS_WRITE = 3;
PERMISSION_SCOPE_TRANSACTIONS_READ = 4;
PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5;
PERMISSION_SCOPE_WALLETS_READ = 6;
PERMISSION_SCOPE_WALLETS_CREATE = 7;
PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8;
PERMISSION_SCOPE_WALLETS_UPDATE = 9;
PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10;
PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11;
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}

View File

@ -2,17 +2,15 @@ syntax = "proto3";
package did.v1; package did.v1;
import "did/v1/constants.proto";
import "did/v1/genesis.proto"; import "did/v1/genesis.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/sonr/x/did/types";
// DID defines a parsed DID string // Accumulator defines a BLS accumulator
message DID { message Accumulator {
string id = 1; bytes accumulator = 1;
DIDNamespace method = 2;
string network = 3;
string identifier = 4;
repeated string paths = 5;
} }
// Credential defines a WebAuthn credential // Credential defines a WebAuthn credential
@ -25,6 +23,15 @@ message Credential {
string controller = 7; string controller = 7;
} }
// DID defines a parsed DID string
message DID {
DIDNamespace method = 1;
string network = 2;
string subject = 3;
string identifier = 4;
repeated string paths = 5;
}
// Document defines a DID document // Document defines a DID document
message Document { message Document {
string id = 1; string id = 1;
@ -33,6 +40,7 @@ message Document {
repeated string assertion_method = 5; repeated string assertion_method = 5;
repeated string capability_delegation = 7; repeated string capability_delegation = 7;
repeated string capability_invocation = 8; repeated string capability_invocation = 8;
repeated string service = 9;
} }
// Metadata defines additional information provided to a did // Metadata defines additional information provided to a did
@ -54,9 +62,7 @@ message Profile {
string id = 1; string id = 1;
string subject = 2; string subject = 2;
string controller = 3; string controller = 3;
repeated Credential credentials = 4; Metadata metadata = 4;
repeated VerificationMethod attestations = 5;
Metadata metadata = 6;
} }
// Property defines a Zero-Knowledge accumulator which can be used to // Property defines a Zero-Knowledge accumulator which can be used to
@ -68,17 +74,42 @@ message Property {
// PubKey defines a public key for a did // PubKey defines a public key for a did
message PubKey { message PubKey {
DIDNamespace namespace = 1; KeyRole role = 1;
bytes key = 2; KeyAlgorithm algorithm = 2;
KeyType kind = 3; KeyEncoding encoding = 3;
string multibase = 5; bytes raw = 4;
map<string, string> jwks = 6; string hex = 5;
string multibase = 6;
map<string, string> jwk = 7;
}
// Service defines a Decentralized Service on the Sonr Blockchain
message Service {
string id = 1;
string controller = 2;
string origin = 3;
Permissions permissions = 4;
OpenIDConfig openid = 5;
Metadata metadata = 6;
}
// Token defines a macron token
message Token {
string id = 1;
string controller = 2;
bytes macron = 3;
} }
// VerificationMethod defines a verification method // VerificationMethod defines a verification method
message VerificationMethod { message VerificationMethod {
string id = 1; string id = 1;
string controller = 2; string controller = 2;
PubKey public_key = 3; DIDNamespace method = 3;
PubKey public_key = 4;
Service service = 7;
} }
// Witness defines a BLS witness
message Witness {
bytes witness = 1;
}

View File

@ -1,47 +1,52 @@
syntax = "proto3"; syntax = "proto3";
package did.v1; package did.v1;
import "google/api/annotations.proto";
import "did/v1/genesis.proto"; import "did/v1/genesis.proto";
import "did/v1/models.proto"; import "did/v1/models.proto";
import "google/api/annotations.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/sonr/x/did/types";
// Query provides defines the gRPC querier service. // Query provides defines the gRPC querier service.
service Query { service Query {
// Params queries all parameters of the module. // Params queries all parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { rpc Params(QueryRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/did/params"; option (google.api.http).get = "/did/params";
} }
// Accounts returns associated wallet accounts with the DID. // Accounts returns associated wallet accounts with the DID.
rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { rpc Accounts(QueryRequest) returns (QueryAccountsResponse) {
option (google.api.http).get = "/did/{did}/accounts"; option (google.api.http).get = "/did/{did}/accounts";
} }
// Credentials returns associated credentials with the DID and Service Origin. // Credentials returns associated credentials with the DID and Service Origin.
rpc Credentials(QueryCredentialsRequest) returns (QueryCredentialsResponse) { rpc Credentials(QueryRequest) returns (QueryCredentialsResponse) {
option (google.api.http).get = "/did/{did}/{origin}/credentials"; option (google.api.http).get = "/service/{origin}/{subject}/credentials";
} }
// Identities returns associated identity with the DID. // Resolve queries the DID document by its id.
rpc Identities(QueryIdentitiesRequest) returns (QueryIdentitiesResponse) { rpc Resolve(QueryRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/{did}/identities"; option (google.api.http).get = "/did/{did}";
} }
// Resolve queries the DID document by its id. // Service returns associated ServiceInfo for a given Origin
rpc Resolve(QueryResolveRequest) returns (QueryResolveResponse) { rpc Service(QueryRequest) returns (QueryServiceResponse) {
option (google.api.http).get = "/did/resolve/{did}"; option (google.api.http).get = "/service/{origin}";
} }
// Service returns associated ServiceInfo for a given Origin // Token returns the current authentication token for the client.
rpc Service(QueryServiceRequest) returns (QueryServiceResponse) { rpc Token(QueryRequest) returns (QueryTokenResponse) {
option (google.api.http).get = "/did/service/{origin}"; option (google.api.http).post = "/token";
} }
} }
// QueryParamsRequest is the request type for the Query/Params RPC method. // Queryequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {} message QueryRequest {
string did = 1;
string origin = 2;
string subject = 3;
repeated Credential credentials = 4;
}
// QueryParamsResponse is the response type for the Query/Params RPC method. // QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse { message QueryParamsResponse {
@ -49,57 +54,34 @@ message QueryParamsResponse {
Params params = 1; Params params = 1;
} }
// QueryAccountsRequest is the request type for the Query/Exists RPC method.
message QueryAccountsRequest {
string did = 1;
}
// QueryAccountsResponse is the response type for the Query/Exists RPC method. // QueryAccountsResponse is the response type for the Query/Exists RPC method.
message QueryAccountsResponse { message QueryAccountsResponse {
bool exists = 1; bool exists = 1;
}
// QueryCredentialsRequest is the request type for the Query/Exists RPC method.
message QueryCredentialsRequest {
string did = 1;
string origin = 2;
} }
// QueryCredentialsResponse is the response type for the Query/Exists RPC method. // QueryCredentialsResponse is the response type for the Query/Exists RPC method.
message QueryCredentialsResponse { message QueryCredentialsResponse {
map<string, bytes> credentials = 1; bool success = 1;
} string subject = 2;
string origin = 3;
// QueryIdentitiesRequest is the request type for the Query/Exists RPC method. repeated Credential credentials = 4;
message QueryIdentitiesRequest { string error = 5;
string did = 1;
}
// QueryIdentitiesResponse is the response type for the Query/Exists RPC method.
message QueryIdentitiesResponse {
bool exists = 1;
repeated VerificationMethod verificationMethod = 2;
}
// QueryResolveRequest is the request type for the Query/Resolve RPC method.
message QueryResolveRequest {
string did = 1;
} }
// QueryResolveResponse is the response type for the Query/Resolve RPC method. // QueryResolveResponse is the response type for the Query/Resolve RPC method.
message QueryResolveResponse { message QueryResolveResponse {
// document is the DID document // document is the DID document
Document document = 1; Document document = 1;
}
// QueryServiceRequest is the request type for the Query/LoginOptions RPC method.
message QueryServiceRequest {
string origin = 1;
} }
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
message QueryServiceResponse { message QueryServiceResponse {
// options is the PublicKeyCredentialAttestationOptions Service service = 1;
string options = 1;
} }
// QueryTokenResponse is the response type for the Query/LoginOptions RPC method.
message QueryTokenResponse {
bool success = 1;
Token token = 2;
string error = 3;
}

View File

@ -2,17 +2,32 @@ syntax = "proto3";
package did.v1; package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types";
import "cosmos/orm/v1/orm.proto"; import "cosmos/orm/v1/orm.proto";
import "did/v1/genesis.proto"; import "did/v1/genesis.proto";
import "did/v1/models.proto"; import "did/v1/models.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave) // Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave)
message Assertion { message Assertion {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
id: 1 id: 1
primary_key: {fields: "id"} primary_key: {fields: "id"}
index: {
id: 1
fields: "subject,origin"
unique: true
}
index: {
id: 2
fields: "controller,origin"
unique: true
}
index: {
id: 3
fields: "controller,credential_label"
unique: true
}
}; };
// The unique identifier of the attestation // The unique identifier of the attestation
@ -27,8 +42,17 @@ message Assertion {
// The value of the linked identifier // The value of the linked identifier
bytes credential_id = 4; bytes credential_id = 4;
// The display label of the attestation
string credential_label = 5;
// The origin of the attestation
string origin = 6;
// The subject of the attestation
string subject = 7;
// Metadata is optional additional information about the assertion // Metadata is optional additional information about the assertion
Metadata metadata = 5; Metadata metadata = 8;
} }
// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone) // Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
@ -36,7 +60,16 @@ message Attestation {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
id: 2 id: 2
primary_key: {fields: "id"} primary_key: {fields: "id"}
index: { id: 1, fields: "subject,origin", unique: true } index: {
id: 1
fields: "subject,origin"
unique: true
}
index: {
id: 2
fields: "controller,origin"
unique: true
}
}; };
// The unique identifier of the attestation // The unique identifier of the attestation
@ -58,12 +91,21 @@ message Attestation {
Metadata metadata = 6; Metadata metadata = 6;
} }
// Controller represents a Sonr DWN Vault // Controller represents a Sonr DWN Vault
message Controller { message Controller {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
id: 3 id: 3
primary_key: {fields: "id"} primary_key: {fields: "id"}
index: {
id: 1
fields: "address"
unique: true
}
index: {
id: 2
fields: "vault_cid"
unique: true
}
}; };
// The unique identifier of the controller // The unique identifier of the controller
@ -72,6 +114,9 @@ message Controller {
// The DID of the controller // The DID of the controller
string address = 2; string address = 2;
// Aliases of the controller
repeated string aliases = 3;
// PubKey is the verification method // PubKey is the verification method
PubKey public_key = 4; PubKey public_key = 4;
@ -84,6 +129,20 @@ message Delegation {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
id: 4 id: 4
primary_key: {fields: "id"} primary_key: {fields: "id"}
index: {
id: 1
fields: "account_address,chain_id"
unique: true
}
index: {
id: 2
fields: "controller,account_label"
unique: true
}
index: {
id: 3
fields: "controller,chain_id"
}
}; };
// The unique identifier of the delegation // The unique identifier of the delegation
@ -93,17 +152,36 @@ message Delegation {
string controller = 2; string controller = 2;
// Resolved from module parameters // Resolved from module parameters
string chain_info_id = 3; string chain_index = 3;
// The delegation proof or verification method // The delegation proof or verification method
PubKey public_key = 4; PubKey public_key = 4;
// The Account Address
string account_address = 5;
// The Account label
string account_label = 6;
// The Chain ID
string chain_id = 7;
} }
// Service represents a service in a DID Document // ServiceRecord represents a decentralized service in a DID Document
message Service { message ServiceRecord {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
id: 5 id: 5
primary_key: {fields: "id"} primary_key: {fields: "id"}
index: {
id: 1
fields: "origin_uri"
unique: true
}
index: {
id: 2
fields: "controller,origin_uri"
unique: true
}
}; };
// The ID of the service // The ID of the service
@ -113,14 +191,20 @@ message Service {
string service_type = 2; string service_type = 2;
// The controller DID of the service // The controller DID of the service
string controller_did = 3; string controller = 3;
// The domain name of the service // The domain name of the service
string origin_uri = 4; string origin_uri = 4;
// The description of the service
string description = 5;
// The service endpoint // The service endpoint
map<string, string> service_endpoints = 5; map<string, string> service_endpoints = 6;
// Scopes is the Authorization Grants of the service // Scopes is the Authorization Grants of the service
Permissions permissions = 6; Permissions permissions = 7;
// Metadata is optional additional information about the service
Metadata metadata = 8;
} }

View File

@ -3,34 +3,37 @@ syntax = "proto3";
package did.v1; package did.v1;
import "cosmos/msg/v1/msg.proto"; import "cosmos/msg/v1/msg.proto";
import "did/v1/models.proto";
import "did/v1/genesis.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto"; import "cosmos_proto/cosmos.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; import "did/v1/constants.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
// Msg defines the Msg service. // Msg defines the Msg service.
service Msg { service Msg {
option (cosmos.msg.v1.service) = true; option (cosmos.msg.v1.service) = true;
// 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
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
// Authenticate asserts the given controller is the owner of the given address. // Authorize asserts the given controller is the owner of the given address.
rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse); rpc Authorize(MsgAuthorize) returns (MsgAuthorizeResponse);
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators. // AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database.
rpc ProveWitness(MsgProveWitness) returns (MsgProveWitnessResponse); // this operation is called by services initiating a controller registration.
rpc AllocateVault(MsgAllocateVault) returns (MsgAllocateVaultResponse);
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet. // SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
rpc SyncVault(MsgSyncVault) returns (MsgSyncVaultResponse); rpc SyncVault(MsgSyncVault) returns (MsgSyncVaultResponse);
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse); rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key. // RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse); rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
} }
// MsgUpdateParams is the Msg/UpdateParams request type. // MsgUpdateParams is the Msg/UpdateParams request type.
@ -43,9 +46,10 @@ message MsgUpdateParams {
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// params defines the parameters to update. // params defines the parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false]; Params params = 2 [(gogoproto.nullable) = false];
// token is the macron token to authenticate the operation.
Token token = 3;
} }
// MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParamsResponse defines the response structure for executing a
@ -54,25 +58,28 @@ message MsgUpdateParams {
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {} message MsgUpdateParamsResponse {}
// MsgAuthenticate is the message type for the Authenticate RPC. // MsgAllocateVault is the message type for the AllocateVault RPC.
message MsgAuthenticate { message MsgAllocateVault {
option (cosmos.msg.v1.signer) = "authority"; option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account. // authority is the address of the service account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Controller is the address of the controller to authenticate. // subject is a unique human-defined identifier to associate with the vault.
string controller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string subject = 2;
// Address is the address to authenticate. // token is the macron token to authenticate the operation.
string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; Token token = 3;
// Origin is the origin of the request in wildcard form.
string origin = 4;
} }
// MsgAuthenticateResponse is the response type for the Authenticate RPC. // MsgAllocateVaultResponse is the response type for the AllocateVault RPC.
message MsgAuthenticateResponse {} message MsgAllocateVaultResponse {
// CID is the content identifier of the vault.
string cid = 1;
// ExpiryBlock is the block number at which the vault will expire.
int64 expiry_block = 2;
}
// MsgProveWitness is the message type for the ProveWitness RPC. // MsgProveWitness is the message type for the ProveWitness RPC.
message MsgProveWitness { message MsgProveWitness {
@ -86,6 +93,9 @@ message MsgProveWitness {
// Witness Value is the bytes of the witness. // Witness Value is the bytes of the witness.
bytes witness = 3; bytes witness = 3;
// token is the macron token to authenticate the operation.
Token token = 4;
} }
// MsgProveWitnessResponse is the response type for the ProveWitness RPC. // MsgProveWitnessResponse is the response type for the ProveWitness RPC.
@ -101,11 +111,8 @@ message MsgSyncVault {
// controller is the address of the controller to sync. // controller is the address of the controller to sync.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// cid is the IPFS content identifier. // Token is the public token to authenticate the operation.
string cid = 2; Token token = 3;
// Macroon is the public token to authenticate the operation.
bytes macron = 3;
} }
// MsgSyncVaultResponse is the response type for the SyncVault RPC. // MsgSyncVaultResponse is the response type for the SyncVault RPC.
@ -115,45 +122,90 @@ message MsgSyncVaultResponse {
// MsgRegisterController is the message type for the InitializeController RPC. // MsgRegisterController is the message type for the InitializeController RPC.
message MsgRegisterController { message MsgRegisterController {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Assertions is the list of assertions to initialize the controller with.
string cid = 2;
// Keyshares is the list of keyshares to initialize the controller with.
repeated bytes keyshares = 3;
// Verifications is the list of verifications to initialize the controller with.
repeated bytes verifications = 4;
}
// MsgRegisterControllerResponse is the response type for the InitializeController RPC.
message MsgRegisterControllerResponse {
// Controller is the address of the initialized controller.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Accounts are a Address Map and Supported coin Denoms for the controller
map<string, string> accounts = 2;
}
// MsgRegisterService is the message type for the RegisterService RPC.
message MsgRegisterService {
option (cosmos.msg.v1.signer) = "authority"; option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account. // authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Assertions is the list of assertions to initialize the controller with.
string cid = 2;
// Origin is the origin of the request in wildcard form.
string origin = 3;
// Credential is the list of keyshares to initialize the controller with.
repeated Credential authentication = 4;
// token is the macron token to authenticate the operation.
Token token = 5;
}
// MsgRegisterControllerResponse is the response type for the InitializeController RPC.
message MsgRegisterControllerResponse {
// Success returns true if the specified cid is valid and not already encrypted.
bool success = 1;
// Controller is the address of the initialized controller.
string controller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Accounts are a Address Map and Supported coin Denoms for the controller
map<string, string> accounts = 3;
}
// MsgAuthorize is the message type for the Authorize RPC.
message MsgAuthorize {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Controller is the address of the controller to authenticate.
string controller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Address is the address to authenticate.
string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Origin is the origin of the request in wildcard form.
string origin = 4;
// token is the macron token to authenticate the operation.
Token token = 5;
}
// MsgAuthorizeResponse is the response type for the Authorize RPC.
message MsgAuthorizeResponse {
bool success = 1;
Token token = 2;
}
// MsgRegisterService is the message type for the RegisterService RPC.
message MsgRegisterService {
option (cosmos.msg.v1.signer) = "controller";
// authority is the address of the governance account.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// origin is the origin of the request in wildcard form. // origin is the origin of the request in wildcard form.
string origin_uri = 2; string origin_uri = 2;
// PermissionScope is the scope of the service. // Permissions is the scope of the service.
repeated PermissionScope scopes = 3; Permissions scopes = 3;
// Description is the description of the service
string description = 4;
// service_endpoints is the endpoints of the service
map<string, string> service_endpoints = 5;
// Metadata is optional additional information about the service
Metadata metadata = 6;
// token is the macron token to authenticate the operation.
Token token = 7;
} }
// MsgRegisterServiceResponse is the response type for the RegisterService RPC. // MsgRegisterServiceResponse is the response type for the RegisterService RPC.
message MsgRegisterServiceResponse { message MsgRegisterServiceResponse {
bool success = 1; bool success = 1;
string did = 2;
} }

View File

@ -1,6 +1,6 @@
syntax = "proto3"; syntax = "proto3";
package onsonr.hway.oracle.module.v1; package onsonr.sonr.oracle.module.v1;
import "cosmos/app/v1alpha1/module.proto"; import "cosmos/app/v1alpha1/module.proto";
@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto";
// Learn more: https://docs.cosmos.network/main/building-modules/depinject // Learn more: https://docs.cosmos.network/main/building-modules/depinject
message Module { message Module {
option (cosmos.app.v1alpha1.module) = { option (cosmos.app.v1alpha1.module) = {
go_import : "github.com/onsonr/hway" go_import : "github.com/onsonr/sonr"
}; };
} }

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package oracle.v1; package oracle.v1;
option go_package = "github.com/onsonr/hway/x/oracle/types"; option go_package = "github.com/onsonr/sonr/x/oracle/types";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";

View File

@ -2,6 +2,6 @@ syntax = "proto3";
package oracle.v1; package oracle.v1;
option go_package = "github.com/onsonr/hway/x/oracle/types"; option go_package = "github.com/onsonr/sonr/x/oracle/types";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";

View File

@ -2,6 +2,6 @@ syntax = "proto3";
package oracle.v1; package oracle.v1;
option go_package = "github.com/onsonr/hway/x/oracle/types"; option go_package = "github.com/onsonr/sonr/x/oracle/types";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";

View File

@ -2,7 +2,7 @@
set -e set -e
GO_MOD_PACKAGE="github.com/onsonr/hway" GO_MOD_PACKAGE="github.com/onsonr/sonr"
echo "Generating gogo proto code" echo "Generating gogo proto code"
cd proto cd proto

152
scripts/test_ics_node.sh Normal file
View File

@ -0,0 +1,152 @@
#!/bin/bash
# Run this script to quickly install, setup, and run the current version of the network.
#
# Examples:
# CHAIN_ID="localchain-1" HOME_DIR="~/.simapp" BLOCK_TIME="1000ms" CLEAN=true sh scripts/test_ics_node.sh
# CHAIN_ID="localchain-2" HOME_DIR="~/.simapp" CLEAN=true RPC=36657 REST=2317 PROFF=6061 P2P=36656 GRPC=8090 GRPC_WEB=8091 ROSETTA=8081 BLOCK_TIME="500ms" sh scripts/test_ics_node.sh
set -eu
export KEY="acc0"
export KEY2="acc1"
export CHAIN_ID=${CHAIN_ID:-"localchain-1"}
export MONIKER="localvalidator"
export KEYALGO="secp256k1"
export KEYRING=${KEYRING:-"test"}
export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.simapp"}")
export BINARY=${BINARY:-wasmd}
export DENOM=${DENOM:-token}
export CLEAN=${CLEAN:-"false"}
export RPC=${RPC:-"26657"}
export REST=${REST:-"1317"}
export PROFF=${PROFF:-"6060"}
export P2P=${P2P:-"26656"}
export GRPC=${GRPC:-"9090"}
export GRPC_WEB=${GRPC_WEB:-"9091"}
export ROSETTA=${ROSETTA:-"8080"}
export BLOCK_TIME=${BLOCK_TIME:-"5s"}
config_toml="${HOME_DIR}/config/config.toml"
client_toml="${HOME_DIR}/config/client.toml"
app_toml="${HOME_DIR}/config/app.toml"
genesis_json="${HOME_DIR}/config/genesis.json"
# if which binary does not exist, install it
if [ -z $(which $BINARY) ]; then
make install
if [ -z $(which $BINARY) ]; then
echo "Ensure $BINARY is installed and in your PATH"
exit 1
fi
fi
command -v $BINARY >/dev/null 2>&1 || {
echo >&2 "$BINARY command not found. Ensure this is setup / properly installed in your GOPATH (make install)."
exit 1
}
command -v jq >/dev/null 2>&1 || {
echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"
exit 1
}
set_config() {
$BINARY config set client chain-id $CHAIN_ID
$BINARY config set client keyring-backend $KEYRING
}
set_config
from_scratch() {
# Fresh install on current branch
make install
# remove existing daemon files.
if [ ${#HOME_DIR} -le 2 ]; then
echo "HOME_DIR must be more than 2 characters long"
return
fi
rm -rf $HOME_DIR && echo "Removed $HOME_DIR"
# reset values if not set already after whipe
set_config
add_key() {
key=$1
mnemonic=$2
echo $mnemonic | $BINARY keys add $key --home $HOME_DIR --keyring-backend $KEYRING --algo $KEYALGO --recover
}
# cosmos1efd63aw40lxf3n4mhf7dzhjkr453axur6cpk92
add_key $KEY "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
# cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr
add_key $KEY2 "wealth flavor believe regret funny network recall kiss grape useless pepper cram hint member few certain unveil rather brick bargain curious require crowd raise"
$BINARY init $CHAIN_ID --chain-id $CHAIN_ID --overwrite --default-denom $DENOM --home $HOME_DIR
update_test_genesis() {
cat $HOME_DIR/config/genesis.json | jq "$1" >$HOME_DIR/config/tmp_genesis.json && mv $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json
}
# === CORE MODULES ===
# block
update_test_genesis '.consensus_params["block"]["max_gas"]="100000000"'
# crisis
update_test_genesis $(printf '.app_state["crisis"]["constant_fee"]={"denom":"%s","amount":"1000"}' $DENOM)
# === CUSTOM MODULES ===
# tokenfactory
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]'
update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=100000'
$BINARY keys list --keyring-backend $KEYRING --home $HOME_DIR
# Allocate genesis accounts
$BINARY genesis add-genesis-account $KEY 10000000$DENOM,900test --keyring-backend $KEYRING --home $HOME_DIR --append
$BINARY genesis add-genesis-account $KEY2 10000000$DENOM,800test --keyring-backend $KEYRING --home $HOME_DIR --append
# ICS provider genesis hack
HACK_DIR=icshack-1 && echo $HACK_DIR
rm -rf $HACK_DIR
cp -r ${HOME_DIR} $HACK_DIR
$BINARY add-consumer-section provider --home $HACK_DIR
ccvjson=$(jq '.app_state["ccvconsumer"]' $HACK_DIR/config/genesis.json)
echo $ccvjson
jq '.app_state["ccvconsumer"] = '"$ccvjson" ${HACK_DIR}/config/genesis.json >json.tmp && mv json.tmp $genesis_json
rm -rf $HACK_DIR
update_test_genesis $(printf '.app_state["ccvconsumer"]["params"]["unbonding_period"]="%s"' "240s")
}
# check if CLEAN is not set to false
if [ "$CLEAN" != "false" ]; then
echo "Starting from a clean state"
from_scratch
fi
# Opens the RPC endpoint to outside connections
sed -i -e 's/laddr = "tcp:\/\/127.0.0.1:26657"/c\laddr = "tcp:\/\/0.0.0.0:'$RPC'"/g' $HOME_DIR/config/config.toml
sed -i -e 's/cors_allowed_origins = \[\]/cors_allowed_origins = \["\*"\]/g' $HOME_DIR/config/config.toml
# REST endpoint
sed -i -e 's/address = "tcp:\/\/localhost:1317"/address = "tcp:\/\/0.0.0.0:'$REST'"/g' $HOME_DIR/config/app.toml
sed -i -e 's/enable = false/enable = true/g' $HOME_DIR/config/app.toml
# peer exchange
sed -i -e 's/pprof_laddr = "localhost:6060"/pprof_laddr = "localhost:'$PROFF'"/g' $HOME_DIR/config/config.toml
sed -i -e 's/laddr = "tcp:\/\/0.0.0.0:26656"/laddr = "tcp:\/\/0.0.0.0:'$P2P'"/g' $HOME_DIR/config/config.toml
# GRPC
sed -i -e 's/address = "localhost:9090"/address = "0.0.0.0:'$GRPC'"/g' $HOME_DIR/config/app.toml
sed -i -e 's/address = "localhost:9091"/address = "0.0.0.0:'$GRPC_WEB'"/g' $HOME_DIR/config/app.toml
# Rosetta Api
sed -i -e 's/address = ":8080"/address = "0.0.0.0:'$ROSETTA'"/g' $HOME_DIR/config/app.toml
# Faster blocks
sed -i -e 's/timeout_commit = "5s"/timeout_commit = "'$BLOCK_TIME'"/g' $HOME_DIR/config/config.toml
# Start the daemon in the background
$BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" --home $HOME_DIR

View File

@ -8,15 +8,15 @@
export KEY="user1" export KEY="user1"
export KEY2="user2" export KEY2="user2"
export CHAIN_ID=${CHAIN_ID:-"local-1"} export CHAIN_ID=${CHAIN_ID:-"sonr-testnet-1"}
export MONIKER="localvalidator" export MONIKER="florence"
export KEYALGO="secp256k1" export KEYALGO="secp256k1"
export KEYRING=${KEYRING:-"test"} export KEYRING=${KEYRING:-"test"}
export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.core"}") export HOME_DIR=$(eval echo "${HOME_DIR:-"~/.sonr"}")
export BINARY=${BINARY:-sonrd} export BINARY=${BINARY:-sonrd}
export DENOM=${DENOM:-usnr} export DENOM=${DENOM:-usnr}
export CLEAN=${CLEAN:-"false"} export CLEAN=${CLEAN:-"true"}
export RPC=${RPC:-"26657"} export RPC=${RPC:-"26657"}
export REST=${REST:-"1317"} export REST=${REST:-"1317"}
export PROFF=${PROFF:-"6060"} export PROFF=${PROFF:-"6060"}
@ -106,8 +106,8 @@ from_scratch () {
update_test_genesis '.app_state["poa"]["params"]["admins"]=["idx10d07y265gmmuvt4z0w9aw880jnsr700j9kqcfa"]' update_test_genesis '.app_state["poa"]["params"]["admins"]=["idx10d07y265gmmuvt4z0w9aw880jnsr700j9kqcfa"]'
# Allocate genesis accounts # Allocate genesis accounts
BINARY genesis add-genesis-account $KEY 10000000$DENOM,900test --keyring-backend $KEYRING BINARY genesis add-genesis-account $KEY 10000000$DENOM,900snr --keyring-backend $KEYRING
BINARY genesis add-genesis-account $KEY2 10000000$DENOM,800test --keyring-backend $KEYRING BINARY genesis add-genesis-account $KEY2 10000000$DENOM,800snr --keyring-backend $KEYRING
# Sign genesis transaction # Sign genesis transaction
BINARY genesis gentx $KEY 1000000$DENOM --keyring-backend $KEYRING --chain-id $CHAIN_ID BINARY genesis gentx $KEY 1000000$DENOM --keyring-backend $KEYRING --chain-id $CHAIN_ID

View File

@ -3,7 +3,7 @@ package module
import ( import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
modulev1 "github.com/onsonr/hway/api/did/v1" modulev1 "github.com/onsonr/sonr/api/did/v1"
) )
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.

View File

@ -17,8 +17,8 @@ import (
"cosmossdk.io/depinject" "cosmossdk.io/depinject"
"cosmossdk.io/log" "cosmossdk.io/log"
modulev1 "github.com/onsonr/hway/api/did/module/v1" modulev1 "github.com/onsonr/sonr/api/did/module/v1"
"github.com/onsonr/hway/x/did/keeper" "github.com/onsonr/sonr/x/did/keeper"
) )
var _ appmodule.AppModule = AppModule{} var _ appmodule.AppModule = AppModule{}

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"cosmossdk.io/log" "cosmossdk.io/log"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
) )
// Logger returns the logger // Logger returns the logger

View File

@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
) )
func TestGenesis(t *testing.T) { func TestGenesis(t *testing.T) {
@ -20,7 +20,6 @@ func TestGenesis(t *testing.T) {
err := f.k.InitGenesis(f.ctx, genesisState) err := f.k.InitGenesis(f.ctx, genesisState)
require.NoError(t, err) require.NoError(t, err)
got := f.k.ExportGenesis(f.ctx) got := f.k.ExportGenesis(f.ctx)
require.NotNil(t, got) require.NotNil(t, got)

View File

@ -10,8 +10,8 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
apiv1 "github.com/onsonr/hway/api/did/v1" apiv1 "github.com/onsonr/sonr/api/did/v1"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
) )
// Keeper defines the middleware keeper. // Keeper defines the middleware keeper.

View File

@ -26,9 +26,9 @@ import (
"cosmossdk.io/core/store" "cosmossdk.io/core/store"
module "github.com/onsonr/hway/x/did" module "github.com/onsonr/sonr/x/did"
"github.com/onsonr/hway/x/did/keeper" "github.com/onsonr/sonr/x/did/keeper"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
"github.com/strangelove-ventures/poa" "github.com/strangelove-ventures/poa"
) )

View File

@ -5,8 +5,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
// "github.com/onsonr/hway/internal/local" // "github.com/onsonr/sonr/internal/local"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
) )
var _ types.QueryServer = Querier{} var _ types.QueryServer = Querier{}
@ -20,7 +20,7 @@ func NewQuerier(keeper Keeper) Querier {
} }
// Params returns the total set of did parameters. // Params returns the total set of did parameters.
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { func (k Querier) Params(c context.Context, req *types.QueryRequest) (*types.QueryParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(c) ctx := sdk.UnwrapSDKContext(c)
p, err := k.Keeper.Params.Get(ctx) p, err := k.Keeper.Params.Get(ctx)
@ -32,31 +32,31 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type
} }
// Accounts implements types.QueryServer. // Accounts implements types.QueryServer.
func (k Querier) Accounts(goCtx context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) { func (k Querier) Accounts(goCtx context.Context, req *types.QueryRequest) (*types.QueryAccountsResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryAccountsResponse{}, nil return &types.QueryAccountsResponse{}, nil
} }
// Credentials implements types.QueryServer. // Credentials implements types.QueryServer.
func (k Querier) Credentials(goCtx context.Context, req *types.QueryCredentialsRequest) (*types.QueryCredentialsResponse, error) { func (k Querier) Credentials(goCtx context.Context, req *types.QueryRequest) (*types.QueryCredentialsResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryCredentialsResponse{}, nil return &types.QueryCredentialsResponse{}, nil
} }
// Identities implements types.QueryServer.
func (k Querier) Identities(goCtx context.Context, req *types.QueryIdentitiesRequest) (*types.QueryIdentitiesResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryIdentitiesResponse{}, nil
}
// Resolve implements types.QueryServer. // Resolve implements types.QueryServer.
func (k Querier) Resolve(goCtx context.Context, req *types.QueryResolveRequest) (*types.QueryResolveResponse, error) { func (k Querier) Resolve(goCtx context.Context, req *types.QueryRequest) (*types.QueryResolveResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryResolveResponse{}, nil return &types.QueryResolveResponse{}, nil
} }
// Service implements types.QueryServer. // Service implements types.QueryServer.
func (k Querier) Service(goCtx context.Context, req *types.QueryServiceRequest) (*types.QueryServiceResponse, error) { func (k Querier) Service(goCtx context.Context, req *types.QueryRequest) (*types.QueryServiceResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryServiceResponse{}, nil return &types.QueryServiceResponse{}, nil
} }
// Token implements types.QueryServer.
func (k Querier) Token(goCtx context.Context, req *types.QueryRequest) (*types.QueryTokenResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryTokenResponse{}, nil
}

View File

@ -7,8 +7,9 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"cosmossdk.io/errors" "cosmossdk.io/errors"
didv1 "github.com/onsonr/hway/api/did/v1" didv1 "github.com/onsonr/sonr/api/did/v1"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/internal/files"
"github.com/onsonr/sonr/x/did/types"
) )
type msgServer struct { type msgServer struct {
@ -31,13 +32,23 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams
return nil, ms.k.Params.Set(ctx, msg.Params) return nil, ms.k.Params.Set(ctx, msg.Params)
} }
// Authenticate implements types.MsgServer. // Authorize implements types.MsgServer.
func (ms msgServer) Authenticate(ctx context.Context, msg *types.MsgAuthenticate) (*types.MsgAuthenticateResponse, error) { func (ms msgServer) Authorize(ctx context.Context, msg *types.MsgAuthorize) (*types.MsgAuthorizeResponse, error) {
if ms.k.authority != msg.Authority { if ms.k.authority != msg.Authority {
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
} }
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
return &types.MsgAuthenticateResponse{}, nil return &types.MsgAuthorizeResponse{}, nil
}
// AllocateVault implements types.MsgServer.
func (ms msgServer) AllocateVault(goCtx context.Context, msg *types.MsgAllocateVault) (*types.MsgAllocateVaultResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
err := files.Assemble("/tmp/sonr-testnet-1/vaults/0")
if err != nil {
return nil, err
}
return &types.MsgAllocateVaultResponse{}, nil
} }
// RegisterController implements types.MsgServer. // RegisterController implements types.MsgServer.
@ -46,26 +57,25 @@ func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegi
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
} }
ctx := sdk.UnwrapSDKContext(goCtx) ctx := sdk.UnwrapSDKContext(goCtx)
svc := didv1.Service{ svc := didv1.ServiceRecord{
ControllerDid: msg.Authority, Controller: msg.Authority,
} }
ms.k.OrmDB.ServiceTable().Insert(ctx, &svc) ms.k.OrmDB.ServiceRecordTable().Insert(ctx, &svc)
return &types.MsgRegisterControllerResponse{}, nil return &types.MsgRegisterControllerResponse{}, nil
} }
// RegisterService implements types.MsgServer. // RegisterService implements types.MsgServer.
func (ms msgServer) RegisterService(ctx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) { func (ms msgServer) RegisterService(ctx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) {
if ms.k.authority != msg.Authority { if ms.k.authority != msg.Controller {
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority) return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Controller)
} }
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.MsgRegisterServiceResponse{}, nil
}
// ProveWitness implements types.MsgServer.
func (ms msgServer) ProveWitness(ctx context.Context, msg *types.MsgProveWitness) (*types.MsgProveWitnessResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
return &types.MsgProveWitnessResponse{}, nil svc := didv1.ServiceRecord{
Controller: msg.Controller,
}
ms.k.OrmDB.ServiceRecordTable().Insert(ctx, &svc)
return &types.MsgRegisterServiceResponse{}, nil
} }
// SyncVault implements types.MsgServer. // SyncVault implements types.MsgServer.

View File

@ -1,55 +0,0 @@
package keeper_test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/onsonr/hway/x/did/types"
)
func TestParams(t *testing.T) {
f := SetupTest(t)
require := require.New(t)
testCases := []struct {
name string
request *types.MsgUpdateParams
err bool
}{
{
name: "fail; invalid authority",
request: &types.MsgUpdateParams{
Authority: f.addrs[0].String(),
Params: types.DefaultParams(),
},
err: true,
},
{
name: "success",
request: &types.MsgUpdateParams{
Authority: f.govModAddr,
Params: types.DefaultParams(),
},
err: false,
},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
_, err := f.msgServer.UpdateParams(f.ctx, tc.request)
if tc.err {
require.Error(err)
} else {
require.NoError(err)
r, err := f.queryServer.Params(f.ctx, &types.QueryParamsRequest{})
require.NoError(err)
require.EqualValues(&tc.request.Params, r.Params)
}
})
}
}

View File

@ -1,9 +1,13 @@
package keeper package keeper
func (k Keeper) insertAliasFromDisplayName() { import (
} didv1 "github.com/onsonr/sonr/api/did/v1"
"github.com/onsonr/sonr/x/did/types"
func (k Keeper) insertAssertionFromIdentity() { sdk "github.com/cosmos/cosmos-sdk/types"
)
func (k Keeper) convertProfileToVerification() {
} }
func (k Keeper) insertAuthenticationFromCredential() { func (k Keeper) insertAuthenticationFromCredential() {
@ -12,5 +16,22 @@ func (k Keeper) insertAuthenticationFromCredential() {
func (k Keeper) insertControllerFromMotrVault() { func (k Keeper) insertControllerFromMotrVault() {
} }
func (k Keeper) insertDelegationFromAccount() { func (k Keeper) insertDelegationFromAccount(ctx sdk.Context, address string, label string) (*didv1.Delegation, error) {
del, err := k.OrmDB.DelegationTable().GetByControllerAccountLabel(ctx, address, label)
if err != nil {
return nil, err
}
return del, nil
}
func (k Keeper) insertServiceRecord(ctx sdk.Context, msg *types.MsgRegisterService) error {
record, err := msg.ExtractServiceRecord()
if err != nil {
return err
}
err = k.OrmDB.ServiceRecordTable().Insert(ctx, record)
if err != nil {
return err
}
return nil
} }

14
x/did/keeper/validate.go Normal file
View File

@ -0,0 +1,14 @@
package keeper
import sdk "github.com/cosmos/cosmos-sdk/types"
func (k Keeper) ValidServiceOrigin(ctx sdk.Context, origin string) bool {
rec, err := k.OrmDB.ServiceRecordTable().GetByOriginUri(ctx, origin)
if err != nil {
return false
}
if rec == nil {
return false
}
return true
}

View File

@ -18,8 +18,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/module"
"github.com/onsonr/hway/x/did/keeper" "github.com/onsonr/sonr/x/did/keeper"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
// this line is used by starport scaffolding # 1 // this line is used by starport scaffolding # 1
) )

View File

@ -176,7 +176,7 @@ func init() {
func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) } func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) }
var fileDescriptor_2125a09fb14c3bc3 = []byte{ var fileDescriptor_2125a09fb14c3bc3 = []byte{
// 148 bytes of a gzipped FileDescriptorProto // 145 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1,
0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x54, 0xe2, 0xe1, 0xe2, 0x72, 0x2a, 0x49, 0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x54, 0xe2, 0xe1, 0xe2, 0x72, 0x2a, 0x49,
@ -184,9 +184,9 @@ var fileDescriptor_2125a09fb14c3bc3 = []byte{
0x5e, 0x11, 0x94, 0xe7, 0x64, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0x5e, 0x11, 0x94, 0xe7, 0x64, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e,
0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51,
0x4a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9, 0x4a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9,
0x79, 0x45, 0xfa, 0x19, 0xe5, 0x89, 0x95, 0xfa, 0x15, 0xfa, 0x20, 0x97, 0x94, 0x54, 0x16, 0xa4, 0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0xe4, 0x92, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36,
0x16, 0x27, 0xb1, 0x81, 0x1d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x96, 0xc2, 0x4c, 0x7c, 0xb0, 0x23, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x82, 0x7e, 0x89, 0x0a, 0x9d, 0x00, 0x00,
0x9d, 0x00, 0x00, 0x00, 0x00,
} }
func (m *BtcAccount) Marshal() (dAtA []byte, err error) { func (m *BtcAccount) Marshal() (dAtA []byte, err error) {

View File

@ -4,6 +4,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice" "github.com/cosmos/cosmos-sdk/types/msgservice"
// this line is used by starport scaffolding # 1 // this line is used by starport scaffolding # 1
@ -26,16 +27,17 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
} }
func RegisterInterfaces(registry types.InterfaceRegistry) { func RegisterInterfaces(registry types.InterfaceRegistry) {
//registry.RegisterImplementations( registry.RegisterImplementations(
//(*cryptotypes.PubKey)(nil), (*cryptotypes.PubKey)(nil),
// &PublicKey{}, &PubKey{},
//) )
registry.RegisterImplementations( registry.RegisterImplementations(
(*sdk.Msg)(nil), (*sdk.Msg)(nil),
&MsgUpdateParams{}, &MsgUpdateParams{},
&MsgRegisterController{}, &MsgRegisterController{},
&MsgRegisterService{}, &MsgRegisterService{},
&MsgAllocateVault{},
) )
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
} }

445
x/did/types/constants.pb.go Normal file
View File

@ -0,0 +1,445 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: did/v1/constants.proto
package types
import (
fmt "fmt"
proto "github.com/cosmos/gogoproto/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
type AssetType int32
const (
AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0
AssetType_ASSET_TYPE_NATIVE AssetType = 1
AssetType_ASSET_TYPE_WRAPPED AssetType = 2
AssetType_ASSET_TYPE_STAKING AssetType = 3
AssetType_ASSET_TYPE_POOL AssetType = 4
AssetType_ASSET_TYPE_IBC AssetType = 5
AssetType_ASSET_TYPE_CW20 AssetType = 6
)
var AssetType_name = map[int32]string{
0: "ASSET_TYPE_UNSPECIFIED",
1: "ASSET_TYPE_NATIVE",
2: "ASSET_TYPE_WRAPPED",
3: "ASSET_TYPE_STAKING",
4: "ASSET_TYPE_POOL",
5: "ASSET_TYPE_IBC",
6: "ASSET_TYPE_CW20",
}
var AssetType_value = map[string]int32{
"ASSET_TYPE_UNSPECIFIED": 0,
"ASSET_TYPE_NATIVE": 1,
"ASSET_TYPE_WRAPPED": 2,
"ASSET_TYPE_STAKING": 3,
"ASSET_TYPE_POOL": 4,
"ASSET_TYPE_IBC": 5,
"ASSET_TYPE_CW20": 6,
}
func (x AssetType) String() string {
return proto.EnumName(AssetType_name, int32(x))
}
func (AssetType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{0}
}
// DIDNamespace define the different namespaces of DID
type DIDNamespace int32
const (
DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0
DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1
DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2
DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3
DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4
DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5
DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6
DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7
DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8
)
var DIDNamespace_name = map[int32]string{
0: "DID_NAMESPACE_UNSPECIFIED",
1: "DID_NAMESPACE_IPFS",
2: "DID_NAMESPACE_SONR",
3: "DID_NAMESPACE_BITCOIN",
4: "DID_NAMESPACE_ETHEREUM",
5: "DID_NAMESPACE_IBC",
6: "DID_NAMESPACE_WEBAUTHN",
7: "DID_NAMESPACE_DWN",
8: "DID_NAMESPACE_SERVICE",
}
var DIDNamespace_value = map[string]int32{
"DID_NAMESPACE_UNSPECIFIED": 0,
"DID_NAMESPACE_IPFS": 1,
"DID_NAMESPACE_SONR": 2,
"DID_NAMESPACE_BITCOIN": 3,
"DID_NAMESPACE_ETHEREUM": 4,
"DID_NAMESPACE_IBC": 5,
"DID_NAMESPACE_WEBAUTHN": 6,
"DID_NAMESPACE_DWN": 7,
"DID_NAMESPACE_SERVICE": 8,
}
func (x DIDNamespace) String() string {
return proto.EnumName(DIDNamespace_name, int32(x))
}
func (DIDNamespace) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{1}
}
// KeyAlgorithm defines the key algorithm
type KeyAlgorithm int32
const (
KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0
KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1
KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2
KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3
KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4
KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5
KeyAlgorithm_KEY_ALGORITHM_BLS12377 KeyAlgorithm = 6
KeyAlgorithm_KEY_ALGORITHM_KECCAK256 KeyAlgorithm = 7
)
var KeyAlgorithm_name = map[int32]string{
0: "KEY_ALGORITHM_UNSPECIFIED",
1: "KEY_ALGORITHM_ES256",
2: "KEY_ALGORITHM_ES384",
3: "KEY_ALGORITHM_ES512",
4: "KEY_ALGORITHM_EDDSA",
5: "KEY_ALGORITHM_ES256K",
6: "KEY_ALGORITHM_BLS12377",
7: "KEY_ALGORITHM_KECCAK256",
}
var KeyAlgorithm_value = map[string]int32{
"KEY_ALGORITHM_UNSPECIFIED": 0,
"KEY_ALGORITHM_ES256": 1,
"KEY_ALGORITHM_ES384": 2,
"KEY_ALGORITHM_ES512": 3,
"KEY_ALGORITHM_EDDSA": 4,
"KEY_ALGORITHM_ES256K": 5,
"KEY_ALGORITHM_BLS12377": 6,
"KEY_ALGORITHM_KECCAK256": 7,
}
func (x KeyAlgorithm) String() string {
return proto.EnumName(KeyAlgorithm_name, int32(x))
}
func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{2}
}
// KeyCurve defines the key curve
type KeyCurve int32
const (
KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0
KeyCurve_KEY_CURVE_P256 KeyCurve = 1
KeyCurve_KEY_CURVE_P384 KeyCurve = 2
KeyCurve_KEY_CURVE_P521 KeyCurve = 3
KeyCurve_KEY_CURVE_X25519 KeyCurve = 4
KeyCurve_KEY_CURVE_X448 KeyCurve = 5
KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6
KeyCurve_KEY_CURVE_ED448 KeyCurve = 7
KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8
)
var KeyCurve_name = map[int32]string{
0: "KEY_CURVE_UNSPECIFIED",
1: "KEY_CURVE_P256",
2: "KEY_CURVE_P384",
3: "KEY_CURVE_P521",
4: "KEY_CURVE_X25519",
5: "KEY_CURVE_X448",
6: "KEY_CURVE_ED25519",
7: "KEY_CURVE_ED448",
8: "KEY_CURVE_SECP256K1",
}
var KeyCurve_value = map[string]int32{
"KEY_CURVE_UNSPECIFIED": 0,
"KEY_CURVE_P256": 1,
"KEY_CURVE_P384": 2,
"KEY_CURVE_P521": 3,
"KEY_CURVE_X25519": 4,
"KEY_CURVE_X448": 5,
"KEY_CURVE_ED25519": 6,
"KEY_CURVE_ED448": 7,
"KEY_CURVE_SECP256K1": 8,
}
func (x KeyCurve) String() string {
return proto.EnumName(KeyCurve_name, int32(x))
}
func (KeyCurve) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{3}
}
// KeyEncoding defines the key encoding
type KeyEncoding int32
const (
KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0
KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1
KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2
KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3
KeyEncoding_KEY_ENCODING_JWK KeyEncoding = 4
)
var KeyEncoding_name = map[int32]string{
0: "KEY_ENCODING_UNSPECIFIED",
1: "KEY_ENCODING_RAW",
2: "KEY_ENCODING_HEX",
3: "KEY_ENCODING_MULTIBASE",
4: "KEY_ENCODING_JWK",
}
var KeyEncoding_value = map[string]int32{
"KEY_ENCODING_UNSPECIFIED": 0,
"KEY_ENCODING_RAW": 1,
"KEY_ENCODING_HEX": 2,
"KEY_ENCODING_MULTIBASE": 3,
"KEY_ENCODING_JWK": 4,
}
func (x KeyEncoding) String() string {
return proto.EnumName(KeyEncoding_name, int32(x))
}
func (KeyEncoding) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{4}
}
// KeyRole defines the kind of key
type KeyRole int32
const (
KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0
// Blockchain key types
KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1
KeyRole_KEY_ROLE_ASSERTION KeyRole = 2
KeyRole_KEY_ROLE_DELEGATION KeyRole = 3
KeyRole_KEY_ROLE_INVOCATION KeyRole = 4
)
var KeyRole_name = map[int32]string{
0: "KEY_ROLE_UNSPECIFIED",
1: "KEY_ROLE_AUTHENTICATION",
2: "KEY_ROLE_ASSERTION",
3: "KEY_ROLE_DELEGATION",
4: "KEY_ROLE_INVOCATION",
}
var KeyRole_value = map[string]int32{
"KEY_ROLE_UNSPECIFIED": 0,
"KEY_ROLE_AUTHENTICATION": 1,
"KEY_ROLE_ASSERTION": 2,
"KEY_ROLE_DELEGATION": 3,
"KEY_ROLE_INVOCATION": 4,
}
func (x KeyRole) String() string {
return proto.EnumName(KeyRole_name, int32(x))
}
func (KeyRole) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{5}
}
// KeyType defines the key type
type KeyType int32
const (
KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0
KeyType_KEY_TYPE_OCTET KeyType = 1
KeyType_KEY_TYPE_ELLIPTIC KeyType = 2
KeyType_KEY_TYPE_RSA KeyType = 3
KeyType_KEY_TYPE_SYMMETRIC KeyType = 4
KeyType_KEY_TYPE_HMAC KeyType = 5
)
var KeyType_name = map[int32]string{
0: "KEY_TYPE_UNSPECIFIED",
1: "KEY_TYPE_OCTET",
2: "KEY_TYPE_ELLIPTIC",
3: "KEY_TYPE_RSA",
4: "KEY_TYPE_SYMMETRIC",
5: "KEY_TYPE_HMAC",
}
var KeyType_value = map[string]int32{
"KEY_TYPE_UNSPECIFIED": 0,
"KEY_TYPE_OCTET": 1,
"KEY_TYPE_ELLIPTIC": 2,
"KEY_TYPE_RSA": 3,
"KEY_TYPE_SYMMETRIC": 4,
"KEY_TYPE_HMAC": 5,
}
func (x KeyType) String() string {
return proto.EnumName(KeyType_name, int32(x))
}
func (KeyType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{6}
}
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_RECORDS_READ PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_RECORDS_WRITE PermissionScope = 3
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5
PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6
PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7
PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8
PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11
PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12
PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13
)
var PermissionScope_name = map[int32]string{
0: "PERMISSION_SCOPE_UNSPECIFIED",
1: "PERMISSION_SCOPE_BASIC_INFO",
2: "PERMISSION_SCOPE_RECORDS_READ",
3: "PERMISSION_SCOPE_RECORDS_WRITE",
4: "PERMISSION_SCOPE_TRANSACTIONS_READ",
5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE",
6: "PERMISSION_SCOPE_WALLETS_READ",
7: "PERMISSION_SCOPE_WALLETS_CREATE",
8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE",
9: "PERMISSION_SCOPE_WALLETS_UPDATE",
10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY",
11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST",
12: "PERMISSION_SCOPE_ADMIN_USER",
13: "PERMISSION_SCOPE_ADMIN_VALIDATOR",
}
var PermissionScope_value = map[string]int32{
"PERMISSION_SCOPE_UNSPECIFIED": 0,
"PERMISSION_SCOPE_BASIC_INFO": 1,
"PERMISSION_SCOPE_RECORDS_READ": 2,
"PERMISSION_SCOPE_RECORDS_WRITE": 3,
"PERMISSION_SCOPE_TRANSACTIONS_READ": 4,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5,
"PERMISSION_SCOPE_WALLETS_READ": 6,
"PERMISSION_SCOPE_WALLETS_CREATE": 7,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8,
"PERMISSION_SCOPE_WALLETS_UPDATE": 9,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11,
"PERMISSION_SCOPE_ADMIN_USER": 12,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": 13,
}
func (x PermissionScope) String() string {
return proto.EnumName(PermissionScope_name, int32(x))
}
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_7cc61ab03a01b9c8, []int{7}
}
func init() {
proto.RegisterEnum("did.v1.AssetType", AssetType_name, AssetType_value)
proto.RegisterEnum("did.v1.DIDNamespace", DIDNamespace_name, DIDNamespace_value)
proto.RegisterEnum("did.v1.KeyAlgorithm", KeyAlgorithm_name, KeyAlgorithm_value)
proto.RegisterEnum("did.v1.KeyCurve", KeyCurve_name, KeyCurve_value)
proto.RegisterEnum("did.v1.KeyEncoding", KeyEncoding_name, KeyEncoding_value)
proto.RegisterEnum("did.v1.KeyRole", KeyRole_name, KeyRole_value)
proto.RegisterEnum("did.v1.KeyType", KeyType_name, KeyType_value)
proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value)
}
func init() { proto.RegisterFile("did/v1/constants.proto", fileDescriptor_7cc61ab03a01b9c8) }
var fileDescriptor_7cc61ab03a01b9c8 = []byte{
// 902 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x95, 0xdf, 0x72, 0xda, 0x46,
0x14, 0xc6, 0x2d, 0x83, 0xb1, 0xb3, 0x71, 0x92, 0x93, 0x4d, 0xe2, 0x24, 0x4d, 0x42, 0xd2, 0x24,
0xd3, 0x74, 0xe8, 0x8c, 0x29, 0xd8, 0x34, 0xe9, 0x4c, 0x6f, 0x56, 0xab, 0x63, 0xb3, 0x95, 0x90,
0x34, 0xbb, 0x0b, 0xc4, 0xbd, 0x61, 0x1c, 0xd0, 0x38, 0xcc, 0xc4, 0x88, 0x01, 0xe2, 0x29, 0x8f,
0xd0, 0xf6, 0xa6, 0x6f, 0xd0, 0x17, 0xe8, 0x83, 0xf4, 0xd2, 0x97, 0xbd, 0xec, 0xd8, 0x7d, 0x89,
0xde, 0x75, 0x84, 0xf8, 0x27, 0xc0, 0xbe, 0xe1, 0xe2, 0xf7, 0x7d, 0x3a, 0xfa, 0xce, 0x39, 0xcb,
0x8a, 0xec, 0xb4, 0xda, 0xad, 0xfc, 0x59, 0x21, 0xdf, 0x0c, 0x3b, 0xfd, 0xc1, 0x71, 0x67, 0xd0,
0xdf, 0xed, 0xf6, 0xc2, 0x41, 0x48, 0x33, 0xad, 0x76, 0x6b, 0xf7, 0xac, 0x90, 0xfb, 0xd3, 0x20,
0x37, 0x58, 0xbf, 0x1f, 0x0c, 0xf4, 0xb0, 0x1b, 0xd0, 0x2f, 0xc8, 0x0e, 0x53, 0x0a, 0x75, 0x43,
0x1f, 0xf9, 0xd8, 0xa8, 0xba, 0xca, 0x47, 0x2e, 0x0e, 0x04, 0x5a, 0xb0, 0x46, 0x1f, 0x90, 0xbb,
0x73, 0x9a, 0xcb, 0xb4, 0xa8, 0x21, 0x18, 0x74, 0x87, 0xd0, 0x39, 0x5c, 0x97, 0xcc, 0xf7, 0xd1,
0x82, 0xf5, 0x05, 0xae, 0x34, 0xb3, 0x85, 0x7b, 0x08, 0x29, 0x7a, 0x8f, 0xdc, 0x99, 0xe3, 0xbe,
0xe7, 0x39, 0x90, 0xa6, 0x94, 0xdc, 0x9e, 0x83, 0xc2, 0xe4, 0xb0, 0xb1, 0x60, 0xe4, 0xf5, 0xe2,
0xb7, 0x90, 0xc9, 0xfd, 0x67, 0x90, 0x6d, 0x4b, 0x58, 0xee, 0xf1, 0x69, 0xd0, 0xef, 0x1e, 0x37,
0x03, 0xfa, 0x8c, 0x3c, 0xb6, 0x84, 0xd5, 0x70, 0x59, 0x05, 0x95, 0xcf, 0xf8, 0x62, 0xe8, 0x1d,
0x42, 0x93, 0xb2, 0xf0, 0x0f, 0x54, 0x9c, 0x3a, 0xc9, 0x95, 0xe7, 0x4a, 0x58, 0xa7, 0x8f, 0xc9,
0x83, 0x24, 0x37, 0x85, 0xe6, 0x9e, 0x70, 0x21, 0x15, 0xcd, 0x26, 0x29, 0xa1, 0x2e, 0xa3, 0xc4,
0x6a, 0x05, 0xd2, 0xd1, 0x6c, 0x16, 0x5e, 0x33, 0x6a, 0x61, 0xe9, 0x91, 0x3a, 0x9a, 0xac, 0xaa,
0xcb, 0x2e, 0x64, 0x96, 0x1f, 0xb1, 0xea, 0x2e, 0x6c, 0x2e, 0x07, 0x50, 0x28, 0x6b, 0x82, 0x23,
0x6c, 0xe5, 0xfe, 0x35, 0xc8, 0xb6, 0x1d, 0x0c, 0xd9, 0xa7, 0x93, 0xb0, 0xd7, 0x1e, 0x7c, 0x3c,
0x8d, 0x7a, 0xb7, 0xf1, 0xa8, 0xc1, 0x9c, 0x43, 0x4f, 0x0a, 0x5d, 0xae, 0x2c, 0xf4, 0xfe, 0x90,
0xdc, 0x4b, 0xca, 0xa8, 0x8a, 0xa5, 0xef, 0xc0, 0x58, 0x25, 0xec, 0xbd, 0xdb, 0x87, 0xf5, 0x55,
0x42, 0xa9, 0x50, 0x84, 0xd4, 0x0a, 0xc1, 0xb2, 0x14, 0x83, 0x34, 0x7d, 0x44, 0xee, 0xaf, 0x78,
0x87, 0x1d, 0xf7, 0x9e, 0x54, 0x4c, 0x47, 0x15, 0x8a, 0x7b, 0x6f, 0xdf, 0x42, 0x86, 0x3e, 0x21,
0x0f, 0x93, 0x9a, 0x8d, 0x9c, 0x33, 0x3b, 0x4a, 0xb7, 0x99, 0x3b, 0x37, 0xc8, 0x96, 0x1d, 0x0c,
0xf9, 0xe7, 0xde, 0x59, 0x10, 0x8d, 0x23, 0x72, 0xf2, 0xaa, 0xac, 0x2d, 0xae, 0x96, 0x92, 0xdb,
0x33, 0xc9, 0x8f, 0x3b, 0x4b, 0xb2, 0xb8, 0xa9, 0x24, 0x2b, 0x15, 0x0b, 0x90, 0xa2, 0xf7, 0x09,
0xcc, 0xd8, 0xfb, 0x62, 0xa9, 0x54, 0xf8, 0x3e, 0x3e, 0x85, 0x73, 0x74, 0x7f, 0xff, 0x1d, 0x6c,
0x44, 0x6b, 0x9a, 0x31, 0xb4, 0x62, 0x6b, 0x26, 0x3a, 0x9c, 0xf3, 0x38, 0xf2, 0x6e, 0x4e, 0xa6,
0x14, 0x43, 0x85, 0x3c, 0x0a, 0x65, 0x17, 0x60, 0x2b, 0xf7, 0x8b, 0x41, 0x6e, 0xda, 0xc1, 0x10,
0x3b, 0xcd, 0xb0, 0xd5, 0xee, 0x9c, 0xd0, 0xa7, 0xe4, 0x51, 0x64, 0x44, 0x97, 0x7b, 0x96, 0x70,
0x0f, 0x17, 0x1a, 0x1b, 0x87, 0x9b, 0xaa, 0x92, 0xd5, 0xc1, 0x58, 0xa2, 0x65, 0x7c, 0x0f, 0xeb,
0x93, 0x29, 0x4f, 0x69, 0xa5, 0xea, 0x68, 0x61, 0x32, 0x85, 0xb3, 0x26, 0xa7, 0xda, 0x8f, 0x75,
0x1b, 0xd2, 0xb9, 0x5f, 0x0d, 0xb2, 0x69, 0x07, 0x43, 0x19, 0x7e, 0x0a, 0x26, 0xdb, 0x93, 0x9e,
0xb3, 0x38, 0xdc, 0xf1, 0x86, 0x46, 0x4a, 0x74, 0x62, 0xd1, 0xd5, 0x82, 0x33, 0x2d, 0x3c, 0x37,
0xfe, 0xf3, 0xcc, 0x44, 0xa5, 0x50, 0x8e, 0xf8, 0xf4, 0xf8, 0x8c, 0xb8, 0x85, 0x0e, 0x1e, 0xc6,
0x0f, 0xa4, 0x12, 0x82, 0x70, 0x6b, 0xde, 0xb8, 0x52, 0x3a, 0xf7, 0x5b, 0x1c, 0x66, 0x74, 0xf7,
0x8c, 0xc3, 0xac, 0xb8, 0x79, 0xc6, 0x7b, 0x19, 0x29, 0x1e, 0xd7, 0xa8, 0xc1, 0x98, 0xec, 0x65,
0xc4, 0xd0, 0x71, 0x84, 0xaf, 0x05, 0x87, 0x75, 0x0a, 0x64, 0x7b, 0x8a, 0xa5, 0x62, 0x90, 0x9a,
0x84, 0x8d, 0x6f, 0xa1, 0xa3, 0x4a, 0x05, 0xb5, 0x14, 0x1c, 0xd2, 0xf4, 0x2e, 0xb9, 0x35, 0xe5,
0xe5, 0x0a, 0xe3, 0xb0, 0x91, 0xfb, 0x23, 0x4d, 0xee, 0xf8, 0x41, 0xef, 0xb4, 0xdd, 0xef, 0xb7,
0xc3, 0x8e, 0x6a, 0x86, 0xdd, 0x80, 0xbe, 0x20, 0x4f, 0x7d, 0x94, 0x15, 0xa1, 0x94, 0xf0, 0xdc,
0x86, 0xe2, 0xde, 0x52, 0xba, 0xe7, 0xe4, 0xc9, 0x92, 0xc3, 0x64, 0x4a, 0xf0, 0x86, 0x70, 0x0f,
0x3c, 0x30, 0xe8, 0x97, 0xe4, 0xd9, 0x92, 0x41, 0x22, 0xf7, 0xa4, 0xa5, 0x1a, 0x12, 0x59, 0x74,
0x59, 0xbe, 0x24, 0xd9, 0x2b, 0x2d, 0x75, 0x29, 0x74, 0xb4, 0xce, 0xaf, 0xc8, 0xcb, 0x25, 0x8f,
0x96, 0xcc, 0x55, 0x8c, 0x47, 0xd3, 0x1c, 0xd7, 0x4a, 0xd3, 0x37, 0xe4, 0xd5, 0xf5, 0xbe, 0xb8,
0xe0, 0xc6, 0xca, 0x5c, 0x75, 0xe6, 0x38, 0xa8, 0xc7, 0xb5, 0x32, 0xf4, 0x15, 0x79, 0x7e, 0xa5,
0x85, 0x4b, 0x64, 0x1a, 0x61, 0x73, 0x65, 0xb0, 0x89, 0x49, 0x55, 0x4d, 0xc5, 0xa5, 0x30, 0x11,
0xb6, 0xae, 0x2d, 0x56, 0xf5, 0xad, 0xa8, 0xd8, 0x0d, 0xfa, 0x35, 0x79, 0x7d, 0x7d, 0xfa, 0x1a,
0x4a, 0x71, 0x70, 0x04, 0x84, 0x7e, 0x43, 0xde, 0x5c, 0xef, 0x34, 0xa5, 0xc7, 0x2c, 0xce, 0x94,
0x86, 0x9b, 0x2b, 0x97, 0xc4, 0xac, 0x8a, 0x70, 0x1b, 0x55, 0x85, 0x12, 0xb6, 0xe9, 0x6b, 0xf2,
0xe2, 0x0a, 0x43, 0x8d, 0x39, 0xc2, 0x62, 0xda, 0x93, 0x70, 0xcb, 0xfc, 0xe1, 0xaf, 0x8b, 0xac,
0x71, 0x7e, 0x91, 0x35, 0xfe, 0xb9, 0xc8, 0x1a, 0xbf, 0x5f, 0x66, 0xd7, 0xce, 0x2f, 0xb3, 0x6b,
0x7f, 0x5f, 0x66, 0xd7, 0x7e, 0x7a, 0x79, 0xd2, 0x1e, 0x7c, 0xfc, 0xfc, 0x61, 0xb7, 0x19, 0x9e,
0xe6, 0xc3, 0x4e, 0x3f, 0xec, 0xf4, 0xf2, 0xa3, 0x9f, 0x9f, 0xf3, 0xd1, 0x07, 0x78, 0x30, 0xec,
0x06, 0xfd, 0x0f, 0x99, 0xd1, 0xa7, 0x77, 0xef, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0x58,
0x91, 0x1e, 0x94, 0x07, 0x00, 0x00,
}

109
x/did/types/defaults.go Normal file
View File

@ -0,0 +1,109 @@
package types
// DefaultAssets returns the default asset infos: BTC, ETH, SNR, and USDC
func DefaultAssets() []*AssetInfo {
return []*AssetInfo{
{
Name: "Bitcoin",
Symbol: "BTC",
Hrp: "bc",
Index: 0,
AssetType: AssetType_ASSET_TYPE_NATIVE,
IconUrl: "https://cdn.sonr.land/BTC.svg",
},
{
Name: "Ethereum",
Symbol: "ETH",
Hrp: "eth",
Index: 64,
AssetType: AssetType_ASSET_TYPE_NATIVE,
IconUrl: "https://cdn.sonr.land/ETH.svg",
},
{
Name: "Sonr",
Symbol: "SNR",
Hrp: "idx",
Index: 703,
AssetType: AssetType_ASSET_TYPE_NATIVE,
IconUrl: "https://cdn.sonr.land/SNR.svg",
},
}
}
// DefaultChains returns the default chain infos: Bitcoin, Ethereum, and Sonr.
func DefaultChains() []*ChainInfo {
return []*ChainInfo{}
}
// DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12377.
func DefaultKeyInfos() []*KeyInfo {
return []*KeyInfo{
//
// Identity Key Info
//
// Sonr Controller Key Info
{
Role: KeyRole_KEY_ROLE_INVOCATION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256K,
Encoding: KeyEncoding_KEY_ENCODING_HEX,
},
{
Role: KeyRole_KEY_ROLE_ASSERTION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_BLS12377,
Encoding: KeyEncoding_KEY_ENCODING_MULTIBASE,
},
//
// Blockchain Key Info
//
// Ethereum Key Info
{
Role: KeyRole_KEY_ROLE_DELEGATION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_KECCAK256,
Encoding: KeyEncoding_KEY_ENCODING_HEX,
},
// Bitcoin Key Info
{
Role: KeyRole_KEY_ROLE_DELEGATION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256K,
Encoding: KeyEncoding_KEY_ENCODING_HEX,
},
//
// Authentication Key Info
//
// Browser based WebAuthn
{
Role: KeyRole_KEY_ROLE_AUTHENTICATION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256,
Encoding: KeyEncoding_KEY_ENCODING_RAW,
},
// FIDO U2F
{
Role: KeyRole_KEY_ROLE_AUTHENTICATION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256K,
Encoding: KeyEncoding_KEY_ENCODING_RAW,
},
// Cross-Platform Passkeys
{
Role: KeyRole_KEY_ROLE_AUTHENTICATION,
Algorithm: KeyAlgorithm_KEY_ALGORITHM_EDDSA,
Encoding: KeyEncoding_KEY_ENCODING_RAW,
},
}
}
func DefaultOpenIDConfig() *OpenIDConfig {
return &OpenIDConfig{
Issuer: "https://sonr.id",
AuthorizationEndpoint: "https://api.sonr.id/auth",
TokenEndpoint: "https://api.sonr.id/token",
UserinfoEndpoint: "https://api.sonr.id/userinfo",
ScopesSupported: []string{"openid", "profile", "email", "web3", "sonr"},
ResponseTypesSupported: []string{"code"},
ResponseModesSupported: []string{"query", "form_post"},
GrantTypesSupported: []string{"authorization_code", "refresh_token"},
AcrValuesSupported: []string{"passkey"},
SubjectTypesSupported: []string{"public"},
}
}

View File

@ -11,7 +11,7 @@ import (
// VerifySignature verifies the signature of a message // VerifySignature verifies the signature of a message
func VerifySignature(key []byte, msg []byte, sig []byte) bool { func VerifySignature(key []byte, msg []byte, sig []byte) bool {
pp, err := BuildEcPoint(key) pp, err := buildEcPoint(key)
if err != nil { if err != nil {
return false return false
} }
@ -29,7 +29,7 @@ func VerifySignature(key []byte, msg []byte, sig []byte) bool {
} }
// BuildEcPoint builds an elliptic curve point from a compressed byte slice // BuildEcPoint builds an elliptic curve point from a compressed byte slice
func BuildEcPoint(pubKey []byte) (*curves.EcPoint, error) { func buildEcPoint(pubKey []byte) (*curves.EcPoint, error) {
crv := curves.K256() crv := curves.K256()
x := new(big.Int).SetBytes(pubKey[1:33]) x := new(big.Int).SetBytes(pubKey[1:33])
y := new(big.Int).SetBytes(pubKey[33:]) y := new(big.Int).SetBytes(pubKey[33:])

View File

@ -1,120 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: did/v1/enums.proto
package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_PROFILE_NAME PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_EMAIL PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_PHONE PermissionScope = 3
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5
PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6
PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7
PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8
PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11
PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12
PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13
)
var PermissionScope_name = map[int32]string{
0: "PERMISSION_SCOPE_UNSPECIFIED",
1: "PERMISSION_SCOPE_PROFILE_NAME",
2: "PERMISSION_SCOPE_IDENTIFIERS_EMAIL",
3: "PERMISSION_SCOPE_IDENTIFIERS_PHONE",
4: "PERMISSION_SCOPE_TRANSACTIONS_READ",
5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE",
6: "PERMISSION_SCOPE_WALLETS_READ",
7: "PERMISSION_SCOPE_WALLETS_CREATE",
8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE",
9: "PERMISSION_SCOPE_WALLETS_UPDATE",
10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY",
11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST",
12: "PERMISSION_SCOPE_ADMIN_USER",
13: "PERMISSION_SCOPE_ADMIN_VALIDATOR",
}
var PermissionScope_value = map[string]int32{
"PERMISSION_SCOPE_UNSPECIFIED": 0,
"PERMISSION_SCOPE_PROFILE_NAME": 1,
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": 2,
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": 3,
"PERMISSION_SCOPE_TRANSACTIONS_READ": 4,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5,
"PERMISSION_SCOPE_WALLETS_READ": 6,
"PERMISSION_SCOPE_WALLETS_CREATE": 7,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8,
"PERMISSION_SCOPE_WALLETS_UPDATE": 9,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11,
"PERMISSION_SCOPE_ADMIN_USER": 12,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": 13,
}
func (x PermissionScope) String() string {
return proto.EnumName(PermissionScope_name, int32(x))
}
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_001c58538597e328, []int{0}
}
func init() {
proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value)
}
func init() { proto.RegisterFile("did/v1/enums.proto", fileDescriptor_001c58538597e328) }
var fileDescriptor_001c58538597e328 = []byte{
// 388 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0xd2, 0xc1, 0x6e, 0xd3, 0x30,
0x18, 0x07, 0xf0, 0x04, 0x46, 0x01, 0x03, 0xc2, 0x58, 0x9c, 0x06, 0x64, 0x63, 0x9b, 0x18, 0x02,
0xa9, 0xd6, 0xc4, 0x95, 0x8b, 0x93, 0x7c, 0x15, 0x96, 0x12, 0x27, 0xb2, 0x9d, 0x4d, 0x70, 0x89,
0xd6, 0x26, 0x6a, 0x73, 0x48, 0x5c, 0x35, 0x6d, 0xa1, 0x6f, 0xc1, 0x73, 0xf0, 0x24, 0x1c, 0x7b,
0xe4, 0x88, 0xda, 0x17, 0x41, 0x69, 0xe1, 0xd4, 0x36, 0x5c, 0x2c, 0xeb, 0xf3, 0x4f, 0x7f, 0x7d,
0x96, 0xfe, 0x88, 0x64, 0x45, 0x46, 0xe7, 0x57, 0x34, 0xaf, 0x66, 0x65, 0xdd, 0x1d, 0x4f, 0xcc,
0xd4, 0x90, 0x4e, 0x56, 0x64, 0xdd, 0xf9, 0xd5, 0xf1, 0xf3, 0xa1, 0x19, 0x9a, 0xcd, 0x88, 0x36,
0xb7, 0xed, 0xeb, 0xf1, 0xb3, 0xdb, 0xb2, 0xa8, 0x0c, 0xdd, 0x9c, 0xdb, 0xd1, 0xbb, 0x1f, 0x47,
0xe8, 0x69, 0x9c, 0x4f, 0xca, 0xa2, 0xae, 0x0b, 0x53, 0xa9, 0x81, 0x19, 0xe7, 0xe4, 0x14, 0xbd,
0x8c, 0x41, 0x86, 0x5c, 0x29, 0x1e, 0x89, 0x54, 0x79, 0x51, 0x0c, 0x69, 0x22, 0x54, 0x0c, 0x1e,
0xef, 0x71, 0xf0, 0xb1, 0x45, 0x5e, 0xa3, 0x57, 0x3b, 0x22, 0x96, 0x51, 0x8f, 0x07, 0x90, 0x0a,
0x16, 0x02, 0xb6, 0xc9, 0x1b, 0x74, 0xb6, 0x43, 0xb8, 0x0f, 0x42, 0x37, 0x19, 0x52, 0xa5, 0x10,
0x32, 0x1e, 0xe0, 0x3b, 0xff, 0x75, 0xf1, 0xa7, 0x48, 0x00, 0xbe, 0xbb, 0xd7, 0x69, 0xc9, 0x84,
0x62, 0x9e, 0xe6, 0x91, 0x50, 0xa9, 0x04, 0xe6, 0xe3, 0x23, 0x72, 0x89, 0xce, 0xdb, 0xdd, 0x8d,
0xe4, 0x1a, 0xf0, 0xbd, 0xbd, 0x7f, 0xb8, 0x61, 0x41, 0x00, 0xfa, 0x6f, 0x56, 0x87, 0x9c, 0xa3,
0x93, 0x83, 0xc4, 0x93, 0xc0, 0x34, 0xe0, 0xfb, 0x7b, 0x17, 0xfb, 0x87, 0x54, 0xe2, 0x2a, 0x4f,
0x72, 0x17, 0xf0, 0x83, 0xd6, 0xb0, 0x24, 0xf6, 0x9b, 0xb0, 0x87, 0xe4, 0x2d, 0xba, 0x68, 0xdf,
0xfe, 0x1a, 0x24, 0xef, 0x7d, 0xc6, 0x88, 0xbc, 0x47, 0x97, 0xed, 0xd2, 0x95, 0x11, 0xf3, 0x3d,
0xa6, 0x34, 0x7e, 0x44, 0x4e, 0xd0, 0x8b, 0x1d, 0xcc, 0xfc, 0x90, 0x8b, 0x34, 0x51, 0x20, 0xf1,
0x63, 0x72, 0x81, 0x4e, 0x0f, 0x80, 0x6b, 0x16, 0x70, 0x9f, 0xe9, 0x48, 0xe2, 0x27, 0xee, 0xc7,
0x9f, 0x2b, 0xc7, 0x5e, 0xae, 0x1c, 0xfb, 0xf7, 0xca, 0xb1, 0xbf, 0xaf, 0x1d, 0x6b, 0xb9, 0x76,
0xac, 0x5f, 0x6b, 0xc7, 0xfa, 0x72, 0x36, 0x2c, 0xa6, 0xa3, 0x59, 0xbf, 0x3b, 0x30, 0x25, 0x35,
0x55, 0x6d, 0xaa, 0x09, 0x1d, 0x7d, 0xbd, 0x5d, 0xd0, 0x6f, 0xb4, 0x29, 0xe9, 0x74, 0x31, 0xce,
0xeb, 0x7e, 0x67, 0xd3, 0xb8, 0x0f, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x1a, 0xa8, 0xd9,
0xb8, 0x02, 0x00, 0x00,
}

View File

@ -12,4 +12,5 @@ var (
ErrMinimumAssertions = sdkerrors.Register(ModuleName, 300, "at least one assertion is required for account initialization") ErrMinimumAssertions = sdkerrors.Register(ModuleName, 300, "at least one assertion is required for account initialization")
ErrInvalidControllers = sdkerrors.Register(ModuleName, 301, "no more than one controller can be used for account initialization") ErrInvalidControllers = sdkerrors.Register(ModuleName, 301, "no more than one controller can be used for account initialization")
ErrMaximumAuthenticators = sdkerrors.Register(ModuleName, 302, "more authenticators provided than the total accepted count") ErrMaximumAuthenticators = sdkerrors.Register(ModuleName, 302, "more authenticators provided than the total accepted count")
ErrUnsupportedKeyEncoding = sdkerrors.Register(ModuleName, 400, "unsupported key encoding")
) )

18
x/did/types/extractor.go Normal file
View File

@ -0,0 +1,18 @@
package types
import didv1 "github.com/onsonr/sonr/api/did/v1"
func (m *MsgRegisterService) ExtractServiceRecord() (*didv1.ServiceRecord, error) {
return &didv1.ServiceRecord{
Controller: m.Controller,
OriginUri: m.OriginUri,
Description: m.Description,
}, nil
}
func convertPermissions(permissions *Permissions) *didv1.Permissions {
if permissions == nil {
return nil
}
return &didv1.Permissions{}
}

View File

@ -25,7 +25,12 @@ func (gs GenesisState) Validate() error {
// DefaultParams returns default module parameters. // DefaultParams returns default module parameters.
func DefaultParams() Params { func DefaultParams() Params {
return Params{} return Params{
WhitelistedAssets: DefaultAssets(),
WhitelistedChains: DefaultChains(),
AllowedPublicKeys: DefaultKeyInfos(),
OpenidConfig: DefaultOpenIDConfig(),
}
} }
// Stringer method for Params. // Stringer method for Params.

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ package types_test
import ( import (
"testing" "testing"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/sonr/x/did/types"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -19,14 +19,6 @@ func TestGenesisState_Validate(t *testing.T) {
genState: types.DefaultGenesis(), genState: types.DefaultGenesis(),
valid: true, valid: true,
}, },
{
desc: "valid genesis state",
genState: &types.GenesisState{
// this line is used by starport scaffolding # types/genesis/validField
},
valid: true,
},
// this line is used by starport scaffolding # types/genesis/testcase // this line is used by starport scaffolding # types/genesis/testcase
} }
for _, tc := range tests { for _, tc := range tests {

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