Compare commits
126 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e74de2d67 | |||
| a886715948 | |||
| ebac4e8564 | |||
| da81664729 | |||
| ebfb9c4bc1 | |||
| 8e7918cc45 | |||
| 24ffb8fe8c | |||
| d1bf1f2005 | |||
| c42b3f7617 | |||
| 606144dd87 | |||
| a5bcbcc1f5 | |||
| 31cd62b676 | |||
| 53366c4151 | |||
| 2ca63a6fd5 | |||
| d33baec79b | |||
| 0626e54b6a | |||
| 2a260d46f8 | |||
| 7cb5afdeab | |||
| d18f4c0380 | |||
| c9c4059c90 | |||
| 3fe33dec8b | |||
| 589074360d | |||
| 2e5406692c | |||
| 1920177b2f | |||
| f562433519 | |||
| 2affa76304 | |||
| d6aeb9142f | |||
| 70af84b6b1 | |||
| fc397053c8 | |||
| 3092c8e68e | |||
| 4a1efab5c8 | |||
| a2d57f269d | |||
| 38c4cc3345 | |||
| 06ebe56914 | |||
| 1c3140898f | |||
| 6005bf6101 | |||
| 78b9ebb463 | |||
| ad7f993f0f | |||
| 9be8a53ea2 | |||
| a89f8cf2ab | |||
| a2dab0e64d | |||
| 52459f6545 | |||
| a82bc3356e | |||
| 9ebe8310a1 | |||
| cf5c5f1df4 | |||
| 8585a68d7f | |||
| e8540c13a5 | |||
| 5a24a8fafc | |||
| 1195b120ff | |||
| f30cfc0be7 | |||
| 9460a9941c | |||
| eeffc0db51 | |||
| b7d6e0e1e3 | |||
| 45e0b406ac | |||
| 405d4653df | |||
| 579527b480 | |||
| 70360196f0 | |||
| b777adeda6 | |||
| 6a6505c9d7 | |||
| b10119d339 | |||
| 3a4bd4ffd6 | |||
| 9769387730 | |||
| 71747e3c82 | |||
| 5cbbeee0d5 | |||
| 57187be113 | |||
| fbd634a866 | |||
| 8d4eba858e | |||
| f1486fb989 | |||
| c50c30ae76 | |||
| 5745cb4d7a | |||
| 00c978c864 | |||
| 9e4c58efdf | |||
| 13e6fcaa85 | |||
| 9bd095ec18 | |||
| 60d50ff17a | |||
| 03f3f0285a | |||
| 3e87063ab4 | |||
| a32cbd44b0 | |||
| 962070a33c | |||
| 55f11a5433 | |||
| 48332a1069 | |||
| f43a2a1e42 | |||
| 205c887686 | |||
| 4666e91820 | |||
| 7d0a25d570 | |||
| bb46235b54 | |||
| 464041f9e1 | |||
| 433748521c | |||
| 3cbcd001f4 | |||
| 282b27646f | |||
| 5cc3ee32e9 | |||
| f412f45b50 | |||
| 9c19452758 | |||
| bf34d00478 | |||
| 70fa41c165 | |||
| 065d416305 | |||
| 3e93d2a250 | |||
| 8bc85191d5 | |||
| 7d714a22f0 | |||
| 102a8a0d8b | |||
| ae28a45915 | |||
| cffb8d98af | |||
| a40c2239d7 | |||
| 5a990a58ff | |||
| 2a1d37dd22 | |||
| be79042a23 | |||
| 7019dcc11f | |||
| bab842d277 | |||
| a374bca601 | |||
| d4d3041816 | |||
| 70766b6d3e | |||
| 437c66ad0b | |||
| 1afcfb0842 | |||
| b617729873 | |||
| c5e1ea289c | |||
| 266c98a80e | |||
| 4540b3b41a | |||
| a9beb13189 | |||
| ebc30ec248 | |||
| 3cd9c6ad13 | |||
| b83d4e964b | |||
| bceb59a832 | |||
| 50a48603e3 | |||
| 1ae718c345 | |||
| 12c4450527 | |||
| 5bf34950ab |
@@ -1,9 +0,0 @@
|
|||||||
# Description
|
|
||||||
|
|
||||||
Closes: #XXXX
|
|
||||||
|
|
||||||
<!-- If appropriate, insert relevant description here -->
|
|
||||||
|
|
||||||
# Checklist:
|
|
||||||
|
|
||||||
- [ ] added a changelog entry to `CHANGELOG.md`
|
|
||||||
@@ -104,12 +104,9 @@ jobs:
|
|||||||
name: nym-binaries-artifacts
|
name: nym-binaries-artifacts
|
||||||
path: |
|
path: |
|
||||||
target/release/nym-client
|
target/release/nym-client
|
||||||
target/release/nym-gateway
|
|
||||||
target/release/nym-mixnode
|
|
||||||
target/release/nym-socks5-client
|
target/release/nym-socks5-client
|
||||||
target/release/nym-api
|
target/release/nym-api
|
||||||
target/release/nym-network-requester
|
target/release/nym-network-requester
|
||||||
target/release/nym-network-statistics
|
|
||||||
target/release/nym-cli
|
target/release/nym-cli
|
||||||
target/release/nymvisor
|
target/release/nymvisor
|
||||||
target/release/nym-node
|
target/release/nym-node
|
||||||
@@ -124,12 +121,9 @@ jobs:
|
|||||||
OUTPUT_DIR: ci-builds/${{ github.ref_name }}
|
OUTPUT_DIR: ci-builds/${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
cp target/release/nym-client $OUTPUT_DIR
|
cp target/release/nym-client $OUTPUT_DIR
|
||||||
cp target/release/nym-gateway $OUTPUT_DIR
|
|
||||||
cp target/release/nym-mixnode $OUTPUT_DIR
|
|
||||||
cp target/release/nym-socks5-client $OUTPUT_DIR
|
cp target/release/nym-socks5-client $OUTPUT_DIR
|
||||||
cp target/release/nym-api $OUTPUT_DIR
|
cp target/release/nym-api $OUTPUT_DIR
|
||||||
cp target/release/nym-network-requester $OUTPUT_DIR
|
cp target/release/nym-network-requester $OUTPUT_DIR
|
||||||
cp target/release/nym-network-statistics $OUTPUT_DIR
|
|
||||||
cp target/release/nymvisor $OUTPUT_DIR
|
cp target/release/nymvisor $OUTPUT_DIR
|
||||||
cp target/release/nym-node $OUTPUT_DIR
|
cp target/release/nym-node $OUTPUT_DIR
|
||||||
cp target/release/nym-cli $OUTPUT_DIR
|
cp target/release/nym-cli $OUTPUT_DIR
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ on:
|
|||||||
- 'clients/**'
|
- 'clients/**'
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
- 'explorer-api/**'
|
- 'explorer-api/**'
|
||||||
- 'ephemera/**'
|
|
||||||
- 'gateway/**'
|
- 'gateway/**'
|
||||||
- 'integrations/**'
|
- 'integrations/**'
|
||||||
- 'mixnode/**'
|
- 'mixnode/**'
|
||||||
@@ -24,7 +23,6 @@ on:
|
|||||||
- 'clients/**'
|
- 'clients/**'
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
- 'explorer-api/**'
|
- 'explorer-api/**'
|
||||||
- 'ephemera/**'
|
|
||||||
- 'gateway/**'
|
- 'gateway/**'
|
||||||
- 'integrations/**'
|
- 'integrations/**'
|
||||||
- 'mixnode/**'
|
- 'mixnode/**'
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ jobs:
|
|||||||
cp contracts/target/wasm32-unknown-unknown/release/nym_coconut_dkg.wasm $OUTPUT_DIR
|
cp contracts/target/wasm32-unknown-unknown/release/nym_coconut_dkg.wasm $OUTPUT_DIR
|
||||||
cp contracts/target/wasm32-unknown-unknown/release/cw3_flex_multisig.wasm $OUTPUT_DIR
|
cp contracts/target/wasm32-unknown-unknown/release/cw3_flex_multisig.wasm $OUTPUT_DIR
|
||||||
cp contracts/target/wasm32-unknown-unknown/release/cw4_group.wasm $OUTPUT_DIR
|
cp contracts/target/wasm32-unknown-unknown/release/cw4_group.wasm $OUTPUT_DIR
|
||||||
cp contracts/target/wasm32-unknown-unknown/release/nym_service_provider_directory.wasm $OUTPUT_DIR
|
|
||||||
cp contracts/target/wasm32-unknown-unknown/release/nym_name_service.wasm $OUTPUT_DIR
|
|
||||||
|
|
||||||
- name: Deploy branch to CI www
|
- name: Deploy branch to CI www
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
name: ci-nym-connect-desktop-rust
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- "nym-connect/desktop/src-tauri/**"
|
|
||||||
- "nym-connect/desktop/src-tauri/Cargo.toml"
|
|
||||||
- "clients/client-core/**"
|
|
||||||
- "clients/socks5/**"
|
|
||||||
- "common/**"
|
|
||||||
- "gateway/gateway-requests/**"
|
|
||||||
- "contracts/vesting/**"
|
|
||||||
- "nym-api/nym-api-requests/**"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: [self-hosted, custom-linux]
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
steps:
|
|
||||||
- name: Install Dependencies (Linux)
|
|
||||||
run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools libayatana-appindicator3-dev
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install rust toolchain
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: Check formatting
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: --manifest-path nym-connect/desktop/Cargo.toml --all -- --check
|
|
||||||
|
|
||||||
- name: Build all binaries
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --manifest-path nym-connect/desktop/Cargo.toml --workspace
|
|
||||||
|
|
||||||
- name: Run all tests
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --manifest-path nym-connect/desktop/Cargo.toml --workspace
|
|
||||||
|
|
||||||
- uses: actions-rs/clippy-check@v1
|
|
||||||
name: Clippy checks
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
args: --manifest-path nym-connect/desktop/Cargo.toml --workspace --all-features
|
|
||||||
|
|
||||||
- name: Run clippy
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: clippy
|
|
||||||
args: --manifest-path nym-connect/desktop/Cargo.toml --workspace --all-features -- -D warnings
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
name: ci-nym-connect-desktop
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'nym-connect/desktop/**'
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: nym-connect/desktop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: custom-linux
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install rsync
|
|
||||||
run: sudo apt-get install rsync
|
|
||||||
continue-on-error: true
|
|
||||||
- uses: rlespinasse/github-slug-action@v3.x
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm install -g yarn
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
- name: Install wasm-pack
|
|
||||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
||||||
- name: Install project dependencies
|
|
||||||
run: cd ../.. && yarn --network-timeout 100000
|
|
||||||
|
|
||||||
- name: Install app dependencies
|
|
||||||
run: yarn
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Set environment from the example
|
|
||||||
run: cp .env.sample .env
|
|
||||||
- run: yarn storybook:build
|
|
||||||
- name: Deploy branch to CI www
|
|
||||||
continue-on-error: true
|
|
||||||
uses: easingthemes/ssh-deploy@main
|
|
||||||
env:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.CI_WWW_SSH_PRIVATE_KEY }}
|
|
||||||
ARGS: "-rltgoDzvO --delete"
|
|
||||||
SOURCE: "nym-connect/desktop/storybook-static/"
|
|
||||||
REMOTE_HOST: ${{ secrets.CI_WWW_REMOTE_HOST }}
|
|
||||||
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
|
||||||
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/nym-connect-${{ env.GITHUB_REF_SLUG }}
|
|
||||||
EXCLUDE: "/dist/, /node_modules/"
|
|
||||||
- name: Matrix - Node Install
|
|
||||||
run: npm install
|
|
||||||
working-directory: .github/workflows/support-files
|
|
||||||
- name: Matrix - Send Notification
|
|
||||||
env:
|
|
||||||
NYM_NOTIFICATION_KIND: nym-connect
|
|
||||||
NYM_PROJECT_NAME: "nym-connect"
|
|
||||||
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
|
|
||||||
NYM_CI_WWW_LOCATION: "nym-connect-${{ env.GITHUB_REF_SLUG }}"
|
|
||||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
||||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
||||||
IS_SUCCESS: "${{ job.status == 'success' }}"
|
|
||||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
||||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM }}"
|
|
||||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
||||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
||||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
||||||
uses: docker://keybaseio/client:stable-node
|
|
||||||
with:
|
|
||||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
name: nightly-nym-connect-desktop-build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '14 1 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-20.04, macos-latest, windows-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
MANIFEST_PATH: --manifest-path nym-connect/desktop/Cargo.toml
|
|
||||||
continue-on-error: true
|
|
||||||
steps:
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Dependencies (Linux)
|
|
||||||
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools
|
|
||||||
if: matrix.os == 'ubuntu-20.04'
|
|
||||||
|
|
||||||
- name: Install rust toolchain
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: Check formatting
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: ${{ env.MANIFEST_PATH }} --all -- --check
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: ${{ env.MANIFEST_PATH }} --release --workspace
|
|
||||||
|
|
||||||
- name: Unit tests
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: ${{ env.MANIFEST_PATH }} --workspace
|
|
||||||
|
|
||||||
- name: Clippy
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: clippy
|
|
||||||
args: ${{ env.MANIFEST_PATH }} --workspace --all-targets -- -D warnings
|
|
||||||
|
|
||||||
notification:
|
|
||||||
needs: build
|
|
||||||
runs-on: custom-linux
|
|
||||||
steps:
|
|
||||||
- name: Collect jobs status
|
|
||||||
uses: technote-space/workflow-conclusion-action@v2
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: install npm
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
- name: Matrix - Node Install
|
|
||||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
|
||||||
run: npm install
|
|
||||||
working-directory: .github/workflows/support-files
|
|
||||||
- name: Matrix - Send Notification
|
|
||||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
|
||||||
env:
|
|
||||||
NYM_NOTIFICATION_KIND: nightly
|
|
||||||
NYM_PROJECT_NAME: "nym-connect-desktop-nightly-build"
|
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
||||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
||||||
IS_SUCCESS: "${{ env.WORKFLOW_CONCLUSION == 'success' }}"
|
|
||||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
||||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM_NIGHTLY }}"
|
|
||||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
||||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
||||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
||||||
uses: docker://keybaseio/client:stable-node
|
|
||||||
with:
|
|
||||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
name: pr-validation
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
- 'release/**'
|
||||||
|
types:
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
- edited
|
||||||
|
- milestoned
|
||||||
|
- demilestoned
|
||||||
|
|
||||||
|
env:
|
||||||
|
LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-milestone:
|
||||||
|
name: Check Milestone
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- if: github.event.pull_request.milestone == null && contains( env.LABELS, 'no-milestone' ) == false
|
||||||
|
run: exit 1
|
||||||
@@ -27,23 +27,17 @@ jobs:
|
|||||||
release_id: ${{ steps.create-release.outputs.id }}
|
release_id: ${{ steps.create-release.outputs.id }}
|
||||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||||
client_hash: ${{ steps.binary-hashes.outputs.client_hash }}
|
client_hash: ${{ steps.binary-hashes.outputs.client_hash }}
|
||||||
mixnode_hash: ${{ steps.binary-hashes.outputs.mixnode_hash }}
|
|
||||||
gateway_hash: ${{ steps.binary-hashes.outputs.gateway_hash }}
|
|
||||||
nymvisor_hash: ${{ steps.binary-hashes.outputs.nymvisor_hash }}
|
nymvisor_hash: ${{ steps.binary-hashes.outputs.nymvisor_hash }}
|
||||||
nymnode_hash: ${{ steps.binary-hashes.outputs.nymnode_hash }}
|
nymnode_hash: ${{ steps.binary-hashes.outputs.nymnode_hash }}
|
||||||
socks5_hash: ${{ steps.binary-hashes.outputs.socks5_hash }}
|
socks5_hash: ${{ steps.binary-hashes.outputs.socks5_hash }}
|
||||||
netreq_hash: ${{ steps.binary-hashes.outputs.netreq_hash }}
|
netreq_hash: ${{ steps.binary-hashes.outputs.netreq_hash }}
|
||||||
cli_hash: ${{ steps.binary-hashes.outputs.cli_hash }}
|
cli_hash: ${{ steps.binary-hashes.outputs.cli_hash }}
|
||||||
netstat_hash: ${{ steps.binary-hashes.outputs.netstat_hash }}
|
|
||||||
client_version: ${{ steps.binary-versions.outputs.client_version }}
|
client_version: ${{ steps.binary-versions.outputs.client_version }}
|
||||||
mixnode_version: ${{ steps.binary-versions.outputs.mixnode_version }}
|
|
||||||
gateway_version: ${{ steps.binary-versions.outputs.gateway_version }}
|
|
||||||
nymvisor_version: ${{ steps.binary-versions.outputs.nymvisor_version }}
|
nymvisor_version: ${{ steps.binary-versions.outputs.nymvisor_version }}
|
||||||
nymnode_version: ${{ steps.binary-versions.outputs.nymnode_version }}
|
nymnode_version: ${{ steps.binary-versions.outputs.nymnode_version }}
|
||||||
socks5_version: ${{ steps.binary-versions.outputs.socks5_version }}
|
socks5_version: ${{ steps.binary-versions.outputs.socks5_version }}
|
||||||
netreq_version: ${{ steps.binary-versions.outputs.netreq_version }}
|
netreq_version: ${{ steps.binary-versions.outputs.netreq_version }}
|
||||||
cli_version: ${{ steps.binary-versions.outputs.cli_version }}
|
cli_version: ${{ steps.binary-versions.outputs.cli_version }}
|
||||||
netstat_version: ${{ steps.binary-versions.outputs.netstat_version }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -75,12 +69,9 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
target/release/explorer-api
|
target/release/explorer-api
|
||||||
target/release/nym-client
|
target/release/nym-client
|
||||||
target/release/nym-gateway
|
|
||||||
target/release/nym-mixnode
|
|
||||||
target/release/nym-socks5-client
|
target/release/nym-socks5-client
|
||||||
target/release/nym-api
|
target/release/nym-api
|
||||||
target/release/nym-network-requester
|
target/release/nym-network-requester
|
||||||
target/release/nym-network-statistics
|
|
||||||
target/release/nym-cli
|
target/release/nym-cli
|
||||||
target/release/nymvisor
|
target/release/nymvisor
|
||||||
target/release/nym-node
|
target/release/nym-node
|
||||||
@@ -94,12 +85,9 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
target/release/explorer-api
|
target/release/explorer-api
|
||||||
target/release/nym-client
|
target/release/nym-client
|
||||||
target/release/nym-gateway
|
|
||||||
target/release/nym-mixnode
|
|
||||||
target/release/nym-socks5-client
|
target/release/nym-socks5-client
|
||||||
target/release/nym-api
|
target/release/nym-api
|
||||||
target/release/nym-network-requester
|
target/release/nym-network-requester
|
||||||
target/release/nym-network-statistics
|
|
||||||
target/release/nym-cli
|
target/release/nym-cli
|
||||||
target/release/nymvisor
|
target/release/nymvisor
|
||||||
target/release/nym-node
|
target/release/nym-node
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
name: publish-nym-connect-macos
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
release:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: nym-connect/desktop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-tauri:
|
|
||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform: [macos-12-large]
|
|
||||||
runs-on: ${{ matrix.platform }}
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
release_id: ${{ steps.create-release.outputs.id }}
|
|
||||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
|
||||||
version: ${{ steps.release-info.outputs.version }}
|
|
||||||
filename: ${{ steps.release-info.outputs.filename }}
|
|
||||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: wasm32-unknown-unknown
|
|
||||||
|
|
||||||
- name: Install wasm-pack
|
|
||||||
run: |
|
|
||||||
export WASM_PACK_VERSION="v0.12.1"
|
|
||||||
curl -LO https://github.com/rustwasm/wasm-pack/releases/download/${WASM_PACK_VERSION}/wasm-pack-${WASM_PACK_VERSION}-x86_64-apple-darwin.tar.gz
|
|
||||||
tar xvzf wasm-pack-${WASM_PACK_VERSION}-x86_64-apple-darwin.tar.gz -C $HOME/.cargo/bin --strip-components=1
|
|
||||||
rm wasm-pack-${WASM_PACK_VERSION}-x86_64-apple-darwin.tar.gz
|
|
||||||
|
|
||||||
- name: Install the Apple developer certificate for code signing
|
|
||||||
env:
|
|
||||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
|
||||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
||||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
# create variables
|
|
||||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
|
||||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
|
||||||
|
|
||||||
# import certificate and provisioning profile from secrets
|
|
||||||
echo -n "$APPLE_CERTIFICATE" | base64 --decode --output $CERTIFICATE_PATH
|
|
||||||
|
|
||||||
# create temporary keychain
|
|
||||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
|
||||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
|
|
||||||
# import certificate to keychain
|
|
||||||
security import $CERTIFICATE_PATH -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
|
||||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
|
||||||
|
|
||||||
- name: Create env file
|
|
||||||
uses: timheuer/base64-to-file@v1.2
|
|
||||||
with:
|
|
||||||
fileName: '.env'
|
|
||||||
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
|
||||||
|
|
||||||
- name: Install project dependencies
|
|
||||||
shell: bash
|
|
||||||
run: cd .. && yarn --network-timeout 100000
|
|
||||||
|
|
||||||
- name: Install app dependencies and build it
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
|
|
||||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
|
||||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
||||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_IDENTITY_ID }}
|
|
||||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
||||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
||||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
||||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
|
||||||
SENTRY_DSN_RUST: ${{ secrets.SENTRY_DSN_RUST }}
|
|
||||||
SENTRY_DSN_JS: ${{ secrets.SENTRY_DSN_JS }}
|
|
||||||
run: yarn && yarn build
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: nym-connect_1.0.0_x64.dmg
|
|
||||||
path: nym-connect/desktop/target/release/bundle/dmg/nym-connect_1*_x64.dmg
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- name: Clean up keychain
|
|
||||||
if: ${{ always() }}
|
|
||||||
run: |
|
|
||||||
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
|
||||||
|
|
||||||
- id: create-release
|
|
||||||
name: Upload to release based on tag name
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
nym-connect/desktop/target/release/bundle/dmg/*.dmg
|
|
||||||
nym-connect/desktop/target/release/bundle/macos/*.app.tar.gz*
|
|
||||||
|
|
||||||
push-release-data:
|
|
||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/release-calculate-hash.yml
|
|
||||||
needs: publish-tauri
|
|
||||||
with:
|
|
||||||
release_tag: ${{ github.ref_name }}
|
|
||||||
secrets: inherit
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
name: publish-nym-connect-ubuntu
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
release:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: nym-connect/desktop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-tauri:
|
|
||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform: [custom-ubuntu-20.04]
|
|
||||||
runs-on: ${{ matrix.platform }}
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
release_id: ${{ steps.create-release.outputs.id }}
|
|
||||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
|
||||||
version: ${{ steps.release-info.outputs.version }}
|
|
||||||
filename: ${{ steps.release-info.outputs.filename }}
|
|
||||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Tauri dependencies
|
|
||||||
run: >
|
|
||||||
sudo apt-get update &&
|
|
||||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
- name: Install project dependencies
|
|
||||||
shell: bash
|
|
||||||
run: cd .. && yarn --network-timeout 100000
|
|
||||||
|
|
||||||
- name: Install app dependencies
|
|
||||||
run: yarn
|
|
||||||
|
|
||||||
- name: Create env file
|
|
||||||
uses: timheuer/base64-to-file@v1.2
|
|
||||||
with:
|
|
||||||
fileName: '.env'
|
|
||||||
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
|
||||||
|
|
||||||
- name: Build app
|
|
||||||
run: yarn build
|
|
||||||
env:
|
|
||||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
||||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
|
||||||
SENTRY_DSN_RUST: ${{ secrets.SENTRY_DSN_RUST }}
|
|
||||||
SENTRY_DSN_JS: ${{ secrets.SENTRY_DSN_JS }}
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: nym-connect.AppImage.tar.gz
|
|
||||||
path: nym-connect/desktop/target/release/bundle/appimage/nym-connect_1*_amd64.AppImage
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- id: create-release
|
|
||||||
name: Upload to release based on tag name
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
nym-connect/desktop/target/release/bundle/appimage/*.AppImage
|
|
||||||
nym-connect/desktop/target/release/bundle/appimage/*.AppImage.tar.gz*
|
|
||||||
|
|
||||||
push-release-data:
|
|
||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/release-calculate-hash.yml
|
|
||||||
needs: publish-tauri
|
|
||||||
with:
|
|
||||||
release_tag: ${{ github.ref_name }}
|
|
||||||
secrets: inherit
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
name: publish-nym-connect-win10
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
release:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: nym-connect/desktop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-tauri:
|
|
||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform: [windows10]
|
|
||||||
runs-on: ${{ matrix.platform }}
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
release_id: ${{ steps.create-release.outputs.id }}
|
|
||||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].created_at }}
|
|
||||||
version: ${{ steps.release-info.outputs.version }}
|
|
||||||
filename: ${{ steps.release-info.outputs.filename }}
|
|
||||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clean up first
|
|
||||||
continue-on-error: true
|
|
||||||
working-directory: .
|
|
||||||
run: |
|
|
||||||
cd ..
|
|
||||||
del /s /q /A:H nym
|
|
||||||
rmdir /s /q nym
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Import signing certificate
|
|
||||||
env:
|
|
||||||
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
|
|
||||||
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
New-Item -ItemType directory -Path certificate
|
|
||||||
Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_CERTIFICATE
|
|
||||||
certutil -decode certificate/tempCert.txt certificate/certificate.pfx
|
|
||||||
Remove-Item -path certificate -include tempCert.txt
|
|
||||||
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
|
|
||||||
|
|
||||||
- name: Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
- name: Create env file
|
|
||||||
uses: timheuer/base64-to-file@v1.2
|
|
||||||
with:
|
|
||||||
fileName: '.env'
|
|
||||||
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
|
||||||
|
|
||||||
- name: Install project dependencies
|
|
||||||
shell: bash
|
|
||||||
run: cd .. && yarn --network-timeout 100000
|
|
||||||
|
|
||||||
- name: Install app dependencies
|
|
||||||
shell: bash
|
|
||||||
run: yarn --network-timeout 100000
|
|
||||||
|
|
||||||
- name: Build and sign it
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }}
|
|
||||||
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
|
|
||||||
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
||||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
|
||||||
SENTRY_DSN_RUST: ${{ secrets.SENTRY_DSN_RUST }}
|
|
||||||
SENTRY_DSN_JS: ${{ secrets.SENTRY_DSN_JS }}
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: nym-connect_1.0.0_x64_en-US.msi
|
|
||||||
path: nym-connect/desktop/target/release/bundle/msi/nym-connect_1*_x64_en-US.msi
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- id: create-release
|
|
||||||
name: Upload to release based on tag name
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
nym-connect/desktop/target/release/bundle/msi/*.msi
|
|
||||||
nym-connect/desktop/target/release/bundle/msi/*.msi.zip*
|
|
||||||
|
|
||||||
push-release-data:
|
|
||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/release-calculate-hash.yml
|
|
||||||
needs: publish-tauri
|
|
||||||
with:
|
|
||||||
release_tag: ${{ github.ref_name }}
|
|
||||||
secrets: inherit
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
const Handlebars = require('handlebars');
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
async function addToContextAndValidate(context) {
|
|
||||||
if (!context.env.NYM_CI_WWW_LOCATION) {
|
|
||||||
throw new Error('Please ensure the env var NYM_CI_WWW_LOCATION is set');
|
|
||||||
}
|
|
||||||
if (!context.env.NYM_CI_WWW_BASE) {
|
|
||||||
throw new Error('Please ensure the env var NYM_CI_WWW_BASE is set');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getMessageBody(context) {
|
|
||||||
const source = fs
|
|
||||||
.readFileSync(
|
|
||||||
context.env.IS_SUCCESS === 'true'
|
|
||||||
? path.resolve(__dirname, 'templates', 'success')
|
|
||||||
: path.resolve(__dirname, 'templates', 'failure'),
|
|
||||||
)
|
|
||||||
.toString();
|
|
||||||
const template = Handlebars.compile(source);
|
|
||||||
return template(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
addToContextAndValidate,
|
|
||||||
getMessageBody,
|
|
||||||
};
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
|
|
||||||
> :rocket: {{ env.NYM_PROJECT_NAME }}
|
|
||||||
>
|
|
||||||
> 🔴 **FAILURE** :cry:
|
|
||||||
>
|
|
||||||
> `branch` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/tree/{{ env.GIT_BRANCH_NAME }}
|
|
||||||
>
|
|
||||||
> `commit` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/commit/{{ env.GITHUB_SHA }}
|
|
||||||
>
|
|
||||||
> `build ` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}
|
|
||||||
>
|
|
||||||
|
|
||||||
Commit message:
|
|
||||||
```
|
|
||||||
{{ env.GIT_COMMIT_MESSAGE }}
|
|
||||||
```
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
|
|
||||||
> :rocket: {{ env.NYM_PROJECT_NAME }} ➡️➡️➡️➡️➡️ **View storybook:** https://{{ env.NYM_CI_WWW_LOCATION }}.{{ env.NYM_CI_WWW_BASE }}/
|
|
||||||
>
|
|
||||||
> ✅ **SUCCESS**
|
|
||||||
>
|
|
||||||
> `branch` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/tree/{{ env.GIT_BRANCH_NAME }}
|
|
||||||
>
|
|
||||||
> `commit` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/commit/{{ env.GITHUB_SHA }}
|
|
||||||
>
|
|
||||||
> `build ` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}
|
|
||||||
>
|
|
||||||
|
|
||||||
Commit message by `{{ env.GITHUB_ACTOR }}` at {{ timestamp }}:
|
|
||||||
```
|
|
||||||
{{ env.GIT_COMMIT_MESSAGE }}
|
|
||||||
```
|
|
||||||
@@ -4,6 +4,78 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2024.7-doubledecker] (2024-07-04)
|
||||||
|
|
||||||
|
- Add an early return in `parse_raw_str_logs` for empty raw log strings. ([#4686])
|
||||||
|
- Bump braces from 3.0.2 to 3.0.3 in /wasm/mix-fetch/internal-dev ([#4672])
|
||||||
|
- add expiry returned on import ([#4670])
|
||||||
|
- [bugfix] missing rustls feature ([#4666])
|
||||||
|
- Bump ws from 8.13.0 to 8.17.1 in /wasm/client/internal-dev-node ([#4665])
|
||||||
|
- Bump braces from 3.0.2 to 3.0.3 in /clients/native/examples/js-examples/websocket ([#4663])
|
||||||
|
- Bump ws from 8.14.2 to 8.17.1 in /sdk/typescript/packages/nodejs-client ([#4662])
|
||||||
|
- Update setup.md ([#4661])
|
||||||
|
- New clippy lints ([#4660])
|
||||||
|
- Bump braces from 3.0.2 to 3.0.3 in /nym-api/tests ([#4659])
|
||||||
|
- Bump braces from 3.0.2 to 3.0.3 in /docker/typescript_client/upload_contract ([#4658])
|
||||||
|
- Update vps-setup.md ([#4656])
|
||||||
|
- Update configuration.md ([#4655])
|
||||||
|
- Remove old PR template ([#4639])
|
||||||
|
|
||||||
|
[#4686]: https://github.com/nymtech/nym/pull/4686
|
||||||
|
[#4672]: https://github.com/nymtech/nym/pull/4672
|
||||||
|
[#4670]: https://github.com/nymtech/nym/pull/4670
|
||||||
|
[#4666]: https://github.com/nymtech/nym/pull/4666
|
||||||
|
[#4665]: https://github.com/nymtech/nym/pull/4665
|
||||||
|
[#4663]: https://github.com/nymtech/nym/pull/4663
|
||||||
|
[#4662]: https://github.com/nymtech/nym/pull/4662
|
||||||
|
[#4661]: https://github.com/nymtech/nym/pull/4661
|
||||||
|
[#4660]: https://github.com/nymtech/nym/pull/4660
|
||||||
|
[#4659]: https://github.com/nymtech/nym/pull/4659
|
||||||
|
[#4658]: https://github.com/nymtech/nym/pull/4658
|
||||||
|
[#4656]: https://github.com/nymtech/nym/pull/4656
|
||||||
|
[#4655]: https://github.com/nymtech/nym/pull/4655
|
||||||
|
[#4639]: https://github.com/nymtech/nym/pull/4639
|
||||||
|
|
||||||
|
## [2024.6-chomp] (2024-06-25)
|
||||||
|
|
||||||
|
- Remove additional code as part of Ephemera Purge and SP and contracts ([#4650])
|
||||||
|
- bugfix: make sure nym-api can handle non-cw2 (or without detailed build info) compliant contracts ([#4648])
|
||||||
|
- introduced a flag to accept toc and exposed it via self-described API ([#4647])
|
||||||
|
- bugfix: make sure to return an error on invalid public ip ([#4646])
|
||||||
|
- Add ci check for PR having an assigned milestone ([#4644])
|
||||||
|
- Removed ephemera code ([#4642])
|
||||||
|
- Remove stale peers ([#4640])
|
||||||
|
- Add generic wg private network routing ([#4636])
|
||||||
|
- Feature/new node endpoints ([#4635])
|
||||||
|
- standarised ContractBuildInformation and added it to all contracts ([#4631])
|
||||||
|
- validate nym-node public ips on startup ([#4630])
|
||||||
|
- Bump defguard wg ([#4625])
|
||||||
|
- Fix cargo warnings ([#4624])
|
||||||
|
- Update kernel peers on peer modification ([#4622])
|
||||||
|
- Handle v6 and v7 requests in the IPR, but reply with v6 ([#4620])
|
||||||
|
- fix typo ([#4619])
|
||||||
|
- Update crypto and rand crates ([#4607])
|
||||||
|
- Purge name service and service provider directory contracts ([#4603])
|
||||||
|
|
||||||
|
[#4650]: https://github.com/nymtech/nym/pull/4650
|
||||||
|
[#4648]: https://github.com/nymtech/nym/pull/4648
|
||||||
|
[#4647]: https://github.com/nymtech/nym/pull/4647
|
||||||
|
[#4646]: https://github.com/nymtech/nym/pull/4646
|
||||||
|
[#4644]: https://github.com/nymtech/nym/pull/4644
|
||||||
|
[#4642]: https://github.com/nymtech/nym/pull/4642
|
||||||
|
[#4640]: https://github.com/nymtech/nym/pull/4640
|
||||||
|
[#4636]: https://github.com/nymtech/nym/pull/4636
|
||||||
|
[#4635]: https://github.com/nymtech/nym/pull/4635
|
||||||
|
[#4631]: https://github.com/nymtech/nym/pull/4631
|
||||||
|
[#4630]: https://github.com/nymtech/nym/pull/4630
|
||||||
|
[#4625]: https://github.com/nymtech/nym/pull/4625
|
||||||
|
[#4624]: https://github.com/nymtech/nym/pull/4624
|
||||||
|
[#4622]: https://github.com/nymtech/nym/pull/4622
|
||||||
|
[#4620]: https://github.com/nymtech/nym/pull/4620
|
||||||
|
[#4619]: https://github.com/nymtech/nym/pull/4619
|
||||||
|
[#4607]: https://github.com/nymtech/nym/pull/4607
|
||||||
|
[#4603]: https://github.com/nymtech/nym/pull/4603
|
||||||
|
|
||||||
## [2024.5-ragusa] (2024-05-22)
|
## [2024.5-ragusa] (2024-05-22)
|
||||||
|
|
||||||
- Feature/nym node api location ([#4605])
|
- Feature/nym node api location ([#4605])
|
||||||
|
|||||||
Generated
+114
-246
@@ -43,19 +43,6 @@ dependencies = [
|
|||||||
"generic-array 0.14.7",
|
"generic-array 0.14.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "aes"
|
|
||||||
version = "0.7.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"cipher 0.3.0",
|
|
||||||
"cpufeatures",
|
|
||||||
"ctr 0.8.0",
|
|
||||||
"opaque-debug 0.3.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aes"
|
name = "aes"
|
||||||
version = "0.8.4"
|
version = "0.8.4"
|
||||||
@@ -63,7 +50,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
|
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cipher 0.4.4",
|
"cipher",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -74,9 +61,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
|
checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aead",
|
"aead",
|
||||||
"aes 0.8.4",
|
"aes",
|
||||||
"cipher 0.4.4",
|
"cipher",
|
||||||
"ctr 0.9.2",
|
"ctr",
|
||||||
"ghash",
|
"ghash",
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
]
|
]
|
||||||
@@ -537,10 +524,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164"
|
checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bs58 0.5.1",
|
"bs58 0.5.1",
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
"k256",
|
"k256",
|
||||||
"once_cell",
|
|
||||||
"pbkdf2",
|
|
||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
"ripemd",
|
"ripemd",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
@@ -599,7 +584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330"
|
checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byte-tools",
|
"byte-tools",
|
||||||
"crypto-mac 0.7.0",
|
"crypto-mac",
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
"opaque-debug 0.2.3",
|
"opaque-debug 0.2.3",
|
||||||
]
|
]
|
||||||
@@ -827,7 +812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
|
checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cipher 0.4.4",
|
"cipher",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -839,7 +824,7 @@ checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"aead",
|
"aead",
|
||||||
"chacha20",
|
"chacha20",
|
||||||
"cipher 0.4.4",
|
"cipher",
|
||||||
"poly1305",
|
"poly1305",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
@@ -886,15 +871,6 @@ dependencies = [
|
|||||||
"half",
|
"half",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cipher"
|
|
||||||
version = "0.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array 0.14.7",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cipher"
|
name = "cipher"
|
||||||
version = "0.4.4"
|
version = "0.4.4"
|
||||||
@@ -1188,7 +1164,7 @@ dependencies = [
|
|||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"signature 2.2.0",
|
"signature",
|
||||||
"subtle-encoding",
|
"subtle-encoding",
|
||||||
"tendermint",
|
"tendermint",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -1207,7 +1183,7 @@ dependencies = [
|
|||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"signature 2.2.0",
|
"signature",
|
||||||
"subtle-encoding",
|
"subtle-encoding",
|
||||||
"tendermint",
|
"tendermint",
|
||||||
"tendermint-rpc",
|
"tendermint-rpc",
|
||||||
@@ -1473,16 +1449,6 @@ dependencies = [
|
|||||||
"subtle 1.0.0",
|
"subtle 1.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "crypto-mac"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array 0.14.7",
|
|
||||||
"subtle 2.5.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "csv"
|
name = "csv"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
@@ -1504,22 +1470,13 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ctr"
|
|
||||||
version = "0.8.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea"
|
|
||||||
dependencies = [
|
|
||||||
"cipher 0.3.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ctr"
|
name = "ctr"
|
||||||
version = "0.9.2"
|
version = "0.9.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
|
checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cipher 0.4.4",
|
"cipher",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1571,7 +1528,6 @@ dependencies = [
|
|||||||
"byteorder",
|
"byteorder",
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
"serde",
|
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
@@ -1585,9 +1541,11 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"curve25519-dalek-derive",
|
"curve25519-dalek-derive",
|
||||||
|
"digest 0.10.7",
|
||||||
"fiat-crypto",
|
"fiat-crypto",
|
||||||
"platforms",
|
"platforms",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version 0.4.0",
|
||||||
|
"serde",
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
@@ -1804,8 +1762,9 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "defguard_wireguard_rs"
|
name = "defguard_wireguard_rs"
|
||||||
version = "0.3.0"
|
version = "0.4.2"
|
||||||
source = "git+https://github.com/neacsu/wireguard-rs.git?rev=c2cd0c1119f699f4bc43f5e6ffd6fc242caa42ed#c2cd0c1119f699f4bc43f5e6ffd6fc242caa42ed"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6ba16f17698d4b389907310af018b0c3a80b025bba9c38d947cbc6dd70921743"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.7",
|
"base64 0.21.7",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -1985,20 +1944,10 @@ dependencies = [
|
|||||||
"elliptic-curve",
|
"elliptic-curve",
|
||||||
"rfc6979",
|
"rfc6979",
|
||||||
"serdect",
|
"serdect",
|
||||||
"signature 2.2.0",
|
"signature",
|
||||||
"spki",
|
"spki",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ed25519"
|
|
||||||
version = "1.5.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
|
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
"signature 1.6.4",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ed25519"
|
name = "ed25519"
|
||||||
version = "2.2.3"
|
version = "2.2.3"
|
||||||
@@ -2006,7 +1955,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
|
checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pkcs8",
|
"pkcs8",
|
||||||
"signature 2.2.0",
|
"serde",
|
||||||
|
"signature",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2024,16 +1974,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ed25519-dalek"
|
name = "ed25519-dalek"
|
||||||
version = "1.0.1"
|
version = "2.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"curve25519-dalek 3.2.0",
|
"curve25519-dalek 4.1.2",
|
||||||
"ed25519 1.5.3",
|
"ed25519",
|
||||||
"rand 0.7.3",
|
"rand_core 0.6.4",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"sha2 0.10.8",
|
||||||
"sha2 0.9.9",
|
"subtle 2.5.0",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2143,7 +2093,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "explorer-api"
|
name = "explorer-api"
|
||||||
version = "1.1.34"
|
version = "1.1.36"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 4.5.4",
|
"clap 4.5.4",
|
||||||
@@ -2252,7 +2202,6 @@ version = "0.13.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitvec",
|
|
||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
]
|
]
|
||||||
@@ -2825,33 +2774,13 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hkdf"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "01706d578d5c281058480e673ae4086a9f4710d8df1ad80a5b03e39ece5f886b"
|
|
||||||
dependencies = [
|
|
||||||
"digest 0.9.0",
|
|
||||||
"hmac 0.11.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hkdf"
|
name = "hkdf"
|
||||||
version = "0.12.4"
|
version = "0.12.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
|
checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hmac"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b"
|
|
||||||
dependencies = [
|
|
||||||
"crypto-mac 0.11.0",
|
|
||||||
"digest 0.9.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3409,7 +3338,7 @@ dependencies = [
|
|||||||
"elliptic-curve",
|
"elliptic-curve",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
"signature 2.2.0",
|
"signature",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3688,7 +3617,7 @@ dependencies = [
|
|||||||
"nym-ordered-buffer",
|
"nym-ordered-buffer",
|
||||||
"nym-service-providers-common",
|
"nym-service-providers-common",
|
||||||
"nym-socks5-requests",
|
"nym-socks5-requests",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde-wasm-bindgen 0.6.5",
|
"serde-wasm-bindgen 0.6.5",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -3929,7 +3858,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-api"
|
name = "nym-api"
|
||||||
version = "1.1.38"
|
version = "1.1.40"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -3966,11 +3895,9 @@ dependencies = [
|
|||||||
"nym-inclusion-probability",
|
"nym-inclusion-probability",
|
||||||
"nym-mixnet-contract-common",
|
"nym-mixnet-contract-common",
|
||||||
"nym-multisig-contract-common",
|
"nym-multisig-contract-common",
|
||||||
"nym-name-service-common",
|
|
||||||
"nym-node-requests",
|
"nym-node-requests",
|
||||||
"nym-node-tester-utils",
|
"nym-node-tester-utils",
|
||||||
"nym-pemstore",
|
"nym-pemstore",
|
||||||
"nym-service-provider-directory-common",
|
|
||||||
"nym-sphinx",
|
"nym-sphinx",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
@@ -3978,9 +3905,7 @@ dependencies = [
|
|||||||
"nym-vesting-contract-common",
|
"nym-vesting-contract-common",
|
||||||
"okapi",
|
"okapi",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"rand 0.7.3",
|
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"rand_chacha 0.2.2",
|
|
||||||
"rand_chacha 0.3.1",
|
"rand_chacha 0.3.1",
|
||||||
"reqwest 0.12.4",
|
"reqwest 0.12.4",
|
||||||
"rocket",
|
"rocket",
|
||||||
@@ -4015,6 +3940,7 @@ dependencies = [
|
|||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-mixnet-contract-common",
|
"nym-mixnet-contract-common",
|
||||||
"nym-node-requests",
|
"nym-node-requests",
|
||||||
|
"rocket",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -4046,7 +3972,7 @@ dependencies = [
|
|||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-network-defaults",
|
"nym-network-defaults",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
@@ -4092,7 +4018,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-cli"
|
name = "nym-cli"
|
||||||
version = "1.1.36"
|
version = "1.1.38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.13.1",
|
"base64 0.13.1",
|
||||||
@@ -4151,10 +4077,8 @@ dependencies = [
|
|||||||
"nym-id",
|
"nym-id",
|
||||||
"nym-mixnet-contract-common",
|
"nym-mixnet-contract-common",
|
||||||
"nym-multisig-contract-common",
|
"nym-multisig-contract-common",
|
||||||
"nym-name-service-common",
|
|
||||||
"nym-network-defaults",
|
"nym-network-defaults",
|
||||||
"nym-pemstore",
|
"nym-pemstore",
|
||||||
"nym-service-provider-directory-common",
|
|
||||||
"nym-sphinx",
|
"nym-sphinx",
|
||||||
"nym-types",
|
"nym-types",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
@@ -4173,7 +4097,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-client"
|
name = "nym-client"
|
||||||
version = "1.1.35"
|
version = "1.1.37"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bs58 0.5.1",
|
"bs58 0.5.1",
|
||||||
"clap 4.5.4",
|
"clap 4.5.4",
|
||||||
@@ -4196,7 +4120,7 @@ dependencies = [
|
|||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tap",
|
"tap",
|
||||||
@@ -4244,7 +4168,7 @@ dependencies = [
|
|||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
@@ -4324,7 +4248,7 @@ dependencies = [
|
|||||||
"nym-bin-common",
|
"nym-bin-common",
|
||||||
"nym-node-tester-utils",
|
"nym-node-tester-utils",
|
||||||
"nym-node-tester-wasm",
|
"nym-node-tester-wasm",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde-wasm-bindgen 0.6.5",
|
"serde-wasm-bindgen 0.6.5",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -4413,10 +4337,12 @@ dependencies = [
|
|||||||
"bs58 0.5.1",
|
"bs58 0.5.1",
|
||||||
"cosmwasm-schema",
|
"cosmwasm-schema",
|
||||||
"cosmwasm-std",
|
"cosmwasm-std",
|
||||||
|
"cw-storage-plus",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"vergen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4467,7 +4393,7 @@ dependencies = [
|
|||||||
"nym-credentials-interface",
|
"nym-credentials-interface",
|
||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
"time",
|
||||||
@@ -4488,25 +4414,25 @@ dependencies = [
|
|||||||
name = "nym-crypto"
|
name = "nym-crypto"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes 0.8.4",
|
"aes",
|
||||||
"blake3",
|
"blake3",
|
||||||
"bs58 0.5.1",
|
"bs58 0.5.1",
|
||||||
"cipher 0.4.4",
|
"cipher",
|
||||||
"ctr 0.9.2",
|
"ctr",
|
||||||
"digest 0.10.7",
|
"digest 0.10.7",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"generic-array 0.14.7",
|
"generic-array 0.14.7",
|
||||||
"hkdf 0.12.4",
|
"hkdf",
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
"nym-pemstore",
|
"nym-pemstore",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.3.1",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"subtle-encoding",
|
"subtle-encoding",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"x25519-dalek 1.1.1",
|
"x25519-dalek",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -4533,16 +4459,6 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nym-ephemera-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"cosmwasm-schema",
|
|
||||||
"cosmwasm-std",
|
|
||||||
"cw-utils",
|
|
||||||
"nym-contracts-common",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-execute"
|
name = "nym-execute"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -4628,7 +4544,7 @@ dependencies = [
|
|||||||
"nym-wireguard",
|
"nym-wireguard",
|
||||||
"nym-wireguard-types",
|
"nym-wireguard-types",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
@@ -4661,7 +4577,7 @@ dependencies = [
|
|||||||
"nym-sphinx",
|
"nym-sphinx",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"si-scale",
|
"si-scale",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -4690,7 +4606,7 @@ dependencies = [
|
|||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-pemstore",
|
"nym-pemstore",
|
||||||
"nym-sphinx",
|
"nym-sphinx",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -4781,6 +4697,7 @@ dependencies = [
|
|||||||
"bincode",
|
"bincode",
|
||||||
"bytes",
|
"bytes",
|
||||||
"nym-bin-common",
|
"nym-bin-common",
|
||||||
|
"nym-crypto",
|
||||||
"nym-sphinx",
|
"nym-sphinx",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -4825,6 +4742,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"tap",
|
"tap",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-tun",
|
"tokio-tun",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
@@ -4918,7 +4836,7 @@ dependencies = [
|
|||||||
"nym-topology",
|
"nym-topology",
|
||||||
"nym-types",
|
"nym-types",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sysinfo 0.27.8",
|
"sysinfo 0.27.8",
|
||||||
@@ -4975,20 +4893,6 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nym-name-service-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"cosmwasm-schema",
|
|
||||||
"cosmwasm-std",
|
|
||||||
"cw-controllers",
|
|
||||||
"cw-utils",
|
|
||||||
"cw2",
|
|
||||||
"nym-contracts-common",
|
|
||||||
"serde",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-network-defaults"
|
name = "nym-network-defaults"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5006,7 +4910,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-network-requester"
|
name = "nym-network-requester"
|
||||||
version = "1.1.36"
|
version = "1.1.38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"addr",
|
"addr",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -5040,7 +4944,7 @@ dependencies = [
|
|||||||
"nym-types",
|
"nym-types",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"publicsuffix",
|
"publicsuffix",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"regex",
|
"regex",
|
||||||
"reqwest 0.12.4",
|
"reqwest 0.12.4",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -5075,7 +4979,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-node"
|
name = "nym-node"
|
||||||
version = "1.1.2"
|
version = "1.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bip39",
|
"bip39",
|
||||||
@@ -5101,8 +5005,9 @@ dependencies = [
|
|||||||
"nym-sphinx-addressing",
|
"nym-sphinx-addressing",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-types",
|
"nym-types",
|
||||||
|
"nym-wireguard",
|
||||||
"nym-wireguard-types",
|
"nym-wireguard-types",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"semver 1.0.23",
|
"semver 1.0.23",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -5126,7 +5031,7 @@ dependencies = [
|
|||||||
"dashmap",
|
"dashmap",
|
||||||
"fastrand 2.1.0",
|
"fastrand 2.1.0",
|
||||||
"headers",
|
"headers",
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
"hyper 1.3.1",
|
"hyper 1.3.1",
|
||||||
"ipnetwork 0.16.0",
|
"ipnetwork 0.16.0",
|
||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
@@ -5136,7 +5041,7 @@ dependencies = [
|
|||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-wireguard",
|
"nym-wireguard",
|
||||||
"nym-wireguard-types",
|
"nym-wireguard-types",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
"time",
|
||||||
@@ -5146,7 +5051,7 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
"utoipa",
|
"utoipa",
|
||||||
"utoipa-swagger-ui",
|
"utoipa-swagger-ui",
|
||||||
"x25519-dalek 2.0.1",
|
"x25519-dalek",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5163,7 +5068,7 @@ dependencies = [
|
|||||||
"nym-exit-policy",
|
"nym-exit-policy",
|
||||||
"nym-http-api-client",
|
"nym-http-api-client",
|
||||||
"nym-wireguard-types",
|
"nym-wireguard-types",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.3.1",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -5184,7 +5089,7 @@ dependencies = [
|
|||||||
"nym-sphinx-params",
|
"nym-sphinx-params",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -5199,7 +5104,7 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"nym-node-tester-utils",
|
"nym-node-tester-utils",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde-wasm-bindgen 0.6.5",
|
"serde-wasm-bindgen 0.6.5",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -5254,11 +5159,11 @@ dependencies = [
|
|||||||
"chacha20",
|
"chacha20",
|
||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
"criterion",
|
"criterion",
|
||||||
"curve25519-dalek 3.2.0",
|
"curve25519-dalek 4.1.2",
|
||||||
"fastrand 1.9.0",
|
"fastrand 1.9.0",
|
||||||
"getrandom 0.2.15",
|
"getrandom 0.2.15",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"rayon",
|
"rayon",
|
||||||
"sphinx-packet",
|
"sphinx-packet",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -5306,7 +5211,7 @@ dependencies = [
|
|||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"parking_lot 0.12.2",
|
"parking_lot 0.12.2",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"reqwest 0.12.4",
|
"reqwest 0.12.4",
|
||||||
"tap",
|
"tap",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -5317,19 +5222,6 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nym-service-provider-directory-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"cosmwasm-schema",
|
|
||||||
"cosmwasm-std",
|
|
||||||
"cw-controllers",
|
|
||||||
"cw-utils",
|
|
||||||
"cw2",
|
|
||||||
"nym-contracts-common",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-service-providers-common"
|
name = "nym-service-providers-common"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5349,7 +5241,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-socks5-client"
|
name = "nym-socks5-client"
|
||||||
version = "1.1.35"
|
version = "1.1.37"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bs58 0.5.1",
|
"bs58 0.5.1",
|
||||||
"clap 4.5.4",
|
"clap 4.5.4",
|
||||||
@@ -5368,7 +5260,7 @@ dependencies = [
|
|||||||
"nym-socks5-client-core",
|
"nym-socks5-client-core",
|
||||||
"nym-sphinx",
|
"nym-sphinx",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tap",
|
"tap",
|
||||||
@@ -5401,7 +5293,7 @@ dependencies = [
|
|||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"reqwest 0.12.4",
|
"reqwest 0.12.4",
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -5427,7 +5319,7 @@ dependencies = [
|
|||||||
"nym-credential-storage",
|
"nym-credential-storage",
|
||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-socks5-client-core",
|
"nym-socks5-client-core",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"safer-ffi",
|
"safer-ffi",
|
||||||
"serde",
|
"serde",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -5481,7 +5373,7 @@ dependencies = [
|
|||||||
"nym-sphinx-routing",
|
"nym-sphinx-routing",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"rand_distr",
|
"rand_distr",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -5499,7 +5391,7 @@ dependencies = [
|
|||||||
"nym-sphinx-routing",
|
"nym-sphinx-routing",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
@@ -5511,7 +5403,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
@@ -5527,8 +5419,8 @@ dependencies = [
|
|||||||
"nym-sphinx-routing",
|
"nym-sphinx-routing",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.3.1",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
@@ -5542,7 +5434,7 @@ dependencies = [
|
|||||||
"nym-sphinx-addressing",
|
"nym-sphinx-addressing",
|
||||||
"nym-sphinx-params",
|
"nym-sphinx-params",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5559,7 +5451,7 @@ dependencies = [
|
|||||||
"nym-sphinx-routing",
|
"nym-sphinx-routing",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -5670,7 +5562,7 @@ dependencies = [
|
|||||||
"nym-sphinx-addressing",
|
"nym-sphinx-addressing",
|
||||||
"nym-sphinx-routing",
|
"nym-sphinx-routing",
|
||||||
"nym-sphinx-types",
|
"nym-sphinx-types",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"semver 0.11.0",
|
"semver 0.11.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@@ -5700,7 +5592,7 @@ dependencies = [
|
|||||||
"cosmrs 0.15.0 (git+https://github.com/jstuczyn/cosmos-rust?branch=nym-temp/all-validator-features)",
|
"cosmrs 0.15.0 (git+https://github.com/jstuczyn/cosmos-rust?branch=nym-temp/all-validator-features)",
|
||||||
"cosmwasm-std",
|
"cosmwasm-std",
|
||||||
"eyre",
|
"eyre",
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
"itertools 0.11.0",
|
"itertools 0.11.0",
|
||||||
"log",
|
"log",
|
||||||
"nym-config",
|
"nym-config",
|
||||||
@@ -5718,7 +5610,7 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
"ts-rs",
|
"ts-rs",
|
||||||
"url",
|
"url",
|
||||||
"x25519-dalek 2.0.1",
|
"x25519-dalek",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5748,14 +5640,11 @@ dependencies = [
|
|||||||
"nym-coconut-dkg-common",
|
"nym-coconut-dkg-common",
|
||||||
"nym-config",
|
"nym-config",
|
||||||
"nym-contracts-common",
|
"nym-contracts-common",
|
||||||
"nym-ephemera-common",
|
|
||||||
"nym-group-contract-common",
|
"nym-group-contract-common",
|
||||||
"nym-http-api-client",
|
"nym-http-api-client",
|
||||||
"nym-mixnet-contract-common",
|
"nym-mixnet-contract-common",
|
||||||
"nym-multisig-contract-common",
|
"nym-multisig-contract-common",
|
||||||
"nym-name-service-common",
|
|
||||||
"nym-network-defaults",
|
"nym-network-defaults",
|
||||||
"nym-service-provider-directory-common",
|
|
||||||
"nym-vesting-contract-common",
|
"nym-vesting-contract-common",
|
||||||
"prost 0.12.4",
|
"prost 0.12.4",
|
||||||
"reqwest 0.12.4",
|
"reqwest 0.12.4",
|
||||||
@@ -5843,14 +5732,17 @@ name = "nym-wireguard"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.7",
|
"base64 0.21.7",
|
||||||
|
"dashmap",
|
||||||
"defguard_wireguard_rs",
|
"defguard_wireguard_rs",
|
||||||
"ip_network",
|
"ip_network",
|
||||||
"log",
|
"log",
|
||||||
|
"nym-crypto",
|
||||||
"nym-network-defaults",
|
"nym-network-defaults",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-wireguard-types",
|
"nym-wireguard-types",
|
||||||
"tokio",
|
"tokio",
|
||||||
"x25519-dalek 2.0.1",
|
"tokio-stream",
|
||||||
|
"x25519-dalek",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5859,23 +5751,23 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.7",
|
"base64 0.21.7",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
"log",
|
"log",
|
||||||
"nym-config",
|
"nym-config",
|
||||||
"nym-crypto",
|
"nym-crypto",
|
||||||
"nym-network-defaults",
|
"nym-network-defaults",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"utoipa",
|
"utoipa",
|
||||||
"x25519-dalek 2.0.1",
|
"x25519-dalek",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nymvisor"
|
name = "nymvisor"
|
||||||
version = "0.1.1"
|
version = "0.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bytes",
|
"bytes",
|
||||||
@@ -6187,16 +6079,6 @@ version = "1.0.15"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pbkdf2"
|
|
||||||
version = "0.12.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
|
||||||
dependencies = [
|
|
||||||
"digest 0.10.7",
|
|
||||||
"hmac 0.12.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pear"
|
name = "pear"
|
||||||
version = "0.2.9"
|
version = "0.2.9"
|
||||||
@@ -6753,12 +6635,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rand_distr"
|
name = "rand_distr"
|
||||||
version = "0.3.0"
|
version = "0.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c9e9532ada3929fb8b2e9dbe28d1e06c9b2cc65813f074fcb6bd5fbefeff9d56"
|
checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -7072,7 +6954,7 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hmac 0.12.1",
|
"hmac",
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -7864,12 +7746,6 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "signature"
|
|
||||||
version = "1.6.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "signature"
|
name = "signature"
|
||||||
version = "2.2.0"
|
version = "2.2.0"
|
||||||
@@ -7940,25 +7816,26 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sphinx-packet"
|
name = "sphinx-packet"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cc43eda802856ee82a7555c7b75ceb9e07451741c7a2f5f23d036020e01189d4"
|
checksum = "dabeca95bf5fd0563d6be7ebcb1c6a9fcb135746a0ba9050c47dc68c8607e595"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes 0.7.5",
|
"aes",
|
||||||
"arrayref",
|
"arrayref",
|
||||||
"blake2 0.8.1",
|
"blake2 0.8.1",
|
||||||
"bs58 0.4.0",
|
"bs58 0.5.1",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"chacha",
|
"chacha",
|
||||||
"curve25519-dalek 3.2.0",
|
"ctr",
|
||||||
"digest 0.9.0",
|
"curve25519-dalek 4.1.2",
|
||||||
"hkdf 0.11.0",
|
"digest 0.10.7",
|
||||||
"hmac 0.11.0",
|
"hkdf",
|
||||||
|
"hmac",
|
||||||
"lioness",
|
"lioness",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"rand_distr",
|
"rand_distr",
|
||||||
"sha2 0.9.9",
|
"sha2 0.10.8",
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -8349,7 +8226,7 @@ checksum = "15ab8f0a25d0d2ad49ac615da054d6a76aa6603ff95f7d18bafdd34450a1a04b"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"digest 0.10.7",
|
"digest 0.10.7",
|
||||||
"ed25519 2.2.3",
|
"ed25519",
|
||||||
"ed25519-consensus",
|
"ed25519-consensus",
|
||||||
"flex-error",
|
"flex-error",
|
||||||
"futures",
|
"futures",
|
||||||
@@ -8364,7 +8241,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_repr",
|
"serde_repr",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
"signature 2.2.0",
|
"signature",
|
||||||
"subtle 2.5.0",
|
"subtle 2.5.0",
|
||||||
"subtle-encoding",
|
"subtle-encoding",
|
||||||
"tendermint-proto",
|
"tendermint-proto",
|
||||||
@@ -9338,11 +9215,14 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vergen"
|
name = "vergen"
|
||||||
version = "8.2.6"
|
version = "8.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939"
|
checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"cargo_metadata",
|
||||||
|
"cfg-if",
|
||||||
|
"regex",
|
||||||
"rustc_version 0.4.0",
|
"rustc_version 0.4.0",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"time",
|
"time",
|
||||||
@@ -9500,7 +9380,7 @@ dependencies = [
|
|||||||
"nym-task",
|
"nym-task",
|
||||||
"nym-topology",
|
"nym-topology",
|
||||||
"nym-validator-client",
|
"nym-validator-client",
|
||||||
"rand 0.7.3",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde-wasm-bindgen 0.6.5",
|
"serde-wasm-bindgen 0.6.5",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -9956,18 +9836,6 @@ dependencies = [
|
|||||||
"tap",
|
"tap",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "x25519-dalek"
|
|
||||||
version = "1.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f"
|
|
||||||
dependencies = [
|
|
||||||
"curve25519-dalek 3.2.0",
|
|
||||||
"rand_core 0.5.1",
|
|
||||||
"serde",
|
|
||||||
"zeroize",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "x25519-dalek"
|
name = "x25519-dalek"
|
||||||
version = "2.0.1"
|
version = "2.0.1"
|
||||||
|
|||||||
+19
-22
@@ -35,12 +35,9 @@ members = [
|
|||||||
"common/cosmwasm-smart-contracts/coconut-bandwidth-contract",
|
"common/cosmwasm-smart-contracts/coconut-bandwidth-contract",
|
||||||
"common/cosmwasm-smart-contracts/coconut-dkg",
|
"common/cosmwasm-smart-contracts/coconut-dkg",
|
||||||
"common/cosmwasm-smart-contracts/contracts-common",
|
"common/cosmwasm-smart-contracts/contracts-common",
|
||||||
# "common/cosmwasm-smart-contracts/ephemera",
|
|
||||||
"common/cosmwasm-smart-contracts/group-contract",
|
"common/cosmwasm-smart-contracts/group-contract",
|
||||||
"common/cosmwasm-smart-contracts/mixnet-contract",
|
"common/cosmwasm-smart-contracts/mixnet-contract",
|
||||||
"common/cosmwasm-smart-contracts/multisig-contract",
|
"common/cosmwasm-smart-contracts/multisig-contract",
|
||||||
"common/cosmwasm-smart-contracts/name-service",
|
|
||||||
"common/cosmwasm-smart-contracts/service-provider-directory",
|
|
||||||
"common/cosmwasm-smart-contracts/vesting-contract",
|
"common/cosmwasm-smart-contracts/vesting-contract",
|
||||||
"common/country-group",
|
"common/country-group",
|
||||||
"common/credential-storage",
|
"common/credential-storage",
|
||||||
@@ -119,7 +116,7 @@ members = [
|
|||||||
"tools/nymvisor",
|
"tools/nymvisor",
|
||||||
"tools/ts-rs-cli",
|
"tools/ts-rs-cli",
|
||||||
"wasm/client",
|
"wasm/client",
|
||||||
# "wasm/full-nym-wasm",
|
# "wasm/full-nym-wasm", # If we uncomment this again, remember to also uncomment the profile settings below
|
||||||
"wasm/mix-fetch",
|
"wasm/mix-fetch",
|
||||||
"wasm/node-tester",
|
"wasm/node-tester",
|
||||||
"wasm/zknym-lib",
|
"wasm/zknym-lib",
|
||||||
@@ -143,9 +140,6 @@ exclude = [
|
|||||||
"explorer",
|
"explorer",
|
||||||
"contracts",
|
"contracts",
|
||||||
"nym-wallet",
|
"nym-wallet",
|
||||||
"nym-connect/mobile/src-tauri",
|
|
||||||
"nym-connect/desktop",
|
|
||||||
"nym-vpn/ui/src-tauri",
|
|
||||||
"cpu-cycles",
|
"cpu-cycles",
|
||||||
"sdk/ffi/cpp",
|
"sdk/ffi/cpp",
|
||||||
]
|
]
|
||||||
@@ -172,7 +166,7 @@ bincode = "1.3.3"
|
|||||||
bip39 = { version = "2.0.0", features = ["zeroize"] }
|
bip39 = { version = "2.0.0", features = ["zeroize"] }
|
||||||
bitvec = "1.0.0"
|
bitvec = "1.0.0"
|
||||||
blake3 = "1.3.1"
|
blake3 = "1.3.1"
|
||||||
bs58 = "0.5.0"
|
bs58 = "0.5.1"
|
||||||
bytecodec = "0.4.15"
|
bytecodec = "0.4.15"
|
||||||
bytes = "1.5.0"
|
bytes = "1.5.0"
|
||||||
cargo_metadata = "0.18.1"
|
cargo_metadata = "0.18.1"
|
||||||
@@ -195,13 +189,13 @@ criterion = "0.4"
|
|||||||
csv = "1.3.0"
|
csv = "1.3.0"
|
||||||
ctr = "0.9.1"
|
ctr = "0.9.1"
|
||||||
cupid = "0.6.1"
|
cupid = "0.6.1"
|
||||||
curve25519-dalek = "3.2"
|
curve25519-dalek = "4.1"
|
||||||
dashmap = "5.5.3"
|
dashmap = "5.5.3"
|
||||||
defguard_wireguard_rs = { git = "https://github.com/neacsu/wireguard-rs.git", rev = "c2cd0c1119f699f4bc43f5e6ffd6fc242caa42ed" }
|
defguard_wireguard_rs = "0.4.2"
|
||||||
doc-comment = "0.3"
|
doc-comment = "0.3"
|
||||||
dotenvy = "0.15.6"
|
dotenvy = "0.15.6"
|
||||||
ecdsa = "0.16"
|
ecdsa = "0.16"
|
||||||
ed25519-dalek = "1.0"
|
ed25519-dalek = "2.1"
|
||||||
etherparse = "0.13.0"
|
etherparse = "0.13.0"
|
||||||
eyre = "0.6.9"
|
eyre = "0.6.9"
|
||||||
flate2 = "1.0.28"
|
flate2 = "1.0.28"
|
||||||
@@ -247,7 +241,7 @@ rand = "0.8.5"
|
|||||||
rand-07 = "0.7.3"
|
rand-07 = "0.7.3"
|
||||||
rand_chacha_02 = "0.2"
|
rand_chacha_02 = "0.2"
|
||||||
rand_core = "0.6.3"
|
rand_core = "0.6.3"
|
||||||
rand_distr = "0.3"
|
rand_distr = "0.4"
|
||||||
rand_pcg = "0.3.1"
|
rand_pcg = "0.3.1"
|
||||||
rand_seeder = "0.2.3"
|
rand_seeder = "0.2.3"
|
||||||
rayon = "1.5.1"
|
rayon = "1.5.1"
|
||||||
@@ -266,7 +260,7 @@ serde_repr = "0.1"
|
|||||||
serde_with = "3.4.0"
|
serde_with = "3.4.0"
|
||||||
serde_yaml = "0.9.25"
|
serde_yaml = "0.9.25"
|
||||||
si-scale = "0.2.2"
|
si-scale = "0.2.2"
|
||||||
sphinx-packet = "0.1.0"
|
sphinx-packet = "0.1.1"
|
||||||
sqlx = "0.6.3"
|
sqlx = "0.6.3"
|
||||||
strum = "0.25"
|
strum = "0.25"
|
||||||
subtle-encoding = "0.5"
|
subtle-encoding = "0.5"
|
||||||
@@ -292,7 +286,7 @@ tungstenite = { version = "0.20.1", default-features = false }
|
|||||||
url = "2.4"
|
url = "2.4"
|
||||||
utoipa = "4.2.0"
|
utoipa = "4.2.0"
|
||||||
utoipa-swagger-ui = "6.0.0"
|
utoipa-swagger-ui = "6.0.0"
|
||||||
vergen = { version = "=8.2.6", default-features = false }
|
vergen = { version = "=8.3.1", default-features = false }
|
||||||
walkdir = "2"
|
walkdir = "2"
|
||||||
wasm-bindgen-test = "0.3.36"
|
wasm-bindgen-test = "0.3.36"
|
||||||
zeroize = "1.6.0"
|
zeroize = "1.6.0"
|
||||||
@@ -302,9 +296,9 @@ prometheus = { version = "0.13.0" }
|
|||||||
# coconut/DKG related
|
# coconut/DKG related
|
||||||
# unfortunately until https://github.com/zkcrypto/bls12_381/issues/10 is resolved, we have to rely on the fork
|
# unfortunately until https://github.com/zkcrypto/bls12_381/issues/10 is resolved, we have to rely on the fork
|
||||||
# as we need to be able to serialize Gt so that we could create the lookup table for baby-step-giant-step algorithm
|
# as we need to be able to serialize Gt so that we could create the lookup table for baby-step-giant-step algorithm
|
||||||
bls12_381 = { git = "https://github.com/jstuczyn/bls12_381", branch = "feature/gt-serialization-0.8.0" }
|
bls12_381 = { git = "https://github.com/jstuczyn/bls12_381", default-features = false, branch = "feature/gt-serialization-0.8.0" }
|
||||||
group = "0.13.0"
|
group = { version = "0.13.0", default-features = false }
|
||||||
ff = "0.13.0"
|
ff = { version = "0.13.0", default-features = false }
|
||||||
|
|
||||||
# cosmwasm-related
|
# cosmwasm-related
|
||||||
cosmwasm-derive = "=1.4.3"
|
cosmwasm-derive = "=1.4.3"
|
||||||
@@ -323,14 +317,14 @@ cw4 = { version = "=1.1.2" }
|
|||||||
cw-controllers = { version = "=1.1.0" }
|
cw-controllers = { version = "=1.1.0" }
|
||||||
|
|
||||||
# cosmrs-related
|
# cosmrs-related
|
||||||
bip32 = "0.5.1"
|
bip32 = { version = "0.5.1", default-features = false }
|
||||||
|
|
||||||
# temporarily using a fork again (yay.) because we need staking and slashing support
|
# temporarily using a fork again (yay.) because we need staking and slashing support
|
||||||
cosmrs = { git = "https://github.com/jstuczyn/cosmos-rust", branch = "nym-temp/all-validator-features" }
|
cosmrs = { git = "https://github.com/jstuczyn/cosmos-rust", branch = "nym-temp/all-validator-features" }
|
||||||
#cosmrs = { git = "https://github.com/jstuczyn/cosmos-rust", branch = "nym-temp/all-validator-features" } # unfortuntely we need a fork by yours truly to get the staking support
|
#cosmrs = { git = "https://github.com/jstuczyn/cosmos-rust", branch = "nym-temp/all-validator-features" } # unfortuntely we need a fork by yours truly to get the staking support
|
||||||
tendermint = "0.34" # same version as used by cosmrs
|
tendermint = "0.34" # same version as used by cosmrs
|
||||||
tendermint-rpc = "0.34" # same version as used by cosmrs
|
tendermint-rpc = "0.34" # same version as used by cosmrs
|
||||||
prost = "0.12"
|
prost = { version = "0.12", default-features = false }
|
||||||
|
|
||||||
# wasm-related dependencies
|
# wasm-related dependencies
|
||||||
gloo-utils = "0.2.0"
|
gloo-utils = "0.2.0"
|
||||||
@@ -358,9 +352,12 @@ opt-level = 'z'
|
|||||||
# lto = true
|
# lto = true
|
||||||
opt-level = 'z'
|
opt-level = 'z'
|
||||||
|
|
||||||
[profile.release.package.nym-wasm-sdk]
|
# Commented out since the crate is also commented out from the inclusion in the
|
||||||
# lto = true
|
# workspace above. We should uncomment this if we re-include it in the
|
||||||
opt-level = 'z'
|
# workspace
|
||||||
|
#[profile.release.package.nym-wasm-sdk]
|
||||||
|
## lto = true
|
||||||
|
#opt-level = 'z'
|
||||||
|
|
||||||
[profile.release.package.mix-fetch-wasm]
|
[profile.release.package.mix-fetch-wasm]
|
||||||
# lto = true
|
# lto = true
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ endef
|
|||||||
$(eval $(call add_cargo_workspace,main,.))
|
$(eval $(call add_cargo_workspace,main,.))
|
||||||
$(eval $(call add_cargo_workspace,contracts,contracts,--lib --target wasm32-unknown-unknown,RUSTFLAGS='-C link-arg=-s'))
|
$(eval $(call add_cargo_workspace,contracts,contracts,--lib --target wasm32-unknown-unknown,RUSTFLAGS='-C link-arg=-s'))
|
||||||
$(eval $(call add_cargo_workspace,wallet,nym-wallet))
|
$(eval $(call add_cargo_workspace,wallet,nym-wallet))
|
||||||
$(eval $(call add_cargo_workspace,connect,nym-connect/desktop))
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# SDK
|
# SDK
|
||||||
@@ -134,7 +133,7 @@ clippy: sdk-wasm-lint
|
|||||||
# Build contracts ready for deploy
|
# Build contracts ready for deploy
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
CONTRACTS=vesting_contract mixnet_contract nym_service_provider_directory nym_name_service
|
CONTRACTS=vesting_contract mixnet_contract
|
||||||
CONTRACTS_WASM=$(addsuffix .wasm, $(CONTRACTS))
|
CONTRACTS_WASM=$(addsuffix .wasm, $(CONTRACTS))
|
||||||
CONTRACTS_OUT_DIR=contracts/target/wasm32-unknown-unknown/release
|
CONTRACTS_OUT_DIR=contracts/target/wasm32-unknown-unknown/release
|
||||||
|
|
||||||
@@ -186,4 +185,4 @@ deb-gateway: build-nym-gateway
|
|||||||
deb-cli: build-nym-cli
|
deb-cli: build-nym-cli
|
||||||
cargo deb -p nym-cli
|
cargo deb -p nym-cli
|
||||||
|
|
||||||
deb: deb-mixnode deb-gateway deb-cli
|
deb: deb-mixnode deb-gateway deb-cli
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nym-client"
|
name = "nym-client"
|
||||||
version = "1.1.35"
|
version = "1.1.37"
|
||||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||||
description = "Implementation of the Nym Client"
|
description = "Implementation of the Nym Client"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -25,7 +25,7 @@ bs58 = { workspace = true }
|
|||||||
clap = { workspace = true, features = ["cargo", "derive"] }
|
clap = { workspace = true, features = ["cargo", "derive"] }
|
||||||
dirs = "4.0"
|
dirs = "4.0"
|
||||||
log = { workspace = true } # self explanatory
|
log = { workspace = true } # self explanatory
|
||||||
rand = { version = "0.7.3", features = ["wasm-bindgen"] } # rng-related traits + some rng implementation to use
|
rand = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] } # for config serialization/deserialization
|
serde = { workspace = true, features = ["derive"] } # for config serialization/deserialization
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
|||||||
+78
-236
@@ -744,6 +744,18 @@
|
|||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/braces": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"fill-range": "^7.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/browserslist": {
|
"node_modules/browserslist": {
|
||||||
"version": "4.20.2",
|
"version": "4.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
|
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
|
||||||
@@ -862,51 +874,6 @@
|
|||||||
"fsevents": "~2.3.2"
|
"fsevents": "~2.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chokidar/node_modules/braces": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"fill-range": "^7.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/chokidar/node_modules/fill-range": {
|
|
||||||
"version": "7.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/chokidar/node_modules/is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/chokidar/node_modules/to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/chrome-trace-event": {
|
"node_modules/chrome-trace-event": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",
|
||||||
@@ -1593,39 +1560,6 @@
|
|||||||
"node": ">=8.6.0"
|
"node": ">=8.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fast-glob/node_modules/braces": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"fill-range": "^7.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-glob/node_modules/fill-range": {
|
|
||||||
"version": "7.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-glob/node_modules/is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-glob/node_modules/micromatch": {
|
"node_modules/fast-glob/node_modules/micromatch": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||||
@@ -1639,18 +1573,6 @@
|
|||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fast-glob/node_modules/to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fast-json-stable-stringify": {
|
"node_modules/fast-json-stable-stringify": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||||
@@ -1683,6 +1605,18 @@
|
|||||||
"node": ">=0.8.0"
|
"node": ">=0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fill-range": {
|
||||||
|
"version": "7.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"to-regex-range": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/finalhandler": {
|
"node_modules/finalhandler": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
||||||
@@ -2137,39 +2071,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/http-proxy-middleware/node_modules/braces": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"fill-range": "^7.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/http-proxy-middleware/node_modules/fill-range": {
|
|
||||||
"version": "7.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/http-proxy-middleware/node_modules/is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.12.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/http-proxy-middleware/node_modules/micromatch": {
|
"node_modules/http-proxy-middleware/node_modules/micromatch": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||||
@@ -2183,18 +2084,6 @@
|
|||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/http-proxy-middleware/node_modules/to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/human-signals": {
|
"node_modules/human-signals": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
||||||
@@ -2361,6 +2250,15 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-number": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-path-cwd": {
|
"node_modules/is-path-cwd": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
||||||
@@ -3853,6 +3751,18 @@
|
|||||||
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/to-regex-range": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"is-number": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/toidentifier": {
|
"node_modules/toidentifier": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||||
@@ -5213,6 +5123,15 @@
|
|||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"braces": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"fill-range": "^7.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"version": "4.20.2",
|
"version": "4.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
|
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
|
||||||
@@ -5283,41 +5202,6 @@
|
|||||||
"is-glob": "~4.0.1",
|
"is-glob": "~4.0.1",
|
||||||
"normalize-path": "~3.0.0",
|
"normalize-path": "~3.0.0",
|
||||||
"readdirp": "~3.6.0"
|
"readdirp": "~3.6.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"braces": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fill-range": "^7.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fill-range": {
|
|
||||||
"version": "7.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chrome-trace-event": {
|
"chrome-trace-event": {
|
||||||
@@ -5852,30 +5736,6 @@
|
|||||||
"micromatch": "^4.0.4"
|
"micromatch": "^4.0.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fill-range": "^7.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fill-range": {
|
|
||||||
"version": "7.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"micromatch": {
|
"micromatch": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||||
@@ -5885,15 +5745,6 @@
|
|||||||
"braces": "^3.0.1",
|
"braces": "^3.0.1",
|
||||||
"picomatch": "^2.2.3"
|
"picomatch": "^2.2.3"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -5926,6 +5777,15 @@
|
|||||||
"websocket-driver": ">=0.5.1"
|
"websocket-driver": ">=0.5.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fill-range": {
|
||||||
|
"version": "7.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"to-regex-range": "^5.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"finalhandler": {
|
"finalhandler": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
||||||
@@ -6247,30 +6107,6 @@
|
|||||||
"micromatch": "^4.0.2"
|
"micromatch": "^4.0.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fill-range": "^7.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fill-range": {
|
|
||||||
"version": "7.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"to-regex-range": "^5.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"is-number": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"micromatch": {
|
"micromatch": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||||
@@ -6280,15 +6116,6 @@
|
|||||||
"braces": "^3.0.1",
|
"braces": "^3.0.1",
|
||||||
"picomatch": "^2.2.3"
|
"picomatch": "^2.2.3"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"to-regex-range": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"is-number": "^7.0.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -6407,6 +6234,12 @@
|
|||||||
"is-extglob": "^2.1.1"
|
"is-extglob": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"is-number": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"is-path-cwd": {
|
"is-path-cwd": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
||||||
@@ -7524,6 +7357,15 @@
|
|||||||
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"to-regex-range": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"is-number": "^7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"toidentifier": {
|
"toidentifier": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ impl From<Init> for OverrideConfig {
|
|||||||
fn from(init_config: Init) -> Self {
|
fn from(init_config: Init) -> Self {
|
||||||
OverrideConfig {
|
OverrideConfig {
|
||||||
nym_apis: init_config.common_args.nym_apis,
|
nym_apis: init_config.common_args.nym_apis,
|
||||||
|
fronting_domains: init_config.common_args.fronting_domains,
|
||||||
disable_socket: init_config.disable_socket,
|
disable_socket: init_config.disable_socket,
|
||||||
port: init_config.port,
|
port: init_config.port,
|
||||||
host: init_config.host,
|
host: init_config.host,
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ pub(crate) enum Commands {
|
|||||||
// Configuration that can be overridden.
|
// Configuration that can be overridden.
|
||||||
pub(crate) struct OverrideConfig {
|
pub(crate) struct OverrideConfig {
|
||||||
nym_apis: Option<Vec<url::Url>>,
|
nym_apis: Option<Vec<url::Url>>,
|
||||||
|
fronting_domains: Option<Vec<url::Url>>,
|
||||||
disable_socket: Option<bool>,
|
disable_socket: Option<bool>,
|
||||||
port: Option<u16>,
|
port: Option<u16>,
|
||||||
host: Option<IpAddr>,
|
host: Option<IpAddr>,
|
||||||
@@ -133,6 +134,10 @@ pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config {
|
|||||||
.with_base(BaseClientConfig::with_disabled_cover_traffic, args.no_cover)
|
.with_base(BaseClientConfig::with_disabled_cover_traffic, args.no_cover)
|
||||||
.with_optional(Config::with_port, args.port)
|
.with_optional(Config::with_port, args.port)
|
||||||
.with_optional(Config::with_host, args.host)
|
.with_optional(Config::with_host, args.host)
|
||||||
|
.with_optional_ext(
|
||||||
|
BaseClientConfig::with_fronting_domains,
|
||||||
|
args.fronting_domains,
|
||||||
|
)
|
||||||
.with_optional_custom_env_ext(
|
.with_optional_custom_env_ext(
|
||||||
BaseClientConfig::with_custom_nym_apis,
|
BaseClientConfig::with_custom_nym_apis,
|
||||||
args.nym_apis,
|
args.nym_apis,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ impl From<Run> for OverrideConfig {
|
|||||||
fn from(run_config: Run) -> Self {
|
fn from(run_config: Run) -> Self {
|
||||||
OverrideConfig {
|
OverrideConfig {
|
||||||
nym_apis: run_config.common_args.nym_apis,
|
nym_apis: run_config.common_args.nym_apis,
|
||||||
|
fronting_domains: run_config.common_args.fronting_domains,
|
||||||
disable_socket: run_config.disable_socket,
|
disable_socket: run_config.disable_socket,
|
||||||
port: run_config.port,
|
port: run_config.port,
|
||||||
host: run_config.host,
|
host: run_config.host,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nym-socks5-client"
|
name = "nym-socks5-client"
|
||||||
version = "1.1.35"
|
version = "1.1.37"
|
||||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
|
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
|
||||||
description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address"
|
description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -16,7 +16,7 @@ serde_json = { workspace = true }
|
|||||||
tap = { workspace = true }
|
tap = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
tokio = { workspace = true, features = ["rt-multi-thread", "net", "signal"] }
|
tokio = { workspace = true, features = ["rt-multi-thread", "net", "signal"] }
|
||||||
rand = "0.7.3"
|
rand = { workspace = true }
|
||||||
time = { workspace = true }
|
time = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
zeroize = { workspace = true }
|
zeroize = { workspace = true }
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ license.workspace = true
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
bip39 = { workspace = true }
|
bip39 = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
rand = "0.7.3"
|
rand = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
zeroize = { workspace = true }
|
zeroize = { workspace = true }
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ clap = { workspace = true, optional = true }
|
|||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
humantime-serde = { workspace = true }
|
humantime-serde = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
|
rand = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
sha2 = "0.10.6"
|
sha2 = "0.10.6"
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ const DEFAULT_MESSAGE_STREAM_AVERAGE_DELAY: Duration = Duration::from_millis(20)
|
|||||||
const DEFAULT_AVERAGE_PACKET_DELAY: Duration = Duration::from_millis(50);
|
const DEFAULT_AVERAGE_PACKET_DELAY: Duration = Duration::from_millis(50);
|
||||||
const DEFAULT_TOPOLOGY_REFRESH_RATE: Duration = Duration::from_secs(5 * 60); // every 5min
|
const DEFAULT_TOPOLOGY_REFRESH_RATE: Duration = Duration::from_secs(5 * 60); // every 5min
|
||||||
const DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT: Duration = Duration::from_millis(5_000);
|
const DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT: Duration = Duration::from_millis(5_000);
|
||||||
|
|
||||||
|
// the same values as our current (10.06.24) blacklist
|
||||||
|
const DEFAULT_MIN_MIXNODE_PERFORMANCE: u8 = 50;
|
||||||
|
const DEFAULT_MIN_GATEWAY_PERFORMANCE: u8 = 50;
|
||||||
|
|
||||||
const DEFAULT_MAX_STARTUP_GATEWAY_WAITING_PERIOD: Duration = Duration::from_secs(70 * 60); // 70min -> full epoch (1h) + a bit of overhead
|
const DEFAULT_MAX_STARTUP_GATEWAY_WAITING_PERIOD: Duration = Duration::from_secs(70 * 60); // 70min -> full epoch (1h) + a bit of overhead
|
||||||
|
|
||||||
// Set this to a high value for now, so that we don't risk sporadic timeouts that might cause
|
// Set this to a high value for now, so that we don't risk sporadic timeouts that might cause
|
||||||
@@ -112,6 +117,11 @@ impl Config {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn with_fronting_domains(mut self, fronting_domains: Vec<Url>) -> Self {
|
||||||
|
self.client.fronting_domains = Some(fronting_domains);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_custom_nym_apis(&mut self, nym_api_urls: Vec<Url>) {
|
pub fn set_custom_nym_apis(&mut self, nym_api_urls: Vec<Url>) {
|
||||||
self.client.nym_api_urls = nym_api_urls;
|
self.client.nym_api_urls = nym_api_urls;
|
||||||
}
|
}
|
||||||
@@ -284,6 +294,10 @@ impl Config {
|
|||||||
pub fn get_nym_api_endpoints(&self) -> Vec<Url> {
|
pub fn get_nym_api_endpoints(&self) -> Vec<Url> {
|
||||||
self.client.nym_api_urls.clone()
|
self.client.nym_api_urls.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_fronting_domains(&self) -> Option<Vec<Url>> {
|
||||||
|
self.client.fronting_domains.clone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
|
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
|
||||||
@@ -309,6 +323,9 @@ pub struct Client {
|
|||||||
/// Addresses to APIs running on validator from which the client gets the view of the network.
|
/// Addresses to APIs running on validator from which the client gets the view of the network.
|
||||||
#[serde(alias = "validator_api_urls")]
|
#[serde(alias = "validator_api_urls")]
|
||||||
pub nym_api_urls: Vec<Url>,
|
pub nym_api_urls: Vec<Url>,
|
||||||
|
|
||||||
|
/// Domain to use for domain fronting censorship circumvention
|
||||||
|
pub fronting_domains: Option<Vec<Url>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
@@ -335,6 +352,7 @@ impl Client {
|
|||||||
disabled_credentials_mode: true,
|
disabled_credentials_mode: true,
|
||||||
nyxd_urls,
|
nyxd_urls,
|
||||||
nym_api_urls,
|
nym_api_urls,
|
||||||
|
fronting_domains: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,6 +362,7 @@ impl Client {
|
|||||||
disabled_credentials_mode: bool,
|
disabled_credentials_mode: bool,
|
||||||
nyxd_urls: Vec<Url>,
|
nyxd_urls: Vec<Url>,
|
||||||
nym_api_urls: Vec<Url>,
|
nym_api_urls: Vec<Url>,
|
||||||
|
fronting_domains: Option<Vec<Url>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Client {
|
Client {
|
||||||
version: version.into(),
|
version: version.into(),
|
||||||
@@ -351,6 +370,7 @@ impl Client {
|
|||||||
disabled_credentials_mode,
|
disabled_credentials_mode,
|
||||||
nyxd_urls,
|
nyxd_urls,
|
||||||
nym_api_urls,
|
nym_api_urls,
|
||||||
|
fronting_domains,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -516,6 +536,14 @@ pub struct Topology {
|
|||||||
|
|
||||||
/// Specifies the mixnode topology to be used for sending packets.
|
/// Specifies the mixnode topology to be used for sending packets.
|
||||||
pub topology_structure: TopologyStructure,
|
pub topology_structure: TopologyStructure,
|
||||||
|
|
||||||
|
/// Specifies a minimum performance of a mixnode that is used on route construction.
|
||||||
|
/// This setting is only applicable when `NymApi` topology is used.
|
||||||
|
pub minimum_mixnode_performance: u8,
|
||||||
|
|
||||||
|
/// Specifies a minimum performance of a gateway that is used on route construction.
|
||||||
|
/// This setting is only applicable when `NymApi` topology is used.
|
||||||
|
pub minimum_gateway_performance: u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::large_enum_variant)]
|
#[allow(clippy::large_enum_variant)]
|
||||||
@@ -550,6 +578,8 @@ impl Default for Topology {
|
|||||||
disable_refreshing: false,
|
disable_refreshing: false,
|
||||||
max_startup_gateway_waiting_period: DEFAULT_MAX_STARTUP_GATEWAY_WAITING_PERIOD,
|
max_startup_gateway_waiting_period: DEFAULT_MAX_STARTUP_GATEWAY_WAITING_PERIOD,
|
||||||
topology_structure: TopologyStructure::default(),
|
topology_structure: TopologyStructure::default(),
|
||||||
|
minimum_mixnode_performance: DEFAULT_MIN_MIXNODE_PERFORMANCE,
|
||||||
|
minimum_gateway_performance: DEFAULT_MIN_GATEWAY_PERFORMANCE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ impl From<ConfigV5> for Config {
|
|||||||
id: value.client.id,
|
id: value.client.id,
|
||||||
disabled_credentials_mode: value.client.disabled_credentials_mode,
|
disabled_credentials_mode: value.client.disabled_credentials_mode,
|
||||||
nyxd_urls: value.client.nyxd_urls,
|
nyxd_urls: value.client.nyxd_urls,
|
||||||
|
fronting_domains: None, //SW need proper migrations if it gets applied
|
||||||
nym_api_urls: value.client.nym_api_urls,
|
nym_api_urls: value.client.nym_api_urls,
|
||||||
},
|
},
|
||||||
debug: DebugConfig {
|
debug: DebugConfig {
|
||||||
@@ -146,6 +147,7 @@ impl From<ConfigV5> for Config {
|
|||||||
.topology
|
.topology
|
||||||
.max_startup_gateway_waiting_period,
|
.max_startup_gateway_waiting_period,
|
||||||
topology_structure: value.debug.topology.topology_structure.into(),
|
topology_structure: value.debug.topology.topology_structure.into(),
|
||||||
|
..Default::default()
|
||||||
},
|
},
|
||||||
reply_surbs: ReplySurbs {
|
reply_surbs: ReplySurbs {
|
||||||
minimum_reply_surb_storage_threshold: value
|
minimum_reply_surb_storage_threshold: value
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
CREATE TABLE remote_gateway_details_temp
|
||||||
|
(
|
||||||
|
gateway_id_bs58 TEXT NOT NULL UNIQUE PRIMARY KEY REFERENCES registered_gateway (gateway_id_bs58),
|
||||||
|
derived_aes128_ctr_blake3_hmac_keys_bs58 TEXT NOT NULL,
|
||||||
|
gateway_owner_address TEXT,
|
||||||
|
gateway_listener TEXT NOT NULL,
|
||||||
|
wg_tun_address TEXT
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO remote_gateway_details_temp SELECT * FROM remote_gateway_details;
|
||||||
|
|
||||||
|
DROP TABLE remote_gateway_details;
|
||||||
|
ALTER TABLE remote_gateway_details_temp RENAME TO remote_gateway_details;
|
||||||
@@ -65,7 +65,7 @@ impl GatewayDetails {
|
|||||||
pub fn new_remote(
|
pub fn new_remote(
|
||||||
gateway_id: identity::PublicKey,
|
gateway_id: identity::PublicKey,
|
||||||
derived_aes128_ctr_blake3_hmac_keys: Arc<SharedKeys>,
|
derived_aes128_ctr_blake3_hmac_keys: Arc<SharedKeys>,
|
||||||
gateway_owner_address: AccountId,
|
gateway_owner_address: Option<AccountId>,
|
||||||
gateway_listener: Url,
|
gateway_listener: Url,
|
||||||
wg_tun_address: Option<Url>,
|
wg_tun_address: Option<Url>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
@@ -170,7 +170,7 @@ pub struct RegisteredGateway {
|
|||||||
pub struct RawRemoteGatewayDetails {
|
pub struct RawRemoteGatewayDetails {
|
||||||
pub gateway_id_bs58: String,
|
pub gateway_id_bs58: String,
|
||||||
pub derived_aes128_ctr_blake3_hmac_keys_bs58: String,
|
pub derived_aes128_ctr_blake3_hmac_keys_bs58: String,
|
||||||
pub gateway_owner_address: String,
|
pub gateway_owner_address: Option<String>,
|
||||||
pub gateway_listener: String,
|
pub gateway_listener: String,
|
||||||
pub wg_tun_address: Option<String>,
|
pub wg_tun_address: Option<String>,
|
||||||
}
|
}
|
||||||
@@ -195,14 +195,19 @@ impl TryFrom<RawRemoteGatewayDetails> for RemoteGatewayDetails {
|
|||||||
})?,
|
})?,
|
||||||
);
|
);
|
||||||
|
|
||||||
let gateway_owner_address =
|
let gateway_owner_address = value
|
||||||
AccountId::from_str(&value.gateway_owner_address).map_err(|source| {
|
.gateway_owner_address
|
||||||
BadGateway::MalformedGatewayOwnerAccountAddress {
|
.as_ref()
|
||||||
gateway_id: value.gateway_id_bs58.clone(),
|
.map(|raw_owner| {
|
||||||
raw_owner: value.gateway_owner_address.clone(),
|
AccountId::from_str(raw_owner).map_err(|source| {
|
||||||
source,
|
BadGateway::MalformedGatewayOwnerAccountAddress {
|
||||||
}
|
gateway_id: value.gateway_id_bs58.clone(),
|
||||||
})?;
|
raw_owner: raw_owner.clone(),
|
||||||
|
source,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.transpose()?;
|
||||||
|
|
||||||
let gateway_listener = Url::parse(&value.gateway_listener).map_err(|source| {
|
let gateway_listener = Url::parse(&value.gateway_listener).map_err(|source| {
|
||||||
BadGateway::MalformedListener {
|
BadGateway::MalformedListener {
|
||||||
@@ -241,7 +246,7 @@ impl<'a> From<&'a RemoteGatewayDetails> for RawRemoteGatewayDetails {
|
|||||||
derived_aes128_ctr_blake3_hmac_keys_bs58: value
|
derived_aes128_ctr_blake3_hmac_keys_bs58: value
|
||||||
.derived_aes128_ctr_blake3_hmac_keys
|
.derived_aes128_ctr_blake3_hmac_keys
|
||||||
.to_base58_string(),
|
.to_base58_string(),
|
||||||
gateway_owner_address: value.gateway_owner_address.to_string(),
|
gateway_owner_address: value.gateway_owner_address.as_ref().map(|o| o.to_string()),
|
||||||
gateway_listener: value.gateway_listener.to_string(),
|
gateway_listener: value.gateway_listener.to_string(),
|
||||||
wg_tun_address: value.wg_tun_address.as_ref().map(|addr| addr.to_string()),
|
wg_tun_address: value.wg_tun_address.as_ref().map(|addr| addr.to_string()),
|
||||||
}
|
}
|
||||||
@@ -256,7 +261,7 @@ pub struct RemoteGatewayDetails {
|
|||||||
// the keys will be zeroized
|
// the keys will be zeroized
|
||||||
pub derived_aes128_ctr_blake3_hmac_keys: Arc<SharedKeys>,
|
pub derived_aes128_ctr_blake3_hmac_keys: Arc<SharedKeys>,
|
||||||
|
|
||||||
pub gateway_owner_address: AccountId,
|
pub gateway_owner_address: Option<AccountId>,
|
||||||
|
|
||||||
pub gateway_listener: Url,
|
pub gateway_listener: Url,
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ where
|
|||||||
hardcoded_topology.get_gateways()
|
hardcoded_topology.get_gateways()
|
||||||
} else {
|
} else {
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
crate::init::helpers::current_gateways(&mut rng, &core.client.nym_api_urls).await?
|
crate::init::helpers::current_gateways(&mut rng, &core.client.nym_api_urls, None).await?
|
||||||
};
|
};
|
||||||
|
|
||||||
// since we're registering with a brand new gateway,
|
// since we're registering with a brand new gateway,
|
||||||
|
|||||||
@@ -70,6 +70,13 @@ pub struct CommonClientInitArgs {
|
|||||||
)]
|
)]
|
||||||
pub nym_apis: Option<Vec<url::Url>>,
|
pub nym_apis: Option<Vec<url::Url>>,
|
||||||
|
|
||||||
|
///Comma separated list of urls to use for domain fronting
|
||||||
|
#[cfg_attr(
|
||||||
|
feature = "cli",
|
||||||
|
clap(long, value_delimiter = ',', requires = "nym_apis", hide = true)
|
||||||
|
)]
|
||||||
|
pub fronting_domains: Option<Vec<url::Url>>,
|
||||||
|
|
||||||
/// Path to .json file containing custom network specification.
|
/// Path to .json file containing custom network specification.
|
||||||
#[cfg_attr(feature = "cli", clap(long, group = "network", hide = true))]
|
#[cfg_attr(feature = "cli", clap(long, group = "network", hide = true))]
|
||||||
pub custom_mixnet: Option<PathBuf>,
|
pub custom_mixnet: Option<PathBuf>,
|
||||||
@@ -144,6 +151,16 @@ where
|
|||||||
.collect::<Vec<&str>>()
|
.collect::<Vec<&str>>()
|
||||||
.join(",")
|
.join(",")
|
||||||
);
|
);
|
||||||
|
if let Some(fronting_domains) = &core.client.fronting_domains {
|
||||||
|
log::info!(
|
||||||
|
"fronted by : {}",
|
||||||
|
fronting_domains
|
||||||
|
.iter()
|
||||||
|
.map(|url| url.host_str().unwrap_or_default())
|
||||||
|
.collect::<Vec<&str>>()
|
||||||
|
.join(",")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let key_store = OnDiskKeys::new(paths.keys.clone());
|
let key_store = OnDiskKeys::new(paths.keys.clone());
|
||||||
let details_store = setup_fs_gateways_storage(&paths.gateway_registrations).await?;
|
let details_store = setup_fs_gateways_storage(&paths.gateway_registrations).await?;
|
||||||
@@ -163,7 +180,12 @@ where
|
|||||||
hardcoded_topology.get_gateways()
|
hardcoded_topology.get_gateways()
|
||||||
} else {
|
} else {
|
||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
crate::init::helpers::current_gateways(&mut rng, &core.client.nym_api_urls).await?
|
crate::init::helpers::current_gateways(
|
||||||
|
&mut rng,
|
||||||
|
&core.client.nym_api_urls,
|
||||||
|
core.client.fronting_domains.as_ref(),
|
||||||
|
)
|
||||||
|
.await?
|
||||||
};
|
};
|
||||||
|
|
||||||
let gateway_setup = GatewaySetup::New {
|
let gateway_setup = GatewaySetup::New {
|
||||||
|
|||||||
@@ -35,6 +35,13 @@ pub struct CommonClientRunArgs {
|
|||||||
)]
|
)]
|
||||||
pub nym_apis: Option<Vec<url::Url>>,
|
pub nym_apis: Option<Vec<url::Url>>,
|
||||||
|
|
||||||
|
///Comma separated list of urls to use for domain fronting
|
||||||
|
#[cfg_attr(
|
||||||
|
feature = "cli",
|
||||||
|
clap(long, value_delimiter = ',', requires = "nym_apis", hide = true)
|
||||||
|
)]
|
||||||
|
pub fronting_domains: Option<Vec<url::Url>>,
|
||||||
|
|
||||||
/// Path to .json file containing custom network specification.
|
/// Path to .json file containing custom network specification.
|
||||||
#[cfg_attr(feature = "cli", clap(long, group = "network", hide = true))]
|
#[cfg_attr(feature = "cli", clap(long, group = "network", hide = true))]
|
||||||
pub custom_mixnet: Option<PathBuf>,
|
pub custom_mixnet: Option<PathBuf>,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
use super::packet_statistics_control::PacketStatisticsReporter;
|
use super::packet_statistics_control::PacketStatisticsReporter;
|
||||||
use super::received_buffer::ReceivedBufferMessage;
|
use super::received_buffer::ReceivedBufferMessage;
|
||||||
|
use super::topology_control::fronted_api_provider::FrontedApiTopologyProvider;
|
||||||
use super::topology_control::geo_aware_provider::GeoAwareTopologyProvider;
|
use super::topology_control::geo_aware_provider::GeoAwareTopologyProvider;
|
||||||
use crate::client::base_client::storage::helpers::store_client_keys;
|
use crate::client::base_client::storage::helpers::store_client_keys;
|
||||||
use crate::client::base_client::storage::MixnetClientStorage;
|
use crate::client::base_client::storage::MixnetClientStorage;
|
||||||
@@ -25,7 +26,7 @@ use crate::client::replies::reply_storage::{
|
|||||||
};
|
};
|
||||||
use crate::client::topology_control::nym_api_provider::NymApiTopologyProvider;
|
use crate::client::topology_control::nym_api_provider::NymApiTopologyProvider;
|
||||||
use crate::client::topology_control::{
|
use crate::client::topology_control::{
|
||||||
TopologyAccessor, TopologyRefresher, TopologyRefresherConfig,
|
nym_api_provider, TopologyAccessor, TopologyRefresher, TopologyRefresherConfig,
|
||||||
};
|
};
|
||||||
use crate::config::{Config, DebugConfig};
|
use crate::config::{Config, DebugConfig};
|
||||||
use crate::error::ClientCoreError;
|
use crate::error::ClientCoreError;
|
||||||
@@ -388,7 +389,10 @@ where
|
|||||||
|
|
||||||
let cfg = GatewayConfig::new(
|
let cfg = GatewayConfig::new(
|
||||||
details.gateway_id,
|
details.gateway_id,
|
||||||
Some(details.gateway_owner_address.to_string()),
|
details
|
||||||
|
.gateway_owner_address
|
||||||
|
.as_ref()
|
||||||
|
.map(|o| o.to_string()),
|
||||||
gateway_listener,
|
gateway_listener,
|
||||||
);
|
);
|
||||||
GatewayClient::new(
|
GatewayClient::new(
|
||||||
@@ -462,15 +466,31 @@ where
|
|||||||
|
|
||||||
fn setup_topology_provider(
|
fn setup_topology_provider(
|
||||||
custom_provider: Option<Box<dyn TopologyProvider + Send + Sync>>,
|
custom_provider: Option<Box<dyn TopologyProvider + Send + Sync>>,
|
||||||
provider_from_config: config::TopologyStructure,
|
config_topology: config::Topology,
|
||||||
nym_api_urls: Vec<Url>,
|
nym_api_urls: Vec<Url>,
|
||||||
|
fronting_domains: Option<Vec<Url>>,
|
||||||
) -> Box<dyn TopologyProvider + Send + Sync> {
|
) -> Box<dyn TopologyProvider + Send + Sync> {
|
||||||
// if no custom provider was ... provided ..., create one using nym-api
|
// if no custom provider was ... provided ..., create one using nym-api
|
||||||
custom_provider.unwrap_or_else(|| match provider_from_config {
|
custom_provider.unwrap_or_else(|| match config_topology.topology_structure {
|
||||||
config::TopologyStructure::NymApi => Box::new(NymApiTopologyProvider::new(
|
config::TopologyStructure::NymApi => match fronting_domains {
|
||||||
nym_api_urls,
|
Some(domains) => Box::new(FrontedApiTopologyProvider::new(
|
||||||
env!("CARGO_PKG_VERSION").to_string(),
|
nym_api_provider::Config {
|
||||||
)),
|
min_mixnode_performance: config_topology.minimum_mixnode_performance,
|
||||||
|
min_gateway_performance: config_topology.minimum_gateway_performance,
|
||||||
|
},
|
||||||
|
nym_api_urls,
|
||||||
|
domains,
|
||||||
|
env!("CARGO_PKG_VERSION").to_string(),
|
||||||
|
)),
|
||||||
|
None => Box::new(NymApiTopologyProvider::new(
|
||||||
|
nym_api_provider::Config {
|
||||||
|
min_mixnode_performance: config_topology.minimum_mixnode_performance,
|
||||||
|
min_gateway_performance: config_topology.minimum_gateway_performance,
|
||||||
|
},
|
||||||
|
nym_api_urls,
|
||||||
|
env!("CARGO_PKG_VERSION").to_string(),
|
||||||
|
)),
|
||||||
|
},
|
||||||
config::TopologyStructure::GeoAware(group_by) => {
|
config::TopologyStructure::GeoAware(group_by) => {
|
||||||
Box::new(GeoAwareTopologyProvider::new(
|
Box::new(GeoAwareTopologyProvider::new(
|
||||||
nym_api_urls,
|
nym_api_urls,
|
||||||
@@ -680,8 +700,9 @@ where
|
|||||||
|
|
||||||
let topology_provider = Self::setup_topology_provider(
|
let topology_provider = Self::setup_topology_provider(
|
||||||
self.custom_topology_provider.take(),
|
self.custom_topology_provider.take(),
|
||||||
self.config.debug.topology.topology_structure,
|
self.config.debug.topology,
|
||||||
self.config.get_nym_api_endpoints(),
|
self.config.get_nym_api_endpoints(),
|
||||||
|
self.config.get_fronting_domains(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// needs to be started as the first thing to block if required waiting for the gateway
|
// needs to be started as the first thing to block if required waiting for the gateway
|
||||||
|
|||||||
@@ -92,11 +92,11 @@ pub mod v1_1_33 {
|
|||||||
message: format!("the stored gateway id was malformed: {err}"),
|
message: format!("the stored gateway id was malformed: {err}"),
|
||||||
})?,
|
})?,
|
||||||
derived_aes128_ctr_blake3_hmac_keys: Arc::new(gateway_shared_key),
|
derived_aes128_ctr_blake3_hmac_keys: Arc::new(gateway_shared_key),
|
||||||
gateway_owner_address: gateway_owner.parse().map_err(|err| {
|
gateway_owner_address: Some(gateway_owner.parse().map_err(|err| {
|
||||||
ClientCoreError::UpgradeFailure {
|
ClientCoreError::UpgradeFailure {
|
||||||
message: format!("the stored gateway owner address was malformed: {err}"),
|
message: format!("the stored gateway owner address was malformed: {err}"),
|
||||||
}
|
}
|
||||||
})?,
|
})?),
|
||||||
gateway_listener: gateway_listener.parse().map_err(|err| {
|
gateway_listener: gateway_listener.parse().map_err(|err| {
|
||||||
ClientCoreError::UpgradeFailure {
|
ClientCoreError::UpgradeFailure {
|
||||||
message: format!("the stored gateway listener address was malformed: {err}"),
|
message: format!("the stored gateway listener address was malformed: {err}"),
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use async_trait::async_trait;
|
||||||
|
use log::{debug, error, warn};
|
||||||
|
use nym_topology::provider_trait::TopologyProvider;
|
||||||
|
use nym_topology::{NymTopology, NymTopologyError};
|
||||||
|
use rand::prelude::SliceRandom;
|
||||||
|
use rand::thread_rng;
|
||||||
|
use url::Url;
|
||||||
|
|
||||||
|
use super::nym_api_provider::Config;
|
||||||
|
|
||||||
|
pub(crate) struct FrontedApiTopologyProvider {
|
||||||
|
config: Config,
|
||||||
|
|
||||||
|
validator_client: nym_validator_client::client::NymApiClient,
|
||||||
|
nym_api_urls: Vec<Url>,
|
||||||
|
fronting_domains: Vec<Url>,
|
||||||
|
shuffling: Vec<usize>,
|
||||||
|
|
||||||
|
client_version: String,
|
||||||
|
currently_used_api: usize,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FrontedApiTopologyProvider {
|
||||||
|
pub(crate) fn new(
|
||||||
|
config: Config,
|
||||||
|
nym_api_urls: Vec<Url>,
|
||||||
|
fronting_domains: Vec<Url>,
|
||||||
|
client_version: String,
|
||||||
|
) -> Self {
|
||||||
|
//SW for the PoC, we assume same lenght between fronting domains and api_urls
|
||||||
|
let mut shuffling = (0..nym_api_urls.len()).collect::<Vec<_>>();
|
||||||
|
shuffling.shuffle(&mut thread_rng());
|
||||||
|
|
||||||
|
FrontedApiTopologyProvider {
|
||||||
|
config,
|
||||||
|
validator_client: nym_validator_client::client::NymApiClient::new_fronted(
|
||||||
|
nym_api_urls[shuffling[0]].clone(),
|
||||||
|
fronting_domains[shuffling[0]].clone(),
|
||||||
|
),
|
||||||
|
nym_api_urls,
|
||||||
|
fronting_domains,
|
||||||
|
shuffling,
|
||||||
|
client_version,
|
||||||
|
currently_used_api: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn use_next_nym_api(&mut self) {
|
||||||
|
if self.nym_api_urls.len() == 1 {
|
||||||
|
warn!("There's only a single nym API available - it won't be possible to use a different one");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.currently_used_api = (self.currently_used_api + 1) % self.nym_api_urls.len();
|
||||||
|
self.validator_client.change_nym_api_with_fronting(
|
||||||
|
self.nym_api_urls[self.shuffling[self.currently_used_api]].clone(),
|
||||||
|
self.fronting_domains[self.shuffling[self.currently_used_api]].clone(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Verifies whether nodes a reasonably distributed among all mix layers.
|
||||||
|
///
|
||||||
|
/// In ideal world we would have 33% nodes on layer 1, 33% on layer 2 and 33% on layer 3.
|
||||||
|
/// However, this is a rather unrealistic expectation, instead we check whether there exists
|
||||||
|
/// a layer with more than 66% of nodes or with fewer than 15% and if so, we trigger a failure.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `topology`: active topology constructed from validator api data
|
||||||
|
fn check_layer_distribution(
|
||||||
|
&self,
|
||||||
|
active_topology: &NymTopology,
|
||||||
|
) -> Result<(), NymTopologyError> {
|
||||||
|
let lower_threshold = 0.15;
|
||||||
|
let upper_threshold = 0.66;
|
||||||
|
active_topology.ensure_even_layer_distribution(lower_threshold, upper_threshold)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_current_compatible_topology(&mut self) -> Option<NymTopology> {
|
||||||
|
let mixnodes = match self
|
||||||
|
.validator_client
|
||||||
|
.get_basic_mixnodes(Some(self.client_version.clone()))
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Err(err) => {
|
||||||
|
error!("failed to get network mixnodes - {err}");
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Ok(mixes) => mixes,
|
||||||
|
};
|
||||||
|
|
||||||
|
let gateways = match self
|
||||||
|
.validator_client
|
||||||
|
.get_basic_gateways(Some(self.client_version.clone()))
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Err(err) => {
|
||||||
|
error!("failed to get network gateways - {err}");
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Ok(gateways) => gateways,
|
||||||
|
};
|
||||||
|
|
||||||
|
debug!(
|
||||||
|
"there are {} mixnodes and {} gateways in total (before performance filtering)",
|
||||||
|
mixnodes.len(),
|
||||||
|
gateways.len()
|
||||||
|
);
|
||||||
|
|
||||||
|
let topology = NymTopology::from_unordered(
|
||||||
|
mixnodes.iter().filter(|m| {
|
||||||
|
m.performance.round_to_integer() >= self.config.min_mixnode_performance
|
||||||
|
}),
|
||||||
|
gateways.iter().filter(|g| {
|
||||||
|
g.performance.round_to_integer() >= self.config.min_gateway_performance
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
if let Err(err) = self.check_layer_distribution(&topology) {
|
||||||
|
warn!("The current filtered active topology has extremely skewed layer distribution. It cannot be used: {err}");
|
||||||
|
self.use_next_nym_api();
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(topology)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// hehe, wasm
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
#[async_trait]
|
||||||
|
impl TopologyProvider for FrontedApiTopologyProvider {
|
||||||
|
async fn get_new_topology(&mut self) -> Option<NymTopology> {
|
||||||
|
self.get_current_compatible_topology().await
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
#[async_trait(?Send)]
|
||||||
|
impl TopologyProvider for FrontedApiTopologyProvider {
|
||||||
|
async fn get_new_topology(&mut self) -> Option<NymTopology> {
|
||||||
|
self.get_current_compatible_topology().await
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ use tokio::time::sleep;
|
|||||||
use wasmtimer::tokio::sleep;
|
use wasmtimer::tokio::sleep;
|
||||||
|
|
||||||
mod accessor;
|
mod accessor;
|
||||||
|
pub(crate) mod fronted_api_provider;
|
||||||
pub mod geo_aware_provider;
|
pub mod geo_aware_provider;
|
||||||
pub(crate) mod nym_api_provider;
|
pub(crate) mod nym_api_provider;
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,35 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use log::{error, warn};
|
use log::{debug, error, warn};
|
||||||
use nym_topology::provider_trait::TopologyProvider;
|
use nym_topology::provider_trait::TopologyProvider;
|
||||||
use nym_topology::{nym_topology_from_detailed, NymTopology, NymTopologyError};
|
use nym_topology::{NymTopology, NymTopologyError};
|
||||||
use rand::prelude::SliceRandom;
|
use rand::prelude::SliceRandom;
|
||||||
use rand::thread_rng;
|
use rand::thread_rng;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
// the same values as our current (10.06.24) blacklist
|
||||||
|
pub const DEFAULT_MIN_MIXNODE_PERFORMANCE: u8 = 50;
|
||||||
|
pub const DEFAULT_MIN_GATEWAY_PERFORMANCE: u8 = 50;
|
||||||
|
|
||||||
|
pub(crate) struct Config {
|
||||||
|
pub(crate) min_mixnode_performance: u8,
|
||||||
|
pub(crate) min_gateway_performance: u8,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Config {
|
||||||
|
fn default() -> Self {
|
||||||
|
// old values that decided on blacklist membership
|
||||||
|
Config {
|
||||||
|
min_mixnode_performance: DEFAULT_MIN_MIXNODE_PERFORMANCE,
|
||||||
|
min_gateway_performance: DEFAULT_MIN_GATEWAY_PERFORMANCE,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) struct NymApiTopologyProvider {
|
pub(crate) struct NymApiTopologyProvider {
|
||||||
|
config: Config,
|
||||||
|
|
||||||
validator_client: nym_validator_client::client::NymApiClient,
|
validator_client: nym_validator_client::client::NymApiClient,
|
||||||
nym_api_urls: Vec<Url>,
|
nym_api_urls: Vec<Url>,
|
||||||
|
|
||||||
@@ -18,10 +39,11 @@ pub(crate) struct NymApiTopologyProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl NymApiTopologyProvider {
|
impl NymApiTopologyProvider {
|
||||||
pub(crate) fn new(mut nym_api_urls: Vec<Url>, client_version: String) -> Self {
|
pub(crate) fn new(config: Config, mut nym_api_urls: Vec<Url>, client_version: String) -> Self {
|
||||||
nym_api_urls.shuffle(&mut thread_rng());
|
nym_api_urls.shuffle(&mut thread_rng());
|
||||||
|
|
||||||
NymApiTopologyProvider {
|
NymApiTopologyProvider {
|
||||||
|
config,
|
||||||
validator_client: nym_validator_client::client::NymApiClient::new(
|
validator_client: nym_validator_client::client::NymApiClient::new(
|
||||||
nym_api_urls[0].clone(),
|
nym_api_urls[0].clone(),
|
||||||
),
|
),
|
||||||
@@ -61,7 +83,11 @@ impl NymApiTopologyProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn get_current_compatible_topology(&mut self) -> Option<NymTopology> {
|
async fn get_current_compatible_topology(&mut self) -> Option<NymTopology> {
|
||||||
let mixnodes = match self.validator_client.get_cached_active_mixnodes().await {
|
let mixnodes = match self
|
||||||
|
.validator_client
|
||||||
|
.get_basic_mixnodes(Some(self.client_version.clone()))
|
||||||
|
.await
|
||||||
|
{
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
error!("failed to get network mixnodes - {err}");
|
error!("failed to get network mixnodes - {err}");
|
||||||
return None;
|
return None;
|
||||||
@@ -69,7 +95,11 @@ impl NymApiTopologyProvider {
|
|||||||
Ok(mixes) => mixes,
|
Ok(mixes) => mixes,
|
||||||
};
|
};
|
||||||
|
|
||||||
let gateways = match self.validator_client.get_cached_described_gateways().await {
|
let gateways = match self
|
||||||
|
.validator_client
|
||||||
|
.get_basic_gateways(Some(self.client_version.clone()))
|
||||||
|
.await
|
||||||
|
{
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
error!("failed to get network gateways - {err}");
|
error!("failed to get network gateways - {err}");
|
||||||
return None;
|
return None;
|
||||||
@@ -77,8 +107,20 @@ impl NymApiTopologyProvider {
|
|||||||
Ok(gateways) => gateways,
|
Ok(gateways) => gateways,
|
||||||
};
|
};
|
||||||
|
|
||||||
let topology = nym_topology_from_detailed(mixnodes, gateways)
|
debug!(
|
||||||
.filter_system_version(&self.client_version);
|
"there are {} mixnodes and {} gateways in total (before performance filtering)",
|
||||||
|
mixnodes.len(),
|
||||||
|
gateways.len()
|
||||||
|
);
|
||||||
|
|
||||||
|
let topology = NymTopology::from_unordered(
|
||||||
|
mixnodes.iter().filter(|m| {
|
||||||
|
m.performance.round_to_integer() >= self.config.min_mixnode_performance
|
||||||
|
}),
|
||||||
|
gateways.iter().filter(|g| {
|
||||||
|
g.performance.round_to_integer() >= self.config.min_gateway_performance
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
if let Err(err) = self.check_layer_distribution(&topology) {
|
if let Err(err) = self.check_layer_distribution(&topology) {
|
||||||
warn!("The current filtered active topology has extremely skewed layer distribution. It cannot be used: {err}");
|
warn!("The current filtered active topology has extremely skewed layer distribution. It cannot be used: {err}");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use nym_crypto::asymmetric::identity;
|
|||||||
use nym_gateway_client::GatewayClient;
|
use nym_gateway_client::GatewayClient;
|
||||||
use nym_topology::{filter::VersionFilterable, gateway, mix};
|
use nym_topology::{filter::VersionFilterable, gateway, mix};
|
||||||
use nym_validator_client::client::IdentityKeyRef;
|
use nym_validator_client::client::IdentityKeyRef;
|
||||||
|
use rand::seq::IteratorRandom;
|
||||||
use rand::{seq::SliceRandom, Rng};
|
use rand::{seq::SliceRandom, Rng};
|
||||||
use std::{sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
use tungstenite::Message;
|
use tungstenite::Message;
|
||||||
@@ -59,13 +60,29 @@ impl<'a> GatewayWithLatency<'a> {
|
|||||||
pub async fn current_gateways<R: Rng>(
|
pub async fn current_gateways<R: Rng>(
|
||||||
rng: &mut R,
|
rng: &mut R,
|
||||||
nym_apis: &[Url],
|
nym_apis: &[Url],
|
||||||
|
fronting_domains: Option<&Vec<Url>>,
|
||||||
) -> Result<Vec<gateway::Node>, ClientCoreError> {
|
) -> Result<Vec<gateway::Node>, ClientCoreError> {
|
||||||
let nym_api = nym_apis
|
let client = match fronting_domains {
|
||||||
.choose(rng)
|
Some(domains) => {
|
||||||
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
|
let (api_url, fronting_url) = nym_apis
|
||||||
let client = nym_validator_client::client::NymApiClient::new(nym_api.clone());
|
.iter()
|
||||||
|
.zip(domains)
|
||||||
|
.choose(rng)
|
||||||
|
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
|
||||||
|
|
||||||
log::debug!("Fetching list of gateways from: {nym_api}");
|
nym_validator_client::client::NymApiClient::new_fronted(
|
||||||
|
api_url.clone(),
|
||||||
|
fronting_url.clone(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
let nym_api = nym_apis
|
||||||
|
.choose(rng)
|
||||||
|
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
|
||||||
|
nym_validator_client::client::NymApiClient::new(nym_api.clone())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
log::debug!("Fetching list of gateways from: {}", client.api_url());
|
||||||
|
|
||||||
let gateways = client.get_cached_described_gateways().await?;
|
let gateways = client.get_cached_described_gateways().await?;
|
||||||
log::debug!("Found {} gateways", gateways.len());
|
log::debug!("Found {} gateways", gateways.len());
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ pub enum SelectedGateway {
|
|||||||
Remote {
|
Remote {
|
||||||
gateway_id: identity::PublicKey,
|
gateway_id: identity::PublicKey,
|
||||||
|
|
||||||
gateway_owner_address: AccountId,
|
gateway_owner_address: Option<AccountId>,
|
||||||
|
|
||||||
gateway_listener: Url,
|
gateway_listener: Url,
|
||||||
|
|
||||||
@@ -84,13 +84,19 @@ impl SelectedGateway {
|
|||||||
|
|
||||||
let wg_tun_address = wg_tun_address(wg_tun_ip_address, &node)?;
|
let wg_tun_address = wg_tun_address(wg_tun_ip_address, &node)?;
|
||||||
|
|
||||||
let gateway_owner_address = AccountId::from_str(&node.owner).map_err(|source| {
|
let gateway_owner_address = node
|
||||||
ClientCoreError::MalformedGatewayOwnerAccountAddress {
|
.owner
|
||||||
gateway_id: node.identity_key.to_base58_string(),
|
.as_ref()
|
||||||
raw_owner: node.owner,
|
.map(|raw_owner| {
|
||||||
err: source.to_string(),
|
AccountId::from_str(raw_owner).map_err(|source| {
|
||||||
}
|
ClientCoreError::MalformedGatewayOwnerAccountAddress {
|
||||||
})?;
|
gateway_id: node.identity_key.to_base58_string(),
|
||||||
|
raw_owner: raw_owner.clone(),
|
||||||
|
err: source.to_string(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.transpose()?;
|
||||||
|
|
||||||
let gateway_listener =
|
let gateway_listener =
|
||||||
Url::parse(&gateway_listener).map_err(|source| ClientCoreError::MalformedListener {
|
Url::parse(&gateway_listener).map_err(|source| ClientCoreError::MalformedListener {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ futures = { workspace = true }
|
|||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
|
rand = { workspace = true }
|
||||||
tokio = { workspace = true, features = ["macros"] }
|
tokio = { workspace = true, features = ["macros"] }
|
||||||
si-scale = { workspace = true }
|
si-scale = { workspace = true }
|
||||||
time.workspace = true
|
time.workspace = true
|
||||||
|
|||||||
@@ -220,9 +220,18 @@ impl<C, St> GatewayClient<C, St> {
|
|||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub async fn establish_connection(&mut self) -> Result<(), GatewayClientError> {
|
pub async fn establish_connection(&mut self) -> Result<(), GatewayClientError> {
|
||||||
|
debug!(
|
||||||
|
"Attemting to establish connection to gateway at: {}",
|
||||||
|
self.gateway_address
|
||||||
|
);
|
||||||
let ws_stream = match connect_async(&self.gateway_address).await {
|
let ws_stream = match connect_async(&self.gateway_address).await {
|
||||||
Ok((ws_stream, _)) => ws_stream,
|
Ok((ws_stream, _)) => ws_stream,
|
||||||
Err(e) => return Err(GatewayClientError::NetworkError(e)),
|
Err(error) => {
|
||||||
|
return Err(GatewayClientError::NetworkConnectionFailed {
|
||||||
|
address: self.gateway_address.clone(),
|
||||||
|
source: error,
|
||||||
|
})
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.connection = SocketState::Available(Box::new(ws_stream));
|
self.connection = SocketState::Available(Box::new(ws_stream));
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ pub enum GatewayClientError {
|
|||||||
#[error("There was a network error: {0}")]
|
#[error("There was a network error: {0}")]
|
||||||
NetworkErrorWasm(#[from] JsError),
|
NetworkErrorWasm(#[from] JsError),
|
||||||
|
|
||||||
|
#[error("connection failed: {address}: {source}")]
|
||||||
|
NetworkConnectionFailed { address: String, source: WsError },
|
||||||
|
|
||||||
#[error("Invalid URL: {0}")]
|
#[error("Invalid URL: {0}")]
|
||||||
InvalidURL(String),
|
InvalidURL(String),
|
||||||
|
|
||||||
|
|||||||
@@ -14,17 +14,14 @@ colored = { workspace = true }
|
|||||||
|
|
||||||
nym-coconut-dkg-common = { path = "../../cosmwasm-smart-contracts/coconut-dkg" }
|
nym-coconut-dkg-common = { path = "../../cosmwasm-smart-contracts/coconut-dkg" }
|
||||||
nym-contracts-common = { path = "../../cosmwasm-smart-contracts/contracts-common" }
|
nym-contracts-common = { path = "../../cosmwasm-smart-contracts/contracts-common" }
|
||||||
nym-ephemera-common = { path = "../../cosmwasm-smart-contracts/ephemera" }
|
|
||||||
nym-mixnet-contract-common = { path = "../../cosmwasm-smart-contracts/mixnet-contract" }
|
nym-mixnet-contract-common = { path = "../../cosmwasm-smart-contracts/mixnet-contract" }
|
||||||
nym-vesting-contract-common = { path = "../../cosmwasm-smart-contracts/vesting-contract" }
|
nym-vesting-contract-common = { path = "../../cosmwasm-smart-contracts/vesting-contract" }
|
||||||
nym-coconut-bandwidth-contract-common = { path = "../../cosmwasm-smart-contracts/coconut-bandwidth-contract" }
|
nym-coconut-bandwidth-contract-common = { path = "../../cosmwasm-smart-contracts/coconut-bandwidth-contract" }
|
||||||
nym-multisig-contract-common = { path = "../../cosmwasm-smart-contracts/multisig-contract" }
|
nym-multisig-contract-common = { path = "../../cosmwasm-smart-contracts/multisig-contract" }
|
||||||
nym-name-service-common = { path = "../../cosmwasm-smart-contracts/name-service" }
|
|
||||||
nym-group-contract-common = { path = "../../cosmwasm-smart-contracts/group-contract" }
|
nym-group-contract-common = { path = "../../cosmwasm-smart-contracts/group-contract" }
|
||||||
nym-service-provider-directory-common = { path = "../../cosmwasm-smart-contracts/service-provider-directory" }
|
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
nym-http-api-client = { path = "../../../common/http-api-client"}
|
nym-http-api-client = { path = "../../../common/http-api-client" }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
url = { workspace = true, features = ["serde"] }
|
url = { workspace = true, features = ["serde"] }
|
||||||
@@ -86,14 +83,6 @@ name = "offline_signing"
|
|||||||
# (traits would need to be moved around and refactored themselves)
|
# (traits would need to be moved around and refactored themselves)
|
||||||
required-features = ["http-client"]
|
required-features = ["http-client"]
|
||||||
|
|
||||||
[[example]]
|
|
||||||
name = "query_service_provider_directory"
|
|
||||||
required-features = ["http-client"]
|
|
||||||
|
|
||||||
[[example]]
|
|
||||||
name = "query_name_service"
|
|
||||||
required-features = ["http-client"]
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["http-client"]
|
default = ["http-client"]
|
||||||
http-client = ["cosmrs/rpc"]
|
http-client = ["cosmrs/rpc"]
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use cosmrs::AccountId;
|
|
||||||
use nym_name_service_common::Address;
|
|
||||||
use nym_network_defaults::{setup_env, NymNetworkDetails};
|
|
||||||
use nym_validator_client::nyxd::contract_traits::{
|
|
||||||
NameServiceQueryClient, PagedNameServiceQueryClient,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[tokio::main]
|
|
||||||
async fn main() {
|
|
||||||
setup_env(Some("../../../envs/qa.env"));
|
|
||||||
let network_details = NymNetworkDetails::new_from_env();
|
|
||||||
let config =
|
|
||||||
nym_validator_client::Config::try_from_nym_network_details(&network_details).unwrap();
|
|
||||||
let client = nym_validator_client::Client::new_query(config).unwrap();
|
|
||||||
|
|
||||||
let config = client.nyxd.get_name_service_config().await.unwrap();
|
|
||||||
println!("config: {config:?}");
|
|
||||||
|
|
||||||
let names_paged = client.nyxd.get_names_paged(None, None).await.unwrap();
|
|
||||||
println!("names (paged): {names_paged:#?}");
|
|
||||||
|
|
||||||
let names = client.nyxd.get_all_names().await.unwrap();
|
|
||||||
println!("names: {names:#?}");
|
|
||||||
|
|
||||||
let owner = AccountId::from_str("n1hmf957kc7arcd39rl7xq8l0a4zyg7kxnv7su87").unwrap();
|
|
||||||
let names_by_owner = client.nyxd.get_names_by_owner(owner).await.unwrap();
|
|
||||||
println!("names (by owner): {names_by_owner:#?}");
|
|
||||||
|
|
||||||
let nym_address = Address::new("client_id.client_key@gateway_id").unwrap();
|
|
||||||
let names_by_address = client.nyxd.get_names_by_address(nym_address).await.unwrap();
|
|
||||||
println!("names (by address): {names_by_address:#?}");
|
|
||||||
|
|
||||||
let service_info = client.nyxd.get_name_entry(1).await;
|
|
||||||
println!("service info: {service_info:#?}");
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use cosmrs::AccountId;
|
|
||||||
use nym_network_defaults::{setup_env, NymNetworkDetails};
|
|
||||||
use nym_service_provider_directory_common::NymAddress;
|
|
||||||
use nym_validator_client::nyxd::contract_traits::{
|
|
||||||
PagedSpDirectoryQueryClient, SpDirectoryQueryClient,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[tokio::main]
|
|
||||||
async fn main() {
|
|
||||||
setup_env(Some("../../../envs/qa.env"));
|
|
||||||
let network_details = NymNetworkDetails::new_from_env();
|
|
||||||
let config =
|
|
||||||
nym_validator_client::Config::try_from_nym_network_details(&network_details).unwrap();
|
|
||||||
let client = nym_validator_client::Client::new_query(config).unwrap();
|
|
||||||
|
|
||||||
let config = client.nyxd.get_service_config().await.unwrap();
|
|
||||||
println!("config: {config:?}");
|
|
||||||
|
|
||||||
let services_paged = client.nyxd.get_services_paged(None, None).await.unwrap();
|
|
||||||
println!("services (paged): {services_paged:#?}");
|
|
||||||
|
|
||||||
let services = client.nyxd.get_all_services().await.unwrap();
|
|
||||||
println!("services: {services:#?}");
|
|
||||||
|
|
||||||
let announcer = AccountId::from_str("n1hmf957kc7arcd39rl7xq8l0a4zyg7kxnv7su87").unwrap();
|
|
||||||
let services_by_announcer = client
|
|
||||||
.nyxd
|
|
||||||
.get_services_by_announcer(announcer)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
println!("services (by announcer): {services_by_announcer:#?}");
|
|
||||||
|
|
||||||
let nym_address = NymAddress::new("foo.bar@gateway");
|
|
||||||
let services_by_nym_address = client
|
|
||||||
.nyxd
|
|
||||||
.get_services_by_nym_address(nym_address)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(services_by_announcer, services_by_nym_address);
|
|
||||||
|
|
||||||
let service_info = client.nyxd.get_service_info(1).await;
|
|
||||||
println!("service info: {service_info:#?}");
|
|
||||||
}
|
|
||||||
@@ -18,6 +18,7 @@ use nym_api_requests::models::{
|
|||||||
GatewayCoreStatusResponse, MixnodeCoreStatusResponse, MixnodeStatusResponse,
|
GatewayCoreStatusResponse, MixnodeCoreStatusResponse, MixnodeStatusResponse,
|
||||||
RewardEstimationResponse, StakeSaturationResponse,
|
RewardEstimationResponse, StakeSaturationResponse,
|
||||||
};
|
};
|
||||||
|
use nym_api_requests::nym_nodes::SkimmedNode;
|
||||||
use nym_network_defaults::NymNetworkDetails;
|
use nym_network_defaults::NymNetworkDetails;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
@@ -257,6 +258,12 @@ impl NymApiClient {
|
|||||||
NymApiClient { nym_api }
|
NymApiClient { nym_api }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_fronted(api_url: Url, fronting_url: Url) -> Self {
|
||||||
|
let nym_api = nym_api::Client::new_fronted(api_url, fronting_url, None);
|
||||||
|
|
||||||
|
NymApiClient { nym_api }
|
||||||
|
}
|
||||||
|
|
||||||
pub fn api_url(&self) -> &Url {
|
pub fn api_url(&self) -> &Url {
|
||||||
self.nym_api.current_url()
|
self.nym_api.current_url()
|
||||||
}
|
}
|
||||||
@@ -265,6 +272,37 @@ impl NymApiClient {
|
|||||||
self.nym_api.change_base_url(new_endpoint);
|
self.nym_api.change_base_url(new_endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn change_nym_api_with_fronting(
|
||||||
|
&mut self,
|
||||||
|
new_api_endpoint: Url,
|
||||||
|
new_fronting_domain: Url,
|
||||||
|
) {
|
||||||
|
self.nym_api
|
||||||
|
.change_fronted_url(new_api_endpoint, new_fronting_domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_basic_mixnodes(
|
||||||
|
&self,
|
||||||
|
semver_compatibility: Option<String>,
|
||||||
|
) -> Result<Vec<SkimmedNode>, ValidatorClientError> {
|
||||||
|
Ok(self
|
||||||
|
.nym_api
|
||||||
|
.get_basic_mixnodes(semver_compatibility)
|
||||||
|
.await?
|
||||||
|
.nodes)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_basic_gateways(
|
||||||
|
&self,
|
||||||
|
semver_compatibility: Option<String>,
|
||||||
|
) -> Result<Vec<SkimmedNode>, ValidatorClientError> {
|
||||||
|
Ok(self
|
||||||
|
.nym_api
|
||||||
|
.get_basic_gateways(semver_compatibility)
|
||||||
|
.await?
|
||||||
|
.nodes)
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn get_cached_active_mixnodes(
|
pub async fn get_cached_active_mixnodes(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<Vec<MixNodeDetails>, ValidatorClientError> {
|
) -> Result<Vec<MixNodeDetails>, ValidatorClientError> {
|
||||||
|
|||||||
@@ -25,14 +25,13 @@ pub use nym_coconut_dkg_common::types::EpochId;
|
|||||||
use nym_http_api_client::{ApiClient, NO_PARAMS};
|
use nym_http_api_client::{ApiClient, NO_PARAMS};
|
||||||
use nym_mixnet_contract_common::mixnode::MixNodeDetails;
|
use nym_mixnet_contract_common::mixnode::MixNodeDetails;
|
||||||
use nym_mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixId};
|
use nym_mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixId};
|
||||||
use nym_name_service_common::response::NamesListResponse;
|
|
||||||
use nym_service_provider_directory_common::response::ServicesListResponse;
|
|
||||||
|
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod routes;
|
pub mod routes;
|
||||||
|
|
||||||
use nym_api_requests::coconut::models::FreePassNonceResponse;
|
use nym_api_requests::coconut::models::FreePassNonceResponse;
|
||||||
use nym_api_requests::coconut::FreePassRequest;
|
use nym_api_requests::coconut::FreePassRequest;
|
||||||
|
use nym_api_requests::nym_nodes::{CachedNodesResponse, SkimmedNode};
|
||||||
pub use nym_http_api_client::Client;
|
pub use nym_http_api_client::Client;
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
||||||
@@ -97,6 +96,52 @@ pub trait NymApiClientExt: ApiClient {
|
|||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn get_basic_mixnodes(
|
||||||
|
&self,
|
||||||
|
semver_compatibility: Option<String>,
|
||||||
|
) -> Result<CachedNodesResponse<SkimmedNode>, NymAPIError> {
|
||||||
|
let params = if let Some(semver_compatibility) = &semver_compatibility {
|
||||||
|
vec![("semver_compatibility", semver_compatibility.as_str())]
|
||||||
|
} else {
|
||||||
|
vec![]
|
||||||
|
};
|
||||||
|
|
||||||
|
self.get_json(
|
||||||
|
&[
|
||||||
|
routes::API_VERSION,
|
||||||
|
"unstable",
|
||||||
|
"nym-nodes",
|
||||||
|
"mixnodes",
|
||||||
|
"skimmed",
|
||||||
|
],
|
||||||
|
¶ms,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_basic_gateways(
|
||||||
|
&self,
|
||||||
|
semver_compatibility: Option<String>,
|
||||||
|
) -> Result<CachedNodesResponse<SkimmedNode>, NymAPIError> {
|
||||||
|
let params = if let Some(semver_compatibility) = &semver_compatibility {
|
||||||
|
vec![("semver_compatibility", semver_compatibility.as_str())]
|
||||||
|
} else {
|
||||||
|
vec![]
|
||||||
|
};
|
||||||
|
|
||||||
|
self.get_json(
|
||||||
|
&[
|
||||||
|
routes::API_VERSION,
|
||||||
|
"unstable",
|
||||||
|
"nym-nodes",
|
||||||
|
"gateways",
|
||||||
|
"skimmed",
|
||||||
|
],
|
||||||
|
¶ms,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
async fn get_active_mixnodes(&self) -> Result<Vec<MixNodeDetails>, NymAPIError> {
|
async fn get_active_mixnodes(&self) -> Result<Vec<MixNodeDetails>, NymAPIError> {
|
||||||
self.get_json(
|
self.get_json(
|
||||||
&[routes::API_VERSION, routes::MIXNODES, routes::ACTIVE],
|
&[routes::API_VERSION, routes::MIXNODES, routes::ACTIVE],
|
||||||
@@ -492,19 +537,6 @@ pub trait NymApiClientExt: ApiClient {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_service_providers(&self) -> Result<ServicesListResponse, NymAPIError> {
|
|
||||||
log::trace!("Getting service providers");
|
|
||||||
self.get_json(&[routes::API_VERSION, routes::SERVICE_PROVIDERS], NO_PARAMS)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
//async fn get_registered_names(&self) -> Result<Vec<NameEntry>, NymAPIError> {
|
|
||||||
async fn get_registered_names(&self) -> Result<NamesListResponse, NymAPIError> {
|
|
||||||
log::trace!("Getting registered names");
|
|
||||||
self.get_json(&[routes::API_VERSION, routes::REGISTERED_NAMES], NO_PARAMS)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
||||||
|
|||||||
@@ -40,4 +40,3 @@ pub const STAKE_SATURATION: &str = "stake-saturation";
|
|||||||
pub const INCLUSION_CHANCE: &str = "inclusion-probability";
|
pub const INCLUSION_CHANCE: &str = "inclusion-probability";
|
||||||
|
|
||||||
pub const SERVICE_PROVIDERS: &str = "services";
|
pub const SERVICE_PROVIDERS: &str = "services";
|
||||||
pub const REGISTERED_NAMES: &str = "names";
|
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::collect_paged;
|
|
||||||
use crate::nyxd::contract_traits::NymContractsProvider;
|
|
||||||
use crate::nyxd::error::NyxdError;
|
|
||||||
use crate::nyxd::CosmWasmClient;
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use nym_ephemera_common::msg::QueryMsg as EphemeraQueryMsg;
|
|
||||||
use nym_ephemera_common::peers::PagedPeerResponse;
|
|
||||||
use nym_ephemera_common::types::JsonPeerInfo;
|
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait EphemeraQueryClient {
|
|
||||||
async fn query_ephemera_contract<T>(&self, query: EphemeraQueryMsg) -> Result<T, NyxdError>
|
|
||||||
where
|
|
||||||
for<'a> T: Deserialize<'a>;
|
|
||||||
|
|
||||||
async fn get_peers_paged(
|
|
||||||
&self,
|
|
||||||
start_after: Option<String>,
|
|
||||||
limit: Option<u32>,
|
|
||||||
) -> Result<PagedPeerResponse, NyxdError> {
|
|
||||||
let request = EphemeraQueryMsg::GetPeers { start_after, limit };
|
|
||||||
self.query_ephemera_contract(request).await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// extension trait to the query client to deal with the paged queries
|
|
||||||
// (it didn't feel appropriate to combine it with the existing trait
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait PagedEphemeraQueryClient: EphemeraQueryClient {
|
|
||||||
async fn get_all_ephemera_peers(&self) -> Result<Vec<JsonPeerInfo>, NyxdError> {
|
|
||||||
collect_paged!(self, get_peers_paged, peers)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl<T> PagedEphemeraQueryClient for T where T: EphemeraQueryClient {}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
impl<C> EphemeraQueryClient for C
|
|
||||||
where
|
|
||||||
C: CosmWasmClient + NymContractsProvider + Send + Sync,
|
|
||||||
{
|
|
||||||
async fn query_ephemera_contract<T>(&self, query: EphemeraQueryMsg) -> Result<T, NyxdError>
|
|
||||||
where
|
|
||||||
for<'a> T: Deserialize<'a>,
|
|
||||||
{
|
|
||||||
let ephemera_contract_address = &self
|
|
||||||
.ephemera_contract_address()
|
|
||||||
.ok_or_else(|| NyxdError::unavailable_contract_address("ephemera contract"))?;
|
|
||||||
self.query_contract_smart(ephemera_contract_address, &query)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::nyxd::contract_traits::tests::IgnoreValue;
|
|
||||||
|
|
||||||
// it's enough that this compiles and clippy is happy about it
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn all_query_variants_are_covered<C: EphemeraQueryClient + Send + Sync>(
|
|
||||||
client: C,
|
|
||||||
msg: EphemeraQueryMsg,
|
|
||||||
) {
|
|
||||||
match msg {
|
|
||||||
EphemeraQueryMsg::GetPeers { limit, start_after } => {
|
|
||||||
client.get_peers_paged(start_after, limit).ignore()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-86
@@ -1,86 +0,0 @@
|
|||||||
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::nyxd::contract_traits::NymContractsProvider;
|
|
||||||
use crate::nyxd::cosmwasm_client::types::ExecuteResult;
|
|
||||||
use crate::nyxd::error::NyxdError;
|
|
||||||
use crate::nyxd::{Coin, Fee, SigningCosmWasmClient};
|
|
||||||
use crate::signing::signer::OfflineSigner;
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use nym_ephemera_common::msg::ExecuteMsg as EphemeraExecuteMsg;
|
|
||||||
use nym_ephemera_common::types::JsonPeerInfo;
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait EphemeraSigningClient {
|
|
||||||
async fn execute_ephemera_contract(
|
|
||||||
&self,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
msg: EphemeraExecuteMsg,
|
|
||||||
memo: String,
|
|
||||||
funds: Vec<Coin>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError>;
|
|
||||||
|
|
||||||
async fn register_as_peer(
|
|
||||||
&self,
|
|
||||||
peer_info: JsonPeerInfo,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
let req = EphemeraExecuteMsg::RegisterPeer { peer_info };
|
|
||||||
|
|
||||||
self.execute_ephemera_contract(fee, req, "registering as peer".to_string(), vec![])
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
impl<C> EphemeraSigningClient for C
|
|
||||||
where
|
|
||||||
C: SigningCosmWasmClient + NymContractsProvider + Sync,
|
|
||||||
NyxdError: From<<Self as OfflineSigner>::Error>,
|
|
||||||
{
|
|
||||||
async fn execute_ephemera_contract(
|
|
||||||
&self,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
msg: EphemeraExecuteMsg,
|
|
||||||
memo: String,
|
|
||||||
funds: Vec<Coin>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
let ephemera_contract_address = self
|
|
||||||
.ephemera_contract_address()
|
|
||||||
.ok_or_else(|| NyxdError::unavailable_contract_address("ephemera contract"))?;
|
|
||||||
|
|
||||||
let fee = fee.unwrap_or(Fee::Auto(Some(self.simulated_gas_multiplier())));
|
|
||||||
let signer_address = &self.signer_addresses()?[0];
|
|
||||||
|
|
||||||
self.execute(
|
|
||||||
signer_address,
|
|
||||||
ephemera_contract_address,
|
|
||||||
&msg,
|
|
||||||
fee,
|
|
||||||
memo,
|
|
||||||
funds,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::nyxd::contract_traits::tests::IgnoreValue;
|
|
||||||
|
|
||||||
// it's enough that this compiles and clippy is happy about it
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn all_execute_variants_are_covered<C: EphemeraSigningClient + Send + Sync>(
|
|
||||||
client: C,
|
|
||||||
msg: EphemeraExecuteMsg,
|
|
||||||
) {
|
|
||||||
match msg {
|
|
||||||
EphemeraExecuteMsg::RegisterPeer { peer_info } => {
|
|
||||||
client.register_as_peer(peer_info, None).ignore()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,23 +10,17 @@ use std::str::FromStr;
|
|||||||
// query clients
|
// query clients
|
||||||
pub mod coconut_bandwidth_query_client;
|
pub mod coconut_bandwidth_query_client;
|
||||||
pub mod dkg_query_client;
|
pub mod dkg_query_client;
|
||||||
pub mod ephemera_query_client;
|
|
||||||
pub mod group_query_client;
|
pub mod group_query_client;
|
||||||
pub mod mixnet_query_client;
|
pub mod mixnet_query_client;
|
||||||
pub mod multisig_query_client;
|
pub mod multisig_query_client;
|
||||||
pub mod name_service_query_client;
|
|
||||||
pub mod sp_directory_query_client;
|
|
||||||
pub mod vesting_query_client;
|
pub mod vesting_query_client;
|
||||||
|
|
||||||
// signing clients
|
// signing clients
|
||||||
pub mod coconut_bandwidth_signing_client;
|
pub mod coconut_bandwidth_signing_client;
|
||||||
pub mod dkg_signing_client;
|
pub mod dkg_signing_client;
|
||||||
pub mod ephemera_signing_client;
|
|
||||||
pub mod group_signing_client;
|
pub mod group_signing_client;
|
||||||
pub mod mixnet_signing_client;
|
pub mod mixnet_signing_client;
|
||||||
pub mod multisig_signing_client;
|
pub mod multisig_signing_client;
|
||||||
pub mod name_service_signing_client;
|
|
||||||
pub mod sp_directory_signing_client;
|
|
||||||
pub mod vesting_signing_client;
|
pub mod vesting_signing_client;
|
||||||
|
|
||||||
// re-export query traits
|
// re-export query traits
|
||||||
@@ -34,23 +28,17 @@ pub use coconut_bandwidth_query_client::{
|
|||||||
CoconutBandwidthQueryClient, PagedCoconutBandwidthQueryClient,
|
CoconutBandwidthQueryClient, PagedCoconutBandwidthQueryClient,
|
||||||
};
|
};
|
||||||
pub use dkg_query_client::{DkgQueryClient, PagedDkgQueryClient};
|
pub use dkg_query_client::{DkgQueryClient, PagedDkgQueryClient};
|
||||||
pub use ephemera_query_client::{EphemeraQueryClient, PagedEphemeraQueryClient};
|
|
||||||
pub use group_query_client::{GroupQueryClient, PagedGroupQueryClient};
|
pub use group_query_client::{GroupQueryClient, PagedGroupQueryClient};
|
||||||
pub use mixnet_query_client::{MixnetQueryClient, PagedMixnetQueryClient};
|
pub use mixnet_query_client::{MixnetQueryClient, PagedMixnetQueryClient};
|
||||||
pub use multisig_query_client::{MultisigQueryClient, PagedMultisigQueryClient};
|
pub use multisig_query_client::{MultisigQueryClient, PagedMultisigQueryClient};
|
||||||
pub use name_service_query_client::{NameServiceQueryClient, PagedNameServiceQueryClient};
|
|
||||||
pub use sp_directory_query_client::{PagedSpDirectoryQueryClient, SpDirectoryQueryClient};
|
|
||||||
pub use vesting_query_client::{PagedVestingQueryClient, VestingQueryClient};
|
pub use vesting_query_client::{PagedVestingQueryClient, VestingQueryClient};
|
||||||
|
|
||||||
// re-export signing traits
|
// re-export signing traits
|
||||||
pub use coconut_bandwidth_signing_client::CoconutBandwidthSigningClient;
|
pub use coconut_bandwidth_signing_client::CoconutBandwidthSigningClient;
|
||||||
pub use dkg_signing_client::DkgSigningClient;
|
pub use dkg_signing_client::DkgSigningClient;
|
||||||
pub use ephemera_signing_client::EphemeraSigningClient;
|
|
||||||
pub use group_signing_client::GroupSigningClient;
|
pub use group_signing_client::GroupSigningClient;
|
||||||
pub use mixnet_signing_client::MixnetSigningClient;
|
pub use mixnet_signing_client::MixnetSigningClient;
|
||||||
pub use multisig_signing_client::MultisigSigningClient;
|
pub use multisig_signing_client::MultisigSigningClient;
|
||||||
pub use name_service_signing_client::NameServiceSigningClient;
|
|
||||||
pub use sp_directory_signing_client::SpDirectorySigningClient;
|
|
||||||
pub use vesting_signing_client::VestingSigningClient;
|
pub use vesting_signing_client::VestingSigningClient;
|
||||||
|
|
||||||
// helper for providing blanket implementation for query clients
|
// helper for providing blanket implementation for query clients
|
||||||
@@ -64,13 +52,6 @@ pub trait NymContractsProvider {
|
|||||||
fn dkg_contract_address(&self) -> Option<&AccountId>;
|
fn dkg_contract_address(&self) -> Option<&AccountId>;
|
||||||
fn group_contract_address(&self) -> Option<&AccountId>;
|
fn group_contract_address(&self) -> Option<&AccountId>;
|
||||||
fn multisig_contract_address(&self) -> Option<&AccountId>;
|
fn multisig_contract_address(&self) -> Option<&AccountId>;
|
||||||
|
|
||||||
// ephemera-related
|
|
||||||
fn ephemera_contract_address(&self) -> Option<&AccountId>;
|
|
||||||
|
|
||||||
// SPs
|
|
||||||
fn name_service_contract_address(&self) -> Option<&AccountId>;
|
|
||||||
fn service_provider_contract_address(&self) -> Option<&AccountId>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -82,11 +63,6 @@ pub struct TypedNymContracts {
|
|||||||
pub group_contract_address: Option<AccountId>,
|
pub group_contract_address: Option<AccountId>,
|
||||||
pub multisig_contract_address: Option<AccountId>,
|
pub multisig_contract_address: Option<AccountId>,
|
||||||
pub coconut_dkg_contract_address: Option<AccountId>,
|
pub coconut_dkg_contract_address: Option<AccountId>,
|
||||||
|
|
||||||
pub ephemera_contract_address: Option<AccountId>,
|
|
||||||
|
|
||||||
pub service_provider_directory_contract_address: Option<AccountId>,
|
|
||||||
pub name_service_contract_address: Option<AccountId>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<NymContracts> for TypedNymContracts {
|
impl TryFrom<NymContracts> for TypedNymContracts {
|
||||||
@@ -118,18 +94,6 @@ impl TryFrom<NymContracts> for TypedNymContracts {
|
|||||||
.coconut_dkg_contract_address
|
.coconut_dkg_contract_address
|
||||||
.map(|addr| addr.parse())
|
.map(|addr| addr.parse())
|
||||||
.transpose()?,
|
.transpose()?,
|
||||||
ephemera_contract_address: value
|
|
||||||
.ephemera_contract_address
|
|
||||||
.map(|addr| addr.parse())
|
|
||||||
.transpose()?,
|
|
||||||
service_provider_directory_contract_address: value
|
|
||||||
.service_provider_directory_contract_address
|
|
||||||
.map(|addr| addr.parse())
|
|
||||||
.transpose()?,
|
|
||||||
name_service_contract_address: value
|
|
||||||
.name_service_contract_address
|
|
||||||
.map(|addr| addr.parse())
|
|
||||||
.transpose()?,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-144
@@ -1,144 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::collect_paged;
|
|
||||||
use crate::nyxd::contract_traits::NymContractsProvider;
|
|
||||||
use crate::nyxd::{error::NyxdError, CosmWasmClient};
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use cosmrs::AccountId;
|
|
||||||
use nym_contracts_common::{signing::Nonce, ContractBuildInformation};
|
|
||||||
use nym_name_service_common::{
|
|
||||||
msg::QueryMsg as NameQueryMsg,
|
|
||||||
response::{ConfigResponse, NamesListResponse, PagedNamesListResponse},
|
|
||||||
Address, NameId, NymName, RegisteredName,
|
|
||||||
};
|
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait NameServiceQueryClient {
|
|
||||||
async fn query_name_service_contract<T>(&self, query: NameQueryMsg) -> Result<T, NyxdError>
|
|
||||||
where
|
|
||||||
for<'a> T: Deserialize<'a>;
|
|
||||||
|
|
||||||
async fn get_name_service_config(&self) -> Result<ConfigResponse, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::Config {})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_name_entry(&self, name_id: NameId) -> Result<RegisteredName, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::NameId { name_id })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_names_paged(
|
|
||||||
&self,
|
|
||||||
start_after: Option<NameId>,
|
|
||||||
limit: Option<u32>,
|
|
||||||
) -> Result<PagedNamesListResponse, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::All { limit, start_after })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_name_signing_nonce(&self, address: &AccountId) -> Result<Nonce, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::SigningNonce {
|
|
||||||
address: address.to_string(),
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_names_by_owner(&self, owner: AccountId) -> Result<NamesListResponse, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::ByOwner {
|
|
||||||
owner: owner.to_string(),
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_names_by_nym_name(&self, name: NymName) -> Result<NamesListResponse, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::ByName { name })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_names_by_address(&self, address: Address) -> Result<NamesListResponse, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::ByAddress { address })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_name_service_contract_version(
|
|
||||||
&self,
|
|
||||||
) -> Result<ContractBuildInformation, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::GetContractVersion {})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_name_service_contract_cw2_version(
|
|
||||||
&self,
|
|
||||||
) -> Result<cw2::ContractVersion, NyxdError> {
|
|
||||||
self.query_name_service_contract(NameQueryMsg::GetCW2ContractVersion {})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait PagedNameServiceQueryClient: NameServiceQueryClient {
|
|
||||||
async fn get_all_names(&self) -> Result<Vec<RegisteredName>, NyxdError> {
|
|
||||||
collect_paged!(self, get_names_paged, names)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl<T> PagedNameServiceQueryClient for T where T: NameServiceQueryClient {}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
impl<C> NameServiceQueryClient for C
|
|
||||||
where
|
|
||||||
C: CosmWasmClient + NymContractsProvider + Send + Sync,
|
|
||||||
{
|
|
||||||
async fn query_name_service_contract<T>(&self, query: NameQueryMsg) -> Result<T, NyxdError>
|
|
||||||
where
|
|
||||||
for<'a> T: Deserialize<'a>,
|
|
||||||
{
|
|
||||||
let name_service_contract_address = &self
|
|
||||||
.name_service_contract_address()
|
|
||||||
.ok_or_else(|| NyxdError::unavailable_contract_address("name service contract"))?;
|
|
||||||
self.query_contract_smart(name_service_contract_address, &query)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::nyxd::contract_traits::tests::IgnoreValue;
|
|
||||||
|
|
||||||
// it's enough that this compiles and clippy is happy about it
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn all_query_variants_are_covered<C: NameServiceQueryClient + Send + Sync>(
|
|
||||||
client: C,
|
|
||||||
msg: NameQueryMsg,
|
|
||||||
) {
|
|
||||||
match msg {
|
|
||||||
NameQueryMsg::NameId { name_id } => client.get_name_entry(name_id).ignore(),
|
|
||||||
NameQueryMsg::ByOwner { owner } => {
|
|
||||||
client.get_names_by_owner(owner.parse().unwrap()).ignore()
|
|
||||||
}
|
|
||||||
NameQueryMsg::ByName { name } => client.get_names_by_nym_name(name).ignore(),
|
|
||||||
NameQueryMsg::ByAddress { address } => client.get_names_by_address(address).ignore(),
|
|
||||||
NameQueryMsg::All { limit, start_after } => {
|
|
||||||
client.get_names_paged(limit, start_after).ignore()
|
|
||||||
}
|
|
||||||
NameQueryMsg::SigningNonce { address } => client
|
|
||||||
.get_name_signing_nonce(&address.parse().unwrap())
|
|
||||||
.ignore(),
|
|
||||||
NameQueryMsg::Config {} => client.get_name_service_config().ignore(),
|
|
||||||
NameQueryMsg::GetContractVersion {} => {
|
|
||||||
client.get_name_service_contract_version().ignore()
|
|
||||||
}
|
|
||||||
NameQueryMsg::GetCW2ContractVersion {} => {
|
|
||||||
client.get_name_service_contract_cw2_version().ignore()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-138
@@ -1,138 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use nym_contracts_common::signing::MessageSignature;
|
|
||||||
use nym_name_service_common::{msg::ExecuteMsg as NameExecuteMsg, NameDetails, NameId, NymName};
|
|
||||||
|
|
||||||
use crate::nyxd::contract_traits::NymContractsProvider;
|
|
||||||
use crate::nyxd::{
|
|
||||||
coin::Coin, cosmwasm_client::types::ExecuteResult, error::NyxdError, Fee, SigningCosmWasmClient,
|
|
||||||
};
|
|
||||||
use crate::signing::signer::OfflineSigner;
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait NameServiceSigningClient {
|
|
||||||
async fn execute_name_service_contract(
|
|
||||||
&self,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
msg: NameExecuteMsg,
|
|
||||||
funds: Vec<Coin>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError>;
|
|
||||||
|
|
||||||
async fn register_name(
|
|
||||||
&self,
|
|
||||||
name: NameDetails,
|
|
||||||
owner_signature: MessageSignature,
|
|
||||||
deposit: Coin,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_name_service_contract(
|
|
||||||
fee,
|
|
||||||
NameExecuteMsg::Register {
|
|
||||||
name,
|
|
||||||
owner_signature,
|
|
||||||
},
|
|
||||||
vec![deposit],
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn delete_name_by_id(
|
|
||||||
&self,
|
|
||||||
name_id: NameId,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_name_service_contract(fee, NameExecuteMsg::DeleteId { name_id }, vec![])
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn delete_service_provider_by_name(
|
|
||||||
&self,
|
|
||||||
name: NymName,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_name_service_contract(fee, NameExecuteMsg::DeleteName { name }, vec![])
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn update_deposit_required(
|
|
||||||
&self,
|
|
||||||
deposit_required: Coin,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_name_service_contract(
|
|
||||||
fee,
|
|
||||||
NameExecuteMsg::UpdateDepositRequired {
|
|
||||||
deposit_required: deposit_required.into(),
|
|
||||||
},
|
|
||||||
vec![],
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
impl<C> NameServiceSigningClient for C
|
|
||||||
where
|
|
||||||
C: SigningCosmWasmClient + NymContractsProvider + Sync,
|
|
||||||
NyxdError: From<<Self as OfflineSigner>::Error>,
|
|
||||||
{
|
|
||||||
async fn execute_name_service_contract(
|
|
||||||
&self,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
msg: NameExecuteMsg,
|
|
||||||
funds: Vec<Coin>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
let name_service_contract_address = &self
|
|
||||||
.name_service_contract_address()
|
|
||||||
.ok_or_else(|| NyxdError::unavailable_contract_address("name service contract"))?;
|
|
||||||
|
|
||||||
let fee = fee.unwrap_or(Fee::Auto(Some(self.simulated_gas_multiplier())));
|
|
||||||
let memo = msg.default_memo();
|
|
||||||
|
|
||||||
let signer_address = &self.signer_addresses()?[0];
|
|
||||||
self.execute(
|
|
||||||
signer_address,
|
|
||||||
name_service_contract_address,
|
|
||||||
&msg,
|
|
||||||
fee,
|
|
||||||
memo,
|
|
||||||
funds,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::nyxd::contract_traits::tests::{mock_coin, IgnoreValue};
|
|
||||||
|
|
||||||
// it's enough that this compiles and clippy is happy about it
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn all_execute_variants_are_covered<C: NameServiceSigningClient + Send + Sync>(
|
|
||||||
client: C,
|
|
||||||
msg: NameExecuteMsg,
|
|
||||||
) {
|
|
||||||
match msg {
|
|
||||||
NameExecuteMsg::Register {
|
|
||||||
name,
|
|
||||||
owner_signature,
|
|
||||||
} => client
|
|
||||||
.register_name(name, owner_signature, mock_coin(), None)
|
|
||||||
.ignore(),
|
|
||||||
NameExecuteMsg::DeleteId { name_id } => {
|
|
||||||
client.delete_name_by_id(name_id, None).ignore()
|
|
||||||
}
|
|
||||||
NameExecuteMsg::DeleteName { name } => {
|
|
||||||
client.delete_service_provider_by_name(name, None).ignore()
|
|
||||||
}
|
|
||||||
NameExecuteMsg::UpdateDepositRequired { deposit_required } => client
|
|
||||||
.update_deposit_required(deposit_required.into(), None)
|
|
||||||
.ignore(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-142
@@ -1,142 +0,0 @@
|
|||||||
use crate::collect_paged;
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use cosmrs::AccountId;
|
|
||||||
use nym_contracts_common::{signing::Nonce, ContractBuildInformation};
|
|
||||||
use nym_service_provider_directory_common::{
|
|
||||||
msg::QueryMsg as SpQueryMsg,
|
|
||||||
response::{
|
|
||||||
ConfigResponse, PagedServicesListResponse, ServiceInfoResponse, ServicesListResponse,
|
|
||||||
},
|
|
||||||
NymAddress, Service, ServiceId,
|
|
||||||
};
|
|
||||||
use serde::Deserialize;
|
|
||||||
|
|
||||||
use crate::nyxd::contract_traits::NymContractsProvider;
|
|
||||||
use crate::nyxd::{error::NyxdError, CosmWasmClient};
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait SpDirectoryQueryClient {
|
|
||||||
async fn query_service_provider_contract<T>(&self, query: SpQueryMsg) -> Result<T, NyxdError>
|
|
||||||
where
|
|
||||||
for<'a> T: Deserialize<'a>;
|
|
||||||
|
|
||||||
async fn get_service_config(&self) -> Result<ConfigResponse, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::Config {})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_service_info(
|
|
||||||
&self,
|
|
||||||
service_id: ServiceId,
|
|
||||||
) -> Result<ServiceInfoResponse, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::ServiceId { service_id })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_services_paged(
|
|
||||||
&self,
|
|
||||||
start_after: Option<ServiceId>,
|
|
||||||
limit: Option<u32>,
|
|
||||||
) -> Result<PagedServicesListResponse, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::All { limit, start_after })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_services_by_announcer(
|
|
||||||
&self,
|
|
||||||
announcer: AccountId,
|
|
||||||
) -> Result<ServicesListResponse, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::ByAnnouncer {
|
|
||||||
announcer: announcer.to_string(),
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_services_by_nym_address(
|
|
||||||
&self,
|
|
||||||
nym_address: NymAddress,
|
|
||||||
) -> Result<ServicesListResponse, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::ByNymAddress { nym_address })
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_sp_contract_version(&self) -> Result<ContractBuildInformation, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::GetContractVersion {})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_sp_contract_cw2_version(&self) -> Result<cw2::ContractVersion, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::GetCW2ContractVersion {})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn get_service_signing_nonce(&self, address: &AccountId) -> Result<Nonce, NyxdError> {
|
|
||||||
self.query_service_provider_contract(SpQueryMsg::SigningNonce {
|
|
||||||
address: address.to_string(),
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait PagedSpDirectoryQueryClient: SpDirectoryQueryClient {
|
|
||||||
async fn get_all_services(&self) -> Result<Vec<Service>, NyxdError> {
|
|
||||||
collect_paged!(self, get_services_paged, services)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl<T> PagedSpDirectoryQueryClient for T where T: SpDirectoryQueryClient {}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
impl<C> SpDirectoryQueryClient for C
|
|
||||||
where
|
|
||||||
C: CosmWasmClient + NymContractsProvider + Send + Sync,
|
|
||||||
{
|
|
||||||
async fn query_service_provider_contract<T>(&self, query: SpQueryMsg) -> Result<T, NyxdError>
|
|
||||||
where
|
|
||||||
for<'a> T: Deserialize<'a>,
|
|
||||||
{
|
|
||||||
let sp_directory_contract_address =
|
|
||||||
&self.service_provider_contract_address().ok_or_else(|| {
|
|
||||||
NyxdError::unavailable_contract_address("service provider directory contract")
|
|
||||||
})?;
|
|
||||||
self.query_contract_smart(sp_directory_contract_address, &query)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::nyxd::contract_traits::tests::IgnoreValue;
|
|
||||||
|
|
||||||
// it's enough that this compiles and clippy is happy about it
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn all_query_variants_are_covered<C: SpDirectoryQueryClient + Send + Sync>(
|
|
||||||
client: C,
|
|
||||||
msg: SpQueryMsg,
|
|
||||||
) {
|
|
||||||
match msg {
|
|
||||||
SpQueryMsg::ServiceId { service_id } => client.get_service_info(service_id).ignore(),
|
|
||||||
SpQueryMsg::ByAnnouncer { announcer } => client
|
|
||||||
.get_services_by_announcer(announcer.parse().unwrap())
|
|
||||||
.ignore(),
|
|
||||||
SpQueryMsg::ByNymAddress { nym_address } => {
|
|
||||||
client.get_services_by_nym_address(nym_address).ignore()
|
|
||||||
}
|
|
||||||
SpQueryMsg::All { limit, start_after } => {
|
|
||||||
client.get_services_paged(start_after, limit).ignore()
|
|
||||||
}
|
|
||||||
SpQueryMsg::SigningNonce { address } => client
|
|
||||||
.get_service_signing_nonce(&address.parse().unwrap())
|
|
||||||
.ignore(),
|
|
||||||
SpQueryMsg::Config {} => client.get_service_config().ignore(),
|
|
||||||
SpQueryMsg::GetContractVersion {} => client.get_sp_contract_version().ignore(),
|
|
||||||
SpQueryMsg::GetCW2ContractVersion {} => client.get_sp_contract_cw2_version().ignore(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-148
@@ -1,148 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::nyxd::contract_traits::NymContractsProvider;
|
|
||||||
use crate::nyxd::{
|
|
||||||
coin::Coin, cosmwasm_client::types::ExecuteResult, error::NyxdError, Fee, SigningCosmWasmClient,
|
|
||||||
};
|
|
||||||
use crate::signing::signer::OfflineSigner;
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use nym_contracts_common::signing::MessageSignature;
|
|
||||||
use nym_service_provider_directory_common::{
|
|
||||||
msg::ExecuteMsg as SpExecuteMsg, NymAddress, ServiceDetails, ServiceId,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
pub trait SpDirectorySigningClient {
|
|
||||||
async fn execute_service_provider_directory_contract(
|
|
||||||
&self,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
msg: SpExecuteMsg,
|
|
||||||
funds: Vec<Coin>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError>;
|
|
||||||
|
|
||||||
async fn announce_service_provider(
|
|
||||||
&self,
|
|
||||||
service: ServiceDetails,
|
|
||||||
owner_signature: MessageSignature,
|
|
||||||
deposit: Coin,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_service_provider_directory_contract(
|
|
||||||
fee,
|
|
||||||
SpExecuteMsg::Announce {
|
|
||||||
service,
|
|
||||||
owner_signature,
|
|
||||||
},
|
|
||||||
vec![deposit],
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn delete_service_provider_by_id(
|
|
||||||
&self,
|
|
||||||
service_id: ServiceId,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_service_provider_directory_contract(
|
|
||||||
fee,
|
|
||||||
SpExecuteMsg::DeleteId { service_id },
|
|
||||||
vec![],
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn delete_service_provider_by_nym_address(
|
|
||||||
&self,
|
|
||||||
nym_address: NymAddress,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_service_provider_directory_contract(
|
|
||||||
fee,
|
|
||||||
SpExecuteMsg::DeleteNymAddress { nym_address },
|
|
||||||
vec![],
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn update_deposit_required(
|
|
||||||
&self,
|
|
||||||
deposit_required: Coin,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
self.execute_service_provider_directory_contract(
|
|
||||||
fee,
|
|
||||||
SpExecuteMsg::UpdateDepositRequired {
|
|
||||||
deposit_required: deposit_required.into(),
|
|
||||||
},
|
|
||||||
vec![],
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
|
|
||||||
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
|
|
||||||
impl<C> SpDirectorySigningClient for C
|
|
||||||
where
|
|
||||||
C: SigningCosmWasmClient + NymContractsProvider + Sync,
|
|
||||||
NyxdError: From<<Self as OfflineSigner>::Error>,
|
|
||||||
{
|
|
||||||
async fn execute_service_provider_directory_contract(
|
|
||||||
&self,
|
|
||||||
fee: Option<Fee>,
|
|
||||||
msg: SpExecuteMsg,
|
|
||||||
funds: Vec<Coin>,
|
|
||||||
) -> Result<ExecuteResult, NyxdError> {
|
|
||||||
let sp_directory_contract_address =
|
|
||||||
&self.service_provider_contract_address().ok_or_else(|| {
|
|
||||||
NyxdError::unavailable_contract_address("service provider directory contract")
|
|
||||||
})?;
|
|
||||||
|
|
||||||
let fee = fee.unwrap_or(Fee::Auto(Some(self.simulated_gas_multiplier())));
|
|
||||||
let memo = msg.default_memo();
|
|
||||||
|
|
||||||
let signer_address = &self.signer_addresses()?[0];
|
|
||||||
self.execute(
|
|
||||||
signer_address,
|
|
||||||
sp_directory_contract_address,
|
|
||||||
&msg,
|
|
||||||
fee,
|
|
||||||
memo,
|
|
||||||
funds,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use crate::nyxd::contract_traits::tests::{mock_coin, IgnoreValue};
|
|
||||||
|
|
||||||
// it's enough that this compiles and clippy is happy about it
|
|
||||||
#[allow(dead_code)]
|
|
||||||
fn all_execute_variants_are_covered<C: SpDirectorySigningClient + Send + Sync>(
|
|
||||||
client: C,
|
|
||||||
msg: SpExecuteMsg,
|
|
||||||
) {
|
|
||||||
match msg {
|
|
||||||
SpExecuteMsg::Announce {
|
|
||||||
service,
|
|
||||||
owner_signature,
|
|
||||||
} => client
|
|
||||||
.announce_service_provider(service, owner_signature, mock_coin(), None)
|
|
||||||
.ignore(),
|
|
||||||
SpExecuteMsg::DeleteId { service_id } => client
|
|
||||||
.delete_service_provider_by_id(service_id, None)
|
|
||||||
.ignore(),
|
|
||||||
SpExecuteMsg::DeleteNymAddress { nym_address } => client
|
|
||||||
.delete_service_provider_by_nym_address(nym_address, None)
|
|
||||||
.ignore(),
|
|
||||||
SpExecuteMsg::UpdateDepositRequired { deposit_required } => client
|
|
||||||
.update_deposit_required(deposit_required.into(), None)
|
|
||||||
.ignore(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,16 +9,12 @@ pub use nym_coconut_bandwidth_contract_common::event_attributes::*;
|
|||||||
pub use nym_coconut_dkg_common::event_attributes::*;
|
pub use nym_coconut_dkg_common::event_attributes::*;
|
||||||
|
|
||||||
// it seems that currently validators just emit stringified events (which are also returned as part of deliverTx response)
|
// it seems that currently validators just emit stringified events (which are also returned as part of deliverTx response)
|
||||||
// as theirs logs
|
// as their logs
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct Log {
|
pub struct Log {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
// weird thing is that the first msg_index seems to always be undefined on the raw logs
|
// weird thing is that the first msg_index seems to always be undefined on the raw logs
|
||||||
pub msg_index: usize,
|
pub msg_index: usize,
|
||||||
// unless I'm missing something obvious, the "log" type in cosmjs is always an empty string
|
|
||||||
// and launchpad cosmos validator was setting it to what essentially is just the raw version of what
|
|
||||||
// we received (and we don't care about launchpad, we, as the time of writing this, work on the stargate)
|
|
||||||
// log: String,
|
|
||||||
pub events: Vec<cosmwasm_std::Event>,
|
pub events: Vec<cosmwasm_std::Event>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,8 +33,12 @@ pub fn find_attribute<'a>(
|
|||||||
.find(|attr| attr.key == attribute_key)
|
.find(|attr| attr.key == attribute_key)
|
||||||
}
|
}
|
||||||
|
|
||||||
// those two functions were separated so that the internal logic could actually be tested
|
// these two functions were separated so that the internal logic could actually be tested
|
||||||
fn parse_raw_str_logs(raw: &str) -> Result<Vec<Log>, NyxdError> {
|
fn parse_raw_str_logs(raw: &str) -> Result<Vec<Log>, NyxdError> {
|
||||||
|
if raw.is_empty() {
|
||||||
|
return Ok(Vec::new());
|
||||||
|
}
|
||||||
|
|
||||||
let logs: Vec<Log> = serde_json::from_str(raw).map_err(|_| NyxdError::MalformedLogString)?;
|
let logs: Vec<Log> = serde_json::from_str(raw).map_err(|_| NyxdError::MalformedLogString)?;
|
||||||
if logs.len() != logs.iter().unique_by(|log| log.msg_index).count() {
|
if logs.len() != logs.iter().unique_by(|log| log.msg_index).count() {
|
||||||
// this check is only here because I don't yet fully understand raw log string generation and
|
// this check is only here because I don't yet fully understand raw log string generation and
|
||||||
|
|||||||
@@ -140,6 +140,6 @@ mod tests {
|
|||||||
|
|
||||||
let fee = &gas_price * gas_limit;
|
let fee = &gas_price * gas_limit;
|
||||||
// the failing behaviour was result value of 3937
|
// the failing behaviour was result value of 3937
|
||||||
assert_eq!(fee.amount, 3938u64.into());
|
assert_eq!(fee.amount, 3938u128);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ use crate::http_client;
|
|||||||
use crate::{DirectSigningHttpRpcNyxdClient, QueryHttpRpcNyxdClient};
|
use crate::{DirectSigningHttpRpcNyxdClient, QueryHttpRpcNyxdClient};
|
||||||
#[cfg(feature = "http-client")]
|
#[cfg(feature = "http-client")]
|
||||||
use cosmrs::rpc::{HttpClient, HttpClientUrl};
|
use cosmrs::rpc::{HttpClient, HttpClientUrl};
|
||||||
|
use nym_contracts_common::build_information::CONTRACT_BUILD_INFO_STORAGE_KEY;
|
||||||
|
use nym_contracts_common::ContractBuildInformation;
|
||||||
|
|
||||||
pub mod coin;
|
pub mod coin;
|
||||||
pub mod contract_traits;
|
pub mod contract_traits;
|
||||||
@@ -246,12 +248,6 @@ impl<C, S> NyxdClient<C, S> {
|
|||||||
self.config.contracts.multisig_contract_address = Some(address);
|
self.config.contracts.multisig_contract_address = Some(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_service_provider_contract_address(&mut self, address: AccountId) {
|
|
||||||
self.config
|
|
||||||
.contracts
|
|
||||||
.service_provider_directory_contract_address = Some(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_simulated_gas_multiplier(&mut self, multiplier: f32) {
|
pub fn set_simulated_gas_multiplier(&mut self, multiplier: f32) {
|
||||||
self.config.simulated_gas_multiplier = multiplier;
|
self.config.simulated_gas_multiplier = multiplier;
|
||||||
}
|
}
|
||||||
@@ -284,21 +280,6 @@ impl<C, S> NymContractsProvider for NyxdClient<C, S> {
|
|||||||
fn multisig_contract_address(&self) -> Option<&AccountId> {
|
fn multisig_contract_address(&self) -> Option<&AccountId> {
|
||||||
self.config.contracts.multisig_contract_address.as_ref()
|
self.config.contracts.multisig_contract_address.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ephemera_contract_address(&self) -> Option<&AccountId> {
|
|
||||||
self.config.contracts.ephemera_contract_address.as_ref()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn name_service_contract_address(&self) -> Option<&AccountId> {
|
|
||||||
self.config.contracts.name_service_contract_address.as_ref()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn service_provider_contract_address(&self) -> Option<&AccountId> {
|
|
||||||
self.config
|
|
||||||
.contracts
|
|
||||||
.service_provider_directory_contract_address
|
|
||||||
.as_ref()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// queries
|
// queries
|
||||||
@@ -349,6 +330,33 @@ where
|
|||||||
.await
|
.await
|
||||||
.map(|block| block.block_id.hash)
|
.map(|block| block.block_id.hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn try_get_cw2_contract_version(
|
||||||
|
&self,
|
||||||
|
contract_address: &AccountId,
|
||||||
|
) -> Option<cw2::ContractVersion> {
|
||||||
|
let raw_info = self
|
||||||
|
.query_contract_raw(contract_address, b"contract_info".to_vec())
|
||||||
|
.await
|
||||||
|
.ok()?;
|
||||||
|
|
||||||
|
serde_json::from_slice(&raw_info).ok()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn try_get_contract_build_information(
|
||||||
|
&self,
|
||||||
|
contract_address: &AccountId,
|
||||||
|
) -> Option<ContractBuildInformation> {
|
||||||
|
let raw_info = self
|
||||||
|
.query_contract_raw(
|
||||||
|
contract_address,
|
||||||
|
CONTRACT_BUILD_INFO_STORAGE_KEY.as_bytes().to_vec(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.ok()?;
|
||||||
|
|
||||||
|
serde_json::from_slice(&raw_info).ok()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// signing
|
// signing
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ nym-vesting-contract-common = { path = "../cosmwasm-smart-contracts/vesting-cont
|
|||||||
nym-coconut-bandwidth-contract-common = { path = "../cosmwasm-smart-contracts/coconut-bandwidth-contract" }
|
nym-coconut-bandwidth-contract-common = { path = "../cosmwasm-smart-contracts/coconut-bandwidth-contract" }
|
||||||
nym-coconut-dkg-common = { path = "../cosmwasm-smart-contracts/coconut-dkg" }
|
nym-coconut-dkg-common = { path = "../cosmwasm-smart-contracts/coconut-dkg" }
|
||||||
nym-multisig-contract-common = { path = "../cosmwasm-smart-contracts/multisig-contract" }
|
nym-multisig-contract-common = { path = "../cosmwasm-smart-contracts/multisig-contract" }
|
||||||
nym-service-provider-directory-common = { path = "../cosmwasm-smart-contracts/service-provider-directory" }
|
|
||||||
nym-name-service-common = { path = "../cosmwasm-smart-contracts/name-service" }
|
|
||||||
nym-sphinx = { path = "../../common/nymsphinx" }
|
nym-sphinx = { path = "../../common/nymsphinx" }
|
||||||
nym-client-core = { path = "../../common/client-core" }
|
nym-client-core = { path = "../../common/client-core" }
|
||||||
nym-config = { path = "../../common/config" }
|
nym-config = { path = "../../common/config" }
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ use clap::{Args, Subcommand};
|
|||||||
pub mod gateway;
|
pub mod gateway;
|
||||||
pub mod identity_key;
|
pub mod identity_key;
|
||||||
pub mod mixnode;
|
pub mod mixnode;
|
||||||
pub mod name;
|
|
||||||
pub mod service;
|
|
||||||
|
|
||||||
#[derive(Debug, Args)]
|
#[derive(Debug, Args)]
|
||||||
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
||||||
@@ -23,10 +21,6 @@ pub enum MixnetOperatorsCommands {
|
|||||||
Mixnode(mixnode::MixnetOperatorsMixnode),
|
Mixnode(mixnode::MixnetOperatorsMixnode),
|
||||||
/// Manage your gateway
|
/// Manage your gateway
|
||||||
Gateway(gateway::MixnetOperatorsGateway),
|
Gateway(gateway::MixnetOperatorsGateway),
|
||||||
/// Manage your service
|
|
||||||
ServiceProvider(service::MixnetOperatorsService),
|
|
||||||
/// Manage your registered name
|
|
||||||
Name(name::MixnetOperatorsName),
|
|
||||||
/// Sign messages using your private identity key
|
/// Sign messages using your private identity key
|
||||||
IdentityKey(identity_key::MixnetOperatorsIdentityKey),
|
IdentityKey(identity_key::MixnetOperatorsIdentityKey),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
use clap::Parser;
|
|
||||||
use log::{error, info};
|
|
||||||
use nym_name_service_common::NameId;
|
|
||||||
use nym_validator_client::nyxd::{contract_traits::NameServiceSigningClient, error::NyxdError};
|
|
||||||
use tap::TapFallible;
|
|
||||||
|
|
||||||
use crate::context::SigningClient;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
#[clap(long)]
|
|
||||||
pub id: NameId,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn delete(args: Args, client: SigningClient) -> Result<(), NyxdError> {
|
|
||||||
info!("Deleting registered name alias with id {}", args.id);
|
|
||||||
|
|
||||||
let res = client
|
|
||||||
.delete_name_by_id(args.id, None)
|
|
||||||
.await
|
|
||||||
.tap_err(|err| error!("Failed to delete name: {err:#?}"))?;
|
|
||||||
|
|
||||||
info!("Deleted: {res:?}");
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
use clap::{Args, Subcommand};
|
|
||||||
|
|
||||||
pub mod delete;
|
|
||||||
pub mod register;
|
|
||||||
pub mod register_sign_payload;
|
|
||||||
|
|
||||||
#[derive(Debug, Args)]
|
|
||||||
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
|
||||||
pub struct MixnetOperatorsName {
|
|
||||||
#[clap(subcommand)]
|
|
||||||
pub command: MixnetOperatorsNameCommands,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Subcommand)]
|
|
||||||
pub enum MixnetOperatorsNameCommands {
|
|
||||||
/// Register a name alias for a nym address
|
|
||||||
Register(register::Args),
|
|
||||||
/// Delete name alias for a nym address
|
|
||||||
Delete(delete::Args),
|
|
||||||
/// Create base58-encoded payload required for producing valiid register signature.
|
|
||||||
CreateNameRegisterPayload(register_sign_payload::Args),
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
use clap::Parser;
|
|
||||||
use log::{error, info};
|
|
||||||
use nym_contracts_common::signing::MessageSignature;
|
|
||||||
use nym_name_service_common::{Address, Coin, NameDetails, NymName};
|
|
||||||
use nym_sphinx::addressing::clients::Recipient;
|
|
||||||
use nym_validator_client::nyxd::{contract_traits::NameServiceSigningClient, error::NyxdError};
|
|
||||||
use tap::TapFallible;
|
|
||||||
|
|
||||||
use crate::context::SigningClient;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
/// Name alias
|
|
||||||
#[clap(long)]
|
|
||||||
pub name: NymName,
|
|
||||||
|
|
||||||
/// Nym address that the alias is pointing to
|
|
||||||
#[clap(long)]
|
|
||||||
pub nym_address: Recipient,
|
|
||||||
|
|
||||||
#[clap(long)]
|
|
||||||
pub signature: MessageSignature,
|
|
||||||
|
|
||||||
/// Deposit to be made to the service provider directory, in curent DENOMINATION (e.g. 'unym')
|
|
||||||
#[clap(long)]
|
|
||||||
pub deposit: u128,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn register(args: Args, client: SigningClient) -> Result<(), NyxdError> {
|
|
||||||
info!(
|
|
||||||
"Registering name alias '{}' for nym address '{}'",
|
|
||||||
args.name, args.nym_address
|
|
||||||
);
|
|
||||||
|
|
||||||
let address = Address::new(&args.nym_address.to_string()).expect("invalid address");
|
|
||||||
let identity_key = address.client_id().to_string();
|
|
||||||
let name = NameDetails {
|
|
||||||
name: args.name,
|
|
||||||
address,
|
|
||||||
identity_key,
|
|
||||||
};
|
|
||||||
|
|
||||||
let denom = client.current_chain_details().mix_denom.base.as_str();
|
|
||||||
let deposit = Coin::new(args.deposit, denom);
|
|
||||||
|
|
||||||
let res = client
|
|
||||||
.register_name(name, args.signature, deposit.into(), None)
|
|
||||||
.await
|
|
||||||
.tap_err(|err| error!("Failed to register name: {err:#?}"))?;
|
|
||||||
|
|
||||||
info!("Registered name: {res:?}");
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
context::SigningClient,
|
|
||||||
utils::{account_id_to_cw_addr, DataWrapper},
|
|
||||||
};
|
|
||||||
|
|
||||||
use clap::Parser;
|
|
||||||
use cosmwasm_std::Coin;
|
|
||||||
|
|
||||||
use nym_bin_common::output_format::OutputFormat;
|
|
||||||
use nym_name_service_common::{
|
|
||||||
signing_types::construct_name_register_sign_payload, Address, NymName,
|
|
||||||
};
|
|
||||||
use nym_sphinx::addressing::clients::Recipient;
|
|
||||||
use nym_validator_client::nyxd::{contract_traits::NameServiceQueryClient, error::NyxdError};
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
// The name to register.
|
|
||||||
#[arg(long)]
|
|
||||||
pub name: NymName,
|
|
||||||
|
|
||||||
/// The nym address the name should point to.
|
|
||||||
#[arg(long)]
|
|
||||||
pub nym_address: Recipient,
|
|
||||||
|
|
||||||
#[arg(long)]
|
|
||||||
pub amount: u128,
|
|
||||||
|
|
||||||
#[arg(short, long, default_value_t = OutputFormat::default())]
|
|
||||||
output: OutputFormat,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn create_payload(args: Args, client: SigningClient) -> Result<(), NyxdError> {
|
|
||||||
let address = Address::new(&args.nym_address.to_string()).expect("invalid address");
|
|
||||||
let identity_key = address.client_id().to_string();
|
|
||||||
let name = nym_name_service_common::NameDetails {
|
|
||||||
name: args.name,
|
|
||||||
address,
|
|
||||||
identity_key,
|
|
||||||
};
|
|
||||||
|
|
||||||
let denom = client.current_chain_details().mix_denom.base.as_str();
|
|
||||||
let deposit = Coin::new(args.amount, denom);
|
|
||||||
|
|
||||||
let nonce = match client.get_name_signing_nonce(&client.address()).await {
|
|
||||||
Ok(nonce) => nonce,
|
|
||||||
Err(err) => {
|
|
||||||
eprint!(
|
|
||||||
"failed to query for the signing nonce of {}: {err}",
|
|
||||||
client.address()
|
|
||||||
);
|
|
||||||
return Err(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let address = account_id_to_cw_addr(&client.address());
|
|
||||||
let payload = construct_name_register_sign_payload(nonce, address, deposit, name);
|
|
||||||
let wrapper = DataWrapper::new(payload.to_base58_string().unwrap());
|
|
||||||
println!("{}", args.output.format(&wrapper));
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
use clap::Parser;
|
|
||||||
use log::info;
|
|
||||||
use nym_contracts_common::signing::MessageSignature;
|
|
||||||
use nym_service_provider_directory_common::{Coin, NymAddress, ServiceDetails, ServiceType};
|
|
||||||
use nym_validator_client::nyxd::contract_traits::SpDirectorySigningClient;
|
|
||||||
|
|
||||||
use crate::context::SigningClient;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
#[clap(long)]
|
|
||||||
pub nym_address: String,
|
|
||||||
|
|
||||||
#[clap(long)]
|
|
||||||
pub signature: MessageSignature,
|
|
||||||
|
|
||||||
/// Deposit to be made to the service provider directory, in curent DENOMINATION (e.g. 'unym')
|
|
||||||
#[clap(long)]
|
|
||||||
pub deposit: u128,
|
|
||||||
|
|
||||||
#[clap(long)]
|
|
||||||
pub identity_key: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn announce(args: Args, client: SigningClient) {
|
|
||||||
info!("Annoucing service provider");
|
|
||||||
|
|
||||||
let nym_address = NymAddress::Address(args.nym_address);
|
|
||||||
let service_type = ServiceType::NetworkRequester;
|
|
||||||
let service = ServiceDetails {
|
|
||||||
nym_address,
|
|
||||||
service_type,
|
|
||||||
identity_key: args.identity_key,
|
|
||||||
};
|
|
||||||
|
|
||||||
let denom = client.current_chain_details().mix_denom.base.as_str();
|
|
||||||
let deposit = Coin::new(args.deposit, denom);
|
|
||||||
|
|
||||||
let res = client
|
|
||||||
.announce_service_provider(service, args.signature, deposit.into(), None)
|
|
||||||
.await
|
|
||||||
.expect("Failed to announce service provider");
|
|
||||||
|
|
||||||
info!("Announced service provider: {res:?}");
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
context::SigningClient,
|
|
||||||
utils::{account_id_to_cw_addr, DataWrapper},
|
|
||||||
};
|
|
||||||
|
|
||||||
use clap::Parser;
|
|
||||||
use cosmwasm_std::Coin;
|
|
||||||
|
|
||||||
use nym_bin_common::output_format::OutputFormat;
|
|
||||||
use nym_service_provider_directory_common::{
|
|
||||||
signing_types::construct_service_provider_announce_sign_payload, NymAddress,
|
|
||||||
ServiceType::NetworkRequester,
|
|
||||||
};
|
|
||||||
use nym_sphinx::addressing::clients::Recipient;
|
|
||||||
use nym_validator_client::nyxd::contract_traits::SpDirectoryQueryClient;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
#[clap(long)]
|
|
||||||
pub nym_address: Recipient,
|
|
||||||
|
|
||||||
#[clap(long)]
|
|
||||||
pub amount: u128,
|
|
||||||
|
|
||||||
#[clap(long)]
|
|
||||||
pub identity_key: String,
|
|
||||||
|
|
||||||
#[clap(short, long, default_value_t = OutputFormat::default())]
|
|
||||||
output: OutputFormat,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn create_payload(args: Args, client: SigningClient) {
|
|
||||||
let service = nym_service_provider_directory_common::ServiceDetails {
|
|
||||||
nym_address: NymAddress::new(&args.nym_address.to_string()),
|
|
||||||
service_type: NetworkRequester,
|
|
||||||
identity_key: args.identity_key,
|
|
||||||
};
|
|
||||||
|
|
||||||
let denom = client.current_chain_details().mix_denom.base.as_str();
|
|
||||||
let deposit = Coin::new(args.amount, denom);
|
|
||||||
|
|
||||||
let nonce = match client.get_service_signing_nonce(&client.address()).await {
|
|
||||||
Ok(nonce) => nonce,
|
|
||||||
Err(err) => {
|
|
||||||
eprint!(
|
|
||||||
"failed to query for the signing nonce of {}: {err}",
|
|
||||||
client.address()
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let address = account_id_to_cw_addr(&client.address());
|
|
||||||
let payload =
|
|
||||||
construct_service_provider_announce_sign_payload(nonce, address, deposit, service);
|
|
||||||
let wrapper = DataWrapper::new(payload.to_base58_string().unwrap());
|
|
||||||
println!("{}", args.output.format(&wrapper))
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
use clap::Parser;
|
|
||||||
use log::info;
|
|
||||||
use nym_service_provider_directory_common::ServiceId;
|
|
||||||
use nym_validator_client::nyxd::contract_traits::SpDirectorySigningClient;
|
|
||||||
|
|
||||||
use crate::context::SigningClient;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
#[clap(long)]
|
|
||||||
pub id: ServiceId,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn delete(args: Args, client: SigningClient) {
|
|
||||||
info!("Deleting service provider with id {}", args.id);
|
|
||||||
|
|
||||||
let res = client
|
|
||||||
.delete_service_provider_by_id(args.id, None)
|
|
||||||
.await
|
|
||||||
.expect("Failed to delete service provider");
|
|
||||||
|
|
||||||
info!("Deleted: {res:?}");
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
use clap::{Args, Subcommand};
|
|
||||||
|
|
||||||
pub mod announce;
|
|
||||||
pub mod announce_sign_payload;
|
|
||||||
pub mod delete;
|
|
||||||
|
|
||||||
#[derive(Debug, Args)]
|
|
||||||
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
|
||||||
pub struct MixnetOperatorsService {
|
|
||||||
#[clap(subcommand)]
|
|
||||||
pub command: MixnetOperatorsServiceCommands,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(clippy::large_enum_variant)]
|
|
||||||
#[derive(Debug, Subcommand)]
|
|
||||||
pub enum MixnetOperatorsServiceCommands {
|
|
||||||
/// Announce service provider to the world
|
|
||||||
Announce(announce::Args),
|
|
||||||
/// Delete entry for service provider from the directory
|
|
||||||
Delete(delete::Args),
|
|
||||||
/// Create base58-encoded payload required for producing valid announce signature.
|
|
||||||
CreateServiceAnnounceSignPayload(announce_sign_payload::Args),
|
|
||||||
}
|
|
||||||
@@ -5,8 +5,6 @@ use clap::{Args, Subcommand};
|
|||||||
|
|
||||||
pub mod query_all_gateways;
|
pub mod query_all_gateways;
|
||||||
pub mod query_all_mixnodes;
|
pub mod query_all_mixnodes;
|
||||||
pub mod query_all_names;
|
|
||||||
pub mod query_all_service_providers;
|
|
||||||
|
|
||||||
#[derive(Debug, Args)]
|
#[derive(Debug, Args)]
|
||||||
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
||||||
@@ -21,8 +19,4 @@ pub enum MixnetQueryCommands {
|
|||||||
Mixnodes(query_all_mixnodes::Args),
|
Mixnodes(query_all_mixnodes::Args),
|
||||||
/// Query gateways
|
/// Query gateways
|
||||||
Gateways(query_all_gateways::Args),
|
Gateways(query_all_gateways::Args),
|
||||||
/// Query announced service-providers
|
|
||||||
ServiceProviders(query_all_service_providers::Args),
|
|
||||||
/// Query registed names
|
|
||||||
Names(query_all_names::Args),
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::context::QueryClientWithNyxd;
|
|
||||||
use crate::utils::show_error;
|
|
||||||
use clap::Parser;
|
|
||||||
use comfy_table::Table;
|
|
||||||
use nym_validator_client::client::NymApiClientExt;
|
|
||||||
use nym_validator_client::nym_api::error::NymAPIError;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
#[clap(value_parser)]
|
|
||||||
#[clap(help = "Optionally, the registered name to display")]
|
|
||||||
pub name: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn query(args: Args, client: &QueryClientWithNyxd) {
|
|
||||||
log::trace!("Querying all registered names");
|
|
||||||
|
|
||||||
match client.nym_api.get_registered_names().await {
|
|
||||||
Ok(res) => {
|
|
||||||
if let Some(name) = args.name {
|
|
||||||
let name = res.names.iter().find(|name_entry| {
|
|
||||||
name_entry.name.name.to_string().eq_ignore_ascii_case(&name)
|
|
||||||
});
|
|
||||||
println!(
|
|
||||||
"{}",
|
|
||||||
::serde_json::to_string_pretty(&name).expect("json formatting error")
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
let mut table = Table::new();
|
|
||||||
|
|
||||||
table.set_header(vec!["Name Id", "Owner", "Nym Address", "Name"]);
|
|
||||||
for name_entry in res.names {
|
|
||||||
table.add_row(vec![
|
|
||||||
name_entry.id.to_string(),
|
|
||||||
name_entry.owner.to_string(),
|
|
||||||
name_entry.name.address.to_string(),
|
|
||||||
name_entry.name.name.to_string(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("The registered names in the directory are:");
|
|
||||||
println!("{table}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(NymAPIError::NotFound) => {
|
|
||||||
println!("nym-api reports no name endpoint available");
|
|
||||||
}
|
|
||||||
Err(e) => show_error(e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::context::QueryClientWithNyxd;
|
|
||||||
use crate::utils::show_error;
|
|
||||||
use clap::Parser;
|
|
||||||
use comfy_table::Table;
|
|
||||||
use nym_validator_client::client::NymApiClientExt;
|
|
||||||
use nym_validator_client::nym_api::error::NymAPIError;
|
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
|
||||||
pub struct Args {
|
|
||||||
#[clap(value_parser)]
|
|
||||||
#[clap(help = "Optionally, the service provider to display")]
|
|
||||||
pub nym_address: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn query(args: Args, client: &QueryClientWithNyxd) {
|
|
||||||
match client.nym_api.get_service_providers().await {
|
|
||||||
Ok(res) => {
|
|
||||||
if let Some(nym_address) = args.nym_address {
|
|
||||||
let service = res.services.iter().find(|service| {
|
|
||||||
service
|
|
||||||
.service
|
|
||||||
.nym_address
|
|
||||||
.to_string()
|
|
||||||
.eq_ignore_ascii_case(&nym_address)
|
|
||||||
});
|
|
||||||
println!(
|
|
||||||
"{}",
|
|
||||||
::serde_json::to_string_pretty(&service).expect("json formatting error")
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
let mut table = Table::new();
|
|
||||||
|
|
||||||
table.set_header(vec!["Service Id", "Announcer", "Type", "Nym Address"]);
|
|
||||||
for service in res.services {
|
|
||||||
table.add_row(vec![
|
|
||||||
service.service_id.to_string(),
|
|
||||||
service.announcer.to_string(),
|
|
||||||
service.service.service_type.to_string(),
|
|
||||||
service.service.nym_address.to_string(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("The service providers in the directory are:");
|
|
||||||
println!("{table}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(NymAPIError::NotFound) => {
|
|
||||||
println!("nym-api reports no service provider endpoint available");
|
|
||||||
}
|
|
||||||
Err(e) => show_error(e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,9 +11,13 @@ repository = { workspace = true }
|
|||||||
bs58 = { workspace = true }
|
bs58 = { workspace = true }
|
||||||
cosmwasm-std = { workspace = true }
|
cosmwasm-std = { workspace = true }
|
||||||
cosmwasm-schema = { workspace = true }
|
cosmwasm-schema = { workspace = true }
|
||||||
|
cw-storage-plus = { workspace = true }
|
||||||
schemars = { workspace = true }
|
schemars = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
vergen = { version = "=8.3.1", features = ["build", "git", "gitcl", "rustc", "cargo"] }
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use vergen::EmitBuilder;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
EmitBuilder::builder()
|
||||||
|
.all_build()
|
||||||
|
.rustc_semver()
|
||||||
|
.git_branch()
|
||||||
|
.git_commit_timestamp()
|
||||||
|
.git_sha(false)
|
||||||
|
.cargo_debug()
|
||||||
|
.cargo_opt_level()
|
||||||
|
.emit()
|
||||||
|
.expect("failed to extract build metadata");
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::ContractBuildInformation;
|
||||||
|
use cosmwasm_std::{StdResult, Storage};
|
||||||
|
use cw_storage_plus::Item;
|
||||||
|
|
||||||
|
pub const CONTRACT_BUILD_INFO_STORAGE_KEY: &str = "contract_build_info";
|
||||||
|
pub const CONTRACT_BUILD_INFO: Item<ContractBuildInformation> =
|
||||||
|
Item::new(CONTRACT_BUILD_INFO_STORAGE_KEY);
|
||||||
|
|
||||||
|
// important note. this MUST BE called inside the contract code itself and not any intermediate crate
|
||||||
|
// otherwise macro expansions will resolve to incorrect data
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! get_build_information {
|
||||||
|
() => {
|
||||||
|
$crate::types::ContractBuildInformation::new(
|
||||||
|
env!("CARGO_PKG_NAME"),
|
||||||
|
env!("CARGO_PKG_VERSION"),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_state_build_information(
|
||||||
|
store: &mut dyn Storage,
|
||||||
|
build_info: ContractBuildInformation,
|
||||||
|
) -> StdResult<()> {
|
||||||
|
CONTRACT_BUILD_INFO.save(store, &build_info)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_contract_build_information(store: &dyn Storage) -> StdResult<ContractBuildInformation> {
|
||||||
|
CONTRACT_BUILD_INFO.load(store)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! set_build_information {
|
||||||
|
( $store:expr ) => {
|
||||||
|
$crate::build_information::set_state_build_information(
|
||||||
|
$store,
|
||||||
|
$crate::get_build_information!(),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use cosmwasm_std::testing::MockStorage;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn get_and_set_work() {
|
||||||
|
let mut store = MockStorage::new();
|
||||||
|
|
||||||
|
// error if not set
|
||||||
|
assert!(get_contract_build_information(&store).is_err());
|
||||||
|
|
||||||
|
// set and get
|
||||||
|
let contract_name = "nym-mixnet-contract";
|
||||||
|
let contract_version = "1.2.3";
|
||||||
|
let build_info = ContractBuildInformation::new(contract_name, contract_version);
|
||||||
|
|
||||||
|
set_state_build_information(&mut store, build_info).unwrap();
|
||||||
|
|
||||||
|
let loaded = get_contract_build_information(&store).unwrap();
|
||||||
|
|
||||||
|
let expected = ContractBuildInformation {
|
||||||
|
contract_name: contract_name.into(),
|
||||||
|
build_version: contract_version.into(),
|
||||||
|
build_timestamp: env!("VERGEN_BUILD_TIMESTAMP").to_string(),
|
||||||
|
commit_sha: option_env!("VERGEN_GIT_SHA")
|
||||||
|
.unwrap_or("UNKNOWN")
|
||||||
|
.to_string(),
|
||||||
|
commit_timestamp: option_env!("VERGEN_GIT_COMMIT_TIMESTAMP")
|
||||||
|
.unwrap_or("UNKNOWN")
|
||||||
|
.to_string(),
|
||||||
|
commit_branch: option_env!("VERGEN_GIT_BRANCH")
|
||||||
|
.unwrap_or("UNKNOWN")
|
||||||
|
.to_string(),
|
||||||
|
rustc_version: env!("VERGEN_RUSTC_SEMVER").to_string(),
|
||||||
|
cargo_debug: env!("VERGEN_CARGO_DEBUG").to_string(),
|
||||||
|
cargo_opt_level: env!("VERGEN_CARGO_OPT_LEVEL").to_string(),
|
||||||
|
};
|
||||||
|
assert_eq!(expected, loaded);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
#![warn(clippy::expect_used)]
|
#![warn(clippy::expect_used)]
|
||||||
#![warn(clippy::unwrap_used)]
|
#![warn(clippy::unwrap_used)]
|
||||||
|
|
||||||
|
pub mod build_information;
|
||||||
pub mod dealings;
|
pub mod dealings;
|
||||||
pub mod events;
|
pub mod events;
|
||||||
pub mod signing;
|
pub mod signing;
|
||||||
|
|||||||
@@ -132,10 +132,18 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn default_unknown() -> String {
|
||||||
|
"unknown".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: there's no reason this couldn't be used for proper binaries, but in that case
|
// TODO: there's no reason this couldn't be used for proper binaries, but in that case
|
||||||
// perhaps the struct should get renamed and moved to a "more" common crate
|
// perhaps the struct should get renamed and moved to a "more" common crate
|
||||||
#[cw_serde]
|
#[cw_serde]
|
||||||
pub struct ContractBuildInformation {
|
pub struct ContractBuildInformation {
|
||||||
|
/// Provides the name of the binary, i.e. the content of `CARGO_PKG_NAME` environmental variable.
|
||||||
|
#[serde(default = "default_unknown")]
|
||||||
|
pub contract_name: String,
|
||||||
|
|
||||||
// VERGEN_BUILD_TIMESTAMP
|
// VERGEN_BUILD_TIMESTAMP
|
||||||
/// Provides the build timestamp, for example `2021-02-23T20:14:46.558472672+00:00`.
|
/// Provides the build timestamp, for example `2021-02-23T20:14:46.558472672+00:00`.
|
||||||
pub build_timestamp: String,
|
pub build_timestamp: String,
|
||||||
@@ -159,6 +167,38 @@ pub struct ContractBuildInformation {
|
|||||||
// VERGEN_RUSTC_SEMVER
|
// VERGEN_RUSTC_SEMVER
|
||||||
/// Provides the rustc version that was used for the build, for example `1.52.0-nightly`.
|
/// Provides the rustc version that was used for the build, for example `1.52.0-nightly`.
|
||||||
pub rustc_version: String,
|
pub rustc_version: String,
|
||||||
|
|
||||||
|
// VERGEN_CARGO_DEBUG
|
||||||
|
/// Provides the cargo debug mode that was used for the build.
|
||||||
|
#[serde(default = "default_unknown")]
|
||||||
|
pub cargo_debug: String,
|
||||||
|
|
||||||
|
// VERGEN_CARGO_OPT_LEVEL
|
||||||
|
/// Provides the opt value set by cargo during the build
|
||||||
|
#[serde(default = "default_unknown")]
|
||||||
|
pub cargo_opt_level: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ContractBuildInformation {
|
||||||
|
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self {
|
||||||
|
ContractBuildInformation {
|
||||||
|
contract_name: name.into(),
|
||||||
|
build_version: version.into(),
|
||||||
|
build_timestamp: env!("VERGEN_BUILD_TIMESTAMP").to_string(),
|
||||||
|
commit_sha: option_env!("VERGEN_GIT_SHA")
|
||||||
|
.unwrap_or("UNKNOWN")
|
||||||
|
.to_string(),
|
||||||
|
commit_timestamp: option_env!("VERGEN_GIT_COMMIT_TIMESTAMP")
|
||||||
|
.unwrap_or("UNKNOWN")
|
||||||
|
.to_string(),
|
||||||
|
commit_branch: option_env!("VERGEN_GIT_BRANCH")
|
||||||
|
.unwrap_or("UNKNOWN")
|
||||||
|
.to_string(),
|
||||||
|
rustc_version: env!("VERGEN_RUSTC_SEMVER").to_string(),
|
||||||
|
cargo_debug: env!("VERGEN_CARGO_DEBUG").to_string(),
|
||||||
|
cargo_opt_level: env!("VERGEN_CARGO_OPT_LEVEL").to_string(),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "nym-ephemera-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
license.workspace = true
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
cosmwasm-schema = { workspace = true }
|
|
||||||
cosmwasm-std = { workspace = true }
|
|
||||||
cw-utils = { workspace = true }
|
|
||||||
|
|
||||||
contracts-common = { path = "../contracts-common", package = "nym-contracts-common" }
|
|
||||||
|
|
||||||
[features]
|
|
||||||
schema = []
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
pub mod msg;
|
|
||||||
pub mod peers;
|
|
||||||
pub mod types;
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use crate::peers::PagedPeerResponse;
|
|
||||||
use crate::types::JsonPeerInfo;
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use cosmwasm_schema::QueryResponses;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct InstantiateMsg {
|
|
||||||
pub group_addr: String,
|
|
||||||
pub mix_denom: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub enum ExecuteMsg {
|
|
||||||
RegisterPeer { peer_info: JsonPeerInfo },
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
#[cfg_attr(feature = "schema", derive(QueryResponses))]
|
|
||||||
pub enum QueryMsg {
|
|
||||||
#[cfg_attr(feature = "schema", returns(PagedPeerResponse))]
|
|
||||||
GetPeers {
|
|
||||||
limit: Option<u32>,
|
|
||||||
start_after: Option<String>,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct MigrateMsg {}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::types::JsonPeerInfo;
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::Addr;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct PagedPeerResponse {
|
|
||||||
pub peers: Vec<JsonPeerInfo>,
|
|
||||||
pub per_page: usize,
|
|
||||||
|
|
||||||
/// Field indicating paging information for the following queries if the caller wishes to get further entries.
|
|
||||||
pub start_next_after: Option<Addr>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PagedPeerResponse {
|
|
||||||
pub fn new(peers: Vec<JsonPeerInfo>, per_page: usize, start_next_after: Option<Addr>) -> Self {
|
|
||||||
PagedPeerResponse {
|
|
||||||
peers,
|
|
||||||
per_page,
|
|
||||||
start_next_after,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::Addr;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct JsonPeerInfo {
|
|
||||||
/// The cosmos address of the peer, used in interacting with the chain.
|
|
||||||
pub cosmos_address: Addr,
|
|
||||||
/// The TCP/IP address of the peer.
|
|
||||||
/// Expected formats:
|
|
||||||
/// 1. `<IP>:<PORT>`
|
|
||||||
/// 2. `/ip4/<IP>/tcp/<PORT>` - this is the format used by libp2p multiaddr
|
|
||||||
pub ip_address: String,
|
|
||||||
///Serialized public key.
|
|
||||||
pub public_key: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl JsonPeerInfo {
|
|
||||||
#[must_use]
|
|
||||||
pub fn new(cosmos_address: Addr, ip_address: String, public_key: String) -> Self {
|
|
||||||
Self {
|
|
||||||
cosmos_address,
|
|
||||||
ip_address,
|
|
||||||
public_key,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -234,12 +234,6 @@ pub enum MixnetContractError {
|
|||||||
#[error("the epoch is currently not in the 'epoch advancement' state. (the state is {current_state})")]
|
#[error("the epoch is currently not in the 'epoch advancement' state. (the state is {current_state})")]
|
||||||
EpochNotInAdvancementState { current_state: EpochState },
|
EpochNotInAdvancementState { current_state: EpochState },
|
||||||
|
|
||||||
#[error("failed to parse {value} into a valid SemVer version: {error_message}")]
|
|
||||||
SemVerFailure {
|
|
||||||
value: String,
|
|
||||||
error_message: String,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("failed to verify message signature: {source}")]
|
#[error("failed to verify message signature: {source}")]
|
||||||
SignatureVerificationFailure {
|
SignatureVerificationFailure {
|
||||||
#[from]
|
#[from]
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "nym-name-service-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
license.workspace = true
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
cosmwasm-schema = { workspace = true }
|
|
||||||
cosmwasm-std = { workspace = true }
|
|
||||||
cw2 = { workspace = true, optional = true }
|
|
||||||
cw-controllers = { workspace = true }
|
|
||||||
cw-utils = { workspace = true }
|
|
||||||
nym-contracts-common = { path = "../contracts-common", version = "0.5.0" }
|
|
||||||
serde = { workspace = true, features = ["derive"] }
|
|
||||||
thiserror = { workspace = true }
|
|
||||||
|
|
||||||
[features]
|
|
||||||
schema = ["cw2"]
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
use cosmwasm_std::{Addr, StdError};
|
|
||||||
use cw_controllers::AdminError;
|
|
||||||
use nym_contracts_common::signing::verifier::ApiVerifierError;
|
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
use crate::{Address, NameId, NymName};
|
|
||||||
|
|
||||||
#[derive(Error, Debug, PartialEq)]
|
|
||||||
pub enum NameServiceError {
|
|
||||||
#[error("{0}")]
|
|
||||||
Std(#[from] StdError),
|
|
||||||
|
|
||||||
#[error("{0}")]
|
|
||||||
AdminError(#[from] AdminError),
|
|
||||||
|
|
||||||
#[error("name id entry not found: {name_id}")]
|
|
||||||
NotFound { name_id: NameId },
|
|
||||||
|
|
||||||
#[error("name entry not found: {name}")]
|
|
||||||
NameNotFound { name: NymName },
|
|
||||||
|
|
||||||
#[error("{sender} is not registrator of name")]
|
|
||||||
Unauthorized { sender: Addr },
|
|
||||||
|
|
||||||
#[error("deposit required to register a name")]
|
|
||||||
DepositRequired { source: cw_utils::PaymentError },
|
|
||||||
|
|
||||||
#[error("insufficiant deposit: {funds}, required: {deposit_required}")]
|
|
||||||
InsufficientDeposit {
|
|
||||||
funds: cosmwasm_std::Uint128,
|
|
||||||
deposit_required: cosmwasm_std::Uint128,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("deposit too large: {funds}, required: {deposit_required}")]
|
|
||||||
TooLargeDeposit {
|
|
||||||
funds: cosmwasm_std::Uint128,
|
|
||||||
deposit_required: cosmwasm_std::Uint128,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("reached the max number of names ({max_names}) for owner {owner}")]
|
|
||||||
ReachedMaxNamesForOwner { max_names: u32, owner: Addr },
|
|
||||||
|
|
||||||
#[error("reached the max number of names ({max_names}) for address {0}", address.to_string())]
|
|
||||||
ReachedMaxNamesForAddress { max_names: u32, address: Address },
|
|
||||||
|
|
||||||
#[error("failed to parse {value} into a valid SemVer version: {error_message}")]
|
|
||||||
SemVerFailure {
|
|
||||||
value: String,
|
|
||||||
error_message: String,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("failed to recover ed25519 public key from its base58 representation: {0}")]
|
|
||||||
MalformedEd25519IdentityKey(String),
|
|
||||||
|
|
||||||
#[error("failed to recover ed25519 signature from its base58 representation: {0}")]
|
|
||||||
MalformedEd25519Signature(String),
|
|
||||||
|
|
||||||
#[error("provided ed25519 signature did not verify correctly")]
|
|
||||||
InvalidEd25519Signature,
|
|
||||||
|
|
||||||
#[error("failed to verify message signature: {source}")]
|
|
||||||
SignatureVerificationFailure {
|
|
||||||
#[from]
|
|
||||||
source: ApiVerifierError,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("duplicate entries detected for name: {name}")]
|
|
||||||
DuplicateNames { name: NymName },
|
|
||||||
|
|
||||||
#[error("name already registered: {name}")]
|
|
||||||
NameAlreadyRegistered { name: NymName },
|
|
||||||
|
|
||||||
#[error("invalid nym address format: {0}")]
|
|
||||||
InvalidNymAddress(String),
|
|
||||||
|
|
||||||
#[error("client identity in nym address does not match the provided identity key")]
|
|
||||||
IdentityKeyMismatch {
|
|
||||||
address: Address,
|
|
||||||
identity_key: String,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type Result<T, E = NameServiceError> = std::result::Result<T, E>;
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
use cosmwasm_std::{Coin, Event};
|
|
||||||
|
|
||||||
use crate::RegisteredName;
|
|
||||||
|
|
||||||
pub enum NameEventType {
|
|
||||||
Register,
|
|
||||||
DeleteId,
|
|
||||||
DeleteName,
|
|
||||||
UpdateDepositRequired,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::fmt::Display for NameEventType {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
match self {
|
|
||||||
NameEventType::Register => write!(f, "register"),
|
|
||||||
NameEventType::DeleteId => write!(f, "delete_id"),
|
|
||||||
NameEventType::DeleteName => write!(f, "delete_name"),
|
|
||||||
NameEventType::UpdateDepositRequired => write!(f, "update_deposit_required"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<NameEventType> for String {
|
|
||||||
fn from(event_type: NameEventType) -> Self {
|
|
||||||
event_type.to_string()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const ACTION: &str = "action";
|
|
||||||
|
|
||||||
pub const NAME_ID: &str = "name_id";
|
|
||||||
pub const NAME: &str = "name";
|
|
||||||
pub const OWNER: &str = "owner";
|
|
||||||
|
|
||||||
pub const DEPOSIT_REQUIRED: &str = "deposit_required";
|
|
||||||
|
|
||||||
pub fn new_register_event(name: RegisteredName) -> Event {
|
|
||||||
Event::new(NameEventType::Register)
|
|
||||||
.add_attribute(ACTION, NameEventType::Register)
|
|
||||||
.add_attribute(NAME_ID, name.id.to_string())
|
|
||||||
.add_attribute(NAME, name.name.name.to_string())
|
|
||||||
.add_attribute(name.name.address.event_tag(), name.name.address.to_string())
|
|
||||||
.add_attribute(OWNER, name.owner.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_delete_id_event(name: RegisteredName) -> Event {
|
|
||||||
Event::new(NameEventType::DeleteId)
|
|
||||||
.add_attribute(ACTION, NameEventType::DeleteId)
|
|
||||||
.add_attribute(NAME_ID, name.id.to_string())
|
|
||||||
.add_attribute(NAME, name.name.name.to_string())
|
|
||||||
.add_attribute(name.name.address.event_tag(), name.name.address.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_delete_name_event(name: RegisteredName) -> Event {
|
|
||||||
Event::new(NameEventType::DeleteId)
|
|
||||||
.add_attribute(ACTION, NameEventType::DeleteName)
|
|
||||||
.add_attribute(NAME_ID, name.id.to_string())
|
|
||||||
.add_attribute(NAME, name.name.name.to_string())
|
|
||||||
.add_attribute(name.name.address.event_tag(), name.name.address.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_update_deposit_required_event(deposit_required: Coin) -> Event {
|
|
||||||
Event::new(NameEventType::UpdateDepositRequired)
|
|
||||||
.add_attribute(ACTION, NameEventType::UpdateDepositRequired)
|
|
||||||
.add_attribute(DEPOSIT_REQUIRED, deposit_required.to_string())
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
pub mod error;
|
|
||||||
pub mod events;
|
|
||||||
pub mod msg;
|
|
||||||
pub mod response;
|
|
||||||
pub mod signing_types;
|
|
||||||
pub mod types;
|
|
||||||
|
|
||||||
// Re-export all types at the top-level
|
|
||||||
pub use types::*;
|
|
||||||
|
|
||||||
pub use cosmwasm_std::{Addr, Coin, Decimal, Fraction};
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::{Address, NameDetails, NameId, NymName};
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::Coin;
|
|
||||||
use nym_contracts_common::signing::MessageSignature;
|
|
||||||
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use crate::{
|
|
||||||
response::{ConfigResponse, NamesListResponse, PagedNamesListResponse},
|
|
||||||
types::RegisteredName,
|
|
||||||
};
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use cosmwasm_schema::QueryResponses;
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use nym_contracts_common::{signing::Nonce, ContractBuildInformation};
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct InstantiateMsg {
|
|
||||||
pub deposit_required: Coin,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl InstantiateMsg {
|
|
||||||
pub fn new(deposit_required: Coin) -> Self {
|
|
||||||
Self { deposit_required }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct MigrateMsg {}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub enum ExecuteMsg {
|
|
||||||
/// Announcing a name pointing to a nym-address
|
|
||||||
Register {
|
|
||||||
name: NameDetails,
|
|
||||||
owner_signature: MessageSignature,
|
|
||||||
},
|
|
||||||
|
|
||||||
/// Delete a name entry by id
|
|
||||||
DeleteId { name_id: NameId },
|
|
||||||
|
|
||||||
/// Delete a name entry by name
|
|
||||||
DeleteName { name: NymName },
|
|
||||||
|
|
||||||
/// Change the deposit required for announcing a name
|
|
||||||
UpdateDepositRequired { deposit_required: Coin },
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ExecuteMsg {
|
|
||||||
pub fn delete_id(name_id: NameId) -> Self {
|
|
||||||
ExecuteMsg::DeleteId { name_id }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn default_memo(&self) -> String {
|
|
||||||
match self {
|
|
||||||
ExecuteMsg::Register {
|
|
||||||
name,
|
|
||||||
owner_signature: _,
|
|
||||||
} => {
|
|
||||||
format!("registering {} as name: {}", name.address, name.name)
|
|
||||||
}
|
|
||||||
ExecuteMsg::DeleteId { name_id } => {
|
|
||||||
format!("deleting name with id {name_id}")
|
|
||||||
}
|
|
||||||
ExecuteMsg::DeleteName { name } => {
|
|
||||||
format!("deleting name: {name}")
|
|
||||||
}
|
|
||||||
ExecuteMsg::UpdateDepositRequired { deposit_required } => {
|
|
||||||
format!("updating the deposit required to {deposit_required}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
#[cfg_attr(feature = "schema", derive(QueryResponses))]
|
|
||||||
pub enum QueryMsg {
|
|
||||||
/// Query the name by it's assigned id
|
|
||||||
#[cfg_attr(feature = "schema", returns(RegisteredName))]
|
|
||||||
NameId { name_id: NameId },
|
|
||||||
|
|
||||||
/// Query the names by the registrator
|
|
||||||
#[cfg_attr(feature = "schema", returns(NamesListResponse))]
|
|
||||||
ByOwner { owner: String },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(RegisteredName))]
|
|
||||||
ByName { name: NymName },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(NamesListResponse))]
|
|
||||||
ByAddress { address: Address },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(PagedNamesListResponse))]
|
|
||||||
All {
|
|
||||||
limit: Option<u32>,
|
|
||||||
start_after: Option<NameId>,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(Nonce))]
|
|
||||||
SigningNonce { address: String },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(ConfigResponse))]
|
|
||||||
Config {},
|
|
||||||
|
|
||||||
/// Gets build information of this contract, such as the commit hash used for the build or rustc version.
|
|
||||||
#[cfg_attr(feature = "schema", returns(ContractBuildInformation))]
|
|
||||||
GetContractVersion {},
|
|
||||||
|
|
||||||
/// Gets the stored contract version information that's required by the CW2 spec interface for migrations.
|
|
||||||
#[serde(rename = "get_cw2_contract_version")]
|
|
||||||
#[cfg_attr(feature = "schema", returns(cw2::ContractVersion))]
|
|
||||||
GetCW2ContractVersion {},
|
|
||||||
}
|
|
||||||
|
|
||||||
impl QueryMsg {
|
|
||||||
pub fn all() -> QueryMsg {
|
|
||||||
QueryMsg::All {
|
|
||||||
limit: None,
|
|
||||||
start_after: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::{NameId, RegisteredName};
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::Coin;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct NamesListResponse {
|
|
||||||
pub names: Vec<RegisteredName>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl NamesListResponse {
|
|
||||||
pub fn new(names: Vec<RegisteredName>) -> NamesListResponse {
|
|
||||||
NamesListResponse { names }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<&[RegisteredName]> for NamesListResponse {
|
|
||||||
fn from(names: &[RegisteredName]) -> Self {
|
|
||||||
NamesListResponse {
|
|
||||||
names: names.to_vec(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct PagedNamesListResponse {
|
|
||||||
pub names: Vec<RegisteredName>,
|
|
||||||
pub per_page: usize,
|
|
||||||
|
|
||||||
/// Field indicating paging information for the following queries if the caller wishes to get further entries.
|
|
||||||
pub start_next_after: Option<NameId>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PagedNamesListResponse {
|
|
||||||
pub fn new(
|
|
||||||
names: Vec<RegisteredName>,
|
|
||||||
per_page: usize,
|
|
||||||
start_next_after: Option<NameId>,
|
|
||||||
) -> PagedNamesListResponse {
|
|
||||||
PagedNamesListResponse {
|
|
||||||
names,
|
|
||||||
per_page,
|
|
||||||
start_next_after,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct ConfigResponse {
|
|
||||||
pub deposit_required: Coin,
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
use cosmwasm_std::{Addr, Coin};
|
|
||||||
use nym_contracts_common::signing::{
|
|
||||||
ContractMessageContent, MessageType, Nonce, SignableMessage, SigningPurpose,
|
|
||||||
};
|
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::NameDetails;
|
|
||||||
|
|
||||||
pub type SignableNameRegisterMsg = SignableMessage<ContractMessageContent<NameRegister>>;
|
|
||||||
|
|
||||||
#[derive(Serialize)]
|
|
||||||
pub struct NameRegister {
|
|
||||||
name: NameDetails,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SigningPurpose for NameRegister {
|
|
||||||
fn message_type() -> MessageType {
|
|
||||||
MessageType::new("name-register")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn construct_name_register_sign_payload(
|
|
||||||
nonce: Nonce,
|
|
||||||
sender: Addr,
|
|
||||||
deposit: Coin,
|
|
||||||
name: NameDetails,
|
|
||||||
) -> SignableNameRegisterMsg {
|
|
||||||
let payload = NameRegister { name };
|
|
||||||
let proxy = None;
|
|
||||||
let content = ContractMessageContent::new(sender, proxy, vec![deposit], payload);
|
|
||||||
SignableMessage::new(nonce, content)
|
|
||||||
}
|
|
||||||
@@ -1,252 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::{Addr, Coin};
|
|
||||||
use nym_contracts_common::IdentityKey;
|
|
||||||
use std::{
|
|
||||||
fmt::{Display, Formatter},
|
|
||||||
str::FromStr,
|
|
||||||
};
|
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
use crate::error::{NameServiceError, Result};
|
|
||||||
|
|
||||||
/// The directory of names are indexed by [`NameId`].
|
|
||||||
pub type NameId = u32;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct RegisteredName {
|
|
||||||
/// Unique id assigned to the registerd name.
|
|
||||||
pub id: NameId,
|
|
||||||
|
|
||||||
/// The registerd name details.
|
|
||||||
pub name: NameDetails,
|
|
||||||
|
|
||||||
/// name owner.
|
|
||||||
pub owner: Addr,
|
|
||||||
|
|
||||||
/// Block height at which the name was added.
|
|
||||||
pub block_height: u64,
|
|
||||||
|
|
||||||
/// The deposit used to announce the name.
|
|
||||||
pub deposit: Coin,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RegisteredName {
|
|
||||||
// Shortcut for getting the actual name
|
|
||||||
pub fn entry(&self) -> &NymName {
|
|
||||||
&self.name.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct NameDetails {
|
|
||||||
/// The name pointing to the nym address
|
|
||||||
pub name: NymName,
|
|
||||||
|
|
||||||
/// The address of the name alias.
|
|
||||||
pub address: Address,
|
|
||||||
|
|
||||||
/// The identity key of the registered name.
|
|
||||||
pub identity_key: IdentityKey,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// String representation of a nym address, which is of the form
|
|
||||||
/// client_id.client_enc@gateway_id.
|
|
||||||
/// NOTE: entirely unvalidated.
|
|
||||||
#[cw_serde]
|
|
||||||
pub enum Address {
|
|
||||||
NymAddress(NymAddressInner),
|
|
||||||
// Possible extension:
|
|
||||||
//Gateway(String)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct NymAddressInner {
|
|
||||||
client_id: String,
|
|
||||||
client_enc: String,
|
|
||||||
gateway_id: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
// ADDRESS . ENCRYPTION @ GATEWAY_ID
|
|
||||||
impl std::fmt::Display for NymAddressInner {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
write!(
|
|
||||||
f,
|
|
||||||
"{}.{}@{}",
|
|
||||||
self.client_id, self.client_enc, self.gateway_id
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Address {
|
|
||||||
/// Create a new nym address.
|
|
||||||
pub fn new(address: &str) -> Result<Self> {
|
|
||||||
parse_nym_address(address)
|
|
||||||
.map(Self::NymAddress)
|
|
||||||
.ok_or_else(|| NameServiceError::InvalidNymAddress(address.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn client_id(&self) -> &str {
|
|
||||||
match self {
|
|
||||||
Address::NymAddress(address) => &address.client_id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn client_enc(&self) -> &str {
|
|
||||||
match self {
|
|
||||||
Address::NymAddress(address) => &address.client_enc,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn gateway_id(&self) -> &str {
|
|
||||||
match self {
|
|
||||||
Address::NymAddress(address) => &address.gateway_id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn event_tag(&self) -> &str {
|
|
||||||
match self {
|
|
||||||
Address::NymAddress(_) => "nym_address",
|
|
||||||
//Address::Gateway(_) => "gatway_address",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Display for Address {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
match self {
|
|
||||||
Address::NymAddress(address) => write!(f, "{}", address),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A valid nym address is of the form client_id.client_enc@gateway_id
|
|
||||||
fn parse_nym_address(address: &str) -> Option<NymAddressInner> {
|
|
||||||
let parts: Vec<&str> = address.split('@').collect();
|
|
||||||
if parts.len() != 2 {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
let client_part = parts[0];
|
|
||||||
let gateway_part = parts[1];
|
|
||||||
|
|
||||||
// The client part consists of two parts separated by a dot
|
|
||||||
let client_parts: Vec<&str> = client_part.split('.').collect();
|
|
||||||
if client_parts.len() != 2 {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check that the gateway part does not contain any dots
|
|
||||||
if gateway_part.contains('.') {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
Some(NymAddressInner {
|
|
||||||
client_id: client_parts[0].to_string(),
|
|
||||||
client_enc: client_parts[1].to_string(),
|
|
||||||
gateway_id: gateway_part.to_string(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Name stored and pointing a to a nym-address
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct NymName(String);
|
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
|
||||||
pub enum NymNameError {
|
|
||||||
#[error("invalid name")]
|
|
||||||
InvalidName,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Defines what names are allowed
|
|
||||||
fn is_valid_name_char(c: char) -> bool {
|
|
||||||
// Normal lowercase letters
|
|
||||||
(c.is_alphabetic() && c.is_lowercase())
|
|
||||||
// or numbers
|
|
||||||
|| c.is_numeric()
|
|
||||||
// special case hyphen or underscore
|
|
||||||
|| c == '-' || c == '_'
|
|
||||||
}
|
|
||||||
|
|
||||||
impl NymName {
|
|
||||||
pub fn new(name: &str) -> Result<NymName, NymNameError> {
|
|
||||||
// We are a bit restrictive in which names we allow, to start out with. Consider relaxing
|
|
||||||
// this in the future.
|
|
||||||
if !name.chars().all(is_valid_name_char) {
|
|
||||||
return Err(NymNameError::InvalidName);
|
|
||||||
}
|
|
||||||
Ok(Self(name.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn as_str(&self) -> &str {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromStr for NymName {
|
|
||||||
type Err = NymNameError;
|
|
||||||
|
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
||||||
Self::new(s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Display for NymName {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
write!(f, "{}", self.0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::NymName;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn parse_nym_name() {
|
|
||||||
// Test some valid cases
|
|
||||||
assert!(NymName::new("foo").is_ok());
|
|
||||||
assert!(NymName::new("foo-bar").is_ok());
|
|
||||||
assert!(NymName::new("foo-bar-123").is_ok());
|
|
||||||
assert!(NymName::new("foo_bar").is_ok());
|
|
||||||
assert!(NymName::new("foo_bar_123").is_ok());
|
|
||||||
|
|
||||||
// And now test all some invalid ones
|
|
||||||
assert!(NymName::new("Foo").is_err());
|
|
||||||
assert!(NymName::new("foo bar").is_err());
|
|
||||||
assert!(NymName::new("foo!bar").is_err());
|
|
||||||
assert!(NymName::new("foo#bar").is_err());
|
|
||||||
assert!(NymName::new("foo$bar").is_err());
|
|
||||||
assert!(NymName::new("foo%bar").is_err());
|
|
||||||
assert!(NymName::new("foo&bar").is_err());
|
|
||||||
assert!(NymName::new("foo'bar").is_err());
|
|
||||||
assert!(NymName::new("foo(bar").is_err());
|
|
||||||
assert!(NymName::new("foo)bar").is_err());
|
|
||||||
assert!(NymName::new("foo*bar").is_err());
|
|
||||||
assert!(NymName::new("foo+bar").is_err());
|
|
||||||
assert!(NymName::new("foo,bar").is_err());
|
|
||||||
assert!(NymName::new("foo.bar").is_err());
|
|
||||||
assert!(NymName::new("foo.bar").is_err());
|
|
||||||
assert!(NymName::new("foo/bar").is_err());
|
|
||||||
assert!(NymName::new("foo/bar").is_err());
|
|
||||||
assert!(NymName::new("foo:bar").is_err());
|
|
||||||
assert!(NymName::new("foo;bar").is_err());
|
|
||||||
assert!(NymName::new("foo<bar").is_err());
|
|
||||||
assert!(NymName::new("foo=bar").is_err());
|
|
||||||
assert!(NymName::new("foo>bar").is_err());
|
|
||||||
assert!(NymName::new("foo?bar").is_err());
|
|
||||||
assert!(NymName::new("foo@bar").is_err());
|
|
||||||
assert!(NymName::new("fooBar").is_err());
|
|
||||||
assert!(NymName::new("foo[bar").is_err());
|
|
||||||
assert!(NymName::new("foo\"bar").is_err());
|
|
||||||
assert!(NymName::new("foo\\bar").is_err());
|
|
||||||
assert!(NymName::new("foo]bar").is_err());
|
|
||||||
assert!(NymName::new("foo^bar").is_err());
|
|
||||||
assert!(NymName::new("foo`bar").is_err());
|
|
||||||
assert!(NymName::new("foo{bar").is_err());
|
|
||||||
assert!(NymName::new("foo|bar").is_err());
|
|
||||||
assert!(NymName::new("foo}bar").is_err());
|
|
||||||
assert!(NymName::new("foo~bar").is_err());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "nym-service-provider-directory-common"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
license.workspace = true
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
cosmwasm-schema = { workspace = true }
|
|
||||||
cosmwasm-std = { workspace = true }
|
|
||||||
cw2 = { workspace = true, optional = true }
|
|
||||||
cw-controllers = { workspace = true }
|
|
||||||
cw-utils = { workspace = true }
|
|
||||||
nym-contracts-common = { path = "../contracts-common", version = "0.5.0" }
|
|
||||||
thiserror = { workspace = true }
|
|
||||||
|
|
||||||
[features]
|
|
||||||
schema = ["cw2"]
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
use cosmwasm_std::{Addr, StdError};
|
|
||||||
use cw_controllers::AdminError;
|
|
||||||
use nym_contracts_common::signing::verifier::ApiVerifierError;
|
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
use crate::{NymAddress, ServiceId};
|
|
||||||
|
|
||||||
#[derive(Error, Debug, PartialEq)]
|
|
||||||
pub enum SpContractError {
|
|
||||||
#[error("{0}")]
|
|
||||||
Std(#[from] StdError),
|
|
||||||
|
|
||||||
#[error("{0}")]
|
|
||||||
AdminError(#[from] AdminError),
|
|
||||||
|
|
||||||
#[error("service not found: {service_id}")]
|
|
||||||
NotFound { service_id: ServiceId },
|
|
||||||
|
|
||||||
#[error("{sender} is not announcer of service")]
|
|
||||||
Unauthorized { sender: Addr },
|
|
||||||
|
|
||||||
#[error("deposit required to announce service")]
|
|
||||||
DepositRequired { source: cw_utils::PaymentError },
|
|
||||||
|
|
||||||
#[error("insufficiant deposit: {funds}, required: {deposit_required}")]
|
|
||||||
InsufficientDeposit {
|
|
||||||
funds: cosmwasm_std::Uint128,
|
|
||||||
deposit_required: cosmwasm_std::Uint128,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("deposit too large: {funds}, required: {deposit_required}")]
|
|
||||||
TooLargeDeposit {
|
|
||||||
funds: cosmwasm_std::Uint128,
|
|
||||||
deposit_required: cosmwasm_std::Uint128,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("reached the max number of providers ({max_providers}) for announcer {announcer}")]
|
|
||||||
ReachedMaxProvidersForAdmin { max_providers: u32, announcer: Addr },
|
|
||||||
|
|
||||||
#[error("reached the max number of aliases ({max_aliases}) for nym address {0}", nym_address.to_string())]
|
|
||||||
ReachedMaxAliasesForNymAddress {
|
|
||||||
max_aliases: u32,
|
|
||||||
nym_address: NymAddress,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("failed to parse {value} into a valid SemVer version: {error_message}")]
|
|
||||||
SemVerFailure {
|
|
||||||
value: String,
|
|
||||||
error_message: String,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[error("Failed to recover ed25519 public key from its base58 representation - {0}")]
|
|
||||||
MalformedEd25519IdentityKey(String),
|
|
||||||
|
|
||||||
#[error("Failed to recover ed25519 signature from its base58 representation - {0}")]
|
|
||||||
MalformedEd25519Signature(String),
|
|
||||||
|
|
||||||
#[error("Provided ed25519 signature did not verify correctly")]
|
|
||||||
InvalidEd25519Signature,
|
|
||||||
|
|
||||||
#[error("failed to verify message signature: {source}")]
|
|
||||||
SignatureVerificationFailure {
|
|
||||||
#[from]
|
|
||||||
source: ApiVerifierError,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type Result<T, E = SpContractError> = std::result::Result<T, E>;
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
use cosmwasm_std::{Coin, Event};
|
|
||||||
|
|
||||||
use crate::{Service, ServiceId};
|
|
||||||
|
|
||||||
pub enum ServiceProviderEventType {
|
|
||||||
Announce,
|
|
||||||
DeleteId,
|
|
||||||
DeleteNymAddress,
|
|
||||||
UpdateDepositRequired,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::fmt::Display for ServiceProviderEventType {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
match self {
|
|
||||||
ServiceProviderEventType::Announce => write!(f, "announce"),
|
|
||||||
ServiceProviderEventType::DeleteId => write!(f, "delete_id"),
|
|
||||||
ServiceProviderEventType::DeleteNymAddress => write!(f, "delete_nym_address"),
|
|
||||||
ServiceProviderEventType::UpdateDepositRequired => write!(f, "update_deposit_required"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<ServiceProviderEventType> for String {
|
|
||||||
fn from(event_type: ServiceProviderEventType) -> Self {
|
|
||||||
event_type.to_string()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const ACTION: &str = "action";
|
|
||||||
|
|
||||||
pub const SERVICE_ID: &str = "service_id";
|
|
||||||
pub const SERVICE_TYPE: &str = "service_type";
|
|
||||||
pub const NYM_ADDRESS: &str = "nym_address";
|
|
||||||
pub const OWNER: &str = "owner";
|
|
||||||
|
|
||||||
pub const DEPOSIT_REQUIRED: &str = "deposit_required";
|
|
||||||
|
|
||||||
pub fn new_announce_event(service_id: ServiceId, service: Service) -> Event {
|
|
||||||
Event::new(ServiceProviderEventType::Announce)
|
|
||||||
.add_attribute(ACTION, ServiceProviderEventType::Announce)
|
|
||||||
.add_attribute(SERVICE_ID, service_id.to_string())
|
|
||||||
.add_attribute(SERVICE_TYPE, service.service.service_type.to_string())
|
|
||||||
.add_attribute(NYM_ADDRESS, service.service.nym_address.to_string())
|
|
||||||
.add_attribute(OWNER, service.announcer.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_delete_id_event(service: Service) -> Event {
|
|
||||||
Event::new(ServiceProviderEventType::DeleteId)
|
|
||||||
.add_attribute(ACTION, ServiceProviderEventType::DeleteId)
|
|
||||||
.add_attribute(SERVICE_ID, service.service_id.to_string())
|
|
||||||
.add_attribute(NYM_ADDRESS, service.service.nym_address.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new_update_deposit_required_event(deposit_required: Coin) -> Event {
|
|
||||||
Event::new(ServiceProviderEventType::UpdateDepositRequired)
|
|
||||||
.add_attribute(ACTION, ServiceProviderEventType::UpdateDepositRequired)
|
|
||||||
.add_attribute(DEPOSIT_REQUIRED, deposit_required.to_string())
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
pub mod error;
|
|
||||||
pub mod events;
|
|
||||||
pub mod msg;
|
|
||||||
pub mod response;
|
|
||||||
pub mod signing_types;
|
|
||||||
pub mod types;
|
|
||||||
|
|
||||||
// Re-export all types at the top-level
|
|
||||||
pub use types::*;
|
|
||||||
|
|
||||||
pub use cosmwasm_std::{Addr, Coin, Decimal, Fraction};
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::{NymAddress, ServiceDetails, ServiceId};
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::Coin;
|
|
||||||
use nym_contracts_common::signing::MessageSignature;
|
|
||||||
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use crate::{
|
|
||||||
response::{ConfigResponse, PagedServicesListResponse, ServicesListResponse},
|
|
||||||
types::Service,
|
|
||||||
};
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use cosmwasm_schema::QueryResponses;
|
|
||||||
#[cfg(feature = "schema")]
|
|
||||||
use nym_contracts_common::{signing::Nonce, ContractBuildInformation};
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct InstantiateMsg {
|
|
||||||
pub deposit_required: Coin,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl InstantiateMsg {
|
|
||||||
pub fn new(deposit_required: Coin) -> Self {
|
|
||||||
Self { deposit_required }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct MigrateMsg {}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub enum ExecuteMsg {
|
|
||||||
Announce {
|
|
||||||
service: ServiceDetails,
|
|
||||||
owner_signature: MessageSignature,
|
|
||||||
},
|
|
||||||
DeleteId {
|
|
||||||
service_id: ServiceId,
|
|
||||||
},
|
|
||||||
DeleteNymAddress {
|
|
||||||
nym_address: NymAddress,
|
|
||||||
},
|
|
||||||
UpdateDepositRequired {
|
|
||||||
deposit_required: Coin,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ExecuteMsg {
|
|
||||||
pub fn delete_id(service_id: ServiceId) -> Self {
|
|
||||||
ExecuteMsg::DeleteId { service_id }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn default_memo(&self) -> String {
|
|
||||||
match self {
|
|
||||||
ExecuteMsg::Announce {
|
|
||||||
service,
|
|
||||||
owner_signature: _,
|
|
||||||
} => format!(
|
|
||||||
"announcing {} as type {}",
|
|
||||||
service.nym_address, service.service_type
|
|
||||||
),
|
|
||||||
ExecuteMsg::DeleteId { service_id } => {
|
|
||||||
format!("deleting service with service id {service_id}")
|
|
||||||
}
|
|
||||||
ExecuteMsg::DeleteNymAddress { nym_address } => {
|
|
||||||
format!("deleting service with nym address {nym_address}")
|
|
||||||
}
|
|
||||||
ExecuteMsg::UpdateDepositRequired { deposit_required } => {
|
|
||||||
format!("updating the deposit required to {deposit_required}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
#[cfg_attr(feature = "schema", derive(QueryResponses))]
|
|
||||||
pub enum QueryMsg {
|
|
||||||
#[cfg_attr(feature = "schema", returns(Service))]
|
|
||||||
ServiceId { service_id: ServiceId },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(ServicesListResponse))]
|
|
||||||
ByAnnouncer { announcer: String },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(ServicesListResponse))]
|
|
||||||
ByNymAddress { nym_address: NymAddress },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(PagedServicesListResponse))]
|
|
||||||
All {
|
|
||||||
limit: Option<u32>,
|
|
||||||
start_after: Option<ServiceId>,
|
|
||||||
},
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(Nonce))]
|
|
||||||
SigningNonce { address: String },
|
|
||||||
|
|
||||||
#[cfg_attr(feature = "schema", returns(ConfigResponse))]
|
|
||||||
Config {},
|
|
||||||
|
|
||||||
/// Gets build information of this contract, such as the commit hash used for the build or rustc version.
|
|
||||||
#[cfg_attr(feature = "schema", returns(ContractBuildInformation))]
|
|
||||||
GetContractVersion {},
|
|
||||||
|
|
||||||
/// Gets the stored contract version information that's required by the CW2 spec interface for migrations.
|
|
||||||
#[serde(rename = "get_cw2_contract_version")]
|
|
||||||
#[cfg_attr(feature = "schema", returns(cw2::ContractVersion))]
|
|
||||||
GetCW2ContractVersion {},
|
|
||||||
}
|
|
||||||
|
|
||||||
impl QueryMsg {
|
|
||||||
pub fn all() -> QueryMsg {
|
|
||||||
QueryMsg::All {
|
|
||||||
limit: None,
|
|
||||||
start_after: None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::{Service, ServiceId};
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::Coin;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct ServiceInfoResponse {
|
|
||||||
pub service_id: ServiceId,
|
|
||||||
pub service: Option<Service>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct ServicesListResponse {
|
|
||||||
pub services: Vec<Service>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ServicesListResponse {
|
|
||||||
pub fn new(services: Vec<Service>) -> ServicesListResponse {
|
|
||||||
ServicesListResponse { services }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<&[Service]> for ServicesListResponse {
|
|
||||||
fn from(services: &[Service]) -> Self {
|
|
||||||
Self {
|
|
||||||
services: services.to_vec(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct PagedServicesListResponse {
|
|
||||||
pub services: Vec<Service>,
|
|
||||||
pub per_page: usize,
|
|
||||||
|
|
||||||
/// Field indicating paging information for the following queries if the caller wishes to get further entries.
|
|
||||||
pub start_next_after: Option<ServiceId>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PagedServicesListResponse {
|
|
||||||
pub fn new(
|
|
||||||
services: Vec<Service>,
|
|
||||||
per_page: usize,
|
|
||||||
start_next_after: Option<ServiceId>,
|
|
||||||
) -> PagedServicesListResponse {
|
|
||||||
PagedServicesListResponse {
|
|
||||||
services,
|
|
||||||
per_page,
|
|
||||||
start_next_after,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct ConfigResponse {
|
|
||||||
pub deposit_required: Coin,
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use crate::ServiceDetails;
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::{Addr, Coin};
|
|
||||||
use nym_contracts_common::signing::{
|
|
||||||
ContractMessageContent, MessageType, Nonce, SignableMessage, SigningPurpose,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub type SignableServiceProviderAnnounceMsg =
|
|
||||||
SignableMessage<ContractMessageContent<ServiceProviderAnnounce>>;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct ServiceProviderAnnounce {
|
|
||||||
service: ServiceDetails,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SigningPurpose for ServiceProviderAnnounce {
|
|
||||||
fn message_type() -> MessageType {
|
|
||||||
MessageType::new("service-provider-announce")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn construct_service_provider_announce_sign_payload(
|
|
||||||
nonce: Nonce,
|
|
||||||
sender: Addr,
|
|
||||||
deposit: Coin,
|
|
||||||
service: ServiceDetails,
|
|
||||||
) -> SignableServiceProviderAnnounceMsg {
|
|
||||||
let payload = ServiceProviderAnnounce { service };
|
|
||||||
let proxy = None;
|
|
||||||
let content = ContractMessageContent::new(sender, proxy, vec![deposit], payload);
|
|
||||||
SignableMessage::new(nonce, content)
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
use cosmwasm_schema::cw_serde;
|
|
||||||
use cosmwasm_std::{Addr, Coin};
|
|
||||||
use nym_contracts_common::IdentityKey;
|
|
||||||
use std::fmt::{Display, Formatter};
|
|
||||||
|
|
||||||
/// The directory of services are indexed by [`ServiceId`].
|
|
||||||
pub type ServiceId = u32;
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct Service {
|
|
||||||
/// Unique id assigned to the anounced service.
|
|
||||||
pub service_id: ServiceId,
|
|
||||||
/// The announced service.
|
|
||||||
pub service: ServiceDetails,
|
|
||||||
/// Address of the service owner.
|
|
||||||
pub announcer: Addr,
|
|
||||||
/// Block height at which the service was added.
|
|
||||||
pub block_height: u64,
|
|
||||||
/// The deposit used to announce the service.
|
|
||||||
pub deposit: Coin,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cw_serde]
|
|
||||||
pub struct ServiceDetails {
|
|
||||||
/// The address of the service.
|
|
||||||
pub nym_address: NymAddress,
|
|
||||||
/// The service type.
|
|
||||||
pub service_type: ServiceType,
|
|
||||||
/// The identity key of the service.
|
|
||||||
pub identity_key: IdentityKey,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The types of addresses supported.
|
|
||||||
#[cw_serde]
|
|
||||||
pub enum NymAddress {
|
|
||||||
/// String representation of a nym address, which is of the form
|
|
||||||
/// client_id.client_enc@gateway_id.
|
|
||||||
Address(String),
|
|
||||||
// String name that can looked up in the nym-name-service contract (once it exists)
|
|
||||||
//Name(String),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl NymAddress {
|
|
||||||
/// Create a new nym address.
|
|
||||||
pub fn new(address: &str) -> Self {
|
|
||||||
Self::Address(address.to_string())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn as_str(&self) -> &str {
|
|
||||||
match self {
|
|
||||||
NymAddress::Address(address) => address,
|
|
||||||
//NymAddress::Name(name) => name,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Display for NymAddress {
|
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
||||||
write!(f, "{}", self.as_str())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The type of services provider supported
|
|
||||||
#[cw_serde]
|
|
||||||
pub enum ServiceType {
|
|
||||||
NetworkRequester,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::fmt::Display for ServiceType {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
let service_type = match self {
|
|
||||||
ServiceType::NetworkRequester => "network_requester",
|
|
||||||
};
|
|
||||||
write!(f, "{service_type}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user