Compare commits

..

3 Commits

Author SHA1 Message Date
Tommy Verrall abce3421c5 Update upload-nyxd-ci.yml 2023-06-30 10:02:47 +02:00
Tommy Verrall cb24065aca Update upload-nyxd-ci.yml 2023-06-29 16:47:03 +02:00
Tommy Verrall 1eb8862272 Update upload-nyxd-ci.yml 2023-06-27 15:12:55 +02:00
550 changed files with 5769 additions and 16202 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
name: 'Documentation' name: 'Documentation'
about: Suggest a fix or enhancement to the documentation or developer portal content about: Suggest a fix or enhancement to the documentation or developer portal content
title: "[DOCS]" title: "[DOCS]"
labels: documentation, needs-triage labels: documentation
assignees: mfahampshire assignees: mfahampshire
--- ---
+1 -1
View File
@@ -2,7 +2,7 @@
name: Feature request name: Feature request
about: Suggest an enhancement to the product about: Suggest an enhancement to the product
title: "[Feature Request]" title: "[Feature Request]"
labels: enhancement, needs-triage labels: enhancement
assignees: '' assignees: ''
--- ---
+1 -1
View File
@@ -2,7 +2,7 @@
name: Report name: Report
about: To help identify and reproduce issues about: To help identify and reproduce issues
title: "[Issue]" title: "[Issue]"
labels: bug, bug-needs-triage, qa, needs-triage labels: bug, bug-needs-triage, qa
assignees: tommyv1987 assignees: tommyv1987
--- ---
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
- name: install npm - name: install npm
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Matrix - Node Install - name: Matrix - Node Install
run: npm install run: npm install
working-directory: .github/workflows/support-files working-directory: .github/workflows/support-files
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Setup yarn - name: Setup yarn
run: npm install -g yarn run: npm install -g yarn
- name: Build - name: Build
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: "16"
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: "16"
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: "16"
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: "16"
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
+2 -13
View File
@@ -20,22 +20,11 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Yarn - name: Install Yarn
run: npm install -g yarn run: npm install -g yarn
- name: Install Rust stable - run: yarn
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 continue-on-error: true
- name: Set environment from the example - name: Set environment from the example
run: cp .env.sample .env run: cp .env.sample .env
- run: yarn storybook:build - run: yarn storybook:build
@@ -0,0 +1,24 @@
name: Linting for Network Explorer (eslint/prettier)
on:
pull_request:
paths:
- 'explorer/**'
defaults:
run:
working-directory: explorer
jobs:
build:
runs-on: custom-runner-linux
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup yarn
run: npm install -g yarn
- name: Run ESLint
# GitHub should automatically annotate the PR
run: yarn && yarn lint
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Setup yarn - name: Setup yarn
run: npm install -g yarn run: npm install -g yarn
continue-on-error: true continue-on-error: true
+1 -1
View File
@@ -152,7 +152,7 @@ jobs:
uses: actions/setup-node@v3 uses: actions/setup-node@v3
if: env.WORKFLOW_CONCLUSION == 'failure' if: env.WORKFLOW_CONCLUSION == 'failure'
with: with:
node-version: 18 node-version: 16
- name: Matrix - Node Install - name: Matrix - Node Install
if: env.WORKFLOW_CONCLUSION == 'failure' if: env.WORKFLOW_CONCLUSION == 'failure'
run: npm install run: npm install
+1 -1
View File
@@ -167,7 +167,7 @@ jobs:
uses: actions/setup-node@v3 uses: actions/setup-node@v3
if: env.WORKFLOW_CONCLUSION == 'failure' if: env.WORKFLOW_CONCLUSION == 'failure'
with: with:
node-version: 18 node-version: 16
- name: Matrix - Node Install - name: Matrix - Node Install
if: env.WORKFLOW_CONCLUSION == 'failure' if: env.WORKFLOW_CONCLUSION == 'failure'
run: npm install run: npm install
+1 -1
View File
@@ -167,7 +167,7 @@ jobs:
uses: actions/setup-node@v3 uses: actions/setup-node@v3
if: env.WORKFLOW_CONCLUSION == 'failure' if: env.WORKFLOW_CONCLUSION == 'failure'
with: with:
node-version: 18 node-version: 16
- name: Matrix - Node Install - name: Matrix - Node Install
if: env.WORKFLOW_CONCLUSION == 'failure' if: env.WORKFLOW_CONCLUSION == 'failure'
run: npm install run: npm install
@@ -15,36 +15,19 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [macos-latest] platform: [macos-latest]
runs-on: ${{ matrix.platform }} 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable 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 - name: Install the Apple developer certificate for code signing
env: env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
@@ -68,15 +51,11 @@ jobs:
security list-keychain -d user -s $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH
- name: Create env file - name: Create env file
uses: timheuer/base64-to-file@v1.2 uses: timheuer/base64-to-file@v1.1
with: with:
fileName: '.env' fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }} encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000
- name: Install app dependencies and build it - name: Install app dependencies and build it
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -88,15 +67,13 @@ jobs:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} 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 run: yarn && yarn build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: nym-connect_1.0.0_x64.dmg name: nym-connect_1.0.0_x64.dmg
path: nym-connect/desktop/target/release/bundle/dmg/nym-connect_1*_x64.dmg path: nym-connect/desktop/target/release/bundle/dmg/nym-connect_1.0.0_x64.dmg
retention-days: 30 retention-days: 30
- name: Clean up keychain - name: Clean up keychain
@@ -104,39 +81,10 @@ jobs:
run: | run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
- id: create-release - name: Upload to release based on tag name
name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release' if: github.event_name == 'release'
with: with:
files: | files: |
nym-connect/desktop/target/release/bundle/dmg/*.dmg nym-connect/desktop/target/release/bundle/dmg/*.dmg
nym-connect/desktop/target/release/bundle/macos/*.app.tar.gz* nym-connect/desktop/target/release/bundle/macos/*.app.tar.gz*
- id: release-info
name: Prepare release info
run: |
ref=${{ github.ref_name }}
semver="${ref##nym-connect-}" && semver="${semver##v}"
echo "version=${semver}" >> "$GITHUB_OUTPUT"
echo "filename=nym-connect_${version}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
echo "file_hash=${{ hashFiles('nym-connect/desktop/target/release/bundle/dmg/nym-connect_*_x64.dmg') }}" >> "$GITHUB_OUTPUT"
push-release-data:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-tauri
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-tauri.outputs.release_id }}
release_date: ${{ needs.publish-tauri.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/nym-connect/desktop/CHANGELOG.md
archive_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-connect.app.tar.gz
sig_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-connect.app.tar.gz.sig
version: ${{ needs.publish-tauri.outputs.version }}
filename: ${{ needs.publish-tauri.outputs.filename }}
file_hash: ${{ needs.publish-tauri.outputs.file_hash }}
name: NymConnect
category: connect
platform: MacOS
secrets: inherit
@@ -15,15 +15,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [custom-runner-linux] platform: [custom-runner-linux]
runs-on: ${{ matrix.platform }} 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -33,25 +26,19 @@ jobs:
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
continue-on-error: true continue-on-error: true
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000
- name: Install app dependencies - name: Install app dependencies
run: yarn run: yarn
- name: Create env file - name: Create env file
uses: timheuer/base64-to-file@v1.2 uses: timheuer/base64-to-file@v1.1
with: with:
fileName: '.env' fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }} encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
@@ -61,48 +48,18 @@ jobs:
env: env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
SENTRY_DSN_RUST: ${{ secrets.SENTRY_DSN_RUST }}
SENTRY_DSN_JS: ${{ secrets.SENTRY_DSN_JS }}
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: nym-connect.AppImage.tar.gz name: nym-connect.AppImage.tar.gz
path: nym-connect/desktop/target/release/bundle/appimage/nym-connect_1*_amd64.AppImage path: nym-connect/desktop/target/release/bundle/appimage/nym-connect_1.0.0_amd64.AppImage
retention-days: 30 retention-days: 30
- id: create-release - name: Upload to release based on tag name
name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release' if: github.event_name == 'release'
with: with:
files: | files: |
nym-connect/desktop/target/release/bundle/appimage/*.AppImage nym-connect/desktop/target/release/bundle/appimage/*.AppImage
nym-connect/desktop/target/release/bundle/appimage/*.AppImage.tar.gz* nym-connect/desktop/target/release/bundle/appimage/*.AppImage.tar.gz*
- id: release-info
name: Prepare release info
run: |
ref=${{ github.ref_name }}
semver="${ref##nym-connect-}" && semver="${semver##v}"
echo "version=${semver}" >> "$GITHUB_OUTPUT"
echo "filename=nym-connect_${version}_amd64.AppImage" >> "$GITHUB_OUTPUT"
echo "file_hash=${{ hashFiles('nym-connect/desktop/target/release/bundle/appimage/nym-connect_*_amd64.AppImage') }}" >> "$GITHUB_OUTPUT"
push-release-data:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-tauri
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-tauri.outputs.release_id }}
release_date: ${{ needs.publish-tauri.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/nym-connect/desktop/CHANGELOG.md
archive_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-connect_${{ needs.publish-tauri.outputs.version }}_amd64.AppImage.tar.gz
sig_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-connect_${{ needs.publish-tauri.outputs.version }}_amd64.AppImage.tar.gz.sig
version: ${{ needs.publish-tauri.outputs.version }}
filename: ${{ needs.publish-tauri.outputs.filename }}
file_hash: ${{ needs.publish-tauri.outputs.file_hash }}
name: NymConnect
category: connect
platform: Ubuntu
secrets: inherit
@@ -15,15 +15,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [windows10] platform: [windows10]
runs-on: ${{ matrix.platform }} 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: steps:
- name: Clean up first - name: Clean up first
continue-on-error: true continue-on-error: true
@@ -46,10 +39,10 @@ jobs:
Remove-Item -path certificate -include tempCert.txt 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) Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@@ -57,21 +50,15 @@ jobs:
toolchain: stable toolchain: stable
- name: Create env file - name: Create env file
uses: timheuer/base64-to-file@v1.2 uses: timheuer/base64-to-file@v1.1
with: with:
fileName: '.env' fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }} encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000
- name: Install app dependencies - name: Install app dependencies
shell: bash
run: yarn --network-timeout 100000 run: yarn --network-timeout 100000
- name: Build and sign it - name: Build and sign it
shell: bash
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }} ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }}
@@ -79,51 +66,19 @@ jobs:
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }} WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
SENTRY_DSN_RUST: ${{ secrets.SENTRY_DSN_RUST }}
SENTRY_DSN_JS: ${{ secrets.SENTRY_DSN_JS }}
run: yarn build run: yarn build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: nym-connect_1.0.0_x64_en-US.msi 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 path: nym-connect/desktop/target/release/bundle/msi/nym-connect_1.0.0_x64_en-US.msi
retention-days: 30 retention-days: 30
- id: create-release - name: Upload to release based on tag name
name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release' if: github.event_name == 'release'
with: with:
files: | files: |
nym-connect/desktop/target/release/bundle/msi/*.msi nym-connect/desktop/target/release/bundle/msi/*.msi
nym-connect/desktop/target/release/bundle/msi/*.msi.zip* nym-connect/desktop/target/release/bundle/msi/*.msi.zip*
- id: release-info
name: Prepare release info
shell: bash
run: |
ref=${{ github.ref_name }}
semver="${ref##nym-connect-}" && semver="${semver##v}"
echo "version=${semver}" >> "$GITHUB_OUTPUT"
echo "filename=nym-connect_${version}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
echo "file_hash=${{ hashFiles('nym-connect/desktop/target/release/bundle/msi/nym-connect_*_x64_en-US.msi') }}" >> "$GITHUB_OUTPUT"
push-release-data:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-connect-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-tauri
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-tauri.outputs.release_id }}
release_date: ${{ needs.publish-tauri.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/nym-connect/desktop/CHANGELOG.md
archive_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-connect_${{ needs.publish-tauri.outputs.version }}_x64_en-US.msi.zip
sig_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-connect_${{ needs.publish-tauri.outputs.version }}_x64_en-US.msi.zip.sig
version: ${{ needs.publish-tauri.outputs.version }}
filename: ${{ needs.publish-tauri.outputs.filename }}
file_hash: ${{ needs.publish-tauri.outputs.file_hash }}
name: NymConnect
category: connect
platform: Windows
secrets: inherit
+8 -174
View File
@@ -2,17 +2,17 @@ name: Publish Nym binaries
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
add_tokio_unstable: add_tokio_unstable:
description: 'True to add RUSTFLAGS="--cfg tokio_unstable"' description: 'True to add RUSTFLAGS="--cfg tokio_unstable"'
required: true required: true
default: false default: false
type: boolean type: boolean
release: release:
types: [created] types: [created]
env: env:
NETWORK: mainnet NETWORK: mainnet
jobs: jobs:
publish-nym: publish-nym:
@@ -21,33 +21,15 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [custom-runner-linux] platform: [custom-runner-linux]
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
outputs:
release_id: ${{ steps.create-release.outputs.id }}
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
client_hash: ${{ steps.binary-hashes.outputs.client_hash }}
mixnode_hash: ${{ steps.binary-hashes.outputs.mixnode_hash }}
gateway_hash: ${{ steps.binary-hashes.outputs.gateway_hash }}
socks5_hash: ${{ steps.binary-hashes.outputs.socks5_hash }}
netreq_hash: ${{ steps.binary-hashes.outputs.netreq_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 }}
mixnode_version: ${{ steps.binary-versions.outputs.mixnode_version }}
gateway_version: ${{ steps.binary-versions.outputs.gateway_version }}
socks5_version: ${{ steps.binary-versions.outputs.socks5_version }}
netreq_version: ${{ steps.binary-versions.outputs.netreq_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
- name: Install Dependencies (Linux) - name: Install Dependencies (Linux)
run: sudo apt-get update && sudo apt-get -y install ripgrep libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools
continue-on-error: true continue-on-error: true
- name: Sets env vars for tokio if set in manual dispatch inputs - name: Sets env vars for tokio if set in manual dispatch inputs
run: | run: |
echo 'RUSTFLAGS="--cfg tokio_unstable"' >> $GITHUB_ENV echo 'RUSTFLAGS="--cfg tokio_unstable"' >> $GITHUB_ENV
@@ -80,8 +62,7 @@ jobs:
target/release/nym-cli target/release/nym-cli
retention-days: 30 retention-days: 30
- id: create-release - name: Upload to release based on tag name
name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release' if: github.event_name == 'release'
with: with:
@@ -95,150 +76,3 @@ jobs:
target/release/nym-network-requester target/release/nym-network-requester
target/release/nym-network-statistics target/release/nym-network-statistics
target/release/nym-cli target/release/nym-cli
- id: release-info
name: Prepare release info
run: |
semver="${${{ github.ref_name }}##nym-binaries-}" && semver="${semver##v}"
echo "version=$semver" >> "$GITHUB_OUTPUT"
- id: binary-hashes
name: Generate binary hashes
run: |
echo "client_hash=${{ hashFiles('target/release/nym-client') }}" >> "$GITHUB_OUTPUT"
echo "mixnode_hash=${{ hashFiles('target/release/nym-mixnode') }}" >> "$GITHUB_OUTPUT"
echo "gateway_hash=${{ hashFiles('target/release/nym-gateway') }}" >> "$GITHUB_OUTPUT"
echo "socks5_hash=${{ hashFiles('target/release/nym-socks5-client') }}" >> "$GITHUB_OUTPUT"
echo "netreq_hash=${{ hashFiles('target/release/nym-network-requester') }}" >> "$GITHUB_OUTPUT"
echo "cli_hash=${{ hashFiles('target/release/nym-cli') }}" >> "$GITHUB_OUTPUT"
echo "netstat_hash=${{ hashFiles('target/release/nym-network-statistics') }}" >> "$GITHUB_OUTPUT"
- id: binary-versions
name: Get binary versions
run: |
v=$(rg '^version = "(.*)"' -or '$1' clients/native/Cargo.toml) && echo "client_version=$v" >> "$GITHUB_OUTPUT"
v=$(rg '^version = "(.*)"' -or '$1' mixnode/Cargo.toml) && echo "mixnode_version=$v" >> "$GITHUB_OUTPUT"
v=$(rg '^version = "(.*)"' -or '$1' gateway/Cargo.toml) && echo "gateway_version=$v" >> "$GITHUB_OUTPUT"
v=$(rg '^version = "(.*)"' -or '$1' clients/socks5/Cargo.toml) && echo "socks5_version=$v" >> "$GITHUB_OUTPUT"
v=$(rg '^version = "(.*)"' -or '$1' service-providers/network-requester/Cargo.toml) && echo "netreq_version=$v" >> "$GITHUB_OUTPUT"
v=$(rg '^version = "(.*)"' -or '$1' tools/nym-cli/Cargo.toml) && echo "cli_version=$v" >> "$GITHUB_OUTPUT"
v=$(rg '^version = "(.*)"' -or '$1' service-providers/network-statistics/Cargo.toml) && echo "netstat_version=$v" >> "$GITHUB_OUTPUT"
push-release-data-client:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.client_version }}
filename: nym-client
file_hash: ${{ needs.publish-nym.outputs.client_hash }}
name: Client
category: binaries
secrets: inherit
push-release-data-mixnode:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.mixnode_version }}
filename: nym-mixnode
file_hash: ${{ needs.publish-nym.outputs.mixnode_hash }}
name: Mixnode
category: binaries
secrets: inherit
push-release-data-gateway:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.gateway_version }}
filename: nym-gateway
file_hash: ${{ needs.publish-nym.outputs.gateway_hash }}
name: Gateway
category: binaries
secrets: inherit
push-release-data-socks5:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.socks5_version }}
filename: nym-socks5-client
file_hash: ${{ needs.publish-nym.outputs.socks5_hash }}
name: Socks5 Client
category: binaries
secrets: inherit
push-release-data-network-requester:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.netreq_version }}
filename: nym-network-requester
file_hash: ${{ needs.publish-nym.outputs.netreq_hash }}
name: Network Requester
category: binaries
secrets: inherit
push-release-data-cli:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.cli_version }}
filename: nym-cli
file_hash: ${{ needs.publish-nym.outputs.cli_hash }}
name: Cli
category: binaries
secrets: inherit
push-release-data-network-stat:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-binaries-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-nym
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-nym.outputs.release_id }}
release_date: ${{ needs.publish-nym.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/CHANGELOG.md
version: ${{ needs.publish-nym.outputs.netstat_version }}
filename: nym-network-statistics
file_hash: ${{ needs.publish-nym.outputs.netstat_hash }}
name: Network Statistics
category: binaries
secrets: inherit
+6 -46
View File
@@ -15,22 +15,15 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [macos-latest] platform: [macos-latest]
runs-on: ${{ matrix.platform }} 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
@@ -58,15 +51,11 @@ jobs:
security list-keychain -d user -s $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH
- name: Create env file - name: Create env file
uses: timheuer/base64-to-file@v1.2 uses: timheuer/base64-to-file@v1.1
with: with:
fileName: '.env' fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }} encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000
- name: Install app dependencies and build it - name: Install app dependencies and build it
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -91,40 +80,11 @@ jobs:
if: ${{ always() }} if: ${{ always() }}
run: | run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
- id: create-release
name: Upload to release based on tag name - name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release' if: github.event_name == 'release'
with: with:
files: | files: |
nym-wallet/target/release/bundle/dmg/*.dmg nym-wallet/target/release/bundle/dmg/*.dmg
nym-wallet/target/release/bundle/macos/*.app.tar.gz* nym-wallet/target/release/bundle/macos/*.app.tar.gz*
- id: release-info
name: Prepare release info
run: |
ref=${{ github.ref_name }}
semver="${ref##nym-wallet-}" && semver="${semver##v}"
echo "version=${semver}" >> "$GITHUB_OUTPUT"
echo "filename=nym-wallet_${version}_x64.dmg" >> "$GITHUB_OUTPUT"
echo "file_hash=${{ hashFiles('nym-wallet/target/release/bundle/dmg/nym-wallet_*_x64.dmg') }}" >> "$GITHUB_OUTPUT"
push-release-data:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-tauri
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-tauri.outputs.release_id }}
release_date: ${{ needs.publish-tauri.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/nym-wallet/CHANGELOG.md
archive_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-wallet.app.tar.gz
sig_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-wallet.app.tar.gz.sig
version: ${{ needs.publish-tauri.outputs.version }}
filename: ${{ needs.publish-tauri.outputs.filename }}
file_hash: ${{ needs.publish-tauri.outputs.file_hash }}
name: Wallet
category: wallet
platform: MacOS
secrets: inherit
@@ -1,6 +1,5 @@
name: Publish Nym Wallet (Ubuntu) name: Publish Nym Wallet (Ubuntu)
on: on:
workflow_dispatch:
release: release:
types: [created] types: [created]
@@ -15,15 +14,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [custom-runner-linux] platform: [custom-runner-linux]
runs-on: ${{ matrix.platform }} 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -33,24 +25,19 @@ jobs:
sudo apt-get install -y webkit2gtk-4.0 sudo apt-get install -y webkit2gtk-4.0
continue-on-error: true continue-on-error: true
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000
- name: Install app dependencies - name: Install app dependencies
run: yarn run: yarn
- name: Create env file - name: Create env file
uses: timheuer/base64-to-file@v1.2 uses: timheuer/base64-to-file@v1.1
with: with:
fileName: '.env' fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }} encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
@@ -60,48 +47,9 @@ jobs:
env: env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- name: Upload to release based on tag name
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nym-wallet_1.0.0_amd64.AppImage.tar.gz
path: nym-wallet/target/release/bundle/appimage/nym-wallet*.AppImage.tar.gz
retention-days: 30
- id: create-release
name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with: with:
files: | files: |
nym-wallet/target/release/bundle/appimage/*.AppImage nym-wallet/target/release/bundle/appimage/*.AppImage
nym-wallet/target/release/bundle/appimage/*.AppImage.tar.gz* nym-wallet/target/release/bundle/appimage/*.AppImage.tar.gz*
- id: release-info
name: Prepare release info
run: |
ref=${{ github.ref_name }}
semver="${ref##nym-wallet-}" && semver="${semver##v}"
echo "version=${semver}" >> "$GITHUB_OUTPUT"
echo "filename=nym-wallet_${version}_amd64.AppImage" >> "$GITHUB_OUTPUT"
echo "file_hash=${{ hashFiles('nym-wallet/target/release/bundle/appimage/nym-wallet_*_amd64.AppImage') }}" >> "$GITHUB_OUTPUT"
push-release-data:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-tauri
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-tauri.outputs.release_id }}
release_date: ${{ needs.publish-tauri.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/nym-wallet/CHANGELOG.md
archive_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-wallet_${{ needs.publish-tauri.outputs.version }}_amd64.AppImage.tar.gz
sig_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-wallet_${{ needs.publish-tauri.outputs.version }}_amd64.AppImage.tar.gz.sig
version: ${{ needs.publish-tauri.outputs.version }}
filename: ${{ needs.publish-tauri.outputs.filename }}
file_hash: ${{ needs.publish-tauri.outputs.file_hash }}
name: Wallet
category: wallet
platform: Ubuntu
secrets: inherit
@@ -15,15 +15,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [windows10] platform: [windows10]
runs-on: ${{ matrix.platform }} 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: steps:
- name: Clean up first - name: Clean up first
continue-on-error: true continue-on-error: true
@@ -46,10 +39,10 @@ jobs:
Remove-Item -path certificate -include tempCert.txt 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) Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Install Rust stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@@ -57,21 +50,15 @@ jobs:
toolchain: stable toolchain: stable
- name: Create env file - name: Create env file
uses: timheuer/base64-to-file@v1.2 uses: timheuer/base64-to-file@v1.1
with: with:
fileName: '.env' fileName: '.env'
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }} encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
- name: Install project dependencies
shell: bash
run: cd .. && yarn --network-timeout 100000
- name: Install app dependencies - name: Install app dependencies
shell: bash
run: yarn --network-timeout 100000 run: yarn --network-timeout 100000
- name: Build and sign it - name: Build and sign it
shell: bash
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }} ENABLE_CODE_SIGNING: ${{ secrets.WINDOWS_CERTIFICATE }}
@@ -88,40 +75,10 @@ jobs:
path: nym-wallet/target/release/bundle/msi/nym-wallet_1.*.msi path: nym-wallet/target/release/bundle/msi/nym-wallet_1.*.msi
retention-days: 30 retention-days: 30
- id: create-release - name: Upload to release based on tag name
name: Upload to release based on tag name
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event_name == 'release' if: github.event_name == 'release'
with: with:
files: | files: |
nym-wallet/target/release/bundle/msi/*.msi nym-wallet/target/release/bundle/msi/*.msi
nym-wallet/target/release/bundle/msi/*.msi.zip* nym-wallet/target/release/bundle/msi/*.msi.zip*
- id: release-info
name: Prepare release info
run: |
ref=${{ github.ref_name }}
semver="${ref##nym-wallet-}" && semver="${semver##v}"
echo "version=${semver}" >> "$GITHUB_OUTPUT"
echo "filename=nym-wallet_${version}_x64_en-US.msi" >> "$GITHUB_OUTPUT"
echo "file_hash=${{ hashFiles('nym-wallet/target/release/bundle/msi/nym-wallet_*_x64_en-US.msi') }}" >> "$GITHUB_OUTPUT"
push-release-data:
if: ${{ (startsWith(github.ref, 'refs/tags/nym-wallet-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/push-release-data.yml
needs: publish-tauri
with:
release_tag: ${{ github.ref_name }}
release_id: ${{ needs.publish-tauri.outputs.release_id }}
release_date: ${{ needs.publish-tauri.outputs.release_date }}
download_base_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}
changelog_url: https://github.com/nymtech/nym/blob/${{ github.ref_name }}/nym-wallet/CHANGELOG.md
archive_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-wallet_${{ needs.publish-tauri.outputs.version }}_x64_en-US.msi.zip
sig_url: https://github.com/nymtech/nym/releases/download/${{ github.ref_name }}/nym-wallet_${{ needs.publish-tauri.outputs.version }}_x64_en-US.msi.zip.sig
version: ${{ needs.publish-tauri.outputs.version }}
filename: ${{ needs.publish-tauri.outputs.filename }}
file_hash: ${{ needs.publish-tauri.outputs.file_hash }}
name: Wallet
category: wallet
platform: Windows
secrets: inherit
+1 -7
View File
@@ -16,15 +16,9 @@ jobs:
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Setup yarn - name: Setup yarn
run: npm install -g 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: Build dependencies - name: Build dependencies
run: yarn && yarn build run: yarn && yarn build
- name: Build storybook - name: Build storybook
+2 -2
View File
@@ -34,10 +34,10 @@ jobs:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
- name: Node - name: Node v16
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install yarn for building application - name: Install yarn for building application
run: yarn install run: yarn install
-212
View File
@@ -1,212 +0,0 @@
name: Push release data
env:
strapi_download_url: 'https://strapi.feat-nym-update-nym-web.websites.dev.nymte.ch/api/downloaders'
strapi_updater_url: 'https://strapi.feat-nym-update-nym-web.websites.dev.nymte.ch/api/updaters'
on:
workflow_call:
inputs:
release_tag:
required: true
description: Release tag
type: string
release_id:
required: true
description: Release ID
type: string
release_date:
required: true
description: Release date
type: string
download_base_url:
required: true
description: Download base URL
type: string
changelog_url:
required: true
description: Changelog URL
type: string
archive_url:
required: false
description: Binary archive URL
type: string
sig_url:
required: false
description: Archive signature URL
type: string
version:
required: true
description: Release version (semver)
type: string
filename:
required: true
description: Binary file name
type: string
file_hash:
required: true
description: Binary hash (sha256)
type: string
name:
required: true
description: Name
type: string
category:
required: true
description: Category
type: string
platform:
required: false
description: Platform
type: string
workflow_dispatch:
inputs:
# ⚠ since inputs are limited to 10 max for workflow_dispatch
# some properties were omitted
version:
required: true
description: Release version (semver)
type: string
default: '1.0.0'
release_id:
required: true
description: Release ID
type: string
default: '1234'
release_date:
required: true
description: Release date
type: string
default: '2023-06-26T10:09:16Z'
download_base_url:
required: true
description: Download base URL
type: string
default: 'https://github.com/nymtech/nym/releases/download/nym-wallet-v1.0.0'
changelog_url:
required: true
description: Changelog URL
type: string
default: 'https://github.com/nymtech/nym/blob/nym-wallet-v1.0.0/nym-wallet/CHANGELOG.md'
filename:
required: true
description: Binary file name
type: string
default: 'nym-wallet_1.0.0_amd64.AppImage'
file_hash:
required: true
description: Binary hash (sha256)
type: string
default: 'xxx'
name:
required: true
description: Name
type: string
default: 'Wallet'
category:
required: true
description: Category
default: 'wallet'
type: choice
options:
- wallet
- connect
- binaries
platform:
required: false
description: Platform
default: 'Ubuntu'
type: choice
options:
- Ubuntu
- Windows
- MacOS
jobs:
push-download-data:
name: Push download data to Strapi
runs-on: custom-runner-linux
steps:
- name: Release info
run: |
echo "version: ${{ inputs.version }}"
echo "tag: ${{ inputs.release_tag }}"
- id: get_sig
name: Get sig
if: ${{ inputs.sig_url != null }}
run: |
output=$(curl -LsSf ${{ inputs.sig_url }})
echo "sig=$output" >> "$GITHUB_OUTPUT"
- id: strapi-request
name: Strapi request
uses: fjogeleit/http-request-action@v1
with:
url: ${{ env.strapi_download_url }}
method: 'POST'
bearerToken: ${{ secrets.STRAPI_API_TOKEN_RELEASES }}
customHeaders: '{"Content-Type": "application/json"}'
data: |
{
"data": {
"releaseId": "${{ inputs.release_id }}",
"releaseDate": "${{ inputs.release_date }}",
"downloadBaseUrl": "${{ inputs.download_base_url }}",
"changelogUrl": "${{ inputs.changelog_url }}",
"version": "${{ inputs.version }}",
"filename": "${{ inputs.filename }}",
"name": "${{ inputs.name }}",
"category": "${{ inputs.category }}",
"platform": "${{ inputs.platform }}",
"sha256": "${{ inputs.file_hash }}",
"sig": "${{ steps.get_sig.outputs.sig }}"
}
}
- name: Strapi Response
run: |
echo ${{ steps.strapi-request.outputs.response }}
push-update-data:
name: Push update data to Strapi
runs-on: custom-runner-linux
# only push update data for tauri apps (desktop wallet and NC)
if: ${{ inputs.category == 'wallet' || inputs.category == 'connect' }}
steps:
- name: Release info
run: |
echo "version: ${{ inputs.version }}"
echo "tag: ${{ inputs.release_tag }}"
- id: get_sig
name: Get sig
if: ${{ inputs.sig_url != null }}
run: |
output=$(curl -LsSf ${{ inputs.sig_url }})
echo "sig=$output" >> "$GITHUB_OUTPUT"
- id: strapi-request
name: Strapi request
uses: fjogeleit/http-request-action@v1
with:
url: ${{ env.strapi_updater_url }}
method: 'POST'
bearerToken: ${{ secrets.STRAPI_API_TOKEN_RELEASES }}
customHeaders: '{"Content-Type": "application/json"}'
data: |
{
"data": {
"releaseId": "${{ inputs.release_id }}",
"releaseDate": "${{ inputs.release_date }}",
"downloadUrl": "${{ inputs.archive_url }}",
"changelog": "See ${{ inputs.changelog_url }} for the changelog",
"version": "${{ inputs.version }}",
"filename": "${{ inputs.filename }}",
"category": "${{ inputs.category }}",
"platform": "${{ inputs.platform }}",
"sha256": "${{ inputs.file_hash }}",
"sig": "${{ steps.get_sig.outputs.sig }}"
}
}
- name: Strapi Response
run: |
echo ${{ steps.strapi-request.outputs.response }}
-35
View File
@@ -1,35 +0,0 @@
name: Publish SDK to NPM
on:
workflow_dispatch:
jobs:
publish:
runs-on: [custom-runner-linux]
steps:
- uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Setup 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 dependencies
run: yarn
- name: Build and publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
working-directory: ./sdk/typescript/packages/sdk
run: scripts/publish.sh
+1 -1
View File
@@ -1 +1 @@
18 16
@@ -10,7 +10,7 @@ async function addToContextAndValidate(context) {
async function getMessageBody(context) { async function getMessageBody(context) {
try { try {
const source = fs const source = fs
.readFileSync("./notifications/deny.message").toString(); .readFileSync("deny.message").toString();
return source; return source;
} catch (error) { } catch (error) {
console.error(error); console.error(error);
+52 -60
View File
@@ -3,70 +3,62 @@ name: CI for linting Typescript
on: on:
push: push:
paths: paths:
- "ts-packages/**" - 'ts-packages/**'
- "sdk/typescript/**" - 'sdk/typescript/**'
- "nym-connect/desktop/src/**" - 'nym-connect/desktop/src/**'
- "nym-connect/desktop/package.json" - 'nym-connect/desktop/package.json'
- "nym-connect/mobile/src/**" - 'nym-connect/mobile/src/**'
- "nym-connect/mobile/package.json" - 'nym-connect/mobile/package.json'
- "nym-wallet/src/**" - 'nym-wallet/src/**'
- "nym-wallet/package.json" - 'nym-wallet/package.json'
- "explorer/**"
pull_request: pull_request:
paths: paths:
- "ts-packages/**" - 'ts-packages/**'
- "sdk/typescript/**" - 'sdk/typescript/**'
- "nym-connect/desktop/src/**" - 'nym-connect/desktop/src/**'
- "nym-connect/desktop/package.json" - 'nym-connect/desktop/package.json'
- "nym-connect/mobile/src/**" - 'nym-connect/mobile/src/**'
- "nym-connect/mobile/package.json" - 'nym-connect/mobile/package.json'
- "nym-wallet/src/**" - 'nym-wallet/src/**'
- "nym-wallet/package.json" - 'nym-wallet/package.json'
- "explorer/**"
jobs: jobs:
build: build:
runs-on: custom-runner-linux runs-on: custom-runner-linux
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install rsync - name: Install rsync
run: sudo apt-get install rsync run: sudo apt-get install rsync
continue-on-error: true continue-on-error: true
- uses: rlespinasse/github-slug-action@v3.x - uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 16
- name: Install Rust stable - name: Setup yarn
uses: actions-rs/toolchain@v1 run: npm install -g yarn
with: - name: Install
toolchain: stable run: yarn
- name: Install wasm-pack - name: Build packages
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh run: yarn build
- name: Setup yarn - name: Lint
run: npm install -g yarn run: yarn lint && yarn tsc
- name: Install - name: Matrix - Node Install
run: yarn run: npm install
- name: Build packages working-directory: .github/workflows/support-files
run: yarn build - name: Matrix - Send Notification
- name: Lint env:
run: yarn lint && yarn tsc NYM_NOTIFICATION_KIND: ts-packages
- name: Matrix - Node Install NYM_PROJECT_NAME: "ts-packages"
run: npm install NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
working-directory: .github/workflows/support-files NYM_CI_WWW_LOCATION: "ts-${{ env.GITHUB_REF_SLUG }}"
- name: Matrix - Send Notification GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
env: GIT_BRANCH: "${GITHUB_REF##*/}"
NYM_NOTIFICATION_KIND: ts-packages IS_SUCCESS: "${{ job.status == 'success' }}"
NYM_PROJECT_NAME: "ts-packages" MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}" MATRIX_ROOM: "${{ secrets.MATRIX_ROOM }}"
NYM_CI_WWW_LOCATION: "ts-${{ env.GITHUB_REF_SLUG }}" MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}" MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
GIT_BRANCH: "${GITHUB_REF##*/}" MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
IS_SUCCESS: "${{ job.status == 'success' }}" uses: docker://keybaseio/client:stable-node
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}" with:
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM }}" args: .github/workflows/support-files/notifications/entry_point.sh
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
+17 -12
View File
@@ -27,17 +27,22 @@ jobs:
run: sudo apt-get update && sudo apt-get -y install build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools git run: sudo apt-get update && sudo apt-get -y install build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools git
continue-on-error: true continue-on-error: true
- name: Update env variables to include go # - name: Update env variables to include go
run: | # run: |
sudo rm -rf /usr/local/go # sudo rm -rf /usr/local/go
curl https://dl.google.com/go/go1.19.2.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - # curl https://dl.google.com/go/go1.20.4.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.profile # cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go # export GOROOT=/usr/local/go
export GOPATH=$HOME/go # export GOPATH=$HOME/go
export GO111MODULE=on # export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin # export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF # EOF
source $HOME/.profile # source $HOME/.profile
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.4"
- name: Verify Go is installed - name: Verify Go is installed
run: go version run: go version
@@ -46,7 +51,7 @@ jobs:
run: | run: |
git clone https://github.com/tommyv1987/nyxd git clone https://github.com/tommyv1987/nyxd
cd nyxd cd nyxd
git checkout release/v0.30.2 git checkout release/v0.31.1
- name: Run nyxd - name: Run nyxd
run: | run: |
-12
View File
@@ -4,18 +4,6 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
## [Unreleased] ## [Unreleased]
## [v1.1.23] (2023-07-04)
- nym-cli: add client identity key signing support ([#3576])
- Feature/node tester package ([#3634])
- Add medium toggle to socks5 client ([#3615])
- Don't fully turn off background task when cover traffic is disabled ([#3596])
[#3576]: https://github.com/nymtech/nym/issues/3576
[#3634]: https://github.com/nymtech/nym/pull/3634
[#3615]: https://github.com/nymtech/nym/pull/3615
[#3596]: https://github.com/nymtech/nym/pull/3596
## [v1.1.22] (2023-06-20) ## [v1.1.22] (2023-06-20)
- CLI tool for querying network-requesters ([#3539]) - CLI tool for querying network-requesters ([#3539])
Generated
+96 -199
View File
@@ -400,18 +400,18 @@ dependencies = [
[[package]] [[package]]
name = "bip32" name = "bip32"
version = "0.4.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b" checksum = "873faa4363bfc54c36a48321da034c92a0645a363eed34d948683ffc1706e37f"
dependencies = [ dependencies = [
"bs58", "bs58",
"hmac 0.12.1", "hmac 0.11.0",
"k256", "k256",
"once_cell", "once_cell",
"pbkdf2", "pbkdf2",
"rand_core 0.6.4", "rand_core 0.6.4",
"ripemd", "ripemd160",
"sha2 0.10.6", "sha2 0.9.9",
"subtle 2.4.1", "subtle 2.4.1",
"zeroize", "zeroize",
] ]
@@ -495,6 +495,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
dependencies = [ dependencies = [
"block-padding",
"generic-array 0.14.7", "generic-array 0.14.7",
] ]
@@ -507,6 +508,12 @@ dependencies = [
"generic-array 0.14.7", "generic-array 0.14.7",
] ]
[[package]]
name = "block-padding"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
[[package]] [[package]]
name = "bls12_381" name = "bls12_381"
version = "0.5.0" version = "0.5.0"
@@ -876,9 +883,9 @@ dependencies = [
[[package]] [[package]]
name = "const-oid" name = "const-oid"
version = "0.9.2" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
[[package]] [[package]]
name = "constant_time_eq" name = "constant_time_eq"
@@ -922,9 +929,8 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
[[package]] [[package]]
name = "cosmos-sdk-proto" name = "cosmos-sdk-proto"
version = "0.13.0" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/neacsu/cosmos-rust?branch=neacsu/feegrant_support#f63ded63ec13e753ebe8bdafe9dc503df265d67d"
checksum = "8bb61f3d2224c90ea78e1fa7444787761a549170c46b6b0ed09b93f9b7e4076a"
dependencies = [ dependencies = [
"prost 0.10.4", "prost 0.10.4",
"prost-types 0.10.1", "prost-types 0.10.1",
@@ -933,9 +939,8 @@ dependencies = [
[[package]] [[package]]
name = "cosmrs" name = "cosmrs"
version = "0.8.0" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/neacsu/cosmos-rust?branch=neacsu/feegrant_support#f63ded63ec13e753ebe8bdafe9dc503df265d67d"
checksum = "20d5890dac07a62337e5841adb8f2074a66a962a098a48df9460f64d483beaf4"
dependencies = [ dependencies = [
"bip32", "bip32",
"cosmos-sdk-proto", "cosmos-sdk-proto",
@@ -956,11 +961,11 @@ dependencies = [
[[package]] [[package]]
name = "cosmwasm-crypto" name = "cosmwasm-crypto"
version = "1.2.5" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75836a10cb9654c54e77ee56da94d592923092a10b369cdb0dbd56acefc16340" checksum = "970d1d705862179b5d7a233ae36f02f21c4ec1b8075fe60c77fc5b43471331fa"
dependencies = [ dependencies = [
"digest 0.10.6", "digest 0.9.0",
"ed25519-zebra", "ed25519-zebra",
"k256", "k256",
"rand_core 0.6.4", "rand_core 0.6.4",
@@ -969,53 +974,26 @@ dependencies = [
[[package]] [[package]]
name = "cosmwasm-derive" name = "cosmwasm-derive"
version = "1.2.5" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c9f7f0e51bfc7295f7b2664fe8513c966428642aa765dad8a74acdab5e0c773" checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4"
dependencies = [ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "cosmwasm-schema"
version = "1.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f00b363610218eea83f24bbab09e1a7c3920b79f068334fdfcc62f6129ef9fc"
dependencies = [
"cosmwasm-schema-derive",
"schemars",
"serde",
"serde_json",
"thiserror",
]
[[package]]
name = "cosmwasm-schema-derive"
version = "1.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae38f909b2822d32b275c9e2db9728497aa33ffe67dd463bc67c6a3b7092785c"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]] [[package]]
name = "cosmwasm-std" name = "cosmwasm-std"
version = "1.2.5" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a49b85345e811c8e80ec55d0d091e4fcb4f00f97ab058f9be5f614c444a730cb" checksum = "875994993c2082a6fcd406937bf0fca21c349e4a624f3810253a14fa83a3a195"
dependencies = [ dependencies = [
"base64 0.13.1", "base64 0.13.1",
"cosmwasm-crypto", "cosmwasm-crypto",
"cosmwasm-derive", "cosmwasm-derive",
"derivative",
"forward_ref", "forward_ref",
"hex",
"schemars", "schemars",
"serde", "serde",
"serde-json-wasm 0.5.1", "serde-json-wasm",
"sha2 0.10.6",
"thiserror", "thiserror",
"uint", "uint",
] ]
@@ -1198,9 +1176,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]] [[package]]
name = "crypto-bigint" name = "crypto-bigint"
version = "0.4.9" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21"
dependencies = [ dependencies = [
"generic-array 0.14.7", "generic-array 0.14.7",
"rand_core 0.6.4", "rand_core 0.6.4",
@@ -1332,11 +1310,10 @@ dependencies = [
[[package]] [[package]]
name = "cw-controllers" name = "cw-controllers"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91440ce8ec4f0642798bc8c8cb6b9b53c1926c6dadaf0eed267a5145cd529071" checksum = "4f0bc6019b4d3d81e11f5c384bcce7173e2210bd654d75c6c9668e12cca05dfa"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus", "cw-storage-plus",
"cw-utils", "cw-utils",
@@ -1347,9 +1324,9 @@ dependencies = [
[[package]] [[package]]
name = "cw-storage-plus" name = "cw-storage-plus"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053a5083c258acd68386734f428a5a171b29f7d733151ae83090c6fcc9417ffa" checksum = "648b1507290bbc03a8d88463d7cd9b04b1fa0155e5eef366c4fa052b9caaac7a"
dependencies = [ dependencies = [
"cosmwasm-std", "cosmwasm-std",
"schemars", "schemars",
@@ -1358,67 +1335,46 @@ dependencies = [
[[package]] [[package]]
name = "cw-utils" name = "cw-utils"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" checksum = "9dbaecb78c8e8abfd6b4258c7f4fbeb5c49a5e45ee4d910d3240ee8e1d714e1b"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw2",
"schemars", "schemars",
"semver 1.0.17",
"serde", "serde",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "cw2" name = "cw2"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fb70cee2cf0b4a8ff7253e6bc6647107905e8eb37208f87d54f67810faa62f8" checksum = "04cf4639517490dd36b333bbd6c4fbd92e325fd0acf4683b41753bc5eb63bfc1"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus", "cw-storage-plus",
"schemars", "schemars",
"serde", "serde",
] ]
[[package]]
name = "cw20"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91666da6c7b40c8dd5ff94df655a28114efc10c79b70b4d06f13c31e37d60609"
dependencies = [
"cosmwasm-schema",
"cosmwasm-std",
"cw-utils",
"schemars",
"serde",
]
[[package]] [[package]]
name = "cw3" name = "cw3"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fe0b587008aa221cd2a2579a21990a28c4347dc53ad43167c68ad765f5b6efa" checksum = "fe19462a7f644ba60c19d3443cb90d00c50d9b6b3b0a3a7fca93df8261af979b"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-utils", "cw-utils",
"cw20",
"schemars", "schemars",
"serde", "serde",
"thiserror",
] ]
[[package]] [[package]]
name = "cw4" name = "cw4"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c236e0bae02ce97e89235a681dd0e07d099524b369f1ef908d704db3e6b049b" checksum = "0acc3549d5ce11c6901b3a676f2e2628684722197054d97cd0101ea174ed5cbd"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus", "cw-storage-plus",
"schemars", "schemars",
@@ -1485,23 +1441,11 @@ dependencies = [
[[package]] [[package]]
name = "der" name = "der"
version = "0.6.1" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
dependencies = [ dependencies = [
"const-oid", "const-oid",
"zeroize",
]
[[package]]
name = "derivative"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
] ]
[[package]] [[package]]
@@ -1633,9 +1577,9 @@ checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
[[package]] [[package]]
name = "ecdsa" name = "ecdsa"
version = "0.14.8" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9"
dependencies = [ dependencies = [
"der", "der",
"elliptic-curve", "elliptic-curve",
@@ -1691,18 +1635,16 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]] [[package]]
name = "elliptic-curve" name = "elliptic-curve"
version = "0.12.3" version = "0.11.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6"
dependencies = [ dependencies = [
"base16ct", "base16ct",
"crypto-bigint", "crypto-bigint",
"der", "der",
"digest 0.10.6", "ff 0.11.1",
"ff 0.12.1",
"generic-array 0.14.7", "generic-array 0.14.7",
"group 0.12.1", "group 0.11.0",
"pkcs8",
"rand_core 0.6.4", "rand_core 0.6.4",
"sec1", "sec1",
"subtle 2.4.1", "subtle 2.4.1",
@@ -1790,7 +1732,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]] [[package]]
name = "explorer-api" name = "explorer-api"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap 4.2.7", "clap 4.2.7",
@@ -1890,16 +1832,6 @@ dependencies = [
"subtle 2.4.1", "subtle 2.4.1",
] ]
[[package]]
name = "ff"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160"
dependencies = [
"rand_core 0.6.4",
"subtle 2.4.1",
]
[[package]] [[package]]
name = "figment" name = "figment"
version = "0.10.8" version = "0.10.8"
@@ -2284,17 +2216,6 @@ dependencies = [
"subtle 2.4.1", "subtle 2.4.1",
] ]
[[package]]
name = "group"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7"
dependencies = [
"ff 0.12.1",
"rand_core 0.6.4",
"subtle 2.4.1",
]
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.3.19" version = "0.3.19"
@@ -2970,14 +2891,15 @@ dependencies = [
[[package]] [[package]]
name = "k256" name = "k256"
version = "0.11.6" version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"ecdsa", "ecdsa",
"elliptic-curve", "elliptic-curve",
"sha2 0.10.6", "sec1",
"sha2 0.9.9",
"sha3", "sha3",
] ]
@@ -3400,7 +3322,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-api" name = "nym-api"
version = "1.1.24" version = "1.1.23"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@@ -3537,7 +3459,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-cli" name = "nym-cli"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.13.1", "base64 0.13.1",
@@ -3603,7 +3525,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-client" name = "nym-client"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"clap 4.2.7", "clap 4.2.7",
"dirs 4.0.0", "dirs 4.0.0",
@@ -3877,7 +3799,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-gateway" name = "nym-gateway"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@@ -3981,8 +3903,6 @@ dependencies = [
name = "nym-group-contract-common" name = "nym-group-contract-common"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cw-controllers",
"cw4", "cw4",
"schemars", "schemars",
"serde", "serde",
@@ -4021,7 +3941,7 @@ dependencies = [
"rand_chacha 0.3.1", "rand_chacha 0.3.1",
"schemars", "schemars",
"serde", "serde",
"serde-json-wasm 0.4.1", "serde-json-wasm",
"serde_repr", "serde_repr",
"thiserror", "thiserror",
"time 0.3.21", "time 0.3.21",
@@ -4030,7 +3950,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-mixnode" name = "nym-mixnode"
version = "1.1.24" version = "1.1.23"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bs58", "bs58",
@@ -4107,9 +4027,7 @@ dependencies = [
name = "nym-multisig-contract-common" name = "nym-multisig-contract-common"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus",
"cw-utils", "cw-utils",
"cw3", "cw3",
"cw4", "cw4",
@@ -4123,12 +4041,8 @@ name = "nym-name-service-common"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cosmwasm-std", "cosmwasm-std",
"cw-controllers",
"cw-utils",
"nym-contracts-common",
"schemars", "schemars",
"serde", "serde",
"thiserror",
] ]
[[package]] [[package]]
@@ -4146,7 +4060,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-network-requester" name = "nym-network-requester"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-file-watcher", "async-file-watcher",
@@ -4178,7 +4092,6 @@ dependencies = [
"pretty_env_logger", "pretty_env_logger",
"publicsuffix", "publicsuffix",
"rand 0.7.3", "rand 0.7.3",
"regex",
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
@@ -4193,7 +4106,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-network-statistics" name = "nym-network-statistics"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"dirs 4.0.0", "dirs 4.0.0",
"log", "log",
@@ -4352,7 +4265,7 @@ dependencies = [
[[package]] [[package]]
name = "nym-socks5-client" name = "nym-socks5-client"
version = "1.1.23" version = "1.1.22"
dependencies = [ dependencies = [
"clap 4.2.7", "clap 4.2.7",
"lazy_static", "lazy_static",
@@ -5084,11 +4997,11 @@ checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
[[package]] [[package]]
name = "pbkdf2" name = "pbkdf2"
version = "0.11.0" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739"
dependencies = [ dependencies = [
"digest 0.10.6", "crypto-mac 0.11.1",
] ]
[[package]] [[package]]
@@ -5236,12 +5149,13 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "pkcs8" name = "pkcs8"
version = "0.9.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
dependencies = [ dependencies = [
"der", "der",
"spki", "spki",
"zeroize",
] ]
[[package]] [[package]]
@@ -5792,13 +5706,13 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.8.4" version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
"regex-syntax 0.7.2", "regex-syntax 0.7.1",
] ]
[[package]] [[package]]
@@ -5818,9 +5732,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.7.2" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
[[package]] [[package]]
name = "reqwest" name = "reqwest"
@@ -5862,12 +5776,12 @@ dependencies = [
[[package]] [[package]]
name = "rfc6979" name = "rfc6979"
version = "0.3.1" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525"
dependencies = [ dependencies = [
"crypto-bigint", "crypto-bigint",
"hmac 0.12.1", "hmac 0.11.0",
"zeroize", "zeroize",
] ]
@@ -5886,15 +5800,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "ripemd"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
dependencies = [
"digest 0.10.6",
]
[[package]] [[package]]
name = "ripemd160" name = "ripemd160"
version = "0.9.1" version = "0.9.1"
@@ -6229,11 +6134,10 @@ dependencies = [
[[package]] [[package]]
name = "sec1" name = "sec1"
version = "0.3.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1"
dependencies = [ dependencies = [
"base16ct",
"der", "der",
"generic-array 0.14.7", "generic-array 0.14.7",
"pkcs8", "pkcs8",
@@ -6321,15 +6225,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "serde-json-wasm"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16a62a1fad1e1828b24acac8f2b468971dade7b8c3c2e672bcadefefb1f8c137"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "serde-wasm-bindgen" name = "serde-wasm-bindgen"
version = "0.5.0" version = "0.5.0"
@@ -6476,12 +6371,14 @@ dependencies = [
[[package]] [[package]]
name = "sha3" name = "sha3"
version = "0.10.8" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
dependencies = [ dependencies = [
"digest 0.10.6", "block-buffer 0.9.0",
"digest 0.9.0",
"keccak", "keccak",
"opaque-debug 0.3.0",
] ]
[[package]] [[package]]
@@ -6525,11 +6422,11 @@ dependencies = [
[[package]] [[package]]
name = "signature" name = "signature"
version = "1.6.4" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788"
dependencies = [ dependencies = [
"digest 0.10.6", "digest 0.9.0",
"rand_core 0.6.4", "rand_core 0.6.4",
] ]
@@ -6632,9 +6529,9 @@ dependencies = [
[[package]] [[package]]
name = "spki" name = "spki"
version = "0.6.0" version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27"
dependencies = [ dependencies = [
"base64ct", "base64ct",
"der", "der",
@@ -7001,9 +6898,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint" name = "tendermint"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a199518e0366ba0aeb0d0e0a59dbd99ea0bdc14280f414ecc758c9228a454ad8" checksum = "3ca881fa4dedd2b46334f13be7fbc8cc1549ba4be5a833fe4e73d1a1baaf7949"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
@@ -7032,9 +6929,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint-config" name = "tendermint-config"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6d8f6a64ae3b59ea3c73efad727271ee085b544b817d7f46901817ca6bb1773" checksum = "f6c56ee93f4e9b7e7daba86d171f44572e91b741084384d0ae00df7991873dfd"
dependencies = [ dependencies = [
"flex-error", "flex-error",
"serde", "serde",
@@ -7046,9 +6943,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint-proto" name = "tendermint-proto"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b303d6387aaea38cea7ef924476d1f798573044e7b4f6ddd1166ac5184b2281" checksum = "b71f925d74903f4abbdc4af0110635a307b3cb05b175fdff4a7247c14a4d0874"
dependencies = [ dependencies = [
"bytes", "bytes",
"flex-error", "flex-error",
@@ -7064,9 +6961,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint-rpc" name = "tendermint-rpc"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3036f0b65baa11e767dabd22a0663e842b595b0a1903f149b7b8b1e09b2b443d" checksum = "a13e63f57ee05a1e927887191c76d1b139de9fa40c180b9f8727ee44377242a6"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
+12 -14
View File
@@ -102,7 +102,7 @@ default-members = [
"explorer-api", "explorer-api",
] ]
exclude = ["explorer", "contracts", "clients/webassembly", "nym-wallet", "nym-connect/mobile/src-tauri", "nym-connect/desktop", "nym-browser-extension/storage", "cpu-cycles"] exclude = ["explorer", "contracts", "clients/webassembly", "nym-wallet", "nym-connect/mobile/src-tauri", "nym-connect/desktop", "cpu-cycles"]
[workspace.package] [workspace.package]
authors = ["Nym Technologies SA"] authors = ["Nym Technologies SA"]
@@ -117,21 +117,19 @@ anyhow = "1.0.71"
async-trait = "0.1.64" async-trait = "0.1.64"
bip39 = { version = "2.0.0", features = ["zeroize"] } bip39 = { version = "2.0.0", features = ["zeroize"] }
cfg-if = "1.0.0" cfg-if = "1.0.0"
cosmwasm-derive = "=1.2.5" cosmwasm-derive = "=1.0.0"
cosmwasm-schema = "=1.2.5" cosmwasm-schema = "=1.0.0"
cosmwasm-std = "=1.2.5" cosmwasm-std = "=1.0.0"
cosmwasm-storage = "=1.2.5" cosmwasm-storage = "=1.0.0"
cosmrs = "=0.8.0" cw-controllers = "=0.13.4"
cw-utils = "=1.0.1" cw-storage-plus = "=0.13.4"
cw-storage-plus = "=1.0.1" cw-utils = "=0.13.4"
cw2 = { version = "=1.0.1" } cw2 = { version = "=0.13.4" }
cw3 = { version = "=1.0.1" } cw3 = { version = "=0.13.4" }
cw3-fixed-multisig = { version = "=1.0.1" } cw3-fixed-multisig = { version = "=0.13.4" }
cw4 = { version = "=1.0.1" } cw4 = { version = "=0.13.4" }
cw-controllers = { version = "=1.0.1" }
dotenvy = "0.15.6" dotenvy = "0.15.6"
generic-array = "0.14.7" generic-array = "0.14.7"
k256 = "0.11"
getrandom = "0.2.10" getrandom = "0.2.10"
lazy_static = "1.4.0" lazy_static = "1.4.0"
log = "0.4" log = "0.4"
+5 -4
View File
@@ -13,7 +13,7 @@ The platform is composed of multiple Rust crates. Top-level executable binary cr
* nym-gateway - acts sort of like a mailbox for mixnet messages, which removes the need for direct delivery to potentially offline or firewalled devices. * nym-gateway - acts sort of like a mailbox for mixnet messages, which removes the need for direct delivery to potentially offline or firewalled devices.
* nym-network-monitor - sends packets through the full system to check that they are working as expected, and stores node uptime histories as the basis of a rewards system ("mixmining" or "proof-of-mixing"). * nym-network-monitor - sends packets through the full system to check that they are working as expected, and stores node uptime histories as the basis of a rewards system ("mixmining" or "proof-of-mixing").
* nym-explorer - a (projected) block explorer and (existing) mixnet viewer. * nym-explorer - a (projected) block explorer and (existing) mixnet viewer.
* nym-wallet - a desktop wallet implemented using the [Tauri](https://tauri.studio/en/docs/about/intro) framework. * nym-wallet - a desktop wallet implemented using the [Tauri](https://tauri.studio/en/docs/about/intro) framework.
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://img.shields.io/github/actions/workflow/status/nymtech/nym/build.yml?branch=develop&style=for-the-badge&logo=github-actions)](https://github.com/nymtech/nym/actions?query=branch%3Adevelop) [![Build Status](https://img.shields.io/github/actions/workflow/status/nymtech/nym/build.yml?branch=develop&style=for-the-badge&logo=github-actions)](https://github.com/nymtech/nym/actions?query=branch%3Adevelop)
@@ -21,7 +21,7 @@ The platform is composed of multiple Rust crates. Top-level executable binary cr
### Building ### Building
Platform build instructions are available on [our docs site](https://nymtech.net/docs/binaries/pre-built-binaries.html). Platform build instructions are available on [our docs site](https://nymtech.net/docs/binaries/build-nym.html).
Wallet build instructions are also available on [our docs site](https://nymtech.net/docs/wallet/desktop-wallet.html). Wallet build instructions are also available on [our docs site](https://nymtech.net/docs/wallet/desktop-wallet.html).
### Developing ### Developing
@@ -32,9 +32,9 @@ For Typescript components, please see [ts-packages](./ts-packages).
### Developer chat ### Developer chat
> We used to use Keybase for developer chats, but we have since migrated to Matrix and Discord. We no longer check the old **nymtech.friends** Keybase team. > We used to use Keybase for developer chats, but we have since migrated to Matrix and Discord. We no longer check the old **nymtech.friends** Keybase team.
You can chat to us in two places: You can chat to us in two places:
* The #dev channel on [Matrix](https://matrix.to/#/#dev:nymtech.chat) * The #dev channel on [Matrix](https://matrix.to/#/#dev:nymtech.chat)
* The various developer channels on [Discord](https://discord.gg/nym) * The various developer channels on [Discord](https://discord.gg/nym)
@@ -84,3 +84,4 @@ where `s'` is stake `s` scaled over total token circulating supply.
### Licensing and copyright information ### Licensing and copyright information
This program is available as open source under the terms of the Apache 2.0 license. However, some elements are being licensed under CC0-1.0 and MIT. For accurate information, please check individual files. This program is available as open source under the terms of the Apache 2.0 license. However, some elements are being licensed under CC0-1.0 and MIT. For accurate information, please check individual files.
-53
View File
@@ -1,53 +0,0 @@
<svg
width="100%"
height="100%"
viewBox="0 0 80 80"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0_421_13045)">
<path
d="M40 80C62.0914 80 80 62.0914 80 40C80 17.9086 62.0914 0 40 0C17.9086 0 0 17.9086 0 40C0 62.0914 17.9086 80 40 80Z"
fill="black"
/>
<path
d="M40 77.2636C60.5801 77.2636 77.2636 60.5801 77.2636 40C77.2636 19.4199 60.5801 2.73645 40 2.73645C19.4199 2.73645 2.73645 19.4199 2.73645 40C2.73645 60.5801 19.4199 77.2636 40 77.2636Z"
fill="white"
/>
<path
d="M24.0224 32.471H23.9776V32.5084V45.5775L18.4673 32.4934L18.4598 32.471H18.4299H15.3047H11.7981H11.7607V32.5084V47.4916V47.529H11.7981H15.3047H15.3421V47.4916V34.4L20.8748 47.5065L20.8822 47.529H20.9121H24.0224H27.5215H27.5589V47.4916V32.5084V32.471H27.5215H24.0224Z"
fill="black"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M23.8965 32.39H27.64V47.6101H20.8238L20.7989 47.5352L15.4232 34.8006V47.6101H11.6797V32.39H18.5183L18.5432 32.4649L23.8965 45.1761V32.39ZM23.9776 45.5776L18.4673 32.4935L18.4598 32.471H11.7608V47.529H15.3421V34.4L20.8748 47.5065L20.8823 47.529H27.5589V32.471H23.9776V45.5776Z"
fill="black"
/>
<path
d="M68.2019 32.471H61.5178H61.4804L61.4729 32.5009L58.0486 45.6374L54.6169 32.5009L54.6094 32.471H54.5795H47.8804H47.8355V32.5084V47.4916V47.529H47.8804H51.3795H51.4169V47.4916V34.5047L54.8038 47.499L54.8112 47.529H54.8486H61.2337H61.2636L61.2711 47.499L64.658 34.5047V47.4916V47.529H64.6954H68.2019H68.2393V47.4916V32.5084V32.471H68.2019Z"
fill="black"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M61.4171 32.39H68.3204V47.6101H64.5769V35.1372L61.3497 47.5187L61.3495 47.5195L61.3269 47.6101H54.7479L54.7253 47.5195L54.7251 47.5187L51.4979 35.1372V47.6101H47.7545V32.39H54.6727L54.6953 32.4804L54.6955 32.4813L58.0485 45.3163L61.3943 32.4813L61.3945 32.4805L61.4171 32.39ZM58.0486 45.6374L54.6168 32.5009L54.6094 32.471H47.8355V47.529H51.4168V34.5047L54.8038 47.4991L54.8112 47.529H61.2636L61.2711 47.4991L64.658 34.5047V47.529H68.2393V32.471H61.4804L61.4729 32.5009L58.0486 45.6374Z"
fill="black"
/>
<path
d="M42.0711 32.471H42.0486L42.0412 32.486L37.7869 39.8804L33.5103 32.486L33.5028 32.471H33.4804H29.4355H29.3608L29.3982 32.5308L35.9851 43.9402V47.4916V47.529H36.0225H39.529H39.5664V47.4916V43.9402L46.1533 32.5308L46.1907 32.471H46.1159H42.0711Z"
fill="black"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M41.9985 32.39H46.337L46.2228 32.5726L39.6475 43.9619V47.6101H35.904V43.9619L29.3286 32.5726L29.2145 32.39H33.5529L33.5817 32.4475L37.7868 39.7181L41.9697 32.4476L41.9985 32.39ZM42.0411 32.486L37.7869 39.8804L33.5103 32.486L33.5028 32.471H29.3608L29.3981 32.5308L35.9851 43.9402V47.529H39.5664V43.9402L46.1533 32.5308L46.1907 32.471H42.0486L42.0411 32.486Z"
fill="black"
/>
</g>
<defs>
<clipPath id="clip0_421_13045">
<rect width="80" height="80" fill="white" />
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

+3 -3
View File
@@ -15,9 +15,9 @@ The credential binary is still experimental software. The infrastructure for usi
From the project's root directory, run: From the project's root directory, run:
``` ```
cargo build -p nym-credential-client cargo build -p credential
``` ```
which generates the `nym-credential-client` binary in `target/debug/nym-credential-client`. which generates the `credential` binary in `target/debug/credential`.
### Running ### Running
@@ -25,7 +25,7 @@ which generates the `nym-credential-client` binary in `target/debug/nym-credenti
For example, you can get a credential worth 3 nym (3000000 unym) in a socks5 client that was already initialized like so: For example, you can get a credential worth 3 nym (3000000 unym) in a socks5 client that was already initialized like so:
``` ```
./target/debug/nym-credential-client --config-env-file envs/sandbox.env --client-home-directory ~/.nym/socks5-clients/cred_client --nyxd-url https://sandbox-validator1.nymtech.net --mnemonic $MNEMONIC --recovery-dir /tmp/recovery --amount 3000000 ./target/debug/credential --config-env-file envs/sandbox.env --client-home-directory ~/.nym/socks5-clients/cred_client --nyxd-url https://sandbox-validator1.nymtech.net --mnemonic $MNEMONIC --recovery-dir /tmp/recovery --amount 3000000
``` ```
More information regarding how to run the binary can be found by running it with the `--help` argument. More information regarding how to run the binary can be found by running it with the `--help` argument.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "nym-client" name = "nym-client"
version = "1.1.23" version = "1.1.22"
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"
+4 -1
View File
@@ -24,6 +24,7 @@ use std::net::IpAddr;
pub(crate) mod init; pub(crate) mod init;
pub(crate) mod run; pub(crate) mod run;
pub(crate) mod upgrade;
lazy_static! { lazy_static! {
pub static ref PRETTY_BUILD_INFORMATION: String = pub static ref PRETTY_BUILD_INFORMATION: String =
@@ -50,9 +51,10 @@ pub(crate) struct Cli {
pub(crate) enum Commands { pub(crate) enum Commands {
/// Initialise a Nym client. Do this first! /// Initialise a Nym client. Do this first!
Init(init::Init), Init(init::Init),
/// Run the Nym client with provided configuration client optionally overriding set parameters /// Run the Nym client with provided configuration client optionally overriding set parameters
Run(run::Run), Run(run::Run),
/// Try to upgrade the client
Upgrade(upgrade::Upgrade),
/// Generate shell completions /// Generate shell completions
Completions(ArgShell), Completions(ArgShell),
@@ -79,6 +81,7 @@ pub(crate) async fn execute(args: &Cli) -> Result<(), Box<dyn Error + Send + Syn
match &args.command { match &args.command {
Commands::Init(m) => init::execute(m).await?, Commands::Init(m) => init::execute(m).await?,
Commands::Run(m) => run::execute(m).await?, Commands::Run(m) => run::execute(m).await?,
Commands::Upgrade(m) => upgrade::execute(m),
Commands::Completions(s) => s.generate(&mut Cli::command(), bin_name), Commands::Completions(s) => s.generate(&mut Cli::command(), bin_name),
Commands::GenerateFigSpec => fig_generate(&mut Cli::command(), bin_name), Commands::GenerateFigSpec => fig_generate(&mut Cli::command(), bin_name),
} }
+78
View File
@@ -0,0 +1,78 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use crate::commands::try_load_current_config;
use clap::Args;
use nym_bin_common::version_checker::Version;
use std::process;
fn unimplemented_upgrade(current_version: &Version, config_version: &Version) -> ! {
eprintln!("Cannot perform upgrade from {config_version} to {current_version} as it hasn't been implemented yet");
process::exit(1)
}
#[derive(Args, Clone)]
pub(crate) struct Upgrade {
/// Id of the nym-client we want to upgrade
#[clap(long)]
id: String,
}
fn parse_config_version(config: &Config) -> Version {
let version = Version::parse(&config.base.client.version).unwrap_or_else(|err| {
eprintln!("failed to parse client version! - {err}");
process::exit(1)
});
if version.is_prerelease() || !version.build.is_empty() {
eprintln!(
"Trying to upgrade from a non-released version {version}. This is not supported!"
);
process::exit(1)
}
version
}
fn parse_package_version() -> Version {
let version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
// technically this is not a correct way of checking it as a released version might contain valid build identifiers
// however, we are not using them ourselves at the moment and hence it should be fine.
// if we change our mind, we could easily tweak this code
if version.is_prerelease() || !version.build.is_empty() {
eprintln!("Trying to upgrade to a non-released version {version}. This is not supported!");
process::exit(1)
}
version
}
fn do_upgrade(config: Config, _args: &Upgrade, package_version: &Version) {
let config_version = parse_config_version(&config);
if &config_version == package_version {
println!("You're using the most recent version!");
return;
}
unimplemented_upgrade(package_version, &config_version)
}
pub(crate) fn execute(args: &Upgrade) {
let package_version = parse_package_version();
let id = &args.id;
let existing_config = try_load_current_config(id).unwrap_or_else(|err| {
eprintln!("failed to load existing config file! - {err}");
process::exit(1)
});
if existing_config.base.client.version.is_empty() {
eprintln!("the existing configuration file does not seem to contain version number.");
process::exit(1);
}
do_upgrade(existing_config, args, &package_version)
}
+5 -6
View File
@@ -117,11 +117,10 @@ impl Handler {
let Ok(base_length) = self let Ok(base_length) = self
.lane_queue_lengths .lane_queue_lengths
.lock() .lock()
.map(|guard| guard.get(&conn_lane).unwrap_or_default()) .map(|guard| guard.get(&conn_lane).unwrap_or_default()) else {
else {
// I'd argue we should panic here as this error it not recoverable // I'd argue we should panic here as this error it not recoverable
error!("The lane queue length lock is poisoned!!"); error!("The lane queue length lock is poisoned!!");
return None; return None
}; };
// get the number of pending replies waiting for reply surbs // get the number of pending replies waiting for reply surbs
@@ -175,7 +174,7 @@ impl Handler {
// Only reply back with a `LaneQueueLength` if the sender providided a connection id // Only reply back with a `LaneQueueLength` if the sender providided a connection id
let TransmissionLane::ConnectionId(connection_id) = lane else { let TransmissionLane::ConnectionId(connection_id) = lane else {
return None; return None
}; };
self.get_lane_queue_length(connection_id).await self.get_lane_queue_length(connection_id).await
@@ -207,7 +206,7 @@ impl Handler {
// Only reply back with a `LaneQueueLength` if the sender providided a connection id // Only reply back with a `LaneQueueLength` if the sender providided a connection id
let TransmissionLane::ConnectionId(connection_id) = lane else { let TransmissionLane::ConnectionId(connection_id) = lane else {
return None; return None
}; };
self.get_lane_queue_length(connection_id).await self.get_lane_queue_length(connection_id).await
@@ -234,7 +233,7 @@ impl Handler {
// Only reply back with a `LaneQueueLength` if the sender providided a connection id // Only reply back with a `LaneQueueLength` if the sender providided a connection id
let TransmissionLane::ConnectionId(connection_id) = lane else { let TransmissionLane::ConnectionId(connection_id) = lane else {
return None; return None
}; };
self.get_lane_queue_length(connection_id).await self.get_lane_queue_length(connection_id).await
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// all variable size data is always prefixed with u64 length // all variable size data is always prefixed with u64 length
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// all variable size data is always prefixed with u64 length // all variable size data is always prefixed with u64 length
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::error::ErrorKind; use crate::error::ErrorKind;
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "nym-socks5-client" name = "nym-socks5-client"
version = "1.1.23" version = "1.1.22"
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"
-1
View File
@@ -94,7 +94,6 @@ impl From<Init> for OverrideConfig {
use_anonymous_replies: init_config.use_reply_surbs, use_anonymous_replies: init_config.use_reply_surbs,
fastmode: init_config.fastmode, fastmode: init_config.fastmode,
no_cover: init_config.no_cover, no_cover: init_config.no_cover,
medium_toggle: false,
nyxd_urls: init_config.nyxd_urls, nyxd_urls: init_config.nyxd_urls,
enabled_credentials_mode: init_config.enabled_credentials_mode, enabled_credentials_mode: init_config.enabled_credentials_mode,
outfox: false, outfox: false,
+6 -17
View File
@@ -19,11 +19,12 @@ use nym_client_core::client::key_manager::persistence::OnDiskKeys;
use nym_client_core::config::GatewayEndpointConfig; use nym_client_core::config::GatewayEndpointConfig;
use nym_client_core::error::ClientCoreError; use nym_client_core::error::ClientCoreError;
use nym_config::OptionalSet; use nym_config::OptionalSet;
use nym_sphinx::params::{PacketSize, PacketType}; use nym_sphinx::params::PacketType;
use std::error::Error; use std::error::Error;
pub mod init; pub mod init;
pub(crate) mod run; pub(crate) mod run;
pub(crate) mod upgrade;
lazy_static! { lazy_static! {
pub static ref PRETTY_BUILD_INFORMATION: String = pub static ref PRETTY_BUILD_INFORMATION: String =
@@ -54,6 +55,9 @@ pub(crate) enum Commands {
/// Run the Nym client with provided configuration client optionally overriding set parameters /// Run the Nym client with provided configuration client optionally overriding set parameters
Run(run::Run), Run(run::Run),
/// Try to upgrade the client
Upgrade(upgrade::Upgrade),
/// Generate shell completions /// Generate shell completions
Completions(ArgShell), Completions(ArgShell),
@@ -68,7 +72,6 @@ pub(crate) struct OverrideConfig {
use_anonymous_replies: Option<bool>, use_anonymous_replies: Option<bool>,
fastmode: bool, fastmode: bool,
no_cover: bool, no_cover: bool,
medium_toggle: bool,
nyxd_urls: Option<Vec<url::Url>>, nyxd_urls: Option<Vec<url::Url>>,
enabled_credentials_mode: Option<bool>, enabled_credentials_mode: Option<bool>,
outfox: bool, outfox: bool,
@@ -80,6 +83,7 @@ pub(crate) async fn execute(args: &Cli) -> Result<(), Box<dyn Error + Send + Syn
match &args.command { match &args.command {
Commands::Init(m) => init::execute(m).await?, Commands::Init(m) => init::execute(m).await?,
Commands::Run(m) => run::execute(m).await?, Commands::Run(m) => run::execute(m).await?,
Commands::Upgrade(m) => upgrade::execute(m),
Commands::Completions(s) => s.generate(&mut Cli::command(), bin_name), Commands::Completions(s) => s.generate(&mut Cli::command(), bin_name),
Commands::GenerateFigSpec => fig_generate(&mut Cli::command(), bin_name), Commands::GenerateFigSpec => fig_generate(&mut Cli::command(), bin_name),
} }
@@ -87,10 +91,6 @@ pub(crate) async fn execute(args: &Cli) -> Result<(), Box<dyn Error + Send + Syn
} }
pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config { pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config {
let disable_cover_traffic_with_keepalive = args.medium_toggle;
let secondary_packet_size = args.medium_toggle.then_some(PacketSize::ExtendedPacket16);
let no_per_hop_delays = args.medium_toggle;
let packet_type = if args.outfox { let packet_type = if args.outfox {
PacketType::Outfox PacketType::Outfox
} else { } else {
@@ -101,17 +101,6 @@ pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config {
BaseClientConfig::with_high_default_traffic_volume, BaseClientConfig::with_high_default_traffic_volume,
args.fastmode, args.fastmode,
) )
.with_base(
// NOTE: This interacts with disabling cover traffic fully, so we want to this to be set before
BaseClientConfig::with_disabled_cover_traffic_with_keepalive,
disable_cover_traffic_with_keepalive,
)
.with_base(
BaseClientConfig::with_secondary_packet_size,
secondary_packet_size,
)
.with_base(BaseClientConfig::with_no_per_hop_delays, no_per_hop_delays)
// NOTE: see comment above about the order of the other disble cover traffic config
.with_base(BaseClientConfig::with_disabled_cover_traffic, args.no_cover) .with_base(BaseClientConfig::with_disabled_cover_traffic, args.no_cover)
.with_base(BaseClientConfig::with_packet_type, packet_type) .with_base(BaseClientConfig::with_packet_type, packet_type)
.with_optional(Config::with_anonymous_replies, args.use_anonymous_replies) .with_optional(Config::with_anonymous_replies, args.use_anonymous_replies)
-6
View File
@@ -60,11 +60,6 @@ pub(crate) struct Run {
#[clap(long, hide = true)] #[clap(long, hide = true)]
no_cover: bool, no_cover: bool,
/// Enable medium mixnet traffic, for experiments only.
/// This includes things like disabling cover traffic, no per hop delays, etc.
#[clap(long, hide = true)]
medium_toggle: bool,
/// Set this client to work in a enabled credentials mode that would attempt to use gateway /// Set this client to work in a enabled credentials mode that would attempt to use gateway
/// with bandwidth credential requirement. /// with bandwidth credential requirement.
#[clap(long, hide = true)] #[clap(long, hide = true)]
@@ -82,7 +77,6 @@ impl From<Run> for OverrideConfig {
use_anonymous_replies: run_config.use_anonymous_replies, use_anonymous_replies: run_config.use_anonymous_replies,
fastmode: run_config.fastmode, fastmode: run_config.fastmode,
no_cover: run_config.no_cover, no_cover: run_config.no_cover,
medium_toggle: run_config.medium_toggle,
nyxd_urls: run_config.nyxd_urls, nyxd_urls: run_config.nyxd_urls,
enabled_credentials_mode: run_config.enabled_credentials_mode, enabled_credentials_mode: run_config.enabled_credentials_mode,
outfox: run_config.outfox, outfox: run_config.outfox,
+78
View File
@@ -0,0 +1,78 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::commands::try_load_current_config;
use crate::config::Config;
use clap::Args;
use nym_bin_common::version_checker::Version;
use std::process;
fn unimplemented_upgrade(current_version: &Version, config_version: &Version) -> ! {
eprintln!("Cannot perform upgrade from {config_version} to {current_version} as it hasn't been implemented yet");
process::exit(1)
}
#[derive(Args, Clone)]
pub(crate) struct Upgrade {
/// Id of the nym-client we want to upgrade
#[clap(long)]
id: String,
}
fn parse_config_version(config: &Config) -> Version {
let version = Version::parse(&config.core.base.client.version).unwrap_or_else(|err| {
eprintln!("failed to parse client version! - {err}");
process::exit(1)
});
if version.is_prerelease() || !version.build.is_empty() {
eprintln!(
"Trying to upgrade from a non-released version {version}. This is not supported!"
);
process::exit(1)
}
version
}
fn parse_package_version() -> Version {
let version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
// technically this is not a correct way of checking it as a released version might contain valid build identifiers
// however, we are not using them ourselves at the moment and hence it should be fine.
// if we change our mind, we could easily tweak this code
if version.is_prerelease() || !version.build.is_empty() {
eprintln!("Trying to upgrade to a non-released version {version}. This is not supported!");
process::exit(1)
}
version
}
fn do_upgrade(config: Config, _args: &Upgrade, package_version: &Version) {
let config_version = parse_config_version(&config);
if &config_version == package_version {
println!("You're using the most recent version!");
return;
}
unimplemented_upgrade(package_version, &config_version)
}
pub(crate) fn execute(args: &Upgrade) {
let package_version = parse_package_version();
let id = &args.id;
let existing_config = try_load_current_config(id).unwrap_or_else(|err| {
eprintln!("failed to load existing config file! - {err}");
process::exit(1)
});
if existing_config.core.base.client.version.is_empty() {
eprintln!("the existing configuration file does not seem to contain version number.");
process::exit(1);
}
do_upgrade(existing_config, args, &package_version)
}
+1 -1
View File
@@ -1 +1 @@
18 16
+18 -19
View File
@@ -3,11 +3,11 @@
"version": "0.19.0", "version": "0.19.0",
"description": "A TypeScript client for interacting with smart contracts in Nym validators", "description": "A TypeScript client for interacting with smart contracts in Nym validators",
"repository": "https://github.com/nymtech/nym", "repository": "https://github.com/nymtech/nym",
"main": "dist/index.js", "main": "./dist/index.js",
"types": "dist/index.d.ts", "types": "./dist/index.d.ts",
"scripts": { "scripts": {
"build": "rollup -c ./rollup.config.mjs", "build": "rollup -c ./rollup.config.mjs",
"build:types": "rollup-type-bundler --dist ./dist", "build:types": "rollup-type-bundler --dist ./dist/nym-validator-client",
"build:prod": "sh ./scripts/build-prod.sh", "build:prod": "sh ./scripts/build-prod.sh",
"test": "ts-mocha -p ./tsconfig.test.json ./src/tests/**/*.test.ts", "test": "ts-mocha -p ./tsconfig.test.json ./src/tests/**/*.test.ts",
"testmock": "ts-mocha -p ./tsconfig.test.json ./src/tests/mock/*.test.ts", "testmock": "ts-mocha -p ./tsconfig.test.json ./src/tests/mock/*.test.ts",
@@ -29,23 +29,16 @@
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"@cosmjs/cosmwasm-stargate": "^0.29.5",
"@cosmjs/crypto": "^0.29.5",
"@cosmjs/math": "^0.29.5",
"@cosmjs/proto-signing": "^0.29.5",
"@cosmjs/stargate": "^0.29.5",
"@cosmjs/tendermint-rpc": "^0.29.5",
"@favware/rollup-type-bundler": "^2.0.0", "@favware/rollup-type-bundler": "^2.0.0",
"@nymproject/types": "^1.0.0", "@nymproject/types": "^1.0.0",
"@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0", "@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^11.0.0", "@rollup/plugin-typescript": "^11.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"rollup": "^3.17.2",
"rollup-plugin-dts": "^5.2.0",
"@typescript-eslint/eslint-plugin": "^5.7.0", "@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0", "@typescript-eslint/parser": "^5.7.0",
"axios": "^1.3.3",
"cosmjs-types": "^0.4.1",
"dotenv": "^16.0.3",
"eslint": "^7.18.0", "eslint": "^7.18.0",
"eslint-config-airbnb": "^19.0.2", "eslint-config-airbnb": "^19.0.2",
"eslint-config-airbnb-typescript": "^16.1.0", "eslint-config-airbnb-typescript": "^16.1.0",
@@ -54,15 +47,21 @@
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.25.4",
"eslint-plugin-mocha": "^10.0.3", "eslint-plugin-mocha": "^10.0.3",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"expect": "^28.1.3",
"mocha": "^10.0.0", "mocha": "^10.0.0",
"moq.ts": "^7.3.4",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"rollup": "^3.17.2",
"rollup-plugin-dts": "^5.2.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"ts-mocha": "^10.0.0", "ts-mocha": "^10.0.0",
"typedoc": "^0.22.13", "typedoc": "^0.22.13",
"typescript": "^4.6.2" "typescript": "^4.6.2",
"cosmjs-types": "^0.4.1",
"dotenv": "^16.0.3",
"expect": "^28.1.3",
"moq.ts": "^7.3.4",
"@cosmjs/cosmwasm-stargate": "^0.29.5",
"@cosmjs/crypto": "^0.29.5",
"@cosmjs/math": "^0.29.5",
"@cosmjs/proto-signing": "^0.29.5",
"@cosmjs/stargate": "^0.29.5",
"@cosmjs/tendermint-rpc": "^0.29.5",
"axios": "^1.3.3"
} }
} }
+4 -4
View File
@@ -1,15 +1,15 @@
import typescript from '@rollup/plugin-typescript'; import typescript from '@rollup/plugin-typescript';
import nodePolyfills from 'rollup-plugin-node-polyfills'; import resolve from '@rollup/plugin-node-resolve';
import json from '@rollup/plugin-json'; import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
export default [ export default [
{ {
input: 'src/index.ts', input: './src/index.ts',
output: { output: {
dir: 'dist', dir: 'dist/nym-validator-client',
format: 'cjs', format: 'cjs',
}, },
plugins: [nodePolyfills(), typescript(), commonjs(), json()], plugins: [resolve(), typescript(), commonjs(), json()],
}, },
]; ];
+1 -1
View File
@@ -21,7 +21,7 @@ node ./scripts/buildPackageJson.mjs
# Copy README # Copy README
cp README.md dist/ cp README.md dist/nym-validator-client
# move the output outside of the yarn/npm workspaces # move the output outside of the yarn/npm workspaces
@@ -17,4 +17,4 @@ const packageJson = {
types, types,
}; };
fs.writeFileSync('./dist/package.json', JSON.stringify(packageJson, null, 2)); fs.writeFileSync('./dist/nym-validator-client/package.json', JSON.stringify(packageJson, null, 2));
+3 -12
View File
@@ -45,6 +45,7 @@ import {
} from '@nymproject/types'; } from '@nymproject/types';
import QueryClient from './query-client'; import QueryClient from './query-client';
import SigningClient, { ISigningClient } from './signing-client'; import SigningClient, { ISigningClient } from './signing-client';
// import { DelegationBlock } from './types/shared';
export interface INymClient { export interface INymClient {
readonly mixnetContract: string; readonly mixnetContract: string;
@@ -625,17 +626,7 @@ export default class ValidatorClient implements INymClient {
// SIMULATE // SIMULATE
public async simulateSend({ public async simulateSend(signingAddress: string, from: string, to: string, amount: Coin[]) {
signingAddress, return (this.client as SigningClient).simulateSend(signingAddress, from, to, amount);
from,
to,
amount,
}: {
signingAddress: string;
from: string;
to: string;
amount: Coin[];
}) {
return (this.client as ISigningClient).simulateSend(signingAddress, from, to, amount);
} }
} }
@@ -22,12 +22,9 @@ describe('Simualtions', () => {
}); });
it('can simulate sending tokens', async () => { it('can simulate sending tokens', async () => {
const res = await client.simulateSend({ const res = await client.simulateSend(client.address, client.address, client.address, [
signingAddress: client.address, { amount: '400000', denom: 'unym' },
from: client.address, ]);
to: client.address,
amount: [{ amount: '400000', denom: 'unym' }],
});
expect(typeof res).toBe('number'); expect(typeof res).toBe('number');
}).timeout(10000); }).timeout(10000);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "./dist/nym-validator-client",
"module": "ES2020", "module": "ES2020",
"target": "es2021", "target": "es2021",
"allowJs": false, "allowJs": false,
+82 -184
View File
@@ -237,18 +237,18 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]] [[package]]
name = "bip32" name = "bip32"
version = "0.4.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b" checksum = "873faa4363bfc54c36a48321da034c92a0645a363eed34d948683ffc1706e37f"
dependencies = [ dependencies = [
"bs58", "bs58",
"hmac 0.12.1", "hmac 0.11.0",
"k256", "k256",
"once_cell", "once_cell",
"pbkdf2", "pbkdf2",
"rand_core 0.6.4", "rand_core 0.6.4",
"ripemd", "ripemd160",
"sha2 0.10.6", "sha2 0.9.9",
"subtle 2.4.1", "subtle 2.4.1",
"zeroize", "zeroize",
] ]
@@ -332,6 +332,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
dependencies = [ dependencies = [
"block-padding",
"generic-array 0.14.7", "generic-array 0.14.7",
] ]
@@ -344,6 +345,12 @@ dependencies = [
"generic-array 0.14.7", "generic-array 0.14.7",
] ]
[[package]]
name = "block-padding"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
[[package]] [[package]]
name = "bls12_381" name = "bls12_381"
version = "0.5.0" version = "0.5.0"
@@ -570,9 +577,9 @@ dependencies = [
[[package]] [[package]]
name = "const-oid" name = "const-oid"
version = "0.9.4" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
[[package]] [[package]]
name = "constant_time_eq" name = "constant_time_eq"
@@ -598,9 +605,8 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
[[package]] [[package]]
name = "cosmos-sdk-proto" name = "cosmos-sdk-proto"
version = "0.13.0" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/neacsu/cosmos-rust?branch=neacsu/feegrant_support#f63ded63ec13e753ebe8bdafe9dc503df265d67d"
checksum = "8bb61f3d2224c90ea78e1fa7444787761a549170c46b6b0ed09b93f9b7e4076a"
dependencies = [ dependencies = [
"prost", "prost",
"prost-types", "prost-types",
@@ -609,9 +615,8 @@ dependencies = [
[[package]] [[package]]
name = "cosmrs" name = "cosmrs"
version = "0.8.0" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/neacsu/cosmos-rust?branch=neacsu/feegrant_support#f63ded63ec13e753ebe8bdafe9dc503df265d67d"
checksum = "20d5890dac07a62337e5841adb8f2074a66a962a098a48df9460f64d483beaf4"
dependencies = [ dependencies = [
"bip32", "bip32",
"cosmos-sdk-proto", "cosmos-sdk-proto",
@@ -632,11 +637,11 @@ dependencies = [
[[package]] [[package]]
name = "cosmwasm-crypto" name = "cosmwasm-crypto"
version = "1.3.0" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d076a08ec01ed23c4396aca98ec73a38fa1fee5f310465add52b4108181c7a8" checksum = "970d1d705862179b5d7a233ae36f02f21c4ec1b8075fe60c77fc5b43471331fa"
dependencies = [ dependencies = [
"digest 0.10.6", "digest 0.9.0",
"ed25519-zebra", "ed25519-zebra",
"k256", "k256",
"rand_core 0.6.4", "rand_core 0.6.4",
@@ -645,53 +650,26 @@ dependencies = [
[[package]] [[package]]
name = "cosmwasm-derive" name = "cosmwasm-derive"
version = "1.2.5" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c9f7f0e51bfc7295f7b2664fe8513c966428642aa765dad8a74acdab5e0c773" checksum = "4b36e527620a2a3e00e46b6e731ab6c9b68d11069c986f7d7be8eba79ef081a4"
dependencies = [ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "cosmwasm-schema"
version = "1.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f00b363610218eea83f24bbab09e1a7c3920b79f068334fdfcc62f6129ef9fc"
dependencies = [
"cosmwasm-schema-derive",
"schemars",
"serde",
"serde_json",
"thiserror",
]
[[package]]
name = "cosmwasm-schema-derive"
version = "1.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae38f909b2822d32b275c9e2db9728497aa33ffe67dd463bc67c6a3b7092785c"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]] [[package]]
name = "cosmwasm-std" name = "cosmwasm-std"
version = "1.2.5" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a49b85345e811c8e80ec55d0d091e4fcb4f00f97ab058f9be5f614c444a730cb" checksum = "875994993c2082a6fcd406937bf0fca21c349e4a624f3810253a14fa83a3a195"
dependencies = [ dependencies = [
"base64 0.13.1", "base64 0.13.1",
"cosmwasm-crypto", "cosmwasm-crypto",
"cosmwasm-derive", "cosmwasm-derive",
"derivative",
"forward_ref", "forward_ref",
"hex",
"schemars", "schemars",
"serde", "serde",
"serde-json-wasm 0.5.1", "serde-json-wasm",
"sha2 0.10.6",
"thiserror", "thiserror",
"uint", "uint",
] ]
@@ -805,9 +783,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]] [[package]]
name = "crypto-bigint" name = "crypto-bigint"
version = "0.4.9" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21"
dependencies = [ dependencies = [
"generic-array 0.14.7", "generic-array 0.14.7",
"rand_core 0.6.4", "rand_core 0.6.4",
@@ -889,11 +867,10 @@ dependencies = [
[[package]] [[package]]
name = "cw-controllers" name = "cw-controllers"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91440ce8ec4f0642798bc8c8cb6b9b53c1926c6dadaf0eed267a5145cd529071" checksum = "4f0bc6019b4d3d81e11f5c384bcce7173e2210bd654d75c6c9668e12cca05dfa"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus", "cw-storage-plus",
"cw-utils", "cw-utils",
@@ -904,9 +881,9 @@ dependencies = [
[[package]] [[package]]
name = "cw-storage-plus" name = "cw-storage-plus"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053a5083c258acd68386734f428a5a171b29f7d733151ae83090c6fcc9417ffa" checksum = "648b1507290bbc03a8d88463d7cd9b04b1fa0155e5eef366c4fa052b9caaac7a"
dependencies = [ dependencies = [
"cosmwasm-std", "cosmwasm-std",
"schemars", "schemars",
@@ -915,67 +892,46 @@ dependencies = [
[[package]] [[package]]
name = "cw-utils" name = "cw-utils"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" checksum = "9dbaecb78c8e8abfd6b4258c7f4fbeb5c49a5e45ee4d910d3240ee8e1d714e1b"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw2",
"schemars", "schemars",
"semver 1.0.17",
"serde", "serde",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "cw2" name = "cw2"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fb70cee2cf0b4a8ff7253e6bc6647107905e8eb37208f87d54f67810faa62f8" checksum = "04cf4639517490dd36b333bbd6c4fbd92e325fd0acf4683b41753bc5eb63bfc1"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus", "cw-storage-plus",
"schemars", "schemars",
"serde", "serde",
] ]
[[package]]
name = "cw20"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "011c45920f8200bd5d32d4fe52502506f64f2f75651ab408054d4cfc75ca3a9b"
dependencies = [
"cosmwasm-schema",
"cosmwasm-std",
"cw-utils",
"schemars",
"serde",
]
[[package]] [[package]]
name = "cw3" name = "cw3"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fe0b587008aa221cd2a2579a21990a28c4347dc53ad43167c68ad765f5b6efa" checksum = "fe19462a7f644ba60c19d3443cb90d00c50d9b6b3b0a3a7fca93df8261af979b"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-utils", "cw-utils",
"cw20",
"schemars", "schemars",
"serde", "serde",
"thiserror",
] ]
[[package]] [[package]]
name = "cw4" name = "cw4"
version = "1.0.1" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c236e0bae02ce97e89235a681dd0e07d099524b369f1ef908d704db3e6b049b" checksum = "0acc3549d5ce11c6901b3a676f2e2628684722197054d97cd0101ea174ed5cbd"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus", "cw-storage-plus",
"schemars", "schemars",
@@ -997,23 +953,11 @@ dependencies = [
[[package]] [[package]]
name = "der" name = "der"
version = "0.6.1" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
dependencies = [ dependencies = [
"const-oid", "const-oid",
"zeroize",
]
[[package]]
name = "derivative"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
] ]
[[package]] [[package]]
@@ -1106,9 +1050,9 @@ checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
[[package]] [[package]]
name = "ecdsa" name = "ecdsa"
version = "0.14.8" version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9"
dependencies = [ dependencies = [
"der", "der",
"elliptic-curve", "elliptic-curve",
@@ -1164,18 +1108,16 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]] [[package]]
name = "elliptic-curve" name = "elliptic-curve"
version = "0.12.3" version = "0.11.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6"
dependencies = [ dependencies = [
"base16ct", "base16ct",
"crypto-bigint", "crypto-bigint",
"der", "der",
"digest 0.10.6", "ff 0.11.1",
"ff 0.12.1",
"generic-array 0.14.7", "generic-array 0.14.7",
"group 0.12.1", "group 0.11.0",
"pkcs8",
"rand_core 0.6.4", "rand_core 0.6.4",
"sec1", "sec1",
"subtle 2.4.1", "subtle 2.4.1",
@@ -1290,16 +1232,6 @@ dependencies = [
"subtle 2.4.1", "subtle 2.4.1",
] ]
[[package]]
name = "ff"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160"
dependencies = [
"rand_core 0.6.4",
"subtle 2.4.1",
]
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.26" version = "1.0.26"
@@ -1592,17 +1524,6 @@ dependencies = [
"subtle 2.4.1", "subtle 2.4.1",
] ]
[[package]]
name = "group"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7"
dependencies = [
"ff 0.12.1",
"rand_core 0.6.4",
"subtle 2.4.1",
]
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.3.19" version = "0.3.19"
@@ -2057,14 +1978,15 @@ dependencies = [
[[package]] [[package]]
name = "k256" name = "k256"
version = "0.11.6" version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"ecdsa", "ecdsa",
"elliptic-curve", "elliptic-curve",
"sha2 0.10.6", "sec1",
"sha2 0.9.9",
"sha3", "sha3",
] ]
@@ -2618,8 +2540,6 @@ dependencies = [
name = "nym-group-contract-common" name = "nym-group-contract-common"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cw-controllers",
"cw4", "cw4",
"schemars", "schemars",
"serde", "serde",
@@ -2636,7 +2556,7 @@ dependencies = [
"nym-contracts-common", "nym-contracts-common",
"schemars", "schemars",
"serde", "serde",
"serde-json-wasm 0.4.1", "serde-json-wasm",
"serde_repr", "serde_repr",
"thiserror", "thiserror",
"time", "time",
@@ -2646,9 +2566,7 @@ dependencies = [
name = "nym-multisig-contract-common" name = "nym-multisig-contract-common"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cosmwasm-schema",
"cosmwasm-std", "cosmwasm-std",
"cw-storage-plus",
"cw-utils", "cw-utils",
"cw3", "cw3",
"cw4", "cw4",
@@ -2662,12 +2580,8 @@ name = "nym-name-service-common"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cosmwasm-std", "cosmwasm-std",
"cw-controllers",
"cw-utils",
"nym-contracts-common",
"schemars", "schemars",
"serde", "serde",
"thiserror",
] ]
[[package]] [[package]]
@@ -3167,11 +3081,11 @@ checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
[[package]] [[package]]
name = "pbkdf2" name = "pbkdf2"
version = "0.11.0" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739"
dependencies = [ dependencies = [
"digest 0.10.6", "crypto-mac 0.11.1",
] ]
[[package]] [[package]]
@@ -3296,12 +3210,13 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "pkcs8" name = "pkcs8"
version = "0.9.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
dependencies = [ dependencies = [
"der", "der",
"spki", "spki",
"zeroize",
] ]
[[package]] [[package]]
@@ -3630,12 +3545,12 @@ dependencies = [
[[package]] [[package]]
name = "rfc6979" name = "rfc6979"
version = "0.3.1" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525"
dependencies = [ dependencies = [
"crypto-bigint", "crypto-bigint",
"hmac 0.12.1", "hmac 0.11.0",
"zeroize", "zeroize",
] ]
@@ -3654,15 +3569,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "ripemd"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f"
dependencies = [
"digest 0.10.6",
]
[[package]] [[package]]
name = "ripemd160" name = "ripemd160"
version = "0.9.1" version = "0.9.1"
@@ -3832,11 +3738,10 @@ dependencies = [
[[package]] [[package]]
name = "sec1" name = "sec1"
version = "0.3.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1"
dependencies = [ dependencies = [
"base16ct",
"der", "der",
"generic-array 0.14.7", "generic-array 0.14.7",
"pkcs8", "pkcs8",
@@ -3909,15 +3814,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "serde-json-wasm"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16a62a1fad1e1828b24acac8f2b468971dade7b8c3c2e672bcadefefb1f8c137"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "serde-wasm-bindgen" name = "serde-wasm-bindgen"
version = "0.5.0" version = "0.5.0"
@@ -4053,12 +3949,14 @@ dependencies = [
[[package]] [[package]]
name = "sha3" name = "sha3"
version = "0.10.8" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
dependencies = [ dependencies = [
"digest 0.10.6", "block-buffer 0.9.0",
"digest 0.9.0",
"keccak", "keccak",
"opaque-debug 0.3.0",
] ]
[[package]] [[package]]
@@ -4072,11 +3970,11 @@ dependencies = [
[[package]] [[package]]
name = "signature" name = "signature"
version = "1.6.4" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788"
dependencies = [ dependencies = [
"digest 0.10.6", "digest 0.9.0",
"rand_core 0.6.4", "rand_core 0.6.4",
] ]
@@ -4146,9 +4044,9 @@ dependencies = [
[[package]] [[package]]
name = "spki" name = "spki"
version = "0.6.0" version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27"
dependencies = [ dependencies = [
"base64ct", "base64ct",
"der", "der",
@@ -4433,9 +4331,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint" name = "tendermint"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a199518e0366ba0aeb0d0e0a59dbd99ea0bdc14280f414ecc758c9228a454ad8" checksum = "3ca881fa4dedd2b46334f13be7fbc8cc1549ba4be5a833fe4e73d1a1baaf7949"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
@@ -4464,9 +4362,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint-config" name = "tendermint-config"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6d8f6a64ae3b59ea3c73efad727271ee085b544b817d7f46901817ca6bb1773" checksum = "f6c56ee93f4e9b7e7daba86d171f44572e91b741084384d0ae00df7991873dfd"
dependencies = [ dependencies = [
"flex-error", "flex-error",
"serde", "serde",
@@ -4478,9 +4376,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint-proto" name = "tendermint-proto"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b303d6387aaea38cea7ef924476d1f798573044e7b4f6ddd1166ac5184b2281" checksum = "b71f925d74903f4abbdc4af0110635a307b3cb05b175fdff4a7247c14a4d0874"
dependencies = [ dependencies = [
"bytes", "bytes",
"flex-error", "flex-error",
@@ -4496,9 +4394,9 @@ dependencies = [
[[package]] [[package]]
name = "tendermint-rpc" name = "tendermint-rpc"
version = "0.23.8" version = "0.23.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3036f0b65baa11e767dabd22a0663e842b595b0a1903f149b7b8b1e09b2b443d" checksum = "a13e63f57ee05a1e927887191c76d1b139de9fa40c180b9f8727ee44377242a6"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bytes", "bytes",
-3
View File
@@ -3,6 +3,3 @@ clippy:
test: test:
wasm-pack test --node wasm-pack test --node
wasm-build:
wasm-pack build
@@ -8,7 +8,6 @@
}, },
"scripts": { "scripts": {
"build": "webpack --config webpack.config.js", "build": "webpack --config webpack.config.js",
"build:wasm": "cd ../ && make wasm-build",
"start": "webpack-dev-server --port 8001" "start": "webpack-dev-server --port 8001"
}, },
"repository": { "repository": {
@@ -37,4 +36,4 @@
"dependencies": { "dependencies": {
"@nymproject/nym-client-wasm": "file:../pkg" "@nymproject/nym-client-wasm": "file:../pkg"
} }
} }
+292 -293
View File
@@ -12,371 +12,370 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
importScripts("nym_client_wasm.js"); importScripts('nym_client_wasm.js');
console.log("Initializing worker"); console.log('Initializing worker');
// wasm_bindgen creates a global variable (with the exports attached) that is in scope after `importScripts` // wasm_bindgen creates a global variable (with the exports attached) that is in scope after `importScripts`
const { const {
NymNodeTester, NymNodeTester,
WasmGateway, WasmGateway,
WasmMixNode, WasmMixNode,
WasmNymTopology, WasmNymTopology,
default_debug, default_debug,
NymClientBuilder, NymClientBuilder,
NymClient, NymClient,
set_panic_hook, set_panic_hook,
Config, Config,
GatewayEndpointConfig, GatewayEndpointConfig,
ClientStorage, ClientStorage,
current_network_topology, current_network_topology,
make_key, make_key,
make_key2, make_key2
} = wasm_bindgen; } = wasm_bindgen;
let client = null; let client = null;
let tester = null; let tester = null;
const preferredGateway = "336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9";
function dummyTopology() { function dummyTopology() {
const l1Mixnode = new WasmMixNode( const l1Mixnode = new WasmMixNode(
1, 1,
"n1fzv4jc7fanl9s0qj02ge2ezk3kts545kjtek47", 'n1fzv4jc7fanl9s0qj02ge2ezk3kts545kjtek47',
"178.79.143.65", '178.79.143.65',
1789, 1789,
"4Yr4qmEHd9sgsuQ83191FR2hD88RfsbMmB4tzhhZWriz", '4Yr4qmEHd9sgsuQ83191FR2hD88RfsbMmB4tzhhZWriz',
"8ndjk5oZ6HxUZNScLJJ7hk39XtUqGexdKgW7hSX6kpWG", '8ndjk5oZ6HxUZNScLJJ7hk39XtUqGexdKgW7hSX6kpWG',
1, 1,
"1.10.0" '1.10.0',
); );
const l2Mixnode = new WasmMixNode( const l2Mixnode = new WasmMixNode(
2, 2,
"n1z93z44vf8ssvdhujjvxcj4rd5e3lz0l60wdk70", 'n1z93z44vf8ssvdhujjvxcj4rd5e3lz0l60wdk70',
"109.74.197.180", '109.74.197.180',
1789, 1789,
"7sVjiMrPYZrDWRujku9QLxgE8noT7NTgBAqizCsu7AoK", '7sVjiMrPYZrDWRujku9QLxgE8noT7NTgBAqizCsu7AoK',
"GepXwRnKZDd8x2nBWAajGGBVvF3mrpVMQBkgfrGuqRCN", 'GepXwRnKZDd8x2nBWAajGGBVvF3mrpVMQBkgfrGuqRCN',
2, 2,
"1.10.0" '1.10.0',
); );
const l3Mixnode = new WasmMixNode( const l3Mixnode = new WasmMixNode(
3, 3,
"n1ptg680vnmef2cd8l0s9uyc4f0hgf3x8sed6w77", 'n1ptg680vnmef2cd8l0s9uyc4f0hgf3x8sed6w77',
"176.58.101.80", '176.58.101.80',
1789, 1789,
"FoM5Mx9Pxk1g3zEqkS3APgtBeTtTo3M8k7Yu4bV6kK1R", 'FoM5Mx9Pxk1g3zEqkS3APgtBeTtTo3M8k7Yu4bV6kK1R',
"DeYjrDC2AcQRVFshiKnbUo6bRvPyZ33QGYR2DLeFJ9qD", 'DeYjrDC2AcQRVFshiKnbUo6bRvPyZ33QGYR2DLeFJ9qD',
3, 3,
"1.10.0" '1.10.0',
); );
const gateway = new WasmGateway( const gateway = new WasmGateway(
"n16evnn8glr0sham3matj8rg2s24m6x56ayk87ts", 'n16evnn8glr0sham3matj8rg2s24m6x56ayk87ts',
"85.159.212.96", '85.159.212.96',
1789, 1789,
9000, 9000,
"336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9", '336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9',
"BtYjoWihiuFihGKQypmpSspbhmWDPxzqeTVSd8ciCpWL", 'BtYjoWihiuFihGKQypmpSspbhmWDPxzqeTVSd8ciCpWL',
"1.10.1" '1.10.1',
); );
const mixnodes = new Map(); const mixnodes = new Map();
mixnodes.set(1, [l1Mixnode]); mixnodes.set(1, [l1Mixnode]);
mixnodes.set(2, [l2Mixnode]); mixnodes.set(2, [l2Mixnode]);
mixnodes.set(3, [l3Mixnode]); mixnodes.set(3, [l3Mixnode]);
const gateways = [gateway];
return new WasmNymTopology(mixnodes, gateways); const gateways = [gateway];
return new WasmNymTopology(mixnodes, gateways)
} }
function printAndDisplayTestResult(result) { function printAndDisplayTestResult(result) {
result.log_details(); result.log_details();
self.postMessage({ self.postMessage({
kind: "DisplayTesterResults", kind: 'DisplayTesterResults',
args: { args: {
score: result.score(), score: result.score(),
sentPackets: result.sent_packets, sentPackets: result.sent_packets,
receivedPackets: result.received_packets, receivedPackets: result.received_packets,
receivedAcks: result.received_acks, receivedAcks: result.received_acks,
duplicatePackets: result.duplicate_packets, duplicatePackets: result.duplicate_packets,
duplicateAcks: result.duplicate_acks, duplicateAcks: result.duplicate_acks,
}, },
}); });
} }
async function testWithTester() { async function testWithTester() {
// A) construct with hardcoded topology const preferredGateway = "336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9";
const topology = dummyTopology();
const nodeTester = await new NymNodeTester(topology, preferredGateway);
// B) first get topology directly from nym-api // A) construct with hardcoded topology
// const validator = 'https://qwerty-validator-api.qa.nymte.ch/api'; const topology = dummyTopology()
// const topology = await current_network_topology(validator) const nodeTester = await new NymNodeTester(topology, preferredGateway);
// const nodeTester = await new NymNodeTester(topology, preferredGateway);
//
// C) use nym-api in the constructor (note: it does no filtering for 'good' nodes on other layers)
// const validator = 'https://qwerty-validator-api.qa.nymte.ch/api';
// const nodeTester = await NymNodeTester.new_with_api(validator, preferredGateway)
// B) first get topology directly from nym-api // B) first get topology directly from nym-api
// const validator = 'https://qwerty-validator-api.qa.nymte.ch/api'; // const validator = 'https://qwerty-validator-api.qa.nymte.ch/api';
// const topology = await current_network_topology(validator) // const topology = await current_network_topology(validator)
// const nodeTester = await new NymNodeTester(topology, undefined, preferredGateway); // const nodeTester = await new NymNodeTester(topology, undefined, preferredGateway);
// //
// C) use nym-api in the constructor (note: it does no filtering for 'good' nodes on other layers) // C) use nym-api in the constructor (note: it does no filtering for 'good' nodes on other layers)
// const validator = 'https://qwerty-validator-api.qa.nymte.ch/api'; // const validator = 'https://qwerty-validator-api.qa.nymte.ch/api';
// const nodeTester = await NymNodeTester.new_with_api(validator, undefined, preferredGateway) // const nodeTester = await NymNodeTester.new_with_api(validator, undefined, preferredGateway)
// D, E, F) you also don't have to specify the gateway. if you don't, a random one (from your topology) will be used
// const topology = dummyTopology()
// const nodeTester = await new NymNodeTester(topology);
self.onmessage = async (event) => { // D, E, F) you also don't have to specify the gateway. if you don't, a random one (from your topology) will be used
if (event.data && event.data.kind) { // const topology = dummyTopology()
switch (event.data.kind) { // const nodeTester = await new NymNodeTester(topology);
case "TestPacket": {
const { mixnodeIdentity } = event.data.args;
console.log("starting node test...");
let result = await nodeTester.test_node(mixnodeIdentity); self.onmessage = async event => {
printAndDisplayTestResult(result); if (event.data && event.data.kind) {
switch (event.data.kind) {
case 'TestPacket': {
const {mixnodeIdentity} = event.data.args;
console.log("starting node test...");
let result = await nodeTester.test_node(mixnodeIdentity);
printAndDisplayTestResult(result)
}
}
} }
} };
}
};
} }
async function testerReconnection() { async function testerReconnection() {
const validator = "https://qwerty-validator-api.qa.nymte.ch/api"; const validator = 'https://qwerty-validator-api.qa.nymte.ch/api';
const nodeTester = await NymNodeTester.new_with_api(validator); const nodeTester = await NymNodeTester.new_with_api(validator);
self.onmessage = async (event) => { self.onmessage = async event => {
if (event.data && event.data.kind) { if (event.data && event.data.kind) {
switch (event.data.kind) { switch (event.data.kind) {
case "TestPacket": { case 'TestPacket': {
const { mixnodeIdentity } = event.data.args; const {mixnodeIdentity} = event.data.args;
console.log("starting node test..."); console.log("starting node test...");
let result1 = await nodeTester.test_node(mixnodeIdentity); let result1 = await nodeTester.test_node(mixnodeIdentity);
console.log("sleeping for 5s"); console.log("sleeping for 5s");
await new Promise((r) => setTimeout(r, 5000)); await new Promise(r => setTimeout(r, 5000));
await nodeTester.disconnect_from_gateway(); await nodeTester.disconnect_from_gateway();
console.log("sleeping for 5s"); console.log("sleeping for 5s");
await new Promise((r) => setTimeout(r, 5000)); await new Promise(r => setTimeout(r, 5000));
await nodeTester.reconnect_to_gateway(); await nodeTester.reconnect_to_gateway();
let result2 = await nodeTester.test_node(mixnodeIdentity); let result2 = await nodeTester.test_node(mixnodeIdentity);
printAndDisplayTestResult(result1); printAndDisplayTestResult(result1)
printAndDisplayTestResult(result2); printAndDisplayTestResult(result2)
}
}
} }
} };
}
};
} }
async function testWithNymClient() { async function testWithNymClient() {
const topology = dummyTopology(); const preferredGateway = "336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9";
const topology = dummyTopology()
let received = 0; let received = 0
const onMessageHandler = (message) => { const onMessageHandler = (message) => {
received += 1; received += 1;
self.postMessage({
kind: 'ReceiveMessage',
args: {
message,
senderTag: undefined,
isTestPacket: true,
},
});
// it's really up to the user to create proper callback here...
console.log(`received ${received} packets so far`)
};
console.log('Instantiating WASM client...');
let clientBuilder = NymClientBuilder.new_tester(topology, onMessageHandler, preferredGateway)
console.log('Web worker creating WASM client...');
let local_client = await clientBuilder.start_client();
console.log('WASM client running!');
const selfAddress = local_client.self_address();
// set the global (I guess we don't have to anymore?)
client = local_client;
console.log(`Client address is ${selfAddress}`);
self.postMessage({ self.postMessage({
kind: "ReceiveMessage", kind: 'Ready',
args: { args: {
message, selfAddress,
senderTag: undefined, },
isTestPacket: true,
},
}); });
// it's really up to the user to create proper callback here... // Set callback to handle messages passed to the worker.
console.log(`received ${received} packets so far`); self.onmessage = async event => {
}; console.log(event)
if (event.data && event.data.kind) {
console.log("Instantiating WASM client..."); switch (event.data.kind) {
case 'SendMessage': {
let clientBuilder = NymClientBuilder.new_tester( const {message, recipient} = event.data.args;
topology, let uint8Array = new TextEncoder().encode(message);
onMessageHandler, await client.send_regular_message(uint8Array, recipient);
preferredGateway break;
); }
case 'TestPacket': {
console.log("Web worker creating WASM client..."); const {mixnodeIdentity} = event.data.args;
let local_client = await clientBuilder.start_client(); const req = await client.try_construct_test_packet_request(mixnodeIdentity);
console.log("WASM client running!"); await client.change_hardcoded_topology(req.injectable_topology());
await client.try_send_test_packets(req);
const selfAddress = local_client.self_address(); break;
}
// set the global (I guess we don't have to anymore?) }
client = local_client;
console.log(`Client address is ${selfAddress}`);
self.postMessage({
kind: "Ready",
args: {
selfAddress,
},
});
// Set callback to handle messages passed to the worker.
self.onmessage = async (event) => {
console.log(event);
if (event.data && event.data.kind) {
switch (event.data.kind) {
case "SendMessage": {
const { message, recipient } = event.data.args;
let uint8Array = new TextEncoder().encode(message);
await client.send_regular_message(uint8Array, recipient);
break;
} }
case "TestPacket": { };
const { mixnodeIdentity } = event.data.args;
const req = await client.try_construct_test_packet_request(
mixnodeIdentity
);
await client.change_hardcoded_topology(req.injectable_topology());
await client.try_send_test_packets(req);
break;
}
}
}
};
} }
async function normalNymClientUsage() { async function normalNymClientUsage() {
self.postMessage({ kind: "DisableMagicTestButton" }); self.postMessage({kind: 'DisableMagicTestButton'});
// only really useful if you want to adjust some settings like traffic rate // only really useful if you want to adjust some settings like traffic rate
// (if not needed you can just pass a null) // (if not needed you can just pass a null)
const debug = default_debug(); const debug = default_debug();
debug.disable_main_poisson_packet_distribution = true; debug.disable_main_poisson_packet_distribution = true;
debug.disable_loop_cover_traffic_stream = true; debug.disable_loop_cover_traffic_stream = true;
debug.use_extended_packet_size = false; debug.use_extended_packet_size = false;
// debug.average_packet_delay_ms = BigInt(10); // debug.average_packet_delay_ms = BigInt(10);
// debug.average_ack_delay_ms = BigInt(10); // debug.average_ack_delay_ms = BigInt(10);
// debug.ack_wait_addition_ms = BigInt(3000); // debug.ack_wait_addition_ms = BigInt(3000);
// debug.ack_wait_multiplier = 10; // debug.ack_wait_multiplier = 10;
debug.topology_refresh_rate_ms = BigInt(60000); debug.topology_refresh_rate_ms = BigInt(60000)
const preferredGateway = "336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9"; const preferredGateway = "336yuXAeGEgedRfqTJZsG2YV7P13QH1bHv1SjCZYarc9";
const validator = "https://qwerty-validator-api.qa.nymte.ch/api"; const validator = 'https://qwerty-validator-api.qa.nymte.ch/api';
const config = new Config("my-awesome-wasm-client", validator, debug); const config = new Config('my-awesome-wasm-client', validator, debug);
const onMessageHandler = (message) => { const onMessageHandler = (message) => {
console.log(message); console.log(message);
self.postMessage({
kind: 'ReceiveMessage',
args: {
message,
},
});
};
console.log('Instantiating WASM client...');
let localClient = await new NymClient(config, onMessageHandler)
console.log('WASM client running!');
const selfAddress = localClient.self_address();
// set the global (I guess we don't have to anymore?)
client = localClient;
console.log(`Client address is ${selfAddress}`);
self.postMessage({ self.postMessage({
kind: "ReceiveMessage", kind: 'Ready',
args: { args: {
message, selfAddress,
}, },
}); });
};
console.log("Instantiating WASM client..."); // Set callback to handle messages passed to the worker.
self.onmessage = async event => {
let localClient = await new NymClient(config, onMessageHandler); console.log(event)
console.log("WASM client running!"); if (event.data && event.data.kind) {
switch (event.data.kind) {
const selfAddress = localClient.self_address(); case 'SendMessage': {
const {message, recipient} = event.data.args;
// set the global (I guess we don't have to anymore?) let uint8Array = new TextEncoder().encode(message);
client = localClient; await client.send_regular_message(uint8Array, recipient);
break;
console.log(`Client address is ${selfAddress}`); }
self.postMessage({ }
kind: "Ready",
args: {
selfAddress,
},
});
// Set callback to handle messages passed to the worker.
self.onmessage = async (event) => {
console.log(event);
if (event.data && event.data.kind) {
switch (event.data.kind) {
case "SendMessage": {
const { message, recipient } = event.data.args;
let uint8Array = new TextEncoder().encode(message);
await client.send_regular_message(uint8Array, recipient);
break;
} }
} };
}
};
} }
async function messWithStorage() { async function messWithStorage() {
self.onmessage = async (event) => { self.onmessage = async event => {
if (event.data && event.data.kind) { if (event.data && event.data.kind) {
switch (event.data.kind) { switch (event.data.kind) {
case "TestPacket": { case 'TestPacket': {
const { mixnodeIdentity } = event.data.args; const { mixnodeIdentity } = event.data.args;
console.log("button clicked...", mixnodeIdentity); console.log("button clicked...", mixnodeIdentity);
let id1 = "one"; let id1 = "one";
let id2 = "two"; let id2 = "two";
console.log("making store1 NO-ENC"); console.log("making store1 NO-ENC");
let _storage1 = await ClientStorage.new_unencrypted(id1); let _storage1 = await ClientStorage.new_unencrypted(id1);
console.log("making store2 ENC"); console.log("making store2 ENC")
let _storage2 = await new ClientStorage(id2, "my-secret-password"); let _storage2 = await new ClientStorage(id2, "my-secret-password");
// //
// //
// //
// console.log("attempting to use store1 WITH PASSWORD") // console.log("attempting to use store1 WITH PASSWORD")
// let _storage1_alt = await new ClientStorage(id1, "password"); // let _storage1_alt = await new ClientStorage(id1, "password");
// //
// //
// //
// console.log("attempting to use store2 WITHOUT PASSWORD") // console.log("attempting to use store2 WITHOUT PASSWORD")
// let _storage2_alt = await ClientStorage.new_unencrypted(id2); // let _storage2_alt = await ClientStorage.new_unencrypted(id2);
// //
// //
// //
// console.log("attempting to use store2 with WRONG PASSWORD") // console.log("attempting to use store2 with WRONG PASSWORD")
// let _storage2_bad = await new ClientStorage(id2, "bad-password") // let _storage2_bad = await new ClientStorage(id2, "bad-password")
//
// console.log("read1: ", await storage1.read()); //
// console.log("read2: ", await storage2.read()); // console.log("read1: ", await storage1.read());
// // console.log("read2: ", await storage2.read());
// console.log("store1: ", await storage1.store("FOOMP")); //
// // console.log("store1: ", await storage1.store("FOOMP"));
// console.log("read1: ", await storage1.read()); //
// console.log("read2: ", await storage2.read()); // console.log("read1: ", await storage1.read());
// console.log("read2: ", await storage2.read());
}
}
} }
} };
}
};
} }
async function main() { async function main() {
// load WASM package // load WASM package
await wasm_bindgen("nym_client_wasm_bg.wasm"); await wasm_bindgen('nym_client_wasm_bg.wasm');
console.log("Loaded WASM"); console.log('Loaded WASM');
// sets up better stack traces in case of in-rust panics // sets up better stack traces in case of in-rust panics
set_panic_hook(); set_panic_hook();
// show reconnection capabilities // show reconnection capabilities
// await testerReconnection() // await testerReconnection()
// run test on simplified and dedicated tester: // run test on simplified and dedicated tester:
await testWithTester(); await testWithTester()
// 'Normal' client setup (to send 'normal' messages) // hook-up the whole client for testing
// await normalNymClientUsage() // await testWithNymClient()
// 'Normal' client setup (to send 'normal' messages)
// await normalNymClientUsage()
} }
// Let's get started! // Let's get started!
main(); main();
+1 -1
View File
@@ -4,7 +4,7 @@
// due to expansion of #[wasm_bindgen] macro on `Debug` Config struct // due to expansion of #[wasm_bindgen] macro on `Debug` Config struct
#![allow(clippy::drop_non_drop)] #![allow(clippy::drop_non_drop)]
// another issue due to #[wasm_bindgen] and `Copy` trait // another issue due to #[wasm_bindgen] and `Copy` trait
#![allow(dropping_copy_types)] #![allow(clippy::drop_copy)]
use nym_client_core::config::{ use nym_client_core::config::{
Acknowledgements as ConfigAcknowledgements, Config as BaseClientConfig, Acknowledgements as ConfigAcknowledgements, Config as BaseClientConfig,
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::storage::error::ClientStorageError; use crate::storage::errors::ClientStorageError;
use crate::topology::WasmTopologyError; use crate::topology::WasmTopologyError;
use js_sys::Promise; use js_sys::Promise;
use nym_client_core::config::GatewayEndpointConfig; use nym_client_core::config::GatewayEndpointConfig;
+2 -2
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config; use crate::client::config::Config;
use crate::storage::error::ClientStorageError; use crate::storage::errors::ClientStorageError;
use js_sys::Promise; use js_sys::Promise;
use nym_client_core::client::base_client::storage::gateway_details::PersistedGatewayDetails; use nym_client_core::client::base_client::storage::gateway_details::PersistedGatewayDetails;
use nym_crypto::asymmetric::{encryption, identity}; use nym_crypto::asymmetric::{encryption, identity};
@@ -15,7 +15,7 @@ use wasm_utils::storage::{IdbVersionChangeEvent, WasmStorage};
use wasm_utils::PromisableResult; use wasm_utils::PromisableResult;
use zeroize::Zeroizing; use zeroize::Zeroizing;
pub(crate) mod error; pub(crate) mod errors;
pub(crate) mod traits; pub(crate) mod traits;
const STORAGE_NAME_PREFIX: &str = "wasm-client-storage"; const STORAGE_NAME_PREFIX: &str = "wasm-client-storage";
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::storage::error::ClientStorageError; use crate::storage::errors::ClientStorageError;
use crate::storage::ClientStorage; use crate::storage::ClientStorage;
use async_trait::async_trait; use async_trait::async_trait;
use nym_client_core::client::base_client::storage::gateway_details::{ use nym_client_core::client::base_client::storage::gateway_details::{
+1 -1
View File
@@ -101,7 +101,7 @@ impl AsyncFileWatcher {
} }
let Some(filters) = &self.filters else { let Some(filters) = &self.filters else {
return true; return true
}; };
for filter in filters { for filter in filters {
@@ -153,7 +153,7 @@ impl LoopCoverTrafficStream<OsRng> {
fn loop_cover_message_size(&mut self) -> PacketSize { fn loop_cover_message_size(&mut self) -> PacketSize {
let Some(secondary_packet_size) = self.secondary_packet_size else { let Some(secondary_packet_size) = self.secondary_packet_size else {
return self.primary_packet_size; return self.primary_packet_size
}; };
let use_primary = self let use_primary = self
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::client::inbound_messages::{InputMessage, InputMessageReceiver}; use crate::client::inbound_messages::{InputMessage, InputMessageReceiver};
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use super::{ use super::{
@@ -224,7 +224,7 @@ where
// if secondary packet was never set, then it's obvious we have to use the primary packet // if secondary packet was never set, then it's obvious we have to use the primary packet
let Some(secondary_packet) = self.config.secondary_packet_size else { let Some(secondary_packet) = self.config.secondary_packet_size else {
trace!("only primary packet size is available"); trace!("only primary packet size is available");
return self.config.primary_packet_size; return self.config.primary_packet_size
}; };
let primary_count = let primary_count =
@@ -200,7 +200,7 @@ where
fn loop_cover_message_size(&mut self) -> PacketSize { fn loop_cover_message_size(&mut self) -> PacketSize {
let Some(secondary_packet_size) = self.config.traffic.secondary_packet_size else { let Some(secondary_packet_size) = self.config.traffic.secondary_packet_size else {
return self.config.traffic.primary_packet_size; return self.config.traffic.primary_packet_size
}; };
let use_primary = self let use_primary = self
@@ -727,11 +727,7 @@ where
continue; continue;
} }
let Some(last_received) = self let Some(last_received) = self.full_reply_storage.surbs_storage_ref().surbs_last_received_at(pending_reply_target) else {
.full_reply_storage
.surbs_storage_ref()
.surbs_last_received_at(pending_reply_target)
else {
error!("we have {} pending replies for {pending_reply_target}, but we somehow never received any reply surbs from them!", vals.total_size()); error!("we have {} pending replies for {pending_reply_target}, but we somehow never received any reply surbs from them!", vals.total_size());
to_remove.push(*pending_reply_target); to_remove.push(*pending_reply_target);
continue; continue;
@@ -815,8 +811,7 @@ where
// this should never ever happen (famous last words, eh?), but in case it DOES happen eventually // this should never ever happen (famous last words, eh?), but in case it DOES happen eventually
// purge that malformed data // purge that malformed data
let Ok(sent_at) = OffsetDateTime::from_unix_timestamp(reply_key.sent_at_timestamp) let Ok(sent_at) = OffsetDateTime::from_unix_timestamp(reply_key.sent_at_timestamp) else {
else {
error!("somehow our stored timestamp ({}) for one of our reply key is corrupted!. Going to remove all the entry", reply_key.sent_at_timestamp); error!("somehow our stored timestamp ({}) for one of our reply key is corrupted!. Going to remove all the entry", reply_key.sent_at_timestamp);
to_remove_keys.push(*digest); to_remove_keys.push(*digest);
continue; continue;
@@ -180,7 +180,7 @@ impl<T> TransmissionBuffer<T> {
while items.len() < n { while items.len() < n {
let Some(next) = self.pop_next_message_at_random(rng) else { let Some(next) = self.pop_next_message_at_random(rng) else {
break; break
}; };
items.push(next) items.push(next)
} }
+4 -36
View File
@@ -137,46 +137,14 @@ impl Config {
self self
} }
pub fn set_no_cover_traffic(&mut self) {
self.debug.cover_traffic.disable_loop_cover_traffic_stream = true;
self.debug.traffic.disable_main_poisson_packet_distribution = true;
}
pub fn with_disabled_cover_traffic_with_keepalive(mut self, disabled: bool) -> Self {
if disabled {
self.set_no_cover_traffic_with_keepalive()
}
self
}
pub fn set_no_cover_traffic_with_keepalive(&mut self) {
self.debug.traffic.disable_main_poisson_packet_distribution = true;
self.debug.cover_traffic.loop_cover_traffic_average_delay = Duration::from_secs(5);
}
pub fn with_disabled_topology_refresh(mut self, disable_topology_refresh: bool) -> Self { pub fn with_disabled_topology_refresh(mut self, disable_topology_refresh: bool) -> Self {
self.debug.topology.disable_refreshing = disable_topology_refresh; self.debug.topology.disable_refreshing = disable_topology_refresh;
self self
} }
pub fn with_no_per_hop_delays(mut self, no_per_hop_delays: bool) -> Self { pub fn set_no_cover_traffic(&mut self) {
if no_per_hop_delays { self.debug.cover_traffic.disable_loop_cover_traffic_stream = true;
self.set_no_per_hop_delays() self.debug.traffic.disable_main_poisson_packet_distribution = true;
}
self
}
pub fn set_no_per_hop_delays(&mut self) {
self.debug.traffic.average_packet_delay = Duration::ZERO;
self.debug.acknowledgements.average_ack_delay = Duration::ZERO;
}
pub fn with_secondary_packet_size(mut self, secondary_packet_size: Option<PacketSize>) -> Self {
self.set_secondary_packet_size(secondary_packet_size);
self
}
pub fn set_secondary_packet_size(&mut self, secondary_packet_size: Option<PacketSize>) {
self.debug.traffic.secondary_packet_size = secondary_packet_size;
} }
pub fn set_custom_version(&mut self, version: &str) { pub fn set_custom_version(&mut self, version: &str) {
@@ -314,7 +282,7 @@ impl Client {
} }
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Serialize)] #[derive(Debug, Clone, Copy, Deserialize, PartialEq, Serialize)]
#[serde(default, deny_unknown_fields)] #[serde(default)]
pub struct Traffic { pub struct Traffic {
/// The parameter of Poisson distribution determining how long, on average, /// The parameter of Poisson distribution determining how long, on average,
/// sent packet is going to be delayed at any given mix node. /// sent packet is going to be delayed at any given mix node.
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::error::GatewayClientError; use crate::error::GatewayClientError;
@@ -41,7 +41,7 @@ nym-api-requests = { path = "../../../nym-api/nym-api-requests" }
async-trait = { workspace = true, optional = true } async-trait = { workspace = true, optional = true }
bip39 = { workspace = true, features = ["rand"], optional = true } bip39 = { workspace = true, features = ["rand"], optional = true }
nym-config = { path = "../../config", optional = true } nym-config = { path = "../../config", optional = true }
cosmrs = { workspace = true, features = ["rpc", "bip32", "cosmwasm"], optional = true } cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support", features = ["rpc", "bip32", "cosmwasm"], optional = true }
# note that this has the same version as used by cosmrs # note that this has the same version as used by cosmrs
eyre = { version = "0.6", optional = true } eyre = { version = "0.6", optional = true }
cw3 = { workspace = true, optional = true } cw3 = { workspace = true, optional = true }
@@ -55,7 +55,7 @@ cosmwasm-std = { workspace = true, optional = true }
[dev-dependencies] [dev-dependencies]
bip39 = { workspace = true } bip39 = { workspace = true }
cosmrs = { workspace = true, features = ["rpc", "bip32"] } cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support", features = ["rpc", "bip32"] }
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] } tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
ts-rs = "6.1.2" ts-rs = "6.1.2"
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::{nym_api, ValidatorClientError}; use crate::{nym_api, ValidatorClientError};
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::nym_api::error::NymAPIError; use crate::nym_api::error::NymAPIError;
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// TODO: There's a significant argument to pull those out of the package and make a PR on https://github.com/cosmos/cosmos-rust/ // TODO: There's a significant argument to pull those out of the package and make a PR on https://github.com/cosmos/cosmos-rust/
@@ -127,13 +127,46 @@ impl GasAdjustable for Gas {
mod sealed { mod sealed {
use cosmrs::tx::{self, Gas}; use cosmrs::tx::{self, Gas};
use cosmrs::Coin as CosmosCoin; use cosmrs::Coin as CosmosCoin;
use cosmrs::{AccountId, Denom as CosmosDenom}; use cosmrs::{AccountId, Decimal as CosmosDecimal, Denom as CosmosDenom};
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
fn cosmos_denom_inner_getter(val: &CosmosDenom) -> String {
val.as_ref().to_string()
}
#[derive(Serialize, Deserialize)]
#[serde(remote = "CosmosDenom")]
struct Denom(#[serde(getter = "cosmos_denom_inner_getter")] String);
impl From<Denom> for CosmosDenom {
fn from(val: Denom) -> Self {
val.0.parse().unwrap()
}
}
fn cosmos_decimal_inner_getter(val: &CosmosDecimal) -> u64 {
// haha, this code is so disgusting. I'll make a PR on cosmrs to slightly alleviate those issues...
// note: unwrap here is fine as the to_string is just returning a stringified u64 which, well, is a valid u64
val.to_string().parse().unwrap()
}
// at the time of writing it the current cosmrs' Decimal is extremely limited...
#[derive(Serialize, Deserialize)]
#[serde(remote = "CosmosDecimal")]
struct Decimal(#[serde(getter = "cosmos_decimal_inner_getter")] u64);
impl From<Decimal> for CosmosDecimal {
fn from(val: Decimal) -> Self {
val.0.into()
}
}
#[derive(Serialize, Deserialize, Clone)] #[derive(Serialize, Deserialize, Clone)]
struct Coin { struct Coin {
#[serde(with = "Denom")]
denom: CosmosDenom, denom: CosmosDenom,
amount: u128, #[serde(with = "Decimal")]
amount: CosmosDecimal,
} }
impl From<Coin> for CosmosCoin { impl From<Coin> for CosmosCoin {
@@ -39,7 +39,7 @@ pub use cosmrs::tendermint::validator::Info as TendermintValidatorInfo;
pub use cosmrs::tendermint::Time as TendermintTime; pub use cosmrs::tendermint::Time as TendermintTime;
pub use cosmrs::tx::{self, Gas}; pub use cosmrs::tx::{self, Gas};
pub use cosmrs::Coin as CosmosCoin; pub use cosmrs::Coin as CosmosCoin;
pub use cosmrs::{bip32, AccountId, Denom}; pub use cosmrs::{bip32, AccountId, Decimal, Denom};
use cosmwasm_std::Addr; use cosmwasm_std::Addr;
pub use cosmwasm_std::Coin as CosmWasmCoin; pub use cosmwasm_std::Coin as CosmWasmCoin;
pub use fee::{gas_price::GasPrice, GasAdjustable, GasAdjustment}; pub use fee::{gas_price::GasPrice, GasAdjustable, GasAdjustment};
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// TODO: expose query-related capabilities to wasm client... // TODO: expose query-related capabilities to wasm client...
@@ -4,7 +4,7 @@ use nym_contracts_common::ContractBuildInformation;
use nym_name_service_common::{ use nym_name_service_common::{
msg::QueryMsg as NameQueryMsg, msg::QueryMsg as NameQueryMsg,
response::{ConfigResponse, NamesListResponse, PagedNamesListResponse}, response::{ConfigResponse, NamesListResponse, PagedNamesListResponse},
Address, NameId, RegisteredName, Address, NameEntry, NameId,
}; };
use serde::Deserialize; use serde::Deserialize;
@@ -21,7 +21,7 @@ pub trait NameServiceQueryClient {
.await .await
} }
async fn get_name_entry(&self, name_id: NameId) -> Result<RegisteredName, NyxdError> { async fn get_name_entry(&self, name_id: NameId) -> Result<NameEntry, NyxdError> {
self.query_name_service_contract(NameQueryMsg::NameId { name_id }) self.query_name_service_contract(NameQueryMsg::NameId { name_id })
.await .await
} }
@@ -54,14 +54,14 @@ pub trait NameServiceQueryClient {
.await .await
} }
async fn get_all_names(&self) -> Result<Vec<RegisteredName>, NyxdError> { async fn get_all_names(&self) -> Result<Vec<NameEntry>, NyxdError> {
let mut services = Vec::new(); let mut services = Vec::new();
let mut start_after = None; let mut start_after = None;
loop { loop {
let mut paged_response = self.get_names_paged(start_after.take(), None).await?; let mut paged_response = self.get_names_paged(start_after.take(), None).await?;
let last_id = paged_response.names.last().map(|serv| serv.id); let last_id = paged_response.names.last().map(|serv| serv.name_id);
services.append(&mut paged_response.names); services.append(&mut paged_response.names);
if let Some(start_after_res) = last_id { if let Some(start_after_res) = last_id {
@@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use async_trait::async_trait; use async_trait::async_trait;
use nym_contracts_common::signing::MessageSignature; use nym_name_service_common::{msg::ExecuteMsg as NameExecuteMsg, Address, NameId, NymName};
use nym_name_service_common::{msg::ExecuteMsg as NameExecuteMsg, NameDetails, NameId, NymName};
use crate::nyxd::{ use crate::nyxd::{
coin::Coin, cosmwasm_client::types::ExecuteResult, error::NyxdError, Fee, NyxdClient, coin::Coin, cosmwasm_client::types::ExecuteResult, error::NyxdError, Fee, NyxdClient,
@@ -21,17 +20,14 @@ pub trait NameServiceSigningClient {
async fn register_name( async fn register_name(
&self, &self,
name: NameDetails, name: NymName,
owner_signature: MessageSignature, address: Address,
deposit: Coin, deposit: Coin,
fee: Option<Fee>, fee: Option<Fee>,
) -> Result<ExecuteResult, NyxdError> { ) -> Result<ExecuteResult, NyxdError> {
self.execute_name_service_contract( self.execute_name_service_contract(
fee, fee,
NameExecuteMsg::Register { NameExecuteMsg::Register { name, address },
name,
owner_signature,
},
vec![deposit], vec![deposit],
) )
.await .await
+2 -2
View File
@@ -14,7 +14,7 @@ clap = { version = "4.0", features = ["derive"] }
cw-utils = { workspace = true } cw-utils = { workspace = true }
handlebars = "3.0.1" handlebars = "3.0.1"
humantime-serde = "1.0" humantime-serde = "1.0"
k256 = { workspace = true, features = ["ecdsa", "sha256"] } k256 = { version = "0.10", features = ["ecdsa", "sha256"] }
log = { workspace = true } log = { workspace = true }
rand = {version = "0.6", features = ["std"] } rand = {version = "0.6", features = ["std"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
@@ -25,7 +25,7 @@ toml = "0.5.6"
url = "2.2" url = "2.2"
tap = "1" tap = "1"
cosmrs = { workspace = true } cosmrs = { git = "https://github.com/neacsu/cosmos-rust", branch = "neacsu/feegrant_support" }
cosmwasm-std = { workspace = true } cosmwasm-std = { workspace = true }
nym-validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"] } nym-validator-client = { path = "../client-libs/validator-client", features = ["nyxd-client"] }
@@ -56,8 +56,6 @@ pub async fn generate(args: Args) {
.expect("threshold can't be converted to Decimal"), .expect("threshold can't be converted to Decimal"),
}, },
max_voting_period: Duration::Time(args.max_voting_period), max_voting_period: Duration::Time(args.max_voting_period),
executor: None,
proposal_deposit: None,
coconut_bandwidth_contract_address: coconut_bandwidth_contract_address.to_string(), coconut_bandwidth_contract_address: coconut_bandwidth_contract_address.to_string(),
coconut_dkg_contract_address: coconut_dkg_contract_address.to_string(), coconut_dkg_contract_address: coconut_dkg_contract_address.to_string(),
}; };
@@ -35,14 +35,9 @@ pub async fn create_family_join_permit_sign_payload(args: Args, client: QueryCli
info!("Create family join permit sign payload"); info!("Create family join permit sign payload");
// get the address of our mixnode to recover the family head information // get the address of our mixnode to recover the family head information
let Some(mixnode) = client let Some(mixnode) = client.get_owned_mixnode(&args.address).await.unwrap().mixnode_details else {
.get_owned_mixnode(&args.address)
.await
.unwrap()
.mixnode_details
else {
eprintln!("{} does not seem to even own a mixnode!", args.address); eprintln!("{} does not seem to even own a mixnode!", args.address);
return; return
}; };
// make sure this mixnode is actually a family head // make sure this mixnode is actually a family head
@@ -1,7 +1,6 @@
use clap::Parser; use clap::Parser;
use log::{error, info}; use log::{error, info};
use nym_contracts_common::signing::MessageSignature; use nym_name_service_common::{Address, Coin, NymName};
use nym_name_service_common::{Address, Coin, NameDetails, NymName};
use nym_validator_client::nyxd::{error::NyxdError, traits::NameServiceSigningClient}; use nym_validator_client::nyxd::{error::NyxdError, traits::NameServiceSigningClient};
use tap::TapFallible; use tap::TapFallible;
@@ -17,15 +16,9 @@ pub struct Args {
#[clap(long)] #[clap(long)]
pub nym_address: String, pub nym_address: String,
#[clap(long)]
pub signature: MessageSignature,
/// Deposit to be made to the service provider directory, in curent DENOMINATION (e.g. 'unym') /// Deposit to be made to the service provider directory, in curent DENOMINATION (e.g. 'unym')
#[clap(long)] #[clap(long)]
pub deposit: u128, pub deposit: u128,
#[clap(long)]
pub identity_key: String,
} }
pub async fn register(args: Args, client: SigningClient) -> Result<(), NyxdError> { pub async fn register(args: Args, client: SigningClient) -> Result<(), NyxdError> {
@@ -36,17 +29,12 @@ pub async fn register(args: Args, client: SigningClient) -> Result<(), NyxdError
let name = NymName::new(&args.name).expect("invalid name"); let name = NymName::new(&args.name).expect("invalid name");
let address = Address::new(&args.nym_address); let address = Address::new(&args.nym_address);
let name = NameDetails {
name,
address,
identity_key: args.identity_key,
};
let denom = client.current_chain_details().mix_denom.base.as_str(); let denom = client.current_chain_details().mix_denom.base.as_str();
let deposit = Coin::new(args.deposit, denom); let deposit = Coin::new(args.deposit, denom);
let res = client let res = client
.register_name(name, args.signature, deposit.into(), None) .register_name(name, address, deposit.into(), None)
.await .await
.tap_err(|err| error!("Failed to register name: {err:#?}"))?; .tap_err(|err| error!("Failed to register name: {err:#?}"))?;
@@ -34,8 +34,8 @@ pub async fn query(args: Args, client: &QueryClientWithNyxd) {
table.set_header(vec!["Name Id", "Owner", "Nym Address", "Name"]); table.set_header(vec!["Name Id", "Owner", "Nym Address", "Name"]);
for name_entry in res.names { for name_entry in res.names {
table.add_row(vec![ table.add_row(vec![
name_entry.id.to_string(), name_entry.name_id.to_string(),
name_entry.owner.to_string(), name_entry.name.owner.to_string(),
name_entry.name.address.to_string(), name_entry.name.address.to_string(),
name_entry.name.name.to_string(), name_entry.name.name.to_string(),
]); ]);
@@ -14,7 +14,7 @@ pub struct InstantiateMsg {
pub mix_denom: String, pub mix_denom: String,
} }
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum ExecuteMsg { pub enum ExecuteMsg {
DepositFunds { data: DepositData }, DepositFunds { data: DepositData },
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
use crate::msg::ExecuteMsg; use crate::msg::ExecuteMsg;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct SpendCredentialData { pub struct SpendCredentialData {
funds: Coin, funds: Coin,
blinded_serial_number: String, blinded_serial_number: String,
@@ -43,7 +43,7 @@ pub enum SpendCredentialStatus {
Spent, Spent,
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct SpendCredential { pub struct SpendCredential {
funds: Coin, funds: Coin,
blinded_serial_number: String, blinded_serial_number: String,
@@ -74,7 +74,7 @@ impl SpendCredential {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedSpendCredentialResponse { pub struct PagedSpendCredentialResponse {
pub spend_credentials: Vec<SpendCredential>, pub spend_credentials: Vec<SpendCredential>,
pub per_page: usize, pub per_page: usize,
@@ -95,7 +95,7 @@ impl PagedSpendCredentialResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct SpendCredentialResponse { pub struct SpendCredentialResponse {
pub spend_credential: Option<SpendCredential>, pub spend_credential: Option<SpendCredential>,
} }
@@ -15,7 +15,7 @@ pub type Nonce = u32;
// define this type explicitly for [hopefully] better usability // define this type explicitly for [hopefully] better usability
// (so you wouldn't need to worry about whether you should use bytes, bs58, etc.) // (so you wouldn't need to worry about whether you should use bytes, bs58, etc.)
#[derive(Clone, Debug, PartialEq, Eq, JsonSchema)] #[derive(Clone, Debug, PartialEq, JsonSchema)]
pub struct MessageSignature(Vec<u8>); pub struct MessageSignature(Vec<u8>);
impl MessageSignature { impl MessageSignature {
@@ -6,8 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
cosmwasm-schema = { workspace = true }
cw4 = { workspace = true } cw4 = { workspace = true }
cw-controllers = { workspace = true }
schemars = "0.8" schemars = "0.8"
serde = { version = "1.0.103", default-features = false, features = ["derive"] } serde = { version = "1.0.103", default-features = false, features = ["derive"] }
@@ -1,7 +1,13 @@
use cosmwasm_schema::{cw_serde, QueryResponses}; // Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cw4::Member; use cw4::Member;
#[cw_serde] #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub struct InstantiateMsg { pub struct InstantiateMsg {
/// The admin is the only account that can update the group state. /// The admin is the only account that can update the group state.
/// Omit it to make the group immutable. /// Omit it to make the group immutable.
@@ -9,7 +15,8 @@ pub struct InstantiateMsg {
pub members: Vec<Member>, pub members: Vec<Member>,
} }
#[cw_serde] #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg { pub enum ExecuteMsg {
/// Change the admin /// Change the admin
UpdateAdmin { admin: Option<String> }, UpdateAdmin { admin: Option<String> },
@@ -25,24 +32,23 @@ pub enum ExecuteMsg {
RemoveHook { addr: String }, RemoveHook { addr: String },
} }
#[cw_serde] #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug)]
#[derive(QueryResponses)] #[serde(rename_all = "snake_case")]
pub enum QueryMsg { pub enum QueryMsg {
#[returns(cw_controllers::AdminResponse)] /// Return AdminResponse
Admin {}, Admin {},
#[returns(cw4::TotalWeightResponse)] /// Return TotalWeightResponse
TotalWeight { at_height: Option<u64> }, TotalWeight {},
#[returns(cw4::MemberListResponse)] /// Returns MembersListResponse
ListMembers { ListMembers {
start_after: Option<String>, start_after: Option<String>,
limit: Option<u32>, limit: Option<u32>,
}, },
#[returns(cw4::MemberResponse)] /// Returns MemberResponse
Member { Member {
addr: String, addr: String,
at_height: Option<u64>, at_height: Option<u64>,
}, },
/// Shows all registered hooks. /// Shows all registered hooks. Returns HooksResponse.
#[returns(cw_controllers::HooksResponse)]
Hooks {}, Hooks {},
} }
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// due to code generated by JsonSchema // due to code generated by JsonSchema
@@ -37,7 +37,7 @@ pub fn generate_owner_storage_subkey(
} }
} }
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)]
pub struct Delegation { pub struct Delegation {
/// Address of the owner of this delegation. /// Address of the owner of this delegation.
pub owner: Addr, pub owner: Addr,
@@ -114,7 +114,7 @@ impl Delegation {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedMixNodeDelegationsResponse { pub struct PagedMixNodeDelegationsResponse {
pub delegations: Vec<Delegation>, pub delegations: Vec<Delegation>,
pub start_next_after: Option<OwnerProxySubKey>, pub start_next_after: Option<OwnerProxySubKey>,
@@ -129,7 +129,7 @@ impl PagedMixNodeDelegationsResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedDelegatorDelegationsResponse { pub struct PagedDelegatorDelegationsResponse {
pub delegations: Vec<Delegation>, pub delegations: Vec<Delegation>,
pub start_next_after: Option<(MixId, OwnerProxySubKey)>, pub start_next_after: Option<(MixId, OwnerProxySubKey)>,
@@ -147,7 +147,7 @@ impl PagedDelegatorDelegationsResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixNodeDelegationResponse { pub struct MixNodeDelegationResponse {
pub delegation: Option<Delegation>, pub delegation: Option<Delegation>,
pub mixnode_still_bonded: bool, pub mixnode_still_bonded: bool,
@@ -162,7 +162,7 @@ impl MixNodeDelegationResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedAllDelegationsResponse { pub struct PagedAllDelegationsResponse {
pub delegations: Vec<Delegation>, pub delegations: Vec<Delegation>,
pub start_next_after: Option<StorageKey>, pub start_next_after: Option<StorageKey>,
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// due to code generated by JsonSchema // due to code generated by JsonSchema
@@ -23,7 +23,7 @@ pub struct Gateway {
pub version: String, pub version: String,
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct GatewayBond { pub struct GatewayBond {
pub pledge_amount: Coin, pub pledge_amount: Coin,
pub owner: Addr, pub owner: Addr,
@@ -132,7 +132,7 @@ impl GatewayConfigUpdate {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedGatewayResponse { pub struct PagedGatewayResponse {
pub nodes: Vec<GatewayBond>, pub nodes: Vec<GatewayBond>,
pub per_page: usize, pub per_page: usize,
@@ -153,13 +153,13 @@ impl PagedGatewayResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct GatewayOwnershipResponse { pub struct GatewayOwnershipResponse {
pub address: Addr, pub address: Addr,
pub gateway: Option<GatewayBond>, pub gateway: Option<GatewayBond>,
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct GatewayBondResponse { pub struct GatewayBondResponse {
pub identity: IdentityKey, pub identity: IdentityKey,
pub gateway: Option<GatewayBond>, pub gateway: Option<GatewayBond>,
@@ -489,7 +489,7 @@ impl CurrentIntervalResponse {
} }
} }
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct PendingEpochEventsResponse { pub struct PendingEpochEventsResponse {
pub seconds_until_executable: i64, pub seconds_until_executable: i64,
pub events: Vec<PendingEpochEvent>, pub events: Vec<PendingEpochEvent>,
@@ -510,7 +510,7 @@ impl PendingEpochEventsResponse {
} }
} }
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct PendingIntervalEventsResponse { pub struct PendingIntervalEventsResponse {
pub seconds_until_executable: i64, pub seconds_until_executable: i64,
pub events: Vec<PendingIntervalEvent>, pub events: Vec<PendingIntervalEvent>,
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// due to code generated by JsonSchema // due to code generated by JsonSchema
@@ -33,7 +33,7 @@ impl RewardedSetNodeStatus {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixNodeDetails { pub struct MixNodeDetails {
pub bond_information: MixNodeBond, pub bond_information: MixNodeBond,
pub rewarding_details: MixNodeRewarding, pub rewarding_details: MixNodeRewarding,
@@ -86,9 +86,9 @@ impl MixNodeDetails {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixNodeRewarding { pub struct MixNodeRewarding {
/// Information provided by the operator that influence the cost function. /// Information provided by the operator that influence the cost function.
pub cost_params: MixNodeCostParams, pub cost_params: MixNodeCostParams,
/// Total pledge and compounded reward earned by the node operator. /// Total pledge and compounded reward earned by the node operator.
@@ -465,7 +465,7 @@ impl MixNodeRewarding {
} }
// operator information + data assigned by the contract(s) // operator information + data assigned by the contract(s)
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixNodeBond { pub struct MixNodeBond {
/// Unique id assigned to the bonded mixnode. /// Unique id assigned to the bonded mixnode.
pub mix_id: MixId, pub mix_id: MixId,
@@ -559,7 +559,7 @@ pub struct MixNode {
pub version: String, pub version: String,
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixNodeCostParams { pub struct MixNodeCostParams {
pub profit_margin_percent: Percent, pub profit_margin_percent: Percent,
@@ -686,7 +686,7 @@ impl MixNodeConfigUpdate {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedMixnodeBondsResponse { pub struct PagedMixnodeBondsResponse {
pub nodes: Vec<MixNodeBond>, pub nodes: Vec<MixNodeBond>,
pub per_page: usize, pub per_page: usize,
@@ -703,7 +703,7 @@ impl PagedMixnodeBondsResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct PagedMixnodesDetailsResponse { pub struct PagedMixnodesDetailsResponse {
pub nodes: Vec<MixNodeDetails>, pub nodes: Vec<MixNodeDetails>,
pub per_page: usize, pub per_page: usize,
@@ -745,19 +745,19 @@ impl PagedUnbondedMixnodesResponse {
} }
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixOwnershipResponse { pub struct MixOwnershipResponse {
pub address: Addr, pub address: Addr,
pub mixnode_details: Option<MixNodeDetails>, pub mixnode_details: Option<MixNodeDetails>,
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixnodeDetailsResponse { pub struct MixnodeDetailsResponse {
pub mix_id: MixId, pub mix_id: MixId,
pub mixnode_details: Option<MixNodeDetails>, pub mixnode_details: Option<MixNodeDetails>,
} }
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, JsonSchema)] #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)]
pub struct MixnodeRewardingDetailsResponse { pub struct MixnodeRewardingDetailsResponse {
pub mix_id: MixId, pub mix_id: MixId,
pub rewarding_details: Option<MixNodeRewarding>, pub rewarding_details: Option<MixNodeRewarding>,
@@ -1,4 +1,4 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net> // Copyright 2021-2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use crate::delegation::OwnerProxySubKey; use crate::delegation::OwnerProxySubKey;
@@ -7,19 +7,19 @@ use crate::{BlockHeight, EpochEventId, IntervalEventId, MixId};
use cosmwasm_std::{Addr, Coin}; use cosmwasm_std::{Addr, Coin};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct PendingEpochEvent { pub struct PendingEpochEvent {
pub id: EpochEventId, pub id: EpochEventId,
pub event: PendingEpochEventData, pub event: PendingEpochEventData,
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct PendingEpochEventData { pub struct PendingEpochEventData {
pub created_at: BlockHeight, pub created_at: BlockHeight,
pub kind: PendingEpochEventKind, pub kind: PendingEpochEventKind,
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub enum PendingEpochEventKind { pub enum PendingEpochEventKind {
// can't just pass the `Delegation` struct here as it's impossible to determine // can't just pass the `Delegation` struct here as it's impossible to determine
// `cumulative_reward_ratio` ahead of time // `cumulative_reward_ratio` ahead of time
@@ -68,19 +68,19 @@ impl From<(EpochEventId, PendingEpochEventData)> for PendingEpochEvent {
} }
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct PendingIntervalEvent { pub struct PendingIntervalEvent {
pub id: IntervalEventId, pub id: IntervalEventId,
pub event: PendingIntervalEventData, pub event: PendingIntervalEventData,
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct PendingIntervalEventData { pub struct PendingIntervalEventData {
pub created_at: BlockHeight, pub created_at: BlockHeight,
pub kind: PendingIntervalEventKind, pub kind: PendingIntervalEventKind,
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub enum PendingIntervalEventKind { pub enum PendingIntervalEventKind {
ChangeMixCostParams { ChangeMixCostParams {
mix_id: MixId, mix_id: MixId,

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