Compare commits
387 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bdcf9c3cf | |||
| 4ebb9cd239 | |||
| 620d68ea2f | |||
| b747308f74 | |||
| afdd721cc3 | |||
| 9f5c4c5968 | |||
| 9583a5c6c8 | |||
| da60fc0ade | |||
| 96b54c455e | |||
| cc983963d4 | |||
| 40d9321aec | |||
| e5a29cc76e | |||
| 56c55f6b95 | |||
| 2f051fd943 | |||
| c03cf86000 | |||
| ab11508235 | |||
| e65bfaeb31 | |||
| 5a6982fd10 | |||
| 7abe1f505c | |||
| 0ec2514edf | |||
| d6435a8270 | |||
| 9efc50e067 | |||
| 1532547e2b | |||
| 0cb11632e6 | |||
| f71ea52d5d | |||
| 338835698c | |||
| e65e261cd3 | |||
| 2d78f6939e | |||
| 9a45de5874 | |||
| 2f894b9be3 | |||
| d36ea20366 | |||
| 7b1200f338 | |||
| d291582128 | |||
| 9800411990 | |||
| 0e47b88dd8 | |||
| 795350ae8a | |||
| ac9a9827b9 | |||
| 15fd6a2212 | |||
| 85a93f59e8 | |||
| 0cb80d06a7 | |||
| 6d3ce3a1c9 | |||
| 4e65617f08 | |||
| e6d2cbbed7 | |||
| 18c6fd3e3e | |||
| 50c6ac0870 | |||
| 25326e5f9b | |||
| f37eb9db23 | |||
| c5b74353f3 | |||
| 871b54e314 | |||
| 5af6ee763c | |||
| dabbe8ba7f | |||
| 31f1037d44 | |||
| e675e3937a | |||
| 355991adc9 | |||
| 7d55d03925 | |||
| f455b7c720 | |||
| 20bc305fb9 | |||
| 72c54e0057 | |||
| d75c7eaaaf | |||
| 97fbd7db17 | |||
| 9a94e40b36 | |||
| 06b5347200 | |||
| 561203572d | |||
| 8f45649daa | |||
| fa879baeab | |||
| b6ab25a7aa | |||
| 0b6f652709 | |||
| ed2fbc588f | |||
| 9f80d95f75 | |||
| 9bcf48f7dc | |||
| 6446e43322 | |||
| 86eb06048a | |||
| 02dd16bcc6 | |||
| 14fd7c77d0 | |||
| e08e9fcb50 | |||
| 7964e6204b | |||
| 56fb46cd69 | |||
| 973d51eeec | |||
| 24773f68a4 | |||
| 083ee8386e | |||
| 3158a67445 | |||
| a26ba3d9f1 | |||
| b88bc188c6 | |||
| bccbc99448 | |||
| 5d445d6b47 | |||
| 435f236812 | |||
| ca4523025e | |||
| 01db51e492 | |||
| 3320da2060 | |||
| d04331a5df | |||
| 0713869666 | |||
| 27775a29c4 | |||
| 652f2db5c0 | |||
| a1c33bbae3 | |||
| 62c94d58e8 | |||
| 99cf7d1eec | |||
| 6717951037 | |||
| 1219dd9719 | |||
| e87b00bce5 | |||
| 11f6db5304 | |||
| c14481bb77 | |||
| 16edca21b0 | |||
| b68fca0efa | |||
| 1fc7e07028 | |||
| 8758bea17c | |||
| 845b5df14c | |||
| f786dbeaa7 | |||
| 9d8a686760 | |||
| 435d9d3115 | |||
| 275cd9ff92 | |||
| 8435cf91e5 | |||
| 3460ce70a3 | |||
| 0ddaf3b50b | |||
| a103acaf70 | |||
| 08aa0af562 | |||
| e333aca8a1 | |||
| 67462a9f47 | |||
| 493390d92b | |||
| eae76cce10 | |||
| 8113948f48 | |||
| 9341db5d08 | |||
| c3e3ef1737 | |||
| 45f4eeeff2 | |||
| f76d677f64 | |||
| 050a58affa | |||
| 065b3891f2 | |||
| 59da117e8f | |||
| 3d13274219 | |||
| 561566f3c4 | |||
| 6879c211ee | |||
| c7f2ef7074 | |||
| fb43e917cb | |||
| e79450a082 | |||
| 2e365026b7 | |||
| cd706aa67e | |||
| 304b192f52 | |||
| 8c979e3bac | |||
| 279b00d833 | |||
| 49fd0dc9e1 | |||
| 9a9d91cb4f | |||
| 5c08a89be3 | |||
| fd88776998 | |||
| 1339e20420 | |||
| 51b511b27e | |||
| 75a5192c6d | |||
| 25ad0920cf | |||
| a1e75e1dff | |||
| e59a9a59b6 | |||
| 27ac34522c | |||
| 5e0d1bb14e | |||
| c16746a47b | |||
| a21052b72e | |||
| 92e9da7be5 | |||
| 143b336978 | |||
| d4293c9bae | |||
| e2d1806e49 | |||
| 469f85fc49 | |||
| 4c51a8975c | |||
| 1202a2f5f4 | |||
| 6030bf6c95 | |||
| 09a771f58f | |||
| 676a909aee | |||
| e37145422c | |||
| 4ad52accc0 | |||
| 784fae2204 | |||
| 8aa5711bee | |||
| 07022314fc | |||
| 76c3081470 | |||
| d399161d31 | |||
| 27fb4ae0cc | |||
| 74392a2886 | |||
| 457c478a03 | |||
| 5e95992427 | |||
| d7eecd481c | |||
| e08fc4894b | |||
| a4c6f51fe0 | |||
| fabd48b7ea | |||
| 894e0bd1bf | |||
| f86e088663 | |||
| f76300669a | |||
| 333ace1f97 | |||
| 487bf6732e | |||
| 5d4a0fef55 | |||
| 1627146c0e | |||
| ae40a00b8f | |||
| 7f3c0470e0 | |||
| 1bc26ed79f | |||
| 60fa5cfeb8 | |||
| 3b7088aeea | |||
| 179d214e21 | |||
| 2a94ce6443 | |||
| 95ec91daa1 | |||
| 803850be74 | |||
| 2f267cf787 | |||
| 0d2418ef6a | |||
| 6f0c8dbe73 | |||
| 2198c1bd7b | |||
| be7f00fe52 | |||
| 35c94f5c4b | |||
| f5863b9668 | |||
| 963c54fea2 | |||
| db55a96f91 | |||
| 7c0235ab26 | |||
| 92af6f7024 | |||
| 7146c4c012 | |||
| 3dc62a9a60 | |||
| b3d7c26443 | |||
| 9efeef881a | |||
| 9d8369a5b2 | |||
| cc32eb3904 | |||
| 8cf4977021 | |||
| 2c2748832c | |||
| 114db3c1cf | |||
| a65df5a0ab | |||
| b6f07fbfce | |||
| c39d42b7dd | |||
| 21e9df488f | |||
| 94113206b2 | |||
| 71532484a9 | |||
| 8756763875 | |||
| 5753b79997 | |||
| 2a6aa13ecd | |||
| 9213e02b43 | |||
| ede4b23e8a | |||
| 2e95ea16f9 | |||
| d5c9e1d8cb | |||
| 0c955817fd | |||
| 87751894d9 | |||
| ec3c4fb1aa | |||
| 789221f144 | |||
| 5b925d8b68 | |||
| c8c3928575 | |||
| 2fa8da8117 | |||
| 4548ef4d05 | |||
| 7f147ee2b0 | |||
| 48bcd7e802 | |||
| 6598d677da | |||
| e736a01ecc | |||
| a708fa2d4a | |||
| a512217382 | |||
| 086611c7ac | |||
| 05d6652177 | |||
| 9c514fe3b7 | |||
| aad028be3f | |||
| 924160b3e7 | |||
| 23d14b60de | |||
| a4b47ef3a5 | |||
| 6db3b34bcb | |||
| f9383578da | |||
| 47303bcf48 | |||
| 60917ec9e7 | |||
| f616b3c15a | |||
| be2b44c46b | |||
| f6db1a87c6 | |||
| e8e86c273e | |||
| b67ad8c23e | |||
| f655fe81d2 | |||
| 86fa7024a2 | |||
| cbea1d554a | |||
| c08e7d2b11 | |||
| c3eb433960 | |||
| 4c5147390a | |||
| f70e8a3b9e | |||
| 5f7499604d | |||
| 8c021e9537 | |||
| f2d56882fe | |||
| 891fdeb4b5 | |||
| 12e8d3468b | |||
| 01221a8e8c | |||
| 58c74199d1 | |||
| eb98c1bf33 | |||
| d6393c1496 | |||
| 48dfc24c33 | |||
| 61eaffe91b | |||
| 63d0ab49e1 | |||
| 0f59fd4eee | |||
| 55694f0341 | |||
| c3aec2b01f | |||
| c023c8fb9f | |||
| 1162de3673 | |||
| 74252269bc | |||
| fe88321a50 | |||
| babc84779c | |||
| 7e40207d46 | |||
| 85758be9ca | |||
| dd70192508 | |||
| f884331284 | |||
| 45e6011961 | |||
| 04a2f59034 | |||
| 43b0b3eb37 | |||
| 27afe645c6 | |||
| 052dbeaef8 | |||
| fb0b9da14f | |||
| 230e4393c5 | |||
| b7baff1a79 | |||
| 18891e5f20 | |||
| f3fcef60c3 | |||
| ed7a84a1ce | |||
| 3c4bd13c2a | |||
| e76bb0db12 | |||
| 48e18684a2 | |||
| e76c8e06be | |||
| 858b6c6094 | |||
| 7b4dc78f41 | |||
| bb7a8e84e4 | |||
| 17bdb583b5 | |||
| 3300942529 | |||
| 4be5af0c40 | |||
| fa42cf8939 | |||
| d0b380cd99 | |||
| 51d1803ddd | |||
| 3d8520dfc7 | |||
| bf8d54b201 | |||
| 58c9a58a38 | |||
| abc6d61d84 | |||
| d094bb60c6 | |||
| bdf45cafb5 | |||
| a7910c1049 | |||
| 6b93309482 | |||
| 9a209c4f3d | |||
| 4d212f73fc | |||
| d7a7b643ef | |||
| c486a87824 | |||
| a0fea6edb4 | |||
| afc1b90b57 | |||
| 33b85a3ca1 | |||
| a3183ab313 | |||
| 3635cbdc8d | |||
| ff0ad976c6 | |||
| 74cd73a58f | |||
| dd89026065 | |||
| 07c80e5150 | |||
| c17f0ac3f8 | |||
| 7ae56b08b3 | |||
| ae7206e0c2 | |||
| 73fc2d6bb2 | |||
| a5289cd431 | |||
| ec0e1b67a0 | |||
| eafbed6c9f | |||
| 37d9f91922 | |||
| 5f21f8334b | |||
| 9378100957 | |||
| 4635db73f1 | |||
| 9a43d1079a | |||
| 279de8a09b | |||
| 3238722ade | |||
| b6c15deae6 | |||
| 8c250adcfd | |||
| 72306f1215 | |||
| dd695129dd | |||
| f1d97e5578 | |||
| 00aff01deb | |||
| c521ee6702 | |||
| 17686ddd9a | |||
| 40e72ce37a | |||
| 5498bee893 | |||
| 92a1fb514f | |||
| 519d999785 | |||
| d859ad0a51 | |||
| f2d354f6ec | |||
| 72c86ebe7c | |||
| 1ac262ec90 | |||
| a6ad6c7d49 | |||
| 7c1fca8ce4 | |||
| cbc977c491 | |||
| f40c05a34c | |||
| 776443131e | |||
| b5eab7f07f | |||
| eeeb4b3246 | |||
| e3e4dc6db9 | |||
| 461b7bcfb7 | |||
| bbf0d06583 | |||
| 6393d6093f | |||
| c0ea599913 | |||
| 16d09a35ba | |||
| e6c5eddbe5 | |||
| d473e8743e | |||
| 4957d9dbf2 | |||
| 96ead0b19e | |||
| 47a3c53cfb | |||
| 29bfd544f1 | |||
| eff725e8ec | |||
| 5743624948 | |||
| 07de1868ff | |||
| 6ea746e7f3 | |||
| 7722a7080c | |||
| bbe3917c8f |
@@ -0,0 +1,7 @@
|
|||||||
|
.git
|
||||||
|
.github
|
||||||
|
.gitignore
|
||||||
|
**/node_modules
|
||||||
|
**/target
|
||||||
|
dist
|
||||||
|
documentation
|
||||||
@@ -14,3 +14,20 @@ updates:
|
|||||||
prefix: build
|
prefix: build
|
||||||
prefix-development: chore
|
prefix-development: chore
|
||||||
include: scope
|
include: scope
|
||||||
|
# Update the root workspace (only). For now we don't include
|
||||||
|
# the contracts workspcae.
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
time: "09:00"
|
||||||
|
ignore:
|
||||||
|
- dependency-name: "cosmwasm-*"
|
||||||
|
- dependency-name: "cw*"
|
||||||
|
groups:
|
||||||
|
patch-updates:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- "patch"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
name: build-deb-meta
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: arc-ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Build Environment
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y make dpkg-dev
|
||||||
|
|
||||||
|
- name: Build Debian Packages
|
||||||
|
working-directory: ppa/packages
|
||||||
|
run: make
|
||||||
|
|
||||||
|
- name: Find .deb files
|
||||||
|
working-directory: ppa/packages
|
||||||
|
run: |
|
||||||
|
echo "file1=$(ls nym-repo-setup*.deb)" >> $GITHUB_ENV
|
||||||
|
echo "file2=$(ls nym-vpn*.deb)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Upload nym-repo-setup
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ env.file1 }}
|
||||||
|
path: ppa/packages/nym-repo-setup*.deb
|
||||||
|
retention-days: 10
|
||||||
|
|
||||||
|
- name: Upload nym-vpn
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ env.file2 }}
|
||||||
|
path: ppa/packages/nym-vpn*.deb
|
||||||
|
retention-days: 10
|
||||||
@@ -5,9 +5,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04-16-core
|
runs-on: arc-ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler git python3 && sudo apt-get update --fix-missing
|
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler git python3 && sudo apt-get update --fix-missing
|
||||||
- name: Install pip3
|
- name: Install pip3
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- name: Install rsync
|
- name: Install rsync
|
||||||
run: sudo apt-get install rsync
|
run: sudo apt-get install rsync
|
||||||
- uses: rlespinasse/github-slug-action@v3.x
|
- uses: rlespinasse/github-slug-action@v3.x
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
@@ -99,24 +99,3 @@ jobs:
|
|||||||
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||||
working-directory: dist/docs
|
working-directory: dist/docs
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
|
|
||||||
- name: Matrix - Node Install
|
|
||||||
run: npm install
|
|
||||||
working-directory: .github/workflows/support-files
|
|
||||||
- name: Matrix - Send Notification
|
|
||||||
env:
|
|
||||||
NYM_NOTIFICATION_KIND: cd-docs
|
|
||||||
NYM_PROJECT_NAME: "Docs CD"
|
|
||||||
NYM_CI_WWW_BASE: "${{ secrets.NYM_CD_WWW_BASE }}"
|
|
||||||
NYM_CI_WWW_LOCATION: "${{ env.GITHUB_REF_SLUG }}"
|
|
||||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
||||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
||||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
||||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM_DOCS }}"
|
|
||||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
||||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
||||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
||||||
IS_SUCCESS: "${{ job.status == 'success' }}"
|
|
||||||
uses: docker://keybaseio/client:stable-node
|
|
||||||
with:
|
|
||||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ on:
|
|||||||
- 'mixnode/**'
|
- 'mixnode/**'
|
||||||
- 'sdk/rust/nym-sdk/**'
|
- 'sdk/rust/nym-sdk/**'
|
||||||
- 'service-providers/**'
|
- 'service-providers/**'
|
||||||
|
- '.github/workflows/ci-binary-config-checker.yml'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'clients/**'
|
- 'clients/**'
|
||||||
@@ -22,6 +23,7 @@ on:
|
|||||||
- 'mixnode/**'
|
- 'mixnode/**'
|
||||||
- 'sdk/rust/nym-sdk/**'
|
- 'sdk/rust/nym-sdk/**'
|
||||||
- 'service-providers/**'
|
- 'service-providers/**'
|
||||||
|
- '.github/workflows/ci-binary-config-checker.yml'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NETWORK: mainnet
|
NETWORK: mainnet
|
||||||
@@ -31,11 +33,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [custom-linux]
|
platform: [arc-ubuntu-20.04]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt-get update && sudo apt-get -y install jq vim 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 jq vim libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
name: ci-build-ts
|
name: ci-build-ts
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "ts-packages/**"
|
- "ts-packages/**"
|
||||||
- "sdk/typescript/**"
|
- "sdk/typescript/**"
|
||||||
|
- ".github/workflows/ci-build-ts.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04-16-core
|
runs-on: arc-ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- 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@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Setup yarn
|
- name: Setup yarn
|
||||||
@@ -44,23 +46,3 @@ jobs:
|
|||||||
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
||||||
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/ts-${{ env.GITHUB_REF_SLUG }}-example
|
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/ts-${{ env.GITHUB_REF_SLUG }}-example
|
||||||
EXCLUDE: "/dist/, /node_modules/"
|
EXCLUDE: "/dist/, /node_modules/"
|
||||||
- name: Matrix - Node Install
|
|
||||||
run: npm install
|
|
||||||
working-directory: .github/workflows/support-files
|
|
||||||
- name: Matrix - Send Notification
|
|
||||||
env:
|
|
||||||
NYM_NOTIFICATION_KIND: ts-packages
|
|
||||||
NYM_PROJECT_NAME: "ts-packages"
|
|
||||||
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
|
|
||||||
NYM_CI_WWW_LOCATION: "ts-${{ env.GITHUB_REF_SLUG }}"
|
|
||||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
||||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
||||||
IS_SUCCESS: "${{ job.status == 'success' }}"
|
|
||||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
||||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM }}"
|
|
||||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
||||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
||||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
||||||
uses: docker://keybaseio/client:stable-node
|
|
||||||
with:
|
|
||||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
|
||||||
|
|||||||
@@ -26,24 +26,26 @@ on:
|
|||||||
- "nym-api/**"
|
- "nym-api/**"
|
||||||
- "nym-node/**"
|
- "nym-node/**"
|
||||||
- "nym-outfox/**"
|
- "nym-outfox/**"
|
||||||
|
- 'nym-data-observatory/**'
|
||||||
- "nym-validator-rewarder/**"
|
- "nym-validator-rewarder/**"
|
||||||
- "sdk/rust/nym-sdk/**"
|
- "sdk/rust/nym-sdk/**"
|
||||||
- "service-providers/**"
|
- "service-providers/**"
|
||||||
- "tools/**"
|
- "tools/**"
|
||||||
- "nymvisor/**"
|
- "nymvisor/**"
|
||||||
|
- ".github/workflows/ci-build-upload-binaries.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-nym:
|
publish-nym:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ ubuntu-20.04 ]
|
platform: [ arc-ubuntu-20.04 ]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Prepare build output directory
|
- name: Prepare build output directory
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -55,17 +57,13 @@ jobs:
|
|||||||
echo $OUTPUT_DIR
|
echo $OUTPUT_DIR
|
||||||
|
|
||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt update && sudo apt install libudev-dev
|
run: sudo apt-get update && sudo apt-get -y install libudev-dev
|
||||||
|
|
||||||
- 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
|
||||||
if: github.event_name == 'workflow_dispatch' && inputs.add_tokio_unstable == true
|
if: github.event_name == 'workflow_dispatch' && inputs.add_tokio_unstable == true
|
||||||
|
|
||||||
- name: Set CARGO_FEATURES
|
|
||||||
run: |
|
|
||||||
echo 'CARGO_FEATURES=--features wireguard' >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@@ -91,7 +89,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nym-binaries-artifacts
|
name: nym-binaries-artifacts
|
||||||
path: |
|
path: |
|
||||||
@@ -99,6 +97,7 @@ jobs:
|
|||||||
target/release/nym-socks5-client
|
target/release/nym-socks5-client
|
||||||
target/release/nym-api
|
target/release/nym-api
|
||||||
target/release/nym-network-requester
|
target/release/nym-network-requester
|
||||||
|
target/release/nym-data-observatory
|
||||||
target/release/nym-cli
|
target/release/nym-cli
|
||||||
target/release/nymvisor
|
target/release/nymvisor
|
||||||
target/release/nym-node
|
target/release/nym-node
|
||||||
@@ -116,6 +115,7 @@ jobs:
|
|||||||
cp target/release/nym-socks5-client $OUTPUT_DIR
|
cp target/release/nym-socks5-client $OUTPUT_DIR
|
||||||
cp target/release/nym-api $OUTPUT_DIR
|
cp target/release/nym-api $OUTPUT_DIR
|
||||||
cp target/release/nym-network-requester $OUTPUT_DIR
|
cp target/release/nym-network-requester $OUTPUT_DIR
|
||||||
|
cp target/release/nym-data-observatory $OUTPUT_DIR
|
||||||
cp target/release/nymvisor $OUTPUT_DIR
|
cp target/release/nymvisor $OUTPUT_DIR
|
||||||
cp target/release/nym-node $OUTPUT_DIR
|
cp target/release/nym-node $OUTPUT_DIR
|
||||||
cp target/release/nym-cli $OUTPUT_DIR
|
cp target/release/nym-cli $OUTPUT_DIR
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
name: ci-build-vpn-api-wasm
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'common/**'
|
||||||
|
- 'nym-credential-proxy/**'
|
||||||
|
- '.github/workflows/ci-build-vpn-api-wasm.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
wasm:
|
||||||
|
runs-on: arc-ubuntu-22.04
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
target: wasm32-unknown-unknown
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: Install wasm-pack
|
||||||
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||||
|
|
||||||
|
- name: Install wasm-opt
|
||||||
|
uses: ./.github/actions/install-wasm-opt
|
||||||
|
with:
|
||||||
|
version: '116'
|
||||||
|
|
||||||
|
- name: Install wasm-bindgen-cli
|
||||||
|
run: cargo install wasm-bindgen-cli
|
||||||
|
|
||||||
|
- name: "Build"
|
||||||
|
run: make
|
||||||
|
working-directory: nym-credential-proxy/vpn-api-lib-wasm
|
||||||
@@ -1,23 +1,6 @@
|
|||||||
name: ci-build
|
name: ci-build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'clients/**'
|
|
||||||
- 'common/**'
|
|
||||||
- 'explorer-api/**'
|
|
||||||
- 'gateway/**'
|
|
||||||
- 'integrations/**'
|
|
||||||
- 'mixnode/**'
|
|
||||||
- 'sdk/lib/socks5-listener/**'
|
|
||||||
- 'sdk/rust/nym-sdk/**'
|
|
||||||
- 'service-providers/**'
|
|
||||||
- 'nym-api/**'
|
|
||||||
- 'nym-outfox/**'
|
|
||||||
- 'tools/nym-cli/**'
|
|
||||||
- 'tools/nym-nr-query/**'
|
|
||||||
- 'tools/ts-rs-cli/**'
|
|
||||||
- 'Cargo.toml'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'clients/**'
|
- 'clients/**'
|
||||||
@@ -26,15 +9,20 @@ on:
|
|||||||
- 'gateway/**'
|
- 'gateway/**'
|
||||||
- 'integrations/**'
|
- 'integrations/**'
|
||||||
- 'mixnode/**'
|
- 'mixnode/**'
|
||||||
- 'sdk/lib/socks5-listener/**'
|
- 'sdk/rust/**'
|
||||||
- 'sdk/rust/nym-sdk/**'
|
- 'sdk/lib/**'
|
||||||
- 'service-providers/**'
|
- 'service-providers/**'
|
||||||
|
- 'nym-network-monitor/**'
|
||||||
- 'nym-api/**'
|
- 'nym-api/**'
|
||||||
|
- 'nym-node/**'
|
||||||
- 'nym-outfox/**'
|
- 'nym-outfox/**'
|
||||||
- 'tools/nym-cli/**'
|
- 'nym-data-observatory/**'
|
||||||
- 'tools/nym-nr-query/**'
|
- 'nym-validator-rewarder/**'
|
||||||
- 'tools/ts-rs-cli/**'
|
- 'tools/**'
|
||||||
|
- 'wasm/**'
|
||||||
- 'Cargo.toml'
|
- 'Cargo.toml'
|
||||||
|
- 'Cargo.lock'
|
||||||
|
- '.github/workflows/ci-build.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -42,7 +30,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [custom-linux, custom-runner-mac-m1]
|
os: [ arc-ubuntu-20.04, custom-runner-mac-m1 ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
@@ -50,10 +38,10 @@ jobs:
|
|||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools protobuf-compiler
|
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 protobuf-compiler
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: matrix.os == 'custom-linux'
|
if: contains(matrix.os, 'ubuntu')
|
||||||
|
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install rust toolchain
|
- name: Install rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -69,44 +57,34 @@ jobs:
|
|||||||
command: fmt
|
command: fmt
|
||||||
args: --all -- --check
|
args: --all -- --check
|
||||||
|
|
||||||
- name: Build all binaries
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
# Enable wireguard by default on linux only
|
|
||||||
args: --workspace --features wireguard
|
|
||||||
|
|
||||||
- name: Build all examples
|
|
||||||
if: matrix.os == 'custom-linux'
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --workspace --examples --features wireguard
|
|
||||||
|
|
||||||
- name: Run all tests
|
|
||||||
if: matrix.os == 'custom-linux'
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --workspace --features wireguard
|
|
||||||
|
|
||||||
- name: Run expensive tests
|
|
||||||
if: (github.ref == 'refs/heads/develop' || github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'master') && matrix.os == 'custom-linux'
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --workspace --features wireguard -- --ignored
|
|
||||||
|
|
||||||
- name: Annotate with clippy checks
|
|
||||||
if: matrix.os == 'custom-linux'
|
|
||||||
uses: actions-rs/clippy-check@v1
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
args: --workspace --features wireguard
|
|
||||||
|
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: clippy
|
command: clippy
|
||||||
args: --workspace --all-targets --features wireguard -- -D warnings
|
args: --workspace --all-targets -- -D warnings
|
||||||
|
|
||||||
|
- name: Build all binaries
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
|
||||||
|
- name: Build all examples
|
||||||
|
if: contains(matrix.os, 'ubuntu')
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --workspace --examples
|
||||||
|
|
||||||
|
- name: Run all tests
|
||||||
|
if: contains(matrix.os, 'ubuntu')
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --workspace
|
||||||
|
|
||||||
|
- name: Run expensive tests
|
||||||
|
if: (github.ref == 'refs/heads/develop' || github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'master') && contains(matrix.os, 'ubuntu')
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --workspace -- --ignored
|
||||||
|
|||||||
@@ -2,10 +2,14 @@ name: ci-cargo-deny
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'Cargo.toml'
|
||||||
|
- 'Cargo.lock'
|
||||||
|
- '.github/workflows/ci-cargo-deny.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cargo-deny:
|
cargo-deny:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: arc-ubuntu-22.04-dind
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
checks:
|
checks:
|
||||||
@@ -13,9 +17,9 @@ jobs:
|
|||||||
- licenses bans sources
|
- licenses bans sources
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: EmbarkStudios/cargo-deny-action@v1
|
- uses: EmbarkStudios/cargo-deny-action@v2
|
||||||
with:
|
with:
|
||||||
log-level: warn
|
log-level: warn
|
||||||
command: check ${{ matrix.checks }}
|
command: check ${{ matrix.checks }}
|
||||||
argument: --all-features
|
arguments: --all-features
|
||||||
|
|||||||
@@ -6,16 +6,17 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'contracts/**'
|
- 'contracts/**'
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
|
- '.github/workflows/ci-contracts-schema.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-schema:
|
check-schema:
|
||||||
name: Generate and check schema
|
name: Generate and check schema
|
||||||
runs-on: custom-linux
|
runs-on: arc-ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
- 'contracts/**'
|
- 'contracts/**'
|
||||||
|
- '.github/workflows/ci-contracts-upload-binaries.yml'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NETWORK: mainnet
|
NETWORK: mainnet
|
||||||
@@ -15,13 +16,13 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ ubuntu-20.04 ]
|
platform: [ arc-ubuntu-20.04 ]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Prepare build output directory
|
- name: Prepare build output directory
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -9,15 +9,16 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'contracts/**'
|
- 'contracts/**'
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
|
- '.github/workflows/ci-contracts.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
matrix_prep:
|
matrix_prep:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: arc-ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
# creates the matrix strategy from ci-contracts-matrix-includes.json
|
# creates the matrix strategy from ci-contracts-matrix-includes.json
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- id: set-matrix
|
- id: set-matrix
|
||||||
uses: JoshuaTheMiller/conditional-build-matrix@main
|
uses: JoshuaTheMiller/conditional-build-matrix@main
|
||||||
with:
|
with:
|
||||||
@@ -34,7 +35,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
|
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup rust
|
- name: Setup rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ on:
|
|||||||
branches-ignore: master
|
branches-ignore: master
|
||||||
paths:
|
paths:
|
||||||
- 'documentation/docs/**'
|
- 'documentation/docs/**'
|
||||||
|
- '.github/workflows/ci-docs.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04-16-core
|
runs-on: arc-ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler git python3 && sudo apt-get update --fix-missing
|
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler git python3 && sudo apt-get update --fix-missing
|
||||||
- name: Install pip3
|
- name: Install pip3
|
||||||
@@ -21,7 +22,7 @@ jobs:
|
|||||||
- name: Install rsync
|
- name: Install rsync
|
||||||
run: sudo apt-get install rsync
|
run: sudo apt-get install rsync
|
||||||
- uses: rlespinasse/github-slug-action@v3.x
|
- uses: rlespinasse/github-slug-action@v3.x
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
@@ -69,24 +70,3 @@ jobs:
|
|||||||
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
|
||||||
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/docs-${{ env.GITHUB_REF_SLUG }}
|
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/docs-${{ env.GITHUB_REF_SLUG }}
|
||||||
EXCLUDE: "/node_modules/"
|
EXCLUDE: "/node_modules/"
|
||||||
|
|
||||||
- name: Matrix - Node Install
|
|
||||||
run: npm install
|
|
||||||
working-directory: .github/workflows/support-files
|
|
||||||
- name: Matrix - Send Notification
|
|
||||||
env:
|
|
||||||
NYM_NOTIFICATION_KIND: ci-docs
|
|
||||||
NYM_PROJECT_NAME: "Docs CI"
|
|
||||||
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
|
|
||||||
NYM_CI_WWW_LOCATION: "docs-${{ env.GITHUB_REF_SLUG }}"
|
|
||||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
||||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
||||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
||||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM_DOCS }}"
|
|
||||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
||||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
||||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
||||||
IS_SUCCESS: "${{ job.status == 'success' }}"
|
|
||||||
uses: docker://keybaseio/client:stable-node
|
|
||||||
with:
|
|
||||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
name: ci-lint-typescript
|
name: ci-lint-typescript
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "ts-packages/**"
|
- "ts-packages/**"
|
||||||
@@ -10,15 +11,16 @@ on:
|
|||||||
- "nym-wallet/src/**"
|
- "nym-wallet/src/**"
|
||||||
- "nym-wallet/package.json"
|
- "nym-wallet/package.json"
|
||||||
- "explorer/**"
|
- "explorer/**"
|
||||||
|
- ".github/workflows/ci-lint-typescript.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04-16-core
|
runs-on: arc-ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- uses: rlespinasse/github-slug-action@v3.x
|
- uses: rlespinasse/github-slug-action@v3.x
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Setup yarn
|
- name: Setup yarn
|
||||||
@@ -38,7 +40,7 @@ jobs:
|
|||||||
version: '116'
|
version: '116'
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: '1.20'
|
||||||
|
|
||||||
@@ -52,24 +54,3 @@ jobs:
|
|||||||
run: yarn lint
|
run: yarn lint
|
||||||
- name: Typecheck with tsc
|
- name: Typecheck with tsc
|
||||||
run: yarn tsc
|
run: yarn tsc
|
||||||
|
|
||||||
- name: Matrix - Node Install
|
|
||||||
run: npm install
|
|
||||||
working-directory: .github/workflows/support-files
|
|
||||||
- name: Matrix - Send Notification
|
|
||||||
env:
|
|
||||||
NYM_NOTIFICATION_KIND: ts-packages
|
|
||||||
NYM_PROJECT_NAME: "ts-packages"
|
|
||||||
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
|
|
||||||
NYM_CI_WWW_LOCATION: "ts-${{ env.GITHUB_REF_SLUG }}"
|
|
||||||
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
|
|
||||||
GIT_BRANCH: "${GITHUB_REF##*/}"
|
|
||||||
IS_SUCCESS: "${{ job.status == 'success' }}"
|
|
||||||
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}"
|
|
||||||
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM }}"
|
|
||||||
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}"
|
|
||||||
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}"
|
|
||||||
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}"
|
|
||||||
uses: docker://keybaseio/client:stable-node
|
|
||||||
with:
|
|
||||||
args: .github/workflows/support-files/notifications/entry_point.sh
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
name: nym-api tests
|
name: nym-api tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: install yarn in root
|
- name: install yarn in root
|
||||||
run: cd ../.. && yarn install
|
run: cd ../.. && yarn install
|
||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Node v18
|
- name: Node v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18.1.0
|
node-version: 18.1.0
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: ci-nym-credential-proxy
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'common/**'
|
||||||
|
- 'nym-credential-proxy/**'
|
||||||
|
- '.github/workspace/ci-nym-credential-proxy.yml'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: arc-ubuntu-22.04
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
MANIFEST_PATH: "--manifest-path nym-credential-proxy/Cargo.toml"
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: Check formatting
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: ${{ env.MANIFEST_PATH }} --all -- --check
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: ${{ env.MANIFEST_PATH }} --workspace --all-targets
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: ${{ env.MANIFEST_PATH }} --workspace --all-targets -- -D warnings
|
||||||
@@ -5,6 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'explorer/**'
|
- 'explorer/**'
|
||||||
|
- '.github/workflows/ci-nym-network-explorer.yml'
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -14,12 +15,12 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- 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@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Setup yarn
|
- name: Setup yarn
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
name: ci-nym-wallet-rust
|
name: ci-nym-wallet-rust
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'nym-wallet/**'
|
|
||||||
- 'common/**'
|
|
||||||
- 'contracts/vesting/**'
|
|
||||||
- 'nym-api/nym-api-requests/**'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'nym-wallet/**'
|
- 'nym-wallet/**'
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
- 'contracts/vesting/**'
|
- 'contracts/vesting/**'
|
||||||
- 'nym-api/nym-api-requests/**'
|
- 'nym-api/nym-api-requests/**'
|
||||||
|
- '.github/workflows/ci-nym-wallet-rust.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: [ self-hosted, custom-linux ]
|
runs-on: arc-ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
@@ -25,7 +20,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install rust toolchain
|
- name: Install rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'nym-wallet/**'
|
- 'nym-wallet/**'
|
||||||
|
- '.github/workflows/ci-nym-wallet-storybook.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install rsync
|
- name: Install rsync
|
||||||
run: sudo apt-get install rsync
|
run: sudo apt-get install rsync
|
||||||
@@ -17,7 +18,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@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|
||||||
|
|||||||
@@ -5,17 +5,18 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "sdk/typescript/**"
|
- "sdk/typescript/**"
|
||||||
- "wasm/**"
|
- "wasm/**"
|
||||||
|
- '.github/workflows/ci-sdk-docs-typescript.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- 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@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18.17
|
node-version: 18.17
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
@@ -26,7 +27,7 @@ jobs:
|
|||||||
run: npm install -g yarn
|
run: npm install -g yarn
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: '1.20'
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,17 @@ on:
|
|||||||
- 'wasm/**'
|
- 'wasm/**'
|
||||||
- 'clients/client-core/**'
|
- 'clients/client-core/**'
|
||||||
- 'common/**'
|
- 'common/**'
|
||||||
|
- '.github/workflows/ci-sdk-wasm.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
wasm:
|
wasm:
|
||||||
runs-on: [custom-linux]
|
runs-on: arc-ubuntu-20.04
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ jobs:
|
|||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: '1.20'
|
||||||
|
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v3
|
uses: actions/configure-pages@v5
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v2
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
# Upload entire repository
|
# Upload entire repository
|
||||||
path: './ppa'
|
path: './ppa'
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v2
|
uses: actions/deploy-pages@v4
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
name: Hello world
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
my-job:
|
||||||
|
runs-on: arc-ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: my-step
|
||||||
|
run: echo "Hello World!"
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler
|
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
|
|
||||||
- name: Install Protoc
|
- name: Install Protoc
|
||||||
uses: arduino/setup-protoc@v2
|
uses: arduino/setup-protoc@v3
|
||||||
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
|
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -98,11 +98,11 @@ jobs:
|
|||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- name: Collect jobs status
|
- name: Collect jobs status
|
||||||
uses: technote-space/workflow-conclusion-action@v2
|
uses: technote-space/workflow-conclusion-action@v3
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: install npm
|
- name: install npm
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
if: env.WORKFLOW_CONCLUSION == 'failure'
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
output1: ${{ steps.step2.outputs.latest_release }}
|
output1: ${{ steps.step2.outputs.latest_release }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set output variable to latest release branch
|
- name: Set output variable to latest release branch
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup git user
|
- name: Setup git user
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup git user
|
- name: Setup git user
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Dependencies (Linux)
|
- name: Install Dependencies (Linux)
|
||||||
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools
|
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools
|
||||||
@@ -61,11 +61,11 @@ jobs:
|
|||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- name: Collect jobs status
|
- name: Collect jobs status
|
||||||
uses: technote-space/workflow-conclusion-action@v2
|
uses: technote-space/workflow-conclusion-action@v3
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: install npm
|
- name: install npm
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
if: env.WORKFLOW_CONCLUSION == 'failure'
|
if: env.WORKFLOW_CONCLUSION == 'failure'
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository code
|
- name: Checkout repository code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Install rust toolchain
|
- name: Install rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
find . -name Cargo.toml -exec cargo deny --manifest-path {} check \
|
find . -name Cargo.toml -exec cargo deny --manifest-path {} check \
|
||||||
advisories -A advisory-not-detected --hide-inclusion-graph \; &> \
|
advisories -A advisory-not-detected --hide-inclusion-graph \; &> \
|
||||||
>(uniq &> .github/workflows/support-files/notifications/deny.message )
|
>(uniq &> .github/workflows/support-files/notifications/deny.message )
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: report
|
name: report
|
||||||
path: .github/workflows/support-files/notifications/deny.message
|
path: .github/workflows/support-files/notifications/deny.message
|
||||||
@@ -29,14 +29,14 @@ jobs:
|
|||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Download report from previous job
|
- name: Download report from previous job
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: report
|
name: report
|
||||||
path: .github/workflows/support-files/notifications
|
path: .github/workflows/support-files/notifications
|
||||||
- name: install npm
|
- name: install npm
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Matrix - Node Install
|
- name: Matrix - Node Install
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
cli_version: ${{ steps.binary-versions.outputs.cli_version }}
|
cli_version: ${{ steps.binary-versions.outputs.cli_version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- 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 ripgrep libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools
|
||||||
@@ -51,10 +51,6 @@ jobs:
|
|||||||
echo 'RUSTFLAGS="--cfg tokio_unstable"' >> $GITHUB_ENV
|
echo 'RUSTFLAGS="--cfg tokio_unstable"' >> $GITHUB_ENV
|
||||||
if: github.event_name == 'workflow_dispatch' && inputs.add_tokio_unstable == true
|
if: github.event_name == 'workflow_dispatch' && inputs.add_tokio_unstable == true
|
||||||
|
|
||||||
- name: Set CARGO_FEATURES
|
|
||||||
run: |
|
|
||||||
echo 'CARGO_FEATURES=--features wireguard' >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
@@ -67,7 +63,7 @@ jobs:
|
|||||||
args: --workspace --release ${{ env.CARGO_FEATURES }}
|
args: --workspace --release ${{ env.CARGO_FEATURES }}
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: my-artifact
|
name: my-artifact
|
||||||
path: |
|
path: |
|
||||||
@@ -83,7 +79,7 @@ jobs:
|
|||||||
|
|
||||||
- id: create-release
|
- 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@v2
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
if: ${{ (startsWith(github.ref, 'refs/tags/nym-contracts-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
if: ${{ (startsWith(github.ref, 'refs/tags/nym-contracts-') && github.event_name == 'release') || github.event_name == 'workflow_dispatch' }}
|
||||||
runs-on: [self-hosted, custom-ubuntu-20.04]
|
runs-on: [self-hosted, custom-ubuntu-20.04]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
@@ -26,21 +26,21 @@ jobs:
|
|||||||
run: make contracts
|
run: make contracts
|
||||||
|
|
||||||
- name: Upload Mixnet Contract Artifact
|
- name: Upload Mixnet Contract Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mixnet_contract.wasm
|
name: mixnet_contract.wasm
|
||||||
path: contracts/target/wasm32-unknown-unknown/release/mixnet_contract.wasm
|
path: contracts/target/wasm32-unknown-unknown/release/mixnet_contract.wasm
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- name: Upload Vesting Contract Artifact
|
- name: Upload Vesting Contract Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: vesting_contract.wasm
|
name: vesting_contract.wasm
|
||||||
path: contracts/target/wasm32-unknown-unknown/release/vesting_contract.wasm
|
path: contracts/target/wasm32-unknown-unknown/release/vesting_contract.wasm
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- 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@v2
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ jobs:
|
|||||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Node
|
- name: Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
run: yarn && yarn build
|
run: yarn && yarn build
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nym-wallet.app.tar.gz
|
name: nym-wallet.app.tar.gz
|
||||||
path: nym-wallet/target/release/bundle/macos/nym-wallet.app.tar.gz
|
path: nym-wallet/target/release/bundle/macos/nym-wallet.app.tar.gz
|
||||||
@@ -95,7 +95,7 @@ jobs:
|
|||||||
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
||||||
- id: create-release
|
- 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@v2
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
file_hash: ${{ steps.release-info.outputs.file_hash }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Tauri dependencies
|
- name: Tauri dependencies
|
||||||
run: >
|
run: >
|
||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Node
|
- name: Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nym-wallet_1.0.0_amd64.AppImage.tar.gz
|
name: nym-wallet_1.0.0_amd64.AppImage.tar.gz
|
||||||
path: nym-wallet/target/release/bundle/appimage/nym-wallet*.AppImage.tar.gz
|
path: nym-wallet/target/release/bundle/appimage/nym-wallet*.AppImage.tar.gz
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
|
|
||||||
- id: create-release
|
- 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@v2
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
|
|||||||
+9
-6
@@ -1,4 +1,4 @@
|
|||||||
name: publish-nym-wallet-win10
|
name: publish-nym-wallet-win11
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
release:
|
||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [windows10]
|
platform: [custom-windows-11]
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
del /s /q /A:H nym
|
del /s /q /A:H nym
|
||||||
rmdir /s /q nym
|
rmdir /s /q nym
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Import signing certificate
|
- name: Import signing certificate
|
||||||
env:
|
env:
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
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
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|
||||||
@@ -62,6 +62,9 @@ jobs:
|
|||||||
fileName: '.env'
|
fileName: '.env'
|
||||||
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
encodedString: ${{ secrets.WALLET_ADMIN_ADDRESS }}
|
||||||
|
|
||||||
|
- name: Install Yarn
|
||||||
|
run: npm install -g yarn
|
||||||
|
|
||||||
- name: Install project dependencies
|
- name: Install project dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cd .. && yarn --network-timeout 100000
|
run: cd .. && yarn --network-timeout 100000
|
||||||
@@ -82,7 +85,7 @@ jobs:
|
|||||||
run: yarn build
|
run: yarn build
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nym-wallet_1.0.0_x64_en-US.msi
|
name: nym-wallet_1.0.0_x64_en-US.msi
|
||||||
path: nym-wallet/target/release/bundle/msi/nym-wallet_1.*.msi
|
path: nym-wallet/target/release/bundle/msi/nym-wallet_1.*.msi
|
||||||
@@ -90,7 +93,7 @@ jobs:
|
|||||||
|
|
||||||
- id: create-release
|
- 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@v2
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
@@ -22,10 +22,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Java
|
- name: Install Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
java-version: "17"
|
java-version: "17"
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
"build-tools;$SDK_BUILDTOOLS_VERSION"
|
"build-tools;$SDK_BUILDTOOLS_VERSION"
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@1.70.0
|
uses: dtolnay/rust-toolchain@1.90.0
|
||||||
|
|
||||||
- name: Install rust android targets
|
- name: Install rust android targets
|
||||||
run: |
|
run: |
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
apk/nyms5-arch64-release.apk
|
apk/nyms5-arch64-release.apk
|
||||||
|
|
||||||
- name: Upload APKs
|
- name: Upload APKs
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nyms5-apk-arch64
|
name: nyms5-apk-arch64
|
||||||
path: |
|
path: |
|
||||||
@@ -97,14 +97,14 @@ jobs:
|
|||||||
runs-on: custom-linux
|
runs-on: custom-linux
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download binary artifact
|
- name: Download binary artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nyms5-apk-arch64
|
name: nyms5-apk-arch64
|
||||||
path: apk
|
path: apk
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
apk/nyms5-arch64-debug.apk
|
apk/nyms5-arch64-debug.apk
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-20.04-16-core
|
runs-on: arc-ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node
|
- name: Install Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
registry-url: "https://registry.npmjs.org"
|
registry-url: "https://registry.npmjs.org"
|
||||||
@@ -29,12 +29,12 @@ jobs:
|
|||||||
run: cargo install wasm-opt
|
run: cargo install wasm-opt
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.20"
|
go-version: "1.20"
|
||||||
|
|
||||||
- name: Install TinyGo
|
- name: Install TinyGo
|
||||||
uses: acifani/setup-tinygo@v1
|
uses: acifani/setup-tinygo@v2
|
||||||
with:
|
with:
|
||||||
tinygo-version: "0.27.0"
|
tinygo-version: "0.27.0"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
name: Build and upload Credential Proxy container to harbor.nymte.ch
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
WORKING_DIRECTORY: "nym-credential-proxy"
|
||||||
|
CONTAINER_NAME: "credential-proxy"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: arc-ubuntu-22.04-dind
|
||||||
|
steps:
|
||||||
|
- name: Login to Harbor
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: harbor.nymte.ch
|
||||||
|
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure git identity
|
||||||
|
run: |
|
||||||
|
git config --global user.email "lawrence@nymtech.net"
|
||||||
|
git config --global user.name "Lawrence Stalder"
|
||||||
|
|
||||||
|
- name: Get version from cargo.toml
|
||||||
|
uses: mikefarah/yq@v4.44.3
|
||||||
|
id: get_version
|
||||||
|
with:
|
||||||
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/nym-credential-proxy/Cargo.toml
|
||||||
|
|
||||||
|
- name: Check if tag exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
|
||||||
|
echo "Tag ${{ steps.get_version.outputs.value }} already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Remove existing tag if exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
|
||||||
|
git push --delete origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
git tag -d ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git tag -a ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} -m "Version ${{ steps.get_version.outputs.result }}"
|
||||||
|
git push origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
|
||||||
|
- name: BuildAndPushImageOnHarbor
|
||||||
|
run: |
|
||||||
|
docker build -f ${{ env.WORKING_DIRECTORY }}/nym-credential-proxy/Dockerfile . -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.result }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
|
||||||
|
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
name: Build and upload Data observatory container to harbor.nymte.ch
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
WORKING_DIRECTORY: "nym-data-observatory"
|
||||||
|
CONTAINER_NAME: "data-observatory"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: arc-ubuntu-22.04-dind
|
||||||
|
steps:
|
||||||
|
- name: Login to Harbor
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: harbor.nymte.ch
|
||||||
|
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure git identity
|
||||||
|
run: |
|
||||||
|
git config --global user.email "lawrence@nymtech.net"
|
||||||
|
git config --global user.name "Lawrence Stalder"
|
||||||
|
|
||||||
|
- name: Get version from cargo.toml
|
||||||
|
uses: mikefarah/yq@v4.44.3
|
||||||
|
id: get_version
|
||||||
|
with:
|
||||||
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
|
||||||
|
|
||||||
|
- name: Check if tag exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
|
||||||
|
echo "Tag ${{ steps.get_version.outputs.value }} already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Remove existing tag if exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
|
||||||
|
git push --delete origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
git tag -d ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git tag -a ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} -m "Version ${{ steps.get_version.outputs.result }}"
|
||||||
|
git push origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
|
||||||
|
- name: BuildAndPushImageOnHarbor
|
||||||
|
run: |
|
||||||
|
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.result }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
|
||||||
|
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
name: Build and upload Network monitor container to harbor.nymte.ch
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
WORKING_DIRECTORY: "."
|
||||||
|
CONTAINER_NAME: "network-monitor"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: arc-ubuntu-22.04-dind
|
||||||
|
steps:
|
||||||
|
- name: Login to Harbor
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: harbor.nymte.ch
|
||||||
|
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure git identity
|
||||||
|
run: |
|
||||||
|
git config --global user.email "lawrence@nymtech.net"
|
||||||
|
git config --global user.name "Lawrence Stalder"
|
||||||
|
|
||||||
|
- name: Get version from package.json
|
||||||
|
uses: sergeysova/jq-action@v2
|
||||||
|
id: get_version
|
||||||
|
with:
|
||||||
|
cmd: jq -r '.version' ${{ env.WORKING_DIRECTORY }}/package.json
|
||||||
|
|
||||||
|
- name: Check if tag exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
|
||||||
|
echo "Tag ${{ steps.get_version.outputs.value }} already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Remove existing tag if exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
|
||||||
|
git push --delete origin ${{ steps.get_version.outputs.value }}
|
||||||
|
git tag -d ${{ steps.get_version.outputs.value }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git tag -a ${{ steps.get_version.outputs.value }} -m "Version ${{ steps.get_version.outputs.value }}"
|
||||||
|
git push origin ${{ steps.get_version.outputs.value }}
|
||||||
|
|
||||||
|
- name: BuildAndPushImageOnHarbor
|
||||||
|
run: |
|
||||||
|
docker build -f nym-network-monitor.dockerfile ${{ env.WORKING_DIRECTORY }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.value }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
|
||||||
|
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
name: Build and upload Node Status agent container to harbor.nymte.ch
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
WORKING_DIRECTORY: "nym-node-status-agent"
|
||||||
|
CONTAINER_NAME: "node-status-agent"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: arc-ubuntu-22.04-dind
|
||||||
|
steps:
|
||||||
|
- name: Login to Harbor
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: harbor.nymte.ch
|
||||||
|
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure git identity
|
||||||
|
run: |
|
||||||
|
git config --global user.email "lawrence@nymtech.net"
|
||||||
|
git config --global user.name "Lawrence Stalder"
|
||||||
|
|
||||||
|
- name: Get version from cargo.toml
|
||||||
|
uses: mikefarah/yq@v4.44.3
|
||||||
|
id: get_version
|
||||||
|
with:
|
||||||
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
|
||||||
|
|
||||||
|
- name: Check if tag exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
|
||||||
|
echo "Tag ${{ steps.get_version.outputs.value }} already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Remove existing tag if exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
|
||||||
|
git push --delete origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
git tag -d ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git tag -a ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} -m "Version ${{ steps.get_version.outputs.result }}"
|
||||||
|
git push origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
|
||||||
|
- name: BuildAndPushImageOnHarbor
|
||||||
|
run: |
|
||||||
|
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.result }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
|
||||||
|
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
name: Build and upload Node Status API container to harbor.nymte.ch
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
WORKING_DIRECTORY: "nym-node-status-api"
|
||||||
|
CONTAINER_NAME: "node-status-api"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: arc-ubuntu-22.04-dind
|
||||||
|
steps:
|
||||||
|
- name: Login to Harbor
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: harbor.nymte.ch
|
||||||
|
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure git identity
|
||||||
|
run: |
|
||||||
|
git config --global user.email "lawrence@nymtech.net"
|
||||||
|
git config --global user.name "Lawrence Stalder"
|
||||||
|
|
||||||
|
- name: Get version from cargo.toml
|
||||||
|
uses: mikefarah/yq@v4.44.3
|
||||||
|
id: get_version
|
||||||
|
with:
|
||||||
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
|
||||||
|
|
||||||
|
- name: Check if tag exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
|
||||||
|
echo "Tag ${{ steps.get_version.outputs.result }} already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Remove existing tag if exists
|
||||||
|
run: |
|
||||||
|
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
|
||||||
|
git push --delete origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
git tag -d ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create tag
|
||||||
|
run: |
|
||||||
|
git tag -a ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} -m "Version ${{ steps.get_version.outputs.result }}"
|
||||||
|
git push origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
||||||
|
|
||||||
|
- name: BuildAndPushImageOnHarbor
|
||||||
|
run: |
|
||||||
|
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.result }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
|
||||||
|
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
|
||||||
@@ -20,8 +20,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- uses: nymtech/nym/.github/actions/nym-hash-releases@develop
|
- uses: nymtech/nym/.github/actions/nym-hash-releases@develop
|
||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
release-tag-or-name-or-id: ${{ inputs.release_tag }}
|
release-tag-or-name-or-id: ${{ inputs.release_tag }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Asset Hashes
|
name: Asset Hashes
|
||||||
path: hashes.json
|
path: hashes.json
|
||||||
|
|||||||
+4
-1
@@ -48,4 +48,7 @@ foxyfox.env
|
|||||||
|
|
||||||
.next
|
.next
|
||||||
ppa-private-key.b64
|
ppa-private-key.b64
|
||||||
ppa-private-key.asc
|
ppa-private-key.asc
|
||||||
|
nym-network-monitor/topology.json
|
||||||
|
nym-network-monitor/__pycache__
|
||||||
|
nym-network-monitor/*.key
|
||||||
+204
@@ -4,6 +4,210 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2024.12-aero] (2024-10-17)
|
||||||
|
|
||||||
|
- nym-node: don't use bloomfilters for double spending checks ([#4960])
|
||||||
|
- bugfix: replace unreachable macro with an error return ([#4958])
|
||||||
|
- [DOCs:/operators]: Update FAQ sphinx size ([#4946])
|
||||||
|
- [DOCs/operators]: Release notes v2024.11-wedel ([#4939])
|
||||||
|
- Fix handle drop ([#4934])
|
||||||
|
- Assume offline mode ([#4926])
|
||||||
|
- Make ip-packet-request VERSION pub ([#4925])
|
||||||
|
- Expose error type ([#4924])
|
||||||
|
- Fix argument to cargo-deny action ([#4922])
|
||||||
|
- Fix nymvpn.com url in mainnet defaults ([#4920])
|
||||||
|
- Check both version and type in message header ([#4918])
|
||||||
|
- Bump http-api-client default timeout to 30 sec ([#4917])
|
||||||
|
- Max/proxy ffi ([#4906])
|
||||||
|
- Data Observatory stub ([#4905])
|
||||||
|
- Fix missing duplication of modified tables ([#4904])
|
||||||
|
- Update cargo deny ([#4901])
|
||||||
|
- docs: add hostname instructions for wss ([#4900])
|
||||||
|
- build(deps): bump the patch-updates group across 1 directory with 9 updates ([#4898])
|
||||||
|
- Fix clippy for beta toolchain ([#4897])
|
||||||
|
- Remove clippy github PR annotations ([#4896])
|
||||||
|
- Fix apt install in ci-build-upload-binaries.yml ([#4894])
|
||||||
|
- Update network monitor entrypoint ([#4893])
|
||||||
|
- Update nym-vpn metapackage and replace nymvpn-x with nym-vpn-app ([#4889])
|
||||||
|
- Entry wireguard tickets ([#4888])
|
||||||
|
- Build and Push CI ([#4887])
|
||||||
|
- Feature/updated gateway registration ([#4885])
|
||||||
|
- Few fixes to NNM pre deploy ([#4883])
|
||||||
|
- Fix sql serde with enum ([#4875])
|
||||||
|
- allow clients to send stateless gateway requests without prior registration ([#4873])
|
||||||
|
- chore: remove queued migration for adding explicit admin ([#4871])
|
||||||
|
- Gateway database modifications for different modes ([#4868])
|
||||||
|
- build(deps): bump strum from 0.25.0 to 0.26.3 ([#4848])
|
||||||
|
- Use serde from workspace ([#4833])
|
||||||
|
- build(deps): bump toml from 0.5.11 to 0.8.14 ([#4805])
|
||||||
|
- Max/rust sdk stream abstraction ([#4743])
|
||||||
|
|
||||||
|
[#4960]: https://github.com/nymtech/nym/pull/4960
|
||||||
|
[#4958]: https://github.com/nymtech/nym/pull/4958
|
||||||
|
[#4946]: https://github.com/nymtech/nym/pull/4946
|
||||||
|
[#4939]: https://github.com/nymtech/nym/pull/4939
|
||||||
|
[#4934]: https://github.com/nymtech/nym/pull/4934
|
||||||
|
[#4926]: https://github.com/nymtech/nym/pull/4926
|
||||||
|
[#4925]: https://github.com/nymtech/nym/pull/4925
|
||||||
|
[#4924]: https://github.com/nymtech/nym/pull/4924
|
||||||
|
[#4922]: https://github.com/nymtech/nym/pull/4922
|
||||||
|
[#4920]: https://github.com/nymtech/nym/pull/4920
|
||||||
|
[#4918]: https://github.com/nymtech/nym/pull/4918
|
||||||
|
[#4917]: https://github.com/nymtech/nym/pull/4917
|
||||||
|
[#4906]: https://github.com/nymtech/nym/pull/4906
|
||||||
|
[#4905]: https://github.com/nymtech/nym/pull/4905
|
||||||
|
[#4904]: https://github.com/nymtech/nym/pull/4904
|
||||||
|
[#4901]: https://github.com/nymtech/nym/pull/4901
|
||||||
|
[#4900]: https://github.com/nymtech/nym/pull/4900
|
||||||
|
[#4898]: https://github.com/nymtech/nym/pull/4898
|
||||||
|
[#4897]: https://github.com/nymtech/nym/pull/4897
|
||||||
|
[#4896]: https://github.com/nymtech/nym/pull/4896
|
||||||
|
[#4894]: https://github.com/nymtech/nym/pull/4894
|
||||||
|
[#4893]: https://github.com/nymtech/nym/pull/4893
|
||||||
|
[#4889]: https://github.com/nymtech/nym/pull/4889
|
||||||
|
[#4888]: https://github.com/nymtech/nym/pull/4888
|
||||||
|
[#4887]: https://github.com/nymtech/nym/pull/4887
|
||||||
|
[#4885]: https://github.com/nymtech/nym/pull/4885
|
||||||
|
[#4883]: https://github.com/nymtech/nym/pull/4883
|
||||||
|
[#4875]: https://github.com/nymtech/nym/pull/4875
|
||||||
|
[#4873]: https://github.com/nymtech/nym/pull/4873
|
||||||
|
[#4871]: https://github.com/nymtech/nym/pull/4871
|
||||||
|
[#4868]: https://github.com/nymtech/nym/pull/4868
|
||||||
|
[#4848]: https://github.com/nymtech/nym/pull/4848
|
||||||
|
[#4833]: https://github.com/nymtech/nym/pull/4833
|
||||||
|
[#4805]: https://github.com/nymtech/nym/pull/4805
|
||||||
|
[#4743]: https://github.com/nymtech/nym/pull/4743
|
||||||
|
|
||||||
|
## [2024.11-wedel] (2024-09-23)
|
||||||
|
|
||||||
|
- Backport #4894 to fix ci ([#4899])
|
||||||
|
- Bugfix/ticketbook false double spending ([#4892])
|
||||||
|
- fix: allow updating globally stored signatures ([#4891])
|
||||||
|
- [DOCs/operators]: Document changelog for patch/2024.10-caramello ([#4886])
|
||||||
|
- [DOCs/operators]: Post release docs updates ([#4874])
|
||||||
|
- Bump defguard to github latest version ([#4872])
|
||||||
|
- chore: removed completed queued mixnet migration ([#4865])
|
||||||
|
- Disable push trigger and add missing paths in ci-build ([#4864])
|
||||||
|
- Fix linux conditional in ci-build.yml ([#4863])
|
||||||
|
- Remove golang workaround in ci-sdk-wasm ([#4858])
|
||||||
|
- Revert runner for ci-docs ([#4855])
|
||||||
|
- Move credential verification into common crate ([#4853])
|
||||||
|
- Fix test failure in ipr request size ([#4844])
|
||||||
|
- Start switching over jobs to arc-ubuntu-20.04 ([#4843])
|
||||||
|
- Use ecash credential type for bandwidth value ([#4840])
|
||||||
|
- Create nym-repo-setup debian package and nym-vpn meta package ([#4837])
|
||||||
|
- Remove serde_crate named import ([#4832])
|
||||||
|
- Run cargo autoinherit following last weeks dependabot updates ([#4831])
|
||||||
|
- revamped ticketbook serialisation and exposed additional cli methods ([#4827])
|
||||||
|
- Expose wireguard details on self described endpoint ([#4825])
|
||||||
|
- Remove unused wireguard flag from SDK ([#4823])
|
||||||
|
- Add `axum` server to `nym-api` ([#4803])
|
||||||
|
- Run cargo-autoinherit for a few new crates ([#4801])
|
||||||
|
- Update dependabot ([#4796])
|
||||||
|
- Fix clippy for unwrap_or_default ([#4783])
|
||||||
|
- Enable dependabot version upgrades for root rust workspace ([#4778])
|
||||||
|
- Persist used wireguard private IPs ([#4771])
|
||||||
|
- Avoid race on ip and registration structures ([#4766])
|
||||||
|
- docs/hotfix ([#4765])
|
||||||
|
- chore: remove repetitive words ([#4763])
|
||||||
|
- Make gateway latency check generic ([#4759])
|
||||||
|
- Remove duplicate stat count for retransmissions ([#4756])
|
||||||
|
- Update peer refresh value ([#4754])
|
||||||
|
- Remove deprecated mark_as_success and use new disarm ([#4751])
|
||||||
|
- Add get_mixnodes_described to validator_client ([#4725])
|
||||||
|
- New Network Monitor ([#4610])
|
||||||
|
|
||||||
|
[#4899]: https://github.com/nymtech/nym/pull/4899
|
||||||
|
[#4892]: https://github.com/nymtech/nym/pull/4892
|
||||||
|
[#4891]: https://github.com/nymtech/nym/pull/4891
|
||||||
|
[#4886]: https://github.com/nymtech/nym/pull/4886
|
||||||
|
[#4874]: https://github.com/nymtech/nym/pull/4874
|
||||||
|
[#4872]: https://github.com/nymtech/nym/pull/4872
|
||||||
|
[#4865]: https://github.com/nymtech/nym/pull/4865
|
||||||
|
[#4864]: https://github.com/nymtech/nym/pull/4864
|
||||||
|
[#4863]: https://github.com/nymtech/nym/pull/4863
|
||||||
|
[#4858]: https://github.com/nymtech/nym/pull/4858
|
||||||
|
[#4855]: https://github.com/nymtech/nym/pull/4855
|
||||||
|
[#4853]: https://github.com/nymtech/nym/pull/4853
|
||||||
|
[#4844]: https://github.com/nymtech/nym/pull/4844
|
||||||
|
[#4843]: https://github.com/nymtech/nym/pull/4843
|
||||||
|
[#4840]: https://github.com/nymtech/nym/pull/4840
|
||||||
|
[#4837]: https://github.com/nymtech/nym/pull/4837
|
||||||
|
[#4832]: https://github.com/nymtech/nym/pull/4832
|
||||||
|
[#4831]: https://github.com/nymtech/nym/pull/4831
|
||||||
|
[#4827]: https://github.com/nymtech/nym/pull/4827
|
||||||
|
[#4825]: https://github.com/nymtech/nym/pull/4825
|
||||||
|
[#4823]: https://github.com/nymtech/nym/pull/4823
|
||||||
|
[#4803]: https://github.com/nymtech/nym/pull/4803
|
||||||
|
[#4801]: https://github.com/nymtech/nym/pull/4801
|
||||||
|
[#4796]: https://github.com/nymtech/nym/pull/4796
|
||||||
|
[#4783]: https://github.com/nymtech/nym/pull/4783
|
||||||
|
[#4778]: https://github.com/nymtech/nym/pull/4778
|
||||||
|
[#4771]: https://github.com/nymtech/nym/pull/4771
|
||||||
|
[#4766]: https://github.com/nymtech/nym/pull/4766
|
||||||
|
[#4765]: https://github.com/nymtech/nym/pull/4765
|
||||||
|
[#4763]: https://github.com/nymtech/nym/pull/4763
|
||||||
|
[#4759]: https://github.com/nymtech/nym/pull/4759
|
||||||
|
[#4756]: https://github.com/nymtech/nym/pull/4756
|
||||||
|
[#4754]: https://github.com/nymtech/nym/pull/4754
|
||||||
|
[#4751]: https://github.com/nymtech/nym/pull/4751
|
||||||
|
[#4725]: https://github.com/nymtech/nym/pull/4725
|
||||||
|
[#4610]: https://github.com/nymtech/nym/pull/4610
|
||||||
|
|
||||||
|
## [2024.10-caramello] (2024-09-10)
|
||||||
|
|
||||||
|
- Backport 4844 and 4845 ([#4857])
|
||||||
|
- Bugfix/client registration vol2 ([#4856])
|
||||||
|
- Remove wireguard feature flag and pass runtime enabled flag ([#4839])
|
||||||
|
- Eliminate cancel unsafe sig awaiting ([#4834])
|
||||||
|
- added explicit updateable admin to the mixnet contract ([#4822])
|
||||||
|
- using legacy signing payload in CLI and verifying both variants in contract ([#4821])
|
||||||
|
- adding ecash contract address ([#4819])
|
||||||
|
- Check profit margin of node before defaulting to hardcoded value ([#4802])
|
||||||
|
- Sync last_seen_bandwidth immediately ([#4774])
|
||||||
|
- Feature/additional ecash nym cli utils ([#4773])
|
||||||
|
- Better storage error logging ([#4772])
|
||||||
|
- bugfix: make sure DKG parses data out of events if logs are empty ([#4764])
|
||||||
|
- Fix clippy on rustc beta toolchain ([#4746])
|
||||||
|
- Fix clippy for beta toolchain ([#4742])
|
||||||
|
- Disable testnet-manager on non-unix ([#4741])
|
||||||
|
- Don't set NYM_VPN_API to default ([#4740])
|
||||||
|
- Update publish-nym-binaries.yml ([#4739])
|
||||||
|
- Update ci-build-upload-binaries.yml ([#4738])
|
||||||
|
- Add NYM_VPN_API to network config ([#4736])
|
||||||
|
- Re-export RecipientFormattingError in nym sdk ([#4735])
|
||||||
|
- Persist wireguard peers ([#4732])
|
||||||
|
- Fix tokio error in 1.39 ([#4730])
|
||||||
|
- Feature/vesting purge plus ranged cost params ([#4716])
|
||||||
|
- Fix (some) feature unification build failures ([#4681])
|
||||||
|
- Feature Compact Ecash : The One PR ([#4623])
|
||||||
|
|
||||||
|
[#4857]: https://github.com/nymtech/nym/pull/4857
|
||||||
|
[#4856]: https://github.com/nymtech/nym/pull/4856
|
||||||
|
[#4839]: https://github.com/nymtech/nym/pull/4839
|
||||||
|
[#4834]: https://github.com/nymtech/nym/pull/4834
|
||||||
|
[#4822]: https://github.com/nymtech/nym/pull/4822
|
||||||
|
[#4821]: https://github.com/nymtech/nym/pull/4821
|
||||||
|
[#4819]: https://github.com/nymtech/nym/pull/4819
|
||||||
|
[#4802]: https://github.com/nymtech/nym/pull/4802
|
||||||
|
[#4774]: https://github.com/nymtech/nym/pull/4774
|
||||||
|
[#4773]: https://github.com/nymtech/nym/pull/4773
|
||||||
|
[#4772]: https://github.com/nymtech/nym/pull/4772
|
||||||
|
[#4764]: https://github.com/nymtech/nym/pull/4764
|
||||||
|
[#4746]: https://github.com/nymtech/nym/pull/4746
|
||||||
|
[#4742]: https://github.com/nymtech/nym/pull/4742
|
||||||
|
[#4741]: https://github.com/nymtech/nym/pull/4741
|
||||||
|
[#4740]: https://github.com/nymtech/nym/pull/4740
|
||||||
|
[#4739]: https://github.com/nymtech/nym/pull/4739
|
||||||
|
[#4738]: https://github.com/nymtech/nym/pull/4738
|
||||||
|
[#4736]: https://github.com/nymtech/nym/pull/4736
|
||||||
|
[#4735]: https://github.com/nymtech/nym/pull/4735
|
||||||
|
[#4732]: https://github.com/nymtech/nym/pull/4732
|
||||||
|
[#4730]: https://github.com/nymtech/nym/pull/4730
|
||||||
|
[#4716]: https://github.com/nymtech/nym/pull/4716
|
||||||
|
[#4681]: https://github.com/nymtech/nym/pull/4681
|
||||||
|
[#4623]: https://github.com/nymtech/nym/pull/4623
|
||||||
|
|
||||||
## [2024.9-topdeck] (2024-07-26)
|
## [2024.9-topdeck] (2024-07-26)
|
||||||
|
|
||||||
- chore: fix 1.80 lint issues ([#4731])
|
- chore: fix 1.80 lint issues ([#4731])
|
||||||
|
|||||||
Generated
+2520
-1428
File diff suppressed because it is too large
Load Diff
+100
-54
@@ -14,7 +14,6 @@ panic = "abort"
|
|||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
"clients/native",
|
"clients/native",
|
||||||
@@ -46,6 +45,7 @@ members = [
|
|||||||
"common/credentials",
|
"common/credentials",
|
||||||
"common/credential-utils",
|
"common/credential-utils",
|
||||||
"common/credentials-interface",
|
"common/credentials-interface",
|
||||||
|
"common/credential-verification",
|
||||||
"common/crypto",
|
"common/crypto",
|
||||||
"common/dkg",
|
"common/dkg",
|
||||||
"common/ecash-double-spending",
|
"common/ecash-double-spending",
|
||||||
@@ -54,12 +54,14 @@ members = [
|
|||||||
"common/exit-policy",
|
"common/exit-policy",
|
||||||
"common/gateway-requests",
|
"common/gateway-requests",
|
||||||
"common/gateway-storage",
|
"common/gateway-storage",
|
||||||
|
"common/gateway-stats-storage",
|
||||||
"common/http-api-client",
|
"common/http-api-client",
|
||||||
"common/http-api-common",
|
"common/http-api-common",
|
||||||
"common/inclusion-probability",
|
"common/inclusion-probability",
|
||||||
"common/ip-packet-requests",
|
"common/ip-packet-requests",
|
||||||
"common/ledger",
|
"common/ledger",
|
||||||
"common/mixnode-common",
|
"common/mixnode-common",
|
||||||
|
"common/models",
|
||||||
"common/network-defaults",
|
"common/network-defaults",
|
||||||
"common/node-tester-utils",
|
"common/node-tester-utils",
|
||||||
"common/nonexhaustive-delayqueue",
|
"common/nonexhaustive-delayqueue",
|
||||||
@@ -81,9 +83,11 @@ members = [
|
|||||||
"common/nyxd-scraper",
|
"common/nyxd-scraper",
|
||||||
"common/pemstore",
|
"common/pemstore",
|
||||||
"common/serde-helpers",
|
"common/serde-helpers",
|
||||||
|
"common/service-provider-requests-common",
|
||||||
"common/socks5-client-core",
|
"common/socks5-client-core",
|
||||||
"common/socks5/proxy-helpers",
|
"common/socks5/proxy-helpers",
|
||||||
"common/socks5/requests",
|
"common/socks5/requests",
|
||||||
|
"common/statistics",
|
||||||
"common/store-cipher",
|
"common/store-cipher",
|
||||||
"common/task",
|
"common/task",
|
||||||
"common/topology",
|
"common/topology",
|
||||||
@@ -102,20 +106,30 @@ members = [
|
|||||||
"mixnode",
|
"mixnode",
|
||||||
"sdk/lib/socks5-listener",
|
"sdk/lib/socks5-listener",
|
||||||
"sdk/rust/nym-sdk",
|
"sdk/rust/nym-sdk",
|
||||||
|
"sdk/ffi/shared",
|
||||||
|
"sdk/ffi/go",
|
||||||
|
"sdk/ffi/cpp",
|
||||||
"service-providers/authenticator",
|
"service-providers/authenticator",
|
||||||
"service-providers/common",
|
"service-providers/common",
|
||||||
"service-providers/ip-packet-router",
|
"service-providers/ip-packet-router",
|
||||||
"service-providers/network-requester",
|
"service-providers/network-requester",
|
||||||
|
"nym-network-monitor",
|
||||||
"nym-api",
|
"nym-api",
|
||||||
"nym-browser-extension/storage",
|
"nym-browser-extension/storage",
|
||||||
"nym-api/nym-api-requests",
|
"nym-api/nym-api-requests",
|
||||||
|
"nym-data-observatory",
|
||||||
"nym-node",
|
"nym-node",
|
||||||
"nym-node/nym-node-http-api",
|
"nym-node/nym-node-http-api",
|
||||||
"nym-node/nym-node-requests",
|
"nym-node/nym-node-requests",
|
||||||
|
"nym-node-status-api",
|
||||||
|
"nym-node-status-agent",
|
||||||
"nym-outfox",
|
"nym-outfox",
|
||||||
"nym-validator-rewarder",
|
"nym-validator-rewarder",
|
||||||
|
"tools/echo-server",
|
||||||
"tools/internal/ssl-inject",
|
"tools/internal/ssl-inject",
|
||||||
# "tools/internal/sdk-version-bump",
|
# "tools/internal/sdk-version-bump",
|
||||||
|
"tools/internal/testnet-manager",
|
||||||
|
"tools/internal/testnet-manager/dkg-bypass-contract",
|
||||||
"tools/nym-cli",
|
"tools/nym-cli",
|
||||||
"tools/nym-id-cli",
|
"tools/nym-id-cli",
|
||||||
"tools/nym-nr-query",
|
"tools/nym-nr-query",
|
||||||
@@ -128,19 +142,28 @@ members = [
|
|||||||
"wasm/zknym-lib",
|
"wasm/zknym-lib",
|
||||||
"tools/internal/testnet-manager",
|
"tools/internal/testnet-manager",
|
||||||
"tools/internal/testnet-manager/dkg-bypass-contract",
|
"tools/internal/testnet-manager/dkg-bypass-contract",
|
||||||
|
"tools/echo-server",
|
||||||
|
"tools/internal/contract-state-importer/importer-cli",
|
||||||
|
"tools/internal/contract-state-importer/importer-contract",
|
||||||
]
|
]
|
||||||
|
|
||||||
default-members = [
|
default-members = [
|
||||||
"clients/native",
|
"clients/native",
|
||||||
"clients/socks5",
|
"clients/socks5",
|
||||||
|
"common/models",
|
||||||
|
"explorer-api",
|
||||||
"gateway",
|
"gateway",
|
||||||
"service-providers/network-requester",
|
|
||||||
"mixnode",
|
"mixnode",
|
||||||
"nym-api",
|
"nym-api",
|
||||||
"tools/nymvisor",
|
"nym-data-observatory",
|
||||||
"explorer-api",
|
|
||||||
"nym-validator-rewarder",
|
|
||||||
"nym-node",
|
"nym-node",
|
||||||
|
"nym-node-status-api",
|
||||||
|
"nym-validator-rewarder",
|
||||||
|
"nym-node-status-api",
|
||||||
|
"service-providers/authenticator",
|
||||||
|
"service-providers/ip-packet-router",
|
||||||
|
"service-providers/network-requester",
|
||||||
|
"tools/nymvisor",
|
||||||
]
|
]
|
||||||
|
|
||||||
exclude = [
|
exclude = [
|
||||||
@@ -149,7 +172,6 @@ exclude = [
|
|||||||
"nym-wallet",
|
"nym-wallet",
|
||||||
"nym-vpn/ui/src-tauri",
|
"nym-vpn/ui/src-tauri",
|
||||||
"cpu-cycles",
|
"cpu-cycles",
|
||||||
"sdk/ffi/cpp",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
@@ -159,17 +181,21 @@ homepage = "https://nymtech.net"
|
|||||||
documentation = "https://nymtech.net"
|
documentation = "https://nymtech.net"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
rust-version = "1.80"
|
||||||
|
readme = "README.md"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
addr = "0.15.6"
|
addr = "0.15.6"
|
||||||
aes = "0.8.1"
|
aes = "0.8.1"
|
||||||
aes-gcm = "0.10.1"
|
aes-gcm = "0.10.1"
|
||||||
anyhow = "1.0.71"
|
aes-gcm-siv = "0.11.1"
|
||||||
|
aead = "0.5.2"
|
||||||
|
anyhow = "1.0.90"
|
||||||
argon2 = "0.5.0"
|
argon2 = "0.5.0"
|
||||||
async-trait = "0.1.68"
|
async-trait = "0.1.83"
|
||||||
axum = "0.7.5"
|
axum = "0.7.5"
|
||||||
axum-extra = "0.9.3"
|
axum-extra = "0.9.4"
|
||||||
base64 = "0.21.4"
|
base64 = "0.22.1"
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
bip39 = { version = "2.0.0", features = ["zeroize"] }
|
bip39 = { version = "2.0.0", features = ["zeroize"] }
|
||||||
|
|
||||||
@@ -177,11 +203,11 @@ bip39 = { version = "2.0.0", features = ["zeroize"] }
|
|||||||
bit-vec = "0.7.0"
|
bit-vec = "0.7.0"
|
||||||
bitvec = "1.0.0"
|
bitvec = "1.0.0"
|
||||||
|
|
||||||
blake3 = "1.3.1"
|
blake3 = "1.5.4"
|
||||||
bloomfilter = "1.0.14"
|
bloomfilter = "1.0.14"
|
||||||
bs58 = "0.5.1"
|
bs58 = "0.5.1"
|
||||||
bytecodec = "0.4.15"
|
bytecodec = "0.4.15"
|
||||||
bytes = "1.5.0"
|
bytes = "1.7.2"
|
||||||
cargo_metadata = "0.18.1"
|
cargo_metadata = "0.18.1"
|
||||||
celes = "2.4.0"
|
celes = "2.4.0"
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
@@ -189,36 +215,40 @@ chacha20 = "0.9.0"
|
|||||||
chacha20poly1305 = "0.10.1"
|
chacha20poly1305 = "0.10.1"
|
||||||
chrono = "0.4.31"
|
chrono = "0.4.31"
|
||||||
cipher = "0.4.3"
|
cipher = "0.4.3"
|
||||||
clap = "4.4.7"
|
clap = "4.5.20"
|
||||||
clap_complete = "4.0"
|
clap_complete = "4.5"
|
||||||
clap_complete_fig = "4.0"
|
clap_complete_fig = "4.5"
|
||||||
colored = "2.0"
|
colored = "2.0"
|
||||||
comfy-table = "6.0.0"
|
comfy-table = "7.1.1"
|
||||||
|
console = "0.15.8"
|
||||||
console-subscriber = "0.1.1"
|
console-subscriber = "0.1.1"
|
||||||
console_error_panic_hook = "0.1"
|
console_error_panic_hook = "0.1"
|
||||||
const-str = "0.5.6"
|
const-str = "0.5.6"
|
||||||
const_format = "0.2.32"
|
const_format = "0.2.33"
|
||||||
criterion = "0.4"
|
criterion = "0.4"
|
||||||
csv = "1.3.0"
|
csv = "1.3.0"
|
||||||
ctr = "0.9.1"
|
ctr = "0.9.1"
|
||||||
cupid = "0.6.1"
|
cupid = "0.6.1"
|
||||||
curve25519-dalek = "4.1"
|
curve25519-dalek = "4.1"
|
||||||
dashmap = "5.5.3"
|
dashmap = "5.5.3"
|
||||||
defguard_wireguard_rs = "0.4.2"
|
# We want https://github.com/DefGuard/wireguard-rs/pull/64 , but there's no crates.io release being pushed out anymore
|
||||||
|
defguard_wireguard_rs = { git = "https://github.com/DefGuard/wireguard-rs.git", rev = "v0.4.7" }
|
||||||
digest = "0.10.7"
|
digest = "0.10.7"
|
||||||
dirs = "4.0"
|
dirs = "5.0"
|
||||||
doc-comment = "0.3"
|
doc-comment = "0.3"
|
||||||
dotenvy = "0.15.6"
|
dotenvy = "0.15.6"
|
||||||
ecdsa = "0.16"
|
ecdsa = "0.16"
|
||||||
ed25519-dalek = "2.1"
|
ed25519-dalek = "2.1"
|
||||||
etherparse = "0.13.0"
|
etherparse = "0.13.0"
|
||||||
|
envy = "0.4"
|
||||||
eyre = "0.6.9"
|
eyre = "0.6.9"
|
||||||
fastrand = "2.1.0"
|
fastrand = "2.1.1"
|
||||||
flate2 = "1.0.28"
|
flate2 = "1.0.34"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
|
futures-util = "0.3"
|
||||||
generic-array = "0.14.7"
|
generic-array = "0.14.7"
|
||||||
getrandom = "0.2.10"
|
getrandom = "0.2.10"
|
||||||
getset = "0.1.1"
|
getset = "0.1.3"
|
||||||
handlebars = "3.5.5"
|
handlebars = "3.5.5"
|
||||||
headers = "0.4.0"
|
headers = "0.4.0"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
@@ -226,13 +256,16 @@ hex-literal = "0.3.3"
|
|||||||
hkdf = "0.12.3"
|
hkdf = "0.12.3"
|
||||||
hmac = "0.12.1"
|
hmac = "0.12.1"
|
||||||
http = "1"
|
http = "1"
|
||||||
|
http-body-util = "0.1"
|
||||||
httpcodec = "0.2.3"
|
httpcodec = "0.2.3"
|
||||||
humantime = "2.1.0"
|
humantime = "2.1.0"
|
||||||
humantime-serde = "1.1.1"
|
humantime-serde = "1.1.1"
|
||||||
hyper = "1.3.1"
|
hyper = "1.4.1"
|
||||||
|
hyper-util = "0.1"
|
||||||
|
indicatif = "0.17.8"
|
||||||
inquire = "0.6.2"
|
inquire = "0.6.2"
|
||||||
ip_network = "0.4.1"
|
ip_network = "0.4.1"
|
||||||
ipnetwork = "0.16"
|
ipnetwork = "0.20"
|
||||||
isocountry = "0.3.2"
|
isocountry = "0.3.2"
|
||||||
itertools = "0.13.0"
|
itertools = "0.13.0"
|
||||||
k256 = "0.13"
|
k256 = "0.13"
|
||||||
@@ -242,60 +275,64 @@ ledger-transport-hid = "0.10.0"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
maxminddb = "0.23.0"
|
maxminddb = "0.23.0"
|
||||||
mime = "0.3.17"
|
mime = "0.3.17"
|
||||||
|
moka = { version = "0.12", features = ["future"] }
|
||||||
nix = "0.27.1"
|
nix = "0.27.1"
|
||||||
notify = "5.1.0"
|
notify = "5.1.0"
|
||||||
okapi = "0.7.0"
|
okapi = "0.7.0"
|
||||||
once_cell = "1.7.2"
|
once_cell = "1.7.2"
|
||||||
opentelemetry = "0.19.0"
|
opentelemetry = "0.19.0"
|
||||||
opentelemetry-jaeger = "0.18.0"
|
opentelemetry-jaeger = "0.18.0"
|
||||||
parking_lot = "0.12.1"
|
parking_lot = "0.12.3"
|
||||||
pem = "0.8"
|
pem = "0.8"
|
||||||
pin-project = "1.0"
|
petgraph = "0.6.5"
|
||||||
|
pin-project = "1.1"
|
||||||
|
pin-project-lite = "0.2.14"
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.4.0"
|
||||||
publicsuffix = "2.2.3"
|
publicsuffix = "2.2.3"
|
||||||
quote = "1"
|
quote = "1"
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
rand-07 = "0.7.3"
|
|
||||||
rand_chacha = "0.3"
|
rand_chacha = "0.3"
|
||||||
rand_chacha_02 = "0.2"
|
|
||||||
rand_core = "0.6.3"
|
rand_core = "0.6.3"
|
||||||
rand_distr = "0.4"
|
rand_distr = "0.4"
|
||||||
rand_pcg = "0.3.1"
|
rand_pcg = "0.3.1"
|
||||||
rand_seeder = "0.2.3"
|
rand_seeder = "0.2.3"
|
||||||
rayon = "1.5.1"
|
rayon = "1.5.1"
|
||||||
regex = "1.8.4"
|
regex = "1.10.6"
|
||||||
reqwest = { version = "0.12.4", default-features = false }
|
reqwest = { version = "0.12.4", default-features = false }
|
||||||
rocket = "0.5.0"
|
rocket = "0.5.0"
|
||||||
rocket_cors = "0.6.0"
|
rocket_cors = "0.6.0"
|
||||||
rocket_okapi = "0.8.0"
|
rocket_okapi = "0.8.0"
|
||||||
safer-ffi = "0.1.4"
|
safer-ffi = "0.1.13"
|
||||||
schemars = "0.8.1"
|
schemars = "0.8.21"
|
||||||
semver = "1.0.23"
|
semver = "1.0.23"
|
||||||
serde = "1.0.152"
|
serde = "1.0.211"
|
||||||
serde_bytes = "0.11.6"
|
serde_bytes = "0.11.15"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
serde_json = "1.0.91"
|
serde_json = "1.0.132"
|
||||||
|
serde_json_path = "0.6.7"
|
||||||
serde_repr = "0.1"
|
serde_repr = "0.1"
|
||||||
serde_with = "3.4.0"
|
serde_with = "3.9.0"
|
||||||
serde_yaml = "0.9.25"
|
serde_yaml = "0.9.25"
|
||||||
sha2 = "0.10.8"
|
sha2 = "0.10.8"
|
||||||
si-scale = "0.2.2"
|
si-scale = "0.2.3"
|
||||||
sphinx-packet = "0.1.1"
|
sphinx-packet = "0.1.1"
|
||||||
sqlx = "0.6.3"
|
sqlx = "0.7.4"
|
||||||
strum = "0.25"
|
strum = "0.26"
|
||||||
|
strum_macros = "0.26"
|
||||||
subtle-encoding = "0.5"
|
subtle-encoding = "0.5"
|
||||||
syn = "1"
|
syn = "1"
|
||||||
sysinfo = "0.30.12"
|
sysinfo = "0.30.13"
|
||||||
tap = "1.0.1"
|
tap = "1.0.1"
|
||||||
tar = "0.4.40"
|
tar = "0.4.42"
|
||||||
tempfile = "3.5.0"
|
tempfile = "3.5.0"
|
||||||
thiserror = "1.0.48"
|
thiserror = "1.0.64"
|
||||||
time = "0.3.30"
|
time = "0.3.30"
|
||||||
tokio = "1.39"
|
tokio = "1.39"
|
||||||
tokio-stream = "0.1.15"
|
tokio-stream = "0.1.16"
|
||||||
tokio-test = "0.4.4"
|
tokio-test = "0.4.4"
|
||||||
|
tokio-tun = "0.11.5"
|
||||||
tokio-tungstenite = { version = "0.20.1" }
|
tokio-tungstenite = { version = "0.20.1" }
|
||||||
tokio-util = "0.7.11"
|
tokio-util = "0.7.12"
|
||||||
toml = "0.8.14"
|
toml = "0.8.14"
|
||||||
tower = "0.4.13"
|
tower = "0.4.13"
|
||||||
tower-http = "0.5.2"
|
tower-http = "0.5.2"
|
||||||
@@ -303,14 +340,17 @@ tracing = "0.1.37"
|
|||||||
tracing-opentelemetry = "0.19.0"
|
tracing-opentelemetry = "0.19.0"
|
||||||
tracing-subscriber = "0.3.16"
|
tracing-subscriber = "0.3.16"
|
||||||
tracing-tree = "0.2.2"
|
tracing-tree = "0.2.2"
|
||||||
ts-rs = "7.0.0"
|
tracing-log = "0.2"
|
||||||
|
ts-rs = "10.0.0"
|
||||||
tungstenite = { version = "0.20.1", default-features = false }
|
tungstenite = { version = "0.20.1", default-features = false }
|
||||||
url = "2.4"
|
url = "2.5"
|
||||||
utoipa = "4.2.0"
|
utoipa = "4.2"
|
||||||
utoipa-swagger-ui = "6.0.0"
|
utoipa-swagger-ui = "7.1"
|
||||||
|
utoipauto = "0.1"
|
||||||
|
uuid = "*"
|
||||||
vergen = { version = "=8.3.1", default-features = false }
|
vergen = { version = "=8.3.1", default-features = false }
|
||||||
walkdir = "2"
|
walkdir = "2"
|
||||||
wasm-bindgen-test = "0.3.36"
|
wasm-bindgen-test = "0.3.43"
|
||||||
x25519-dalek = "2.0.0"
|
x25519-dalek = "2.0.0"
|
||||||
zeroize = "1.6.0"
|
zeroize = "1.6.0"
|
||||||
|
|
||||||
@@ -323,9 +363,9 @@ prometheus = { version = "0.13.0" }
|
|||||||
bls12_381 = { git = "https://github.com/jstuczyn/bls12_381", default-features = false, branch = "temp/experimental-serdect" }
|
bls12_381 = { git = "https://github.com/jstuczyn/bls12_381", default-features = false, branch = "temp/experimental-serdect" }
|
||||||
group = { version = "0.13.0", default-features = false }
|
group = { version = "0.13.0", default-features = false }
|
||||||
ff = { version = "0.13.0", default-features = false }
|
ff = { version = "0.13.0", default-features = false }
|
||||||
|
subtle = "2.5.0"
|
||||||
|
|
||||||
# cosmwasm-related
|
# cosmwasm-related
|
||||||
cosmwasm-derive = "=1.4.3"
|
|
||||||
cosmwasm-schema = "=1.4.3"
|
cosmwasm-schema = "=1.4.3"
|
||||||
cosmwasm-std = "=1.4.3"
|
cosmwasm-std = "=1.4.3"
|
||||||
# use 0.5.0 as that's the version used by cosmwasm-std 1.4.3
|
# use 0.5.0 as that's the version used by cosmwasm-std 1.4.3
|
||||||
@@ -341,7 +381,7 @@ cw4 = { version = "=1.1.2" }
|
|||||||
cw-controllers = { version = "=1.1.0" }
|
cw-controllers = { version = "=1.1.0" }
|
||||||
|
|
||||||
# cosmrs-related
|
# cosmrs-related
|
||||||
bip32 = { version = "0.5.1", default-features = false }
|
bip32 = { version = "0.5.2", default-features = false }
|
||||||
|
|
||||||
# temporarily using a fork again (yay.) because we need staking and slashing support (which are already on main but not released)
|
# temporarily using a fork again (yay.) because we need staking and slashing support (which are already on main but not released)
|
||||||
# plus response message parsing (which is, as of the time of writing this message, waiting to get merged)
|
# plus response message parsing (which is, as of the time of writing this message, waiting to get merged)
|
||||||
@@ -359,17 +399,23 @@ gloo-net = "0.5.0"
|
|||||||
# this is blocked until the upstream removes outdates `wasm_bindgen` feature usage
|
# this is blocked until the upstream removes outdates `wasm_bindgen` feature usage
|
||||||
# indexed_db_futures = "0.4.1"
|
# indexed_db_futures = "0.4.1"
|
||||||
indexed_db_futures = { git = "https://github.com/TiemenSch/rust-indexed-db", branch = "update-uuid" }
|
indexed_db_futures = { git = "https://github.com/TiemenSch/rust-indexed-db", branch = "update-uuid" }
|
||||||
js-sys = "0.3.69"
|
js-sys = "0.3.70"
|
||||||
serde-wasm-bindgen = "0.6.5"
|
serde-wasm-bindgen = "0.6.5"
|
||||||
tsify = "0.4.5"
|
tsify = "0.4.5"
|
||||||
wasm-bindgen = "0.2.92"
|
wasm-bindgen = "0.2.95"
|
||||||
wasm-bindgen-futures = "0.4.39"
|
wasm-bindgen-futures = "0.4.45"
|
||||||
wasmtimer = "0.2.0"
|
wasmtimer = "0.2.0"
|
||||||
web-sys = "0.3.69"
|
web-sys = "0.3.72"
|
||||||
|
|
||||||
|
|
||||||
# Profile settings for individual crates
|
# Profile settings for individual crates
|
||||||
|
|
||||||
|
# Compile-time verified queries do quite a bit of work at compile time. Incremental
|
||||||
|
# actions like cargo check and cargo build can be significantly faster when
|
||||||
|
# using an optimized build
|
||||||
|
[profile.dev.package.sqlx-macros]
|
||||||
|
opt-level = 3
|
||||||
|
|
||||||
[profile.release.package.nym-socks5-listener]
|
[profile.release.package.nym-socks5-listener]
|
||||||
strip = true
|
strip = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nym-client"
|
name = "nym-client"
|
||||||
version = "1.1.39"
|
version = "1.1.42"
|
||||||
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"
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::CliNativeClient;
|
||||||
|
use crate::error::ClientError;
|
||||||
|
use nym_client_core::cli_helpers::client_import_coin_index_signatures::{
|
||||||
|
import_coin_index_signatures, CommonClientImportCoinIndexSignaturesArgs,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub(crate) async fn execute(
|
||||||
|
args: CommonClientImportCoinIndexSignaturesArgs,
|
||||||
|
) -> Result<(), ClientError> {
|
||||||
|
import_coin_index_signatures::<CliNativeClient, _>(args).await?;
|
||||||
|
println!("successfully imported coin index signatures!");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
+2
-2
@@ -4,10 +4,10 @@
|
|||||||
use crate::commands::CliNativeClient;
|
use crate::commands::CliNativeClient;
|
||||||
use crate::error::ClientError;
|
use crate::error::ClientError;
|
||||||
use nym_client_core::cli_helpers::client_import_credential::{
|
use nym_client_core::cli_helpers::client_import_credential::{
|
||||||
import_credential, CommonClientImportCredentialArgs,
|
import_credential, CommonClientImportTicketBookArgs,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) async fn execute(args: CommonClientImportCredentialArgs) -> Result<(), ClientError> {
|
pub(crate) async fn execute(args: CommonClientImportTicketBookArgs) -> Result<(), ClientError> {
|
||||||
import_credential::<CliNativeClient, _>(args).await?;
|
import_credential::<CliNativeClient, _>(args).await?;
|
||||||
println!("successfully imported credential!");
|
println!("successfully imported credential!");
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::CliNativeClient;
|
||||||
|
use crate::error::ClientError;
|
||||||
|
use nym_client_core::cli_helpers::client_import_expiration_date_signatures::{
|
||||||
|
import_expiration_date_signatures, CommonClientImportExpirationDateSignaturesArgs,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub(crate) async fn execute(
|
||||||
|
args: CommonClientImportExpirationDateSignaturesArgs,
|
||||||
|
) -> Result<(), ClientError> {
|
||||||
|
import_expiration_date_signatures::<CliNativeClient, _>(args).await?;
|
||||||
|
println!("successfully imported expiration date signatures!");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::CliNativeClient;
|
||||||
|
use crate::error::ClientError;
|
||||||
|
use nym_client_core::cli_helpers::client_import_master_verification_key::{
|
||||||
|
import_master_verification_key, CommonClientImportMasterVerificationKeyArgs,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub(crate) async fn execute(
|
||||||
|
args: CommonClientImportMasterVerificationKeyArgs,
|
||||||
|
) -> Result<(), ClientError> {
|
||||||
|
import_master_verification_key::<CliNativeClient, _>(args).await?;
|
||||||
|
println!("successfully imported master verification key!");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use clap::{Args, Subcommand};
|
||||||
|
use nym_client_core::cli_helpers::client_import_coin_index_signatures::CommonClientImportCoinIndexSignaturesArgs;
|
||||||
|
use nym_client_core::cli_helpers::client_import_credential::CommonClientImportTicketBookArgs;
|
||||||
|
use nym_client_core::cli_helpers::client_import_expiration_date_signatures::CommonClientImportExpirationDateSignaturesArgs;
|
||||||
|
use nym_client_core::cli_helpers::client_import_master_verification_key::CommonClientImportMasterVerificationKeyArgs;
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
|
pub(crate) mod import_coin_index_signatures;
|
||||||
|
pub(crate) mod import_credential;
|
||||||
|
pub(crate) mod import_expiration_date_signatures;
|
||||||
|
pub(crate) mod import_master_verification_key;
|
||||||
|
pub(crate) mod show_ticketbooks;
|
||||||
|
|
||||||
|
#[derive(Args)]
|
||||||
|
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
||||||
|
pub struct Ecash {
|
||||||
|
#[clap(subcommand)]
|
||||||
|
pub command: EcashCommands,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Ecash {
|
||||||
|
pub async fn execute(self) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
|
match self.command {
|
||||||
|
EcashCommands::ShowTicketBooks(args) => show_ticketbooks::execute(args).await?,
|
||||||
|
EcashCommands::ImportTicketBook(args) => import_credential::execute(args).await?,
|
||||||
|
EcashCommands::ImportCoinIndexSignatures(args) => {
|
||||||
|
import_coin_index_signatures::execute(args).await?
|
||||||
|
}
|
||||||
|
EcashCommands::ImportExpirationDateSignatures(args) => {
|
||||||
|
import_expiration_date_signatures::execute(args).await?
|
||||||
|
}
|
||||||
|
EcashCommands::ImportMasterVerificationKey(args) => {
|
||||||
|
import_master_verification_key::execute(args).await?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum EcashCommands {
|
||||||
|
/// Display information associated with the imported ticketbooks,
|
||||||
|
ShowTicketBooks(show_ticketbooks::Args),
|
||||||
|
|
||||||
|
/// Import a pre-generated ticketbook
|
||||||
|
ImportTicketBook(CommonClientImportTicketBookArgs),
|
||||||
|
|
||||||
|
/// Import coin index signatures needed for ticketbooks
|
||||||
|
ImportCoinIndexSignatures(CommonClientImportCoinIndexSignaturesArgs),
|
||||||
|
|
||||||
|
/// Import expiration date signatures needed for ticketbooks
|
||||||
|
ImportExpirationDateSignatures(CommonClientImportExpirationDateSignaturesArgs),
|
||||||
|
|
||||||
|
/// Import master verification key needed for ticketbooks
|
||||||
|
ImportMasterVerificationKey(CommonClientImportMasterVerificationKeyArgs),
|
||||||
|
}
|
||||||
@@ -6,13 +6,13 @@ use crate::client::config::old_config_v1_1_20::ConfigV1_1_20;
|
|||||||
use crate::client::config::old_config_v1_1_20_2::ConfigV1_1_20_2;
|
use crate::client::config::old_config_v1_1_20_2::ConfigV1_1_20_2;
|
||||||
use crate::client::config::old_config_v1_1_33::ConfigV1_1_33;
|
use crate::client::config::old_config_v1_1_33::ConfigV1_1_33;
|
||||||
use crate::client::config::{BaseClientConfig, Config};
|
use crate::client::config::{BaseClientConfig, Config};
|
||||||
|
use crate::commands::ecash::Ecash;
|
||||||
use crate::error::ClientError;
|
use crate::error::ClientError;
|
||||||
use clap::CommandFactory;
|
use clap::CommandFactory;
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use nym_bin_common::bin_info;
|
use nym_bin_common::bin_info;
|
||||||
use nym_bin_common::completions::{fig_generate, ArgShell};
|
use nym_bin_common::completions::{fig_generate, ArgShell};
|
||||||
use nym_client_core::cli_helpers::client_import_credential::CommonClientImportCredentialArgs;
|
|
||||||
use nym_client_core::cli_helpers::CliClient;
|
use nym_client_core::cli_helpers::CliClient;
|
||||||
use nym_client_core::client::base_client::storage::migration_helpers::v1_1_33;
|
use nym_client_core::client::base_client::storage::migration_helpers::v1_1_33;
|
||||||
use nym_config::OptionalSet;
|
use nym_config::OptionalSet;
|
||||||
@@ -22,11 +22,10 @@ use std::sync::OnceLock;
|
|||||||
|
|
||||||
mod add_gateway;
|
mod add_gateway;
|
||||||
pub(crate) mod build_info;
|
pub(crate) mod build_info;
|
||||||
pub(crate) mod import_credential;
|
pub(crate) mod ecash;
|
||||||
pub(crate) mod init;
|
pub(crate) mod init;
|
||||||
mod list_gateways;
|
mod list_gateways;
|
||||||
pub(crate) mod run;
|
pub(crate) mod run;
|
||||||
mod show_ticketbooks;
|
|
||||||
mod switch_gateway;
|
mod switch_gateway;
|
||||||
|
|
||||||
pub(crate) struct CliNativeClient;
|
pub(crate) struct CliNativeClient;
|
||||||
@@ -73,8 +72,8 @@ 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),
|
||||||
|
|
||||||
/// Import a pre-generated credential
|
/// Ecash-related functionalities
|
||||||
ImportCredential(CommonClientImportCredentialArgs),
|
Ecash(Ecash),
|
||||||
|
|
||||||
/// List all registered with gateways
|
/// List all registered with gateways
|
||||||
ListGateways(list_gateways::Args),
|
ListGateways(list_gateways::Args),
|
||||||
@@ -85,9 +84,6 @@ pub(crate) enum Commands {
|
|||||||
/// Change the currently active gateway. Note that you must have already registered with the new gateway!
|
/// Change the currently active gateway. Note that you must have already registered with the new gateway!
|
||||||
SwitchGateway(switch_gateway::Args),
|
SwitchGateway(switch_gateway::Args),
|
||||||
|
|
||||||
/// Display information associated with the imported ticketbooks,
|
|
||||||
ShowTicketbooks(show_ticketbooks::Args),
|
|
||||||
|
|
||||||
/// Show build information of this binary
|
/// Show build information of this binary
|
||||||
BuildInfo(build_info::BuildInfo),
|
BuildInfo(build_info::BuildInfo),
|
||||||
|
|
||||||
@@ -116,11 +112,10 @@ pub(crate) async fn execute(args: Cli) -> Result<(), Box<dyn Error + Send + Sync
|
|||||||
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::ImportCredential(m) => import_credential::execute(m).await?,
|
Commands::Ecash(ecash) => ecash.execute().await?,
|
||||||
Commands::ListGateways(args) => list_gateways::execute(args).await?,
|
Commands::ListGateways(args) => list_gateways::execute(args).await?,
|
||||||
Commands::AddGateway(args) => add_gateway::execute(args).await?,
|
Commands::AddGateway(args) => add_gateway::execute(args).await?,
|
||||||
Commands::SwitchGateway(args) => switch_gateway::execute(args).await?,
|
Commands::SwitchGateway(args) => switch_gateway::execute(args).await?,
|
||||||
Commands::ShowTicketbooks(args) => show_ticketbooks::execute(args).await?,
|
|
||||||
Commands::BuildInfo(m) => build_info::execute(m),
|
Commands::BuildInfo(m) => build_info::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),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nym-socks5-client"
|
name = "nym-socks5-client"
|
||||||
version = "1.1.39"
|
version = "1.1.42"
|
||||||
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"
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::CliSocks5Client;
|
||||||
|
use crate::error::Socks5ClientError;
|
||||||
|
use nym_client_core::cli_helpers::client_import_coin_index_signatures::{
|
||||||
|
import_coin_index_signatures, CommonClientImportCoinIndexSignaturesArgs,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub(crate) async fn execute(
|
||||||
|
args: CommonClientImportCoinIndexSignaturesArgs,
|
||||||
|
) -> Result<(), Socks5ClientError> {
|
||||||
|
import_coin_index_signatures::<CliSocks5Client, _>(args).await?;
|
||||||
|
println!("successfully imported coin index signatures!");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
+2
-4
@@ -4,12 +4,10 @@
|
|||||||
use crate::commands::CliSocks5Client;
|
use crate::commands::CliSocks5Client;
|
||||||
use crate::error::Socks5ClientError;
|
use crate::error::Socks5ClientError;
|
||||||
use nym_client_core::cli_helpers::client_import_credential::{
|
use nym_client_core::cli_helpers::client_import_credential::{
|
||||||
import_credential, CommonClientImportCredentialArgs,
|
import_credential, CommonClientImportTicketBookArgs,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) async fn execute(
|
pub async fn execute(args: CommonClientImportTicketBookArgs) -> Result<(), Socks5ClientError> {
|
||||||
args: CommonClientImportCredentialArgs,
|
|
||||||
) -> Result<(), Socks5ClientError> {
|
|
||||||
import_credential::<CliSocks5Client, _>(args).await?;
|
import_credential::<CliSocks5Client, _>(args).await?;
|
||||||
println!("successfully imported credential!");
|
println!("successfully imported credential!");
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::CliSocks5Client;
|
||||||
|
use crate::error::Socks5ClientError;
|
||||||
|
use nym_client_core::cli_helpers::client_import_expiration_date_signatures::{
|
||||||
|
import_expiration_date_signatures, CommonClientImportExpirationDateSignaturesArgs,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub(crate) async fn execute(
|
||||||
|
args: CommonClientImportExpirationDateSignaturesArgs,
|
||||||
|
) -> Result<(), Socks5ClientError> {
|
||||||
|
import_expiration_date_signatures::<CliSocks5Client, _>(args).await?;
|
||||||
|
println!("successfully imported expiration date signatures!");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::CliSocks5Client;
|
||||||
|
use crate::error::Socks5ClientError;
|
||||||
|
use nym_client_core::cli_helpers::client_import_master_verification_key::{
|
||||||
|
import_master_verification_key, CommonClientImportMasterVerificationKeyArgs,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub(crate) async fn execute(
|
||||||
|
args: CommonClientImportMasterVerificationKeyArgs,
|
||||||
|
) -> Result<(), Socks5ClientError> {
|
||||||
|
import_master_verification_key::<CliSocks5Client, _>(args).await?;
|
||||||
|
println!("successfully imported master verification key!");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use clap::{Args, Subcommand};
|
||||||
|
use nym_client_core::cli_helpers::client_import_coin_index_signatures::CommonClientImportCoinIndexSignaturesArgs;
|
||||||
|
use nym_client_core::cli_helpers::client_import_credential::CommonClientImportTicketBookArgs;
|
||||||
|
use nym_client_core::cli_helpers::client_import_expiration_date_signatures::CommonClientImportExpirationDateSignaturesArgs;
|
||||||
|
use nym_client_core::cli_helpers::client_import_master_verification_key::CommonClientImportMasterVerificationKeyArgs;
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
|
pub(crate) mod import_coin_index_signatures;
|
||||||
|
pub(crate) mod import_credential;
|
||||||
|
pub(crate) mod import_expiration_date_signatures;
|
||||||
|
pub(crate) mod import_master_verification_key;
|
||||||
|
pub(crate) mod show_ticketbooks;
|
||||||
|
|
||||||
|
#[derive(Args)]
|
||||||
|
#[clap(args_conflicts_with_subcommands = true, subcommand_required = true)]
|
||||||
|
pub struct Ecash {
|
||||||
|
#[clap(subcommand)]
|
||||||
|
pub command: EcashCommands,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Ecash {
|
||||||
|
pub async fn execute(self) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||||
|
match self.command {
|
||||||
|
EcashCommands::ShowTicketBooks(args) => show_ticketbooks::execute(args).await?,
|
||||||
|
EcashCommands::ImportTicketBook(args) => import_credential::execute(args).await?,
|
||||||
|
EcashCommands::ImportCoinIndexSignatures(args) => {
|
||||||
|
import_coin_index_signatures::execute(args).await?
|
||||||
|
}
|
||||||
|
EcashCommands::ImportExpirationDateSignatures(args) => {
|
||||||
|
import_expiration_date_signatures::execute(args).await?
|
||||||
|
}
|
||||||
|
EcashCommands::ImportMasterVerificationKey(args) => {
|
||||||
|
import_master_verification_key::execute(args).await?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum EcashCommands {
|
||||||
|
/// Display information associated with the imported ticketbooks,
|
||||||
|
ShowTicketBooks(show_ticketbooks::Args),
|
||||||
|
|
||||||
|
/// Import a pre-generated ticketbook
|
||||||
|
ImportTicketBook(CommonClientImportTicketBookArgs),
|
||||||
|
|
||||||
|
/// Import coin index signatures needed for ticketbooks
|
||||||
|
ImportCoinIndexSignatures(CommonClientImportCoinIndexSignaturesArgs),
|
||||||
|
|
||||||
|
/// Import expiration date signatures needed for ticketbooks
|
||||||
|
ImportExpirationDateSignatures(CommonClientImportExpirationDateSignaturesArgs),
|
||||||
|
|
||||||
|
/// Import master verification key needed for ticketbooks
|
||||||
|
ImportMasterVerificationKey(CommonClientImportMasterVerificationKeyArgs),
|
||||||
|
}
|
||||||
+2
-2
@@ -9,7 +9,7 @@ use nym_client_core::cli_helpers::client_show_ticketbooks::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[derive(clap::Args)]
|
#[derive(clap::Args)]
|
||||||
pub(crate) struct Args {
|
pub struct Args {
|
||||||
#[command(flatten)]
|
#[command(flatten)]
|
||||||
common_args: CommonShowTicketbooksArgs,
|
common_args: CommonShowTicketbooksArgs,
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ impl AsRef<CommonShowTicketbooksArgs> for Args {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn execute(args: Args) -> Result<(), Socks5ClientError> {
|
pub async fn execute(args: Args) -> Result<(), Socks5ClientError> {
|
||||||
let output = args.output;
|
let output = args.output;
|
||||||
let res = show_ticketbooks::<CliSocks5Client, _>(args).await?;
|
let res = show_ticketbooks::<CliSocks5Client, _>(args).await?;
|
||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::commands::ecash::Ecash;
|
||||||
use crate::config::old_config_v1_1_13::OldConfigV1_1_13;
|
use crate::config::old_config_v1_1_13::OldConfigV1_1_13;
|
||||||
use crate::config::old_config_v1_1_20::ConfigV1_1_20;
|
use crate::config::old_config_v1_1_20::ConfigV1_1_20;
|
||||||
use crate::config::old_config_v1_1_20_2::ConfigV1_1_20_2;
|
use crate::config::old_config_v1_1_20_2::ConfigV1_1_20_2;
|
||||||
@@ -13,7 +14,6 @@ use clap::{Parser, Subcommand};
|
|||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use nym_bin_common::bin_info;
|
use nym_bin_common::bin_info;
|
||||||
use nym_bin_common::completions::{fig_generate, ArgShell};
|
use nym_bin_common::completions::{fig_generate, ArgShell};
|
||||||
use nym_client_core::cli_helpers::client_import_credential::CommonClientImportCredentialArgs;
|
|
||||||
use nym_client_core::cli_helpers::CliClient;
|
use nym_client_core::cli_helpers::CliClient;
|
||||||
use nym_client_core::client::base_client::storage::migration_helpers::v1_1_33;
|
use nym_client_core::client::base_client::storage::migration_helpers::v1_1_33;
|
||||||
use nym_client_core::client::topology_control::geo_aware_provider::CountryGroup;
|
use nym_client_core::client::topology_control::geo_aware_provider::CountryGroup;
|
||||||
@@ -26,11 +26,10 @@ use std::sync::OnceLock;
|
|||||||
|
|
||||||
mod add_gateway;
|
mod add_gateway;
|
||||||
pub(crate) mod build_info;
|
pub(crate) mod build_info;
|
||||||
mod import_credential;
|
pub mod ecash;
|
||||||
pub mod init;
|
pub mod init;
|
||||||
mod list_gateways;
|
mod list_gateways;
|
||||||
pub(crate) mod run;
|
pub(crate) mod run;
|
||||||
mod show_ticketbooks;
|
|
||||||
mod switch_gateway;
|
mod switch_gateway;
|
||||||
|
|
||||||
pub(crate) struct CliSocks5Client;
|
pub(crate) struct CliSocks5Client;
|
||||||
@@ -77,8 +76,8 @@ 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),
|
||||||
|
|
||||||
/// Import a pre-generated credential
|
/// Ecash-related functionalities
|
||||||
ImportCredential(CommonClientImportCredentialArgs),
|
Ecash(Ecash),
|
||||||
|
|
||||||
/// List all registered with gateways
|
/// List all registered with gateways
|
||||||
ListGateways(list_gateways::Args),
|
ListGateways(list_gateways::Args),
|
||||||
@@ -89,9 +88,6 @@ pub(crate) enum Commands {
|
|||||||
/// Change the currently active gateway. Note that you must have already registered with the new gateway!
|
/// Change the currently active gateway. Note that you must have already registered with the new gateway!
|
||||||
SwitchGateway(switch_gateway::Args),
|
SwitchGateway(switch_gateway::Args),
|
||||||
|
|
||||||
/// Display information associated with the imported ticketbooks,
|
|
||||||
ShowTicketbooks(show_ticketbooks::Args),
|
|
||||||
|
|
||||||
/// Show build information of this binary
|
/// Show build information of this binary
|
||||||
BuildInfo(build_info::BuildInfo),
|
BuildInfo(build_info::BuildInfo),
|
||||||
|
|
||||||
@@ -123,11 +119,10 @@ pub(crate) async fn execute(args: Cli) -> Result<(), Box<dyn Error + Send + Sync
|
|||||||
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::ImportCredential(m) => import_credential::execute(m).await?,
|
Commands::Ecash(ecash) => ecash.execute().await?,
|
||||||
Commands::ListGateways(args) => list_gateways::execute(args).await?,
|
Commands::ListGateways(args) => list_gateways::execute(args).await?,
|
||||||
Commands::AddGateway(args) => add_gateway::execute(args).await?,
|
Commands::AddGateway(args) => add_gateway::execute(args).await?,
|
||||||
Commands::SwitchGateway(args) => switch_gateway::execute(args).await?,
|
Commands::SwitchGateway(args) => switch_gateway::execute(args).await?,
|
||||||
Commands::ShowTicketbooks(args) => show_ticketbooks::execute(args).await?,
|
|
||||||
Commands::BuildInfo(m) => build_info::execute(m),
|
Commands::BuildInfo(m) => build_info::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),
|
||||||
|
|||||||
@@ -9,9 +9,24 @@ edition.workspace = true
|
|||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
base64 = { workspace = true }
|
||||||
bincode = { workspace = true }
|
bincode = { workspace = true }
|
||||||
rand = { workspace = true }
|
rand = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
|
thiserror = { workspace = true }
|
||||||
|
|
||||||
|
nym-credentials-interface = { path = "../credentials-interface" }
|
||||||
|
nym-crypto = { path = "../crypto", features = ["asymmetric"] }
|
||||||
|
nym-service-provider-requests-common = { path = "../service-provider-requests-common" }
|
||||||
nym-sphinx = { path = "../nymsphinx" }
|
nym-sphinx = { path = "../nymsphinx" }
|
||||||
nym-wireguard-types = { path = "../wireguard-types" }
|
nym-wireguard-types = { path = "../wireguard-types" }
|
||||||
|
|
||||||
|
## verify:
|
||||||
|
hmac = { workspace = true, optional = true }
|
||||||
|
sha2 = { workspace = true, optional = true }
|
||||||
|
x25519-dalek = { workspace = true, features = ["static_secrets"] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["verify"]
|
||||||
|
# this is moved to a separate feature as we really need clients to import it (especially, *cough*, wasm)
|
||||||
|
verify = ["hmac", "sha2"]
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Debug, Error)]
|
||||||
|
pub enum Error {
|
||||||
|
#[error("the provided base64-encoded client MAC ('{mac}') was malformed: {source}")]
|
||||||
|
MalformedClientMac {
|
||||||
|
mac: String,
|
||||||
|
#[source]
|
||||||
|
source: base64::DecodeError,
|
||||||
|
},
|
||||||
|
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
#[error("failed to verify mac provided by '{client}': {source}")]
|
||||||
|
FailedClientMacVerification {
|
||||||
|
client: String,
|
||||||
|
#[source]
|
||||||
|
source: hmac::digest::MacError,
|
||||||
|
},
|
||||||
|
|
||||||
|
#[error("conversion: {0}")]
|
||||||
|
Conversion(String),
|
||||||
|
}
|
||||||
@@ -2,8 +2,15 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
pub mod v1;
|
pub mod v1;
|
||||||
|
pub mod v2;
|
||||||
|
pub mod v3;
|
||||||
|
|
||||||
pub const CURRENT_VERSION: u8 = 1;
|
mod error;
|
||||||
|
|
||||||
|
pub use error::Error;
|
||||||
|
pub use v3 as latest;
|
||||||
|
|
||||||
|
pub const CURRENT_VERSION: u8 = 3;
|
||||||
|
|
||||||
fn make_bincode_serializer() -> impl bincode::Options {
|
fn make_bincode_serializer() -> impl bincode::Options {
|
||||||
use bincode::Options;
|
use bincode::Options;
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
pub mod registration;
|
||||||
pub mod request;
|
pub mod request;
|
||||||
pub mod response;
|
pub mod response;
|
||||||
|
|
||||||
const VERSION: u8 = 1;
|
pub use registration::{ClientMac, GatewayClient, InitMessage, Nonce};
|
||||||
|
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub use registration::HmacSha256;
|
||||||
|
|
||||||
|
pub const VERSION: u8 = 1;
|
||||||
|
|||||||
@@ -0,0 +1,218 @@
|
|||||||
|
// Copyright 2023-2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::error::Error;
|
||||||
|
use base64::{engine::general_purpose, Engine};
|
||||||
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
use std::net::IpAddr;
|
||||||
|
use std::time::SystemTime;
|
||||||
|
use std::{fmt, ops::Deref, str::FromStr};
|
||||||
|
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
use hmac::{Hmac, Mac};
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
use nym_crypto::asymmetric::encryption::PrivateKey;
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
use sha2::Sha256;
|
||||||
|
|
||||||
|
pub type PendingRegistrations = HashMap<PeerPublicKey, RegistrationData>;
|
||||||
|
pub type PrivateIPs = HashMap<IpAddr, Taken>;
|
||||||
|
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub type HmacSha256 = Hmac<Sha256>;
|
||||||
|
|
||||||
|
pub type Nonce = u64;
|
||||||
|
pub type Taken = Option<SystemTime>;
|
||||||
|
|
||||||
|
pub const BANDWIDTH_CAP_PER_DAY: i64 = 1024 * 1024 * 1024; // 1 GB
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct InitMessage {
|
||||||
|
/// Base64 encoded x25519 public key
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl InitMessage {
|
||||||
|
pub fn new(pub_key: PeerPublicKey) -> Self {
|
||||||
|
InitMessage { pub_key }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct RegistrationData {
|
||||||
|
pub nonce: u64,
|
||||||
|
pub gateway_data: GatewayClient,
|
||||||
|
pub wg_port: u16,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct RegistredData {
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
pub private_ip: IpAddr,
|
||||||
|
pub wg_port: u16,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct RemainingBandwidthData {
|
||||||
|
pub available_bandwidth: u64,
|
||||||
|
pub suspended: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Client that wants to register sends its PublicKey bytes mac digest encrypted with a DH shared secret.
|
||||||
|
/// Gateway/Nym node can then verify pub_key payload using the same process
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct GatewayClient {
|
||||||
|
/// Base64 encoded x25519 public key
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
|
||||||
|
/// Assigned private IP
|
||||||
|
pub private_ip: IpAddr,
|
||||||
|
|
||||||
|
/// Sha256 hmac on the data (alongside the prior nonce)
|
||||||
|
pub mac: ClientMac,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl GatewayClient {
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub fn new(
|
||||||
|
local_secret: &PrivateKey,
|
||||||
|
remote_public: x25519_dalek::PublicKey,
|
||||||
|
private_ip: IpAddr,
|
||||||
|
nonce: u64,
|
||||||
|
) -> Self {
|
||||||
|
// convert from 1.0 x25519-dalek private key into 2.0 x25519-dalek
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let static_secret = x25519_dalek::StaticSecret::from(local_secret.to_bytes());
|
||||||
|
let local_public: x25519_dalek::PublicKey = (&static_secret).into();
|
||||||
|
|
||||||
|
let dh = static_secret.diffie_hellman(&remote_public);
|
||||||
|
|
||||||
|
// TODO: change that to use our nym_crypto::hmac module instead
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let mut mac = HmacSha256::new_from_slice(dh.as_bytes())
|
||||||
|
.expect("x25519 shared secret is always 32 bytes long");
|
||||||
|
|
||||||
|
mac.update(local_public.as_bytes());
|
||||||
|
mac.update(private_ip.to_string().as_bytes());
|
||||||
|
mac.update(&nonce.to_le_bytes());
|
||||||
|
|
||||||
|
GatewayClient {
|
||||||
|
pub_key: PeerPublicKey::new(local_public),
|
||||||
|
private_ip,
|
||||||
|
mac: ClientMac(mac.finalize().into_bytes().to_vec()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reusable secret should be gateways Wireguard PK
|
||||||
|
// Client should perform this step when generating its payload, using its own WG PK
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub fn verify(&self, gateway_key: &PrivateKey, nonce: u64) -> Result<(), Error> {
|
||||||
|
// convert from 1.0 x25519-dalek private key into 2.0 x25519-dalek
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let static_secret = x25519_dalek::StaticSecret::from(gateway_key.to_bytes());
|
||||||
|
|
||||||
|
let dh = static_secret.diffie_hellman(&self.pub_key);
|
||||||
|
|
||||||
|
// TODO: change that to use our nym_crypto::hmac module instead
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let mut mac = HmacSha256::new_from_slice(dh.as_bytes())
|
||||||
|
.expect("x25519 shared secret is always 32 bytes long");
|
||||||
|
|
||||||
|
mac.update(self.pub_key.as_bytes());
|
||||||
|
mac.update(self.private_ip.to_string().as_bytes());
|
||||||
|
mac.update(&nonce.to_le_bytes());
|
||||||
|
|
||||||
|
mac.verify_slice(&self.mac)
|
||||||
|
.map_err(|source| Error::FailedClientMacVerification {
|
||||||
|
client: self.pub_key.to_string(),
|
||||||
|
source,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn pub_key(&self) -> PeerPublicKey {
|
||||||
|
self.pub_key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: change the inner type into generic array of size HmacSha256::OutputSize
|
||||||
|
// TODO2: rely on our internal crypto/hmac
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct ClientMac(Vec<u8>);
|
||||||
|
|
||||||
|
impl fmt::Display for ClientMac {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
write!(f, "{}", general_purpose::STANDARD.encode(&self.0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ClientMac {
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn new(mac: Vec<u8>) -> Self {
|
||||||
|
ClientMac(mac)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Deref for ClientMac {
|
||||||
|
type Target = Vec<u8>;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for ClientMac {
|
||||||
|
type Err = Error;
|
||||||
|
|
||||||
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
|
let mac_bytes: Vec<u8> =
|
||||||
|
general_purpose::STANDARD
|
||||||
|
.decode(s)
|
||||||
|
.map_err(|source| Error::MalformedClientMac {
|
||||||
|
mac: s.to_string(),
|
||||||
|
source,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
Ok(ClientMac(mac_bytes))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Serialize for ClientMac {
|
||||||
|
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||||
|
let encoded_key = general_purpose::STANDARD.encode(self.0.clone());
|
||||||
|
serializer.serialize_str(&encoded_key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'de> Deserialize<'de> for ClientMac {
|
||||||
|
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
||||||
|
let encoded_key = String::deserialize(deserializer)?;
|
||||||
|
ClientMac::from_str(&encoded_key).map_err(serde::de::Error::custom)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use nym_crypto::asymmetric::encryption;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
fn client_request_roundtrip() {
|
||||||
|
let mut rng = rand::thread_rng();
|
||||||
|
|
||||||
|
let gateway_key_pair = encryption::KeyPair::new(&mut rng);
|
||||||
|
let client_key_pair = encryption::KeyPair::new(&mut rng);
|
||||||
|
|
||||||
|
let nonce = 1234567890;
|
||||||
|
|
||||||
|
let client = GatewayClient::new(
|
||||||
|
client_key_pair.private_key(),
|
||||||
|
x25519_dalek::PublicKey::from(gateway_key_pair.public_key().to_bytes()),
|
||||||
|
"10.0.0.42".parse().unwrap(),
|
||||||
|
nonce,
|
||||||
|
);
|
||||||
|
assert!(client.verify(gateway_key_pair.private_key(), nonce).is_ok())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use super::registration::{GatewayClient, InitMessage};
|
||||||
use nym_sphinx::addressing::Recipient;
|
use nym_sphinx::addressing::Recipient;
|
||||||
use nym_wireguard_types::{GatewayClient, InitMessage, PeerPublicKey};
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::make_bincode_serializer;
|
use crate::make_bincode_serializer;
|
||||||
@@ -82,3 +83,24 @@ pub enum AuthenticatorRequestData {
|
|||||||
Final(GatewayClient),
|
Final(GatewayClient),
|
||||||
QueryBandwidth(PeerPublicKey),
|
QueryBandwidth(PeerPublicKey),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check_first_byte_version() {
|
||||||
|
let version = 2;
|
||||||
|
let data = AuthenticatorRequest {
|
||||||
|
version,
|
||||||
|
data: AuthenticatorRequestData::Initial(InitMessage::new(
|
||||||
|
PeerPublicKey::from_str("yvNUDpT5l7W/xDhiu6HkqTHDQwbs/B3J5UrLmORl1EQ=").unwrap(),
|
||||||
|
)),
|
||||||
|
reply_to: Recipient::try_from_base58_string("D1rrpsysCGCYXy9saP8y3kmNpGtJZUXN9SvFoUcqAsM9.9Ssso1ea5NfkbMASdiseDSjTN1fSWda5SgEVjdSN4CvV@GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN").unwrap(),
|
||||||
|
request_id: 1,
|
||||||
|
};
|
||||||
|
let bytes = data.to_bytes().unwrap();
|
||||||
|
assert_eq!(*bytes.first().unwrap(), version);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use super::registration::{RegistrationData, RegistredData, RemainingBandwidthData};
|
||||||
use nym_sphinx::addressing::Recipient;
|
use nym_sphinx::addressing::Recipient;
|
||||||
use nym_wireguard_types::registration::{RegistrationData, RegistredData, RemainingBandwidthData};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::make_bincode_serializer;
|
use crate::make_bincode_serializer;
|
||||||
|
|||||||
@@ -0,0 +1,174 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use nym_service_provider_requests_common::{Protocol, ServiceProviderType};
|
||||||
|
|
||||||
|
use crate::{v1, v2};
|
||||||
|
|
||||||
|
impl From<v1::request::AuthenticatorRequest> for v2::request::AuthenticatorRequest {
|
||||||
|
fn from(authenticator_request: v1::request::AuthenticatorRequest) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
version: 2,
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
},
|
||||||
|
data: authenticator_request.data.into(),
|
||||||
|
reply_to: authenticator_request.reply_to,
|
||||||
|
request_id: authenticator_request.request_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v1::request::AuthenticatorRequestData> for v2::request::AuthenticatorRequestData {
|
||||||
|
fn from(authenticator_request_data: v1::request::AuthenticatorRequestData) -> Self {
|
||||||
|
match authenticator_request_data {
|
||||||
|
v1::request::AuthenticatorRequestData::Initial(init_msg) => {
|
||||||
|
v2::request::AuthenticatorRequestData::Initial(init_msg.into())
|
||||||
|
}
|
||||||
|
v1::request::AuthenticatorRequestData::Final(gw_client) => {
|
||||||
|
v2::request::AuthenticatorRequestData::Final(gw_client.into())
|
||||||
|
}
|
||||||
|
v1::request::AuthenticatorRequestData::QueryBandwidth(pub_key) => {
|
||||||
|
v2::request::AuthenticatorRequestData::QueryBandwidth(pub_key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v1::registration::InitMessage> for v2::registration::InitMessage {
|
||||||
|
fn from(init_msg: v1::registration::InitMessage) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: init_msg.pub_key,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v1::registration::GatewayClient> for Box<v2::registration::FinalMessage> {
|
||||||
|
fn from(gw_client: v1::registration::GatewayClient) -> Self {
|
||||||
|
Box::new(v2::registration::FinalMessage {
|
||||||
|
gateway_client: gw_client.into(),
|
||||||
|
credential: None,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v1::registration::GatewayClient> for v2::registration::GatewayClient {
|
||||||
|
fn from(gw_client: v1::registration::GatewayClient) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: gw_client.pub_key,
|
||||||
|
private_ip: gw_client.private_ip,
|
||||||
|
mac: gw_client.mac.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::GatewayClient> for v1::registration::GatewayClient {
|
||||||
|
fn from(gw_client: v2::registration::GatewayClient) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: gw_client.pub_key,
|
||||||
|
private_ip: gw_client.private_ip,
|
||||||
|
mac: gw_client.mac.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v1::registration::ClientMac> for v2::registration::ClientMac {
|
||||||
|
fn from(mac: v1::registration::ClientMac) -> Self {
|
||||||
|
Self::new(mac.to_vec())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::ClientMac> for v1::registration::ClientMac {
|
||||||
|
fn from(mac: v2::registration::ClientMac) -> Self {
|
||||||
|
Self::new(mac.to_vec())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::response::AuthenticatorResponse> for v1::response::AuthenticatorResponse {
|
||||||
|
fn from(authenticator_response: v2::response::AuthenticatorResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
version: authenticator_response.protocol.version,
|
||||||
|
data: authenticator_response.data.into(),
|
||||||
|
reply_to: authenticator_response.reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::response::AuthenticatorResponseData> for v1::response::AuthenticatorResponseData {
|
||||||
|
fn from(authenticator_response_data: v2::response::AuthenticatorResponseData) -> Self {
|
||||||
|
match authenticator_response_data {
|
||||||
|
v2::response::AuthenticatorResponseData::PendingRegistration(
|
||||||
|
pending_registration_response,
|
||||||
|
) => v1::response::AuthenticatorResponseData::PendingRegistration(
|
||||||
|
pending_registration_response.into(),
|
||||||
|
),
|
||||||
|
v2::response::AuthenticatorResponseData::Registered(registered_response) => {
|
||||||
|
v1::response::AuthenticatorResponseData::Registered(registered_response.into())
|
||||||
|
}
|
||||||
|
v2::response::AuthenticatorResponseData::RemainingBandwidth(
|
||||||
|
remaining_bandwidth_response,
|
||||||
|
) => v1::response::AuthenticatorResponseData::RemainingBandwidth(
|
||||||
|
remaining_bandwidth_response.into(),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::response::PendingRegistrationResponse> for v1::response::PendingRegistrationResponse {
|
||||||
|
fn from(value: v2::response::PendingRegistrationResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
request_id: value.request_id,
|
||||||
|
reply_to: value.reply_to,
|
||||||
|
reply: value.reply.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::response::RegisteredResponse> for v1::response::RegisteredResponse {
|
||||||
|
fn from(value: v2::response::RegisteredResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
request_id: value.request_id,
|
||||||
|
reply_to: value.reply_to,
|
||||||
|
reply: value.reply.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::response::RemainingBandwidthResponse> for v1::response::RemainingBandwidthResponse {
|
||||||
|
fn from(value: v2::response::RemainingBandwidthResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
request_id: value.request_id,
|
||||||
|
reply_to: value.reply_to,
|
||||||
|
reply: value.reply.map(Into::into),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::RegistrationData> for v1::registration::RegistrationData {
|
||||||
|
fn from(value: v2::registration::RegistrationData) -> Self {
|
||||||
|
Self {
|
||||||
|
nonce: value.nonce,
|
||||||
|
gateway_data: value.gateway_data.into(),
|
||||||
|
wg_port: value.wg_port,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::RegistredData> for v1::registration::RegistredData {
|
||||||
|
fn from(value: v2::registration::RegistredData) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: value.pub_key,
|
||||||
|
private_ip: value.private_ip,
|
||||||
|
wg_port: value.wg_port,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::RemainingBandwidthData> for v1::registration::RemainingBandwidthData {
|
||||||
|
fn from(value: v2::registration::RemainingBandwidthData) -> Self {
|
||||||
|
Self {
|
||||||
|
available_bandwidth: value.available_bandwidth as u64,
|
||||||
|
suspended: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
pub mod conversion;
|
||||||
|
pub mod registration;
|
||||||
|
pub mod request;
|
||||||
|
pub mod response;
|
||||||
|
|
||||||
|
pub const VERSION: u8 = 2;
|
||||||
+13
-22
@@ -1,9 +1,10 @@
|
|||||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2023-2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
use crate::PeerPublicKey;
|
|
||||||
use base64::{engine::general_purpose, Engine};
|
use base64::{engine::general_purpose, Engine};
|
||||||
|
use nym_credentials_interface::CredentialSpendingData;
|
||||||
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::net::IpAddr;
|
use std::net::IpAddr;
|
||||||
@@ -29,32 +30,26 @@ pub type Taken = Option<SystemTime>;
|
|||||||
pub const BANDWIDTH_CAP_PER_DAY: u64 = 1024 * 1024 * 1024; // 1 GB
|
pub const BANDWIDTH_CAP_PER_DAY: u64 = 1024 * 1024 * 1024; // 1 GB
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
#[serde(tag = "type", rename_all = "camelCase")]
|
|
||||||
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
|
|
||||||
pub enum ClientMessage {
|
|
||||||
Initial(InitMessage),
|
|
||||||
Final(GatewayClient),
|
|
||||||
Query(PeerPublicKey),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
||||||
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
|
|
||||||
pub struct InitMessage {
|
pub struct InitMessage {
|
||||||
/// Base64 encoded x25519 public key
|
/// Base64 encoded x25519 public key
|
||||||
#[cfg_attr(feature = "openapi", schema(value_type = String, format = Byte))]
|
|
||||||
pub pub_key: PeerPublicKey,
|
pub pub_key: PeerPublicKey,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InitMessage {
|
impl InitMessage {
|
||||||
pub fn pub_key(&self) -> PeerPublicKey {
|
|
||||||
self.pub_key
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new(pub_key: PeerPublicKey) -> Self {
|
pub fn new(pub_key: PeerPublicKey) -> Self {
|
||||||
InitMessage { pub_key }
|
InitMessage { pub_key }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct FinalMessage {
|
||||||
|
/// Gateway client data
|
||||||
|
pub gateway_client: GatewayClient,
|
||||||
|
|
||||||
|
/// Ecash credential
|
||||||
|
pub credential: Option<CredentialSpendingData>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct RegistrationData {
|
pub struct RegistrationData {
|
||||||
pub nonce: u64,
|
pub nonce: u64,
|
||||||
@@ -71,24 +66,20 @@ pub struct RegistredData {
|
|||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct RemainingBandwidthData {
|
pub struct RemainingBandwidthData {
|
||||||
pub available_bandwidth: u64,
|
pub available_bandwidth: i64,
|
||||||
pub suspended: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Client that wants to register sends its PublicKey bytes mac digest encrypted with a DH shared secret.
|
/// Client that wants to register sends its PublicKey bytes mac digest encrypted with a DH shared secret.
|
||||||
/// Gateway/Nym node can then verify pub_key payload using the same process
|
/// Gateway/Nym node can then verify pub_key payload using the same process
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
|
|
||||||
pub struct GatewayClient {
|
pub struct GatewayClient {
|
||||||
/// Base64 encoded x25519 public key
|
/// Base64 encoded x25519 public key
|
||||||
#[cfg_attr(feature = "openapi", schema(value_type = String, format = Byte))]
|
|
||||||
pub pub_key: PeerPublicKey,
|
pub pub_key: PeerPublicKey,
|
||||||
|
|
||||||
/// Assigned private IP
|
/// Assigned private IP
|
||||||
pub private_ip: IpAddr,
|
pub private_ip: IpAddr,
|
||||||
|
|
||||||
/// Sha256 hmac on the data (alongside the prior nonce)
|
/// Sha256 hmac on the data (alongside the prior nonce)
|
||||||
#[cfg_attr(feature = "openapi", schema(value_type = String, format = Byte))]
|
|
||||||
pub mac: ClientMac,
|
pub mac: ClientMac,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use super::registration::{FinalMessage, InitMessage};
|
||||||
|
use nym_service_provider_requests_common::{Protocol, ServiceProviderType};
|
||||||
|
use nym_sphinx::addressing::Recipient;
|
||||||
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::make_bincode_serializer;
|
||||||
|
|
||||||
|
use super::VERSION;
|
||||||
|
|
||||||
|
fn generate_random() -> u64 {
|
||||||
|
use rand::RngCore;
|
||||||
|
let mut rng = rand::rngs::OsRng;
|
||||||
|
rng.next_u64()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct AuthenticatorRequest {
|
||||||
|
pub protocol: Protocol,
|
||||||
|
pub data: AuthenticatorRequestData,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub request_id: u64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AuthenticatorRequest {
|
||||||
|
pub fn from_reconstructed_message(
|
||||||
|
message: &nym_sphinx::receiver::ReconstructedMessage,
|
||||||
|
) -> Result<Self, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().deserialize(&message.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_initial_request(init_message: InitMessage, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::Initial(init_message),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_final_request(final_message: FinalMessage, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::Final(Box::new(final_message)),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_query_request(peer_public_key: PeerPublicKey, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::QueryBandwidth(peer_public_key),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn to_bytes(&self) -> Result<Vec<u8>, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().serialize(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub enum AuthenticatorRequestData {
|
||||||
|
Initial(InitMessage),
|
||||||
|
Final(Box<FinalMessage>),
|
||||||
|
QueryBandwidth(PeerPublicKey),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check_first_bytes_protocol() {
|
||||||
|
let version = 2;
|
||||||
|
let data = AuthenticatorRequest {
|
||||||
|
protocol: Protocol { version, service_provider_type: ServiceProviderType::Authenticator },
|
||||||
|
data: AuthenticatorRequestData::Initial(InitMessage::new(
|
||||||
|
PeerPublicKey::from_str("yvNUDpT5l7W/xDhiu6HkqTHDQwbs/B3J5UrLmORl1EQ=").unwrap(),
|
||||||
|
)),
|
||||||
|
reply_to: Recipient::try_from_base58_string("D1rrpsysCGCYXy9saP8y3kmNpGtJZUXN9SvFoUcqAsM9.9Ssso1ea5NfkbMASdiseDSjTN1fSWda5SgEVjdSN4CvV@GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN").unwrap(),
|
||||||
|
request_id: 1,
|
||||||
|
};
|
||||||
|
let bytes = *data.to_bytes().unwrap().first_chunk::<2>().unwrap();
|
||||||
|
assert_eq!(bytes, [version, ServiceProviderType::Authenticator as u8]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use super::registration::{RegistrationData, RegistredData, RemainingBandwidthData};
|
||||||
|
use nym_service_provider_requests_common::{Protocol, ServiceProviderType};
|
||||||
|
use nym_sphinx::addressing::Recipient;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::make_bincode_serializer;
|
||||||
|
|
||||||
|
use super::VERSION;
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct AuthenticatorResponse {
|
||||||
|
pub protocol: Protocol,
|
||||||
|
pub data: AuthenticatorResponseData,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AuthenticatorResponse {
|
||||||
|
pub fn new_pending_registration_success(
|
||||||
|
registration_data: RegistrationData,
|
||||||
|
request_id: u64,
|
||||||
|
reply_to: Recipient,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::PendingRegistration(PendingRegistrationResponse {
|
||||||
|
reply: registration_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_registered(
|
||||||
|
registred_data: RegistredData,
|
||||||
|
reply_to: Recipient,
|
||||||
|
request_id: u64,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::Registered(RegisteredResponse {
|
||||||
|
reply: registred_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_remaining_bandwidth(
|
||||||
|
remaining_bandwidth_data: Option<RemainingBandwidthData>,
|
||||||
|
reply_to: Recipient,
|
||||||
|
request_id: u64,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::RemainingBandwidth(RemainingBandwidthResponse {
|
||||||
|
reply: remaining_bandwidth_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn recipient(&self) -> Recipient {
|
||||||
|
self.reply_to
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn to_bytes(&self) -> Result<Vec<u8>, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().serialize(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_reconstructed_message(
|
||||||
|
message: &nym_sphinx::receiver::ReconstructedMessage,
|
||||||
|
) -> Result<Self, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().deserialize(&message.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn id(&self) -> Option<u64> {
|
||||||
|
match &self.data {
|
||||||
|
AuthenticatorResponseData::PendingRegistration(response) => Some(response.request_id),
|
||||||
|
AuthenticatorResponseData::Registered(response) => Some(response.request_id),
|
||||||
|
AuthenticatorResponseData::RemainingBandwidth(response) => Some(response.request_id),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub enum AuthenticatorResponseData {
|
||||||
|
PendingRegistration(PendingRegistrationResponse),
|
||||||
|
Registered(RegisteredResponse),
|
||||||
|
RemainingBandwidth(RemainingBandwidthResponse),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct PendingRegistrationResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: RegistrationData,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct RegisteredResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: RegistredData,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct RemainingBandwidthResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: Option<RemainingBandwidthData>,
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use nym_service_provider_requests_common::{Protocol, ServiceProviderType};
|
||||||
|
|
||||||
|
use crate::{v2, v3};
|
||||||
|
|
||||||
|
impl From<v2::request::AuthenticatorRequest> for v3::request::AuthenticatorRequest {
|
||||||
|
fn from(authenticator_request: v2::request::AuthenticatorRequest) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
version: 2,
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
},
|
||||||
|
data: authenticator_request.data.into(),
|
||||||
|
reply_to: authenticator_request.reply_to,
|
||||||
|
request_id: authenticator_request.request_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::request::AuthenticatorRequestData> for v3::request::AuthenticatorRequestData {
|
||||||
|
fn from(authenticator_request_data: v2::request::AuthenticatorRequestData) -> Self {
|
||||||
|
match authenticator_request_data {
|
||||||
|
v2::request::AuthenticatorRequestData::Initial(init_msg) => {
|
||||||
|
v3::request::AuthenticatorRequestData::Initial(init_msg.into())
|
||||||
|
}
|
||||||
|
v2::request::AuthenticatorRequestData::Final(gw_client) => {
|
||||||
|
v3::request::AuthenticatorRequestData::Final(gw_client.into())
|
||||||
|
}
|
||||||
|
v2::request::AuthenticatorRequestData::QueryBandwidth(pub_key) => {
|
||||||
|
v3::request::AuthenticatorRequestData::QueryBandwidth(pub_key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::InitMessage> for v3::registration::InitMessage {
|
||||||
|
fn from(init_msg: v2::registration::InitMessage) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: init_msg.pub_key,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Box<v2::registration::FinalMessage>> for Box<v3::registration::FinalMessage> {
|
||||||
|
fn from(gw_client: Box<v2::registration::FinalMessage>) -> Self {
|
||||||
|
Box::new(v3::registration::FinalMessage {
|
||||||
|
gateway_client: gw_client.gateway_client.into(),
|
||||||
|
credential: gw_client.credential,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::GatewayClient> for v3::registration::GatewayClient {
|
||||||
|
fn from(gw_client: v2::registration::GatewayClient) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: gw_client.pub_key,
|
||||||
|
private_ip: gw_client.private_ip,
|
||||||
|
mac: gw_client.mac.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::registration::GatewayClient> for v2::registration::GatewayClient {
|
||||||
|
fn from(gw_client: v3::registration::GatewayClient) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: gw_client.pub_key,
|
||||||
|
private_ip: gw_client.private_ip,
|
||||||
|
mac: gw_client.mac.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v2::registration::ClientMac> for v3::registration::ClientMac {
|
||||||
|
fn from(mac: v2::registration::ClientMac) -> Self {
|
||||||
|
Self::new(mac.to_vec())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::registration::ClientMac> for v2::registration::ClientMac {
|
||||||
|
fn from(mac: v3::registration::ClientMac) -> Self {
|
||||||
|
Self::new(mac.to_vec())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<v3::response::AuthenticatorResponse> for v2::response::AuthenticatorResponse {
|
||||||
|
type Error = crate::Error;
|
||||||
|
|
||||||
|
fn try_from(
|
||||||
|
authenticator_response: v3::response::AuthenticatorResponse,
|
||||||
|
) -> Result<Self, Self::Error> {
|
||||||
|
Ok(Self {
|
||||||
|
data: authenticator_response.data.try_into()?,
|
||||||
|
reply_to: authenticator_response.reply_to,
|
||||||
|
protocol: authenticator_response.protocol,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<v3::response::AuthenticatorResponseData> for v2::response::AuthenticatorResponseData {
|
||||||
|
type Error = crate::Error;
|
||||||
|
|
||||||
|
fn try_from(
|
||||||
|
authenticator_response_data: v3::response::AuthenticatorResponseData,
|
||||||
|
) -> Result<Self, Self::Error> {
|
||||||
|
match authenticator_response_data {
|
||||||
|
v3::response::AuthenticatorResponseData::PendingRegistration(
|
||||||
|
pending_registration_response,
|
||||||
|
) => Ok(
|
||||||
|
v2::response::AuthenticatorResponseData::PendingRegistration(
|
||||||
|
pending_registration_response.into(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
v3::response::AuthenticatorResponseData::Registered(registered_response) => Ok(
|
||||||
|
v2::response::AuthenticatorResponseData::Registered(registered_response.into()),
|
||||||
|
),
|
||||||
|
v3::response::AuthenticatorResponseData::RemainingBandwidth(
|
||||||
|
remaining_bandwidth_response,
|
||||||
|
) => Ok(v2::response::AuthenticatorResponseData::RemainingBandwidth(
|
||||||
|
remaining_bandwidth_response.into(),
|
||||||
|
)),
|
||||||
|
v3::response::AuthenticatorResponseData::TopUpBandwidth(_) => {
|
||||||
|
Err(Self::Error::Conversion(
|
||||||
|
"a v2 request couldn't produce a v3 only type of response".to_string(),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::response::PendingRegistrationResponse> for v2::response::PendingRegistrationResponse {
|
||||||
|
fn from(value: v3::response::PendingRegistrationResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
request_id: value.request_id,
|
||||||
|
reply_to: value.reply_to,
|
||||||
|
reply: value.reply.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::response::RegisteredResponse> for v2::response::RegisteredResponse {
|
||||||
|
fn from(value: v3::response::RegisteredResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
request_id: value.request_id,
|
||||||
|
reply_to: value.reply_to,
|
||||||
|
reply: value.reply.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::response::RemainingBandwidthResponse> for v2::response::RemainingBandwidthResponse {
|
||||||
|
fn from(value: v3::response::RemainingBandwidthResponse) -> Self {
|
||||||
|
Self {
|
||||||
|
request_id: value.request_id,
|
||||||
|
reply_to: value.reply_to,
|
||||||
|
reply: value.reply.map(Into::into),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::registration::RegistrationData> for v2::registration::RegistrationData {
|
||||||
|
fn from(value: v3::registration::RegistrationData) -> Self {
|
||||||
|
Self {
|
||||||
|
nonce: value.nonce,
|
||||||
|
gateway_data: value.gateway_data.into(),
|
||||||
|
wg_port: value.wg_port,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::registration::RegistredData> for v2::registration::RegistredData {
|
||||||
|
fn from(value: v3::registration::RegistredData) -> Self {
|
||||||
|
Self {
|
||||||
|
pub_key: value.pub_key,
|
||||||
|
private_ip: value.private_ip,
|
||||||
|
wg_port: value.wg_port,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<v3::registration::RemainingBandwidthData> for v2::registration::RemainingBandwidthData {
|
||||||
|
fn from(value: v3::registration::RemainingBandwidthData) -> Self {
|
||||||
|
Self {
|
||||||
|
available_bandwidth: value.available_bandwidth,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
pub mod conversion;
|
||||||
|
pub mod registration;
|
||||||
|
pub mod request;
|
||||||
|
pub mod response;
|
||||||
|
pub mod topup;
|
||||||
|
|
||||||
|
pub const VERSION: u8 = 3;
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
// -2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use crate::error::Error;
|
||||||
|
use base64::{engine::general_purpose, Engine};
|
||||||
|
use nym_credentials_interface::CredentialSpendingData;
|
||||||
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
use std::net::IpAddr;
|
||||||
|
use std::time::SystemTime;
|
||||||
|
use std::{fmt, ops::Deref, str::FromStr};
|
||||||
|
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
use hmac::{Hmac, Mac};
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
use nym_crypto::asymmetric::encryption::PrivateKey;
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
use sha2::Sha256;
|
||||||
|
|
||||||
|
pub type PendingRegistrations = HashMap<PeerPublicKey, RegistrationData>;
|
||||||
|
pub type PrivateIPs = HashMap<IpAddr, Taken>;
|
||||||
|
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub type HmacSha256 = Hmac<Sha256>;
|
||||||
|
|
||||||
|
pub type Nonce = u64;
|
||||||
|
pub type Taken = Option<SystemTime>;
|
||||||
|
|
||||||
|
pub const BANDWIDTH_CAP_PER_DAY: u64 = 1024 * 1024 * 1024; // 1 GB
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct InitMessage {
|
||||||
|
/// Base64 encoded x25519 public key
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl InitMessage {
|
||||||
|
pub fn new(pub_key: PeerPublicKey) -> Self {
|
||||||
|
InitMessage { pub_key }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct FinalMessage {
|
||||||
|
/// Gateway client data
|
||||||
|
pub gateway_client: GatewayClient,
|
||||||
|
|
||||||
|
/// Ecash credential
|
||||||
|
pub credential: Option<CredentialSpendingData>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct RegistrationData {
|
||||||
|
pub nonce: u64,
|
||||||
|
pub gateway_data: GatewayClient,
|
||||||
|
pub wg_port: u16,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct RegistredData {
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
pub private_ip: IpAddr,
|
||||||
|
pub wg_port: u16,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct RemainingBandwidthData {
|
||||||
|
pub available_bandwidth: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Client that wants to register sends its PublicKey bytes mac digest encrypted with a DH shared secret.
|
||||||
|
/// Gateway/Nym node can then verify pub_key payload using the same process
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct GatewayClient {
|
||||||
|
/// Base64 encoded x25519 public key
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
|
||||||
|
/// Assigned private IP
|
||||||
|
pub private_ip: IpAddr,
|
||||||
|
|
||||||
|
/// Sha256 hmac on the data (alongside the prior nonce)
|
||||||
|
pub mac: ClientMac,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl GatewayClient {
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub fn new(
|
||||||
|
local_secret: &PrivateKey,
|
||||||
|
remote_public: x25519_dalek::PublicKey,
|
||||||
|
private_ip: IpAddr,
|
||||||
|
nonce: u64,
|
||||||
|
) -> Self {
|
||||||
|
// convert from 1.0 x25519-dalek private key into 2.0 x25519-dalek
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let static_secret = x25519_dalek::StaticSecret::from(local_secret.to_bytes());
|
||||||
|
let local_public: x25519_dalek::PublicKey = (&static_secret).into();
|
||||||
|
|
||||||
|
let dh = static_secret.diffie_hellman(&remote_public);
|
||||||
|
|
||||||
|
// TODO: change that to use our nym_crypto::hmac module instead
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let mut mac = HmacSha256::new_from_slice(dh.as_bytes())
|
||||||
|
.expect("x25519 shared secret is always 32 bytes long");
|
||||||
|
|
||||||
|
mac.update(local_public.as_bytes());
|
||||||
|
mac.update(private_ip.to_string().as_bytes());
|
||||||
|
mac.update(&nonce.to_le_bytes());
|
||||||
|
|
||||||
|
GatewayClient {
|
||||||
|
pub_key: PeerPublicKey::new(local_public),
|
||||||
|
private_ip,
|
||||||
|
mac: ClientMac(mac.finalize().into_bytes().to_vec()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reusable secret should be gateways Wireguard PK
|
||||||
|
// Client should perform this step when generating its payload, using its own WG PK
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
pub fn verify(&self, gateway_key: &PrivateKey, nonce: u64) -> Result<(), Error> {
|
||||||
|
// convert from 1.0 x25519-dalek private key into 2.0 x25519-dalek
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let static_secret = x25519_dalek::StaticSecret::from(gateway_key.to_bytes());
|
||||||
|
|
||||||
|
let dh = static_secret.diffie_hellman(&self.pub_key);
|
||||||
|
|
||||||
|
// TODO: change that to use our nym_crypto::hmac module instead
|
||||||
|
#[allow(clippy::expect_used)]
|
||||||
|
let mut mac = HmacSha256::new_from_slice(dh.as_bytes())
|
||||||
|
.expect("x25519 shared secret is always 32 bytes long");
|
||||||
|
|
||||||
|
mac.update(self.pub_key.as_bytes());
|
||||||
|
mac.update(self.private_ip.to_string().as_bytes());
|
||||||
|
mac.update(&nonce.to_le_bytes());
|
||||||
|
|
||||||
|
mac.verify_slice(&self.mac)
|
||||||
|
.map_err(|source| Error::FailedClientMacVerification {
|
||||||
|
client: self.pub_key.to_string(),
|
||||||
|
source,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn pub_key(&self) -> PeerPublicKey {
|
||||||
|
self.pub_key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: change the inner type into generic array of size HmacSha256::OutputSize
|
||||||
|
// TODO2: rely on our internal crypto/hmac
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct ClientMac(Vec<u8>);
|
||||||
|
|
||||||
|
impl fmt::Display for ClientMac {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
write!(f, "{}", general_purpose::STANDARD.encode(&self.0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ClientMac {
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn new(mac: Vec<u8>) -> Self {
|
||||||
|
ClientMac(mac)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Deref for ClientMac {
|
||||||
|
type Target = Vec<u8>;
|
||||||
|
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for ClientMac {
|
||||||
|
type Err = Error;
|
||||||
|
|
||||||
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
|
let mac_bytes: Vec<u8> =
|
||||||
|
general_purpose::STANDARD
|
||||||
|
.decode(s)
|
||||||
|
.map_err(|source| Error::MalformedClientMac {
|
||||||
|
mac: s.to_string(),
|
||||||
|
source,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
Ok(ClientMac(mac_bytes))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Serialize for ClientMac {
|
||||||
|
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||||
|
let encoded_key = general_purpose::STANDARD.encode(self.0.clone());
|
||||||
|
serializer.serialize_str(&encoded_key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'de> Deserialize<'de> for ClientMac {
|
||||||
|
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
|
||||||
|
let encoded_key = String::deserialize(deserializer)?;
|
||||||
|
ClientMac::from_str(&encoded_key).map_err(serde::de::Error::custom)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use nym_crypto::asymmetric::encryption;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(feature = "verify")]
|
||||||
|
fn client_request_roundtrip() {
|
||||||
|
let mut rng = rand::thread_rng();
|
||||||
|
|
||||||
|
let gateway_key_pair = encryption::KeyPair::new(&mut rng);
|
||||||
|
let client_key_pair = encryption::KeyPair::new(&mut rng);
|
||||||
|
|
||||||
|
let nonce = 1234567890;
|
||||||
|
|
||||||
|
let client = GatewayClient::new(
|
||||||
|
client_key_pair.private_key(),
|
||||||
|
x25519_dalek::PublicKey::from(gateway_key_pair.public_key().to_bytes()),
|
||||||
|
"10.0.0.42".parse().unwrap(),
|
||||||
|
nonce,
|
||||||
|
);
|
||||||
|
assert!(client.verify(gateway_key_pair.private_key(), nonce).is_ok())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use super::{
|
||||||
|
registration::{FinalMessage, InitMessage},
|
||||||
|
topup::TopUpMessage,
|
||||||
|
};
|
||||||
|
use nym_service_provider_requests_common::{Protocol, ServiceProviderType};
|
||||||
|
use nym_sphinx::addressing::Recipient;
|
||||||
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::make_bincode_serializer;
|
||||||
|
|
||||||
|
use super::VERSION;
|
||||||
|
|
||||||
|
fn generate_random() -> u64 {
|
||||||
|
use rand::RngCore;
|
||||||
|
let mut rng = rand::rngs::OsRng;
|
||||||
|
rng.next_u64()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct AuthenticatorRequest {
|
||||||
|
pub protocol: Protocol,
|
||||||
|
pub data: AuthenticatorRequestData,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub request_id: u64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AuthenticatorRequest {
|
||||||
|
pub fn from_reconstructed_message(
|
||||||
|
message: &nym_sphinx::receiver::ReconstructedMessage,
|
||||||
|
) -> Result<Self, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().deserialize(&message.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_initial_request(init_message: InitMessage, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::Initial(init_message),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_final_request(final_message: FinalMessage, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::Final(Box::new(final_message)),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_query_request(peer_public_key: PeerPublicKey, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::QueryBandwidth(peer_public_key),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_topup_request(top_up_message: TopUpMessage, reply_to: Recipient) -> (Self, u64) {
|
||||||
|
let request_id = generate_random();
|
||||||
|
(
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorRequestData::TopUpBandwidth(Box::new(top_up_message)),
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
},
|
||||||
|
request_id,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn to_bytes(&self) -> Result<Vec<u8>, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().serialize(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub enum AuthenticatorRequestData {
|
||||||
|
Initial(InitMessage),
|
||||||
|
Final(Box<FinalMessage>),
|
||||||
|
QueryBandwidth(PeerPublicKey),
|
||||||
|
TopUpBandwidth(Box<TopUpMessage>),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check_first_bytes_protocol() {
|
||||||
|
let version = 2;
|
||||||
|
let data = AuthenticatorRequest {
|
||||||
|
protocol: Protocol { version, service_provider_type: ServiceProviderType::Authenticator },
|
||||||
|
data: AuthenticatorRequestData::Initial(InitMessage::new(
|
||||||
|
PeerPublicKey::from_str("yvNUDpT5l7W/xDhiu6HkqTHDQwbs/B3J5UrLmORl1EQ=").unwrap(),
|
||||||
|
)),
|
||||||
|
reply_to: Recipient::try_from_base58_string("D1rrpsysCGCYXy9saP8y3kmNpGtJZUXN9SvFoUcqAsM9.9Ssso1ea5NfkbMASdiseDSjTN1fSWda5SgEVjdSN4CvV@GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN").unwrap(),
|
||||||
|
request_id: 1,
|
||||||
|
};
|
||||||
|
let bytes = *data.to_bytes().unwrap().first_chunk::<2>().unwrap();
|
||||||
|
assert_eq!(bytes, [version, ServiceProviderType::Authenticator as u8]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use super::registration::{RegistrationData, RegistredData, RemainingBandwidthData};
|
||||||
|
use nym_service_provider_requests_common::{Protocol, ServiceProviderType};
|
||||||
|
use nym_sphinx::addressing::Recipient;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::make_bincode_serializer;
|
||||||
|
|
||||||
|
use super::VERSION;
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct AuthenticatorResponse {
|
||||||
|
pub protocol: Protocol,
|
||||||
|
pub data: AuthenticatorResponseData,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AuthenticatorResponse {
|
||||||
|
pub fn new_pending_registration_success(
|
||||||
|
registration_data: RegistrationData,
|
||||||
|
request_id: u64,
|
||||||
|
reply_to: Recipient,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::PendingRegistration(PendingRegistrationResponse {
|
||||||
|
reply: registration_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_registered(
|
||||||
|
registred_data: RegistredData,
|
||||||
|
reply_to: Recipient,
|
||||||
|
request_id: u64,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::Registered(RegisteredResponse {
|
||||||
|
reply: registred_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_remaining_bandwidth(
|
||||||
|
remaining_bandwidth_data: Option<RemainingBandwidthData>,
|
||||||
|
reply_to: Recipient,
|
||||||
|
request_id: u64,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::RemainingBandwidth(RemainingBandwidthResponse {
|
||||||
|
reply: remaining_bandwidth_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_topup_bandwidth(
|
||||||
|
remaining_bandwidth_data: RemainingBandwidthData,
|
||||||
|
reply_to: Recipient,
|
||||||
|
request_id: u64,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
protocol: Protocol {
|
||||||
|
service_provider_type: ServiceProviderType::Authenticator,
|
||||||
|
version: VERSION,
|
||||||
|
},
|
||||||
|
data: AuthenticatorResponseData::TopUpBandwidth(TopUpBandwidthResponse {
|
||||||
|
reply: remaining_bandwidth_data,
|
||||||
|
reply_to,
|
||||||
|
request_id,
|
||||||
|
}),
|
||||||
|
reply_to,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn recipient(&self) -> Recipient {
|
||||||
|
self.reply_to
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn to_bytes(&self) -> Result<Vec<u8>, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().serialize(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_reconstructed_message(
|
||||||
|
message: &nym_sphinx::receiver::ReconstructedMessage,
|
||||||
|
) -> Result<Self, bincode::Error> {
|
||||||
|
use bincode::Options;
|
||||||
|
make_bincode_serializer().deserialize(&message.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn id(&self) -> Option<u64> {
|
||||||
|
match &self.data {
|
||||||
|
AuthenticatorResponseData::PendingRegistration(response) => Some(response.request_id),
|
||||||
|
AuthenticatorResponseData::Registered(response) => Some(response.request_id),
|
||||||
|
AuthenticatorResponseData::RemainingBandwidth(response) => Some(response.request_id),
|
||||||
|
AuthenticatorResponseData::TopUpBandwidth(response) => Some(response.request_id),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub enum AuthenticatorResponseData {
|
||||||
|
PendingRegistration(PendingRegistrationResponse),
|
||||||
|
Registered(RegisteredResponse),
|
||||||
|
RemainingBandwidth(RemainingBandwidthResponse),
|
||||||
|
TopUpBandwidth(TopUpBandwidthResponse),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct PendingRegistrationResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: RegistrationData,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct RegisteredResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: RegistredData,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct RemainingBandwidthResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: Option<RemainingBandwidthData>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct TopUpBandwidthResponse {
|
||||||
|
pub request_id: u64,
|
||||||
|
pub reply_to: Recipient,
|
||||||
|
pub reply: RemainingBandwidthData,
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
use nym_credentials_interface::CredentialSpendingData;
|
||||||
|
use nym_wireguard_types::PeerPublicKey;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct TopUpMessage {
|
||||||
|
/// Base64 encoded x25519 public key
|
||||||
|
pub pub_key: PeerPublicKey,
|
||||||
|
|
||||||
|
/// Ecash credential
|
||||||
|
pub credential: CredentialSpendingData,
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ nym-ecash-time = { path = "../ecash-time" }
|
|||||||
nym-credential-storage = { path = "../credential-storage" }
|
nym-credential-storage = { path = "../credential-storage" }
|
||||||
nym-credentials = { path = "../credentials" }
|
nym-credentials = { path = "../credentials" }
|
||||||
nym-credentials-interface = { path = "../credentials-interface" }
|
nym-credentials-interface = { path = "../credentials-interface" }
|
||||||
nym-crypto = { path = "../crypto", features = ["rand", "asymmetric", "symmetric", "aes", "hashing"] }
|
nym-crypto = { path = "../crypto", features = ["rand", "asymmetric", "stream_cipher", "aes", "hashing"] }
|
||||||
nym-network-defaults = { path = "../network-defaults" }
|
nym-network-defaults = { path = "../network-defaults" }
|
||||||
nym-validator-client = { path = "../client-libs/validator-client", default-features = false }
|
nym-validator-client = { path = "../client-libs/validator-client", default-features = false }
|
||||||
nym-ecash-contract-common = { path = "../cosmwasm-smart-contracts/ecash-contract" }
|
nym-ecash-contract-common = { path = "../cosmwasm-smart-contracts/ecash-contract" }
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use crate::error::BandwidthControllerError;
|
use crate::error::BandwidthControllerError;
|
||||||
use crate::utils::{get_coin_index_signatures, get_expiration_date_signatures};
|
use crate::utils::{
|
||||||
|
get_aggregate_verification_key, get_coin_index_signatures, get_expiration_date_signatures,
|
||||||
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
use nym_credential_storage::storage::Storage;
|
use nym_credential_storage::storage::Storage;
|
||||||
use nym_credentials::ecash::bandwidth::IssuanceTicketBook;
|
use nym_credentials::ecash::bandwidth::IssuanceTicketBook;
|
||||||
@@ -55,7 +57,7 @@ where
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn query_and_persist_required_global_signatures<S>(
|
pub async fn query_and_persist_required_global_data<S>(
|
||||||
storage: &S,
|
storage: &S,
|
||||||
epoch_id: EpochId,
|
epoch_id: EpochId,
|
||||||
expiration_date: Date,
|
expiration_date: Date,
|
||||||
@@ -65,6 +67,10 @@ where
|
|||||||
S: Storage,
|
S: Storage,
|
||||||
<S as Storage>::StorageError: Send + Sync + 'static,
|
<S as Storage>::StorageError: Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
|
log::info!("Getting master verification key");
|
||||||
|
// this will also persist the key in the storage if was not there already
|
||||||
|
get_aggregate_verification_key(storage, epoch_id, apis.clone()).await?;
|
||||||
|
|
||||||
log::info!("Getting expiration date signatures");
|
log::info!("Getting expiration date signatures");
|
||||||
// this will also persist the signatures in the storage if they were not there already
|
// this will also persist the signatures in the storage if they were not there already
|
||||||
get_expiration_date_signatures(storage, epoch_id, expiration_date, apis.clone()).await?;
|
get_expiration_date_signatures(storage, epoch_id, expiration_date, apis.clone()).await?;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use nym_credential_storage::models::RetrievedTicketbook;
|
|||||||
use nym_credential_storage::storage::Storage;
|
use nym_credential_storage::storage::Storage;
|
||||||
use nym_credentials::ecash::bandwidth::CredentialSpendingData;
|
use nym_credentials::ecash::bandwidth::CredentialSpendingData;
|
||||||
use nym_credentials_interface::{
|
use nym_credentials_interface::{
|
||||||
AnnotatedCoinIndexSignature, AnnotatedExpirationDateSignature, NymPayInfo, VerificationKeyAuth,
|
AnnotatedCoinIndexSignature, AnnotatedExpirationDateSignature, TicketType, VerificationKeyAuth,
|
||||||
};
|
};
|
||||||
use nym_ecash_time::Date;
|
use nym_ecash_time::Date;
|
||||||
use nym_validator_client::nym_api::EpochId;
|
use nym_validator_client::nym_api::EpochId;
|
||||||
@@ -64,9 +64,10 @@ impl<C, St: Storage> BandwidthController<C, St> {
|
|||||||
BandwidthController { storage, client }
|
BandwidthController { storage, client }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to retrieve one of the stored, unused credentials that hasn't yet expired.
|
/// Tries to retrieve one of the stored, unused credentials for the given type that hasn't yet expired.
|
||||||
pub async fn get_next_usable_ticketbook(
|
pub async fn get_next_usable_ticketbook(
|
||||||
&self,
|
&self,
|
||||||
|
ticketbook_type: TicketType,
|
||||||
tickets: u32,
|
tickets: u32,
|
||||||
) -> Result<RetrievedTicketbook, BandwidthControllerError>
|
) -> Result<RetrievedTicketbook, BandwidthControllerError>
|
||||||
where
|
where
|
||||||
@@ -74,7 +75,7 @@ impl<C, St: Storage> BandwidthController<C, St> {
|
|||||||
{
|
{
|
||||||
let Some(ticketbook) = self
|
let Some(ticketbook) = self
|
||||||
.storage
|
.storage
|
||||||
.get_next_unspent_usable_ticketbook(tickets)
|
.get_next_unspent_usable_ticketbook(ticketbook_type.to_string(), tickets)
|
||||||
.await
|
.await
|
||||||
.map_err(BandwidthControllerError::credential_storage_error)?
|
.map_err(BandwidthControllerError::credential_storage_error)?
|
||||||
else {
|
else {
|
||||||
@@ -165,7 +166,9 @@ impl<C, St: Storage> BandwidthController<C, St> {
|
|||||||
.get_coin_index_signatures(epoch_id, &mut api_clients)
|
.get_coin_index_signatures(epoch_id, &mut api_clients)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let pay_info = NymPayInfo::generate(provider_pk);
|
let pay_info = retrieved_ticketbook
|
||||||
|
.ticketbook
|
||||||
|
.generate_pay_info(provider_pk);
|
||||||
|
|
||||||
let spend_request = retrieved_ticketbook.ticketbook.prepare_for_spending(
|
let spend_request = retrieved_ticketbook.ticketbook.prepare_for_spending(
|
||||||
&verification_key,
|
&verification_key,
|
||||||
@@ -179,6 +182,7 @@ impl<C, St: Storage> BandwidthController<C, St> {
|
|||||||
|
|
||||||
pub async fn prepare_ecash_ticket(
|
pub async fn prepare_ecash_ticket(
|
||||||
&self,
|
&self,
|
||||||
|
ticketbook_type: TicketType,
|
||||||
provider_pk: [u8; 32],
|
provider_pk: [u8; 32],
|
||||||
tickets_to_spend: u32,
|
tickets_to_spend: u32,
|
||||||
) -> Result<PreparedCredential, BandwidthControllerError>
|
) -> Result<PreparedCredential, BandwidthControllerError>
|
||||||
@@ -186,7 +190,9 @@ impl<C, St: Storage> BandwidthController<C, St> {
|
|||||||
C: DkgQueryClient + Sync + Send,
|
C: DkgQueryClient + Sync + Send,
|
||||||
<St as Storage>::StorageError: Send + Sync + 'static,
|
<St as Storage>::StorageError: Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
let retrieved_ticketbook = self.get_next_usable_ticketbook(tickets_to_spend).await?;
|
let retrieved_ticketbook = self
|
||||||
|
.get_next_usable_ticketbook(ticketbook_type, tickets_to_spend)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let ticketbook_id = retrieved_ticketbook.ticketbook_id;
|
let ticketbook_id = retrieved_ticketbook.ticketbook_id;
|
||||||
let epoch_id = retrieved_ticketbook.ticketbook.epoch_id();
|
let epoch_id = retrieved_ticketbook.ticketbook.epoch_id();
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
use crate::error::BandwidthControllerError;
|
use crate::error::BandwidthControllerError;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use nym_credential_storage::storage::Storage;
|
use nym_credential_storage::storage::Storage;
|
||||||
|
use nym_credentials::ecash::bandwidth::serialiser::keys::EpochVerificationKey;
|
||||||
|
use nym_credentials::ecash::bandwidth::serialiser::signatures::{
|
||||||
|
AggregatedCoinIndicesSignatures, AggregatedExpirationDateSignatures,
|
||||||
|
};
|
||||||
use nym_credentials_interface::{
|
use nym_credentials_interface::{
|
||||||
AnnotatedCoinIndexSignature, AnnotatedExpirationDateSignature, VerificationKeyAuth,
|
AnnotatedCoinIndexSignature, AnnotatedExpirationDateSignature, VerificationKeyAuth,
|
||||||
};
|
};
|
||||||
@@ -94,13 +98,18 @@ where
|
|||||||
.await?
|
.await?
|
||||||
.key;
|
.key;
|
||||||
|
|
||||||
|
let full = EpochVerificationKey {
|
||||||
|
epoch_id,
|
||||||
|
key: master_vk,
|
||||||
|
};
|
||||||
|
|
||||||
// store the retrieved key
|
// store the retrieved key
|
||||||
storage
|
storage
|
||||||
.insert_master_verification_key(epoch_id, &master_vk)
|
.insert_master_verification_key(&full)
|
||||||
.await
|
.await
|
||||||
.map_err(BandwidthControllerError::credential_storage_error)?;
|
.map_err(BandwidthControllerError::credential_storage_error)?;
|
||||||
|
|
||||||
Ok(master_vk)
|
Ok(full.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn get_coin_index_signatures<St>(
|
pub(crate) async fn get_coin_index_signatures<St>(
|
||||||
@@ -132,13 +141,18 @@ where
|
|||||||
.await?
|
.await?
|
||||||
.signatures;
|
.signatures;
|
||||||
|
|
||||||
|
let aggregated = AggregatedCoinIndicesSignatures {
|
||||||
|
epoch_id,
|
||||||
|
signatures: index_sigs,
|
||||||
|
};
|
||||||
|
|
||||||
// store the retrieved key
|
// store the retrieved key
|
||||||
storage
|
storage
|
||||||
.insert_coin_index_signatures(epoch_id, &index_sigs)
|
.insert_coin_index_signatures(&aggregated)
|
||||||
.await
|
.await
|
||||||
.map_err(BandwidthControllerError::credential_storage_error)?;
|
.map_err(BandwidthControllerError::credential_storage_error)?;
|
||||||
|
|
||||||
Ok(index_sigs)
|
Ok(aggregated.signatures)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn get_expiration_date_signatures<St>(
|
pub(crate) async fn get_expiration_date_signatures<St>(
|
||||||
@@ -171,11 +185,17 @@ where
|
|||||||
.await?
|
.await?
|
||||||
.signatures;
|
.signatures;
|
||||||
|
|
||||||
|
let aggregated = AggregatedExpirationDateSignatures {
|
||||||
|
epoch_id,
|
||||||
|
expiration_date,
|
||||||
|
signatures: expiration_sigs,
|
||||||
|
};
|
||||||
|
|
||||||
// store the retrieved key
|
// store the retrieved key
|
||||||
storage
|
storage
|
||||||
.insert_expiration_date_signatures(epoch_id, expiration_date, &expiration_sigs)
|
.insert_expiration_date_signatures(&aggregated)
|
||||||
.await
|
.await
|
||||||
.map_err(BandwidthControllerError::credential_storage_error)?;
|
.map_err(BandwidthControllerError::credential_storage_error)?;
|
||||||
|
|
||||||
Ok(expiration_sigs)
|
Ok(aggregated.signatures)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ license = { workspace = true }
|
|||||||
repository = { workspace = true }
|
repository = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
const-str = { workspace = true }
|
|
||||||
clap = { workspace = true, features = ["derive"], optional = true }
|
clap = { workspace = true, features = ["derive"], optional = true }
|
||||||
clap_complete = { workspace = true, optional = true }
|
clap_complete = { workspace = true, optional = true }
|
||||||
clap_complete_fig = { workspace = true, optional = true }
|
clap_complete_fig = { workspace = true, optional = true }
|
||||||
|
const-str = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
pretty_env_logger = { workspace = true }
|
pretty_env_logger = { workspace = true }
|
||||||
semver = "0.11"
|
|
||||||
schemars = { workspace = true, features = ["preserve_order"], optional = true }
|
schemars = { workspace = true, features = ["preserve_order"], optional = true }
|
||||||
|
semver.workspace = true
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true, optional = true }
|
serde_json = { workspace = true, optional = true }
|
||||||
|
|
||||||
@@ -45,3 +45,4 @@ tracing = [
|
|||||||
"opentelemetry",
|
"opentelemetry",
|
||||||
]
|
]
|
||||||
clap = [ "dep:clap", "dep:clap_complete", "dep:clap_complete_fig" ]
|
clap = [ "dep:clap", "dep:clap_complete", "dep:clap_complete_fig" ]
|
||||||
|
models = []
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use semver::SemVerError;
|
|
||||||
pub use semver::Version;
|
pub use semver::Version;
|
||||||
|
|
||||||
|
/// Checks if the version is minor version compatible.
|
||||||
|
///
|
||||||
/// Checks whether given `version` is compatible with a given semantic version requirement `req`
|
/// Checks whether given `version` is compatible with a given semantic version requirement `req`
|
||||||
/// according to major-minor semver rules. The semantic version requirement can be passed as a full,
|
/// according to major-minor semver rules. The semantic version requirement can be passed as a full,
|
||||||
/// concrete version number, because that's what we'll have in our Cargo.toml files (e.g. 0.3.2).
|
/// concrete version number, because that's what we'll have in our Cargo.toml files (e.g. 0.3.2).
|
||||||
@@ -22,7 +23,7 @@ pub fn is_minor_version_compatible(version: &str, req: &str) -> bool {
|
|||||||
expected_version.major == req_version.major && expected_version.minor == req_version.minor
|
expected_version.major == req_version.major && expected_version.minor == req_version.minor
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_version(raw_version: &str) -> Result<Version, SemVerError> {
|
pub fn parse_version(raw_version: &str) -> Result<Version, semver::Error> {
|
||||||
Version::parse(raw_version)
|
Version::parse(raw_version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,12 @@ base64 = { workspace = true }
|
|||||||
bs58 = { workspace = true }
|
bs58 = { workspace = true }
|
||||||
cfg-if = { workspace = true }
|
cfg-if = { workspace = true }
|
||||||
clap = { workspace = true, optional = true }
|
clap = { workspace = true, optional = true }
|
||||||
comfy-table = { version = "7.1.1", optional = true }
|
comfy-table = { workspace = true, optional = true }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
humantime-serde = { workspace = true }
|
humantime-serde = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
rand = { workspace = true }
|
rand = { workspace = true }
|
||||||
|
rand_chacha = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
sha2 = { workspace = true }
|
sha2 = { workspace = true }
|
||||||
@@ -58,19 +59,19 @@ nym-ecash-time = { path = "../ecash-time" }
|
|||||||
|
|
||||||
### For serving prometheus metrics
|
### For serving prometheus metrics
|
||||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.hyper]
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.hyper]
|
||||||
version = "1"
|
workspace = true
|
||||||
features = ["server", "http1"]
|
features = ["server", "http1"]
|
||||||
|
|
||||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.http-body-util]
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.http-body-util]
|
||||||
version = "0.1"
|
workspace = true
|
||||||
|
|
||||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.hyper-util]
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.hyper-util]
|
||||||
version = "0.1"
|
workspace = true
|
||||||
features = ["tokio"]
|
features = ["tokio"]
|
||||||
###
|
###
|
||||||
|
|
||||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio-stream]
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio-stream]
|
||||||
version = "0.1.11"
|
workspace = true
|
||||||
features = ["time"]
|
features = ["time"]
|
||||||
|
|
||||||
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio]
|
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio]
|
||||||
@@ -101,7 +102,7 @@ workspace = true
|
|||||||
features = ["tokio"]
|
features = ["tokio"]
|
||||||
|
|
||||||
[target."cfg(target_arch = \"wasm32\")".dependencies.gloo-timers]
|
[target."cfg(target_arch = \"wasm32\")".dependencies.gloo-timers]
|
||||||
version = "0.2.4"
|
version = "0.3.0"
|
||||||
features = ["futures"]
|
features = ["futures"]
|
||||||
|
|
||||||
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-utils]
|
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-utils]
|
||||||
@@ -109,7 +110,7 @@ path = "../wasm/utils"
|
|||||||
features = ["websocket"]
|
features = ["websocket"]
|
||||||
|
|
||||||
[target."cfg(target_arch = \"wasm32\")".dependencies.time]
|
[target."cfg(target_arch = \"wasm32\")".dependencies.time]
|
||||||
version = "0.3.17"
|
workspace = true
|
||||||
features = ["wasm-bindgen"]
|
features = ["wasm-bindgen"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT EXISTS (SELECT 1 FROM registered_gateway WHERE gateway_id_bs58 = ?) AS 'exists'",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "exists",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Int"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "06e743d143fcc4be20ca2af5e99b19f15d22fff72490473587a14cdc046fda32"
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT * FROM remote_gateway_details WHERE gateway_id_bs58 = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "gateway_id_bs58",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gateway_owner_address",
|
||||||
|
"ordinal": 1,
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gateway_listener",
|
||||||
|
"ordinal": 2,
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "derived_aes128_ctr_blake3_hmac_keys_bs58",
|
||||||
|
"ordinal": 3,
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "derived_aes256_gcm_siv_key",
|
||||||
|
"ordinal": 4,
|
||||||
|
"type_info": "Blob"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0e85ec18da67cf4e3df04ad80136571f6e920eb2290f20b1b8c5b0ab4b489985"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "\n UPDATE remote_gateway_details\n SET\n derived_aes128_ctr_blake3_hmac_keys_bs58 = ?,\n derived_aes256_gcm_siv_key = ?\n WHERE gateway_id_bs58 = ?\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 3
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "0f1dfb89f1eb39f4a58787af0f53a7a93afb7e4d2e54e2d38fd79d31c8575a54"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "DELETE FROM remote_gateway_details WHERE gateway_id_bs58 = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "1da6904e72b5abb9abf75affb13af7974d7795b4cbdba234273345fe161df233"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "DELETE FROM custom_gateway_details WHERE gateway_id_bs58 = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "4f78619aca933484cd67cb89a376b2a5bec1c191993ff58f0c71c03e3ef6d92d"
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT * FROM custom_gateway_details WHERE gateway_id_bs58 = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "gateway_id_bs58",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"ordinal": 1,
|
||||||
|
"type_info": "Blob"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "54f552a9dbe95236f946ac2b6615e03504afa58e345ae16a128629d8e76f0a11"
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT gateway_id_bs58 FROM registered_gateway",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "gateway_id_bs58",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Text"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 0
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "5661cf1ad8bd5ca062e855e1971a8787133ee41814bd3efdd501f9ee0c050f2b"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "UPDATE active_gateway SET active_gateway_id_bs58 = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "80476cf2906eb0ecf7f66c16bc5682169b87f488b6927fa67fade6bf5abf7582"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "\n INSERT INTO registered_gateway(gateway_id_bs58, registration_timestamp, gateway_type) \n VALUES (?, ?, ?)\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 3
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "8909fd329e7e5fb16c4989b15b3d3a12bba1569520e01f6f074178e23d6ee89e"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "\n INSERT INTO remote_gateway_details(gateway_id_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, derived_aes256_gcm_siv_key, gateway_owner_address, gateway_listener)\n VALUES (?, ?, ?, ?, ?)\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 5
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "a6939bea03b10cde810a9a099bd597b4f51092e30a41c4085a8f8668f039f7c0"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "\n INSERT INTO custom_gateway_details(gateway_id_bs58, data) \n VALUES (?, ?)\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "b059bc3688b6b7f83f47048db9897720fd4e6f3211bf74030a9638f7bf6738e4"
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "SELECT active_gateway_id_bs58 FROM active_gateway",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"name": "active_gateway_id_bs58",
|
||||||
|
"ordinal": 0,
|
||||||
|
"type_info": "Text"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 0
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "bf249752f08c283bf5942b6ff48125c24750b523cfcad1e5e9069dbf7050e2a1"
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "DELETE FROM registered_gateway WHERE gateway_id_bs58 = ?",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 1
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "f3ebe259e26c05ecdd33bd9085dbb91cd5046a8c9d4434cf085a4fa2ebf03e93"
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
CREATE TABLE remote_gateway_details_temp
|
||||||
|
(
|
||||||
|
gateway_id_bs58 TEXT NOT NULL UNIQUE PRIMARY KEY REFERENCES registered_gateway (gateway_id_bs58),
|
||||||
|
derived_aes128_ctr_blake3_hmac_keys_bs58 TEXT NOT NULL,
|
||||||
|
gateway_owner_address TEXT,
|
||||||
|
gateway_listener TEXT NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO remote_gateway_details_temp SELECT gateway_id_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, gateway_owner_address, gateway_listener FROM remote_gateway_details;
|
||||||
|
|
||||||
|
DROP TABLE remote_gateway_details;
|
||||||
|
ALTER TABLE remote_gateway_details_temp RENAME TO remote_gateway_details;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user