Compare commits

..

630 Commits

Author SHA1 Message Date
Aid Thompson b8494eb83a signpost - unfinished just parking changes 2021-11-22 15:08:46 +00:00
Aid Thompson cb549dfe25 1st commit 2021-11-17 11:55:06 +00:00
Tommy Verrall 17507bc8c5 Merge pull request #899 from nymtech/test/wallet-readme-fix
Fix up Nym-Wallet README.md
2021-11-16 14:17:15 +00:00
Tommy Verrall 12f8e453ea Fix typo. 2021-11-16 10:20:50 +00:00
Tommy Verrall 97ef024b8a Fix up Nym-Wallet README.md
. Provide a descriptive overview
. Remove old references
2021-11-16 10:17:30 +00:00
Aid19801 3dc94223ae Bug mapp nodemap (#897)
* desktop onMouseEnter and leave handlers added

* clicking nav option closes drawer

* All AC met

* removed dead bool

* added hamburger to AppBar for mobile users small refactor

* nuts and bolts working needs a lot of tidying though

* Functionally complete.

* change hardcode colors to theming

* UI theme and border changes

* bug fix removed collapse nav flicker

* dead code

* resetting drawer to closed onload

* removal of hardcoded color

* made null functions into optional props

* Nested sx styling not global

* paperprops now working

* fixed breaking changes for DataGrid

* linting fix

* linting fix

* optional chaining for nodemap search

* leaner filter func

Co-authored-by: Aid Thompson <adrian@nymtech.net>
2021-11-12 18:22:03 +00:00
Aid19801 50cd18a926 Add a Mobile Nav to the Network Explorer (#895)
* desktop onMouseEnter and leave handlers added

* clicking nav option closes drawer

* All AC met

* removed dead bool

* added hamburger to AppBar for mobile users small refactor

* nuts and bolts working needs a lot of tidying though

* Functionally complete.

* change hardcode colors to theming

* UI theme and border changes

* bug fix removed collapse nav flicker

* dead code

* resetting drawer to closed onload

* removal of hardcoded color

* made null functions into optional props

* Nested sx styling not global

* paperprops now working

* fixed breaking changes for DataGrid

* linting fix

* linting fix

Co-authored-by: Aid Thompson <adrian@nymtech.net>
2021-11-12 16:14:37 +00:00
Aid19801 897d51cba0 Change MixnodeDetail page's datagrid into a reuseable table component (#887)
* basic table working

* broken out into sep component

* table is more dynamic now

* linting fixes

* Added types for Columns

* hangover from eslint work moving to diff PR

* Changed To DetailTable

* Killed unused flex val in Columns

* merge conflicts resolved

Co-authored-by: Aid Thompson <adrian@nymtech.net>
2021-11-12 10:28:12 +00:00
Tommy Verrall 1f1d91bd1e Adding data-test-ids for the explorer (#885)
* Adding all the data-test-ids

Test ID's for doing automation on explorer

* Applied lint-fix

Linting

* More data ids
2021-11-11 15:31:30 +00:00
Mark Sinclair 9d63a30b07 Merge pull request #890 from nymtech/feature/nym-wallet-rename
Feature/nym wallet rename
2021-11-11 15:00:55 +00:00
Tommy 5b22b1c298 getting branch up to date with tauri changes and webriver changes 2021-11-11 11:02:39 +00:00
Dave Hrycyszyn 0302d9ae5d Merge branch 'feature/nym-wallet-rename' of github.com:nymtech/nym into feature/nym-wallet-rename 2021-11-11 10:50:12 +00:00
Bogdan-Ștefan Neacşu eb6949528a Fix network monitor template (#892) 2021-11-11 10:36:43 +00:00
Mark Sinclair 41b77c3ad5 Merge pull request #894 from nymtech/feature-gate-ts-rs
Only use ts-rs in tests
2021-11-11 10:34:04 +00:00
Mark Sinclair 2f78f5eb26 Merge pull request #884 from nymtech/test/fix-gh-action
Fix path for github action running tauri-wallet-tests
2021-11-11 10:33:02 +00:00
Dave Hrycyszyn cdbd731f10 Changed all workflow references to nym-wallet 2021-11-11 10:25:51 +01:00
Dave Hrycyszyn 5cb4949d46 Renaming tauri-wallet to nym-wallet
Hopefully this will make it a bit clearer as to what people should
compile if they want the wallet.
2021-11-11 10:25:51 +01:00
Mark Sinclair 9ec0b30812 GitHub Actions: move explorer actions to k8s hosted runners 2021-11-10 16:08:15 +00:00
Jędrzej Stuczyński 7e1cf2f105 Feature/rewarding interval updates (#880)
* Introduced rewarding_interval_nonce to contract state

* Queries for ibid.

* Mixnode demanded set size

* Routes for obtaining demanded/active mixnode sets

* Testing only demanded nodes

* Typo

* Initial state

* Feature-locking unused imports

* Generating pseudorandom (with deterministic seed) demanded mixnodes set

* cargo fmt

* Fixed tauri state

* Renamed network monitor address to the rewarding validator

* [ci skip] Generate TS types

* Notice for the future

* Transactions to begin/finish mixnode rewarding + double rewarding protection

* Validator API using new contract calls

* Removed dead code from an old experiment

* [ci skip] Generate TS types

* Removed unused import

* Renamed 'demanded' set to 'rewarded' set

* Some renaming action

* [ci skip] Generate TS types

* Fixed post-merge dependency issue in tests

* Post merge test fix

Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com>
2021-11-10 15:28:16 +00:00
Mark Sinclair 04636a569a GitHub Actions: fix up reference to action 2021-11-10 15:24:47 +00:00
Mark Sinclair 52f5b980a4 GitHub Actions: use dynamic matrix for os types and rust versions 2021-11-10 15:15:31 +00:00
Mark Sinclair 0e4f833715 GitHub Actions: fix up 2021-11-10 14:44:52 +00:00
Mark Sinclair d22914c4dc GitHub Actions: fix up 2021-11-10 14:43:32 +00:00
Mark Sinclair 7d506e6e2a Slim down GitHub Actions 2021-11-10 14:34:02 +00:00
Drazen Urch c7007de1ea Only use ts-rs in tests 2021-11-10 15:02:59 +01:00
Bogdan-Ștefan Neacşu 10bf70b22b Feature/bandwidth token (#832)
* Remove check for bandwidth for incoming packets

We should only accunt for packets that the client inputs to the mixnet

* Introduce BandwidthController for both types of bandwidth creds

* Add some non-coconut token bandwidth handling

* Use thiserror for gateway-client lib

* Add error handling

* Unable to build for wasm for now

* Fix wasm strange error

* Disable non-coconut credentials for wasm client

* Check for status and throw the error up

* Send encrypted token cred from client

* Gateway receive message and signature validation

* Put the correct amount of tokens that were burned

* [ci skip] Generate TS types

* Eth endpoint and secret key as config parameters

* Add eth_endpoint config argument for gateway

* Update test as well

* Separate panicable code from the safe one

* Move some bandwidth controller panics up the call stack

* Save contract corresponding to the eth endpoint

* Fix template

* Pass the web3 interface as well

* Made event reads possible in gateway

* Add checks for event data

* Cosmos contract for double spending prevention

* Add workflow for the new contract

* Add validator rest URL to config

* Rename eth_events to erc20_bridge

* Pass cosmos mnemonic as well, and put the nymd client in ERC20Bridge

* Call cosmos contract for final verification

* Ask for config parameters in cli

* Fix various stuff

* Increase timeout to allow gateway to check the two chains

* Put some logs for the new flow

* Set consumed bandwidth invariantly of coconut feature

* Fix clippy error

* Add non-coconut checks

* Use 2018 rust instead of 2021

* More verbose nymd error

* Explicitly specify TOKENS_TO_BURN constant

* Put eth burn function in a constant

* Replace to_vec & append with iter & chain

* Test for (de)serialization of TokenCredential

* Minor rename

* Separate credential creation from bandwidth claiming

* Switch from panics to errors when claiming coconut bandwidth

* Another append changed to chain

* Update QA cosmos contract address

* Simplify build/test/clippy separation on coconut feature

* Fix bad features arg positioning

* Use the start_after in cosmos contract query

* Set a limit in line with a range on cosmos queries

* Added unit tests for new cosmos contract

* Fix bandwidth_remaining comparation

* Get remaining bandwidth from gateway

* Add contract build flag

* Add a useful info log

* Use a more robust eth depth for release builds

* Include recipt logs in error message

* Fix clippy for tests

* Use Arc instead of clone

* Rename as_bytes to to_bytes

* Make signature verification in contract more verbose

* Missed rename of paging constant

* Fix gateway start with coconut enabled

* Rename function to claim_token

* Simplify nymd client setup

* Check with block buffer on gateway as well

* Update comment of double spending protection

* Correct contract address

* Backup the keypairs used for buying tokens, in case of error cases

* Don't take any chances with the gateway timeout

* [ci skip] Generate TS types

* Updated cosmos contract to latest QA address

* Add cli options for eth

* Update network monitor timeout value as well

Co-authored-by: neacsu <neacsu@users.noreply.github.com>
2021-11-10 14:53:56 +02:00
Jędrzej Stuczyński d952f3233a Active sets => Rewarded + Active/Idle sets (#864)
* Introduced rewarding_interval_nonce to contract state

* Queries for ibid.

* Mixnode demanded set size

* Routes for obtaining demanded/active mixnode sets

* Testing only demanded nodes

* Typo

* Initial state

* Feature-locking unused imports

* Generating pseudorandom (with deterministic seed) demanded mixnodes set

* cargo fmt

* Fixed tauri state

* [ci skip] Generate TS types

* Renamed 'demanded' set to 'rewarded' set

* Some renaming action

* [ci skip] Generate TS types

* Fixed post-merge dependency issue in tests

Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com>
2021-11-10 12:52:13 +00:00
Jędrzej Stuczyński af4ac1b7c9 Reverted gateway registration handshake to its 0.11.0 version (#882) 2021-11-10 11:16:39 +01:00
Drazen Urch eae4276381 Tokenomics rewards (#802)
* Initial analysis

* Implement core rewards distribution

* Tests and refactoring for better testability

* Feature gate ts-rs in mixnet-contract

* No more floats

* Fix performance calculation

* Add migration

* Bandwidth fix, reduce inflation pool size

* Update tokenomics

* Refactor rewarding and replace num crate

* Address review comments

* Cleanup, better test values

* Simplify formula

* Cleanup, add rewarding formulas to README

* Address review comments

* Cleanup rebase

* [ci skip] Generate TS types

* fmt

Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>
2021-11-10 11:14:06 +01:00
Dave Hrycyszyn d8fab74df6 Changed all workflow references to nym-wallet 2021-11-09 17:04:07 +00:00
Dave Hrycyszyn b8c184cc60 Renaming tauri-wallet to nym-wallet
Hopefully this will make it a bit clearer as to what people should
compile if they want the wallet.
2021-11-09 16:55:49 +00:00
Jędrzej Stuczyński 8bcc931d9b Feature/removal of monitor good nodes (#833)
* Removed separated ipv4 and ipv6 testing

* Testing network using chosen core nodes

This should have probably been like 20 independent commits... sorry...

* SQL migrations for updated schema

* SQL updates

* Using absolute uptime directly

* New uptime calculations

* Config entries, more DB work, some cleanup

* Additional API query routes

* More SQL and API work

* Changed `_` to `-` in new routes

* Removed good topology from config

* Fixed gateways reader yield condition

* Initial gateways pinger

* Minor cleanup and logging level decreases

* Missing trait derivations

* Further logging adjustments

* Unused commented out import

* Claiming additional bandwidth in coconut feature when low

* Fixed build with coconut feature

* Minimum number of test routes

* Making beta/nightly clippy happier
2021-11-09 12:25:41 +00:00
Mark Sinclair 955ef7b871 GitHub Actions: only run job to generate types when not in a pull request (#886) 2021-11-09 11:56:43 +00:00
Mark Sinclair 9ee7ad4fa8 GitHub Actions: only run job to generate types when not in a pull request 2021-11-09 11:42:00 +00:00
Tommy Verrall 79aa1febbe Run all the tests 2021-11-08 15:01:21 +00:00
Tommy 4ed9d3a297 Updated rust version for installation 2021-11-08 14:55:49 +00:00
Tommy 97dee2e1a0 Fix path for github action running tauri-wallet-tests
. Applied prettier to the code base
. Removed delegation to gateway tests
2021-11-08 14:54:01 +00:00
Fouad 32c4974c44 Merge pull request #873 from nymtech/update/remove-gateway-delegation
remove gateway selection on delegation and undelegation pages
2021-11-08 15:31:58 +01:00
Mark Sinclair 5dadd73dfd Network Explorer (#881)
* fixed styled component

* dynamic colour for isSelected

* corrected type names

* wrapped nav for routing and positioning of main section and dynamic colour for selected section

* overview info panes added

* quick refactor break out components separately

* WorldMap implemented but not data

* map changed and updated to shades correctly

* live data in cards

* added any types for react simple map

* nested routing added but needs tidying and types refactored

* added tooltip to worldmap

* worldmap killed unused props

* updated MUI version to stable v5

* dark mode and ContentCard refactor complete

* refactor of DarkMode context and API into class and context setup

* context refactor for multiple APIs at top level

* mui typography used for error msging instead of jsx/html

* added typeDefs for node api types

* small changes to sx styling

* added types for api responses and main context

* promiseAll for better error handling of individual async calls

* switch out to live API for country nodes

* removal of unnecessary type any and shortening sx style block

* routing and basic mixnodes table and linking

* fixed TS error handling and ts exclude files

* refactor of class API fetch reqs

* renaming to more appropriate explorer-api

* broken - passing to Fouad

* fix for types in context main

* mixnode detail page

* rebasing back before fetch mixnode by ID was implemented

* added basic cache for huge dump of mixnode data

* broken mixnodes context

* fixed mixnode detail fetch

* added hardcoded BondBreakdown section

* added 2 col table for detail page and small refactor of ApiState type for consistent use throughout app

* basic chart with basic dark/theme implemented - no live data

* added scrollToTop useRef for Detail page

* tidied grid items

* media qry for smaller screens

* small changes

* added live data to bonds breakdown 1/2

* small changes/tweaks

* Bondbreakdown retrieves live data

* mixnode stats using live data

* added node status live data

* uptime story added with live data

* date formatting added

* mixnode map

* error handling for mixnode stats

* error handling for port stats

* improved error handling for table - unfinished

* error handling for mixnode table

* handle Loading state for 2colSmallTable

* Uptime story loading handling

* set up data grid component

* remove mixnode value check as handled inside MixnodesDataGrid component

* use loading prop in data grid component

* undo unintentional code formatting

* map blur and linkable data-grid added

* getting ready for gateways and removing con logs

* quickfix for map blur

* PR comment changes

* refactored data grid for reuseability

* Link to open Big Dipper for Blocks

* passing element to title instead of string for routing to Big Dipper

* quick fix for element passed as title for contentCard

* fix for colour coding nodes

* nuts and bolts of search and results per page are working

* media query for responsive search and no-per-page toolbar

* broke out search and pagesize to separate toolbar

* fix for going back to mixnodes datagrid and refetching

* corrected typings for WorldMap

* removed API for topojson

* Cleaner implementation of formatting inline for datagrid

* added Type to Datagrid Rows for mixnode

* removed optional from type for Datagrid

* added page listing the Gateway nodes

* adding clickable location to handleSearch

* tidying util functions and removing dead useEffect

* Add missing constant

* Validators link to Big Dipper

* added validators link to side nav as per Issues card

* SVG icons

* PR tweak to move logic to routes

* removed dead code post rebase

* fixed light dark mode for DataGrid

* light dark mode works on SVGs in Nav

* moving logic back to Nav to avoid window object issues

* neater ternary for SVG icons dark mode

* Better Linking/Styling for cells

* corrected prop/attr name in svg to Reactify it

* moved api url to constants

* SVGs dark now governed by context not props so reverting renderIcon method back to key value setup

* percentage for bond total added

* SVGs for Overview cards Mixnodes Gateways and Validators

* decimalised formatted punks and % of bond for BondBreakdown card

* number formatting via validator module

* adding cossmjs math pkg

* unfinished refactor BondBreakdown

* first few ui tweaks

* Adding google font Open Sans as per designs

* DataGrid unstylable in theme so nuking in css

* adding theming to Block Height card not hardcoded colours

* DataGrid styling

* Nav styling colours but without hover fix

* theme for bond breakdown

* killing con logs

* Datagrid styling

* Nav bar working

* added lines to nav

* removed cursive from fallback fonts

* trimming and refactoring

* removed dead isActive code from nav options

* Color correction for theme on 2col table

* Moved cell styles out to UniversalDatagrid for reuseability

* Nav colors moved to theme

* Removing comments and dead code

* DataGrid UI improvements

* theming for Overview content card

* Bonds updated from UPUNK to PUNK

* corrected SVG warning on stroke-width

* added Boolean class instead of ternary

* fixing up svg attr to jsx props

* merging UPUNK changes into ui-tweaks

* corrected SVG warning on stroke-width

* added Boolean class instead of ternary

* last instance of Boolean

* BondBreakdown handles 0 delegations

* formatting for webpack config and svgs

* Add `npm run lint` and `npm run lint:fix` targets to `package.json`

* Allow `.vscode` directories - exclude them individually like has been done already in the `.gitignore` directory

* Add `vscode` action to run `eslint` on save for the `/explorer/**` sub-directory

* eslint auto fix

* Fix some easy eslint issues

* removing grid pipes and pastel map colors

* Grid xl lg values to align with Search Toolbar

* GitHub Actions: do not trigger Rust actions when the paths are only `/explorer/**`

See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths for details.

* GitHub Actions: run eslint and annotate pull requests

* socials added to Appbar and Footer

* smaller darkmode icon for mobile

* cleaner code for nav dark light selector

* almost all lint fixes

* post linting Nav fix

* killed con log and removed unused dep

* ref type and removed 1x ts ignore from worldMap

* disabl nested tern w/ nav is refactored on diff br

* icons smaller put into mui List format

* Added hover effect to match DarkLight switch

* ts ignore for worldMap vs no ts decl

* parking changes

* Flipped to MUI SVGs

* re-added external links to Socials

* nav functionality working

* spacing on Mixnode detail page

* datagrid alignment & detail page spacing

* map but no datagrid yet

* killed old SVGs now using mui icons

* added palette instead of strings

* Mixnode Map page working still needs tidying

* better lg xl responsive on Overview and sanitized Page Titles

* removed typography from imports as unused now

* search, sort working & added LG XL responsiveness

* Routing root reqs direct to Overview

* basic 404 page and btn back to overview

* killed fragments and comments

* updated Bond total in column

* Change bond col to type number not text

* Added field to DataGrid and updated MixnodeToGridrow logic

* Added type number so sorting works properly.

* added %self to Detail page

* basic scroll working desktop

* delegations now popout and scroll according to designs

* added stickyHeader and killed dead code

* ExpandMore only renders if delegations exist

* killed old svg icons

* added theme to Overview SVGs

* bringing Title into other pages

* linting fix

* pagination and spacing of gateways cols

* linting fix

* style override for pagination

* added hamburger and changed appbar to fixed

* bringing in other lint fix to pass linting

* PR feedback changes

* Add README.md for theme customisation

* Add hook to get app state context

* Add Nym theme typings to MUI `Theme` types

* Use new theme provider

* Fixing up components to use theme typings
Updated Overview Footer and ContentCard
Footer and Nav socials
Title, Nav chevron and Nav SVGs
Overview SVGs
Light Dark switch
BondBreakdown and 2 col table
DataGrid and 2col Tables
WorldMap UptimeChart and theme changes
WorldMap colors
merge changes
added StatsCard for overview

* Bug fix: do no close drawer when clicking on mixnodes or gateways

* Theme primary colour set to orange highlight, so that default/primary actions are clear to the user. This fixes colours on the pagination page list.

* Fixing up map projection

* Map view uses stroke colour from theme

* added useTheme from correct pkg

* react types upgrade to kill SXProps issue

* SXProps fix removing dead mixins from fixed AppBar

* Scale of Map changed to see more countries

* return type for main Context required

* Fixed map so more countries show

* type for useMainContext hook added

* Remove unused file

* Tidy up imports

* Remove use of `any` by using strongly typed hook to get the app state

* Remove module declaration so that @types/react-simple-maps is used

* API map response changed to indexed object

* Map view uses correct typings from `@types/react-simple-maps` and `d3-scale`

* Make content responsive and fills the view when screen widest

* Link network explorer in title to overview page

* Increase size of card headers to differentiate

* Fix column widths

* Fixed icons showing incorrectly the stats card in mixnode detail view

* Set default sort on mixnodes and gateways to be `bond` descending.

There is an error in MUI data-grid that does not adjust the sort caret based on initial `sortModel` value. Needs investigation.

* GitHub Action for deployment: prefix with network explorer to stop collisions with other deployment projects

* Mixnode list: fix up header title for `host`

* Fix up notification URLs and tidy up readme

* Fix up license information

Co-authored-by: Adrian Thompson <adrian@nymtech.net>
Co-authored-by: Adrian Thompson <adrianthompson@Adrians-MacBook-Air.local>
Co-authored-by: fmtabbara <fmtabbara@hotmail.co.uk>
Co-authored-by: Aid19801 <adrianThompson19801@gmail.com>
2021-11-08 12:23:27 +00:00
Mark Sinclair 6ad5badef4 GitHub Action to publish wallet
This is placeholder to allow the action to trigger in branches
2021-11-08 11:03:49 +00:00
Bogdan-Ștefan Neacşu 480ad18b2e Put client_address and id in the correct order (#875) 2021-11-04 16:33:18 +02:00
Jędrzej Stuczyński cdb21f418b Made daily uptime calculation be independent of epoch rewarding (#860)
* Made daily uptime calculation be independent of epoch rewarding

It was moved into a separate timer

* Don't lookup active gateways during rewarding
2021-11-04 13:06:20 +00:00
Jędrzej Stuczyński bd4c18c723 Set MSRV on all binaries to 1.56 (#872) 2021-11-03 20:07:43 +00:00
fmtabbara e7716ae852 remove gateway selection on delegation and undelegation pages 2021-11-03 15:50:36 +00:00
Jędrzej Stuczyński b19528d47e Removed gateway rewarding and delegation (#856)
* Removed gateway rewarding and delegation

* Removed redundant error variants

* [ci skip] Generate TS types

* Test fixes

Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com>
2021-11-03 15:01:59 +00:00
Tommy Verrall ef88ce9252 Merge pull request #871 from nymtech/bug-fix/keyboard-shortcuts-macos
add native window items (copy/paste) via tauri
2021-11-03 14:24:00 +00:00
Bogdan-Ștefan Neacşu 488f1c7742 Remove stale migration code (#868) 2021-11-03 16:01:13 +02:00
fmtabbara 63c698d903 add native menu items via tauri 2021-11-03 11:42:47 +00:00
Jędrzej Stuczyński 7e1c3b4501 Chore/cosmrs update (#862)
* Re-enabled `get_tx` endpoint

* Updated cosmrs to 0.3 and prost to 0.9

* [ci skip] Generate TS types

Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com>
2021-11-03 11:03:18 +00:00
Jędrzej Stuczyński e1d7772a78 Removed epoch rewarding variance (#857) 2021-11-03 11:02:44 +00:00
Tommy Verrall 9db589e0b3 Merge pull request #842 from nymtech/bug-fix/success-overflow
fix delegate success overflow
2021-11-03 10:33:31 +00:00
Tommy Verrall 57c8d69785 Merge branch 'develop' into bug-fix/success-overflow 2021-11-03 10:32:55 +00:00
Jędrzej Stuczyński 4a9cc5b757 Fixed most recent nightly clippy warnings (#865) 2021-11-02 10:48:54 +02:00
Tommy Verrall 06aac9393b Merge pull request #855 from nymtech/feature-request-template
Update feature-request template
2021-11-01 11:31:24 +00:00
Tommy Verrall f4c5b1d67f Update feature-request template 2021-11-01 11:05:54 +00:00
Tommy Verrall 2e0aba6100 Merge pull request #854 from nymtech/issue-template
Update issue templates
2021-11-01 10:51:37 +00:00
Tommy Verrall 8c6549c5dd Update report.md
consolidated the component area
2021-11-01 10:05:24 +00:00
Tommy Verrall 7b431ebfa8 Update .github/ISSUE_TEMPLATE/report.md
Co-authored-by: Mark Sinclair <mmsinclair@gmail.com>
2021-11-01 09:55:12 +00:00
Tommy Verrall 3152fd6887 Update .github/ISSUE_TEMPLATE/report.md
Co-authored-by: Mark Sinclair <mmsinclair@gmail.com>
2021-11-01 09:54:35 +00:00
Tommy Verrall e03e7f186a Delete create-an-issue.md 2021-11-01 09:47:10 +00:00
Tommy Verrall ec056a548f Delete issue-report.md 2021-11-01 09:46:59 +00:00
Tommy Verrall 24aa075a07 Update issue templates
new issue template for individuals
2021-11-01 09:41:29 +00:00
Jędrzej Stuczyński 8488c4cb0f Overflow checks in release (#846) 2021-10-28 13:07:08 +01:00
Tommy Verrall 20c96b940f Update nym_wallet.yml
check binary exists after name change
2021-10-26 14:10:23 +01:00
Tommy Verrall cfb43699d6 Update nym_wallet.yml
last check to run single test
2021-10-26 13:04:52 +01:00
Tommy Verrall 79e7b5b938 Update nym_wallet.yml
add directory
2021-10-26 12:43:44 +01:00
Tommy Verrall 47156e693c Update nym_wallet.yml
address directory
2021-10-26 12:20:36 +01:00
Mark Sinclair b61f6c8833 Update nym_wallet.yml 2021-10-26 12:32:39 +03:00
Mark Sinclair cc3b710af9 Delete nym-wallet-tests.yml 2021-10-26 12:23:06 +03:00
Mark Sinclair 4de3f16bb3 Merge pull request #841 from nymtech/feature/tauri-wallet-tests
Feature NYM wallet webdriverio test
2021-10-26 10:21:45 +01:00
fmtabbara 7aad7daa5e fix overflow 2021-10-22 17:52:15 +01:00
Tommy 4107d670cf remove stray character 2021-10-22 17:44:58 +01:00
Tommy 284e797fb3 update readme 2021-10-22 17:43:15 +01:00
Tommy 8a63df3e82 remove duplicate loglevel output 2021-10-22 17:27:32 +01:00
Tommy 7b8731ddcc line endings again 2021-10-22 17:25:56 +01:00
Tommy 1017c9c642 more line endings 2021-10-22 17:24:58 +01:00
Tommy 4e0c59a8f1 sort out line endings 2021-10-22 17:24:05 +01:00
Tommy f6d85a0784 remove empty comment 2021-10-22 17:21:25 +01:00
Tommy 6516811276 add assertion on sending funds
need to improve the calculator
2021-10-22 17:20:00 +01:00
Tommy Verrall ca0ed3594f Update nym_wallet.yml
line spacing between on push and defaults
2021-10-22 15:38:42 +01:00
Tommy Verrall a28ad4f81a Merge pull request #840 from nymtech/feature/nym-wallet-tests
Update nym_wallet.yml
2021-10-22 15:32:18 +01:00
Tommy 0ea3183288 set logging to silent 2021-10-22 14:08:54 +01:00
Tommy c6ff7c51f0 setting build path for running the binary 2021-10-22 13:55:48 +01:00
Tommy Verrall 0240ab6144 Update nym_wallet.yml
Draft at the moment whilst figuring out config data
2021-10-22 13:37:24 +01:00
Tommy 2746ec49a3 Fixing bonding tests 2021-10-22 12:29:40 +01:00
Tommy b3f1c943a7 Uncomment test script 2021-10-22 10:33:28 +01:00
Tommy 7654ede904 Update tests to use new selectors, implement reporting
. Use accessible ID's to identify elements
. Implement reporting
. Clean up 
. Input more notes in README.md
2021-10-22 10:30:17 +01:00
Tommy c882487d01 change casing on identifiers to kebab-casing 2021-10-21 11:18:45 +01:00
Tommy 865e4839f3 merging develop 2021-10-21 11:04:57 +01:00
Tommy 5a270f6489 pushing new wallet create - WIP 2021-10-21 11:02:28 +01:00
Tommy Verrall 6776bb4bab Merge pull request #836 from nymtech/feature/add-dataids-wallet
Apply readable ids to elements on Nym Wallet
2021-10-21 10:28:36 +01:00
Tommy cbe9bad66e Apply readable test-dataIds to elements on Nym Wallet
To easily identify elements on the wallet to help with automation.
2021-10-20 16:39:30 +01:00
Tommy Verrall 5761e1c1a4 Merge pull request #831 from nymtech/update/use-nym-icons
update app name and icons
2021-10-19 14:21:51 +01:00
Mark Sinclair 062a5edf76 Merge pull request #806 from nymtech/bugfix/network-explorer-api-geoip
Bug fix: Network Explorer: Add freegeoip API key and split out tasks for country distributions
2021-10-19 11:53:22 +01:00
Jędrzej Stuczyński a009e76568 Feature locked client-side bandwidth metering (#820) 2021-10-19 11:30:34 +02:00
Jędrzej Stuczyński dcc9b856d7 Flag to only run coconut-related functionalities (#824) 2021-10-19 11:30:07 +02:00
Mark Sinclair 592e52b333 Hush nightly clippy, hush 2021-10-19 10:20:00 +01:00
Mark Sinclair bc923be862 Update README 2021-10-19 10:20:00 +01:00
Mark Sinclair e880631500 Remove unused imports 2021-10-19 10:20:00 +01:00
Mark Sinclair d9b0834476 Review feedback 2021-10-19 10:20:00 +01:00
Mark Sinclair 2fda22e168 Run new tasks at startup 2021-10-19 10:20:00 +01:00
Mark Sinclair a5091cd124 Split refreshing of mixnode cache into a separate task 2021-10-19 10:20:00 +01:00
Mark Sinclair b2ec19ece4 Split geolcation into its own task the picks off mixnodes that don't have locations or ones where the cache TTL has expired 2021-10-19 10:20:00 +01:00
Mark Sinclair 72e64cfab7 Split the mixnode country distribution calculation into its own task and get data from the location cache 2021-10-19 10:20:00 +01:00
Mark Sinclair 7eacb6b57e Add TTL to location cache 2021-10-19 10:20:00 +01:00
Mark Sinclair e0e1ca992f Move locations to their own cache 2021-10-19 10:20:00 +01:00
Mark Sinclair f1a628dee4 Change freegeoip API hostname 2021-10-19 10:20:00 +01:00
Mark Sinclair 81d49dc4b9 Add thiserror crate 2021-10-19 10:20:00 +01:00
Mark Sinclair 7e581183f4 Network Explorer API: add env var GEO_IP_SERVICE_API_KEY to provide an API key for https://freegeoip.app/ 2021-10-19 10:20:00 +01:00
fmtabbara a9f3fa0c72 update app name and icons 2021-10-19 09:08:07 +01:00
Tommy e6c5a97f8c set to silent logging 2021-10-18 12:18:18 +01:00
Tommy efb9b70293 merge develop 2021-10-18 12:17:44 +01:00
Tommy 666c233d6c remove workflow 2021-10-18 12:14:57 +01:00
Mark Sinclair 4307756719 Network Explorer: GitHub Actions
- change notification channel
- remove trigger on PR
2021-10-18 12:05:21 +01:00
Mark Sinclair 622d0d3ff9 Merge pull request #829 from nymtech/nym-wallet-test-yml
Create nym-wallet-tests.yml
2021-10-18 11:22:54 +01:00
Tommy Verrall ad763c2131 Update nym_wallet.yml
remove clippy
2021-10-18 11:18:59 +01:00
Jędrzej Stuczyński 87a2ec9468 Updated CODEOWNERS (#828) 2021-10-18 08:41:27 +01:00
Tommy dd590e8779 Update Readme for windows. 2021-10-15 18:17:51 +01:00
Tommy 9555f3a2cd testing tauri-wallet-tests.yml 2021-10-15 18:06:24 +01:00
Tommy Verrall 0b79fc33d7 nym-wallet-tests.yml 2021-10-15 18:05:16 +01:00
Tommy Verrall b7e14489da Create nym-wallet-tests.yml
action for building and running the tauri-wallet-tests
2021-10-15 17:46:53 +01:00
Tommy 84b426042e wrong workflow check in 2021-10-15 17:24:35 +01:00
Tommy f683b9e770 Tauri Wallet Test
. Currently developed against a Linux machine
. POM design
. README.md states how to get up and running on Linux 
WIP - areas of focus inbound ->
. CI
. Test suite configuration
. Working on multiple platforms
. Improve selector selection to reduce fragility in the future
2021-10-15 17:05:00 +01:00
Fouad 5fb2c9d822 Merge pull request #827 from nymtech/tauri-wallet-patch
Tauri wallet
2021-10-15 15:19:01 +01:00
Jędrzej Stuczyński 0f7280c227 Fixed most recent nightly clippy warnings (#817)
* Fixed most recent nightly clippy warnings

* Missing wasm32 changes
2021-10-15 08:57:16 +01:00
mmsinclair 4ebca86a66 [ci skip] Generate TS types 2021-10-14 15:41:13 +00:00
fmtabbara 1a0c6eed27 Tauri wallet 2021-10-14 16:30:09 +01:00
Bogdan-Ștefan Neacşu 673e13ec57 Change false to true, as for mixnodes (#822) 2021-10-13 19:28:47 +03:00
Jędrzej Stuczyński 7caac334f4 Feature/resending rewards on timeout (#810)
* Additional methods on nymd client

* Checking for time out errors

* Attempting retransmission on suspected time out

* Don't report error if tx is a mempool duplicate
2021-10-11 10:48:59 +01:00
Jędrzej Stuczyński 4e0e081b3e Feature/coconut feature (#805)
* 'Coconut' feature in gateway

* Enabled coconut feature in gateway-requests

* Native client coconut feature

* Ibid for socks5 client

* Ibid for wasm client

* Coconut feature flag for validator-api

* Added coconut feature flag to our CI

* build.yml typo

* Continue on windows errors

* Missing quote

* Another typo in build.yml

* Reclaiming disk space when building for windows on CI
2021-10-11 09:17:58 +01:00
Jędrzej Stuczyński 51dc8c81ed Rocket picking up environment from Rocket.toml again (#801)
* Rocket picking up environment from Rocket.toml again

* Removed unused import
2021-10-08 14:33:29 +01:00
Max H 727eedf7d3 updated docs link 2021-10-05 13:34:18 +02:00
Mark Sinclair e37fddf3ab Network Explorer: GitHub Actions - notification channel 2021-10-05 11:53:17 +01:00
Mark Sinclair 885679e575 Network Explorer: GitHub Actions - notification channel 2021-10-05 11:46:41 +01:00
Mark Sinclair 36554c3c34 Network Explorer: GitHub Actions - notification messages 2021-10-05 11:39:33 +01:00
Mark Sinclair 2197062372 Network Explorer: GitHub Actions - notification messages 2021-10-04 11:22:37 +01:00
Mark Sinclair 487b894f3d Network Explorer: GitHub Actions - send message content via stdin 2021-10-04 10:53:39 +01:00
Mark Sinclair a03603b274 Network Explorer: GitHub Actions - fix JSON quote escaping 2021-10-04 10:45:02 +01:00
Mark Sinclair e6879dba63 Network Explorer: GitHub Actions - handle env differently 2021-10-01 15:47:57 +01:00
Mark Sinclair 68a43e33b9 Network Explorer: GitHub Actions - change notifications to be generated from template files 2021-10-01 15:44:26 +01:00
Bogdan-Ștefan Neacşu db2ab41636 Remove migration code (#796) 2021-10-01 16:55:48 +03:00
Mark Sinclair c624327a7a Network Explorer: GitHub Action - add keybase notifications 2021-10-01 14:28:13 +01:00
Mark Sinclair 32ff5cbc1e Network Explorer: GitHub Actions - fix dist path 2021-09-30 16:02:51 +01:00
Mark Sinclair 9ba203c7b3 Network Explorer: GitHub Actions: rsync install 2021-09-30 15:52:02 +01:00
Mark Sinclair 729625ef4f Network Explorer: GitHub Action: install rsync 2021-09-30 15:49:39 +01:00
Mark Sinclair fd3923a5f9 Network Explorer: GitHub Actions - disable tests 2021-09-30 15:37:52 +01:00
Mark Sinclair c2fd07ea18 Fix typo 2021-09-30 15:29:23 +01:00
Mark Sinclair d76a2d84b5 Add GitHub Action to build Network Explorer 2021-09-30 15:19:23 +01:00
Bogdan-Ștefan Neacşu 2a98f7482d Feature/migrate hidden delegations (#786)
* Remove migration code

* Added function to iterate over delegation of variable type

* Add unit tests

* Refactored some naming and reused mix/gateway functionality

* Borrow bucket instead of move

* Linked with existing delegations function

* Migration of left-over delegations

* Remove unused imports

* Put a gateway test as well, next to the mix one

* Expose queries for all delegations

* Change break point

* Added client side calls to the new queries

* Fix clippy

* Added pagination and read check tests

* Fix gateway test from the last commit

* Test functions for (de)serialization of identity and owner (in)to storage keys

* Add delegation function unit test

* Feature guard import

* Changed UnpackedDelegation from type to struct

* Remove mutable parameter and put start_after in returned value

* Made all delegations into iterator for OOM safety

* Fix clippy

* Add test for delegations iterator size in memory

* Change map with if let for ease of read

* Use DENOM instead of hardcoded value
2021-09-30 15:04:33 +03:00
Jędrzej Stuczyński 12637d93ff Feature/persistent gateway storage (#784)
* Sqlx struct stub

* Initial schema

* Initial error enum

* Managed for persisted shared keys

* Initial inbox manager

* Comments

* Using new database in clients handler

* Extending gateway storage API

* tokio::main + placeholder values

* Removed old client store

* Simplified logic of async packet processing

* Renamed table + not null restriction

* BandwidthManager

* Removed sled dependency

* Using centralised storage for bandwidth

* Dead code removal

* WIP connection_handler split and simplification

Maybe it doesn't look like it right now, but once completed it will remove bunch of redundant checks for Nones etc

* Further more explicit clients handler split

* Minor cleanup

* Temporary store for active client handles

* Fixed error types

* Error trait on iv and encrypted address

* Authentication and registration moved to the handler

* Removal of clients handler

* Further logic simplification + returned explicit bandwidth values

* Further cleanup and comments

* Updated config with relevant changes

* Basic bandwidth tracking in client

* FreshHandle doc comments + fixed stagger issue

* Removed side-effects from .map

* More doc comments

* Database migration on build

* Increased default claimed bandwidth

* Renaming

* Fixed client determining available bandwidth

* Removed dead sql table that might be used in the future

* Windows workaround

* Comment

* Return error rather than cap credential
2021-09-30 09:45:21 +01:00
Jędrzej Stuczyński f63aba9058 Removes code of executed migrations (#793) 2021-09-28 10:13:05 +01:00
Jędrzej Stuczyński 668325a4ce Feature/active sets (#764)
* Added separate gateway active set size

* Grabbing contract state

* Defined PartialOrd on MixnodeBond and GatewayBond

* Some initial stub for active set

* Unit tests for mixnode and gateway bond partialord implementation

* Obtaining active sets

* Active nodes routes

* Additional methods on validator client

* Added state migration

* Feature locking unused import

* Fixed State test fixture

* Included block height for partial_ord

* Missing post-merge imports

* api on the client for active nodes

* Native/socks5/wasm clients using active nodes

* Rewarding only active nodes

* Updated validator client StateParams definition

* Gateway active set size

* Contract migration update

* Cargo fmt

* Updated TauriStateParams

* [ci skip] Generate TS types

Co-authored-by: jstuczyn <jstuczyn@users.noreply.github.com>
2021-09-28 09:38:22 +01:00
Jędrzej Stuczyński e891c68158 Created getters for AccountData (#787) 2021-09-27 12:16:16 +02:00
Jędrzej Stuczyński b1fb032f43 Removed SQLx offline mode artifact (#790) 2021-09-27 12:06:13 +02:00
Jędrzej Stuczyński 23ea82952e Bugfix/validator api windows build (#791)
* Use https://github.com/nymtech/nym/pull/784/commits/3eceb349c695372cbb7a3bee9aa5e090da7c9c4d trick to make build.rs work with windows

* Re-enabled validator-api windows CI build
2021-09-27 12:05:53 +02:00
Drazen Urch 9a65e44166 Add Tauri wallet
--
Squashed commit of the following:

commit 3f4f9073b7
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 27 11:38:12 2021 +0200

    Delete .lock for merge

commit bf502f6338
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 27 11:36:51 2021 +0200

    Squashed commit of the following:

    commit 020cad897d
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Fri Sep 24 15:49:21 2021 +0100

        Feature/rust rewarding (#750)

        * Calculating gas fees

        * Ability to set custom fees

        * Added extra test

        * Removed commented code

        * Moved all msg types to common contract crate

        * Temporarily disabling get_tx method

        * Finishing up nymd client API

        * Comment fix

        * Remaining fee values

        * Some cleanup

        * Removed needless borrow

        * Fixed imports in contract tests

        * Moved error types around

        * New ValidatorClient

        * Experiment with new type of defaults

        * Removed dead module

        * Dealt with unwrap

        * Migrated mixnode to use new validator client

        * Migrated gateway to use new validator client

        * Mixnode and gateway adjustments

        * More exported defaults

        * Clients using new validator client

        * Fixed mixnode upgrade

        * Moved default values to a new crate

        * Changed behaviour of validator client features

        * Migrated basic functions of validator api

        * Updated config + fixed startup

        * Fixed wasm client build

        * Integration with the explorer api

        * Removed tokio dev dependency

        * Needless borrow

        * Fixex wasm client build

        * Fixed tauri client build

        * Needless borrows

        * New tables for rewarding

        * Updated cosmos-sdk version

        * Removed reward-specific node status routes

        * New rewarding-specific config entries

        * Additional network defaults

        * Initial periodic rewards from validator api

        * Replaced print with log

        * Filtering nodes with uptime > 0

        * Additional failure logging statements

        * Fixed operation ordering

        * Adjusted next rewarding epoch determination

        * Modified rewarding behaviour to keep track of rewarding in progress

        * Improved error message on config load failure

        * Additional log statement

        * Adjusted rewarding gas limit calculation

        * Made naming slightly more consistent

        * Fixed incorrect parentheses placement

        * Fixed fee calculation

        * Cargo fmt

        * Removed failed merge artifacts

        * Introduced comment for any future reward modification

        * typos

        * Helper functions for the future

        * Making @mfahampshire 's life easier

        * Redesigned epoch + rewarding skipped epochs (if possible)

        * Removed old merge artifacts

        * Naming consistency

        * Constraining arguments

        * Removed unnecessary if branch

        * Ignore monitor check for current epoch

        * Additional checks for current epoch data

        * Monitor threshold check

        * cargo fmt

        * Fixed post-merge issues in transactions.rs

    commit 5dfaff6296
    Author: Drazen Urch <drazen@urch.eu>
    Date:   Tue Sep 21 10:59:17 2021 +0200

        Update hmac and blake3 (#673)

        * Update hmac and blake3

        * Remain paranoid for `0.*` crates

        * Most paranoid versions :)

        * Updated aes and using published version of blake3

        Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>

    commit 5b03982043
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Mon Sep 20 10:40:03 2021 +0100

        Replaced unwrap_or_else with unwrap_or_default (#780)

    commit 8f6856d6fb
    Author: Drazen Urch <drazen@urch.eu>
    Date:   Mon Sep 20 11:15:06 2021 +0200

        Make fee helpers public (#777)

        Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>

commit 80664b911f
Merge: f66ea059 46149012
Author: Fouad <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 23 20:59:27 2021 +0100

    Merge pull request #783 from nymtech/tauri-wallet-frontend

    tauri wallet front-end

commit 46149012bd
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 23 17:42:34 2021 +0100

    PR updates

commit de601c319a
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 23 17:06:47 2021 +0100

    PR updates

commit 7318de23f2
Author: max <mfahampshire@gmail.com>
Date:   Wed Sep 22 18:07:29 2021 +0200

    added info on nym-wallet (tauri) in readme

commit 56e07753ea
Author: max <mfahampshire@gmail.com>
Date:   Wed Sep 22 14:44:22 2021 +0200

    added minimal readme for wallet

commit 21b008fae9
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 13 13:30:05 2021 +0100

    use wrapper functions for send and delegate

    form updates

    update working

    finish bonding and unbonding setup

    funds allocation check when bonding/sending/delegating

    update title

commit 27a202cbe8
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 17 11:32:41 2021 +0100

    integrate admin functions

    updates

    integrate admin form update function

commit 085538582b
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Fri Sep 17 10:43:26 2021 +0200

    Admin functions, reorganize code

commit f66ea05929
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Fri Sep 17 10:43:26 2021 +0200

    Admin functions, reorganize code

commit 052c7188ec
Merge: f6c316ee 976dd7aa
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 17 09:38:19 2021 +0100

    merge develop

commit f6c316eea9
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 16 18:02:15 2021 +0200

    fix typo

commit f33defc645
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 16 17:36:24 2021 +0200

    Squashed commit of the following:

    commit 976dd7aae2
    Author: Drazen Urch <drazen@urch.eu>
    Date:   Wed Sep 15 17:28:49 2021 +0200

        Add block_height method to Delegation (#778)

        Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>

    commit 0d21f4e937
    Merge: e84af4f6 1403449a
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Wed Sep 15 12:41:29 2021 +0100

        Merge pull request #776 from nymtech/update/re-enable-bonding

        re-enable bonding

    commit 1403449ad5
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Tue Sep 14 16:00:21 2021 +0100

        enable bonding

    commit e84af4f601
    Author: Drazen Urch <drazen@urch.eu>
    Date:   Tue Sep 14 15:15:26 2021 +0200

        Migrate legacy delegation data (#771)

        * Skip ReadOnlyBucket deserialization errors

        * empty migration

        * clippy

        * cargo schema

        * Drop invalid delegation data

        * Dont drop old data

        * Add todo

        * Unify on type param

        * gateways are different

        * cargo fmt

        Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>

    commit 26b032c15c
    Merge: e1ddaff0 cba36253
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Tue Sep 14 10:09:14 2021 +0100

        Merge pull request #774 from nymtech/feature/explorer-api-delegations

        Explorer-api: add API resource to show the delegations for each mix node

    commit cba3625394
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Mon Sep 13 10:33:41 2021 +0100

        explorer-api: add API resource to show the delegations for each mix node

    commit e1ddaff04d
    Merge: 0b9c03ca 66ab5de4
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Fri Sep 10 17:17:14 2021 +0100

        Merge pull request #772 from nymtech/update/disable-bonding

        add app alert

    commit 66ab5de442
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Fri Sep 10 16:16:58 2021 +0100

        add app alert

    commit 0b9c03ca90
    Author: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
    Date:   Fri Sep 10 11:23:21 2021 +0300

        Adding deps for building the Tauri wallet under Ubuntu (#770)

    commit c9dce0c1da
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Thu Sep 9 11:21:45 2021 +0200

        Feature/consumable bandwidth (#766)

        * Set actual value for bandwidth

        Also put it as a public attribute, such that it can be actively used
        by the credential consumer

        * Switch from sending Attribute structs to sending the actual attribute bytes over the wire

        * Add atomic bandwidth value to gateway

        * Consume bandwidth based on the mix packet size

        * Use Bandwidth struct for specific functionality

        * Move bandwidth code outside the dependency path of wasm client

        * Use u64 instead of AtomicU64, as the handling is not parallel

    commit e00e77db15
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Wed Sep 8 15:07:24 2021 +0200

        Feature/bond blockstamp (#760)

        * Add block_height to MixNode/GatewayBond

        * Reward based on blockstamp of bonded node or of delegation

        * Add specific tests

        * Add migration code

        * Apply doc nit

    commit 1074449f91
    Merge: 08276e6e 9a3d824a
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Tue Sep 7 23:45:10 2021 +0100

        Merge pull request #767 from nymtech/update/remove-app-alert

        remove alert

    commit 08276e6e42
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Tue Sep 7 16:33:30 2021 +0200

        Remove migration code (#759)

    commit 9a3d824a4a
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Mon Sep 6 20:39:24 2021 +0100

        remove alert

    commit 2789ee8f18
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Fri Sep 3 15:30:45 2021 +0300

        Update coconut-rs and use hash_to_scalar from there (#765)

        Failed tests are due to some nightly issue, not related to this PR

    commit a7ba643c35
    Merge: 28be53ee c42f3c68
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Fri Sep 3 09:14:50 2021 +0100

        Merge pull request #762 from nymtech/feature/app-alert

        add app alert banner

    commit 28be53eefb
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Thu Sep 2 18:26:40 2021 +0300

        Add block_height in the Delegation structure as well (#757)

    commit 219c45a352
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Thu Sep 2 15:48:29 2021 +0100

        Updated cosmos-sdk (#761)

        * Updated cosmos-sdk

        * Re-exposing more things

    commit 1a3b83752e
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Date:   Thu Sep 2 15:45:56 2021 +0100

        Bump next from 11.1.0 to 11.1.1 in /wallet-web (#758)

        Bumps [next](https://github.com/vercel/next.js) from 11.1.0 to 11.1.1.
        - [Release notes](https://github.com/vercel/next.js/releases)
        - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
        - [Commits](https://github.com/vercel/next.js/compare/v11.1.0...v11.1.1)

        ---
        updated-dependencies:
        - dependency-name: next
          dependency-type: direct:production
        ...

        Signed-off-by: dependabot[bot] <support@github.com>

        Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

    commit c42f3c6844
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Thu Sep 2 12:29:47 2021 +0100

        add app alert banner

    commit a5d3ba3900
    Merge: 92e13a5d cdf0d443
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Tue Aug 31 15:59:11 2021 +0100

        Merge pull request #755 from nymtech/bugfix/explorer-api-ping

        Explorer API: port test now split out address resolution and add units tests

    commit cdf0d44341
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Tue Aug 31 14:37:28 2021 +0100

        explorer-api: turned down logging from `error` to `warn`

    commit 92f976a45d
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Fri Aug 27 11:34:21 2021 +0100

        explorer-api: sanitize hostname before running checks to avoid leading or trailing spaces that are known to exist in the current test net

    commit 2bc858cde3
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Fri Aug 27 09:32:26 2021 +0100

        explorer-api: port test: split out address resolution and add units tests

    commit 92e13a5d00
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Tue Aug 31 14:51:15 2021 +0300

        Feature/add blockstamp (#756)

        * Add RawDelegationData

        * Fix current tests for the new stored data

        * Added migration commit. Will be reverted after doing the migration

        * New tests for block height

        * Use current blockstamp instead of 24h old one

        * Put _alot_ of migration stuff in the migrate function scope

    commit 122f5d9f2e
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Mon Aug 30 10:27:20 2021 +0300

        Feature/cred after handshake (#745)

        * Call perform_initial_authentication instead of register in clients

        * Refactor the register/authenticate functions a bit

        * Introduce Bandwidth request type

        * Add encryption layer to cred

        * Remove cred pass and check from handshake

        * Replaced unreachable!  with error

        * Changed decrypt_tagged signature to not take mutable ownership of data

        * Put handle_bandwidth work inside a function

        * Add check before unwrap

        * Remove unnecessary async

        * Decouple bandwidth credential from authentication

        * Use new_error for ServerResponse:Error

        * Send a fresh IV each time the BandwidthCredential request is sent

        * Remove unwrap of bincode::serialize

        * Add comment regarding Bandwidth response

        * Remove _mut from naming

        * Leave Debug trait alone, as the initial error doesn't reproduce anymore

        * Pass iv as Vec<u8> instead of base58 string

        * Renamed AuthenticationIV to IV, as it is now used for more the just authentication

        * Did some IV refactorization

    commit 982ee0266c
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Fri Aug 27 16:02:34 2021 +0300

        Feature/get own delegations (#748)

        * Introduce reverse delegation bucket

        * Add client command

        * Fix clippy error

        * Added tests in queries

        * Add tests in transactions

        * Migration code. Will be reverted after it's called on testnet

        * Replace unwrap with expect

        * Move some test code in the right file...

        ... to remove unnecessary auxiliary function.

        * Reduce the scope to migration auxiliary functions

        * Rename everything from [node]reverse to reverse[node]

        * Fix fmt

    commit 5f42a9bd05
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Fri Aug 27 13:52:18 2021 +0100

        NetworkMonitorBuilder - starting the monitor after rocket has launched (#754)

        * NetworkMonitorBuilder - starting the monitor after rocket has launched

        * Removed unused import

    commit 1811df9ddb
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Fri Aug 27 13:52:10 2021 +0100

        Enabled validators api argument (#753)

    commit 6bdfe7f895
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Thu Aug 26 11:21:01 2021 +0100

        Correctly bounding nominator of uptime calculation (#752)

    commit c6b286a1db
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Wed Aug 25 14:50:57 2021 +0100

        Fixed argument parsing for ipv6 'good' topology (#751)

    commit b3568a26f5
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Tue Aug 24 11:25:05 2021 +0300

        Revert "Migration commit, will be reverted after the testnet contract is updated" (#749)

        This reverts commit 38d868bcce.

    commit 15ae0f521e
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Mon Aug 23 10:26:51 2021 +0100

        Feature/more reliable uptime calculation (#747)

        * New database table holding monitor run info

        * SQL interface for new table

        * Updated uptime calculation to instead rely on number of monitor test runs

    commit 2923d4b872
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Thu Aug 19 22:03:07 2021 +0300

        Update template toml key (#746)

commit 424230c3bb
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 16 17:33:20 2021 +0200

    Squashed commit of the following:

    commit cddd9e8e4c
    Merge: 40fbdff0 976dd7aa
    Author: Drazen Urch <durch@users.noreply.guthub.com>
    Date:   Thu Sep 16 17:27:27 2021 +0200

        Merge branch 'develop' into tauri-wallet

    commit 976dd7aae2
    Author: Drazen Urch <drazen@urch.eu>
    Date:   Wed Sep 15 17:28:49 2021 +0200

        Add block_height method to Delegation (#778)

        Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>

    commit 0d21f4e937
    Merge: e84af4f6 1403449a
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Wed Sep 15 12:41:29 2021 +0100

        Merge pull request #776 from nymtech/update/re-enable-bonding

        re-enable bonding

    commit 1403449ad5
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Tue Sep 14 16:00:21 2021 +0100

        enable bonding

    commit e84af4f601
    Author: Drazen Urch <drazen@urch.eu>
    Date:   Tue Sep 14 15:15:26 2021 +0200

        Migrate legacy delegation data (#771)

        * Skip ReadOnlyBucket deserialization errors

        * empty migration

        * clippy

        * cargo schema

        * Drop invalid delegation data

        * Dont drop old data

        * Add todo

        * Unify on type param

        * gateways are different

        * cargo fmt

        Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>

    commit 26b032c15c
    Merge: e1ddaff0 cba36253
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Tue Sep 14 10:09:14 2021 +0100

        Merge pull request #774 from nymtech/feature/explorer-api-delegations

        Explorer-api: add API resource to show the delegations for each mix node

    commit cba3625394
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Mon Sep 13 10:33:41 2021 +0100

        explorer-api: add API resource to show the delegations for each mix node

    commit e1ddaff04d
    Merge: 0b9c03ca 66ab5de4
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Fri Sep 10 17:17:14 2021 +0100

        Merge pull request #772 from nymtech/update/disable-bonding

        add app alert

    commit 66ab5de442
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Fri Sep 10 16:16:58 2021 +0100

        add app alert

    commit 0b9c03ca90
    Author: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
    Date:   Fri Sep 10 11:23:21 2021 +0300

        Adding deps for building the Tauri wallet under Ubuntu (#770)

    commit c9dce0c1da
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Thu Sep 9 11:21:45 2021 +0200

        Feature/consumable bandwidth (#766)

        * Set actual value for bandwidth

        Also put it as a public attribute, such that it can be actively used
        by the credential consumer

        * Switch from sending Attribute structs to sending the actual attribute bytes over the wire

        * Add atomic bandwidth value to gateway

        * Consume bandwidth based on the mix packet size

        * Use Bandwidth struct for specific functionality

        * Move bandwidth code outside the dependency path of wasm client

        * Use u64 instead of AtomicU64, as the handling is not parallel

    commit e00e77db15
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Wed Sep 8 15:07:24 2021 +0200

        Feature/bond blockstamp (#760)

        * Add block_height to MixNode/GatewayBond

        * Reward based on blockstamp of bonded node or of delegation

        * Add specific tests

        * Add migration code

        * Apply doc nit

    commit 1074449f91
    Merge: 08276e6e 9a3d824a
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Tue Sep 7 23:45:10 2021 +0100

        Merge pull request #767 from nymtech/update/remove-app-alert

        remove alert

    commit 08276e6e42
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Tue Sep 7 16:33:30 2021 +0200

        Remove migration code (#759)

    commit 9a3d824a4a
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Mon Sep 6 20:39:24 2021 +0100

        remove alert

    commit 2789ee8f18
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Fri Sep 3 15:30:45 2021 +0300

        Update coconut-rs and use hash_to_scalar from there (#765)

        Failed tests are due to some nightly issue, not related to this PR

    commit a7ba643c35
    Merge: 28be53ee c42f3c68
    Author: Fouad <fmtabbara@hotmail.co.uk>
    Date:   Fri Sep 3 09:14:50 2021 +0100

        Merge pull request #762 from nymtech/feature/app-alert

        add app alert banner

    commit 28be53eefb
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Thu Sep 2 18:26:40 2021 +0300

        Add block_height in the Delegation structure as well (#757)

    commit 219c45a352
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Thu Sep 2 15:48:29 2021 +0100

        Updated cosmos-sdk (#761)

        * Updated cosmos-sdk

        * Re-exposing more things

    commit 1a3b83752e
    Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Date:   Thu Sep 2 15:45:56 2021 +0100

        Bump next from 11.1.0 to 11.1.1 in /wallet-web (#758)

        Bumps [next](https://github.com/vercel/next.js) from 11.1.0 to 11.1.1.
        - [Release notes](https://github.com/vercel/next.js/releases)
        - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
        - [Commits](https://github.com/vercel/next.js/compare/v11.1.0...v11.1.1)

        ---
        updated-dependencies:
        - dependency-name: next
          dependency-type: direct:production
        ...

        Signed-off-by: dependabot[bot] <support@github.com>

        Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

    commit c42f3c6844
    Author: fmtabbara <fmtabbara@hotmail.co.uk>
    Date:   Thu Sep 2 12:29:47 2021 +0100

        add app alert banner

    commit a5d3ba3900
    Merge: 92e13a5d cdf0d443
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Tue Aug 31 15:59:11 2021 +0100

        Merge pull request #755 from nymtech/bugfix/explorer-api-ping

        Explorer API: port test now split out address resolution and add units tests

    commit cdf0d44341
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Tue Aug 31 14:37:28 2021 +0100

        explorer-api: turned down logging from `error` to `warn`

    commit 92f976a45d
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Fri Aug 27 11:34:21 2021 +0100

        explorer-api: sanitize hostname before running checks to avoid leading or trailing spaces that are known to exist in the current test net

    commit 2bc858cde3
    Author: Mark Sinclair <mmsinclair@gmail.com>
    Date:   Fri Aug 27 09:32:26 2021 +0100

        explorer-api: port test: split out address resolution and add units tests

    commit 92e13a5d00
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Tue Aug 31 14:51:15 2021 +0300

        Feature/add blockstamp (#756)

        * Add RawDelegationData

        * Fix current tests for the new stored data

        * Added migration commit. Will be reverted after doing the migration

        * New tests for block height

        * Use current blockstamp instead of 24h old one

        * Put _alot_ of migration stuff in the migrate function scope

    commit 122f5d9f2e
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Mon Aug 30 10:27:20 2021 +0300

        Feature/cred after handshake (#745)

        * Call perform_initial_authentication instead of register in clients

        * Refactor the register/authenticate functions a bit

        * Introduce Bandwidth request type

        * Add encryption layer to cred

        * Remove cred pass and check from handshake

        * Replaced unreachable!  with error

        * Changed decrypt_tagged signature to not take mutable ownership of data

        * Put handle_bandwidth work inside a function

        * Add check before unwrap

        * Remove unnecessary async

        * Decouple bandwidth credential from authentication

        * Use new_error for ServerResponse:Error

        * Send a fresh IV each time the BandwidthCredential request is sent

        * Remove unwrap of bincode::serialize

        * Add comment regarding Bandwidth response

        * Remove _mut from naming

        * Leave Debug trait alone, as the initial error doesn't reproduce anymore

        * Pass iv as Vec<u8> instead of base58 string

        * Renamed AuthenticationIV to IV, as it is now used for more the just authentication

        * Did some IV refactorization

    commit 982ee0266c
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Fri Aug 27 16:02:34 2021 +0300

        Feature/get own delegations (#748)

        * Introduce reverse delegation bucket

        * Add client command

        * Fix clippy error

        * Added tests in queries

        * Add tests in transactions

        * Migration code. Will be reverted after it's called on testnet

        * Replace unwrap with expect

        * Move some test code in the right file...

        ... to remove unnecessary auxiliary function.

        * Reduce the scope to migration auxiliary functions

        * Rename everything from [node]reverse to reverse[node]

        * Fix fmt

    commit 5f42a9bd05
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Fri Aug 27 13:52:18 2021 +0100

        NetworkMonitorBuilder - starting the monitor after rocket has launched (#754)

        * NetworkMonitorBuilder - starting the monitor after rocket has launched

        * Removed unused import

    commit 1811df9ddb
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Fri Aug 27 13:52:10 2021 +0100

        Enabled validators api argument (#753)

    commit 6bdfe7f895
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Thu Aug 26 11:21:01 2021 +0100

        Correctly bounding nominator of uptime calculation (#752)

    commit c6b286a1db
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Wed Aug 25 14:50:57 2021 +0100

        Fixed argument parsing for ipv6 'good' topology (#751)

    commit b3568a26f5
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Tue Aug 24 11:25:05 2021 +0300

        Revert "Migration commit, will be reverted after the testnet contract is updated" (#749)

        This reverts commit 38d868bcce.

    commit 15ae0f521e
    Author: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
    Date:   Mon Aug 23 10:26:51 2021 +0100

        Feature/more reliable uptime calculation (#747)

        * New database table holding monitor run info

        * SQL interface for new table

        * Updated uptime calculation to instead rely on number of monitor test runs

    commit 2923d4b872
    Author: Bogdan-Ștefan Neacşu <bogdan@nymtech.net>
    Date:   Thu Aug 19 22:03:07 2021 +0300

        Update template toml key (#746)

commit cddd9e8e4c
Merge: 40fbdff0 976dd7aa
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 16 17:27:27 2021 +0200

    Merge branch 'develop' into tauri-wallet

commit 63bc42cd5f
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 16 10:01:53 2021 +0100

    update title

commit 9dc8ba7b77
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 15 21:39:18 2021 +0100

    funds allocation check when bonding/sending/delegating

commit e130131f16
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 15 20:37:24 2021 +0100

    finish bonding and unbonding setup

commit 64a5b4b593
Merge: 9934b9bc 40fbdff0
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Sep 14 12:08:38 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    rust updates

commit 40fbdff05a
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Tue Sep 14 10:29:31 2021 +0200

    Coin and denom tests

commit 9934b9bc8a
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 13 15:20:56 2021 +0100

    update working

commit 6954b383a7
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 13 14:26:21 2021 +0100

    form updates

commit 4b5276e816
Merge: 56a95274 0278bd2c
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 13 13:32:24 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    rust updates

commit 0278bd2c26
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 13 14:31:33 2021 +0200

    Fix coin to cosmwasm coin

commit 56a9527497
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 13 13:30:05 2021 +0100

    use wrapper functions for send and delegate

commit a601c28a20
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 13 13:07:57 2021 +0200

    Return useful info from bond/unbond

commit 005dd7513b
Merge: 3ebdc558 aaf5d186
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 13 12:58:01 2021 +0200

    Merge branch 'tauri-wallet-frontend' into tauri-wallet

commit 3ebdc55847
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 13 12:50:26 2021 +0200

    extract Coin and Denom

commit aaf5d18692
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 13 11:19:28 2021 +0100

    update admin component

commit bcbec1f3e6
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sun Sep 12 21:49:39 2021 +0100

    admin form style updates

commit c95005265d
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sun Sep 12 01:26:57 2021 +0100

    button updates

commit b299c9e4b5
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sun Sep 12 01:03:21 2021 +0100

    add qrcode to receive page

commit bacbd3dfce
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sun Sep 12 00:40:53 2021 +0100

    fix bug

commit 55561fe1f7
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sun Sep 12 00:26:15 2021 +0100

    add admin page

commit 0d01500b87
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sat Sep 11 00:35:14 2021 +0100

    remove login deets

commit 74e34567b4
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sat Sep 11 00:32:54 2021 +0100

    form updates

commit b77025bfd5
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sat Sep 11 00:10:03 2021 +0100

    form updates

commit 4d831efcd6
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 22:33:00 2021 +0100

    more fees work

commit d227d20385
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 17:31:04 2021 +0100

    add gas fees to bond form

commit fb2d3bae3c
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 14:17:24 2021 +0100

    use new getFee api

commit 967d74eb19
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 11:15:52 2021 +0100

    add nvmrc file

commit 228df278d9
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 11:13:18 2021 +0100

    update tsconfig

commit 37da23ab1c
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 09:56:04 2021 +0100

    set up global error handling

commit 0c9cf7b5d9
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 10 09:16:45 2021 +0100

    finish create account

commit 262149078c
Merge: 08fd1c1b 3bcbb901
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 9 19:21:38 2021 +0100

    rust updates

commit 08fd1c1b47
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 9 19:00:30 2021 +0100

    make getBalance global

commit 3bcbb90127
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 9 17:47:11 2021 +0200

    fix docs

commit 8156ed0029
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 9 17:43:56 2021 +0200

    get_fee, create_new_account

commit 265f7a7c2e
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 9 13:21:27 2021 +0200

    Dedicated workspace, random_mnemonic, gas_limits

commit 5de8c9d1ed
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 9 11:35:49 2021 +0100

    style updates

commit 7658eec9b9
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 9 09:16:38 2021 +0100

    create account page

commit 99c49581df
Merge: 7a8ad138 926689da
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 8 20:49:27 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    rust updates

commit 926689da1d
Merge: 714171f4 b40be179
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Wed Sep 8 11:54:49 2021 +0200

    Merge branch 'tauri-wallet' of https://github.com/nymtech/nym into tauri-wallet

commit 714171f4e5
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Wed Sep 8 11:54:36 2021 +0200

    redundant into

commit 7a8ad1387d
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 8 10:30:51 2021 +0100

    add eslint file

commit bd72426280
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Sep 7 23:44:02 2021 +0100

    start adding gas fees

commit 48d0f31d7e
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Sep 7 23:13:54 2021 +0100

    send updates

commit 4522c18a55
Merge: b9389f12 b40be179
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Sep 7 21:53:38 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    rust updates

commit b9389f1235
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Sep 7 21:53:05 2021 +0100

    send updates

commit b40be179ae
Author: durch <durch@users.noreply.github.com>
Date:   Tue Sep 7 12:37:24 2021 +0000

    [ci skip] Generate TS types

commit 32ef9e019e
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Tue Sep 7 14:26:48 2021 +0200

    More verbose send response

commit 45a56a7088
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 6 20:27:15 2021 +0100

    update logo

commit d50afd6113
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 6 20:00:47 2021 +0200

    Add coconut creds

commit 3205b1e0e6
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 6 16:42:56 2021 +0100

    start work on send form

commit 53ea8486f8
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 6 17:36:46 2021 +0200

    get_gas_price, get_gas_limits

commit 43ababf8d4
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Mon Sep 6 17:31:08 2021 +0200

    Rework client errors

commit 5461574023
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 6 13:23:20 2021 +0100

    small refactors

commit 01d2df7bb7
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Sep 6 11:12:39 2021 +0100

    set up form validation for undelegation

commit 7cff72757b
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sun Sep 5 00:07:46 2021 +0100

    set up delgate request

commit 5bcbf45d16
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Sat Sep 4 22:52:02 2021 +0100

    onerror onsuccess added to bond form

commit 4295d75e0f
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 16:53:32 2021 +0100

    format bonding data pre request

commit 018666a614
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 16:37:51 2021 +0100

    layout updates

commit 15048524a7
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 16:25:15 2021 +0100

    layout updates

commit 2b792945cc
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 15:07:38 2021 +0100

    update type roots

commit b6193270a6
Merge: 0b4a8fe6 29973379
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 15:02:56 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    rust updates

commit 0b4a8fe657
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 15:02:09 2021 +0100

    update type roots

commit 2997337948
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Fri Sep 3 15:29:20 2021 +0200

    printable balance should be major

commit e1bea43ff4
Author: Drazen Urch <drazen@urch.eu>
Date:   Fri Sep 3 15:22:48 2021 +0200

    Autogenerate types (#763)

    * Generate TS types on push

    * run shell

    * fix typo

    * pango

    * libpango-dev

    * hopefully all deps are in now :)

    Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>

commit 27ef28da8d
Merge: 42bf139e 87a0b05d
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 12:13:28 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    rust updates

commit 42bf139ebb
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 12:12:52 2021 +0100

    update args collection function

commit 352862e4d0
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 11:42:31 2021 +0100

    delegation form validation

commit 9f9ab010d8
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Sep 3 11:39:17 2021 +0100

    integrate rust generated types

commit 87a0b05d1a
Author: Drazen Urch <drazen@urch.eu>
Date:   Fri Sep 3 07:43:29 2021 +0200

    Send

commit dbf82da9b6
Author: Drazen Urch <drazen@urch.eu>
Date:   Fri Sep 3 07:36:02 2021 +0200

    Delegation docs

commit 01a4305883
Author: Drazen Urch <drazen@urch.eu>
Date:   Fri Sep 3 07:33:11 2021 +0200

    Delegation

commit 704b3241ee
Author: Drazen Urch <drazen@urch.eu>
Date:   Fri Sep 3 06:58:57 2021 +0200

    Gateway bonding

commit 4513edae46
Merge: 5d3f1b86 f020b211
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 2 21:38:19 2021 +0100

    rust updates

commit f020b21106
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 2 21:08:19 2021 +0200

    node unbond

commit 2587906473
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Thu Sep 2 20:57:10 2021 +0200

    TS exports, rework internals

commit 5d3f1b86e8
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 2 17:29:03 2021 +0100

    delegate form validation

commit 5a17e48581
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 2 16:11:54 2021 +0100

    finish bond form validation

commit 41356f2181
Merge: bd7d7887 63107c2b
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 2 10:10:55 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    merge rust updates

commit bd7d788741
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Thu Sep 2 10:10:18 2021 +0100

    more validation work

commit 63107c2bca
Author: Drazen Urch <drazen@urch.eu>
Date:   Thu Sep 2 10:27:49 2021 +0200

    WIP node bonding

commit f043639ad2
Merge: 1d2a1b26 6fb15fff
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 19:48:22 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    merge rust update

commit 1d2a1b2635
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 19:47:41 2021 +0100

    start form validation

commit 6fb15fff8b
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Wed Sep 1 16:33:29 2021 +0200

    printable_balance

commit c69d7fa46f
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 15:12:50 2021 +0100

    remove unused imports

commit c2ee02a2cf
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 15:12:25 2021 +0100

    use printable balance

commit 6f5f0c00b5
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 15:11:24 2021 +0100

    use printable balance

commit 12707c5f1e
Merge: 2aa7fa04 0daf89ee
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 14:59:27 2021 +0100

    merge rust updates

commit 0daf89eeb4
Author: Drazen Urch <drazen@urch.eu>
Date:   Wed Sep 1 15:14:50 2021 +0200

    Utility native <> printable functions

commit 2aa7fa0426
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 13:41:42 2021 +0100

    move balance function call to global state

commit f5aa6e2db2
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Sep 1 09:39:22 2021 +0100

    style updates

commit ee5d1c3419
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 20:57:21 2021 +0100

    fix nav styling

commit e68c261162
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 20:48:30 2021 +0100

    fix ts error

commit c7fe4cd24e
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 15:28:46 2021 +0100

    update imports

commit 1c690fc3d0
Merge: d8e6a5fb f56edb82
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 15:24:35 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    merge rust updates

commit f56edb825a
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Tue Aug 31 15:22:10 2021 +0200

    Fix client address

commit d8e6a5fb2e
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 12:55:13 2021 +0100

    make typescript happy

commit b95893bb02
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 11:20:12 2021 +0100

    update balance page

commit 6bdff701b4
Merge: ccdb5911 eff38c84
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 11:05:51 2021 +0100

    merge backend updates

commit ccdb5911c6
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 31 09:35:24 2021 +0100

    update routing and use new sign in function

commit eff38c8466
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Tue Aug 31 07:38:25 2021 +0200

    some cleanup, get blockchain stuff working

commit 5f4fabc0b8
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Fri Aug 27 15:17:15 2021 +0200

    Add internal documentation scaffolding

commit e2dd1cc9ae
Merge: c7e622f2 42f75028
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Aug 25 14:51:29 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    connect with mnemonic update

commit 42f75028bc
Author: Drazen Urch <durch@users.noreply.guthub.com>
Date:   Wed Aug 25 15:44:08 2021 +0200

    Resolve state deadlock

commit c7e622f284
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Aug 25 14:06:37 2021 +0100

    begin sign in rust integration

commit 248da351c6
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Aug 25 14:05:00 2021 +0100

    use color palette object

commit fe1c8a3b08
Merge: 84af9233 1bc17abb
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Aug 25 10:36:11 2021 +0100

    Merge branch 'tauri-wallet' into tauri-wallet-frontend
    merge rust api updates

commit 84af923389
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Wed Aug 25 10:35:42 2021 +0100

    update receive to use state value

commit 1bc17abbaa
Author: Drazen Urch <drazen@urch.eu>
Date:   Wed Aug 25 11:18:16 2021 +0200

    Add connect_with_mnemonic and get_balance tauri functions

commit b8c2735520
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 24 16:12:08 2021 +0100

    cargo lock update

commit 67fd4367ef
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 24 16:08:55 2021 +0100

    global theme update

commit 4540d2c447
Merge: ce757697 4ad25114
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 24 12:56:59 2021 +0100

    Merge branch 'feature/tauri-wallet-ui' into tauri-wallet
    merge with rust updates

commit 4ad25114c3
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 24 12:46:34 2021 +0100

    update nav cards

commit 3ce7888c07
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 24 11:59:10 2021 +0100

    address and balance cards

commit ce75769703
Author: Drazen Urch <drazen@urch.eu>
Date:   Tue Aug 24 12:54:49 2021 +0200

    Bootstrap nymd client with config

commit 66210658cb
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Tue Aug 24 10:35:54 2021 +0100

    add favicon

commit 728da763b3
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 22:54:30 2021 +0100

    fix padding issue

commit 3da08ee33c
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 22:49:39 2021 +0100

    style updates

commit 55977185fd
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 22:04:26 2021 +0100

    add unbond and undelegte pages

commit 1c8c0a47bc
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 21:34:14 2021 +0100

    receive page adjust margin

commit c161b2fe71
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 21:32:29 2021 +0100

    send wizard updates

commit eb91c1180d
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 17:23:25 2021 +0100

    update balance page

commit 13e357637b
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 17:18:07 2021 +0100

    style updates

commit 54c4bdb7d2
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 17:12:40 2021 +0100

    send wizard update

commit 9b5f50913f
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 14:56:52 2021 +0100

    add send wizard

commit 7cfa35b542
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 11:18:13 2021 +0100

    style updates

commit 581a6b0a6f
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 10:38:56 2021 +0100

    update nav bar

commit 85f23eb3d1
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 10:38:42 2021 +0100

    create delegation page

commit 17100fa7da
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Mon Aug 23 10:38:17 2021 +0100

    create node type selector component

commit 24af0c94bf
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Aug 20 22:26:14 2021 +0100

    add bond form

commit 8ec9e3121f
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Aug 20 17:35:59 2021 +0100

    side bar updates

commit 498dbb8ba3
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Aug 20 12:24:04 2021 +0100

    add balance page

commit 7345bd8148
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Aug 20 11:51:27 2021 +0100

    update navigation style

commit b405d2e4af
Author: fmtabbara <fmtabbara@hotmail.co.uk>
Date:   Fri Aug 20 09:03:21 2021 +0100

    set up tauri app with React frontend
2021-09-27 12:03:54 +02:00
Jędrzej Stuczyński 020cad897d Feature/rust rewarding (#750)
* Calculating gas fees

* Ability to set custom fees

* Added extra test

* Removed commented code

* Moved all msg types to common contract crate

* Temporarily disabling get_tx method

* Finishing up nymd client API

* Comment fix

* Remaining fee values

* Some cleanup

* Removed needless borrow

* Fixed imports in contract tests

* Moved error types around

* New ValidatorClient

* Experiment with new type of defaults

* Removed dead module

* Dealt with unwrap

* Migrated mixnode to use new validator client

* Migrated gateway to use new validator client

* Mixnode and gateway adjustments

* More exported defaults

* Clients using new validator client

* Fixed mixnode upgrade

* Moved default values to a new crate

* Changed behaviour of validator client features

* Migrated basic functions of validator api

* Updated config + fixed startup

* Fixed wasm client build

* Integration with the explorer api

* Removed tokio dev dependency

* Needless borrow

* Fixex wasm client build

* Fixed tauri client build

* Needless borrows

* New tables for rewarding

* Updated cosmos-sdk version

* Removed reward-specific node status routes

* New rewarding-specific config entries

* Additional network defaults

* Initial periodic rewards from validator api

* Replaced print with log

* Filtering nodes with uptime > 0

* Additional failure logging statements

* Fixed operation ordering

* Adjusted next rewarding epoch determination

* Modified rewarding behaviour to keep track of rewarding in progress

* Improved error message on config load failure

* Additional log statement

* Adjusted rewarding gas limit calculation

* Made naming slightly more consistent

* Fixed incorrect parentheses placement

* Fixed fee calculation

* Cargo fmt

* Removed failed merge artifacts

* Introduced comment for any future reward modification

* typos

* Helper functions for the future

* Making @mfahampshire 's life easier

* Redesigned epoch + rewarding skipped epochs (if possible)

* Removed old merge artifacts

* Naming consistency

* Constraining arguments

* Removed unnecessary if branch

* Ignore monitor check for current epoch

* Additional checks for current epoch data

* Monitor threshold check

* cargo fmt

* Fixed post-merge issues in transactions.rs
2021-09-24 15:49:21 +01:00
Drazen Urch 5dfaff6296 Update hmac and blake3 (#673)
* Update hmac and blake3

* Remain paranoid for `0.*` crates

* Most paranoid versions :)

* Updated aes and using published version of blake3

Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
2021-09-21 09:59:17 +01:00
Jędrzej Stuczyński 5b03982043 Replaced unwrap_or_else with unwrap_or_default (#780) 2021-09-20 10:40:03 +01:00
Drazen Urch 8f6856d6fb Make fee helpers public (#777)
Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>
2021-09-20 10:15:06 +01:00
Drazen Urch 976dd7aae2 Add block_height method to Delegation (#778)
Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>
2021-09-15 17:28:49 +02:00
Fouad 0d21f4e937 Merge pull request #776 from nymtech/update/re-enable-bonding
re-enable bonding
2021-09-15 12:41:29 +01:00
fmtabbara 1403449ad5 enable bonding 2021-09-14 16:00:21 +01:00
Drazen Urch e84af4f601 Migrate legacy delegation data (#771)
* Skip ReadOnlyBucket deserialization errors

* empty migration

* clippy

* cargo schema

* Drop invalid delegation data

* Dont drop old data

* Add todo

* Unify on type param

* gateways are different

* cargo fmt

Co-authored-by: Drazen Urch <durch@users.noreply.guthub.com>
2021-09-14 14:15:26 +01:00
Mark Sinclair 26b032c15c Merge pull request #774 from nymtech/feature/explorer-api-delegations
Explorer-api: add API resource to show the delegations for each mix node
2021-09-14 10:09:14 +01:00
Mark Sinclair cba3625394 explorer-api: add API resource to show the delegations for each mix node 2021-09-13 10:46:57 +01:00
Fouad e1ddaff04d Merge pull request #772 from nymtech/update/disable-bonding
add app alert
2021-09-10 17:17:14 +01:00
fmtabbara 66ab5de442 add app alert 2021-09-10 16:16:58 +01:00
Dave Hrycyszyn 0b9c03ca90 Adding deps for building the Tauri wallet under Ubuntu (#770) 2021-09-10 10:23:21 +02:00
Bogdan-Ștefan Neacşu c9dce0c1da Feature/consumable bandwidth (#766)
* Set actual value for bandwidth

Also put it as a public attribute, such that it can be actively used
by the credential consumer

* Switch from sending Attribute structs to sending the actual attribute bytes over the wire

* Add atomic bandwidth value to gateway

* Consume bandwidth based on the mix packet size

* Use Bandwidth struct for specific functionality

* Move bandwidth code outside the dependency path of wasm client

* Use u64 instead of AtomicU64, as the handling is not parallel
2021-09-09 11:21:45 +02:00
Bogdan-Ștefan Neacşu e00e77db15 Feature/bond blockstamp (#760)
* Add block_height to MixNode/GatewayBond

* Reward based on blockstamp of bonded node or of delegation

* Add specific tests

* Add migration code

* Apply doc nit
2021-09-08 15:07:24 +02:00
Fouad 1074449f91 Merge pull request #767 from nymtech/update/remove-app-alert
remove alert
2021-09-07 23:45:10 +01:00
Bogdan-Ștefan Neacşu 08276e6e42 Remove migration code (#759) 2021-09-07 16:33:30 +02:00
fmtabbara 9a3d824a4a remove alert 2021-09-06 20:39:24 +01:00
Bogdan-Ștefan Neacşu 2789ee8f18 Update coconut-rs and use hash_to_scalar from there (#765)
Failed tests are due to some nightly issue, not related to this PR
2021-09-03 15:30:45 +03:00
Fouad a7ba643c35 Merge pull request #762 from nymtech/feature/app-alert
add app alert banner
2021-09-03 09:14:50 +01:00
Bogdan-Ștefan Neacşu 28be53eefb Add block_height in the Delegation structure as well (#757) 2021-09-02 18:26:40 +03:00
Jędrzej Stuczyński 219c45a352 Updated cosmos-sdk (#761)
* Updated cosmos-sdk

* Re-exposing more things
2021-09-02 15:48:29 +01:00
dependabot[bot] 1a3b83752e Bump next from 11.1.0 to 11.1.1 in /wallet-web (#758)
Bumps [next](https://github.com/vercel/next.js) from 11.1.0 to 11.1.1.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v11.1.0...v11.1.1)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-02 15:45:56 +01:00
fmtabbara c42f3c6844 add app alert banner 2021-09-02 12:29:47 +01:00
Mark Sinclair a5d3ba3900 Merge pull request #755 from nymtech/bugfix/explorer-api-ping
Explorer API: port test now split out address resolution and add units tests
2021-08-31 15:59:11 +01:00
Mark Sinclair cdf0d44341 explorer-api: turned down logging from error to warn 2021-08-31 14:37:28 +01:00
Mark Sinclair 92f976a45d explorer-api: sanitize hostname before running checks to avoid leading or trailing spaces that are known to exist in the current test net 2021-08-31 14:32:32 +01:00
Mark Sinclair 2bc858cde3 explorer-api: port test: split out address resolution and add units tests 2021-08-31 14:32:32 +01:00
Bogdan-Ștefan Neacşu 92e13a5d00 Feature/add blockstamp (#756)
* Add RawDelegationData

* Fix current tests for the new stored data

* Added migration commit. Will be reverted after doing the migration

* New tests for block height

* Use current blockstamp instead of 24h old one

* Put _alot_ of migration stuff in the migrate function scope
2021-08-31 14:51:15 +03:00
Bogdan-Ștefan Neacşu 122f5d9f2e Feature/cred after handshake (#745)
* Call perform_initial_authentication instead of register in clients

* Refactor the register/authenticate functions a bit

* Introduce Bandwidth request type

* Add encryption layer to cred

* Remove cred pass and check from handshake

* Replaced unreachable!  with error

* Changed decrypt_tagged signature to not take mutable ownership of data

* Put handle_bandwidth work inside a function

* Add check before unwrap

* Remove unnecessary async

* Decouple bandwidth credential from authentication

* Use new_error for ServerResponse:Error

* Send a fresh IV each time the BandwidthCredential request is sent

* Remove unwrap of bincode::serialize

* Add comment regarding Bandwidth response

* Remove _mut from naming

* Leave Debug trait alone, as the initial error doesn't reproduce anymore

* Pass iv as Vec<u8> instead of base58 string

* Renamed AuthenticationIV to IV, as it is now used for more the just authentication

* Did some IV refactorization
2021-08-30 10:27:20 +03:00
Bogdan-Ștefan Neacşu 982ee0266c Feature/get own delegations (#748)
* Introduce reverse delegation bucket

* Add client command

* Fix clippy error

* Added tests in queries

* Add tests in transactions

* Migration code. Will be reverted after it's called on testnet

* Replace unwrap with expect

* Move some test code in the right file...

... to remove unnecessary auxiliary function.

* Reduce the scope to migration auxiliary functions

* Rename everything from [node]reverse to reverse[node]

* Fix fmt
2021-08-27 16:02:34 +03:00
Jędrzej Stuczyński 5f42a9bd05 NetworkMonitorBuilder - starting the monitor after rocket has launched (#754)
* NetworkMonitorBuilder - starting the monitor after rocket has launched

* Removed unused import
2021-08-27 13:52:18 +01:00
Jędrzej Stuczyński 1811df9ddb Enabled validators api argument (#753) 2021-08-27 13:52:10 +01:00
Jędrzej Stuczyński 6bdfe7f895 Correctly bounding nominator of uptime calculation (#752) 2021-08-26 11:21:01 +01:00
Jędrzej Stuczyński c6b286a1db Fixed argument parsing for ipv6 'good' topology (#751) 2021-08-25 14:50:57 +01:00
Bogdan-Ștefan Neacşu b3568a26f5 Revert "Migration commit, will be reverted after the testnet contract is updated" (#749)
This reverts commit 38d868bcce.
2021-08-24 11:25:05 +03:00
Jędrzej Stuczyński 15ae0f521e Feature/more reliable uptime calculation (#747)
* New database table holding monitor run info

* SQL interface for new table

* Updated uptime calculation to instead rely on number of monitor test runs
2021-08-23 11:26:51 +02:00
Bogdan-Ștefan Neacşu 2923d4b872 Update template toml key (#746) 2021-08-19 21:03:07 +02:00
Bogdan-Ștefan Neacşu d740e8b8a9 Reinstate the POST method blind_sign (#744) 2021-08-18 18:31:12 +03:00
Jędrzej Stuczyński a274edffba Feature/nymd client integration (#736)
* Calculating gas fees

* Ability to set custom fees

* Added extra test

* Removed commented code

* Moved all msg types to common contract crate

* Temporarily disabling get_tx method

* Finishing up nymd client API

* Comment fix

* Remaining fee values

* Some cleanup

* Removed needless borrow

* Fixed imports in contract tests

* Moved error types around

* New ValidatorClient

* Experiment with new type of defaults

* Removed dead module

* Dealt with unwrap

* Migrated mixnode to use new validator client

* Migrated gateway to use new validator client

* Mixnode and gateway adjustments

* More exported defaults

* Clients using new validator client

* Fixed mixnode upgrade

* Moved default values to a new crate

* Changed behaviour of validator client features

* Migrated basic functions of validator api

* Updated config + fixed startup

* Fixed wasm client build

* Integration with the explorer api

* Removed tokio dev dependency

* Needless borrow

* Fixex wasm client build

* Fixed tauri client build

* Needless borrows

* Fixed client upgrade print

* Removed redundant comments

* Made note on aggregated verification key into a doc comment

* Removed mixnet contract references from verloc

* Modified default validators structure

* Reformatted validator-api Cargo.toml file

* Removed commented code

* Made the doc comment example a no-run

* Fixed a upgrade print... again

* Adjusted the doc example

* Removed unused import
2021-08-18 14:41:00 +01:00
Bogdan-Ștefan Neacşu eec211e038 Feature/use delegation rates (#741)
* Rename storage read functions for bond reward rates

* Add reward values per epoch in State

Calculate delegation rewards per epoch for mixnodes and gateways, which
are used when the delegators are rewarded for their stake.

* Migration commit, will be reverted after the testnet contract is updated
2021-08-18 16:24:00 +03:00
Mark Sinclair f5f888a0aa Merge pull request #742 from nymtech/feature/explorer-api-pending-ping
explorer-api: add pending field to port check response
2021-08-17 12:59:47 +01:00
Fouad 86ec1d6026 Feature/copy to clipboard (#740)
* add copy to clipboard component

* use fab button

* use regular button

* remove unneeded config
2021-08-16 17:45:41 +01:00
Mark Sinclair bc3f5838f1 explorer-api: add pending field to port check response 2021-08-16 17:29:51 +01:00
Bogdan-Ștefan Neacşu 7e58b3273d Feature/update wallet with stake rates (#739)
* Replace `BondMixnode` with `Bond` on frontend

* Update wallet to use stake reward rates
2021-08-16 12:24:17 +03:00
Bogdan-Ștefan Neacşu bed09bf8a4 Add stake reward rates and bump version of client (#738)
* Tiny PR to add stake reward rates and bump version

This is needed so that we can publish the 0.17 version.

* Add the changes to contracts as well

On second thought, update the contract together with the client, and
leave the wallet changes for another PR.

* Rename _stake_ to _delegation_
2021-08-16 11:43:24 +03:00
Drazen Urch 28e55c6de6 Hang coconut issuance off the validator-api (#679)
* Hand coconut issuance off the validator-api

* git to cargo

* Move to own module

* Integrate tauri-client, extract common interface

* cargo fmt

* Ergonomics

* Facelift

* Wrap up tauri client

* Set up publish

* Fix fmt

* Install CI dependencies

* Inline deps

* Remove mac deps

* Add dist dir

* Fix beta clippy nag

* Commit some gateway work

* Thread coconut creds through gateway handshake

* Push in progress patch

* Move State from tauri client to coconut interface

* Move get_aggregated_signature from tauri client to coconut interface

* Move prove_credential from tauri client to coconut interface

* Update sphinx version

* Mount coconut routes and manage config file in rocket

* Split default validator endpoint into host and port

* Add init for simple credential initialization

* Fix common gateway client

* Add coconut cred to webassembly client

* Add coconut cred to socks5 client

* Add coconut cred to native client

* Remove direct coconut-rs dependency

* Use only coconut interface in validator api

* Leave validator-api out of workspace and update Cargo.lock

* Fix clippy warnings and update Cargo.lock after rebase

* Switch from attohttpc to reqwest for async gets

This is not only needed for using async requests, but also because attohttpc
causes OpenSSL issues when cross compiling the webassembly client.

* Replace attohttpc with reqwest for puts too

* Make tauri client commands async

* Fix borrow error

* Guard gateway server code from compiling for wasm (client)

* Fix clippy wasm client

* Fix tests

* Fix clippy in tauri client

* Remove commented code

* Update comment of init message

* Remove unnecessary hex dependency

* Replace config argument with key_pair

* Use `trim()` for whitespace removal

* Move verification key query higher up the function calls

* Put KeyPair instead of Config into rocket's managed items

* Re-enable tauri client verify button

* Move verification key up the function calls for prove_credential

* Use consts for verification_key and blind_sign routes of validator-api

* Replace `match` with `map_err`

* Fix typo

* Remove now unnecessary `Clone` derives

... as config is no longer managed by rocket

* Replace `match` with `map_err`

* Make `InternalSignRequest` really internal to validator-api

* Make `with_keypair` live up to its name

* Update Cargo.lock after rebase

* Replace String error with HandshakeError

* Add CoconutInterfaceError to coconut-interface

* Format the new error in tauri client

* Remove  from default, as wasm client doesn't build

* Put public key as init argument...

... for the public attributes of the credential

* Use the hash_to_scalar function to make public key into attribute

Use the function from cli-demo-rs from https://github.com/nymtech/coconut
to make the identity public key into a public attribute.

* Replace vector with array for InitMessage

As we know beforehand the size of the keys, we can use fixed size array
instead of vectors. This eliminates the need for a prefixed length in
the serialized form of the InitMessage structure and enables a easy
deserialization of the remote identity before the actual bincode
deserialization that we do in the handshake process.

Before this, the `extract_remote_identity_from_register_init` function
attempted to deserialize into a public key the length-prefixed public key
received from the client, thus failing sporadically with a `Cannot decompress
Edwards point` error.

* Pass public and private attributes to state `init` instead of PublicKey

* Make tauri call with dummy attributes

* Make clients call with their keypairs

* Revert "Make clients call with their keypairs"

This reverts commit b348f47f7a.

* Put dummy, bandwidth private attribute

Co-authored-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-08-13 14:27:40 +03:00
Bogdan-Ștefan Neacşu abb4537551 Switch from wasm-timer to fluvio-wasm-timer... (#735)
... which addresses the problem from https://github.com/Amanieu/parking_lot/issues/269
by taking the unmerged workaround of https://github.com/tomaka/wasm-timer/pull/13 ,
as wasm-timer appears to be unmaintained.
2021-08-13 09:44:29 +01:00
dependabot[bot] b48f2f1660 Bump next from 10.1.3 to 11.1.0 in /wallet-web (#737)
Bumps [next](https://github.com/vercel/next.js) from 10.1.3 to 11.1.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v10.1.3...v11.1.0)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-13 09:35:16 +01:00
Mark Sinclair ccf8063a52 Explorer API: add new HTTP resource to decorate mix nodes with geoip locations (#734)
* explorer-api: decorate mix nodes with locations from the geoip service and keep mix node cache in a hash map instead of a vec

* explorer-api: add `lat` and `lng` for map views

* explorer-api: remove function and simplify code

* explorer-api: review feedback

* network-explorer: format
2021-08-11 17:24:34 +01:00
Jędrzej Stuczyński 8694396942 Feature/completing nymd client api (#732)
* Calculating gas fees

* Ability to set custom fees

* Added extra test

* Removed commented code

* Moved all msg types to common contract crate

* Temporarily disabling get_tx method

* Finishing up nymd client API

* Comment fix

* Remaining fee values

* Some cleanup

* Removed needless borrow

* Fixed imports in contract tests

* Made contract address optional to allow for contract upload and initialisation
2021-08-11 17:15:14 +01:00
Jędrzej Stuczyński fb253e53a4 Removed all sphinx key caching from mixnodes and gateways (#713)
* Removed all sphinx key caching from mixnodes and gateways

* Missing change in network monitor
2021-08-11 12:47:35 +01:00
Jędrzej Stuczyński fdd34863ba Feature/nymd client fee handling (#730)
* Calculating gas fees

* Ability to set custom fees

* Added extra test

* Removed commented code

* Removed needless borrow
2021-08-11 12:01:53 +01:00
Mark Sinclair 4ac95ad8cf Explorer API - add port check and node description/stats proxy (#731)
* explorer-api: move mix node client operations into a package

* explorer-api: add port test for mixnodes with cache for results

* explorer-api: add `humantime-serde` dependency

* explorer-api: mix node API proxy

This fixes mixed-content responses when using the mix node API from the network explorer. An in-memory cache protects the explorer API from over-querying the http API on the mix node.

* explorer-api: adjust naming

* explorer-api: fix up self refs

* explorer-api: add method to state to get a mix node by identity key

* explorer-api: add cached http resource to proxy the `/description` and `/stats` http api resources to allow the network explorer do https requests for the mix node api resource avoid mixed content requests

* explorer-api: set default mix node cache time to 30 minutes

* explorer-api: make clippy happy

* explorer-api: add CORS with wide open configuration

* explorer-api: fixes from review feedback

* explorer-api: move port check test into separate function

* explorer-api: use `rocket-cors` that is pinned in the `validator-api` and remove custom CORS handler
2021-08-10 15:27:17 +01:00
Fouad 132d550cb6 Merge pull request #721 from nymtech/update/bond-form-state-management
update state management and validation
2021-08-09 11:00:29 +01:00
fmtabbara efc5035144 Merge branch 'develop' into update/bond-form-state-management
Merge develop branch
2021-08-09 09:51:25 +01:00
Jędrzej Stuczyński ebeac73f30 Rust nymd/cosmwasm client (#724)
* Using forked cosmwasm

* Basic wallet functionalities

* WIP

* Generic abci_query method

* More API stubs with some semi-working code

* More API stub work

* Moving from fork of cosmos-rust to the upstream

* Implemented most sign-less cosmwasm client methods

* Full contract upload with log parsing

* Implemented most of remaining methods on signing client

* Some initial cleanup on existing code

* Feature-locking nymd client

* Better type for base account

* Pagination handling

* Searching transaction by concrete hash

* basic search_tx

* More cleanup

* Disabled default validator-client features on wasm client

* Fixed account conversion

* Fixed typo in cargo.toml

* Moving back to main cosmos-sdk repo

* Re-exported connect functions

* comment

* Wallet no longer storing signing keys

* Went back to the trait approach

* Example stub of future API

* Removed needless borrow

* Fixed starting page

* Fixed typo

* Using centralised config defaults
2021-08-06 16:31:57 +01:00
fmtabbara 5303288b9c remove unecessary type check 2021-08-06 14:51:20 +01:00
fmtabbara bcac045c77 remove husky 2021-08-06 11:57:34 +01:00
Jędrzej Stuczyński d643df74b3 Removed wasm feature bypassing cycling dependencies (#723) 2021-08-06 11:00:15 +01:00
Jess 4c1c6d86c8 Update DelegationCheck.tsx (#725)
* Update DelegationCheck.tsx

* Update NodeDelegation.tsx
2021-08-06 09:38:47 +01:00
fmtabbara 623448a220 remove husky 2021-08-05 15:16:04 +01:00
fmtabbara b403ce1e62 add test 2021-08-05 14:25:52 +01:00
fmtabbara 6faf8786ea add husky 2021-08-05 14:23:19 +01:00
Jędrzej Stuczyński aaa4378b33 Updated used sphinx dependency to the most recent revision (#722) 2021-08-05 12:01:37 +01:00
fmtabbara 6512bfb4d9 Merge branch 'develop' into update/bond-form-state-management
Merge develop branch
2021-08-05 09:14:40 +01:00
fmtabbara 1afabfd1b6 update tests :) 2021-08-04 18:43:17 +01:00
fmtabbara f05e2880a9 update config files 2021-08-04 16:52:25 +01:00
fmtabbara 81675008a6 update hostname and ip validation 2021-08-04 16:52:06 +01:00
fmtabbara 8b4fc5719e add tests 2021-08-04 15:51:20 +01:00
fmtabbara e4f7452241 install test packages 2021-08-04 15:51:10 +01:00
fmtabbara 9602379368 update rawport validation function 2021-08-04 15:47:39 +01:00
fmtabbara 35ba39c196 update rawport validation function 2021-08-04 15:44:29 +01:00
fmtabbara 6d09da40e0 remove unused generic 2021-08-04 15:19:12 +01:00
fmtabbara de44f21d64 add code source 2021-08-04 14:21:48 +01:00
fmtabbara edc91e0e36 use regex for validating hostname 2021-08-04 14:19:59 +01:00
fmtabbara 518cd21fd6 type function parameter 2021-08-04 12:42:25 +01:00
Dave Hrycyszyn b36ca2c4f1 Add Network Explorer API (#720)
* Adding the explorer API

* Added explorer-api to workspace

* Re-jigged explorer api cargo paths

* Fixed compiler warnings

* Removing unused code

* network-explorer-api: configure state with env var API_STATE_FILE or fall back to default value of `explorer-api-state.json`

* network-explorer-api: updates to `Cargo.lock` file after rebasing

* network-explorer-api: make clippy happy
2021-08-04 12:38:35 +01:00
Jędrzej Stuczyński 2db79de722 Feature/superbuild (#719)
* Adding build script

* Added build dependencies

* Cleaned up build.rs

* Restored validator-api to default workspace

* Removed split for validator-api build in github ations

* Don't build validator API on Windows

* Remove validator-api Cargo.lock

* Remove fmt from the conditional steps

Co-authored-by: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
Co-authored-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-08-04 11:55:58 +03:00
fmtabbara 3a9531b586 remove console log 2021-08-04 09:26:22 +01:00
fmtabbara f96d768341 update state management and validation 2021-08-03 18:08:54 +01:00
Fouad 26fb13fe2d remove console log (#718) 2021-08-02 17:42:21 +01:00
Fouad 67a9d80299 Merge pull request #715 from nymtech/bug/form-validation
Bug/form validation
2021-08-02 16:29:11 +01:00
fmtabbara 84249cab4b update validation 2021-08-02 15:46:12 +01:00
Jędrzej Stuczyński f4305dfaa5 Warnings with identities of good nodes failing checks (#714)
* Warnings with identities of good nodes failing checks

* Fixed logging messages
2021-08-02 14:08:23 +01:00
fmtabbara 0c45c61c85 format to jsx double quotes 2021-08-02 13:49:46 +01:00
fmtabbara 7d250b3384 merge develop branch 2021-08-02 13:46:04 +01:00
fmtabbara bb2029e21c remove console log 2021-08-02 13:44:22 +01:00
fmtabbara 0f0611f390 form updates and bug fix 2021-08-02 13:42:20 +01:00
Fouad 2904141c14 Merge pull request #704 from nymtech/feature/receive-coins-page
Feature/receive coins page + UI tweaks
2021-08-02 13:32:08 +01:00
fmtabbara c569a7a858 ui tweak 2021-07-28 18:01:40 +01:00
fmtabbara 87db1fd8c1 update breakpoint for large screens 2021-07-28 17:45:45 +01:00
fmtabbara a1d2d09f28 fix conflicts 2021-07-28 16:15:40 +01:00
Fouad b949d7b221 Merge pull request #703 from nymtech/feature/user-sign-out
Allow users to sign out
2021-07-28 15:58:43 +01:00
fmtabbara de468760d6 update layout 2021-07-28 14:17:13 +01:00
fmtabbara 30a78df986 fix build error 2021-07-28 13:52:24 +01:00
fmtabbara e8622a190a layout and icon updates 2021-07-28 10:53:37 +01:00
fmtabbara 75f098f002 style update 2021-07-27 20:07:23 +01:00
fmtabbara b034a07439 display alert when no client detected 2021-07-27 17:50:42 +01:00
fmtabbara 68956456dd style updates 2021-07-27 17:24:23 +01:00
fmtabbara aa048cabe6 update pages to use new components 2021-07-27 16:44:11 +01:00
fmtabbara 5dc67b995e export new reusable components 2021-07-27 16:41:35 +01:00
fmtabbara 721e4bda8b create reuseable components 2021-07-27 16:40:15 +01:00
fmtabbara 2673f83116 fix bug 2021-07-27 15:08:37 +01:00
fmtabbara bc68513a78 allow user to log out 2021-07-27 14:23:17 +01:00
Bogdan-Ștefan Neacşu 91250f199a Feature/docker improvements (#702)
* DRY the docker prefix and wasmd variables

* Don't re-init nymd for the same container

* Specify env variables in x property

* Contract uploader now uses BECH32_PREFIX env var
2021-07-26 19:06:01 +03:00
Fouad 3ec92a0784 Merge pull request #698 from nymtech/bond_and_delegation_alerts
Bond and delegation alerts
2021-07-26 13:48:35 +01:00
Jędrzej Stuczyński 70a9317ab3 Exposed API port on the validator (#701) 2021-07-26 15:30:54 +03:00
Dave Hrycyszyn 71e36065e5 Using validator API instead of nymd (#690) 2021-07-26 10:59:29 +01:00
Jędrzej Stuczyński 389d1ba3b9 Cleaned up dependencies of our typescript client (#699)
* Cleaned up dependencies of our typescript client

* Explicitly added stargate dependency and not rely on it being in node_modules
2021-07-26 10:58:58 +01:00
Bogdan-Ștefan Neacşu 18f5d4084d Feature/default values (#700)
* Put endpoints and contract address in one place

* Put common ports in one place

* Split cache version from route

* Share validator-api port value between server and client

* Put BECH32 prefix in defaults

* Put DENOM in defaults

* Put network monitor address in defaults

* Fix clippy

* Fix another clippy + tests import of DENOM
2021-07-26 10:55:59 +01:00
fmtabbara 83744962f1 remove possible whitespace 2021-07-23 14:44:20 +01:00
fmtabbara df08a894cc only display alert when stakeValue is loaded 2021-07-23 14:34:17 +01:00
Bogdan-Ștefan Neacşu 2354828481 Feature/other containers (#692)
* Add block explorer to docker containers

* Add network explorer to docker containers

A private token is needed to build this container.

* Update docker README
2021-07-23 16:24:55 +03:00
fmtabbara 74693bda6f update allocation check 2021-07-23 14:14:27 +01:00
fmtabbara 613ff5da71 remove unused import 2021-07-23 12:18:45 +01:00
fmtabbara a11937699f Merge branch 'develop' into bond_and_delegation_alerts
Merge develop
2021-07-23 09:47:17 +01:00
fmtabbara eb59ca77ef catch error caused by invalid values 2021-07-23 09:11:11 +01:00
fmtabbara 12d07fd870 use helper function + code tidy 2021-07-22 22:11:59 +01:00
Jędrzej Stuczyński 1d18def642 Run cargo fmt 2021-07-22 15:34:34 +01:00
fmtabbara 70d4bce42f prettier updates 2021-07-22 15:17:37 +01:00
Jędrzej Stuczyński c81454e00b Validator API storage fixes and adjustments 2021-07-22 15:15:08 +01:00
fmtabbara ac4ee2bcf2 allocation check on delegation form 2021-07-22 15:00:24 +01:00
fmtabbara 9184c119d6 set balance warning 2021-07-22 14:23:02 +01:00
fmtabbara 216b114346 make reuseable hook to get balance 2021-07-22 13:29:14 +01:00
Fouad 793dbdef7e update types 2021-07-22 12:00:46 +01:00
Jędrzej Stuczyński 432e1e6065 Merge branch 'develop' of github.com:nymtech/nym into develop 2021-07-22 10:44:11 +01:00
Fouad c8a02e1354 update punk denomination 2021-07-22 10:40:02 +01:00
Jędrzej Stuczyński 698345dbe9 Bugfix/network monitor version check (#697)
* Fixed validator-api network version check

* Removed redundant clone
2021-07-22 10:32:08 +01:00
Jędrzej Stuczyński 5568073c17 Fixed validator-api network version check 2021-07-22 10:05:38 +01:00
Jędrzej Stuczyński addb721d66 Fixed gateway upgrade command argument description 2021-07-21 14:29:47 +01:00
Jędrzej Stuczyński 3bbf959086 Removed port information from bonding notice 2021-07-21 14:24:54 +01:00
Jędrzej Stuczyński 0db4aa5f39 Merge branch 'v0.11.0-release' into release/v0.11.0 2021-07-21 14:22:39 +01:00
Jędrzej Stuczyński f41ee7700d Merge branch 'release/v0.11.0' of github.com:nymtech/nym into release/v0.11.0 2021-07-21 14:18:35 +01:00
Jędrzej Stuczyński 1c335d3172 Merged upgrade commands 2021-07-21 14:16:36 +01:00
Bogdan-Ștefan Neacşu 191b3c09e2 V0.11.0 release (#696)
* Update the version to 0.11.0 for non-upgradable crates

* Fix target version for the current upgrade functions

* Upgrade native client

* Upgrade socks5 client

* Upgrade mixnode

* Upgrade gateway
2021-07-21 14:10:27 +01:00
Jędrzej Stuczyński 725b4de74a Updated changelog 2021-07-21 13:16:01 +01:00
Bogdan-Ștefan Neacșu ce038bf56a Upgrade gateway 2021-07-21 15:13:21 +03:00
Bogdan-Ștefan Neacșu 8727038443 Upgrade mixnode 2021-07-21 15:12:53 +03:00
Bogdan-Ștefan Neacșu afbed0e438 Upgrade socks5 client 2021-07-21 15:12:22 +03:00
Bogdan-Ștefan Neacșu b6a026da83 Upgrade native client 2021-07-21 15:11:45 +03:00
Bogdan-Ștefan Neacșu fc74b723fa Fix target version for the current upgrade functions 2021-07-21 15:11:08 +03:00
Bogdan-Ștefan Neacșu b1fe1f6073 Update the version to 0.11.0 for non-upgradable crates 2021-07-21 15:11:07 +03:00
Jędrzej Stuczyński 043ca9a63e Updated versions to 0.11.0 2021-07-21 13:07:15 +01:00
Jędrzej Stuczyński 46b49eea2f Updated bot channel name 2021-07-21 12:52:39 +01:00
Jędrzej Stuczyński 7430eb99cf Fixed upgraded description save location 2021-07-21 12:43:12 +01:00
Dave Hrycyszyn 111cccea97 Merge branch 'release/v0.11.0' of github.com:nymtech/nym into release/v0.11.0 2021-07-21 11:41:24 +01:00
Dave Hrycyszyn 5e9d87b1ad Updating wallet version prior to release 2021-07-21 11:40:37 +01:00
Jędrzej Stuczyński c28b320b66 Merge branch 'release/v0.11.0' of github.com:nymtech/nym into release/v0.11.0 2021-07-21 11:22:54 +01:00
Jędrzej Stuczyński a80a1bbe34 Only allow bonding nodes with version >= 0.11.0 2021-07-21 11:22:48 +01:00
Bogdan-Ștefan Neacșu c1808ae692 Update to RC 0.11.0-rc1 2021-07-21 13:19:50 +03:00
Jędrzej Stuczyński d8277e851f Updated sign command (#694) 2021-07-21 08:42:02 +01:00
Mx c795490164 got rid of denomination error (#691)
Co-authored-by: mfahampshire <>
2021-07-20 17:31:48 +01:00
Bogdan-Ștefan Neacşu 3f2fa717c9 Return the vec instead of the cache wrapper for topology (#695) 2021-07-20 17:30:58 +01:00
Bogdan-Ștefan Neacşu c0be2330b0 Docker testing env (#687)
* Add validator Docker container

* Add Docker contract upload container

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* Add docker-compose for validators and building deploy container

* One Docker image for each component

* Switch from hal to punk

* Add nym wallet docker

* Point web browser to the correct IP

* Better message parsing

* Rebase on the wallet merge

* Rename upload contract entrypoint script

* Remove unnecessary bash magic

* Put the contract image in the docker dir

* Put the wallet-web image in the docker dir

* Add some read-only specifiers to volumes

* Move typescript container code in docker directory

Also update lock files, as the containers work on a volume binded
to the local filesystem

* Fix volume permissions

* Add mnemonic echo

* Remove magic sleep value from secondary validator

* Adding README.md to the docker directory

* Change ENTRYPOINT to CMD for the typescript client image
2021-07-20 10:16:57 +01:00
Jędrzej Stuczyński e86467d007 Changed validator-api version to 0.10.2 2021-07-19 14:36:25 +01:00
Jędrzej Stuczyński e5afd54ce0 Feature/node status api (#680)
* Basic storage stub

* New models for new node status api

* Route handling

* Mounting new routes

* Missing selective commit

* Moved network monitor related files to separate package

* Starting to see some sqlx action

* Schema updates

* Log statement upon finished migration

* Removed old diesel related imports

* Converted mixnode cache initialisation into a fairing

* Moved cache related functionalities to separate package

Also defined staging there

* Created run method for validator cache + removed unwrap

* Removed old node-status-api types and left bunch of todo placeholders in their place

* Fixed managing validatorcache

* Status reports are starting to get constructed

* Submitting some dummy results to the database

* Removing duplicate code for generating reports

* Removed statuses older than 48h

* Initial attempt at trying to obtain reports for all active nodes

* Removed duplicates from the full report

* Grabbing uptime history

* Updating historical uptimes of active nodes

* Updated sqlx-data.json

* Removed all placeholder foomp owner values

* Changed Layer serde behaviour for easier usage

* Extended validator api config

* Initial (seems working !) integration with network monitor

* Added database path configuration to config

* Using ValidatorCache in NetworkMonitor

* Flag indicating whether validator cache has been initialised

* Introduced a locla-only route for reward script to perform daily chores

* Flag to save config to a file

* Moved spawning of receiving future to run method rather than new

* Removed arguments that dont make sense to be configured via CLI

* Removed dead code from config file

* More dead code removal

* Added validator API to CI

* Corrected manifest-path arguments

* Constructing network monitor by passing config

* Combined validator API CI with the main CI file

* Using query_as for NodeStatus

* Checking if historical uptimes were already calculated on particular day

* Making id field NOT NULL

* More query_as! action

* Updated sqlx-data.json

* Removed unused chrono feature

* Renamed the migration file

* Changed default validator endpoint to point to local validator

* Removing unnecessary clone

* More appropriate naming

* Removed dead code

* Lock file updates

* Updated network monitor address in contract code

* Don't stage node status api if network monitor is disabled

* cargo fmt

* Updated all license notices to SPDX
2021-07-19 14:02:47 +01:00
Jędrzej Stuczyński 25d2af3b04 Changed Layer serde behaviour for easier usage (#686) 2021-07-16 16:23:41 +01:00
Dave Hrycyszyn 8e24583f2a Updating wallet URL in mixnode startup output (#682) 2021-07-16 10:57:26 +01:00
Bogdan-Ștefan Neacşu c09846bb36 Merge the nym-wallet-web repo into a nym directory (#684)
A snapshot of https://github.com/nymtech/nym-wallet-web/tree/60b36db17d994e597b91981be5d60b0488618019
is put into a wallet-web folder.
2021-07-16 10:46:02 +01:00
Dave Hrycyszyn 86034bd955 Temporarily using non-cached gateways so we can get our next version deployed (#683) 2021-07-16 10:08:27 +01:00
Dave Hrycyszyn a9797879e8 Correcting the contract address 2021-07-15 16:16:20 +01:00
Dave Hrycyszyn 407d2bba47 Updating all default config values. 2021-07-14 16:56:51 +01:00
Dave Hrycyszyn 8f4b5ab4c7 Updating default settings to get the next testnet up 2021-07-14 16:46:13 +01:00
Jędrzej Stuczyński 0fd203371d Using specific commit of rocket cors (#678) 2021-07-13 16:14:11 +01:00
Dave Hrycyszyn 68f2d8b925 Version bump 2021-07-09 11:52:59 +01:00
Bogdan-Ștefan Neacşu 973c30592f Use cached topology for clients (#674)
* Add validator-api common client

* Call validator-api from different clients for gateway topology

* Call validator-api from different clients for mixnode topology

* Use consts for the validator-api queries

* Rename the new query_validator function to query_validator_api

* Add mut to mixnode validator client

* Add refreshValidatorAPIGateways as a way to get the gateways...

... from validator-api

* Add refreshValidatorAPIGateways as a way to get the mixnodes...

... from validator-api

* Add yet another mut

* Change the port to validator-api service when querying the topology

* Add parsing check on the config phase...

... to make sure the validator URLs are in the correct format.

* Fix another clippy error

* Use all provided validators instead of just the first one

* The mutable reference was not actually needed, so remove it

* Use global variable for validator-api port

* Use url crate for checking the format and changing the port

* Use URL for parsing and move constants of validator-api to index.ts...

... until we find a way to link to the values from the validator-api
crate.

* Change global variables naming and have the API version into each API query

* Revert the changes to the index on connect...

... as they were working correctly before.

* Use all provided validators for mixnodes as well

* Remove location and layer
2021-07-09 11:50:41 +01:00
Drazen Urch 3886ec5291 Minimize read/write cache contention (#676)
* Add timeout to cache.write() call

* mixnode_cache -> validator_cache

* Fix rename

* Minimize read/write contention
2021-07-08 10:42:53 +01:00
Dave Hrycyszyn 929775c517 Bumping version number for release 2021-07-06 16:10:38 +01:00
Dave Hrycyszyn 427893efef Feature/validator client upgrade (#675)
* Upgrading cosmos client to v0.25.5

* Formatting

* Renamed stakeDenom to prefix

* Added a denom field to the client

* New version needs a denom in the static methods

* ibid

* Formatting

* Renaming bech32prefix to prefix

* Adding a weird 'u' in the nymGasPrice

* Changing to use denom instead of prefix in nymGasPrice

* Alphabetizing fields

* Renaming method to something a bit more sane

* Using prefix, not denom, to build gas price

* Hardcoding an unavoidable and ugly manual conversion into the stargate helper

* denom is correct, for use in getBalance
2021-07-06 13:50:26 +02:00
Jędrzej Stuczyński cb33871934 Disables nightly clippy CI (#677) 2021-07-06 13:48:56 +02:00
Drazen Urch 4a86b24ff5 Use rocket 0.5-rc1, remove rocket-contrib (#672)
* Use rocket 0.5-rc1, remove rocket-contrib

* Revert thread_rng

* Continue on error for beta as well

* Add Drazen to authors

* Remain paranoid for unstable crates

* fmt again :/

* Most paranoid versions
2021-07-05 18:07:18 +02:00
Jędrzej Stuczyński 8f98de4abc Feature/validator api config (#671)
* Modified NymConfig trait to make id optional

* Basic validator-api config definition

* Optionally using the config during startup + flag to enable monitoring
2021-07-05 13:48:55 +02:00
Jędrzej Stuczyński e6460208d3 Removed standalone network-monitor (#669)
It has been integrated into the validator-api
2021-07-02 11:31:29 +01:00
Drazen Urch 3b7315d1e2 Fix a dependabot nag (#670) 2021-07-02 11:53:04 +02:00
Drazen Urch 3aafe54887 Remove mut where possible, parallel cache requests (#668) 2021-07-02 10:50:49 +02:00
Drazen Urch f08f19cd86 Rework validator client requests (#667)
* Rework validator-client to avoid &mut

* Comment

* More logging, sleep

* Fix wasm build

* My clippy missed this
2021-07-01 20:05:29 +02:00
Drazen Urch 2e6a32b298 Generalize cache, and cache gateways (#666)
* Generalize cache, and cache gateways

* Allow dead code
2021-07-01 17:24:23 +02:00
Bogdan-Ștefan Neacşu 57df77a995 Layer selection (#664)
* mixnode: Remove layer computation from mixnode

The layer is currently computed locally. This should be moved to
the validator, and the mixnode should find this information via
a query. Until the query is actually processed, we keep the layer
field as None.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* contracts: Compute layer of bonding mixnode

Predictably compute the best layer of a bonding mixnode by putting it on
the layer with the fewest mixnodes and, in case of equality, with the
smallest index e.g. layer 1 is better then layer 3 if both have
the fewest mixnodes.

The layer received from the client app is regarded as a preferred option
and is only accepted if the number of nodes on the preferred layer is not
bigger then the one on the best layer.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* contracts: Add tests for layer selection

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* mixnode: Upgrade from 0.10.2 to 0.10.3

The config file is changed so that it's only containing the layer if
the layer exists.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* contracts: Move the layer from MixNode to MixNodeBond

Remove the option of a client app to propose a preferred
layer.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* contracts: Move from u64 to Layer representation

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* contracts: Remove Layer::Invalid as it no longer makes sense...

... because layer choice is now present only in the contract.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* contracts: Move layer selection algorithm in `choose_with_fewest` method

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* mixnode: Remove layer altogether

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* mixnode: Refactor upgrading system

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* mixnode: Remove layer from template as well

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>

* Remove invalid field from LayerDistribution

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-07-01 17:56:57 +03:00
Drazen Urch 343c55f981 Validator API server (#665)
* Rocket main stub

* Add anyhow

* Stub cache reads and writes

* Finalize stubs

* Add generic Rocket.toml

* Put back targets

* Have cache own its validator client

* allow dead code

* Update rocket.toml for 0.5
2021-07-01 14:08:04 +02:00
Dave Hrycyszyn 1660e0796d Removing validator binaries, these should go into Github releases (#663) 2021-06-30 10:16:43 +01:00
Drazen Urch b30f11ed7a Rename network-monitor (#662) 2021-06-29 14:48:15 +02:00
Jędrzej Stuczyński 2bdee705b7 Feature/total delegation field (#660)
* Changed bond Vec<Coin> into a Coin

* Introduced total_delegation field to bond models

* Restoring total old delegation

* Updating total delegation on new delegations

* Updating total delegation on removal

* Keeping track of delegation increase during rewarding

* Updating total delegation during rewarding + additional response attributes

* Removed irrelevant tests

* Fixed storage-related tests

* Added additional test assertions for delegation increase

* Added additional node rewarding test assertions

* Tests for correct reward calculation + gateway rewarding early termination

* Added delegation field to parsed node type

* Updated typescript bond types

* Moved `OLD_DELEGATIONS_CHUNK_SIZE` to file-wide namespace so that it could be used in tests

* Tests for finding old node delegations

* ibid.

* Issue#657

* Additional test assertions regardingn total delegation

* Missed test field after merge

* ibid

* Cleaning up storage related imports
2021-06-29 11:29:51 +01:00
Drazen Urch 31f567f1ef Use thiserror for validator-client (#658)
* Use thiserror for validator-client

* cargo fmt

* Move comment

* CI
2021-06-29 10:01:44 +02:00
Jędrzej Stuczyński 216573b65b Adds @neacsu as code owner (#661) 2021-06-29 10:01:25 +02:00
Bogdan-Ștefan Neacşu 4102690cf1 Merge pull request #659 from nymtech/remove_contract_location
contracts: Removed mixnode location from the bonding process
2021-06-28 17:08:15 +03:00
Bogdan-Ștefan Neacșu a82ac9c50d contracts: Removed mixnode location from the bonding process
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-06-28 15:10:57 +03:00
Bogdan-Ștefan Neacşu bb0257ccc6 Merge pull request #656 from nymtech/feature/configurable-verloc-http-ports
Feature/configurable verloc http ports
2021-06-28 14:52:54 +03:00
Bogdan Neacşu 142a70365f Merge pull request #655 from nymtech/feature/describe_location
Feature/describe location
2021-06-25 15:24:09 +03:00
Bogdan-Ștefan Neacșu 12ddf80fe9 Applied feedback:
- Use concrete location for example
- Removed `Location` from displayed information
- Replace tuple with a type alias
- Commit description to disk once the upgrade is finalized
- Other minor changes

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-06-25 14:21:48 +03:00
Bogdan-Ștefan Neacșu 34fcca052b mixnode: Fix clippy warning
This fixes the warning caused by `clippy::field-reassign-with-default`

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-06-25 14:20:21 +03:00
Bogdan-Ștefan Neacșu e06e7aa8f3 mixnode: Add tests for upgrade to 10.0.2
Add a positive and a negative unit test for upgrading to 10.0.2.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-06-25 14:20:21 +03:00
Bogdan-Ștefan Neacșu 4d701be053 mixnode: Add location to describe command
Removed location from the init output and added it as input in the
describe command.

Because this creates a different format of the description file, the
patch version number must also be increased.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-06-25 14:20:20 +03:00
Bogdan-Ștefan Neacșu 3bf02c558c mixnode: Refactor upgrade functions
Renaming the function to have a clear separation between different
parts of the version, especially for future patch upgrade functions.

Also switch to a Result return value for these functions, to gather
all the
```
eprintln!
print_failed_upgrade
exit(1)
```
calls in one place.

Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
2021-06-25 14:13:21 +03:00
Jędrzej Stuczyński e7dcc8dc30 Merge branch 'develop' into feature/configurable-verloc-http-ports 2021-06-25 10:36:17 +01:00
Jędrzej Stuczyński b7f197d278 Feature/host ip split (#654)
* Updated smart contract to work with future cosmwasm 0.14.0 update

* Updated the rest of the codebase

* Reordered imports

* Missing imports

* cargo fmt

* More cargo fmt action

* Introduced type alias for IdentityKey reference

* Constant defined arguments for gateway and mixnode

* Spliting host into explicit address and port(s)

* Using more type restrictive IpAddr rather than String for listening address

* Updated config templates

* Tentative upgrade commands, probably to be further changed before release

* Fixed mixnet contract test fixtures

* Further missing test adjustments
2021-06-25 10:33:12 +01:00
Jędrzej Stuczyński 3412a0b7bd Increased validator client version 2021-06-24 15:51:05 +01:00
Jędrzej Stuczyński 23951acdec Fixed trying to log invalid field 2021-06-24 14:51:44 +01:00
Jędrzej Stuczyński b56bb7f226 Updated typescript models 2021-06-24 10:46:02 +01:00
Jędrzej Stuczyński f0fafe97fe Using verloc with custom ports 2021-06-23 16:08:48 +01:00
Jędrzej Stuczyński 9df360cf63 Removed constructors only used in tests
To elaborate further, to update Mixnode constructor it would require adding yet two more arguments and at that point the compiler warns about too many arguments
2021-06-23 16:08:27 +01:00
Jędrzej Stuczyński 035ee3a402 Added new ports to bond model 2021-06-23 16:04:21 +01:00
Jędrzej Stuczyński 035a2554ee Configurable http api port 2021-06-23 15:49:38 +01:00
Jędrzej Stuczyński 4c8f8ff1b6 Renamed 'rtt_measurement' to verloc to avoid confusion 2021-06-23 15:38:52 +01:00
Jędrzej Stuczyński 35cddab3bd Introduced cli arguments for verloc and http ports 2021-06-23 15:33:57 +01:00
Jędrzej Stuczyński 0a5f6f2ca7 Added verloc and http port fields to config 2021-06-23 15:25:23 +01:00
Jędrzej Stuczyński 53253d443c Further missing test adjustments 2021-06-23 12:58:24 +01:00
Jędrzej Stuczyński 07f2f9c39e Fixed mixnet contract test fixtures 2021-06-23 12:46:38 +01:00
Jędrzej Stuczyński 1d4026ec71 Tentative upgrade commands, probably to be further changed before release 2021-06-23 12:26:06 +01:00
Jędrzej Stuczyński 6524fa3f9c Updated config templates 2021-06-23 12:25:40 +01:00
Jędrzej Stuczyński 6e24b2681b Using more type restrictive IpAddr rather than String for listening address 2021-06-23 12:25:29 +01:00
Jędrzej Stuczyński 5ba20268dd Allow passing optional explicit bond value (#652)
* Allows passing an optional argument to specify bond value

* Fixed incorrect coin array usage

* Using minimum gateway bond for gateway bonding

* Bumped validator client version number

* Made the explicit bond value required as an argument
2021-06-22 17:15:20 +01:00
Jędrzej Stuczyński 4e03759c0f Feature/cosmwasm 0.14.1 update (#653)
* Updated smart contract to work with future cosmwasm 0.14.0 update

* Updated the rest of the codebase

* Reordered imports

* Missing imports

* cargo fmt

* More cargo fmt action

* Introduced type alias for IdentityKey reference
2021-06-22 17:07:11 +01:00
Jędrzej Stuczyński a6be3e763f Spliting host into explicit address and port(s) 2021-06-22 16:39:07 +01:00
Jędrzej Stuczyński 29ac119127 Constant defined arguments for gateway and mixnode 2021-06-22 16:38:14 +01:00
Jędrzej Stuczyński 67ce93ffc8 Merge branch 'feature/cosmwasm-0.14.1-update' into feature/host-ip_split 2021-06-22 09:44:02 +01:00
Jędrzej Stuczyński 08964f8775 Introduced type alias for IdentityKey reference 2021-06-18 12:32:13 +01:00
dependabot[bot] d8d2d84aa7 Bump websockets in /clients/native/examples/python-examples/websocket (#638)
Bumps [websockets](https://github.com/aaugustin/websockets) from 8.1 to 9.1.
- [Release notes](https://github.com/aaugustin/websockets/releases)
- [Changelog](https://github.com/aaugustin/websockets/blob/9.1/docs/changelog.rst)
- [Commits](https://github.com/aaugustin/websockets/compare/8.1...9.1)

---
updated-dependencies:
- dependency-name: websockets
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-18 12:22:38 +01:00
Jędrzej Stuczyński 7d69fa3ed5 More cargo fmt action 2021-06-18 12:21:33 +01:00
Jędrzej Stuczyński dff7a8976a cargo fmt 2021-06-18 12:15:34 +01:00
Jędrzej Stuczyński 50fbe55be9 Missing imports 2021-06-18 12:01:29 +01:00
Jędrzej Stuczyński 648543e536 Merge branch 'feature/cosmwasm-0.14.0-update' into feature/cosmwasm-0.14.1-update 2021-06-18 11:59:45 +01:00
Jędrzej Stuczyński 3d2654923a Bugfix/delegation type fixes (#649)
* Extended no delegation found errors with address information

* Error now use Display implementation rather than Debug

* Delegation correctly contains owner address

* Updated js delegation type

* Bumped validator client version number

* Delegation::owner returns owned type

* cargo fmt
2021-06-17 10:51:50 +01:00
Jędrzej Stuczyński d03798629c Introduced type aliases for mixnode and gateway keys (#650)
* Introduced type aliases for mixnode and gateway keys

* Ibid for error types

* Ibid for tests
2021-06-17 09:01:41 +01:00
Dave Hrycyszyn e470ac4b0f Removing the ancient explorer in preparation for a new dawn. (#645) 2021-06-16 13:35:33 +02:00
Dave Hrycyszyn 9324e3511f Reverting trial README change 2021-06-15 16:05:30 +01:00
Dave Hrycyszyn 23d0607239 Testing code owners again (#644) 2021-06-15 14:07:19 +01:00
Dave Hrycyszyn ebba222a86 I was missing the *, fixing 2021-06-15 12:54:07 +01:00
Dave Hrycyszyn fdbecb2a3f Removing Bogdan for the moment so as not to flood him :) 2021-06-15 12:50:42 +01:00
Dave Hrycyszyn 785513914c Merge branch 'develop' of github.com:nymtech/nym into develop 2021-06-15 12:42:25 +01:00
Dave Hrycyszyn c789853b32 Adding codeowners who can be added to PRs by default 2021-06-15 12:42:15 +01:00
Jędrzej Stuczyński 97ec416b3e TypeScript client v0.12.0 (#641) 2021-06-15 10:46:42 +01:00
Jędrzej Stuczyński 164c8ad05c Feature/reverse contract mapping (#640)
* WIP

* One fewer todos

* Migrated transactions,queries + query tests

* Transaction-related tests restored

* Import cleanup

* Initial draft of the migration procedure

* Future migration test

* Fixed rust compilation errors

* Unbonding no longer requires explicit identity

* Delegation API changes

* Fixed incorrect gateway delegation object
2021-06-14 17:55:41 +01:00
Dave Hrycyszyn 7b02026476 Bumped to 0.11.1 2021-06-11 10:51:54 +01:00
Jędrzej Stuczyński 1fb26b68c6 Feature/delegated staking (#635)
* Initial delegation

* Queries for delegation

* Validation + delegation tests

* Removing delegation tests + fixes

* Tests for query related functions

* Adjusted delegation queries page limits

* Added delegation queries to validator client

* Methods for delegation inside validator client

* Some comments

* missing return types

* Post merge fixes

* Rewarding mix delegations

* Renaming

* Moved storage keys around

* Gateway delegation

* ibid

* Removed needlessly commented lines
2021-06-10 12:55:58 +01:00
Jędrzej Stuczyński 29fd8b8805 Chore/clippy nightly fixes (#636)
* Removed needless borrow in upgrade args matches

* Pathfinder needless borrows

* cmp needless borrow

* Network monitor needless borrows

* Topology control needless borrows

* Received buffer needless borrow

* Key manager needless borrows

* Network requester needless borrow

* Gateway client needless borrow

* Gateway requests needless borrow

* Nymsphinx needless borrows

* verloc needless borrows

* Socks5 needless borrow

* Clone on copy type
2021-06-07 14:52:11 +01:00
dependabot[bot] 31b9048144 Bump ws from 6.2.1 to 6.2.2 in /clients/webassembly/js-example (#632)
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 12:41:39 +01:00
dependabot[bot] 10c0e04926 Bump ws in /clients/native/examples/js-examples/websocket (#633)
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 12:41:33 +01:00
dependabot[bot] c0ad3ce1a6 Bump ws from 6.2.1 to 6.2.2 in /clients/validator (#634)
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 12:41:26 +01:00
Jędrzej Stuczyński 82def1349f Feature/stats endpoint (#631)
* Idea for stats endpoint

* Introduced /stats endpoint replacing sending data to metrics server

* Removed metrics client

* Removed old metrics file

* cargo fmt
2021-06-07 12:01:43 +01:00
Jędrzej Stuczyński 94a52aa2db Updated all js related dependencies (#629) 2021-06-07 12:00:12 +01:00
Jędrzej Stuczyński 50f65aa698 Feature/per layer count (#628)
* Initial struct

* WIP

* Added test for migration

* unused import
2021-06-07 11:59:33 +01:00
Jędrzej Stuczyński e12314a6fa Feature/update validator binaries (#624)
* Removed old wasmd v0.14.1 binaries

* Uploaded new wasmd v0.14.2 binaries
2021-06-07 11:02:06 +01:00
Jędrzej Stuczyński 15e377e678 Changed rewarding behaviour on not found bonds (#627) 2021-06-07 11:00:07 +01:00
Jędrzej Stuczyński 7b1dab8546 Getting required bond from the contract (#623) 2021-06-02 12:51:28 +01:00
Jędrzej Stuczyński 93e9dc5c1e Bugfix/verloc fixes and adjustments (#618)
* Using new display trait for identity key

* Establishing verloc connection with timeout

* Further decrease in log severity

* Writing echo packets with timeout

* Sender formatting

* ConnectionWriteTimeout error definition

* Writing verloc results in chunks

* Added run started and run finished fields to verloc

* Reordered the fields

* Storing the timestamps as options to indicate run in progress
2021-06-02 12:50:36 +01:00
Jędrzej Stuczyński 0dcb046576 Changed omitted print to a debug call (#617) 2021-06-02 12:48:28 +01:00
dependabot[bot] 5288510979 Bump dns-packet in /clients/native/examples/js-examples/websocket (#626)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-01 09:42:26 +01:00
dependabot[bot] 81481832d8 Bump dns-packet from 1.3.1 to 1.3.4 in /clients/webassembly/js-example (#625)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-01 09:42:20 +01:00
Jędrzej Stuczyński 27e704ab80 Reordered imports 2021-05-27 11:42:11 +01:00
Jędrzej Stuczyński da339a83cd Updated the rest of the codebase 2021-05-27 11:29:31 +01:00
Jędrzej Stuczyński 99780d3eb0 Updated smart contract to work with future cosmwasm 0.14.0 update 2021-05-27 11:27:09 +01:00
dependabot[bot] aee0ec7dec Bump browserslist in /clients/native/examples/js-examples/websocket (#619)
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.14.1 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.14.1...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 14:56:07 +01:00
Jędrzej Stuczyński b8e8beb62b Merge tag 'v0.10.1' into develop
release v0.10.1
2021-05-25 17:15:36 +01:00
Jędrzej Stuczyński b4ef0ae4f3 Merge branch 'release/v0.10.1' 2021-05-25 17:15:28 +01:00
Jędrzej Stuczyński d9087bf2a9 Upgrade commands 2021-05-24 11:52:31 +01:00
Jędrzej Stuczyński 2f29ee49db Updated changelog 2021-05-24 11:21:28 +01:00
Jędrzej Stuczyński abc5a58b19 Version bumps 2021-05-24 11:15:59 +01:00
Jędrzej Stuczyński 01d7e3a5f2 Bugfix/unique node ownership (#612)
* Removed old migration code

* Added new errors for duplicate nodes

* Checking for node ownership before adding them

* Tests
2021-05-21 09:03:07 -04:00
Jędrzej Stuczyński ea08fad2e0 Decreased log severity for verloc-related functionalities (#611)
* Decreased log severity for verloc-related functionalities

* Removed unused variable
2021-05-20 20:53:28 -04:00
Jędrzej Stuczyński a47bbf1e67 Disabled metrics reporting to the central server (#609) 2021-05-20 09:09:52 +01:00
Jędrzej Stuczyński 1fe38b1b9c Implemented display traits for identity and encryption keys (#607) 2021-05-19 10:33:01 -04:00
Jędrzej Stuczyński ed489149dc Feature/network monitor gateway pings (#608)
* Ability to send Ping frame to gateway

* Sending ping frame to gateways every 1min

* Increased monitor run interval back to 15min

* Whitespace
2021-05-19 10:32:31 -04:00
Dave Hrycyszyn 190d3c4972 Feature/add node description api (#605)
* Starting to build out node descriptions

* Renamed the mod to node_description instead of descriptor

* Returning results loaded from file

* Taking user input for node describe command

* Readline without new dependencies

* Adding input format hint

* Making sure the node can still start even when the descriptor file isn't there yet

* Adding some additional runtime checks

* Removing -dev from minimum node version

* Removing initial :: on serde

* Fixing comment on the /description endpoint

* Swapped json for toml

* Being a bit more specific with my startup message.

* Cleaning up path building

* Nicer runtime checks

* Put path building inside the file methods
2021-05-19 14:25:11 +01:00
Jędrzej Stuczyński ea62d01e65 Feature/updated network monitor (#604)
* Connecting to gateway with a timeout

* Added address value to InvalidAddress error

* Initial updated network monitor (does not submit results yet)

* Created client for node status api

* Changed default address to the local one

* Removed old validator client

* Renamed validator client rest to validator client

* Print conversion warnings using Display rather than Debug formattingn

* WIP for adding owner field in monitor

* Preserving changes before branch switch

* Keeping track of node owners during monitoring + using those for node status api

* Removed temporary log statement

* Dont notify node status api if good nodes are broken

* Changed default monitor interval to 5min

* Post merge issues

* Allowing dead version field in seocksrequest

* Updated monitor run interval to 15min

* Reporting gateways and mixnodes separately with the new api

* Unused imports

* Decreased testing interval to temporarily bypass the silent timeout issue

* Formattingn
2021-05-18 17:33:31 +01:00
dependabot[bot] 97156c918b Bump url-parse from 1.4.7 to 1.5.1 in /clients/webassembly/js-example (#598)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 09:55:58 +01:00
dependabot[bot] d79013f1c1 Bump url-parse in /clients/native/examples/js-examples/websocket (#599)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 09:55:52 +01:00
dependabot[bot] b69b221e62 Bump lodash in /clients/native/examples/js-examples/websocket (#601)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 09:55:45 +01:00
dependabot[bot] 266138dcf2 Bump lodash from 4.17.20 to 4.17.21 in /clients/validator (#602)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 09:55:12 +01:00
Jędrzej Stuczyński a8299e867d Feature/ping timings (#603)
* WIP

* WIP for time measurement

* In theory working sender and listener

* Further additions + main.rs for local testing

* Further improvements + config builder

* Initial integration into mixnode

* Verifying mixnode version

* 1.52+ clipy warning

* 1.54 nightly clippy fixes

* Changed HTTP Api to bind to the same ip as used for mix packets

* Changed measurements to instead write to shared object

* Required dependencies

* Connecting with the http api

* Updated mixnode common rand dependency
2021-05-12 11:20:03 -04:00
Dave Hrycyszyn 7dc4d653c2 Feature/add rocket (#600)
* Added rocket at a git tag

* Adding Rocket to the mixnode

* Verloc route now in place

* Adding an http api startup notification

* Updated version number to 0.10.1-dev

* Fixing clippy warnings

* Compressing split a bit

* Adjusted used version of js-sys

Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
2021-05-11 17:40:29 +01:00
Jędrzej Stuczyński 2f9e67e8b2 Recalculating reward rates on appropriate value changes (#594) 2021-05-05 11:47:36 -04:00
Jędrzej Stuczyński 2c058bcbca Feature/simple payments (#571)
* Calculating reward per epoch

* Initial uptime-based rewards

* Setting monitor address on init + minor cleanup

* Ability to reward nodes through validator client

* Preemptively updated client version

* Using hardcoded monitor address

* Removed unnecessary let binding

* Comment typo

* Changed validator-client package.json version

* Checking for broadcast error

* Added epoch_length to typescript client's stateparams

* Setting default state on migration

* Removed reward mixnode/gateway methods from the client api

* api for executing custom contract methods

* Removed whitespace leftover from the merge

* Extra comments

* Cleanup

Co-authored-by: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
2021-04-29 14:22:14 -04:00
Jędrzej Stuczyński 528eba2faa Changed default mixnode query page limit (#592)
* Changed default mixnode query page limit

* Fixed the tests

* 0.11.0 validator client
2021-04-29 13:58:28 -04:00
Jędrzej Stuczyński 7f7c37eeba Feature/more exposed client api (#591)
* Added public sign and broadcast to net client

* Created a function to send funds multiple times in a single block
2021-04-28 09:13:41 -04:00
Jędrzej Stuczyński 18adb1f5bd Contract adjustment to check for node ownership before allowing bonding (#590)
* Checking for gateway/mixnode ownership before allowing bonding of the other type

* Renamed bond and unbond to bondmixnode and unbondmixnode
2021-04-28 09:12:20 -04:00
Jędrzej Stuczyński a521bc0f54 Logging adjustment (#585)
* Reduced severity of common harmless warnings

* Changed the same ip node warning

* More explicit error on network address binding failure
2021-04-28 09:11:04 -04:00
dependabot[bot] 6f173ffebd Bump ssri from 6.0.1 to 6.0.2 in /clients/webassembly/js-example (#589)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-23 17:14:33 +01:00
dependabot[bot] 7e31cbabe5 Bump ssri in /clients/native/examples/js-examples/websocket (#588)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-23 17:14:19 +01:00
Jędrzej Stuczyński e8e966b67a Feature/multiple validator endpoints (#583)
* Rust half done

* Removed the temporary 'test'

* Using multiple validator endpoints in the javascript client

* Dont attempt any switches with a single validator endpoint

* Removed the unused temporary function

* Updated validator-client version
2021-04-23 16:41:39 +01:00
Jędrzej Stuczyński 73af405400 Checking for tx success when sending coins (#586)
* Checking for tx success when sending coins

* Changed send return type to BroadcastTxSuccess
2021-04-23 15:34:35 +01:00
Jędrzej Stuczyński 037723eb90 Impl Error trait for ValidatorClientError (#587) 2021-04-23 10:58:06 +01:00
François Garillot d432bebce8 Minor cosmetic changes while reading around (#568)
* Simplify some Option / Result / ? operator patterns

... when they have a direct combinator equivalent.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust)

* Remove panic in socket state
2021-04-19 15:12:19 +01:00
Jędrzej Stuczyński 0a3cffa1a1 Validator client patch version increase 2021-04-16 10:17:01 +01:00
Jędrzej Stuczyński 796107c4c5 Refreshing nodes gets all available nodes from the contract (#575) 2021-04-16 10:15:25 +01:00
Jędrzej Stuczyński fd0df9fe47 Merge tag '0.10.0' into develop
release 0.10.0
2021-04-15 10:05:29 +01:00
Jędrzej Stuczyński 58a7f4ea5f Merge branch 'release/0.10.0' 2021-04-15 10:05:20 +01:00
Jędrzej Stuczyński 725b8d6f8a Updated CHANGELOG 2021-04-15 10:05:10 +01:00
Jędrzej Stuczyński e5a1c1c97e Merge branch 'develop' into release/0.10.0 2021-04-15 10:02:48 +01:00
Dave b894dbf243 Merge branch 'develop' of github.com:nymtech/nym into develop 2021-04-15 10:01:08 +01:00
Dave 92821c8d81 Pushing changelog for 0.10.0 2021-04-15 10:00:52 +01:00
Jędrzej Stuczyński af8360f363 Updated old 0.9.2 versions to 0.10.0 2021-04-15 09:47:55 +01:00
Jędrzej Stuczyński 8b12a31f73 Version 0.10.0 of the validator client 2021-04-15 09:41:14 +01:00
Jędrzej Stuczyński fd55eb678c Displaying address of the client on init (#573) 2021-04-15 09:34:57 +01:00
Jędrzej Stuczyński bb3ce645a4 Changed default client topology refresh rate from 30s to 5min (#570) 2021-04-14 17:04:00 +01:00
Jędrzej Stuczyński 4e339f1788 Fixed nightly clippy warnings (#572)
* Fixed nightly clippy warnings

* Using string literal in panic message
2021-04-14 16:41:47 +01:00
Jędrzej Stuczyński dca9c7079c Merge branch 'develop' of github.com:nymtech/nym into develop 2021-04-14 11:42:23 +01:00
Jędrzej Stuczyński 52a8909e77 Updated default mixnet contract address 2021-04-14 11:42:05 +01:00
Dave Hrycyszyn 9d2c445bb7 Adding the wallet url in startup instructions (#569) 2021-04-13 14:13:13 +01:00
Dave Hrycyszyn 6a1c2fa5dd Feature/cli signing (#566)
* Adding hex output and coloured terminal output crates

* Adding a `sign` command to the mixnode

* IntelliJ's non-use of rustftm is non-IntelliJent. Whitespace commit.

* Removing hex, using base58 everywhere.
2021-04-12 11:11:20 +01:00
Jędrzej Stuczyński 809c3f3607 Updated version number on the validator client (#565) 2021-04-09 15:34:20 +01:00
Jędrzej Stuczyński bebf0df2de Removed unused data from cargo.toml (#567) 2021-04-09 15:19:39 +01:00
Dave Hrycyszyn 5652eb7ee3 A pull request for discussion about contract state variables (#563)
* A pull request for discussion about contract state variables

* Updated contract state struct

* Introduced transaction to update the contract state

* Moved transactions to separate file

* Corrected return type on query

* Corrected query match

* Added test for state params query

* Test for state params update

* Removed unused imports

* Helper functions to query for state params

* Removed hardcoded inside bond, old mix bond value

* Helper function to update contract state

* Changed typescript StateParam from numbers to strings

* Somehow unresolved post-merge issues in tests

* Introduced additional helpers for the validator client to use the new contract features

* Using the state-specified bond values

Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
2021-04-09 13:10:01 +01:00
Jędrzej Stuczyński b6ba8f8555 Renamed mixnode registration into bonding (#564) 2021-04-08 15:37:56 +01:00
Jędrzej Stuczyński 22bfd44065 Feature/mixnet contract ci (#562)
* Fixed constant not updated in error macros

* Fixed clippy warning

* Attempt at adding mixnet contract to CI
2021-04-08 11:42:25 +01:00
Jędrzej Stuczyński 3136346a01 Feature/bonding adjustments (#561)
* Made mixnode bonding process similar to that of gateways' + lowered bonding fee

* Adjusted bonding fee to 100

* Adjusted MixNode Display implementation for nicer formating

* Renamed bonding stake to just bond

* Renamed other cases where stake was referring to bond
2021-04-08 11:15:19 +01:00
Jędrzej Stuczyński f536449f0c Feature/migration additions (#560)
* Changed default contract execution gas limit to 250_000 (from 9_000_000_000)

* Introduced ability to perform contract migration

* Removed unused import
2021-04-07 17:23:13 +01:00
Jędrzej Stuczyński 7659424f28 Changed default contract execution gas limit to 250_000 (from 9_000_000_000) (#559) 2021-04-07 14:37:11 +01:00
Jędrzej Stuczyński eff40dd907 Missing quotes in mixnet_contract_address config field (#558) 2021-04-06 14:46:37 +01:00
Jędrzej Stuczyński 800af218a5 Updated default validator url and contract address (#557) 2021-04-06 13:22:30 +01:00
dependabot[bot] f5c1b6dfdd Bump y18n in /clients/native/examples/js-examples/websocket (#556)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-06 12:17:18 +01:00
Dave dfdfba5d2f Merge branch 'develop' of github.com:nymtech/nym into develop 2021-04-01 12:08:34 +01:00
Jędrzej Stuczyński 047a483464 Added extra step for publishing validator client (#553) 2021-04-01 12:08:16 +01:00
Jędrzej Stuczyński 4a908e7e14 Feature/bonding info on init (#555)
* Mixnode bonding info on init

* Gateway bonding info on init
2021-04-01 12:08:16 +01:00
Jędrzej Stuczyński bcf25135a1 Feature/validator client address getter (#554)
* Added address getter for the client

* Might as well bump the version number
2021-04-01 12:08:16 +01:00
Jędrzej Stuczyński 087efbe553 Feature/validator client rc3 (#552)
* Bumped the version number

* Additional currency helper
2021-04-01 12:08:16 +01:00
Jędrzej Stuczyński 2be0ab6474 Feature/upgrade update (#551)
* Native client upgrade command capable of upgrading to 0.10.0

* Ibid for the socks5 client

* Mixnode upgrade command for 0.10.0

* Fixed clippy warnings

* Gateway upgrade command for 0.10.0

* Removed unused import
2021-04-01 12:08:16 +01:00
Dave Hrycyszyn 9a1abfad9c Feature/export coin helper (#550)
* Annoying whitesapce commit

* ibid

* Re-exporting `coin` so client applications don't need to import it from some random spot
2021-04-01 12:08:16 +01:00
Dave f7f119b100 Merge branch 'develop' of github.com:nymtech/nym into develop 2021-04-01 12:02:29 +01:00
Dave bd78f8833f Adding nymd binaries (which are just cosmwasm/wasmd v0.14.1 compiled artefacts)
May be helpful in case people don't have Go experience.
2021-04-01 12:02:11 +01:00
Dave 4a081d6fa7 Adding a pointer to the docs for validator deploy instructions 2021-04-01 12:01:35 +01:00
Jędrzej Stuczyński 42268e044c Added extra step for publishing validator client (#553) 2021-04-01 11:38:08 +01:00
Jędrzej Stuczyński 48dda32c3e Feature/bonding info on init (#555)
* Mixnode bonding info on init

* Gateway bonding info on init
2021-03-31 16:01:06 +01:00
Jędrzej Stuczyński a21ed92ac3 Feature/validator client address getter (#554)
* Added address getter for the client

* Might as well bump the version number
2021-03-31 10:15:42 +01:00
Jędrzej Stuczyński ee71ae89f7 Feature/validator client rc3 (#552)
* Bumped the version number

* Additional currency helper
2021-03-31 09:58:57 +01:00
Jędrzej Stuczyński a97377fdea Feature/upgrade update (#551)
* Native client upgrade command capable of upgrading to 0.10.0

* Ibid for the socks5 client

* Mixnode upgrade command for 0.10.0

* Fixed clippy warnings

* Gateway upgrade command for 0.10.0

* Removed unused import
2021-03-30 15:47:59 +01:00
Dave Hrycyszyn 1d4420820f Feature/export coin helper (#550)
* Annoying whitesapce commit

* ibid

* Re-exporting `coin` so client applications don't need to import it from some random spot
2021-03-30 15:36:16 +01:00
Jędrzej Stuczyński 596bc76cc6 Chore/dependency updates (#549)
* Updated all non-breaking dependencies

* Updated common/crypto dependencies

* Updated all tokio [and associated] dependencies to most recent version

* Bumped version of rand_distr

* Fixed api changes in tests

* Made clippy happier about the acronym

* Fixed the type while trying to make clippy even happier

* nightly cargo fmt
2021-03-29 15:32:34 +01:00
Jędrzej Stuczyński cc1b80229c Feature/validator query client (#547)
* Defined new query client

* Adjustments to NetClient

* Validator client changes

* Node caches taking either client instance

* Fixed incorrect import paths
2021-03-26 11:25:25 +00:00
Dave Hrycyszyn f07ac48a33 Feature/validator client rc2 (#546)
* Fixing publish instructions

* Bumped version number
2021-03-25 12:44:12 +00:00
Jędrzej Stuczyński 8abfc43fc8 Feature/has node query validator client (#545)
* Added contract query to check if given address owns a mixnode/gateway

* Fixed merge conflict

* Possibly working, but yet untested, checking for mix ownership for validator client
2021-03-25 12:20:56 +00:00
Jędrzej Stuczyński 7361d7a220 Added contract query to check if given address owns a mixnode/gateway (#544)
* Added contract query to check if given address owns a mixnode/gateway

* Fixed merge conflict
2021-03-24 17:29:08 +00:00
Dave Hrycyszyn 52d4ddb714 RC1 published (#543) 2021-03-24 11:49:58 +00:00
Dave Hrycyszyn ca60b8671c Feature/prep for publish (#542)
* Adding Apache license

* Getting package.json ready to roll
2021-03-24 11:04:05 +00:00
Jędrzej Stuczyński 9e0bb80163 Feature/topology conversion (#536)
* Removed reputation field from existing topology

* ibid for registration time

* Basic bond to topology conversion

* Made existing tests compilable

* Added owner and stake fields to mix and gateway topology entries

* Moved node conversion to topology crate

* Added mixnet contract field to clients configs

* topology refresher trying to use new validator

* Removed clients depepdency on the old validator client

* Removed mixnode dependency on the old validator client

* Removed gateway dependency on the old validator client

* Removed location field fron mixnode and gateway configs

* Removed incentives address from mixnodes and gateways

* Cargo.lock changes

* Ignoring clippy warnings originating from codegen from JsonSchema

* no longer formating string with a literal
2021-03-24 10:52:27 +00:00
Dave Hrycyszyn ce7dcbc163 Feature/bigger better stronger mnemonics (#541)
* Upping the size of the mnemonic

* Making mnemonicToAddress static
2021-03-24 10:33:41 +00:00
Dave Hrycyszyn cf93afb639 Removed a package-lock.json which seems to have been accidentally added (#539) 2021-03-23 12:59:03 +00:00
Dave 1119a9e55f Merge branch 'develop' of github.com:nymtech/nym into develop 2021-03-23 12:25:56 +00:00
Dave Hrycyszyn 51d2213819 Feature/convert to uhal (#537)
* Exporting Coin struct, needed for wallet

* Passing the url through instead of using local options.

This gives us the ability to hook up to the new validator

* Removing examples

* Simplifying dependencies a bit

* Setting all contract denominations to uhal

* Making stakeDenom configurable throughout
2021-03-23 12:18:08 +00:00
Dave b567ee55f3 Merge branch 'develop' of github.com:nymtech/nym into develop 2021-03-23 11:30:30 +00:00
Dave Hrycyszyn 5ef77185a1 Feature/hook up url in validator client (#535)
* Exporting Coin struct, needed for wallet

* Passing the url through instead of using local options.

This gives us the ability to hook up to the new validator
2021-03-19 16:35:46 +00:00
Dave 4ae8ae7231 Merge branch 'develop' of github.com:nymtech/nym into develop 2021-03-19 15:47:58 +00:00
Jędrzej Stuczyński 2e7cd451ec Feature/mix contract identity key (#533)
* Added identity_key field to mixnodes

* Printing out required bond information on mixnode startup
2021-03-18 15:05:32 +00:00
Dave Hrycyszyn d301694404 Feature/upgrade cosm client (#534)
* Exporting Coin struct, needed for wallet

* Upgrading cosmwasm client to 0.24.1
2021-03-18 14:40:55 +00:00
Dave 752bce589b Merge branch 'develop' of github.com:nymtech/nym into develop 2021-03-18 11:13:52 +00:00
Jędrzej Stuczyński 67c92b3e56 Feature/validator client rust (#532)
* Moved definition of mixnet contract common items to separate module

* Removed schemars dependency from being wasm32 specific

* Moved query responses to the shared module

* Fixed tests due to differerent import paths

* Updated dashmap in other crates to help with once_cell version selection

* Reexporting coin and humanaddr

* Deserializing response from validator

* Deserializing smart result directly to specific type

* Ability to query for mixnodes and gateways from rust

* Fixed compilation warning due to updated dashmap
2021-03-18 09:31:15 +00:00
Dave Hrycyszyn d3570df968 Feature/add currency helpers (#531)
* Exporting Coin struct, needed for wallet

* Adding currency helpers
2021-03-16 14:31:13 +00:00
Dave 261993ea90 Merge branch 'develop' of github.com:nymtech/nym into develop 2021-03-16 12:52:12 +00:00
Dave Hrycyszyn 0ae29eb5fa Exporting Coin struct, needed for wallet (#530) 2021-03-16 12:13:04 +00:00
Dave 87408d4b7b Exporting Coin struct, needed for wallet 2021-03-16 11:53:57 +00:00
Jędrzej Stuczyński 503f723a64 Feature/validator client gateway bonding (#526)
* Defined gateway and gatewaybond types

* Gateway related errors

* New message types

* gateway tests fixtures and helpers

* Handling of gateway-related messages

* Fixed most of clippy warnings

* Fixed eslint errors in the validator client

* Defining gateway bonds on the typescript side

Co-authored-by: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
2021-03-16 11:48:41 +00:00
Dave 9c72aac255 Loading from key file 2021-03-15 14:18:29 +00:00
Dave 34a143696f Merge branch 'develop' of github.com:nymtech/nym into develop 2021-03-15 14:07:39 +00:00
Dave de22936ed1 Upload contract wasm script 2021-03-15 14:06:35 +00:00
Dave Hrycyszyn 9da9c95c80 Getting corrector user home dir in Python setup script (#528) 2021-03-15 13:40:54 +00:00
Dave a7fe4697c5 Getting corrector user home dir in Python setup script 2021-03-15 13:39:39 +00:00
Dave Hrycyszyn 1d9bced599 Temporarily disabling fs access (#527)
* Temporarily disabling fs access

* Going back to double quotes
2021-03-15 13:37:01 +00:00
Jędrzej Stuczyński a854118f19 Feature/gateway bonding (#524)
* Defined gateway and gatewaybond types

* Gateway related errors

* New message types

* gateway tests fixtures and helpers

* Handling of gateway-related messages

* Fixed most of clippy warnings
2021-03-12 14:28:58 +00:00
Jędrzej Stuczyński d496ee3031 Fixed eslint errors in the validator client (#525) 2021-03-12 14:19:51 +00:00
dependabot[bot] f29dd884f3 Bump elliptic in /clients/native/examples/js-examples/websocket (#521)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-11 10:38:47 +00:00
Dave Hrycyszyn e1181f756c Fix the remove mixnode test (#522) 2021-03-10 16:06:31 +00:00
Dave Hrycyszyn 4ca40fd3bc Feature/initial mixnet contract (#515)
* Starting on cosmwasm smart contracts

* Mixnet contract now builds

* Removing license and notice files, the monorepo already has these.

* Removing generated README content

* Simplified development instructions a bit.

* Converted some network monitor files to use SPDX license headers

* Renamed packaget to mixnet-contracts

* Depending on the Nym topology crate

* Renaming contract package in usage

* Renamed "announce" to "register_node" in the defined messages

* Fixed package name for mixnet contracts in defined release annotations

* Added the mixnet contracts to the Cargo lock file

* Renamed some fields in our contract topology

* Using the stringy mixnode from the validator client.

* Removing mix nodes count from state, we can infer that

* Saving generated code in comment as it's a useful example for now

* Renamed "count" to "get_topology"

* Adding the beginnings of a validator client (in Typescript)

* Starting to integrate example code. WIP.

* Ignoring generated accounts

* Making a few less mixnodes :)

* Adding shebang to start script

* Cranking up the Nym-related gas limits, as otherwise contract upload fails.

* Simplest mixnode example is now working

* Removing the external client code, it messed up wasm compilation. Will copy/paste for now.

* Contract now wants to add a MixNode rather than an IP string

* Adding mixnodes via contract now works (!)

* Simplified mixnode registration example

* Further mixnode-adding simplification.

* Adding author name

* Fixed description

* Sent funds are now required to bond a mixnode

* Ensuring that we send correct coin denomination

* Unbonding now works (!). Quite primitivist.

* Checking that unbonding works from the client.

* Setting up a thief account to play with

* Checking to see whether thief can unbond a node (it fails, happily)

* Adding a more specific error for when an account attempts to unbond but owns no bonds

* Figured out how to test contract balances

* Set the console messages to explain things a little more nicely

* Tests for insufficient funds result

* Using more async in driver example

* Added a bit more explanation of the actions taken by the driver example

* Locking down wasm instantiate a bit more

* Docs clarifications on how to run example

* README clarification

* Corrected the commit hash in the wasmd build command, it was still set for 0.14.0

* Moved models from types into state

* Starting work on range queries

* whitespace

* Going back to slow but reliabel node uploads and disabling new contract upload

* Cranking gas fees temporarily

* Mixnode key retrieval working and tested

* Range retrievals now working well

* Removing unused clone

* Compressing tests a bit

* Testing node retrieval on large numbers of nodes.

Not sure whether MockStorage has the same space limitations as
production storage does.

* Getting rid of spelling warning

* Removing unused responses

* Minor cleanup

* Starting to map my way out of the tuples

* Slightly more meaningful variable names

* Returning a StdResult from nodes query

* Fighting through the unwraps :)

* Unfucking a bit more

* Starting to use ranged nodes in contract

* Testing node retrieval from range store

* Ditching generated tests

* Adding works, still need to test removing mixnodes

* Attempting to remove a mixnode returns an error when no nodes exist

* Un-registering when no accounts exist (edit)

* un-registering someone else's mixnode fails

* Ensuring proper ownership

* Testing for only 1 mixnode getting deleted

* Testing single-node retrieval

* Removing mixnode working

* Removed unused imports and unused variable warnings

* Made handler functions private

* Tested for error response on mixnode removal

* Ensured proper post-state on mixnode removal

* Using Vec<Coin> for currency equality comparisons

* Removed todo, this amount is only for logging purposes anyway

* Refactoring tests a bit

* Adding a few storytelling comments

* Putting helper methods into alphabetical order

* Drying up mixnode adding in tests

* Using the new add_mixnode helper

* Checking full object equality in test

* Removing the GetNodes handler

* Taking a more "storytelling" approach to the contract tests

* We need a few more methods to run our example driver

* We now need to make a new address for each node we want to have,

as each sending account can only have one node

* HumanAddr not needed

* Making call sequence a little more readable

* Added the results of today's experiments with the REST API to the validator client readme

* Corrected console.log message

* Adding a note about how to run tests

* More contract exercising fun

* Updating mocha

* Whitespace

* Adding a note about running tests

* Adding typed rest client

* Starting to mess with typescript paging client

* Removing the rest client, we'll use the cosmjs one for this

* Noting a few more contract requirements

* Starting client restructuring

* Importing cosmjs stargate client

* Starting to work on the chain cache

* Cleanup

* Removing type annotations which hilariously worked, confusing the compiler

* Might as well do each cache individually

* Renaming chaincache so that it handles only mixnodes

* Renaming chaincache

* Setting dynamic per-page value to ease testing

* Using perPage in tests

* Moving tests back into their own special home so they don't bloat our package

* Ignoring generated docs

* Adding TypeDoc documentation generator

* Removing unused NetClient import

* Added docs generation

* Noting existence of docs generation

* Starting to test paged responses

* Working paging tests

* Clarified test names a bit

* Removed console.logs

* Added a test for two full pages.

* Formatting

* Starting to query for mix nodes

* Removed the topology in preparation for paging

* Removing unused struct

* Getting ready for series-based paging

* We're now setting page size limits on list retrievals

* Pagination starting to work, needs more testing

* Moved test support stuff into its own home

* Removing duplicate testy code

* Testing all paging stuff in the contract

* Removed useless method duplicate

* Moving queries into their own file

* Removing redundant tests

* Testing default paging limit

* Testing max paging limit

* We don't need to c/p pagination stuff from the cw-plus contracts, removing

* Testing pagination

* Making next key calculation explict via a function

* Removing temporary variable

* Commenting final state

* Incorporating the PagedResponse

* On the road to a working TypeScript client

* Adding some logging utilities

* Paged retrieval working but needs improvement - it's very brittle

* Getting the loop right

* Removing unused logger

* Setting up a request count

* Documenting the ins and outs of the client network interface

* Removing requestCount as we're not using it yet

* Success! Making paginated requests for mixnodes!

* Differentiating between MixNode and MixNodeBond

* Checking that Fred can upload a mixnode

* Fixing export

* Adding the ability for client to get balances

* Docs fix

* Converting interfaces to types

* Changing `mixNodes()` to `getMixNodes()` on client

* We might as well return the nodes we've just retrieved when we refresh

* Starting work on unbonding

* Fixed a caching bug which was causing multiple result sets to be cached

* Using the sender address as the key for removal

* Importing some result stuff so we can find out what happened on execution

* Minor messing around to prove that the sequence fully works

* Displaying a nicer message on mixnode unbond

* Renamed announce to bond in validator client

* Fixed unstable clippy warnings

* Removing commented fields

* Comment spacing

* Changed announce to bond in example code

* Making the test accounts directory configurable

* Rebuilt

* Loading keys from the local ./accounts directory

* Ignoring contract lockfile

* Saving out a contract lockfile so things continue working after contract upload

* Splitting the driver example into smaller self-contained examples

* Deleting the example that Andrew hates so much

* Making dependabot happy

* Stricter equals

* Removing unused import
2021-03-09 11:32:51 +00:00
Dave Hrycyszyn 6483a62a7c Feature/fix go errors in examples (#516)
* Fixing annoying errors Go errors showing in example code

* Fixed further Go warnings
2021-03-02 09:27:36 +00:00
Jędrzej Stuczyński 83753af944 Running CI also on windows and macOS (#512)
* Running CI also on windows and macOS

* Rust 2021 formatting

* clippy::upper_case_acronyms where appropriate

* Allowing unknown clippy lints

* Further clippy updates

* Building wasm client during CI

* wasm actions update

* added working directory to cargo jobs

* Temporarily disabled wasm test and clippy
2021-03-01 11:06:13 +00:00
Jędrzej Stuczyński 6f8ae53f0c Feature/socks5 adjustments (#510)
* Increased default connection buffer size to help with packet bursts

* Informing remote about failure to establish connection

* Properly closing outbound proxy on failure to read from socket

* Split proxy runner into separate inbound and outbound files

* Flag indicating whether socks client actually started proxying

* Clearing stale proxies if other side is closed

* Decreased log level on not a warning

* Closing proxy if no messages were received in a while

* Dont print harmless false-positive errors

* Formatting + future notes

* Fixed packet delay in higher volume traffic

* Don't attempt writing empty messages to connection
2021-02-01 14:45:50 +00:00
Jędrzej Stuczyński 2f867b75f2 Fixed unused import in non-unix systems (#509) 2021-02-01 14:43:11 +00:00
Dave ea31e18d98 Adding license and extra crate to cargo.lock 2021-02-01 11:57:42 +00:00
Dave d03af9de05 Merge branch 'develop' of https://github.com/lnceballosz/nym into lnceballosz-develop 2021-01-29 10:28:47 +00:00
Jędrzej Stuczyński 4013d0c939 Checking if the delay has already expired before attempting to put it in delay queue (#508) 2021-01-29 10:18:24 +00:00
Jędrzej Stuczyński 3a261d22f5 Not including gateway non-delay when calculating total packet delay (#507) 2021-01-29 10:18:03 +00:00
Jędrzej Stuczyński 2314baf0d3 Allowing for a single topology refresh failure (#505) 2021-01-29 10:17:37 +00:00
Jędrzej Stuczyński c882778583 if on unix, save keys with 0600 permission (#504) 2021-01-29 10:17:02 +00:00
Jędrzej Stuczyński c67e0fee37 More human-readable errors on mixnode/gateway startup (#503)
* More human-readable errors on mixnode/gateway startup

* Missing dots

* Fixed comment moved to incorrect line during formatting
2021-01-29 10:16:38 +00:00
Jędrzej Stuczyński 863aa4535a Feature/ip filtering (#502)
* Initial split into domains and ipnets

* Changed the library used for ip networks for more convenience

* Adding disallowed hosts to the unknown file
2021-01-29 10:15:30 +00:00
Jędrzej Stuczyński 86c9ab2ef5 Feature/wasm client compilation fixes (#501)
* Gateway client wasm-specific fixes

* wasm-client adjustments
2021-01-29 10:13:22 +00:00
Jędrzej Stuczyński 12faa23222 Fixed possible crash on invalid topology (#500) 2021-01-29 10:12:02 +00:00
Jędrzej Stuczyński 9cd463b22c Feature/gateway monitoring (#499)
* ability to read from multiple gateway clients

* A very initial updated network monitor

* Summary producer printing report on each finished run

* fixed gateway startup issue

* initial cleanup pass

* Sending to gateways at specified rate

* Renaming

* Fixed first run interval

* Removed false positive error print

* Ability to use 'good' topology that is different from the one being tested

* Fixed clippy warnings
2021-01-29 10:11:13 +00:00
jstuczyn d7ec81ad0a Shutting up nightly clippy to fix all pending PRs 2021-01-28 11:59:05 +00:00
Jędrzej Stuczyński 2d3b4f4b91 Feature/GitHub actions and clippy cleanup (#493)
* Added github actions templates

* removed travis .yml file

* initial clippy cleanup pass

* fixed the rest of clippy warnings

* Made github badges more fancy and consistent with the ones in sphinx

* Updated local rustc version and removed compilation warningns

* ... and fresh clippy warnings

* formatting

* beta clippy specific warnings fixed

* Fixed all nightly clippy warnings

* Fixed trying to unwrap a ()

* Actually running all tests

* Correctly passing the --all flag

* Hopefullly third time's a charm in fixing argument passing
2021-01-18 11:50:29 +00:00
Dimitris Apostolou 131574cd3c Fix typos (#492) 2021-01-04 09:31:50 +00:00
dependabot[bot] 8b29c612f8 Bump ini from 1.3.5 to 1.3.8 in /clients/webassembly/js-example (#489)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-18 11:58:17 +00:00
dependabot[bot] 9c67b73472 Bump ini in /clients/native/examples/js-examples/websocket (#490)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-18 11:58:05 +00:00
Jędrzej Stuczyński 6b37a9b95c display 0 on no validators rather than crash (#488) 2020-12-10 15:31:22 +00:00
Lina Ceballos 67ac1d9f4b adding license and copyright headers 2020-12-10 10:13:17 +01:00
Lina Ceballos 28410eedad creating license file for image 2020-12-10 10:11:01 +01:00
Lina Ceballos 0fb182ccb9 creating license file for image 2020-12-10 10:08:54 +01:00
Lina Ceballos 7953e36e82 Associating Copyright/ Licensing info through a DEP5 file 2020-12-10 10:07:19 +01:00
Lina Ceballos 9cea2777d4 Adding LICENSES directory and add licenses texts 2020-12-10 10:05:49 +01:00
Jędrzej Stuczyński 46d3591a4f Bugfix/explorer fixes (#477)
* Using original std::thread::spawn

* websocket client reconnection upon broken metrics
2020-12-02 16:49:22 +00:00
Jędrzej Stuczyński 5fc81db0d9 Feature/removed topology (#481)
* Explorer also downloading 'active' and 'removed' topologies

* Updated dashboard with new standby and removed nodes

* Additional cleanup + restored commented code
2020-12-02 16:48:02 +00:00
Jędrzej Stuczyński fbdca2dcd5 Network requester now prints correct version with --version (#478) 2020-12-02 16:43:56 +00:00
Jędrzej Stuczyński afb7825135 Feature/0.9.2+only monitoring (#475)
* Not testing or informing validator about pre 0.9.2 nodes

* Corrected version check

* Updated JS file to monitor 0.9.2+ nodes

* Restored updates every minute
2020-11-26 16:44:18 +00:00
Jędrzej Stuczyński c2a1ed855b Release/v0.9.2 (#474)
* Updated version numbers

* Updated changelog
2020-11-26 15:15:42 +00:00
Jędrzej Stuczyński 210b5466bb Minor mixnet client code simplification and optimization (#472)
* Minor code simplification and optimization

* Made the connection establishing call non-blocking
2020-11-26 13:06:05 +00:00
Jędrzej Stuczyński 33d5effbdc Putting initial packet onto the queue when establishing connection (#471) 2020-11-25 15:09:40 +00:00
jstuczyn fa5c512aa8 Same fixes for client 2020-11-24 12:05:33 +00:00
jstuczyn c1b2a9aaa7 Corrected error message 2020-11-24 11:57:44 +00:00
jstuczyn cdef90c2a4 Changelog update 2020-11-24 11:17:11 +00:00
jstuczyn 8e80651617 Updated version numbers 2020-11-24 11:11:47 +00:00
Jędrzej Stuczyński 80775b7436 Additional feedback on unregistration on sigint (#466) 2020-11-24 10:57:53 +00:00
Jędrzej Stuczyński 83dcd75cea Updated message on shutdown (#467) 2020-11-24 10:57:11 +00:00
Jędrzej Stuczyński d52ea90cd2 Feature/upgrade additions (#465)
* Mix 0.9.x upgrade support

* Gateway upgrade support

* Client 0.9.x upgrades
2020-11-24 10:56:45 +00:00
Jędrzej Stuczyński cb59153422 Feature/nonblocking mix send (#464)
* No backoff

* reconnections

* Increased default network monitor default sending rate

* Comment for the future

* Maximum connection buffer size as part of config
2020-11-23 17:27:14 +00:00
Jędrzej Stuczyński 89f03e63c7 Feature/delay queue mixnodes (#462)
* Initial idea for the delayer

* Initial rought integration into mixnode

* Removed lock requirement from 'received' metrics

* 'sent' metrics

* Comment fix
2020-11-20 14:49:22 +00:00
Dave Hrycyszyn 692f9cb198 Update README.md 2020-11-20 14:27:24 +00:00
Dave 455e735da4 Merge branch 'develop' of github.com:nymtech/nym into develop 2020-11-19 18:07:07 +00:00
Dave 4b34ed1f16 Adding the ulimit stuff to suggested service file. 2020-11-19 18:05:39 +00:00
Jędrzej Stuczyński 08cb39d0af Feature/slowed down network monitor (#461)
* Variable gateway sending rate

* Changed interval ticker to delay

* Extra comment

* Performing delay after test run

* Minor adjustements

* Decreased sending rate

* minor optimization in case of single packet to send.
2020-11-19 17:48:22 +00:00
Jędrzej Stuczyński 1d851c390c Feature/unregister command (#460)
* Unregister command for mixnode

* Unregister command for gateway

* cargo fmt
2020-11-18 17:16:12 +00:00
Jędrzej Stuczyński a69123ebc1 Simple gateway client reconnection in obvious network failures (#459) 2020-11-18 17:11:41 +00:00
Jędrzej Stuczyński e3e633fce4 temporarily disabled mixnode status dot (#454) 2020-11-16 10:24:43 +00:00
jstuczyn 09d053c557 Merge branch 'master' into develop 2020-11-13 12:51:33 +00:00
Jędrzej Stuczyński 3f86919d44 Removed incentives form url (#451) 2020-11-13 10:58:01 +00:00
Dave 4e7dbd93ed Merge branch 'develop' of github.com:nymtech/nym into develop 2020-11-13 10:37:51 +00:00
Dave 0944c127ac Adding graceful de-registration to service 2020-11-13 10:37:42 +00:00
Jędrzej Stuczyński 9cc28db732 Removed hardcoded 'good gateways' in favour of pseusorandom choice from the active set (#450) 2020-11-13 09:58:00 +00:00
Dave Hrycyszyn 21d27495f4 Fixed the URL of the websocket (#449) 2020-11-12 17:53:46 +00:00
Jędrzej Stuczyński 36ec2fef60 Extra argument to specify metrics websocket + long attribute (#448)
* Extra argument to specify metrics websocket + long attribute

* Default testnet values
2020-11-12 17:31:16 +00:00
Jędrzej Stuczyński 830a89cfd4 Explorer public folder being relative to the binary (#447)
* Explorer public folder being relative to the binary

* Qualifying the public mounting path

Co-authored-by: Dave <futurechimp@users.noreply.github.com>
2020-11-12 16:47:00 +00:00
Jędrzej Stuczyński c18766a617 Slightly friendlier upgrade argument description (#446)
* Slightly friendlier upgrade argument description

* Added right format examples
2020-11-12 15:21:33 +00:00
Jędrzej Stuczyński f1e61b16b1 Added validators to dashboard + validator and block count (#443) 2020-11-12 15:03:35 +00:00
Jędrzej Stuczyński 3a5ed57eff Adjusted 'fastmode' settings (#444) 2020-11-12 15:02:45 +00:00
Jędrzej Stuczyński a0b1e00321 Updated nym-run gateway id (#445) 2020-11-12 15:02:02 +00:00
Dave Hrycyszyn 652f39d86d Adding keybase to allowed.list.sample (#442) 2020-11-12 14:40:04 +00:00
Dave Hrycyszyn 3372d38b2d Changing default validator location to make it clear we're testnet (#437)
* Changing default validator location to make it clear we're on a testnet here.

* Updated validator url

* Updated metrics url

Co-authored-by: jstuczyn <jedrzej.stuczynski@gmail.com>
2020-11-12 11:52:37 +00:00
Jędrzej Stuczyński a3d9149d2a Update main.js (#441)
* Update main.js

* Changed websocket port to 1648
2020-11-12 11:07:15 +00:00
Jędrzej Stuczyński 6a2412f5dd Spawning rocket as a blocking task (#440) 2020-11-12 10:46:08 +00:00
Jędrzej Stuczyński 3ef40035ad Passing validator base url as an argument (#439) 2020-11-12 09:48:06 +00:00
Jędrzej Stuczyński 4da04978be Added nym prefix to binary names (#436) 2020-11-11 12:08:40 +00:00
Jędrzej Stuczyński 0649593116 Bugfix/metrics fixes (#434)
* Updated dashboard html file

* Changed explorer to listen on the same port as old dashboard

* Using correct field names in js file

* Sending correct key in metrics
2020-11-11 11:37:16 +00:00
Jędrzej Stuczyński 818405982d Feature/explorer (#431)
* Initial commit of the new dashboard code.

* Periodically grabbing topology json

* Pulling file saving out into its own module

* Ignoring downloaded topology file

* Moved everything public into a public folder

* Refreshing the mixmining report

* Mounting static files from /public

* Including mixminiming report grabber

* Leaving the route in place to pick up later. It's not used right now.

* Removing json download from git

* Ignoring topology download

* Moving recurrent jobs in to a jobs module

* Adding websocket dependencies

* Starting to get client/server websocket functionality running.

* Fixing unused imports

* Separating client and server functionality a bit more cleanly

* WIP to sketch out the ws client and server a bit more

* Initial metrics broadcaster

* Import fixup

* Spawning rocket in tokio task

* Removed outdated comment

* removed the js file

Co-authored-by: Dave <futurechimp@users.noreply.github.com>
2020-11-11 09:43:33 +00:00
Jędrzej Stuczyński 7976776399 Updated default sending rates (#430) 2020-11-10 16:05:09 +00:00
Jędrzej Stuczyński 69eefaf91f Fixed bunch of clippy warnings (#427) 2020-11-10 15:28:55 +00:00
Jędrzej Stuczyński 7d694194ca Starting cover traffic stream under correct condition (#422) 2020-11-10 13:00:38 +00:00
Jędrzej Stuczyński be49c3843a Feature/socks improvements (#423)
* Changed AvailableReader from Future to Stream

* comment formatting

* WIP

* Maximum number of bytes read per poll

* More detailed socks5 printing

* Split up socks5 service provider runner

* Fixed closing proxy too soon on one side

* Additional log information

* Printing connection id in log target

* Adjusted some constants

* Target field in log

* Removed dead code

* Decreased logging level

* Explicitly seperated 'Send' and 'Connect' request + data buffering

* Temporarily commented out test that fails due to not understanding limitations of tokio test io builder

* Fixed socks5 tests
2020-11-10 12:47:26 +00:00
Jędrzej Stuczyński bb04961b41 Bugfix/upgrade fix (#421)
* Added default for incentives address when deserializing

* Ability to optionally pass incentives address during upgrade
2020-11-09 16:47:23 +00:00
Jędrzej Stuczyński a91b2dcafc Updated validator topology (#420) 2020-11-06 16:58:32 +00:00
Jędrzej Stuczyński 7c04a10545 Added option to set incentives address during mix and gateway init (#419) 2020-11-05 17:15:39 +00:00
Jędrzej Stuczyński 7eaef53c62 Renamed 'sphinx-socks' to 'network-requester' (#417) 2020-11-05 12:39:02 +00:00
Jędrzej Stuczyński d6a191a9b1 Flag to start network requester in open proxy mode (#418) 2020-11-05 12:36:05 +00:00
Jędrzej Stuczyński 566eb87b83 Feature/network monitor file topology (#412)
* Network monitor loading 'good' topology from files instead

* Update .gitignore

* Passing address of validator as an argument

* Made detailed report const flag into an argument
2020-11-04 12:54:28 +00:00
Jędrzej Stuczyński e4c8a6b72b Updated upgrade commands to set new default validator (#413) 2020-11-04 12:53:25 +00:00
Jędrzej Stuczyński 9d9d530581 Removed debug print statement (#411) 2020-11-03 17:56:00 +00:00
Jędrzej Stuczyński 00b2ce18c8 Feature/controlled reinit (#410)
* Allowing init with existing id but keeps existing keys

* Removed unused imports
2020-11-03 14:58:47 +00:00
Jędrzej Stuczyński 72496ad2aa Feature/max retry (#409)
* Maximum number of allowed reconnection attempts

* Requiring initial internode connection to be successful

* Decreased logging level for failing to establish initial connection
2020-11-03 14:55:10 +00:00
Jędrzej Stuczyński d7985ef05d Renamed directory arguments to validator (#408) 2020-11-02 14:14:08 +00:00
Jędrzej Stuczyński 607297bf54 Feature/no run config flag (#405)
* Removed `--config` parameter in `run` commands

* Removed old tests that were doing disk IO
2020-10-30 16:28:39 +00:00
Jędrzej Stuczyński 7c65101609 Feature/error on noninit (#404)
* More graceful shutdown in case of uninitialised client/node

* Performing version check on binary `run`
2020-10-30 15:15:18 +00:00
Jędrzej Stuczyński 72e9fb1bc3 Using metrics interval received from server (#403)
* Using metrics interval received from server

* Test fix
2020-10-30 15:14:19 +00:00
Dave Hrycyszyn 4099701852 Feature/wasm client fix (#399)
* Disabling wasm optimization for the moment, it isn't working on my machine

* Updating the React example back to a working state, 0.8.1 npm package is published.

* Merging develop into bugfix

* Upgrading react-scripts to fix a major vulnerability
2020-10-30 13:35:44 +00:00
Jędrzej Stuczyński 0f0a428142 Feature/validator api update (#402)
* Updated validator API routes

* missing comment
2020-10-29 16:10:59 +00:00
Jędrzej Stuczyński 12584749c8 Feature/directory server transition (#401)
* Initial changes to validator client API

* Updated models

* GatewayRegistrationInfo constructor

* Change validator topology to convert into NymTopology without failure

* Mixnode registering and unregistering presence

* Directory -> Validator renamings + adjustments

* Updated upgrade command for mixnode

* Extracted metrics part of directory client into separate library

* Removed no longer needed traits

* Integrated new metrics client into mixnode

* Introduced the same set of changes to the gateway

* Getting active topology in client core via validator client

* Updated clients to get correct topology

* Introduced mix mining endpoints to validator client

* Network monitor using validator client

* Removed directory client

* Updated wasm client

* Temporarily disabled the test

* Checking ok status for validator client response

* Updated upgrade command for clients

* Allowing using old presence directory as new validator endpoint for mixnodes and gateways

* Fixed tests in non-default crates
2020-10-28 14:22:32 +00:00
Jędrzej Stuczyński e759db4ed4 moved new_v4_with_node to test only section (#392)
* moved new_v4_with_node to test only section

* cargo fmt
2020-10-26 19:17:24 +00:00
Ethan Frey 7064e85e5a Fix compiler warnings for unneeded mut (#398) 2020-10-26 19:16:39 +00:00
Jędrzej Stuczyński 495ca35c1f Explicitly handling base58 key recovery errors (#396) 2020-10-22 15:50:56 +01:00
Dave Hrycyszyn 3c07a690a2 Feature/fix dependabot alerts (#393)
* Fixing a dependabot alert

* Fixing npm audit failures in js example for webassembly client

* Fixed some more npm audit problems
2020-10-15 09:39:37 +01:00
Dave 7c808ae356 Merge branch 'develop' of github.com:nymtech/nym into develop 2020-10-14 18:15:24 +01:00
Dave e236b9f1af Moving subsidiary functions down below main so we can see where thing start 2020-10-14 18:15:16 +01:00
Jędrzej Stuczyński 2585efc540 Feature/duration cleanup (#391)
* Mixnode using Duration for time intervals + human readable config fields for them

* Removed old comment

* Native client using Duration for time intervals + human readable config fields for them

* Socks5 client using Duration for time intervals + human readable config fields for them

* Gateway using Duration for time intervals + human readable config fields for them

* Config compatibility with 0.8.0 debug values

* Fixed previous merge issue
2020-10-14 17:25:12 +01:00
Jędrzej Stuczyński d940bc8f31 Feature/double init prevention (#386)
* Updated NymConfig trait making id always obligatory. Also added extra default method implementations

* Preventing init on mixnodes that were initialised before

* Quotes before mix id

* Preventing init on gateways that were initialised before

* Preventing init on native clients that were initialised before

* Preventing init on socks5 clients that were initialised before
2020-10-14 13:30:57 +01:00
Jędrzej Stuczyński 2f7b3eec08 Feature/mix ed25519 identity (#388)
* Introduced identity keypair to mixnode

* Updated upgrade 0.9.0 mix upgrade instructions

* Printing failed upgrade notice when it failed

* Moved printing upgrade start notice to beginning of function
2020-10-14 13:28:20 +01:00
Jędrzej Stuczyński c8bf454ccc Feature/upgrade command (#381)
* Exposed version parsing from version checker

* Ability to upgrade mixnode from 0.8.X to 0.9.0

* Ability to upgrade gateway from 0.8.X to 0.9.0

* Ability to upgrade native client from 0.8.X to 0.9.0

* Ability to upgrade socks5 client from 0.8.X to 0.9.0

* Typo

* Minor renaming

* Preventing upgrade if current is not a release version

* Additional upgrade restrictions

* Corrected version bound
2020-10-14 10:36:10 +01:00
Dave Hrycyszyn e7bd27a2d0 Update README.md 2020-10-13 18:37:08 +01:00
Dave Hrycyszyn 174206ca36 Update README.md 2020-10-13 18:36:13 +01:00
Dave Hrycyszyn 366335a015 Feature/remove validator (#380)
* Replacing Rust validator sketch with Cosmos-based code.

* Removing old build instructions

* go fmt on generated code

* Removing build files for github and pi

* Starting transplant surgery

* Directory now running in validator, sans metrics

* Updating go sum

* A partly-working directory startup integrated into the nymcli app.

* Removing the Swagger docs header from nymcli, it can live in server.go

* Working swagger docs.

* Updating test title on Swagger docs

* Directory server now integrated into validator (primitive but working)

* Noted location of mixmining reports database.

* Bumped golang version

* Removing validator cargo files.

* Moving directory API init method into the nymd module

* Ditching a test which is causing tooling problems - presence will go away soon anyway

* Removing the validator and merging develop
2020-10-13 13:30:23 +01:00
Jędrzej Stuczyński 9c5cd54264 Corrected version on client-core (#377) 2020-10-12 16:35:59 +01:00
Jędrzej Stuczyński 1e35eeefaa Feature/version in config (#376)
* Added version field to config files

* Removed built dependency

* Missing non-removed call to built
2020-10-12 16:35:26 +01:00
Jędrzej Stuczyński c3a812b3cb Added sphinx socks to default workspace members (#358) 2020-10-12 10:13:06 +01:00
Jędrzej Stuczyński 124712a954 Feature/network monitor (#369)
* WIP commit

* Further into errors (WIP)

* WIP commit, more stuff compiling, but now we switch to sneaky Jedrzej trick

* Websocket connections starting to work

* WIP

* Constructing the socket stream in one go

* Nicer connections. Getting topology now works.

* Fixing startup message

* Injecting directory uri

* Injecting good mixndodes

* Deleting old healthcheck

* Starting to wrap gateway client

* Splitting out good topology contstruction

* Starting to breathe finally

* Fixed layer assignment error

* Starting gateway client in a better spot

* Cleanup

* Renamed construct() to new()

* Injected channels, removed websockets

* Added a MixnetListener to deal with returned packet traffic

* Simplification

* Renaming and commenting a few things

* Renamed temp variables

* Fixed variable names

* Made errors a bit more explicit on message reconstruction

* Added the mixmining route / object to the directory server client

* Recipient is always "me", a bit easier to understand what's going on

* Subbing in test nodes works

* Using QA directory

* Noting which directory server we're using at monitor start

* Adding Debug to MixStatus so we can print it more easily

* Prettification of startup messages

* Notifying directory of successful packet receipt

* All nodes now being tested

* Now able to do timer-based test runs and detect the last node tested

* Renamed mixnet_listener to notifier

* Moved message chunking into its own home

* Starting to pull out packet sends

* Basic functionality working!

* Enabled timer runs forever

* License notices

* Depdendency cleanup

* Import cleanup

* Moved to implicit tokio runtime

* Removed some unnecessary data clones

* Fixed monitor doing two runs at startup rather than one

* dalek version updates

* This should have been split but got carried away

* Initial ipv6 support

* Don't test outdated nodes

* Added network monitor to default workspace members

* Actually sending reports

* Batch-sending mix status

* Cargo fmt

* Minor cleanup

* Malformed Cargo.lock

* Post-merge fixes

* Defined constant in main.rs for enabling detailed reporting

* Updated package versions of the system

* Checking version compatibility on startup

Co-authored-by: Dave Hrycyszyn <futurechimp@users.noreply.github.com>
2020-10-09 16:00:19 +01:00
Jędrzej Stuczyński 4f6b2aea19 Feature/instant sending (#359)
* Ability to set client in vpn mode

* Connection handler for mixnode

* Initial vpn mode for mixes

* Updated SphinxCodec to contain more metadata

* Renaming

* Removed handle from mixnet client and introduced forwarder

* Mixnode using new forwarder

* Mixnode common module containing shared packet processing

* ibid. incorporated inside mixnode

* New processing for gateway

* Type cleanup

* Wasm fix

* Fixed client config

* Fixed mixnode runtime issues

* Formatting

* Client re-using secret on 'normal' packets

* Using the same key for acks

* WIP

* vpn key manager cleanup

* wasm fix

* VPN_KEY_REUSE_LIMIT moved to config

* Moved AckDelayQueue to separate common crate

* Key cache invalidator

* Updated dashmap used in gateway

* Old typo

* Additional comment

* Cargo fmt

* Fixed tests

* Sphinx update

* cache ttl as config option

* Cargo fmt
2020-09-30 17:30:17 +01:00
Jedrzej Stuczynski ebea0166f1 Merge branch 'master' into develop 2020-09-28 17:21:36 +01:00
jstuczyn 689c4fc66c Updated wasm publishing instructions 2020-09-16 15:32:31 +01:00
Jędrzej Stuczyński c50e9a9ed7 Feature/wasm update (#341)
* Split text and binary client apis

* Very initial attempt at new serialization

* Defined ser+de for Recipient and ReplySURB

* Response errors

* builds with changes

* Working WS API + moved to separate crate

* updated python examples

* Fixed parsing bug

* Updated go examples

* Updated rust examples

* formatting

* Removed unused imports

* dependency updates

* Further dependency changes

* nymsphinx exposingn framing only if not in wasm32

* Cargo lock changes before develop merge

* Pending work

* Actually sending and receiving websocket from rust!

* more WIP

* Initial wasm client + establishing shared key with gateway!

* Splitting and sending a message!

* WIP

* WIP

* Initial wasm-ification of the gateway client

* Passing reconstruction result to js callback!

* Initial WASM cleaning pass

* Dependency pruning

* Moved processing loop to received_processor + at least ack unwrappingn

* Post merge fix

* Kinda updated react example

* Old print statement removed

* Removed yarn.lock

* Fixed building issue for other clients

* Fixed travis test command
2020-09-16 15:18:04 +01:00
Jedrzej Stuczynski 23edeefcdc Merge tag 'v0.8.0' into develop
Release v0.8.0
2020-09-10 14:17:29 +01:00
1004 changed files with 234104 additions and 37224 deletions
+3
View File
@@ -1,2 +1,5 @@
// Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
RUST_LOG=info
RUST_BACKTRACE=1
+40
View File
@@ -0,0 +1,40 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# More details are here: https://help.github.com/articles/about-codeowners/
# The '*' pattern is global owners.
# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:
# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
# Something weird not covered by anything else
* @futurechimp @mmsinclair
# Rust rules:
*.rs @durch @futurechimp @jstuczyn @neacsu
Cargo.* @durch @futurechimp @jstuczyn @neacsu
# JS rules:
*.js @mmsinclair @fmtabbara @Aid19801
*.ts @mmsinclair @fmtabbara @Aid19801
*.tsx @mmsinclair @fmtabbara @Aid19801
*.jsx @mmsinclair @fmtabbara @Aid19801
# Something looking like possible documentation rules:
*.md @mfahampshire
# our docker scripts
/docker/ @neacsu
# if there are any changes in the core crypto, I feel like Ania should take a look:
/common/crypto/ @aniampio
/common/nymsphinx/ @aniampio
# Explorer and wallet should probably get looked by the product team
/explorer/ @nymtech/product
/nym-wallet/ @nymtech/product
/wallet-web/ @nymtech/product
+32
View File
@@ -0,0 +1,32 @@
---
name: Feature request
about: Suggest an enhancement to the product
title: "[Feature Request]"
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is...
**Is your request a feature not related to an existing problem? A new feature.**
For example.
- Given I am using the nym wallet
- When I transfer nym tokens across the network
- Then I want to have an url link in the wallet which navigates outside the application to the nym-explorer
**Where does the feature fit in the Nym real estate?**
- Application / UI
**What is this solving?**
How will this improve the product...
**Is this an update to packages or libraries?**
If so, please list them. If not, please ignore this section.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+43
View File
@@ -0,0 +1,43 @@
---
name: Report
about: To help identify and reproduce issues
title: "[Issue]"
labels: bug, bug-needs-triage, qa
assignees: tommyv1987
---
**Describe the issue**
A clear and concise description of what the issue is...
**Expected behaviour**
A clear and concise description of what you expected to happen...
**Stack Traces**
If there are stack traces or logs, please provide them here...
**Steps to Reproduce**
Steps to reproduce the behaviour, if you're familiar with BDD syntax, please write it in this style:
- Given I was doing X
- And I installed Y
- When I actioned Y
- Then I expect Z
*An example:*
- Given I was setting up a mix-node following the instructions in the docs
- And I successfully bonded my node via the the wallet
- When I went to start my mixnode
- Then I was presented with an error
**Screenshots**
If applicable, add screenshots to help explain your problem...
**Which area of Nym were you using?**
- UI: [e.g. Websites - network-explorer, nym-website]
- Application: [e.g Gateway, Client, Wallet]
- OS: [e.g. Ubuntu 20.x, MacOs Big Sur, Windows 10]
- Browser: [e.g Chrome (if applicable)]
- Version: [e.g. nym binary(0.11.0), browser(94.0)]
**Additional context**
Please provide any other information
+102
View File
@@ -0,0 +1,102 @@
name: Continuous integration
on:
push:
paths-ignore:
- 'explorer/**'
pull_request:
paths-ignore:
- 'explorer/**'
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
# creates the matrix strategy from build_matrix_includes.json
- uses: actions/checkout@v2
- id: set-matrix
uses: JoshuaTheMiller/conditional-build-matrix@main
with:
inputFile: '.github/workflows/build_matrix_includes.json'
filter: '[?runOnEvent==`${{ github.event_name }}` || runOnEvent==`always`]'
build:
needs: matrix_prep
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.os == 'windows-latest' }}
steps:
- name: Install Dependencies (Linux)
run: sudo apt-get update && sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools
if: matrix.os == 'ubuntu-latest'
- name: Check out repository code
uses: actions/checkout@v2
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
- name: Build all binaries
uses: actions-rs/cargo@v1
with:
command: build
args: --all
- name: Run all tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
name: Clippy checks
# if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- name: Run clippy
uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'nightly' }}
with:
command: clippy
args: -- -D warnings
# COCONUT stuff
- name: Reclaim some disk space (because Windows is being annoying)
uses: actions-rs/cargo@v1
if: ${{ matrix.os == 'windows-latest' }}
with:
command: clean
- name: Build all binaries with coconut enabled
uses: actions-rs/cargo@v1
with:
command: build
args: --all --features=coconut
- name: Run all tests with coconut enabled
uses: actions-rs/cargo@v1
with:
command: test
args: --all --features=coconut
- name: Run clippy with coconut enabled
uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'nightly' }}
with:
command: clippy
args: --features=coconut -- -D warnings
@@ -0,0 +1,50 @@
[
{
"os":"ubuntu-latest",
"rust":"stable",
"runOnEvent":"always"
},
{
"os":"windows-latest",
"rust":"stable",
"runOnEvent":"pull_request"
},
{
"os":"macos-latest",
"rust":"stable",
"runOnEvent":"pull_request"
},
{
"os":"ubuntu-latest",
"rust":"beta",
"runOnEvent":"pull_request"
},
{
"os":"windows-latest",
"rust":"beta",
"runOnEvent":"pull_request"
},
{
"os":"macos-latest",
"rust":"beta",
"runOnEvent":"pull_request"
},
{
"os":"ubuntu-latest",
"rust":"nightly",
"runOnEvent":"pull_request"
},
{
"os":"windows-latest",
"rust":"nightly",
"runOnEvent":"pull_request"
},
{
"os":"macos-latest",
"rust":"nightly",
"runOnEvent":"pull_request"
}
]
@@ -0,0 +1,14 @@
[
{
"rust":"stable",
"runOnEvent":"always"
},
{
"rust":"beta",
"runOnEvent":"pull_request"
},
{
"rust":"nightly",
"runOnEvent":"pull_request"
}
]
@@ -0,0 +1,58 @@
name: ERC20 Bridge Contract
on: [ push, pull_request ]
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
# creates the matrix strategy from build_matrix_includes.json
- uses: actions/checkout@v2
- id: set-matrix
uses: JoshuaTheMiller/conditional-build-matrix@main
with:
inputFile: '.github/workflows/contract_matrix_includes.json'
filter: '[?runOnEvent==`${{ github.event_name }}` || runOnEvent==`always`]'
erc20-bridge-contract:
needs: matrix_prep
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
# since it's going to be compiled into wasm, there's absolutely
# no point in running CI on different OS-es
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '-C link-arg=-s'
with:
command: build
args: --manifest-path contracts/erc20-bridge/Cargo.toml --target wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path contracts/erc20-bridge/Cargo.toml
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path contracts/erc20-bridge/Cargo.toml -- --check
- uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'nightly' }}
with:
command: clippy
args: --manifest-path contracts/erc20-bridge/Cargo.toml -- -D warnings
+64
View File
@@ -0,0 +1,64 @@
name: Mixnet Contract
on:
push:
paths-ignore:
- 'explorer/**'
pull_request:
paths-ignore:
- 'explorer/**'
jobs:
matrix_prep:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
# creates the matrix strategy from build_matrix_includes.json
- uses: actions/checkout@v2
- id: set-matrix
uses: JoshuaTheMiller/conditional-build-matrix@main
with:
inputFile: '.github/workflows/contract_matrix_includes.json'
filter: '[?runOnEvent==`${{ github.event_name }}` || runOnEvent==`always`]'
mixnet-contract:
# since it's going to be compiled into wasm, there's absolutely
# no point in running CI on different OS-es
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.rust == 'nightly' }}
needs: matrix_prep
strategy:
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '-C link-arg=-s'
with:
command: build
args: --manifest-path contracts/mixnet/Cargo.toml --target wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path contracts/mixnet/Cargo.toml
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path contracts/mixnet/Cargo.toml -- --check
- uses: actions-rs/cargo@v1
if: ${{ matrix.rust != 'nightly' }}
with:
command: clippy
args: --manifest-path contracts/mixnet/Cargo.toml -- -D warnings
@@ -0,0 +1,23 @@
name: Linting for Network Explorer (eslint/prettier)
on:
pull_request:
paths:
- 'explorer/**'
defaults:
run:
working-directory: explorer
jobs:
build:
runs-on: custom-runner-linux
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- name: Run ESLint
# GitHub should automatically annotate the PR
run: npm run lint
+57
View File
@@ -0,0 +1,57 @@
name: CI for Network Explorer
on:
push:
paths:
- 'explorer/**'
defaults:
run:
working-directory: explorer
jobs:
build:
runs-on: custom-runner-linux
steps:
- uses: actions/checkout@v2
- name: Install rsync
run: sudo apt-get install rsync
- uses: rlespinasse/github-slug-action@v3.x
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
continue-on-error: true
- run: npm run test
continue-on-error: true
- run: npm run build
continue-on-error: true
- name: Deploy branch to CI www
continue-on-error: true
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.CI_WWW_SSH_PRIVATE_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "explorer/dist/"
REMOTE_HOST: ${{ secrets.CI_WWW_REMOTE_HOST }}
REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }}
TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/network-explorer-${{ env.GITHUB_REF_SLUG }}
EXCLUDE: "/dist/, /node_modules/"
- name: Keybase - Node Install
run: npm install
working-directory: .github/workflows/support-files/messages
- name: Keybase - Send Notification
env:
NYM_PROJECT_NAME: "Network Explorer"
NYM_CI_WWW_BASE: "${{ secrets.NYM_CI_WWW_BASE }}"
NYM_CI_WWW_LOCATION: "network-explorer-${{ env.GITHUB_REF_SLUG }}"
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
GIT_BRANCH: "${GITHUB_REF##*/}"
KEYBASE_NYMBOT_USERNAME: "${{ secrets.KEYBASE_NYMBOT_USERNAME }}"
KEYBASE_NYMBOT_PAPERKEY: "${{ secrets.KEYBASE_NYMBOT_PAPERKEY }}"
KEYBASE_NYMBOT_TEAM: "${{ secrets.KEYBASE_NYMBOT_TEAM }}"
KEYBASE_NYM_CHANNEL: "ci-network-explorer"
IS_SUCCESS: "${{ job.status == 'success' }}"
uses: docker://keybaseio/client:stable-node
with:
args: .github/workflows/support-files/messages/entry_point_notifications.sh
+77
View File
@@ -0,0 +1,77 @@
name: Webdriverio tests for nym wallet
on:
push:
paths:
- "nym-wallet/**"
defaults:
run:
working-directory: nym-wallet
jobs:
test:
name: wallet tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Tauri dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y
libgtk-3-dev
libgtksourceview-3.0-dev
webkit2gtk-4.0
libappindicator3-dev
webkit2gtk-driver
xvfb
- name: Install minimal stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Node v16
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install yarn for building application
run: yarn install
- name: Build application
run: yarn run webpack:build & yarn run tauri:build
- name: Check binary exists
run: |
cd target/release/
(test -f nym-wallet && echo nym binary exists) || echo wallet does not exist
- name: Install dependencies
run: yarn install
working-directory: nym-wallet/webdriver
- name: Remove existing user datafile
uses: JesseTG/rm@v1.0.2
with:
path: nym-wallet/webdriver/common/data/user-data.json
- name: Create user data json file
id: create-json
uses: jsdaniell/create-json@1.1.2
with:
name: "user-data.json"
json: ${{ secrets.WALLET_USERDATA }}
dir: "nym-wallet/webdriver/common/data/"
- name: Install tauri-driver
uses: actions-rs/cargo@v1
with:
command: install
args: tauri-driver
- name: Launch tests
run: xvfb-run yarn test:runall
working-directory: nym-wallet/webdriver
@@ -0,0 +1,2 @@
node_modules
.idea
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# pass exit codes out to GitHub Actions
set -euxo pipefail
# change to the directory that contains this script
cd "${0%/*}"
# run the node script
node send_message.js
@@ -0,0 +1,11 @@
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
> :rocket: {{ env.NYM_PROJECT_NAME }}
> 🔴 **FAILURE** :cry:
> `branch` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/tree/{{ env.GIT_BRANCH_NAME }}
> `commit` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/commit/{{ env.GITHUB_SHA }}
> `build ` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}
Commit message:
```
{{ env.GIT_COMMIT_MESSAGE }}
```
@@ -0,0 +1,16 @@
{
"name": "send-keybase-message",
"description": "Sends a notification message with the keybase package that fails when piped into the keybase CLI",
"version": "1.0.0",
"private": true,
"scripts": {
"format": "prettier --write send_message.js"
},
"dependencies": {
"handlebars": "^4.7.7",
"keybase-bot": "^3.6.1"
},
"devDependencies": {
"prettier": "2.3.2"
}
}
@@ -0,0 +1,69 @@
const Bot = require('keybase-bot');
const Handlebars = require('handlebars');
const fs = require('fs');
async function main() {
const data = { env: process.env };
// const data = { ...PASTE TEST DATA HERE ... }; // -- DEV: uncomment to set test data
// validation of environment
if(!(process.env.NYM_PROJECT_NAME || data.env.NYM_PROJECT_NAME)) {
throw new Error('Please set env var NYM_PROJECT_NAME with the project name for displaying in notification messages');
}
const keybaseChannel = process.env.KEYBASE_NYM_CHANNEL || data.env.KEYBASE_NYM_CHANNEL;
if(!keybaseChannel) {
throw new Error('Please set env var KEYBASE_NYM_CHANNEL with the channel name for the notification message');
}
// extract the git branch name
const GIT_BRANCH_NAME = (process.env.GITHUB_REF || data.env.GITHUB_REF).split('/').slice(2).join('/');
data.env.GIT_BRANCH_NAME = GIT_BRANCH_NAME;
const source = fs
.readFileSync(process.env.IS_SUCCESS === 'true' ? 'success' : 'failure')
.toString();
const template = Handlebars.compile(source);
const result = template(data);
// -- DEV: uncomment to show what is available in the handlebars template / show the result
// console.dir({ data }, { depth: null });
// console.log(result);
const bot = new Bot();
try {
const username = process.env.KEYBASE_NYMBOT_USERNAME;
const paperkey = process.env.KEYBASE_NYMBOT_PAPERKEY;
if(!username) {
throw new Error('Username is not defined. Please set env var KEYBASE_NYMBOT_USERNAME');
}
if(!paperkey) {
throw new Error('Paperkey is not defined. Please set env var KEYBASE_NYMBOT_PAPERKEY');
}
console.log(`Initialising keybase with user "${username}" and key: "${'*'.repeat(paperkey.length)}"...`);
await bot.init(username, paperkey, { verbose: false });
const channel = {
name: 'nymtech_bot',
membersType: 'team',
topicName: keybaseChannel,
topic_type: 'CHAT',
};
const message = {
body: result,
};
console.log(`Sending to ${channel.name}#${channel.topicName}...`);
await bot.chat.send(channel, message);
console.log('Message sent!');
} catch (error) {
console.error(error);
process.exitCode = -1;
} finally {
await bot.deinit();
}
}
main();
@@ -0,0 +1,11 @@
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
> :rocket: {{ env.NYM_PROJECT_NAME }} ➡️➡️➡️➡️➡️ **View output:** https://{{ env.NYM_CI_WWW_LOCATION }}.{{ env.NYM_CI_WWW_BASE }}/
> ✅ **SUCCESS**
> `branch` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/tree/{{ env.GIT_BRANCH_NAME }}
> `commit` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/commit/{{ env.GITHUB_SHA }}
> `build ` {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}
Commit message:
```
{{ env.GIT_COMMIT_MESSAGE }}
```
@@ -0,0 +1,12 @@
name: Publish Tauri Wallet
on:
push:
tags:
- nym-wallet-*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Run a one-line script
run: echo Hello, world!
+29
View File
@@ -0,0 +1,29 @@
name: Generate TS types
on:
push:
paths-ignore:
- "explorer/**"
pull_request:
paths-ignore:
- "explorer/**"
jobs:
nym-wallet-types:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Prepare
run: sudo apt-get update && sudo apt-get install -y libpango1.0-dev libatk1.0-dev libgdk-pixbuf2.0-dev libsoup2.4-dev librust-gdk-dev libwebkit2gtk-4.0-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Generate TS
run: cd nym-wallet/src-tauri && cargo test
- uses: EndBug/add-and-commit@v7.2.1 # https://github.com/marketplace/actions/add-commit
with:
add: '["nym-wallet"]'
message: "[ci skip] Generate TS types"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+48
View File
@@ -0,0 +1,48 @@
name: Wasm Client
on:
pull_request:
paths-ignore:
- 'explorer/**'
jobs:
wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
components: rustfmt, clippy
# token credentials (non-coconut) don't work for wasm right now
# - uses: actions-rs/cargo@v1
# with:
# command: build
# args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown --features=coconut
# for some reason this does not seem to work correctly, leave it for later, building is good enough for now
# - uses: actions-rs/cargo@v1
# with:
# command: test
# args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path clients/webassembly/Cargo.toml -- --check
# for some reason this does not seem to work correctly, leave it for later, building is good enough for now
# - uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: --manifest-path clients/webassembly/Cargo.toml --target wasm32-unknown-unknown -- -D warnings
+13 -1
View File
@@ -1,3 +1,6 @@
// Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: CC0-1.0
/targetString
**/*.rs.bk
/*/target
@@ -8,7 +11,6 @@ target
/.vscode/settings.json
validator/.vscode
sample-configs/validator-config.toml
.vscode
scripts/deploy_qa.sh
scripts/run_gate.sh
scripts/run_mix.sh
@@ -22,3 +24,13 @@ v6-topology.json
/explorer/downloads/topology.json
/explorer/public/downloads/mixmining.json
/explorer/public/downloads/topology.json
/clients/validator/examples/nym-driver-example/current-contract.txt
validator-api/v4.json
validator-api/v6.json
**/node_modules
validator-api/keypair
contracts/mixnet/code_id
contracts/mixnet/Justfile
contracts/mixnet/Makefile
validator-config
*.patch
+9
View File
@@ -0,0 +1,9 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: nym
Upstream-Contact: Nym Technologies SA <contact@nymtech.net>
Source: https://github.com/nymtech/nym
Files: *clients/* *common/* *explorer/*
Copyright: 2020, Nym Technologies SA <contact@nymtech.net>
License: Apache-2.0
-15
View File
@@ -1,15 +0,0 @@
language: rust
rust:
- stable
- beta
- nightly
jobs:
allow_failures:
- rust: nightly
fast_finish: true
before_script:
- rustup component add rustfmt
script:
- cargo build
- cargo test --all
- cargo fmt -- --check
+359 -49
View File
@@ -1,39 +1,295 @@
# Changelog
## [v0.9.0](https://github.com/nymtech/nym/tree/v0.9.0) (2020-11-13)
## [v0.11.0](https://github.com/nymtech/nym/tree/v0.11.0) (2021-07-21)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.8.1...v0.9.0)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.10.1...v0.11.0)
**Implemented enhancements:**
- Investigate why --clients-host and --mix-host are distinct for gateways [\#435](https://github.com/nymtech/nym/issues/435)
- Bugfix/verloc fixes and adjustments [\#618](https://github.com/nymtech/nym/pull/618) ([jstuczyn](https://github.com/jstuczyn))
**Fixed bugs:**
- Update the metrics endpoint [\#597](https://github.com/nymtech/nym/issues/597)
- Intercontinental problems [\#143](https://github.com/nymtech/nym/issues/143)
**Closed issues:**
- Rename `PagedResponse` into `PagedMixnodeResponse` [\#657](https://github.com/nymtech/nym/issues/657)
- Change `u64` layer type in contract code [\#648](https://github.com/nymtech/nym/issues/648)
- Change `String` types of sphinx and identity keys in contract code [\#647](https://github.com/nymtech/nym/issues/647)
- Remove the terrible `decimal_sub_one` once we update contract/validators [\#639](https://github.com/nymtech/nym/issues/639)
- After update failed to receive reply to our echo packet within 1.5s. Stopping the test [\#621](https://github.com/nymtech/nym/issues/621)
- update to v0.10.1, it show ERROR message "failed to receive reply to our echo packet within 1.5s" [\#620](https://github.com/nymtech/nym/issues/620)
- Make validator client send as much tokens for bonding as required [\#614](https://github.com/nymtech/nym/issues/614)
- Update mixnode `init` to not query for entire topology [\#610](https://github.com/nymtech/nym/issues/610)
- Potentially extend metrics with number of dropped packets [\#595](https://github.com/nymtech/nym/issues/595)
- Delegated staking for gateways [\#579](https://github.com/nymtech/nym/issues/579)
- Delegated staking for mixnodes [\#578](https://github.com/nymtech/nym/issues/578)
- Improved mixnode and gateway info [\#577](https://github.com/nymtech/nym/issues/577)
- Gateway bonding [\#576](https://github.com/nymtech/nym/issues/576)
- No graceful degradation on low traffic [\#513](https://github.com/nymtech/nym/issues/513)
- Network monitor should not update when 0 packets come back [\#456](https://github.com/nymtech/nym/issues/456)
- Add mixnode statistics endpoint [\#406](https://github.com/nymtech/nym/issues/406)
**Merged pull requests:**
- Return the vec instead of the cache wrapper for topology [\#695](https://github.com/nymtech/nym/pull/695) ([neacsu](https://github.com/neacsu))
- Updated sign command [\#694](https://github.com/nymtech/nym/pull/694) ([jstuczyn](https://github.com/jstuczyn))
- got rid of denomination error in webwallet bonding interface [\#691](https://github.com/nymtech/nym/pull/691) ([mfahampshire](https://github.com/mfahampshire))
- Docker testing env [\#687](https://github.com/nymtech/nym/pull/687) ([neacsu](https://github.com/neacsu))
- Changed Layer serde behaviour for easier usage [\#686](https://github.com/nymtech/nym/pull/686) ([jstuczyn](https://github.com/jstuczyn))
- Merge the nym-wallet-web repo into a nym directory [\#684](https://github.com/nymtech/nym/pull/684) ([neacsu](https://github.com/neacsu))
- Temporarily using non-cached gateways so we can get our next version … [\#683](https://github.com/nymtech/nym/pull/683) ([futurechimp](https://github.com/futurechimp))
- Updating wallet URL in mixnode startup output [\#682](https://github.com/nymtech/nym/pull/682) ([futurechimp](https://github.com/futurechimp))
- Feature/node status api [\#680](https://github.com/nymtech/nym/pull/680) ([jstuczyn](https://github.com/jstuczyn))
- Using specific commit of rocket cors [\#678](https://github.com/nymtech/nym/pull/678) ([jstuczyn](https://github.com/jstuczyn))
- Disables nightly clippy CI [\#677](https://github.com/nymtech/nym/pull/677) ([jstuczyn](https://github.com/jstuczyn))
- Minimize read/write cache contention [\#676](https://github.com/nymtech/nym/pull/676) ([durch](https://github.com/durch))
- Feature/validator client upgrade [\#675](https://github.com/nymtech/nym/pull/675) ([futurechimp](https://github.com/futurechimp))
- Use cached topology for clients [\#674](https://github.com/nymtech/nym/pull/674) ([neacsu](https://github.com/neacsu))
- Use rocket 0.5-rc1, remove rocket-contrib [\#672](https://github.com/nymtech/nym/pull/672) ([durch](https://github.com/durch))
- Feature/validator api config [\#671](https://github.com/nymtech/nym/pull/671) ([jstuczyn](https://github.com/jstuczyn))
- Fix a dependabot nag [\#670](https://github.com/nymtech/nym/pull/670) ([durch](https://github.com/durch))
- Removed standalone network-monitor [\#669](https://github.com/nymtech/nym/pull/669) ([jstuczyn](https://github.com/jstuczyn))
- Remove mut where possible, parallel cache requests [\#668](https://github.com/nymtech/nym/pull/668) ([durch](https://github.com/durch))
- Rework validator client requests [\#667](https://github.com/nymtech/nym/pull/667) ([durch](https://github.com/durch))
- Generalize cache, and cache gateways [\#666](https://github.com/nymtech/nym/pull/666) ([durch](https://github.com/durch))
- Validator API server [\#665](https://github.com/nymtech/nym/pull/665) ([durch](https://github.com/durch))
- Layer selection [\#664](https://github.com/nymtech/nym/pull/664) ([neacsu](https://github.com/neacsu))
- Removing validator binaries, these should go into Github releases [\#663](https://github.com/nymtech/nym/pull/663) ([futurechimp](https://github.com/futurechimp))
- Rename network-monitor [\#662](https://github.com/nymtech/nym/pull/662) ([durch](https://github.com/durch))
- Adds @neacsu as code owner [\#661](https://github.com/nymtech/nym/pull/661) ([jstuczyn](https://github.com/jstuczyn))
- Feature/total delegation field [\#660](https://github.com/nymtech/nym/pull/660) ([jstuczyn](https://github.com/jstuczyn))
- contracts: Removed mixnode location from the bonding process [\#659](https://github.com/nymtech/nym/pull/659) ([neacsu](https://github.com/neacsu))
- Use thiserror for validator-client [\#658](https://github.com/nymtech/nym/pull/658) ([durch](https://github.com/durch))
- Feature/configurable verloc http ports [\#656](https://github.com/nymtech/nym/pull/656) ([jstuczyn](https://github.com/jstuczyn))
- Feature/describe location [\#655](https://github.com/nymtech/nym/pull/655) ([neacsu](https://github.com/neacsu))
- Feature/host ip split [\#654](https://github.com/nymtech/nym/pull/654) ([jstuczyn](https://github.com/jstuczyn))
- Feature/cosmwasm 0.14.1 update [\#653](https://github.com/nymtech/nym/pull/653) ([jstuczyn](https://github.com/jstuczyn))
- Allow passing optional explicit bond value [\#652](https://github.com/nymtech/nym/pull/652) ([jstuczyn](https://github.com/jstuczyn))
- Introduced type aliases for mixnode and gateway keys [\#650](https://github.com/nymtech/nym/pull/650) ([jstuczyn](https://github.com/jstuczyn))
- Bugfix/delegation type fixes [\#649](https://github.com/nymtech/nym/pull/649) ([jstuczyn](https://github.com/jstuczyn))
- Removing the ancient explorer in preparation for a new dawn. [\#645](https://github.com/nymtech/nym/pull/645) ([futurechimp](https://github.com/futurechimp))
- Testing code owners again [\#644](https://github.com/nymtech/nym/pull/644) ([futurechimp](https://github.com/futurechimp))
- TypeScript client v0.12.0 [\#641](https://github.com/nymtech/nym/pull/641) ([jstuczyn](https://github.com/jstuczyn))
- Feature/reverse contract mapping [\#640](https://github.com/nymtech/nym/pull/640) ([jstuczyn](https://github.com/jstuczyn))
- Bump websockets from 8.1 to 9.1 in /clients/native/examples/python-examples/websocket [\#638](https://github.com/nymtech/nym/pull/638) ([dependabot[bot]](https://github.com/apps/dependabot))
- Chore/clippy nightly fixes [\#636](https://github.com/nymtech/nym/pull/636) ([jstuczyn](https://github.com/jstuczyn))
- Feature/delegated staking [\#635](https://github.com/nymtech/nym/pull/635) ([jstuczyn](https://github.com/jstuczyn))
- Bump ws from 6.2.1 to 6.2.2 in /clients/validator [\#634](https://github.com/nymtech/nym/pull/634) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ws from 6.2.1 to 6.2.2 in /clients/native/examples/js-examples/websocket [\#633](https://github.com/nymtech/nym/pull/633) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ws from 6.2.1 to 6.2.2 in /clients/webassembly/js-example [\#632](https://github.com/nymtech/nym/pull/632) ([dependabot[bot]](https://github.com/apps/dependabot))
- Feature/stats endpoint [\#631](https://github.com/nymtech/nym/pull/631) ([jstuczyn](https://github.com/jstuczyn))
- Updated all js related dependencies [\#629](https://github.com/nymtech/nym/pull/629) ([jstuczyn](https://github.com/jstuczyn))
- Feature/per layer count [\#628](https://github.com/nymtech/nym/pull/628) ([jstuczyn](https://github.com/jstuczyn))
- Changed rewarding behaviour on not found bonds [\#627](https://github.com/nymtech/nym/pull/627) ([jstuczyn](https://github.com/jstuczyn))
- Bump dns-packet from 1.3.1 to 1.3.4 in /clients/native/examples/js-examples/websocket [\#626](https://github.com/nymtech/nym/pull/626) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump dns-packet from 1.3.1 to 1.3.4 in /clients/webassembly/js-example [\#625](https://github.com/nymtech/nym/pull/625) ([dependabot[bot]](https://github.com/apps/dependabot))
- Feature/update validator binaries [\#624](https://github.com/nymtech/nym/pull/624) ([jstuczyn](https://github.com/jstuczyn))
- Checking for required bond rather than using hardcoded value [\#623](https://github.com/nymtech/nym/pull/623) ([jstuczyn](https://github.com/jstuczyn))
- Bump browserslist from 4.14.1 to 4.16.6 in /clients/native/examples/js-examples/websocket [\#619](https://github.com/nymtech/nym/pull/619) ([dependabot[bot]](https://github.com/apps/dependabot))
- Changed omitted print to a debug call [\#617](https://github.com/nymtech/nym/pull/617) ([jstuczyn](https://github.com/jstuczyn))
## [v0.10.1](https://github.com/nymtech/nym/tree/v0.10.1) (2021-05-25)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.10.0...v0.10.1)
**Closed issues:**
- Prometheus metrics doesn't work [\#606](https://github.com/nymtech/nym/issues/606)
- Bonding hostname vs. ip-address does not show up on NYM explorer [\#593](https://github.com/nymtech/nym/issues/593)
- Cannot assign requested address [\#584](https://github.com/nymtech/nym/issues/584)
- Native client upgrade command is broken [\#582](https://github.com/nymtech/nym/issues/582)
- Spread directory requests across good validators [\#580](https://github.com/nymtech/nym/issues/580)
- Change network monitor to use currency-based rewareds [\#540](https://github.com/nymtech/nym/issues/540)
- Unregistration for protocol ipv6 does not work [\#511](https://github.com/nymtech/nym/issues/511)
- Network monitor view on validators [\#373](https://github.com/nymtech/nym/issues/373)
**Merged pull requests:**
- Bugfix/unique node ownership [\#612](https://github.com/nymtech/nym/pull/612) ([jstuczyn](https://github.com/jstuczyn))
- Decreased log severity for verloc-related functionalities [\#611](https://github.com/nymtech/nym/pull/611) ([jstuczyn](https://github.com/jstuczyn))
- Disabled metrics reporting to the central server [\#609](https://github.com/nymtech/nym/pull/609) ([jstuczyn](https://github.com/jstuczyn))
- Feature/network monitor gateway pings [\#608](https://github.com/nymtech/nym/pull/608) ([jstuczyn](https://github.com/jstuczyn))
- Implemented display traits for identity and encryption keys [\#607](https://github.com/nymtech/nym/pull/607) ([jstuczyn](https://github.com/jstuczyn))
- Feature/add node description api [\#605](https://github.com/nymtech/nym/pull/605) ([futurechimp](https://github.com/futurechimp))
- Feature/updated network monitor [\#604](https://github.com/nymtech/nym/pull/604) ([jstuczyn](https://github.com/jstuczyn))
- Feature/ping timings [\#603](https://github.com/nymtech/nym/pull/603) ([jstuczyn](https://github.com/jstuczyn))
- Bump lodash from 4.17.20 to 4.17.21 in /clients/validator [\#602](https://github.com/nymtech/nym/pull/602) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump lodash from 4.17.20 to 4.17.21 in /clients/native/examples/js-examples/websocket [\#601](https://github.com/nymtech/nym/pull/601) ([dependabot[bot]](https://github.com/apps/dependabot))
- Feature/add rocket [\#600](https://github.com/nymtech/nym/pull/600) ([futurechimp](https://github.com/futurechimp))
- Bump url-parse from 1.4.7 to 1.5.1 in /clients/native/examples/js-examples/websocket [\#599](https://github.com/nymtech/nym/pull/599) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump url-parse from 1.4.7 to 1.5.1 in /clients/webassembly/js-example [\#598](https://github.com/nymtech/nym/pull/598) ([dependabot[bot]](https://github.com/apps/dependabot))
- Recalculating reward rates on appropriate value changes [\#594](https://github.com/nymtech/nym/pull/594) ([jstuczyn](https://github.com/jstuczyn))
- Changed default mixnode query page limit [\#592](https://github.com/nymtech/nym/pull/592) ([jstuczyn](https://github.com/jstuczyn))
- Feature/more exposed client api [\#591](https://github.com/nymtech/nym/pull/591) ([jstuczyn](https://github.com/jstuczyn))
- Contract adjustment to check for node ownership before allowing bonding [\#590](https://github.com/nymtech/nym/pull/590) ([jstuczyn](https://github.com/jstuczyn))
- Bump ssri from 6.0.1 to 6.0.2 in /clients/webassembly/js-example [\#589](https://github.com/nymtech/nym/pull/589) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ssri from 6.0.1 to 6.0.2 in /clients/native/examples/js-examples/websocket [\#588](https://github.com/nymtech/nym/pull/588) ([dependabot[bot]](https://github.com/apps/dependabot))
- Impl Error trait for ValidatorClientError [\#587](https://github.com/nymtech/nym/pull/587) ([jstuczyn](https://github.com/jstuczyn))
- Checking for tx success when sending coins [\#586](https://github.com/nymtech/nym/pull/586) ([jstuczyn](https://github.com/jstuczyn))
- Logging adjustment [\#585](https://github.com/nymtech/nym/pull/585) ([jstuczyn](https://github.com/jstuczyn))
- Feature/multiple validator endpoints [\#583](https://github.com/nymtech/nym/pull/583) ([jstuczyn](https://github.com/jstuczyn))
- Refreshing nodes gets all available nodes from the contract [\#575](https://github.com/nymtech/nym/pull/575) ([jstuczyn](https://github.com/jstuczyn))
- Feature/simple payments [\#571](https://github.com/nymtech/nym/pull/571) ([jstuczyn](https://github.com/jstuczyn))
- Minor cosmetic changes while reading around [\#568](https://github.com/nymtech/nym/pull/568) ([huitseeker](https://github.com/huitseeker))
## [v0.10.0](https://github.com/nymtech/nym/tree/v0.10.0) (2021-04-15)
[Full Changelog](https://github.com/nymtech/nym/compare/validator-client-0.10.0-rc1...v0.10.0)
This release brings a distributed directory authority powered by [Cosmos SDK](https://cosmos.network) and [CosmWasm](https://cosmwasm.com) smart contracts. It is designed to run [Testnet Finney](https://testnet-finney-explorer.nymtech.net), the new Nym testnet.
**Closed issues:**
- When I run this command :'./nym-mixnode run --id zzznym', an error occurs [\#548](https://github.com/nymtech/nym/issues/548)
**Merged pull requests:**
- Displaying address of the client on init [\#573](https://github.com/nymtech/nym/pull/573) ([jstuczyn](https://github.com/jstuczyn))
- Fixed nightly clippy warnings [\#572](https://github.com/nymtech/nym/pull/572) ([jstuczyn](https://github.com/jstuczyn))
- Changed default client topology refresh rate from 30s to 5min [\#570](https://github.com/nymtech/nym/pull/570) ([jstuczyn](https://github.com/jstuczyn))
- Adding the wallet url in startup instructions [\#569](https://github.com/nymtech/nym/pull/569) ([futurechimp](https://github.com/futurechimp))
- Removed unused data from cargo.toml [\#567](https://github.com/nymtech/nym/pull/567) ([jstuczyn](https://github.com/jstuczyn))
- Feature/cli signing [\#566](https://github.com/nymtech/nym/pull/566) ([futurechimp](https://github.com/futurechimp))
- Updated version number on the validator client [\#565](https://github.com/nymtech/nym/pull/565) ([jstuczyn](https://github.com/jstuczyn))
- Renamed mixnode registration into bonding [\#564](https://github.com/nymtech/nym/pull/564) ([jstuczyn](https://github.com/jstuczyn))
- A pull request for discussion about contract state variables [\#563](https://github.com/nymtech/nym/pull/563) ([futurechimp](https://github.com/futurechimp))
- Feature/mixnet contract ci [\#562](https://github.com/nymtech/nym/pull/562) ([jstuczyn](https://github.com/jstuczyn))
- Feature/bonding adjustments [\#561](https://github.com/nymtech/nym/pull/561) ([jstuczyn](https://github.com/jstuczyn))
- Feature/migration additions [\#560](https://github.com/nymtech/nym/pull/560) ([jstuczyn](https://github.com/jstuczyn))
- Changed default contract execution gas limit to 250\_000 \(from 9\_000\_000\_000\) [\#559](https://github.com/nymtech/nym/pull/559) ([jstuczyn](https://github.com/jstuczyn))
- Missing quotes in mixnet\_contract\_address config field [\#558](https://github.com/nymtech/nym/pull/558) ([jstuczyn](https://github.com/jstuczyn))
- Updated default validator url and contract address [\#557](https://github.com/nymtech/nym/pull/557) ([jstuczyn](https://github.com/jstuczyn))
- Bump y18n from 4.0.0 to 4.0.1 in /clients/native/examples/js-examples/websocket [\#556](https://github.com/nymtech/nym/pull/556) ([dependabot[bot]](https://github.com/apps/dependabot))
- Feature/bonding info on init [\#555](https://github.com/nymtech/nym/pull/555) ([jstuczyn](https://github.com/jstuczyn))
- Feature/validator client address getter [\#554](https://github.com/nymtech/nym/pull/554) ([jstuczyn](https://github.com/jstuczyn))
- Added extra step for publishing validator client [\#553](https://github.com/nymtech/nym/pull/553) ([jstuczyn](https://github.com/jstuczyn))
- Feature/validator client rc3 [\#552](https://github.com/nymtech/nym/pull/552) ([jstuczyn](https://github.com/jstuczyn))
- Feature/upgrade update [\#551](https://github.com/nymtech/nym/pull/551) ([jstuczyn](https://github.com/jstuczyn))
- Feature/export coin helper [\#550](https://github.com/nymtech/nym/pull/550) ([futurechimp](https://github.com/futurechimp))
- Chore/dependency updates [\#549](https://github.com/nymtech/nym/pull/549) ([jstuczyn](https://github.com/jstuczyn))
- Feature/validator query client [\#547](https://github.com/nymtech/nym/pull/547) ([jstuczyn](https://github.com/jstuczyn))
- Feature/validator client rc2 [\#546](https://github.com/nymtech/nym/pull/546) ([futurechimp](https://github.com/futurechimp))
- Feature/has node query validator client [\#545](https://github.com/nymtech/nym/pull/545) ([jstuczyn](https://github.com/jstuczyn))
- Added contract query to check if given address owns a mixnode/gateway [\#544](https://github.com/nymtech/nym/pull/544) ([jstuczyn](https://github.com/jstuczyn))
## [validator-client-0.10.0-rc1](https://github.com/nymtech/nym/tree/validator-client-0.10.0-rc1) (2021-03-24)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.9.2...validator-client-0.10.0-rc1)
**Implemented enhancements:**
- Add option to whitelist IPv4 ranges to allowed.list in sphinx-socks [\#415](https://github.com/nymtech/nym/issues/415)
- Mixmining monitoring for gateways [\#384](https://github.com/nymtech/nym/issues/384)
**Fixed bugs:**
- Network requester should periodically remove stale proxies [\#424](https://github.com/nymtech/nym/issues/424)
- Network requester now prints correct version with --version [\#478](https://github.com/nymtech/nym/pull/478) ([jstuczyn](https://github.com/jstuczyn))
**Closed issues:**
- Change topology to work with validators. [\#538](https://github.com/nymtech/nym/issues/538)
- Unable to rejoin the network after powerdown [\#514](https://github.com/nymtech/nym/issues/514)
- nym-socks5-client 0.9.2 issue with outbound\_request\_filter.check [\#498](https://github.com/nymtech/nym/issues/498)
- nym-socks5-client high CPU usage on idle [\#491](https://github.com/nymtech/nym/issues/491)
- network requester too many Received a 'Send' before 'Connect' - going to buffer the data [\#483](https://github.com/nymtech/nym/issues/483)
- Socks5 client loops on malformed - invalidaddress message [\#482](https://github.com/nymtech/nym/issues/482)
- Socks5 client hangs [\#479](https://github.com/nymtech/nym/issues/479)
- Network Requester -V flag does not print version [\#469](https://github.com/nymtech/nym/issues/469)
- Gateway reconnection \(wasm\) [\#458](https://github.com/nymtech/nym/issues/458)
- Client warning 'No valid topology' [\#343](https://github.com/nymtech/nym/issues/343)
- private key file permission bits too open, readable for others [\#319](https://github.com/nymtech/nym/issues/319)
- Fix dependabot security notice [\#267](https://github.com/nymtech/nym/issues/267)
- Change how time intervals are serialized in configs [\#141](https://github.com/nymtech/nym/issues/141)
**Merged pull requests:**
- RC1 published [\#543](https://github.com/nymtech/nym/pull/543) ([futurechimp](https://github.com/futurechimp))
- Feature/prep for publish [\#542](https://github.com/nymtech/nym/pull/542) ([futurechimp](https://github.com/futurechimp))
- Feature/bigger better stronger mnemonics [\#541](https://github.com/nymtech/nym/pull/541) ([futurechimp](https://github.com/futurechimp))
- Removed a package-lock.json which seems to have been accidentally added [\#539](https://github.com/nymtech/nym/pull/539) ([futurechimp](https://github.com/futurechimp))
- Feature/convert to uhal [\#537](https://github.com/nymtech/nym/pull/537) ([futurechimp](https://github.com/futurechimp))
- Feature/topology conversion [\#536](https://github.com/nymtech/nym/pull/536) ([jstuczyn](https://github.com/jstuczyn))
- Feature/hook up url in validator client [\#535](https://github.com/nymtech/nym/pull/535) ([futurechimp](https://github.com/futurechimp))
- Feature/upgrade cosm client [\#534](https://github.com/nymtech/nym/pull/534) ([futurechimp](https://github.com/futurechimp))
- Feature/mix contract identity key [\#533](https://github.com/nymtech/nym/pull/533) ([jstuczyn](https://github.com/jstuczyn))
- Feature/validator client rust [\#532](https://github.com/nymtech/nym/pull/532) ([jstuczyn](https://github.com/jstuczyn))
- Feature/add currency helpers [\#531](https://github.com/nymtech/nym/pull/531) ([futurechimp](https://github.com/futurechimp))
- Exporting Coin struct, needed for wallet [\#530](https://github.com/nymtech/nym/pull/530) ([futurechimp](https://github.com/futurechimp))
- Getting correct user home dir in Python setup script [\#528](https://github.com/nymtech/nym/pull/528) ([futurechimp](https://github.com/futurechimp))
- Temporarily disabling fs access [\#527](https://github.com/nymtech/nym/pull/527) ([futurechimp](https://github.com/futurechimp))
- Feature/validator client gateway bonding [\#526](https://github.com/nymtech/nym/pull/526) ([jstuczyn](https://github.com/jstuczyn))
- Fixed eslint errors in the validator client [\#525](https://github.com/nymtech/nym/pull/525) ([jstuczyn](https://github.com/jstuczyn))
- Feature/gateway bonding [\#524](https://github.com/nymtech/nym/pull/524) ([jstuczyn](https://github.com/jstuczyn))
- Fix the remove mixnode test [\#522](https://github.com/nymtech/nym/pull/522) ([futurechimp](https://github.com/futurechimp))
- Bump elliptic from 6.5.3 to 6.5.4 in /clients/native/examples/js-examples/websocket [\#521](https://github.com/nymtech/nym/pull/521) ([dependabot[bot]](https://github.com/apps/dependabot))
- Feature/fix go errors in examples [\#516](https://github.com/nymtech/nym/pull/516) ([futurechimp](https://github.com/futurechimp))
- Feature/initial mixnet contract [\#515](https://github.com/nymtech/nym/pull/515) ([futurechimp](https://github.com/futurechimp))
- Running CI also on windows and macOS [\#512](https://github.com/nymtech/nym/pull/512) ([jstuczyn](https://github.com/jstuczyn))
- Feature/socks5 adjustments [\#510](https://github.com/nymtech/nym/pull/510) ([jstuczyn](https://github.com/jstuczyn))
- Fixed unused import in non-unix systems [\#509](https://github.com/nymtech/nym/pull/509) ([jstuczyn](https://github.com/jstuczyn))
- Checking if the delay has already expired before attempting to put it… [\#508](https://github.com/nymtech/nym/pull/508) ([jstuczyn](https://github.com/jstuczyn))
- Not including gateway non-delay when calculating total packet delay [\#507](https://github.com/nymtech/nym/pull/507) ([jstuczyn](https://github.com/jstuczyn))
- Allowing for a single topology refresh failure [\#505](https://github.com/nymtech/nym/pull/505) ([jstuczyn](https://github.com/jstuczyn))
- More restrictive unix key files permissions [\#504](https://github.com/nymtech/nym/pull/504) ([jstuczyn](https://github.com/jstuczyn))
- More human-readable errors on mixnode/gateway startup [\#503](https://github.com/nymtech/nym/pull/503) ([jstuczyn](https://github.com/jstuczyn))
- Feature/ip filtering [\#502](https://github.com/nymtech/nym/pull/502) ([jstuczyn](https://github.com/jstuczyn))
- Feature/wasm client compilation fixes [\#501](https://github.com/nymtech/nym/pull/501) ([jstuczyn](https://github.com/jstuczyn))
- Fixed possible crash on invalid topology [\#500](https://github.com/nymtech/nym/pull/500) ([jstuczyn](https://github.com/jstuczyn))
- Feature/gateway monitoring [\#499](https://github.com/nymtech/nym/pull/499) ([jstuczyn](https://github.com/jstuczyn))
- Feature/GitHub actions and clippy cleanup [\#493](https://github.com/nymtech/nym/pull/493) ([jstuczyn](https://github.com/jstuczyn))
- Fix typos [\#492](https://github.com/nymtech/nym/pull/492) ([rex4539](https://github.com/rex4539))
- Bump ini from 1.3.5 to 1.3.8 in /clients/native/examples/js-examples/websocket [\#490](https://github.com/nymtech/nym/pull/490) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ini from 1.3.5 to 1.3.8 in /clients/webassembly/js-example [\#489](https://github.com/nymtech/nym/pull/489) ([dependabot[bot]](https://github.com/apps/dependabot))
- display 0 on no validators rather than crash [\#488](https://github.com/nymtech/nym/pull/488) ([jstuczyn](https://github.com/jstuczyn))
- NGI0 - Updating licensing aspects according REUSE [\#487](https://github.com/nymtech/nym/pull/487) ([lnceballosz](https://github.com/lnceballosz))
- Feature/removed topology [\#481](https://github.com/nymtech/nym/pull/481) ([jstuczyn](https://github.com/jstuczyn))
- Bugfix/explorer fixes [\#477](https://github.com/nymtech/nym/pull/477) ([jstuczyn](https://github.com/jstuczyn))
- Feature/0.9.2+only monitoring [\#475](https://github.com/nymtech/nym/pull/475) ([jstuczyn](https://github.com/jstuczyn))
## [v0.9.2](https://github.com/nymtech/nym/tree/v0.9.2) (2020-11-26)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.9.1...v0.9.2)
This release brings networking improvements, eliminating blocking calls and improving mixnode and gateway scalability.
**Fixed bugs:**
- Putting initial packet onto the queue when establishing connection [\#471](https://github.com/nymtech/nym/pull/471) ([jstuczyn](https://github.com/jstuczyn))
**Merged pull requests:**
- Release/v0.9.2 [\#474](https://github.com/nymtech/nym/pull/474) ([jstuczyn](https://github.com/jstuczyn))
- Minor mixnet client code simplification and optimization [\#472](https://github.com/nymtech/nym/pull/472) ([jstuczyn](https://github.com/jstuczyn))
## [v0.9.1](https://github.com/nymtech/nym/tree/v0.9.1) (2020-11-24)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.9.0...v0.9.1)
The main features of this release are:
* a reputation tracking system which starts to link node reputation to quality of service
* a new component, the `nym-network-monitor`, which tracks whether nodes are working properly and providing good service
* automatic node registration and de-registration at node startup
* working Cosmos validators with a `nym` token
* starting to decentralize the old directory server into the validators
* a new block explorer at https://testnet-explorer.nymtech.net which looks the same as the old dashboard but is the basis of something much more advanced. It can be run by anyone.
* de-coupling metrics collection from directory services to make the system scale better overall
* reliability and performance improvements for mixnode networking
- explicit `unregister` command for mixnodes
- introduced gateway client reconnection in case of obvious network failures
- changed network monitor to send at a constant, adjustable, rate
- changed the way in which packets are delayed by mixnodes that should reduce number of tasks spawned
- changed the way in which packets are forwarded to further mixes that should get rid of possible blocking
See the changelog for detailed release notes.
**Implemented enhancements:**
- Nicer error if trying to run an uninitialised client/node [\#389](https://github.com/nymtech/nym/issues/389)
- Gateway announcement [\#383](https://github.com/nymtech/nym/issues/383)
- Add init flag for incentives address [\#382](https://github.com/nymtech/nym/issues/382)
- Ed25519 Identity Keys for Mixnodes [\#379](https://github.com/nymtech/nym/issues/379)
- Introduce version field to config files [\#375](https://github.com/nymtech/nym/issues/375)
- Change `init` to not blow away existing keys \(if exist\) [\#368](https://github.com/nymtech/nym/issues/368)
- Introduce an explicit `upgrade` command [\#367](https://github.com/nymtech/nym/issues/367)
- Show remote hostname in socks5 connection messages [\#365](https://github.com/nymtech/nym/issues/365)
- Make all `const` duration values more explicit. [\#333](https://github.com/nymtech/nym/issues/333)
- Change how mix packets get delayed [\#361](https://github.com/nymtech/nym/issues/361)
- Feature/socks improvements [\#423](https://github.com/nymtech/nym/pull/423) ([jstuczyn](https://github.com/jstuczyn))
- Feature/instant sending [\#359](https://github.com/nymtech/nym/pull/359) ([jstuczyn](https://github.com/jstuczyn))
**Fixed bugs:**
- React wasm example not compiling [\#394](https://github.com/nymtech/nym/issues/394)
- Update main.js [\#441](https://github.com/nymtech/nym/pull/441) ([jstuczyn](https://github.com/jstuczyn))
- Bugfix/metrics fixes [\#434](https://github.com/nymtech/nym/pull/434) ([jstuczyn](https://github.com/jstuczyn))
- Bugfix/upgrade fix [\#421](https://github.com/nymtech/nym/pull/421) ([jstuczyn](https://github.com/jstuczyn))
@@ -42,25 +298,23 @@ See the changelog for detailed release notes.
**Closed issues:**
- Make validator URL configurable [\#438](https://github.com/nymtech/nym/issues/438)
- Change default directory location [\#432](https://github.com/nymtech/nym/issues/432)
- Crank up the default bandwidth settings. [\#429](https://github.com/nymtech/nym/issues/429)
- Change "sphinx-socks" to "nym-requester" [\#428](https://github.com/nymtech/nym/issues/428)
- Clients should use only "active" nodes [\#390](https://github.com/nymtech/nym/issues/390)
- Allow persistently changing config values from command line [\#387](https://github.com/nymtech/nym/issues/387)
- Remove `--config` flag in `run` [\#385](https://github.com/nymtech/nym/issues/385)
- Metrics server should return a metrics rate value [\#374](https://github.com/nymtech/nym/issues/374)
- Integer staking [\#372](https://github.com/nymtech/nym/issues/372)
- Mixnode and gateway blockchain registration [\#371](https://github.com/nymtech/nym/issues/371)
- Remove presence notifications [\#370](https://github.com/nymtech/nym/issues/370)
- Handle invalid base58 encoding for asymmetric key recovery \(encryption and identity\) [\#285](https://github.com/nymtech/nym/issues/285)
- Socks5 nym client + bitcoin service provider [\#254](https://github.com/nymtech/nym/issues/254)
- Message reception in webassembly client [\#204](https://github.com/nymtech/nym/issues/204)
- Simplest possible staking system [\#157](https://github.com/nymtech/nym/issues/157)
- Validator should hold topology [\#77](https://github.com/nymtech/nym/issues/77)
- Gateway reconnections \(simple\) [\#457](https://github.com/nymtech/nym/issues/457)
- Slow down network monitor sending rate [\#455](https://github.com/nymtech/nym/issues/455)
- Deploy the new explorer on the same box as metrics. [\#433](https://github.com/nymtech/nym/issues/433)
- Too many open files [\#366](https://github.com/nymtech/nym/issues/366)
- nym-mixnode doesn't bind to any port \(Ubuntu 20.04\) [\#290](https://github.com/nymtech/nym/issues/290)
**Merged pull requests:**
- Updated message on shutdown [\#467](https://github.com/nymtech/nym/pull/467) ([jstuczyn](https://github.com/jstuczyn))
- Additional feedback on unregistration on sigint [\#466](https://github.com/nymtech/nym/pull/466) ([jstuczyn](https://github.com/jstuczyn))
- Feature/upgrade additions [\#465](https://github.com/nymtech/nym/pull/465) ([jstuczyn](https://github.com/jstuczyn))
- Feature/nonblocking mix send [\#464](https://github.com/nymtech/nym/pull/464) ([jstuczyn](https://github.com/jstuczyn))
- Feature/delay queue mixnodes [\#462](https://github.com/nymtech/nym/pull/462) ([jstuczyn](https://github.com/jstuczyn))
- Feature/slowed down network monitor [\#461](https://github.com/nymtech/nym/pull/461) ([jstuczyn](https://github.com/jstuczyn))
- Feature/unregister command [\#460](https://github.com/nymtech/nym/pull/460) ([jstuczyn](https://github.com/jstuczyn))
- Simple gateway client reconnection in obvious network failures [\#459](https://github.com/nymtech/nym/pull/459) ([jstuczyn](https://github.com/jstuczyn))
- temporarily disabled mixnode status dot [\#454](https://github.com/nymtech/nym/pull/454) ([jstuczyn](https://github.com/jstuczyn))
- Removed incentives form url [\#451](https://github.com/nymtech/nym/pull/451) ([jstuczyn](https://github.com/jstuczyn))
- Removed hardcoded 'good gateways' in favour of pseusorandom choice fr… [\#450](https://github.com/nymtech/nym/pull/450) ([jstuczyn](https://github.com/jstuczyn))
- Fixed the URL of the websocket [\#449](https://github.com/nymtech/nym/pull/449) ([futurechimp](https://github.com/futurechimp))
@@ -108,6 +362,62 @@ See the changelog for detailed release notes.
- Added sphinx socks to default workspace members [\#358](https://github.com/nymtech/nym/pull/358) ([jstuczyn](https://github.com/jstuczyn))
- Feature/wasm update [\#341](https://github.com/nymtech/nym/pull/341) ([jstuczyn](https://github.com/jstuczyn))
## [v0.9.0](https://github.com/nymtech/nym/tree/v0.9.0) (2020-11-13)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.8.1...v0.9.0)
The main features of this release are:
* a reputation tracking system which starts to link node reputation to quality of service
* a new component, the `nym-network-monitor`, which tracks whether nodes are working properly and providing good service
* automatic node registration and de-registration at node startup
* working Cosmos validators with a `nym` token
* starting to decentralize the old directory server into the validators
* a new block explorer at https://testnet-explorer.nymtech.net which looks the same as the old dashboard but is the basis of something much more advanced. It can be run by anyone.
* de-coupling metrics collection from directory services to make the system scale better overall
* reliability and performance improvements for mixnode networking
See the changelog for detailed release notes.
**Implemented enhancements:**
- Nicer error if trying to run an uninitialised client/node [\#389](https://github.com/nymtech/nym/issues/389)
- Gateway announcement [\#383](https://github.com/nymtech/nym/issues/383)
- Add init flag for incentives address [\#382](https://github.com/nymtech/nym/issues/382)
- Ed25519 Identity Keys for Mixnodes [\#379](https://github.com/nymtech/nym/issues/379)
- Introduce version field to config files [\#375](https://github.com/nymtech/nym/issues/375)
- Change `init` to not blow away existing keys \(if exist\) [\#368](https://github.com/nymtech/nym/issues/368)
- Introduce an explicit `upgrade` command [\#367](https://github.com/nymtech/nym/issues/367)
- Show remote hostname in socks5 connection messages [\#365](https://github.com/nymtech/nym/issues/365)
- Make all `const` duration values more explicit. [\#333](https://github.com/nymtech/nym/issues/333)
**Fixed bugs:**
- React wasm example not compiling [\#394](https://github.com/nymtech/nym/issues/394)
**Closed issues:**
- Make validator URL configurable [\#438](https://github.com/nymtech/nym/issues/438)
- Change default directory location [\#432](https://github.com/nymtech/nym/issues/432)
- Crank up the default bandwidth settings. [\#429](https://github.com/nymtech/nym/issues/429)
- Change "sphinx-socks" to "nym-requester" [\#428](https://github.com/nymtech/nym/issues/428)
- Clients should use only "active" nodes [\#390](https://github.com/nymtech/nym/issues/390)
- Allow persistently changing config values from command line [\#387](https://github.com/nymtech/nym/issues/387)
- Remove `--config` flag in `run` [\#385](https://github.com/nymtech/nym/issues/385)
- Metrics server should return a metrics rate value [\#374](https://github.com/nymtech/nym/issues/374)
- Integer staking [\#372](https://github.com/nymtech/nym/issues/372)
- Mixnode and gateway blockchain registration [\#371](https://github.com/nymtech/nym/issues/371)
- Remove presence notifications [\#370](https://github.com/nymtech/nym/issues/370)
- Handle invalid base58 encoding for asymmetric key recovery \(encryption and identity\) [\#285](https://github.com/nymtech/nym/issues/285)
- Socks5 nym client + bitcoin service provider [\#254](https://github.com/nymtech/nym/issues/254)
- Message reception in webassembly client [\#204](https://github.com/nymtech/nym/issues/204)
- Simplest possible staking system [\#157](https://github.com/nymtech/nym/issues/157)
- Validator should hold topology [\#77](https://github.com/nymtech/nym/issues/77)
**Merged pull requests:**
- Release/v0.9.0 [\#453](https://github.com/nymtech/nym/pull/453) ([jstuczyn](https://github.com/jstuczyn))
## [v0.8.1](https://github.com/nymtech/nym/tree/v0.8.1) (2020-09-28)
[Full Changelog](https://github.com/nymtech/nym/compare/v0.8.0...v0.8.1)
@@ -237,7 +547,7 @@ See the [changelog](https://github.com/nymtech/nym/blob/develop/CHANGELOG.md) fo
**Closed issues:**
- Move to userpubkey@gatewaypubkey addresses. [\#235](https://github.com/nymtech/nym/issues/235)
- Get `start\_local\_network.sh` working with the js example [\#227](https://github.com/nymtech/nym/issues/227)
- Get `start_local_network.sh` working with the js example [\#227](https://github.com/nymtech/nym/issues/227)
- Fix indeterminate test failure [\#218](https://github.com/nymtech/nym/issues/218)
- Remove 'fetch' mechanism from desktop client's client in favour of push [\#211](https://github.com/nymtech/nym/issues/211)
- Mixnode - load Sphinx keys like Gateway [\#209](https://github.com/nymtech/nym/issues/209)
@@ -262,12 +572,12 @@ See the [changelog](https://github.com/nymtech/nym/blob/develop/CHANGELOG.md) fo
- Bring health-checker into validator mix-mining [\#78](https://github.com/nymtech/nym/issues/78)
- Solidify TCPSocket on client [\#72](https://github.com/nymtech/nym/issues/72)
- scripts: run\_local\_network.sh doesn't die nicely [\#45](https://github.com/nymtech/nym/issues/45)
- WASM version of the Sphinx packet [\#19](https://github.com/nymtech/nym/issues/19)
- Persistent socket connection \(TCP Socket with provider\) [\#18](https://github.com/nymtech/nym/issues/18)
- Persistent socket connection \(Websocket with client\) [\#17](https://github.com/nymtech/nym/issues/17)
- Persistent socket connection \(TCP Socket with client\) [\#13](https://github.com/nymtech/nym/issues/13)
- Persistent socket connection \(Websocket with client\) [\#12](https://github.com/nymtech/nym/issues/12)
- Persistently store ledger with registered clients and their auth tokens [\#6](https://github.com/nymtech/nym/issues/6)
- Persistent socket connection \(Websocket with client\) [\#17](https://github.com/nymtech/nym/issues/17)
- Persistent socket connection \(TCP Socket with provider\) [\#18](https://github.com/nymtech/nym/issues/18)
- Persistent socket connection \(Websocket with client\) [\#12](https://github.com/nymtech/nym/issues/12)
- Persistent socket connection \(TCP Socket with client\) [\#13](https://github.com/nymtech/nym/issues/13)
- WASM version of the Sphinx packet [\#19](https://github.com/nymtech/nym/issues/19)
**Merged pull requests:**
@@ -410,11 +720,11 @@ This release fixes bugs in v0.5.0. All testnet node operators are advised to up
- Fix incorrectly used Arcs [\#47](https://github.com/nymtech/nym/issues/47)
- nym-mixnode mandatory host option [\#26](https://github.com/nymtech/nym/issues/26)
- Create config struct for mixnode \(possibly also for client\) [\#21](https://github.com/nymtech/nym/issues/21)
- Reuse TCP socket connection between client and mixnodes [\#20](https://github.com/nymtech/nym/issues/20)
- Once implementation is available, wherever appropriate, replace `futures::lock::Mutex` with `futures::lock::RwLock` [\#9](https://github.com/nymtech/nym/issues/9)
- Check if RwLock on MixProcessingData is still needed [\#8](https://github.com/nymtech/nym/issues/8)
- Reuse TCP socket connection between mixnodes and providers [\#3](https://github.com/nymtech/nym/issues/3)
- Once implementation is available, wherever appropriate, replace `futures::lock::Mutex` with `futures::lock::RwLock` [\#9](https://github.com/nymtech/nym/issues/9)
- Persistent socket connection with other mixes [\#2](https://github.com/nymtech/nym/issues/2)
- Reuse TCP socket connection between client and mixnodes [\#20](https://github.com/nymtech/nym/issues/20)
- Reuse TCP socket connection between mixnodes and providers [\#3](https://github.com/nymtech/nym/issues/3)
**Merged pull requests:**
@@ -440,7 +750,6 @@ This release fixes bugs in v0.5.0. All testnet node operators are advised to up
**Merged pull requests:**
- Bugfix/healthcheck on provided topology [\#108](https://github.com/nymtech/nym/pull/108) ([jstuczyn](https://github.com/jstuczyn))
- Feature/check packet length [\#99](https://github.com/nymtech/nym/pull/99) ([futurechimp](https://github.com/futurechimp))
## [v0.4.0](https://github.com/nymtech/nym/tree/v0.4.0) (2020-01-28)
@@ -491,6 +800,7 @@ This release also integrates a health-checker and network topology refresh into
- Feature/base58 [\#102](https://github.com/nymtech/nym/pull/102) ([futurechimp](https://github.com/futurechimp))
- Feature/panic improvements [\#101](https://github.com/nymtech/nym/pull/101) ([jstuczyn](https://github.com/jstuczyn))
- Feature/fix sphinx unwraps [\#100](https://github.com/nymtech/nym/pull/100) ([futurechimp](https://github.com/futurechimp))
- Feature/check packet length [\#99](https://github.com/nymtech/nym/pull/99) ([futurechimp](https://github.com/futurechimp))
- Feature/version filtering improvements [\#96](https://github.com/nymtech/nym/pull/96) ([futurechimp](https://github.com/futurechimp))
- Feature/refreshing topology [\#94](https://github.com/nymtech/nym/pull/94) ([jstuczyn](https://github.com/jstuczyn))
- Feature/consistent logging [\#93](https://github.com/nymtech/nym/pull/93) ([futurechimp](https://github.com/futurechimp))
@@ -514,8 +824,8 @@ This release also integrates a health-checker and network topology refresh into
- Messages returned by fetch are base64 encoded [\#55](https://github.com/nymtech/nym/issues/55)
- Check layer 1 connectivity at client start [\#38](https://github.com/nymtech/nym/issues/38)
- Check required sfw-provider args [\#27](https://github.com/nymtech/nym/issues/27)
- Make Electron app work with new Rust mixnet client [\#16](https://github.com/nymtech/nym/issues/16)
- Take version numbers into account when picking routes [\#14](https://github.com/nymtech/nym/issues/14)
- Make Electron app work with new Rust mixnet client [\#16](https://github.com/nymtech/nym/issues/16)
**Merged pull requests:**
@@ -558,7 +868,7 @@ This release also integrates a health-checker and network topology refresh into
**Merged pull requests:**
- Feature/client topology filtering [\#54](https://github.com/nymtech/nym/pull/54) ([jstuczyn](https://github.com/jstuczyn))
- print public key for nym client tools [\#53](https://github.com/nymtech/nym/pull/53) ([mileschet](https://github.com/mileschet))
- print public key for nym client tools [\#53](https://github.com/nymtech/nym/pull/53) ([ghost](https://github.com/ghost))
- Showing binding warning on binding to localhost, 0.0.0.0 or 127.0.0.1 [\#52](https://github.com/nymtech/nym/pull/52) ([jstuczyn](https://github.com/jstuczyn))
- validator: moving sample config files into sample configs directory [\#51](https://github.com/nymtech/nym/pull/51) ([futurechimp](https://github.com/futurechimp))
- Feature/validator health checker [\#50](https://github.com/nymtech/nym/pull/50) ([jstuczyn](https://github.com/jstuczyn))
@@ -581,7 +891,7 @@ This release also integrates a health-checker and network topology refresh into
## [0.2.0](https://github.com/nymtech/nym/tree/0.2.0) (2020-01-06)
[Full Changelog](https://github.com/nymtech/nym/compare/0.1.0...0.2.0)
[Full Changelog](https://github.com/nymtech/nym/compare/3c64a2facd753f4f2f431e7f888e54842e2bc64e...0.2.0)
Generated
+5277 -998
View File
File diff suppressed because it is too large Load Diff
+16 -6
View File
@@ -1,6 +1,10 @@
# Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
# SPDX-License-Identifier: Apache-2.0
[profile.release]
panic = "abort"
opt-level = "s"
overflow-checks = true
[profile.dev]
panic = "abort"
@@ -8,18 +12,23 @@ panic = "abort"
[workspace]
members = [
"clients/client-core",
"clients/native",
"clients/native/websocket-requests",
"clients/socks5",
"clients/tauri-client/src-tauri",
"clients/webassembly",
"clients/client-core",
"common/client-libs/gateway-client",
"common/client-libs/metrics-client",
"common/client-libs/mixnet-client",
"common/client-libs/validator-client",
"common/coconut-interface",
"common/config",
"common/credentials",
"common/crypto",
"common/erc20-bridge-contract",
"common/mixnet-contract",
"common/mixnode-common",
"common/network-defaults",
"common/nonexhaustive-delayqueue",
"common/nymsphinx",
"common/nymsphinx/acknowledgements",
@@ -32,15 +41,16 @@ members = [
"common/nymsphinx/params",
"common/nymsphinx/types",
"common/pemstore",
"common/socks5/requests",
"common/socks5/proxy-helpers",
"common/socks5/requests",
"common/topology",
"common/wasm-utils",
"explorer-api",
"gateway",
"gateway/gateway-requests",
"mixnode",
"network-monitor",
"service-providers/network-requester",
"validator-api",
]
default-members = [
@@ -50,7 +60,7 @@ default-members = [
"gateway",
"service-providers/network-requester",
"mixnode",
"network-monitor",
"validator-api",
]
exclude = ["explorer"]
exclude = ["explorer", "contracts", "tokenomics-py"]
View File
+36
View File
@@ -0,0 +1,36 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
Standard License Header
There is no standard license header for the license
+14
View File
@@ -0,0 +1,14 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Standard License Header
There is no standard license header for the license
+57 -4
View File
@@ -1,18 +1,27 @@
## The Nym Privacy Platform
<!--
Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
SPDX-License-Identifier: Apache-2.0
-->
This repository contains the Nym mixnet.
## The Nym Privacy Platform
The platform is composed of multiple Rust crates. Top-level executable binary crates include:
* nym-mixnode - shuffles [Sphinx](https://github.com/nymtech/sphinx) packets together to provide privacy against network-level attackers.
* nym-client - an executable which you can build into your own applications. Use it for interacting with Nym nodes.
* nym-socks5-client - a Socks5 proxy you can run on your machine, and use with existing applications
* nym-gateway - acts sort of like a mailbox for mixnet messages, removing the need for directly delivery to potentially offline or firewalled devices.
* nym-network-monitor - sends packets through the full system to check that they are working as expected, and stores node uptime histories as the basis of a rewards system ("mixmining" or "proof-of-mixing").
* nym-explorer - a (projected) block explorer and (existing) mixnet viewer.
* nym-wallet (currently in development)- a desktop wallet implemented using the [Tauri](https://tauri.studio/en/docs/about/intro) framework.
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://img.shields.io/github/workflow/status/nymtech/nym/Continuous%20integration/develop?style=for-the-badge&logo=github-actions)](https://github.com/nymtech/nym/actions?query=branch%3Adevelop)
[![Build Status](https://travis-ci.com/nymtech/nym.svg?branch=develop)](https://travis-ci.com/nymtech/nym)
### Building
Platform build instructions are available on [our docs site](https://nymtech.net/docs).
Platform build instructions are available on [our docs site](https://nymtech.net/docs/0.11.0/overview/index/).
### Developing
@@ -21,3 +30,47 @@ There's a `.env.sample-dev` file provided which you can rename to `.env` if you
### Developer chat
You can chat to us in [Keybase](https://keybase.io). Download their chat app, then click **Teams -> Join a team**. Type **nymtech.friends** into the team name and hit **continue**. For general chat, hang out in the **#general** channel. Our development takes places in the **#dev** channel. Node operators should be in the **#node-operators** channel.
### Rewards
Node, node operator and delegator rewards are determined according to the principles laid out in the section 6 of [Nym Whitepaper](https://nymtech.net/nym-whitepaper.pdf). Below is a TLDR of the variables and formulas involved in calculating the epoch rewards. Initial reward pool is set to 250 million Nym, making the circulating supply 750 million Nym.
|Symbol|Definition|
|---|---|
|<img src="https://render.githubusercontent.com/render/math?math=R">|global share of rewards available, starts at 2% of the reward pool.
|<img src="https://render.githubusercontent.com/render/math?math=R_{i}">|node reward for mixnode `i`.
|<img src="https://render.githubusercontent.com/render/math?math=\sigma_{i}">|ratio of total node stake (node bond + all delegations) to the token circulating supply.
|<img src="https://render.githubusercontent.com/render/math?math=\lambda_{i}">|ratio of stake operator has plaged to their node to the token circulating supply.
|<img src="https://render.githubusercontent.com/render/math?math=\omega_{i}">|fraction of total effort undertaken by node `i`, set to `1/k` in testnet Milhon.
|<img src="https://render.githubusercontent.com/render/math?math=k">|number of nodes stakeholders are incentivised to create, set by the validators, a matter of governance. Currently determined by the `active set` size, and set to 5000 in testnet Milhon.
|<img src="https://render.githubusercontent.com/render/math?math=\alpha">|Sybil attack resistance parameter - the higher this parameter is set the stronger the reduction in competitivness gets for a Sybil attacker.
|<img src="https://render.githubusercontent.com/render/math?math=PM_{i}">|declared profit margin of operator `i`, defaults to 10% in testnet Milhon.
|<img src="https://render.githubusercontent.com/render/math?math=PF_{i}">|uptime of node `i`, scaled to 0 - 1, for the rewarding epoch
|<img src="https://render.githubusercontent.com/render/math?math=PP_{i}">|cost of operating node `i` for the duration of the rewarding eopoch, set to 40 Nym for testnet Milhon.
Node reward for node `i` is determined as:
<img src="https://render.githubusercontent.com/render/math?math=R_{i}=PF_{i} \cdot R \cdot (\sigma^'_{i} \cdot \omega_{i} \cdot k %2b \alpha \cdot \lambda^'_{i} \cdot \sigma^'_{i} \cdot k)/(1 %2b \alpha)">
where:
<img src="https://render.githubusercontent.com/render/math?math=\sigma^'_{i} = min\{\sigma_{i}, 1/k\}">
and
<img src="https://render.githubusercontent.com/render/math?math=\lambda^'_{i} = min\{\lambda_{i}, 1/k\}">
Operator of node `i` is credited with the following amount:
<img src="https://render.githubusercontent.com/render/math?math=min\{PP_{i},R_{i})\} %2b max\{0, (PM_{i} %2b (1 - PM_{i}) \cdot \lambda_{i}/\delta_{i}) \cdot (R_{i} - PP_{i})\}">
Delegate with stake `s` recieves:
<img src="https://render.githubusercontent.com/render/math?math=max\{0, (1-PM_{i}) \cdot (s^'/\sigma_{i}) \cdot (R_{i} - PP_{i})\}">
where `s'` is stake `s` scaled over total token circulating supply.
### Licensing and copyright information
This program is available as open source under the terms of the Apache 2.0 license. However, some elements are being licensed under CC0-1.0 and MIT. For accurate information, please check individual files.
+12 -8
View File
@@ -1,20 +1,21 @@
[package]
name = "client-core"
version = "0.9.0"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
dirs = "2.0.2"
futures = "0.3.1"
humantime-serde = "1.0.1"
dirs = "3.0"
futures = "0.3"
humantime-serde = "1.0"
log = "0.4"
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
serde = { version = "1.0.104", features = ["derive"] }
sled = "0.33"
tokio = { version = "0.2", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
sled = "0.34"
tokio = { version = "1.4", features = ["macros"] }
url = { version ="2.2", features = ["serde"] }
# internal
config = { path = "../../common/config" }
@@ -28,4 +29,7 @@ topology = { path = "../../common/topology" }
validator-client = { path = "../../common/client-libs/validator-client" }
[dev-dependencies]
tempfile = "3.1.0"
tempfile = "3.1.0"
[features]
coconut = []
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::mix_traffic::BatchMixMessageSender;
use crate::client::topology_control::TopologyAccessor;
@@ -46,7 +35,7 @@ where
/// Internal state, determined by `average_message_sending_delay`,
/// used to keep track of when a next packet should be sent out.
next_delay: time::Delay,
next_delay: Pin<Box<time::Sleep>>,
/// Channel used for sending prepared sphinx packets to `MixTrafficController` that sends them
/// out to the network without any further delays.
@@ -74,7 +63,7 @@ where
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
// it is not yet time to return a message
if Pin::new(&mut self.next_delay).poll(cx).is_pending() {
if self.next_delay.as_mut().poll(cx).is_pending() {
return Poll::Pending;
};
@@ -87,7 +76,7 @@ where
// The next interval value is `next_poisson_delay` after the one that just
// yielded.
let next = now + next_poisson_delay;
self.next_delay.reset(next);
self.next_delay.as_mut().reset(next);
Poll::Ready(Some(()))
}
@@ -112,7 +101,7 @@ impl LoopCoverTrafficStream<OsRng> {
average_ack_delay,
average_packet_delay,
average_cover_message_sending_delay,
next_delay: time::delay_for(Default::default()),
next_delay: Box::pin(time::sleep(Default::default())),
mix_tx,
our_full_destination,
rng,
@@ -166,10 +155,10 @@ impl LoopCoverTrafficStream<OsRng> {
async fn run(&mut self) {
// we should set initial delay only when we actually start the stream
self.next_delay = time::delay_for(sample_poisson_duration(
self.next_delay = Box::pin(time::sleep(sample_poisson_duration(
&mut self.rng,
self.average_cover_message_sending_delay,
));
)));
while self.next().await.is_some() {
self.on_new_message().await;
@@ -1,6 +1,6 @@
use futures::channel::mpsc;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::anonymous_replies::ReplySurb;
pub type InputMessageSender = mpsc::UnboundedSender<InputMessage>;
pub type InputMessageReceiver = mpsc::UnboundedReceiver<InputMessage>;
@@ -13,7 +13,7 @@ pub enum InputMessage {
with_reply_surb: bool,
},
Reply {
reply_surb: ReplySURB,
reply_surb: ReplySurb,
data: Vec<u8>,
},
}
@@ -27,7 +27,7 @@ impl InputMessage {
}
}
pub fn new_reply(reply_surb: ReplySURB, data: Vec<u8>) -> Self {
pub fn new_reply(reply_surb: ReplySurb, data: Vec<u8>) -> Self {
InputMessage::Reply { reply_surb, data }
}
}
+9 -21
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::config::persistence::key_pathfinder::ClientKeyPathfinder;
use crypto::asymmetric::{encryption, identity};
@@ -61,8 +50,8 @@ impl KeyManager {
R: RngCore + CryptoRng,
{
KeyManager {
identity_keypair: Arc::new(identity::KeyPair::new_with_rng(rng)),
encryption_keypair: Arc::new(encryption::KeyPair::new_with_rng(rng)),
identity_keypair: Arc::new(identity::KeyPair::new(rng)),
encryption_keypair: Arc::new(encryption::KeyPair::new(rng)),
gateway_shared_key: None,
ack_key: Arc::new(AckKey::new(rng)),
}
@@ -72,8 +61,8 @@ impl KeyManager {
// I have absolutely no idea why the compiler insists it's unused. The call happens during client::init::execute
#[allow(dead_code)]
/// After shared key with the gateway is derived, puts its ownership to this instance of a [`KeyManager`].
pub fn insert_gateway_shared_key(&mut self, gateway_shared_key: SharedKeys) {
self.gateway_shared_key = Some(Arc::new(gateway_shared_key))
pub fn insert_gateway_shared_key(&mut self, gateway_shared_key: Arc<SharedKeys>) {
self.gateway_shared_key = Some(gateway_shared_key)
}
/// Loads previously stored keys from the disk.
@@ -127,12 +116,12 @@ impl KeyManager {
),
)?;
pemstore::store_key(self.ack_key.as_ref(), &client_pathfinder.ack_key())?;
pemstore::store_key(self.ack_key.as_ref(), client_pathfinder.ack_key())?;
match self.gateway_shared_key.as_ref() {
None => warn!("No gateway shared key available to store!"),
Some(gate_key) => {
pemstore::store_key(gate_key.as_ref(), &client_pathfinder.gateway_shared_key())?
pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())?
}
}
@@ -154,8 +143,7 @@ impl KeyManager {
// hence it's up to us to ensure it's called in correct context
pub fn gateway_shared_key(&self) -> Arc<SharedKeys> {
Arc::clone(
&self
.gateway_shared_key
self.gateway_shared_key
.as_ref()
.expect("tried to unwrap empty gateway key!"),
)
+4 -15
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use futures::channel::mpsc;
use futures::StreamExt;
@@ -51,7 +40,7 @@ impl MixTrafficController {
async fn on_messages(&mut self, mut mix_packets: Vec<MixPacket>) {
debug_assert!(!mix_packets.is_empty());
let success = if mix_packets.len() == 1 {
let result = if mix_packets.len() == 1 {
let mix_packet = mix_packets.pop().unwrap();
self.gateway_client.send_mix_packet(mix_packet).await
} else {
@@ -60,7 +49,7 @@ impl MixTrafficController {
.await
};
match success {
match result {
Err(e) => {
error!("Failed to send sphinx packet(s) to the gateway! - {:?}", e);
self.consecutive_gateway_failure_count += 1;
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use super::action_controller::{Action, ActionSender};
use futures::StreamExt;
@@ -1,35 +1,22 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use super::PendingAcknowledgement;
use crate::client::real_messages_control::acknowledgement_control::RetransmissionRequestSender;
use futures::channel::mpsc::{self, UnboundedReceiver, UnboundedSender};
use futures::StreamExt;
use log::*;
use nonexhaustive_delayqueue::NonExhaustiveDelayQueue;
use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey, TimerError};
use nymsphinx::chunking::fragment::FragmentIdentifier;
use nymsphinx::Delay as SphinxDelay;
use std::collections::HashMap;
use std::sync::Arc;
use std::time::Duration;
use tokio::stream::StreamExt;
use tokio::time::delay_queue::{self, Expired};
use tokio::time::Error as TimerError;
pub(crate) type ActionSender = UnboundedSender<Action>;
// The actual data being sent off as well as potential key to the delay queue
type PendingAckEntry = (Arc<PendingAcknowledgement>, Option<delay_queue::Key>);
type PendingAckEntry = (Arc<PendingAcknowledgement>, Option<QueueKey>);
// we can either:
// - have a completely new set of packets we just sent and need to create entries for
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use super::action_controller::{Action, ActionSender};
use super::PendingAcknowledgement;
@@ -22,7 +11,7 @@ use crate::client::{
};
use futures::StreamExt;
use log::*;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::anonymous_replies::ReplySurb;
use nymsphinx::preparer::MessagePreparer;
use nymsphinx::{acknowledgements::AckKey, addressing::clients::Recipient};
use rand::{CryptoRng, Rng};
@@ -49,6 +38,9 @@ impl<R> InputMessageListener<R>
where
R: CryptoRng + Rng,
{
// at this point I'm not entirely sure how to deal with this warning without
// some considerable refactoring
#[allow(clippy::too_many_arguments)]
pub(super) fn new(
ack_key: Arc<AckKey>,
ack_recipient: Recipient,
@@ -72,7 +64,7 @@ where
}
// we require topology for replies to generate surb_acks
async fn handle_reply(&mut self, reply_surb: ReplySURB, data: Vec<u8>) -> Option<RealMessage> {
async fn handle_reply(&mut self, reply_surb: ReplySurb, data: Vec<u8>) -> Option<RealMessage> {
let topology_permit = self.topology_access.get_read_permit().await;
let topology = match topology_permit.try_get_valid_topology_ref(&self.ack_recipient, None) {
Some(topology_ref) => topology_ref,
@@ -107,7 +99,7 @@ where
recipient: Recipient,
content: Vec<u8>,
with_reply_surb: bool,
) -> Vec<RealMessage> {
) -> Option<Vec<RealMessage>> {
let topology_permit = self.topology_access.get_read_permit().await;
let topology = match topology_permit
.try_get_valid_topology_ref(&self.ack_recipient, Some(&recipient))
@@ -115,7 +107,7 @@ where
Some(topology_ref) => topology_ref,
None => {
warn!("Could not process the message - the network topology is invalid");
return Vec::new();
return None;
}
};
@@ -161,7 +153,7 @@ where
.unbounded_send(Action::new_insert(pending_acks))
.unwrap();
real_messages
Some(real_messages)
}
async fn on_input_message(&mut self, msg: InputMessage) {
@@ -174,19 +166,19 @@ where
self.handle_fresh_message(recipient, data, with_reply_surb)
.await
}
InputMessage::Reply { reply_surb, data } => {
if let Some(real_message) = self.handle_reply(reply_surb, data).await {
vec![real_message]
} else {
return;
}
}
InputMessage::Reply { reply_surb, data } => self
.handle_reply(reply_surb, data)
.await
.map(|message| vec![message]),
};
// tells real message sender (with the poisson timer) to send this to the mix network
self.real_message_sender
.unbounded_send(real_messages)
.unwrap();
// there's no point in trying to send nothing
if let Some(real_messages) = real_messages {
// tells real message sender (with the poisson timer) to send this to the mix network
self.real_message_sender
.unbounded_send(real_messages)
.unwrap();
}
}
pub(super) async fn run(&mut self) {
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use self::{
acknowledgement_listener::AcknowledgementListener, action_controller::ActionController,
@@ -24,7 +13,6 @@ use crate::client::{inbound_messages::InputMessageReceiver, topology_control::To
use futures::channel::mpsc;
use gateway_client::AcknowledgementReceiver;
use log::*;
use nymsphinx::params::PacketMode;
use nymsphinx::{
acknowledgements::AckKey,
addressing::clients::Recipient,
@@ -56,7 +44,7 @@ type RetransmissionRequestReceiver = mpsc::UnboundedReceiver<Weak<PendingAcknowl
pub(super) type SentPacketNotificationSender = mpsc::UnboundedSender<FragmentIdentifier>;
/// Channel used for receiving signals about the particular `Fragment` (associated with the `FragmentIdentifier`)
/// that it is about to be sent to tbe mix network and its timeout timer should be started.
/// that it is about to be sent to the mix network and its timeout timer should be started.
type SentPacketNotificationReceiver = mpsc::UnboundedReceiver<FragmentIdentifier>;
/// Structure representing a data `Fragment` that is on-route to the specified `Recipient`
@@ -131,14 +119,6 @@ pub(super) struct Config {
/// Average delay a data packet is going to get delayed at a single mixnode.
average_packet_delay: Duration,
/// Mode of all mix packets created - VPN or Mix. They indicate whether packets should get delayed
/// and keys reused.
packet_mode: PacketMode,
/// If the mode of the client is set to VPN it specifies number of packets created with the
/// same initial secret until it gets rotated.
vpn_key_reuse_limit: Option<usize>,
}
impl Config {
@@ -147,16 +127,12 @@ impl Config {
ack_wait_multiplier: f64,
average_ack_delay: Duration,
average_packet_delay: Duration,
packet_mode: PacketMode,
vpn_key_reuse_limit: Option<usize>,
) -> Self {
Config {
ack_wait_addition,
ack_wait_multiplier,
average_ack_delay,
average_packet_delay,
packet_mode,
vpn_key_reuse_limit,
}
}
}
@@ -197,8 +173,6 @@ where
ack_recipient,
config.average_packet_delay,
config.average_ack_delay,
config.packet_mode,
config.vpn_key_reuse_limit,
);
// will listen for any acks coming from the network
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use super::action_controller::{Action, ActionSender};
use super::PendingAcknowledgement;
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use super::action_controller::{Action, ActionSender};
use super::SentPacketNotificationReceiver;
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
// INPUT: InputMessage from user
// INPUT2: Acks from mix
@@ -30,7 +19,6 @@ use gateway_client::AcknowledgementReceiver;
use log::*;
use nymsphinx::acknowledgements::AckKey;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::params::PacketMode;
use rand::{rngs::OsRng, CryptoRng, Rng};
use std::sync::Arc;
use std::time::Duration;
@@ -62,14 +50,6 @@ pub struct Config {
/// Average delay an acknowledgement packet is going to get delayed at a single mixnode.
average_ack_delay_duration: Duration,
/// Mode of all mix packets created - VPN or Mix. They indicate whether packets should get delayed
/// and keys reused.
packet_mode: PacketMode,
/// If the mode of the client is set to VPN it specifies number of packets created with the
/// same initial secret until it gets rotated.
vpn_key_reuse_limit: Option<usize>,
}
impl Config {
@@ -81,19 +61,15 @@ impl Config {
average_message_sending_delay: Duration,
average_packet_delay_duration: Duration,
self_recipient: Recipient,
packet_mode: PacketMode,
vpn_key_reuse_limit: Option<usize>,
) -> Self {
Config {
ack_key,
ack_wait_addition,
ack_wait_multiplier,
self_recipient,
average_message_sending_delay,
average_packet_delay_duration,
average_ack_delay_duration,
average_message_sending_delay,
ack_wait_multiplier,
ack_wait_addition,
packet_mode,
vpn_key_reuse_limit,
}
}
}
@@ -134,8 +110,6 @@ impl RealMessagesController<OsRng> {
config.ack_wait_multiplier,
config.average_ack_delay_duration,
config.average_packet_delay_duration,
config.packet_mode,
config.vpn_key_reuse_limit,
);
let ack_control = AcknowledgementController::new(
@@ -171,7 +145,7 @@ impl RealMessagesController<OsRng> {
}
}
pub(super) async fn run(&mut self, vpn_mode: bool) {
pub(super) async fn run(&mut self) {
let mut out_queue_control = self.out_queue_control.take().unwrap();
let mut ack_control = self.ack_control.take().unwrap();
@@ -179,7 +153,7 @@ impl RealMessagesController<OsRng> {
// the task to ever finish. This will of course change once we introduce
// graceful shutdowns.
let out_queue_control_fut = tokio::spawn(async move {
out_queue_control.run_out_queue_control(vpn_mode).await;
out_queue_control.run_out_queue_control().await;
error!("The out queue controller has finished execution!");
out_queue_control
});
@@ -198,9 +172,9 @@ impl RealMessagesController<OsRng> {
// &Handle is only passed for consistency sake with other client modules, but I think
// when we get to refactoring, we should apply gateway approach and make it implicit
pub fn start(mut self, handle: &Handle, vpn_mode: bool) -> JoinHandle<Self> {
pub fn start(mut self, handle: &Handle) -> JoinHandle<Self> {
handle.spawn(async move {
self.run(vpn_mode).await;
self.run().await;
self
})
}
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::mix_traffic::BatchMixMessageSender;
use crate::client::real_messages_control::acknowledgement_control::SentPacketNotificationSender;
@@ -73,7 +62,7 @@ where
/// Internal state, determined by `average_message_sending_delay`,
/// used to keep track of when a next packet should be sent out.
next_delay: time::Delay,
next_delay: Pin<Box<time::Sleep>>,
/// Channel used for sending prepared sphinx packets to `MixTrafficController` that sends them
/// out to the network without any further delays.
@@ -117,7 +106,7 @@ type BatchRealMessageReceiver = mpsc::UnboundedReceiver<Vec<RealMessage>>;
pub(crate) enum StreamMessage {
Cover,
Real(RealMessage),
Real(Box<RealMessage>),
}
impl<R> Stream for OutQueueControl<R>
@@ -128,7 +117,7 @@ where
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
// it is not yet time to return a message
if Pin::new(&mut self.next_delay).poll(cx).is_pending() {
if self.next_delay.as_mut().poll(cx).is_pending() {
return Poll::Pending;
};
@@ -141,11 +130,11 @@ where
// The next interval value is `next_poisson_delay` after the one that just
// yielded.
let next = now + next_poisson_delay;
self.next_delay.reset(next);
self.next_delay.as_mut().reset(next);
// check if we have anything immediately available
if let Some(real_available) = self.received_buffer.pop_front() {
return Poll::Ready(Some(StreamMessage::Real(real_available)));
return Poll::Ready(Some(StreamMessage::Real(Box::new(real_available))));
}
// decide what kind of message to send
@@ -158,9 +147,9 @@ where
Poll::Ready(Some(real_messages)) => {
self.received_buffer = real_messages.into();
// we MUST HAVE received at least ONE message
Poll::Ready(Some(StreamMessage::Real(
Poll::Ready(Some(StreamMessage::Real(Box::new(
self.received_buffer.pop_front().unwrap(),
)))
))))
}
// otherwise construct a dummy one
@@ -173,6 +162,9 @@ impl<R> OutQueueControl<R>
where
R: CryptoRng + Rng + Unpin,
{
// at this point I'm not entirely sure how to deal with this warning without
// some considerable refactoring
#[allow(clippy::too_many_arguments)]
pub(crate) fn new(
config: Config,
ack_key: Arc<AckKey>,
@@ -187,7 +179,7 @@ where
config,
ack_key,
sent_notifier,
next_delay: time::delay_for(Default::default()),
next_delay: Box::pin(time::sleep(Default::default())),
mix_tx,
real_receiver,
our_full_destination,
@@ -257,42 +249,21 @@ where
tokio::task::yield_now().await;
}
async fn on_batch_received(&mut self, real_messages: Vec<RealMessage>) {
let mut mix_packets = Vec::with_capacity(real_messages.len());
for real_message in real_messages.into_iter() {
self.sent_notify(real_message.fragment_id);
mix_packets.push(real_message.mix_packet);
}
self.mix_tx.unbounded_send(mix_packets).unwrap();
}
// Send messages at certain rate and if no real traffic is available, send cover message.
async fn run_normal_out_queue(&mut self) {
// we should set initial delay only when we actually start the stream
self.next_delay = time::delay_for(sample_poisson_duration(
self.next_delay = Box::pin(time::sleep(sample_poisson_duration(
&mut self.rng,
self.config.average_message_sending_delay,
));
)));
while let Some(next_message) = self.next().await {
self.on_message(next_message).await;
}
}
// Send real message as soon as it's available and don't inject ANY cover traffic.
async fn run_vpn_out_queue(&mut self) {
while let Some(next_messages) = self.real_receiver.next().await {
self.on_batch_received(next_messages).await
}
}
pub(crate) async fn run_out_queue_control(&mut self, vpn_mode: bool) {
if vpn_mode {
debug!("Starting out queue controller in vpn mode...");
self.run_vpn_out_queue().await
} else {
debug!("Starting out queue controller...");
self.run_normal_out_queue().await
}
pub(crate) async fn run_out_queue_control(&mut self) {
debug!("Starting out queue controller...");
self.run_normal_out_queue().await
}
}
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::reply_key_storage::ReplyKeyStorage;
use crypto::asymmetric::encryption;
@@ -21,8 +10,8 @@ use futures::lock::Mutex;
use futures::StreamExt;
use gateway_client::MixnetMessageReceiver;
use log::*;
use nymsphinx::anonymous_replies::{encryption_key::EncryptionKeyDigest, SURBEncryptionKey};
use nymsphinx::params::{ReplySURBEncryptionAlgorithm, ReplySURBKeyDigestAlgorithm};
use nymsphinx::anonymous_replies::{encryption_key::EncryptionKeyDigest, SurbEncryptionKey};
use nymsphinx::params::{ReplySurbEncryptionAlgorithm, ReplySurbKeyDigestAlgorithm};
use nymsphinx::receiver::{MessageReceiver, MessageRecoveryError, ReconstructedMessage};
use std::collections::HashSet;
use std::sync::Arc;
@@ -165,7 +154,7 @@ impl ReceivedMessagesBuffer {
// while we're at it, also empty the buffer if we happened to receive anything while
// no sender was connected
let stored_messages = std::mem::replace(&mut guard.messages, Vec::new());
let stored_messages = std::mem::take(&mut guard.messages);
if !stored_messages.is_empty() {
if let Err(err) = sender.unbounded_send(stored_messages) {
error!(
@@ -191,12 +180,12 @@ impl ReceivedMessagesBuffer {
fn process_received_reply(
reply_ciphertext: &[u8],
reply_key: SURBEncryptionKey,
reply_key: SurbEncryptionKey,
) -> Option<ReconstructedMessage> {
let zero_iv = stream_cipher::zero_iv::<ReplySURBEncryptionAlgorithm>();
let zero_iv = stream_cipher::zero_iv::<ReplySurbEncryptionAlgorithm>();
let mut reply_msg = stream_cipher::decrypt::<ReplySURBEncryptionAlgorithm>(
&reply_key.inner(),
let mut reply_msg = stream_cipher::decrypt::<ReplySurbEncryptionAlgorithm>(
reply_key.inner(),
&zero_iv,
reply_ciphertext,
);
@@ -221,7 +210,7 @@ impl ReceivedMessagesBuffer {
let mut completed_messages = Vec::new();
let mut inner_guard = self.inner.lock().await;
let reply_surb_digest_size = ReplySURBKeyDigestAlgorithm::output_size();
let reply_surb_digest_size = ReplySurbKeyDigestAlgorithm::output_size();
// first check if this is a reply or a chunked message
// TODO: verify with @AP if this way of doing it is safe or whether it could
@@ -1,21 +1,10 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use log::*;
use nymsphinx::anonymous_replies::{
encryption_key::EncryptionKeyDigest, encryption_key::Unsigned, SURBEncryptionKey,
SURBEncryptionKeySize,
encryption_key::EncryptionKeyDigest, encryption_key::Unsigned, SurbEncryptionKey,
SurbEncryptionKeySize,
};
use std::path::Path;
@@ -29,7 +18,7 @@ pub enum ReplyKeyStorageError {
/// Permanent storage for keys in all sent [`ReplySURB`]
///
/// Each sent out [`ReplySURB`] has a new key associated with it that is going to be used for
/// payload encryption. In order to decrypt whatever reply we receive, we need to know which
/// payload encryption. In order to -decrypt whatever reply we receive, we need to know which
/// key to use for that purpose. We do it based on received `H(t)` which has to be included
/// with each reply.
/// Moreover, there is no restriction when the [`ReplySURB`] might get used so we need to
@@ -49,24 +38,24 @@ impl ReplyKeyStorage {
Ok(ReplyKeyStorage { db })
}
fn read_encryption_key(&self, raw_key: sled::IVec) -> SURBEncryptionKey {
fn read_encryption_key(&self, raw_key: sled::IVec) -> SurbEncryptionKey {
let key_bytes_ref = raw_key.as_ref();
// if this fails it means we have some database corruption and we
// absolutely can't continue
if key_bytes_ref.len() != SURBEncryptionKeySize::to_usize() {
if key_bytes_ref.len() != SurbEncryptionKeySize::to_usize() {
error!("REPLY KEY STORAGE DATA CORRUPTION - ENCRYPTION KEY HAS INVALID LENGTH");
panic!("REPLY KEY STORAGE DATA CORRUPTION - ENCRYPTION KEY HAS INVALID LENGTH");
}
// this can only fail if the bytes have invalid length but we already asserted it
SURBEncryptionKey::try_from_bytes(key_bytes_ref).unwrap()
SurbEncryptionKey::try_from_bytes(key_bytes_ref).unwrap()
}
// TOOD: perhaps we could also store some part of original message here too?
pub fn insert_encryption_key(
&mut self,
encryption_key: SURBEncryptionKey,
encryption_key: SurbEncryptionKey,
) -> Result<(), ReplyKeyStorageError> {
let digest = encryption_key.compute_digest();
@@ -89,7 +78,7 @@ impl ReplyKeyStorage {
pub fn get_and_remove_encryption_key(
&self,
key_digest: EncryptionKeyDigest,
) -> Result<Option<SURBEncryptionKey>, ReplyKeyStorageError> {
) -> Result<Option<SurbEncryptionKey>, ReplyKeyStorageError> {
let removal_result = match self.db.remove(&key_digest.to_vec()) {
Err(e) => Err(ReplyKeyStorageError::DbReadError(e)),
Ok(existing_key) => {
@@ -1,20 +1,11 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use log::*;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::params::DEFAULT_NUM_MIX_HOPS;
use rand::seq::SliceRandom;
use rand::thread_rng;
use std::ops::Deref;
use std::sync::Arc;
use std::time;
@@ -22,7 +13,8 @@ use std::time::Duration;
use tokio::runtime::Handle;
use tokio::sync::{RwLock, RwLockReadGuard};
use tokio::task::JoinHandle;
use topology::NymTopology;
use topology::{nym_topology_from_bonds, NymTopology};
use url::Url;
// I'm extremely curious why compiler NEVER complained about lack of Debug here before
#[derive(Debug)]
@@ -71,9 +63,9 @@ impl<'a> TopologyReadPermit<'a> {
Some(topology_ref) => {
// see if it's possible to route the packet to both gateways
if !topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
|| !topology_ref.gateway_exists(&ack_recipient.gateway())
|| !topology_ref.gateway_exists(ack_recipient.gateway())
|| if let Some(packet_recipient) = packet_recipient {
!topology_ref.gateway_exists(&packet_recipient.gateway())
!topology_ref.gateway_exists(packet_recipient.gateway())
} else {
false
}
@@ -115,7 +107,7 @@ impl TopologyAccessor {
self.inner.read().await.into()
}
async fn update_global_topology(&mut self, new_topology: Option<NymTopology>) {
async fn update_global_topology(&self, new_topology: Option<NymTopology>) {
self.inner.write().await.update(new_topology);
}
@@ -129,51 +121,159 @@ impl TopologyAccessor {
}
}
impl Default for TopologyAccessor {
fn default() -> Self {
TopologyAccessor::new()
}
}
pub struct TopologyRefresherConfig {
directory_server: String,
validator_api_urls: Vec<Url>,
refresh_rate: time::Duration,
client_version: String,
}
impl TopologyRefresherConfig {
pub fn new(directory_server: String, refresh_rate: time::Duration) -> Self {
pub fn new(
validator_api_urls: Vec<Url>,
refresh_rate: time::Duration,
client_version: String,
) -> Self {
TopologyRefresherConfig {
directory_server,
validator_api_urls,
refresh_rate,
client_version,
}
}
}
pub struct TopologyRefresher {
validator_client: validator_client::Client,
validator_client: validator_client::ApiClient,
client_version: String,
validator_api_urls: Vec<Url>,
topology_accessor: TopologyAccessor,
refresh_rate: Duration,
currently_used_api: usize,
was_latest_valid: bool,
}
impl TopologyRefresher {
pub fn new_directory_client(
cfg: TopologyRefresherConfig,
topology_accessor: TopologyAccessor,
) -> Self {
let validator_client_config = validator_client::Config::new(cfg.directory_server);
let validator_client = validator_client::Client::new(validator_client_config);
pub fn new(mut cfg: TopologyRefresherConfig, topology_accessor: TopologyAccessor) -> Self {
cfg.validator_api_urls.shuffle(&mut thread_rng());
TopologyRefresher {
validator_client,
validator_client: validator_client::ApiClient::new(cfg.validator_api_urls[0].clone()),
client_version: cfg.client_version,
validator_api_urls: cfg.validator_api_urls,
topology_accessor,
refresh_rate: cfg.refresh_rate,
currently_used_api: 0,
was_latest_valid: true,
}
}
fn use_next_validator_api(&mut self) {
if self.validator_api_urls.len() == 1 {
warn!("There's only a single validator API available - it won't be possible to use a different one");
return;
}
self.currently_used_api = (self.currently_used_api + 1) % self.validator_api_urls.len();
self.validator_client
.change_validator_api(self.validator_api_urls[self.currently_used_api].clone())
}
/// Verifies whether nodes a reasonably distributed among all mix layers.
///
/// In ideal world we would have 33% nodes on layer 1, 33% on layer 2 and 33% on layer 3.
/// However, this is a rather unrealistic expectation, instead we check whether there exists
/// a layer with more than 66% of nodes or with fewer than 15% and if so, we trigger a failure.
///
/// # Arguments
///
/// * `topology`: active topology constructed from validator api data
/// * `mixnodes_count`: total number of active mixnodes
fn check_layer_distribution(
&self,
active_topology: &NymTopology,
mixnodes_count: usize,
) -> bool {
let mixes = active_topology.mixes();
if active_topology.gateways().is_empty() {
return false;
}
// trivial check to see if have at least a single node on each layer (regardless of active set size)
if mixes.get(&1).is_none() || mixes.get(&2).is_none() || mixes.get(&3).is_none() {
return false;
}
let upper_bound = (mixnodes_count as f32 * 0.66) as usize;
let lower_bound = (mixnodes_count as f32 * 0.15) as usize;
let layer1 = mixes.get(&1).unwrap().len();
let layer2 = mixes.get(&2).unwrap().len();
let layer3 = mixes.get(&3).unwrap().len();
if layer1 < lower_bound || layer1 > upper_bound {
warn!(
"nodes: {}, layer1: {}, layer2: {}, layer3: {}",
mixnodes_count, layer1, layer2, layer3
);
return false;
}
if layer2 < lower_bound || layer2 > upper_bound {
warn!(
"nodes: {}, layer1: {}, layer2: {}, layer3: {}",
mixnodes_count, layer1, layer2, layer3
);
return false;
}
if layer3 < lower_bound || layer3 > upper_bound {
warn!(
"nodes: {}, layer1: {}, layer2: {}, layer3: {}",
mixnodes_count, layer1, layer2, layer3
);
return false;
}
true
}
async fn get_current_compatible_topology(&self) -> Option<NymTopology> {
match self.validator_client.get_active_topology().await {
// TODO: optimization for the future:
// only refresh mixnodes on timer and refresh gateways only when
// we have to send to a new, unknown, gateway
let mixnodes = match self.validator_client.get_cached_active_mixnodes().await {
Err(err) => {
error!("failed to get active network topology! - {:?}", err);
None
error!("failed to get network mixnodes - {}", err);
return None;
}
Ok(topology) => {
let nym_topology: NymTopology = topology.into();
Some(nym_topology.filter_system_version(env!("CARGO_PKG_VERSION")))
Ok(mixes) => mixes,
};
let gateways = match self.validator_client.get_cached_gateways().await {
Err(err) => {
error!("failed to get network gateways - {}", err);
return None;
}
Ok(gateways) => gateways,
};
let mixnodes_count = mixnodes.len();
let topology =
nym_topology_from_bonds(mixnodes, gateways).filter_system_version(&self.client_version);
if !self.check_layer_distribution(&topology, mixnodes_count) {
warn!("The current filtered active topology has extremely skewed layer distribution. It cannot be used.");
None
} else {
Some(topology)
}
}
@@ -181,6 +281,20 @@ impl TopologyRefresher {
trace!("Refreshing the topology");
let new_topology = self.get_current_compatible_topology().await;
if new_topology.is_none() {
self.use_next_validator_api();
}
if new_topology.is_none() && self.was_latest_valid {
// if we failed to grab this topology, but the one before it was alright, let's assume
// validator had a tiny hiccup and use the old data
warn!("we're going to keep on using the old topology for this iteration");
self.was_latest_valid = false;
return;
} else if new_topology.is_some() {
self.was_latest_valid = true;
}
self.topology_accessor
.update_global_topology(new_topology)
.await;
@@ -193,7 +307,7 @@ impl TopologyRefresher {
pub fn start(mut self, handle: &Handle) -> JoinHandle<()> {
handle.spawn(async move {
loop {
tokio::time::delay_for(self.refresh_rate).await;
tokio::time::sleep(self.refresh_rate).await;
self.refresh().await;
}
})
+98 -177
View File
@@ -1,33 +1,18 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use config::defaults::*;
use config::NymConfig;
use serde::{
de::{self, IntoDeserializer, Visitor},
Deserialize, Deserializer, Serialize,
};
use serde::{Deserialize, Serialize};
use std::marker::PhantomData;
use std::path::PathBuf;
use std::time::Duration;
use url::Url;
pub mod persistence;
pub const MISSING_VALUE: &str = "MISSING VALUE";
// 'CLIENT'
pub const DEFAULT_VALIDATOR_REST_ENDPOINT: &str = "http://testnet-validator1.nymtech.net:8081";
// 'DEBUG'
const DEFAULT_ACK_WAIT_MULTIPLIER: f64 = 1.5;
@@ -35,59 +20,12 @@ const DEFAULT_ACK_WAIT_ADDITION: Duration = Duration::from_millis(1_500);
const DEFAULT_LOOP_COVER_STREAM_AVERAGE_DELAY: Duration = Duration::from_millis(200);
const DEFAULT_MESSAGE_STREAM_AVERAGE_DELAY: Duration = Duration::from_millis(20);
const DEFAULT_AVERAGE_PACKET_DELAY: Duration = Duration::from_millis(50);
const DEFAULT_TOPOLOGY_REFRESH_RATE: Duration = Duration::from_millis(30_000);
const DEFAULT_TOPOLOGY_REFRESH_RATE: Duration = Duration::from_secs(5 * 60); // every 5min
const DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT: Duration = Duration::from_millis(5_000);
const DEFAULT_GATEWAY_RESPONSE_TIMEOUT: Duration = Duration::from_millis(1_500);
const DEFAULT_VPN_KEY_REUSE_LIMIT: usize = 1000;
const ZERO_DELAY: Duration = Duration::from_nanos(0);
// custom function is defined to deserialize based on whether field contains a pre 0.9.0
// u64 interpreted as milliseconds or proper duration introduced in 0.9.0
//
// TODO: when we get to refactoring down the line, this code can just be removed
// and all Duration fields could just have #[serde(with = "humantime_serde")] instead
// reason for that is that we don't expect anyone to be upgrading from pre 0.9.0 when we have,
// for argument sake, 0.11.0 out
fn deserialize_duration<'de, D>(deserializer: D) -> Result<Duration, D::Error>
where
D: Deserializer<'de>,
{
struct DurationVisitor;
impl<'de> Visitor<'de> for DurationVisitor {
type Value = Duration;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("u64 or a duration")
}
fn visit_i64<E>(self, value: i64) -> Result<Duration, E>
where
E: de::Error,
{
self.visit_u64(value as u64)
}
fn visit_u64<E>(self, value: u64) -> Result<Duration, E>
where
E: de::Error,
{
Ok(Duration::from_millis(Deserialize::deserialize(
value.into_deserializer(),
)?))
}
fn visit_str<E>(self, value: &str) -> Result<Duration, E>
where
E: de::Error,
{
humantime_serde::deserialize(value.into_deserializer())
}
}
deserializer.deserialize_any(DurationVisitor)
}
// Set this to a high value for now, so that we don't risk sporadic timeouts that might cause
// bought bandwidth tokens to not have time to be spent; Once we remove the gateway from the
// bandwidth bridging protocol, we can come back to a smaller timeout value
const DEFAULT_GATEWAY_RESPONSE_TIMEOUT: Duration = Duration::from_secs(5 * 60);
pub fn missing_string_value() -> String {
MISSING_VALUE.to_string()
@@ -165,6 +103,17 @@ impl<T: NymConfig> Config<T> {
self::Client::<T>::default_reply_encryption_key_store_path(&id);
}
#[cfg(not(feature = "coconut"))]
if self
.client
.backup_bandwidth_token_keys_dir
.as_os_str()
.is_empty()
{
self.client.backup_bandwidth_token_keys_dir =
self::Client::<T>::default_backup_bandwidth_token_keys_dir(&id);
}
self.client.id = id;
}
@@ -176,24 +125,26 @@ impl<T: NymConfig> Config<T> {
self.client.gateway_listener = gateway_listener.into();
}
pub fn set_custom_validator<S: Into<String>>(&mut self, validator: S) {
self.client.validator_rest_url = validator.into();
#[cfg(not(feature = "coconut"))]
pub fn with_eth_private_key<S: Into<String>>(&mut self, eth_private_key: S) {
self.client.eth_private_key = eth_private_key.into();
}
#[cfg(not(feature = "coconut"))]
pub fn with_eth_endpoint<S: Into<String>>(&mut self, eth_endpoint: S) {
self.client.eth_endpoint = eth_endpoint.into();
}
pub fn set_custom_validator_apis(&mut self, validator_api_urls: Vec<Url>) {
self.client.validator_api_urls = validator_api_urls;
}
pub fn set_high_default_traffic_volume(&mut self) {
self.debug.average_packet_delay = Duration::from_millis(1);
self.debug.average_packet_delay = Duration::from_millis(10);
self.debug.loop_cover_traffic_average_delay = Duration::from_millis(2000000); // basically don't really send cover messages
self.debug.message_sending_average_delay = Duration::from_millis(4); // 250 "real" messages / s
}
pub fn set_vpn_mode(&mut self, vpn_mode: bool) {
self.client.vpn_mode = vpn_mode;
}
pub fn set_vpn_key_reuse_limit(&mut self, reuse_limit: usize) {
self.debug.vpn_key_reuse_limit = Some(reuse_limit)
}
pub fn set_custom_version(&mut self, version: &str) {
self.client.version = version.to_string();
}
@@ -234,8 +185,8 @@ impl<T: NymConfig> Config<T> {
self.client.ack_key_file.clone()
}
pub fn get_validator_rest_endpoint(&self) -> String {
self.client.validator_rest_url.clone()
pub fn get_validator_api_endpoints(&self) -> Vec<Url> {
self.client.validator_api_urls.clone()
}
pub fn get_gateway_id(&self) -> String {
@@ -246,21 +197,28 @@ impl<T: NymConfig> Config<T> {
self.client.gateway_listener.clone()
}
#[cfg(not(feature = "coconut"))]
pub fn get_backup_bandwidth_token_keys_dir(&self) -> PathBuf {
self.client.backup_bandwidth_token_keys_dir.clone()
}
#[cfg(not(feature = "coconut"))]
pub fn get_eth_endpoint(&self) -> String {
self.client.eth_endpoint.clone()
}
#[cfg(not(feature = "coconut"))]
pub fn get_eth_private_key(&self) -> String {
self.client.eth_private_key.clone()
}
// Debug getters
pub fn get_average_packet_delay(&self) -> Duration {
if self.client.vpn_mode {
ZERO_DELAY
} else {
self.debug.average_packet_delay
}
self.debug.average_packet_delay
}
pub fn get_average_ack_delay(&self) -> Duration {
if self.client.vpn_mode {
ZERO_DELAY
} else {
self.debug.average_ack_delay
}
self.debug.average_ack_delay
}
pub fn get_ack_wait_multiplier(&self) -> f64 {
@@ -276,11 +234,7 @@ impl<T: NymConfig> Config<T> {
}
pub fn get_message_sending_average_delay(&self) -> Duration {
if self.client.vpn_mode {
ZERO_DELAY
} else {
self.debug.message_sending_average_delay
}
self.debug.message_sending_average_delay
}
pub fn get_gateway_response_timeout(&self) -> Duration {
@@ -295,21 +249,6 @@ impl<T: NymConfig> Config<T> {
self.debug.topology_resolution_timeout
}
pub fn get_vpn_mode(&self) -> bool {
self.client.vpn_mode
}
pub fn get_vpn_key_reuse_limit(&self) -> Option<usize> {
match self.get_vpn_mode() {
false => None,
true => Some(
self.debug
.vpn_key_reuse_limit
.unwrap_or_else(|| DEFAULT_VPN_KEY_REUSE_LIMIT),
),
}
}
pub fn get_version(&self) -> &str {
&self.client.version
}
@@ -334,15 +273,8 @@ pub struct Client<T> {
/// ID specifies the human readable ID of this particular client.
id: String,
/// URL to the validator server for obtaining network topology.
#[serde(default = "missing_string_value")]
validator_rest_url: String,
/// Special mode of the system such that all messages are sent as soon as they are received
/// and no cover traffic is generated. If set all message delays are set to 0 and overwriting
/// 'Debug' values will have no effect.
#[serde(default)]
vpn_mode: bool,
/// Addresses to APIs running on validator from which the client gets the view of the network.
validator_api_urls: Vec<Url>,
/// Path to file containing private identity key.
private_identity_key_file: PathBuf,
@@ -375,6 +307,20 @@ pub struct Client<T> {
/// Address of the gateway listener to which all client requests should be sent.
gateway_listener: String,
/// Path to directory containing public/private keys used for bandwidth token purchase.
/// Those are saved in case of emergency, to be able to reclaim bandwidth tokens.
/// The public key is the name of the file, while the private key is the content.
#[cfg(not(feature = "coconut"))]
backup_bandwidth_token_keys_dir: PathBuf,
/// Ethereum private key.
#[cfg(not(feature = "coconut"))]
eth_private_key: String,
/// Address to an Ethereum full node.
#[cfg(not(feature = "coconut"))]
eth_endpoint: String,
/// nym_home_directory specifies absolute path to the home nym Clients directory.
/// It is expected to use default value and hence .toml file should not redefine this field.
nym_root_directory: PathBuf,
@@ -389,8 +335,7 @@ impl<T: NymConfig> Default for Client<T> {
Client {
version: env!("CARGO_PKG_VERSION").to_string(),
id: "".to_string(),
validator_rest_url: DEFAULT_VALIDATOR_REST_ENDPOINT.to_string(),
vpn_mode: false,
validator_api_urls: default_api_endpoints(),
private_identity_key_file: Default::default(),
public_identity_key_file: Default::default(),
private_encryption_key_file: Default::default(),
@@ -400,6 +345,12 @@ impl<T: NymConfig> Default for Client<T> {
reply_encryption_key_store_path: Default::default(),
gateway_id: "".to_string(),
gateway_listener: "".to_string(),
#[cfg(not(feature = "coconut"))]
backup_bandwidth_token_keys_dir: Default::default(),
#[cfg(not(feature = "coconut"))]
eth_private_key: "".to_string(),
#[cfg(not(feature = "coconut"))]
eth_endpoint: "".to_string(),
nym_root_directory: T::default_root_directory(),
super_struct: Default::default(),
}
@@ -408,44 +359,43 @@ impl<T: NymConfig> Default for Client<T> {
impl<T: NymConfig> Client<T> {
fn default_private_identity_key_file(id: &str) -> PathBuf {
T::default_data_directory(id).join("private_identity.pem")
T::default_data_directory(Some(id)).join("private_identity.pem")
}
fn default_public_identity_key_file(id: &str) -> PathBuf {
T::default_data_directory(id).join("public_identity.pem")
T::default_data_directory(Some(id)).join("public_identity.pem")
}
fn default_private_encryption_key_file(id: &str) -> PathBuf {
T::default_data_directory(id).join("private_encryption.pem")
T::default_data_directory(Some(id)).join("private_encryption.pem")
}
fn default_public_encryption_key_file(id: &str) -> PathBuf {
T::default_data_directory(id).join("public_encryption.pem")
T::default_data_directory(Some(id)).join("public_encryption.pem")
}
fn default_gateway_shared_key_file(id: &str) -> PathBuf {
T::default_data_directory(id).join("gateway_shared.pem")
T::default_data_directory(Some(id)).join("gateway_shared.pem")
}
fn default_ack_key_file(id: &str) -> PathBuf {
T::default_data_directory(id).join("ack_key.pem")
T::default_data_directory(Some(id)).join("ack_key.pem")
}
fn default_reply_encryption_key_store_path(id: &str) -> PathBuf {
T::default_data_directory(id).join("reply_key_store")
T::default_data_directory(Some(id)).join("reply_key_store")
}
#[cfg(not(feature = "coconut"))]
fn default_backup_bandwidth_token_keys_dir(id: &str) -> PathBuf {
T::default_data_directory(Some(id)).join("backup_bandwidth_token_keys")
}
}
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Logging {}
impl Default for Logging {
fn default() -> Self {
Logging {}
}
}
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[serde(default, deny_unknown_fields)]
pub struct Debug {
@@ -453,20 +403,14 @@ pub struct Debug {
/// sent packet is going to be delayed at any given mix node.
/// So for a packet going through three mix nodes, on average, it will take three times this value
/// until the packet reaches its destination.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
average_packet_delay: Duration,
/// The parameter of Poisson distribution determining how long, on average,
/// sent acknowledgement is going to be delayed at any given mix node.
/// So for an ack going through three mix nodes, on average, it will take three times this value
/// until the packet reaches its destination.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
average_ack_delay: Duration,
/// Value multiplied with the expected round trip time of an acknowledgement packet before
@@ -477,58 +421,36 @@ pub struct Debug {
/// Value added to the expected round trip time of an acknowledgement packet before
/// it is assumed it was lost and retransmission of the data packet happens.
/// In an ideal network with 0 latency, this value would have been 0.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
ack_wait_addition: Duration,
/// The parameter of Poisson distribution determining how long, on average,
/// it is going to take for another loop cover traffic message to be sent.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
loop_cover_traffic_average_delay: Duration,
/// The parameter of Poisson distribution determining how long, on average,
/// it is going to take another 'real traffic stream' message to be sent.
/// If no real packets are available and cover traffic is enabled,
/// a loop cover message is sent instead in order to preserve the rate.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
message_sending_average_delay: Duration,
/// How long we're willing to wait for a response to a message sent to the gateway,
/// before giving up on it.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
gateway_response_timeout: Duration,
/// The uniform delay every which clients are querying the directory server
/// to try to obtain a compatible network topology to send sphinx packets through.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
topology_refresh_rate: Duration,
/// During topology refresh, test packets are sent through every single possible network
/// path. This timeout determines waiting period until it is decided that the packet
/// did not reach its destination.
#[serde(
deserialize_with = "deserialize_duration",
serialize_with = "humantime_serde::serialize"
)]
#[serde(with = "humantime_serde")]
topology_resolution_timeout: Duration,
/// If the mode of the client is set to VPN it specifies number of packets created with the
/// same initial secret until it gets rotated.
vpn_key_reuse_limit: Option<usize>,
}
impl Default for Debug {
@@ -543,7 +465,6 @@ impl Default for Debug {
gateway_response_timeout: DEFAULT_GATEWAY_RESPONSE_TIMEOUT,
topology_refresh_rate: DEFAULT_TOPOLOGY_REFRESH_RATE,
topology_resolution_timeout: DEFAULT_TOPOLOGY_RESOLUTION_TIMEOUT,
vpn_key_reuse_limit: None,
}
}
}
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::config::Config;
use config::NymConfig;
@@ -1,15 +1,4 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub mod key_pathfinder;
+13 -7
View File
@@ -1,8 +1,9 @@
[package]
name = "nym-client"
version = "0.9.0"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
edition = "2018"
rust-version = "1.56"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -16,21 +17,23 @@ futures = "0.3" # bunch of futures stuff, however, now that I think about it, it
# the AsyncRead, AsyncWrite, Stream, Sink, etc. traits could be used from tokio
# channels should really be replaced with crossbeam due to that implementation being more efficient
# and the single instance of abortable we have should really be refactored anyway
url = "2.1" # I think we should just replace it with String
url = "2.2"
clap = "2.33.0" # for the command line arguments
dirs = "3.0" # for determining default store directories in config
dotenv = "0.15.0" # for obtaining environmental variables (only used for RUST_LOG for time being)
log = "0.4" # self explanatory
pretty_env_logger = "0.3" # for formatting log messages
pretty_env_logger = "0.4" # for formatting log messages
rand = {version = "0.7.3", features = ["wasm-bindgen"]} # rng-related traits + some rng implementation to use
serde = { version = "1.0.104", features = ["derive"] } # for config serialization/deserialization
sled = "0.33" # for storage of replySURB decryption keys
tokio = { version = "0.2", features = ["full"] } # async runtime
tokio-tungstenite = "0.11.0" # websocket
sled = "0.34" # for storage of replySURB decryption keys
tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal"] } # async runtime
tokio-tungstenite = "0.14" # websocket
## internal
client-core = { path = "../client-core" }
coconut-interface = { path = "../../common/coconut-interface", optional = true }
credentials = { path = "../../common/credentials", optional = true }
config = { path = "../../common/config" }
crypto = { path = "../../common/crypto" }
gateway-client = { path = "../../common/client-libs/gateway-client" }
@@ -42,5 +45,8 @@ websocket-requests = { path = "websocket-requests" }
validator-client = { path = "../../common/client-libs/validator-client" }
version-checker = { path = "../../common/version-checker" }
[features]
coconut = ["coconut-interface", "credentials", "gateway-requests/coconut", "gateway-client/coconut"]
[dev-dependencies]
serde_json = "1.0" # for the "textsend" example
serde_json = "1.0" # for the "textsend" example
@@ -9,21 +9,21 @@ import (
)
// request tags
const SEND_REQUEST_TAG = 0x00
const REPLY_REQUEST_TAG = 0x01
const SELF_ADDRESS_REQUEST_TAG = 0x02
const sendRequestTag = 0x00
const replyRequestTag = 0x01
const selfAddressRequestTag = 0x02
// response tags
const ERROR_RESPONSE_TAG = 0x00
const RECEIVED_RESPONSE_TAG = 0x01
const SELF_ADDRESS_RESPONSE_TAG = 0x02
const errorResponseTag = 0x00
const receivedResponseTag = 0x01
const selfAddressResponseTag = 0x02
func makeSelfAddressRequest() []byte {
return []byte{SELF_ADDRESS_REQUEST_TAG}
return []byte{selfAddressRequestTag}
}
func parseSelfAddressResponse(rawResponse []byte) []byte {
if len(rawResponse) != 97 || rawResponse[0] != SELF_ADDRESS_RESPONSE_TAG {
if len(rawResponse) != 97 || rawResponse[0] != selfAddressResponseTag {
panic("Received invalid response")
}
return rawResponse[1:]
@@ -38,7 +38,7 @@ func makeSendRequest(recipient []byte, message []byte, withReplySurb bool) []byt
surbByte = 1
}
out := []byte{SEND_REQUEST_TAG, surbByte}
out := []byte{sendRequestTag, surbByte}
out = append(out, recipient...)
out = append(out, messageLen...)
out = append(out, message...)
@@ -53,7 +53,7 @@ func makeReplyRequest(message []byte, replySURB []byte) []byte {
surbLen := make([]byte, 8)
binary.BigEndian.PutUint64(surbLen, uint64(len(replySURB)))
out := []byte{REPLY_REQUEST_TAG}
out := []byte{replyRequestTag}
out = append(out, surbLen...)
out = append(out, replySURB...)
out = append(out, messageLen...)
@@ -63,7 +63,7 @@ func makeReplyRequest(message []byte, replySURB []byte) []byte {
}
func parseReceived(rawResponse []byte) ([]byte, []byte) {
if rawResponse[0] != RECEIVED_RESPONSE_TAG {
if rawResponse[0] != receivedResponseTag {
panic("Received invalid response!")
}
@@ -103,7 +103,7 @@ func parseReceived(rawResponse []byte) ([]byte, []byte) {
}
}
func sendWithoutReply() {
func sendBinaryWithoutReply() {
uri := "ws://localhost:1977"
conn, _, err := websocket.DefaultDialer.Dial(uri, nil)
@@ -122,12 +122,12 @@ func sendWithoutReply() {
}
selfAddress := parseSelfAddressResponse(receivedResponse)
read_data, err := ioutil.ReadFile("dummy_file")
readData, err := ioutil.ReadFile("dummy_file")
if err != nil {
panic(err)
}
sendRequest := makeSendRequest(selfAddress, read_data, false)
sendRequest := makeSendRequest(selfAddress, readData, false)
fmt.Printf("sending content of 'dummy file' over the mix network...\n")
if err = conn.WriteMessage(websocket.BinaryMessage, sendRequest); err != nil {
panic(err)
@@ -144,10 +144,10 @@ func sendWithoutReply() {
panic("did not expect a replySURB!")
}
fmt.Printf("writing the file back to the disk!\n")
ioutil.WriteFile("received_file_noreply", fileData, 0644)
ioutil.WriteFile("received_file_no_reply", fileData, 0644)
}
func sendWithReply() {
func sendBinaryWithReply() {
uri := "ws://localhost:1977"
conn, _, err := websocket.DefaultDialer.Dial(uri, nil)
@@ -212,6 +212,6 @@ func sendWithReply() {
}
func main() {
// sendWithoutReply()
sendWithReply()
// sendBinaryWithoutReply()
sendBinaryWithReply()
}
@@ -4,5 +4,5 @@ go 1.14
require (
github.com/btcsuite/btcutil v1.0.2 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.4.2
)
@@ -0,0 +1,9 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam quis efficitur neque. Quisque aliquet vulputate ante, eget vehicula odio feugiat ac. Nulla ut mattis magna. Aenean tincidunt quis nulla eget eleifend. Cras in pretium sem. Nunc lorem metus, blandit sit amet egestas ut, feugiat quis tellus. Aenean tristique, enim a tincidunt condimentum, eros est blandit nunc, id viverra metus erat at nulla. Vivamus at tellus sodales, feugiat odio vel, laoreet neque. Vivamus posuere nulla ac sodales bibendum.
Vestibulum pulvinar nisi non ultricies egestas. Integer finibus ultrices justo vitae suscipit. Etiam interdum eu justo vel interdum. Morbi sagittis ac nisl quis consequat. Mauris dapibus ut risus ac facilisis. Pellentesque non tortor feugiat, consectetur arcu vel, ullamcorper sapien. Proin sodales purus non orci bibendum, sit amet ultrices justo ullamcorper. Nullam ac risus ac justo ultricies efficitur auctor nec arcu. Etiam sed finibus felis. Suspendisse potenti. Phasellus malesuada velit ac ullamcorper egestas. Sed elementum diam ut est gravida ultricies.
Pellentesque sed metus massa. Cras imperdiet lacus sit amet dolor aliquam, luctus posuere justo hendrerit. Morbi augue ex, gravida a metus sed, scelerisque euismod lacus. Nam consequat sapien ac pellentesque sagittis. Morbi a ultrices massa, vel aliquet ex. Maecenas ac sem diam. Nunc sed erat et ipsum volutpat auctor. Etiam elit felis, commodo vitae ipsum ac, fermentum lobortis arcu. Aliquam eu tempus enim. Curabitur vulputate imperdiet aliquam. Morbi iaculis rhoncus risus at malesuada. Donec accumsan feugiat ligula ut facilisis. Nunc porttitor sit amet est eget malesuada. Sed sed consectetur augue, non dapibus orci. Mauris aliquam pellentesque quam, sit amet pellentesque velit cursus vitae. Morbi sit amet molestie risus.
Nam gravida non ligula a egestas. Fusce sodales, purus id rhoncus mattis, purus est vehicula urna, vel finibus augue velit et est. Donec dictum erat eleifend lobortis iaculis. Praesent id venenatis ante. Donec feugiat, ipsum eget porttitor pulvinar, nisl odio posuere lorem, ut placerat elit nulla a ligula. Suspendisse nec nibh tincidunt, sollicitudin mi a, volutpat ligula. In maximus quam lacus, eget semper dolor sagittis sit amet.
In vitae hendrerit est, quis facilisis dui. In eu ante enim. Nullam hendrerit odio sit amet odio tincidunt eleifend. Aliquam erat volutpat. Curabitur commodo, purus pharetra lobortis rhoncus, tortor massa imperdiet nisl, vel dignissim tortor sem at orci. Aliquam maximus lobortis lacus, eu porttitor purus dapibus ut. Praesent at dapibus felis, efficitur blandit tortor. In hac habitasse platea dictumst. Aenean ultrices, nisl a pretium sagittis, tellus sapien mollis erat, eu consectetur erat mauris sed libero. Duis feugiat dapibus mi, vel ornare velit vehicula mattis. Ut suscipit pharetra leo et sollicitudin.
@@ -26,7 +26,7 @@ func getSelfAddress(conn *websocket.Conn) string {
return responseJSON["address"].(string)
}
func sendWithoutReply() {
func sendTextWithoutReply() {
message := "Hello Nym!"
uri := "ws://localhost:1977"
@@ -62,7 +62,7 @@ func sendWithoutReply() {
fmt.Printf("received %v from the mix network!\n", string(receivedMessage))
}
func sendWithReply() {
func sendTextWithReply() {
message := "Hello Nym!"
uri := "ws://localhost:1977"
@@ -97,13 +97,13 @@ func sendWithReply() {
}
fmt.Printf("received %v from the mix network!\n", string(receivedMessage))
receivedMessageJson := make(map[string]interface{})
if err := json.Unmarshal(receivedMessage, &receivedMessageJson); err != nil {
receivedMessageJSON := make(map[string]interface{})
if err := json.Unmarshal(receivedMessage, &receivedMessageJSON); err != nil {
panic(err)
}
// use the received surb to send an anonymous reply!
replySurb := receivedMessageJson["replySurb"]
replySurb := receivedMessageJSON["replySurb"]
replyMessage := "hello from reply SURB!"
reply, err := json.Marshal(map[string]interface{}{
@@ -129,6 +129,6 @@ func sendWithReply() {
}
func main() {
// sendWithoutReply()
sendWithReply()
// sendTextWithoutReply()
sendTextWithReply()
}
File diff suppressed because it is too large Load Diff
@@ -18,7 +18,7 @@
"author": "Dave Hrycyszyn",
"license": "Apache-2.0",
"devDependencies": {
"autoprefixer": "^9.8.0",
"autoprefixer": "^10.2.6",
"clean-webpack-plugin": "^3.0.0",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11",
+34 -23
View File
@@ -36,31 +36,42 @@
},
"websockets": {
"hashes": [
"sha256:0e4fb4de42701340bd2353bb2eee45314651caa6ccee80dbd5f5d5978888fed5",
"sha256:1d3f1bf059d04a4e0eb4985a887d49195e15ebabc42364f4eb564b1d065793f5",
"sha256:20891f0dddade307ffddf593c733a3fdb6b83e6f9eef85908113e628fa5a8308",
"sha256:295359a2cc78736737dd88c343cd0747546b2174b5e1adc223824bcaf3e164cb",
"sha256:2db62a9142e88535038a6bcfea70ef9447696ea77891aebb730a333a51ed559a",
"sha256:3762791ab8b38948f0c4d281c8b2ddfa99b7e510e46bd8dfa942a5fff621068c",
"sha256:3db87421956f1b0779a7564915875ba774295cc86e81bc671631379371af1170",
"sha256:3ef56fcc7b1ff90de46ccd5a687bbd13a3180132268c4254fc0fa44ecf4fc422",
"sha256:4f9f7d28ce1d8f1295717c2c25b732c2bc0645db3215cf757551c392177d7cb8",
"sha256:5c01fd846263a75bc8a2b9542606927cfad57e7282965d96b93c387622487485",
"sha256:5c65d2da8c6bce0fca2528f69f44b2f977e06954c8512a952222cea50dad430f",
"sha256:751a556205d8245ff94aeef23546a1113b1dd4f6e4d102ded66c39b99c2ce6c8",
"sha256:7ff46d441db78241f4c6c27b3868c9ae71473fe03341340d2dfdbe8d79310acc",
"sha256:965889d9f0e2a75edd81a07592d0ced54daa5b0785f57dc429c378edbcffe779",
"sha256:9b248ba3dd8a03b1a10b19efe7d4f7fa41d158fdaa95e2cf65af5a7b95a4f989",
"sha256:9bef37ee224e104a413f0780e29adb3e514a5b698aabe0d969a6ba426b8435d1",
"sha256:c1ec8db4fac31850286b7cd3b9c0e1b944204668b8eb721674916d4e28744092",
"sha256:c8a116feafdb1f84607cb3b14aa1418424ae71fee131642fc568d21423b51824",
"sha256:ce85b06a10fc65e6143518b96d3dca27b081a740bae261c2fb20375801a9d56d",
"sha256:d705f8aeecdf3262379644e4b55107a3b55860eb812b673b28d0fbc347a60c55",
"sha256:e898a0863421650f0bebac8ba40840fc02258ef4714cb7e1fd76b6a6354bda36",
"sha256:f8a7bff6e8664afc4e6c28b983845c5bc14965030e3fb98789734d416af77c4b"
"sha256:0dd4eb8e0bbf365d6f652711ce21b8fd2b596f873d32aabb0fbb53ec604418cc",
"sha256:1d0971cc7251aeff955aa742ec541ee8aaea4bb2ebf0245748fbec62f744a37e",
"sha256:1d6b4fddb12ab9adf87b843cd4316c4bd602db8d5efd2fb83147f0458fe85135",
"sha256:230a3506df6b5f446fed2398e58dcaafdff12d67fe1397dff196411a9e820d02",
"sha256:276d2339ebf0df4f45df453923ebd2270b87900eda5dfd4a6b0cfa15f82111c3",
"sha256:2cf04601633a4ec176b9cc3d3e73789c037641001dbfaf7c411f89cd3e04fcaf",
"sha256:3ddff38894c7857c476feb3538dd847514379d6dc844961dc99f04b0384b1b1b",
"sha256:48c222feb3ced18f3dc61168ca18952a22fb88e5eb8902d2bf1b50faefdc34a2",
"sha256:51d04df04ed9d08077d10ccbe21e6805791b78eac49d16d30a1f1fe2e44ba0af",
"sha256:597c28f3aa7a09e8c070a86b03107094ee5cdafcc0d55f2f2eac92faac8dc67d",
"sha256:5c8f0d82ea2468282e08b0cf5307f3ad022290ed50c45d5cb7767957ca782880",
"sha256:7189e51955f9268b2bdd6cc537e0faa06f8fffda7fb386e5922c6391de51b077",
"sha256:7df3596838b2a0c07c6f6d67752c53859a54993d4f062689fdf547cb56d0f84f",
"sha256:826ccf85d4514609219725ba4a7abd569228c2c9f1968e8be05be366f68291ec",
"sha256:836d14eb53b500fd92bd5db2fc5894f7c72b634f9c2a28f546f75967503d8e25",
"sha256:85db8090ba94e22d964498a47fdd933b8875a1add6ebc514c7ac8703eb97bbf0",
"sha256:85e701a6c316b7067f1e8675c638036a796fe5116783a4c932e7eb8e305a3ffe",
"sha256:900589e19200be76dd7cbaa95e9771605b5ce3f62512d039fb3bc5da9014912a",
"sha256:9147868bb0cc01e6846606cd65cbf9c58598f187b96d14dd1ca17338b08793bb",
"sha256:9e7fdc775fe7403dbd8bc883ba59576a6232eac96dacb56512daacf7af5d618d",
"sha256:ab5ee15d3462198c794c49ccd31773d8a2b8c17d622aa184f669d2b98c2f0857",
"sha256:ad893d889bc700a5835e0a95a3e4f2c39e91577ab232a3dc03c262a0f8fc4b5c",
"sha256:b2e71c4670ebe1067fa8632f0d081e47254ee2d3d409de54168b43b0ba9147e0",
"sha256:b43b13e5622c5a53ab12f3272e6f42f1ce37cd5b6684b2676cb365403295cd40",
"sha256:b4ad84b156cf50529b8ac5cc1638c2cf8680490e3fccb6121316c8c02620a2e4",
"sha256:be5fd35e99970518547edc906efab29afd392319f020c3c58b0e1a158e16ed20",
"sha256:caa68c95bc1776d3521f81eeb4d5b9438be92514ec2a79fececda814099c8314",
"sha256:d144b350045c53c8ff09aa1cfa955012dd32f00c7e0862c199edcabb1a8b32da",
"sha256:d2c2d9b24d3c65b5a02cac12cbb4e4194e590314519ed49db2f67ef561c3cf58",
"sha256:e9e5fd6dbdf95d99bc03732ded1fc8ef22ebbc05999ac7e0c7bf57fe6e4e5ae2",
"sha256:ebf459a1c069f9866d8569439c06193c586e72c9330db1390af7c6a0a32c4afd",
"sha256:f31722f1c033c198aa4a39a01905951c00bd1c74f922e8afc1b1c62adbcdd56a",
"sha256:f68c352a68e5fdf1e97288d5cec9296664c590c25932a8476224124aaf90dbcd"
],
"index": "pypi",
"version": "==8.1"
"version": "==9.1"
}
},
"develop": {}
@@ -1,13 +1,15 @@
use futures::{SinkExt, StreamExt};
use nymsphinx::addressing::clients::Recipient;
use tokio::net::TcpStream;
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocketStream};
use tokio_tungstenite::{
connect_async, tungstenite::protocol::Message, MaybeTlsStream, WebSocketStream,
};
use websocket_requests::{requests::ClientRequest, responses::ServerResponse};
// just helpers functions that work in this very particular context because we are sending to ourselves
// and hence will always get a response back (i.e. the message we sent)
async fn send_message_and_get_response(
ws_stream: &mut WebSocketStream<TcpStream>,
ws_stream: &mut WebSocketStream<MaybeTlsStream<TcpStream>>,
req: Vec<u8>,
) -> ServerResponse {
ws_stream.send(Message::Binary(req)).await.unwrap();
@@ -18,7 +20,7 @@ async fn send_message_and_get_response(
}
}
async fn get_self_address(ws_stream: &mut WebSocketStream<TcpStream>) -> Recipient {
async fn get_self_address(ws_stream: &mut WebSocketStream<MaybeTlsStream<TcpStream>>) -> Recipient {
let self_address_request = ClientRequest::SelfAddress.serialize();
let response = send_message_and_get_response(ws_stream, self_address_request).await;
@@ -1,7 +1,9 @@
use futures::{SinkExt, StreamExt};
use serde_json::json;
use tokio::net::TcpStream;
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocketStream};
use tokio_tungstenite::{
connect_async, tungstenite::protocol::Message, MaybeTlsStream, WebSocketStream,
};
// PREFACE: in practice I don't see why you would ever want to use text api while in Rust, but example
// is here for the completion sake
@@ -9,7 +11,7 @@ use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocket
// just helpers functions that work in this very particular context because we are sending to ourselves
// and hence will always get a response back (i.e. the message we sent)
async fn send_message_and_get_json_response(
ws_stream: &mut WebSocketStream<TcpStream>,
ws_stream: &mut WebSocketStream<MaybeTlsStream<TcpStream>>,
text_req: String,
) -> serde_json::Value {
ws_stream.send(Message::Text(text_req)).await.unwrap();
@@ -20,7 +22,7 @@ async fn send_message_and_get_json_response(
}
}
async fn get_self_address(ws_stream: &mut WebSocketStream<TcpStream>) -> String {
async fn get_self_address(ws_stream: &mut WebSocketStream<MaybeTlsStream<TcpStream>>) -> String {
let self_address_request = json!({ "type": "selfAddress" }).to_string();
let response = send_message_and_get_json_response(ws_stream, self_address_request).await;
+4 -16
View File
@@ -1,28 +1,16 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::template::config_template;
use client_core::config::Config as BaseConfig;
pub use client_core::config::MISSING_VALUE;
use config::defaults::DEFAULT_WEBSOCKET_LISTENING_PORT;
use config::NymConfig;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
mod template;
const DEFAULT_LISTENING_PORT: u16 = 1977;
#[derive(Debug, Deserialize, PartialEq, Serialize, Clone, Copy)]
#[serde(deny_unknown_fields)]
pub enum SocketType {
@@ -128,7 +116,7 @@ impl Default for Socket {
fn default() -> Self {
Socket {
socket_type: SocketType::WebSocket,
listening_port: DEFAULT_LISTENING_PORT,
listening_port: DEFAULT_WEBSOCKET_LISTENING_PORT,
}
}
}
+20 -21
View File
@@ -1,22 +1,11 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub(crate) fn config_template() -> &'static str {
// While using normal toml marshalling would have been way simpler with less overhead,
// I think it's useful to have comments attached to the saved config file to explain behaviour of
// particular fields.
// Note: any changes to the template must be reflected in the appropriate structs in mod.rs.
// Note: any changes to the template must be reflected in the appropriate structs in verloc.
r#"
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
@@ -30,13 +19,12 @@ version = '{{ client.version }}'
# Human readable ID of this particular client.
id = '{{ client.id }}'
# URL to the validator server for obtaining network topology.
validator_rest_url = '{{ client.validator_rest_url }}'
# Special mode of the system such that all messages are sent as soon as they are received
# and no cover traffic is generated. If set all message delays are set to 0 and overwriting
# 'Debug' values will have no effect.
vpn_mode = {{ client.vpn_mode }}
# Addresses to APIs running on validator from which the client gets the view of the network.
validator_api_urls = [
{{#each client.validator_api_urls }}
'{{this}}',
{{/each}}
]
# Path to file containing private identity key.
private_identity_key_file = '{{ client.private_identity_key_file }}'
@@ -54,6 +42,17 @@ public_encryption_key_file = '{{ client.public_encryption_key_file }}'
# sent but not received back.
reply_encryption_key_store_path = '{{ client.reply_encryption_key_store_path }}'
# Path to directory containing public/private keys used for bandwidth token purchase.
# Those are saved in case of emergency, to be able to reclaim bandwidth tokens.
# The public key is the name of the file, while the private key is the content.
backup_bandwidth_token_keys_dir = '{{ client.backup_bandwidth_token_keys_dir }}'
# Ethereum private key.
eth_private_key = '{{ client.eth_private_key }}'
# Addess to an Ethereum full node.
eth_endpoint = '{{ client.eth_endpoint }}'
##### additional client config options #####
# ID of the gateway from which the client should be fetching messages.
+64 -74
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::{Config, SocketType};
use crate::websocket;
@@ -42,11 +31,12 @@ use gateway_client::{
use log::*;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::addressing::nodes::NodeIdentity;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::params::PacketMode;
use nymsphinx::anonymous_replies::ReplySurb;
use nymsphinx::receiver::ReconstructedMessage;
use tokio::runtime::Runtime;
use gateway_client::bandwidth::BandwidthController;
pub(crate) mod config;
pub struct NymClient {
@@ -106,21 +96,20 @@ impl NymClient {
info!("Starting loop cover traffic stream...");
// we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())"
// set in the constructor which HAS TO be called within context of a tokio runtime
self.runtime
.enter(|| {
LoopCoverTrafficStream::new(
self.key_manager.ack_key(),
self.config.get_base().get_average_ack_delay(),
self.config.get_base().get_average_packet_delay(),
self.config
.get_base()
.get_loop_cover_traffic_average_delay(),
mix_tx,
self.as_mix_recipient(),
topology_accessor,
)
})
.start(self.runtime.handle());
let _guard = self.runtime.enter();
LoopCoverTrafficStream::new(
self.key_manager.ack_key(),
self.config.get_base().get_average_ack_delay(),
self.config.get_base().get_average_packet_delay(),
self.config
.get_base()
.get_loop_cover_traffic_average_delay(),
mix_tx,
self.as_mix_recipient(),
topology_accessor,
)
.start(self.runtime.handle());
}
fn start_real_traffic_controller(
@@ -131,12 +120,6 @@ impl NymClient {
input_receiver: InputMessageReceiver,
mix_sender: BatchMixMessageSender,
) {
let packet_mode = if self.config.get_base().get_vpn_mode() {
PacketMode::VPN
} else {
PacketMode::Mix
};
let controller_config = real_messages_control::Config::new(
self.key_manager.ack_key(),
self.config.get_base().get_ack_wait_multiplier(),
@@ -145,26 +128,23 @@ impl NymClient {
self.config.get_base().get_message_sending_average_delay(),
self.config.get_base().get_average_packet_delay(),
self.as_mix_recipient(),
packet_mode,
self.config.get_base().get_vpn_key_reuse_limit(),
);
info!("Starting real traffic stream...");
// we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())"
// set in the constructor [of OutQueueControl] which HAS TO be called within context of a tokio runtime
// When refactoring this restriction should definitely be removed.
let real_messages_controller = self.runtime.enter(|| {
RealMessagesController::new(
controller_config,
ack_receiver,
input_receiver,
mix_sender,
topology_accessor,
reply_key_storage,
)
});
real_messages_controller
.start(self.runtime.handle(), self.config.get_base().get_vpn_mode());
let _guard = self.runtime.enter();
RealMessagesController::new(
controller_config,
ack_receiver,
input_receiver,
mix_sender,
topology_accessor,
reply_key_storage,
)
.start(self.runtime.handle());
}
// buffer controlling all messages fetched from provider
@@ -202,41 +182,53 @@ impl NymClient {
let gateway_identity = identity::PublicKey::from_base58_string(gateway_id)
.expect("provided gateway id is invalid!");
let mut gateway_client = GatewayClient::new(
gateway_address,
self.key_manager.identity_keypair(),
gateway_identity,
Some(self.key_manager.gateway_shared_key()),
mixnet_message_sender,
ack_sender,
self.config.get_base().get_gateway_response_timeout(),
);
self.runtime.block_on(async {
#[cfg(feature = "coconut")]
let bandwidth_controller = BandwidthController::new(
self.config.get_base().get_validator_api_endpoints(),
*self.key_manager.identity_keypair().public_key(),
);
#[cfg(not(feature = "coconut"))]
let bandwidth_controller = BandwidthController::new(
self.config.get_base().get_eth_endpoint(),
self.config.get_base().get_eth_private_key(),
self.config.get_base().get_backup_bandwidth_token_keys_dir(),
)
.expect("Could not create bandwidth controller");
let mut gateway_client = GatewayClient::new(
gateway_address,
self.key_manager.identity_keypair(),
gateway_identity,
Some(self.key_manager.gateway_shared_key()),
mixnet_message_sender,
ack_sender,
self.config.get_base().get_gateway_response_timeout(),
Some(bandwidth_controller),
);
gateway_client
.authenticate_and_start()
.await
.expect("could not authenticate and start up the gateway connection")
});
.expect("could not authenticate and start up the gateway connection");
gateway_client
gateway_client
})
}
// future responsible for periodically polling directory server and updating
// the current global view of topology
fn start_topology_refresher(&mut self, topology_accessor: TopologyAccessor) {
let topology_refresher_config = TopologyRefresherConfig::new(
self.config.get_base().get_validator_rest_endpoint(),
self.config.get_base().get_validator_api_endpoints(),
self.config.get_base().get_topology_refresh_rate(),
env!("CARGO_PKG_VERSION").to_string(),
);
let mut topology_refresher =
TopologyRefresher::new_directory_client(topology_refresher_config, topology_accessor);
TopologyRefresher::new(topology_refresher_config, topology_accessor);
// before returning, block entire runtime to refresh the current network view so that any
// components depending on topology would see a non-empty view
info!(
"Obtaining initial network topology from {}",
self.config.get_base().get_validator_rest_endpoint()
);
info!("Obtaining initial network topology");
self.runtime.block_on(topology_refresher.refresh());
// TODO: a slightly more graceful termination here
@@ -297,7 +289,7 @@ impl NymClient {
/// EXPERIMENTAL DIRECT RUST API
/// It's untested and there are absolutely no guarantees about it (but seems to have worked
/// well enough in local tests)
pub fn send_reply(&mut self, reply_surb: ReplySURB, message: Vec<u8>) {
pub fn send_reply(&mut self, reply_surb: ReplySurb, message: Vec<u8>) {
let input_msg = InputMessage::new_reply(reply_surb, message);
self.input_tx
@@ -335,7 +327,7 @@ impl NymClient {
}
println!(
"Received SIGINT - the client will terminate now (threads are not YET nicely stopped)"
"Received SIGINT - the client will terminate now (threads are not yet nicely stopped, if you see stack traces that's alright)."
);
}
@@ -389,9 +381,7 @@ impl NymClient {
sphinx_message_sender.clone(),
);
if !self.config.get_base().get_vpn_mode() {
self.start_cover_traffic_stream(shared_topology_accessor, sphinx_message_sender);
}
self.start_cover_traffic_stream(shared_topology_accessor, sphinx_message_sender);
match self.config.get_socket_type() {
SocketType::WebSocket => {
+93 -51
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use crate::commands::override_config;
@@ -18,17 +7,22 @@ use clap::{App, Arg, ArgMatches};
use client_core::client::key_manager::KeyManager;
use client_core::config::persistence::key_pathfinder::ClientKeyPathfinder;
use config::NymConfig;
use crypto::asymmetric::identity;
use crypto::asymmetric::{encryption, identity};
use gateway_client::GatewayClient;
use gateway_requests::registration::handshake::SharedKeys;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::addressing::nodes::NodeIdentity;
use rand::rngs::OsRng;
use rand::seq::SliceRandom;
use rand::thread_rng;
use std::convert::TryInto;
use std::sync::Arc;
use std::time::Duration;
use topology::{gateway, NymTopology};
use topology::{filter::VersionFilterable, gateway};
use url::Url;
pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
App::new("init")
let app = App::new("init")
.about("Initialise a Nym client. Do this first!")
.arg(Arg::with_name("id")
.long("id")
@@ -41,10 +35,10 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Id of the gateway we are going to connect to.")
.takes_value(true)
)
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
.arg(Arg::with_name("validators")
.long("validators")
.help("Comma separated list of rest endpoints of the validators")
.takes_value(true),
)
.arg(Arg::with_name("disable-socket")
.long("disable-socket")
@@ -56,31 +50,34 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Port for the socket (if applicable) to listen on in all subsequent runs")
.takes_value(true)
)
.arg(Arg::with_name("vpn-mode")
.long("vpn-mode")
.help("Set the vpn mode of the client")
.long_help(
r#"
Special mode of the system such that all messages are sent as soon as they are received
and no cover traffic is generated. If set all message delays are set to 0 and overwriting
'Debug' values will have no effect.
"#
)
)
.arg(Arg::with_name("fastmode")
.long("fastmode")
.hidden(true) // this will prevent this flag from being displayed in `--help`
.help("Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init")
)
);
#[cfg(not(feature = "coconut"))]
let app = app
.arg(Arg::with_name("eth_endpoint")
.long("eth_endpoint")
.help("URL of an Ethereum full node that we want to use for getting bandwidth tokens from ERC20 tokens")
.takes_value(true)
.required(true))
.arg(Arg::with_name("eth_private_key")
.long("eth_private_key")
.help("Ethereum private key used for obtaining bandwidth tokens from ERC20 tokens")
.takes_value(true)
.required(true));
app
}
async fn register_with_gateway(
gateway: &gateway::Node,
our_identity: Arc<identity::KeyPair>,
) -> SharedKeys {
) -> Arc<SharedKeys> {
let timeout = Duration::from_millis(1500);
let mut gateway_client = GatewayClient::new_init(
gateway.client_listener.clone(),
gateway.clients_address(),
gateway.identity_key,
our_identity.clone(),
timeout,
@@ -90,44 +87,87 @@ async fn register_with_gateway(
.await
.expect("failed to establish connection with the gateway!");
gateway_client
.register()
.perform_initial_authentication()
.await
.expect("failed to register with the gateway!")
}
async fn gateway_details(validator_server: &str, chosen_gateway_id: Option<&str>) -> gateway::Node {
let validator_client_config = validator_client::Config::new(validator_server.to_string());
let validator_client = validator_client::Client::new(validator_client_config);
let topology = validator_client.get_active_topology().await.unwrap();
let nym_topology: NymTopology = topology.into();
let version_filtered_topology = nym_topology.filter_system_version(env!("CARGO_PKG_VERSION"));
async fn gateway_details(
validator_servers: Vec<Url>,
chosen_gateway_id: Option<&str>,
) -> gateway::Node {
let validator_api = validator_servers
.choose(&mut thread_rng())
.expect("The list of validator apis is empty");
let validator_client = validator_client::ApiClient::new(validator_api.clone());
let gateways = validator_client.get_cached_gateways().await.unwrap();
let valid_gateways = gateways
.into_iter()
.filter_map(|gateway| gateway.try_into().ok())
.collect::<Vec<gateway::Node>>();
let filtered_gateways = valid_gateways.filter_by_version(env!("CARGO_PKG_VERSION"));
// if we have chosen particular gateway - use it, otherwise choose a random one.
// (remember that in active topology all gateways have at least 100 reputation so should
// be working correctly)
if let Some(gateway_id) = chosen_gateway_id {
version_filtered_topology
.gateways()
filtered_gateways
.iter()
.find(|gateway| gateway.identity_key.to_base58_string() == gateway_id)
.expect(&*format!("no gateway with id {} exists!", gateway_id))
.clone()
} else {
version_filtered_topology
.gateways()
filtered_gateways
.choose(&mut rand::thread_rng())
.expect("there are no gateways on the network!")
.clone()
}
}
fn show_address(config: &Config) {
fn load_identity_keys(pathfinder: &ClientKeyPathfinder) -> identity::KeyPair {
let identity_keypair: identity::KeyPair =
pemstore::load_keypair(&pemstore::KeyPairPath::new(
pathfinder.private_identity_key().to_owned(),
pathfinder.public_identity_key().to_owned(),
))
.expect("Failed to read stored identity key files");
identity_keypair
}
fn load_sphinx_keys(pathfinder: &ClientKeyPathfinder) -> encryption::KeyPair {
let sphinx_keypair: encryption::KeyPair =
pemstore::load_keypair(&pemstore::KeyPairPath::new(
pathfinder.private_encryption_key().to_owned(),
pathfinder.public_encryption_key().to_owned(),
))
.expect("Failed to read stored sphinx key files");
sphinx_keypair
}
let pathfinder = ClientKeyPathfinder::new_from_config(config.get_base());
let identity_keypair = load_identity_keys(&pathfinder);
let sphinx_keypair = load_sphinx_keys(&pathfinder);
let client_recipient = Recipient::new(
*identity_keypair.public_key(),
*sphinx_keypair.public_key(),
// TODO: below only works under assumption that gateway address == gateway id
// (which currently is true)
NodeIdentity::from_base58_string(config.get_base().get_gateway_id()).unwrap(),
);
println!("\nThe address of this client is: {}", client_recipient);
}
pub fn execute(matches: &ArgMatches) {
println!("Initialising client...");
let id = matches.value_of("id").unwrap(); // required for now
let already_init = if Config::default_config_file_path(id).exists() {
let already_init = if Config::default_config_file_path(Some(id)).exists() {
println!("Client \"{}\" was already initialised before! Config information will be overwritten (but keys will be kept)!", id);
true
} else {
@@ -155,7 +195,7 @@ pub fn execute(matches: &ArgMatches) {
let registration_fut = async {
let gate_details = gateway_details(
&config.get_base().get_validator_rest_endpoint(),
config.get_base().get_validator_api_endpoints(),
chosen_gateway_id,
)
.await;
@@ -164,11 +204,11 @@ pub fn execute(matches: &ArgMatches) {
.with_gateway_id(gate_details.identity_key.to_base58_string());
let shared_keys =
register_with_gateway(&gate_details, key_manager.identity_keypair()).await;
(shared_keys, gate_details.client_listener)
(shared_keys, gate_details.clients_address())
};
// TODO: is there perhaps a way to make it work without having to spawn entire runtime?
let mut rt = tokio::runtime::Runtime::new().unwrap();
let rt = tokio::runtime::Runtime::new().unwrap();
let (shared_keys, gateway_listener) = rt.block_on(registration_fut);
config
.get_base_mut()
@@ -188,5 +228,7 @@ pub fn execute(matches: &ArgMatches) {
.expect("Failed to save the config file");
println!("Saved configuration file to {:?}", config_save_location);
println!("Using gateway: {}", config.get_base().get_gateway_id(),);
println!("Client configuration completed.\n\n\n")
println!("Client configuration completed.\n\n\n");
show_address(&config);
}
+27 -19
View File
@@ -1,27 +1,30 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::{Config, SocketType};
use clap::ArgMatches;
use url::Url;
pub(crate) mod init;
pub(crate) mod run;
pub(crate) mod upgrade;
fn parse_validators(raw: &str) -> Vec<Url> {
raw.split(',')
.map(|raw_validator| {
raw_validator
.trim()
.parse()
.expect("one of the provided validator api urls is invalid")
})
.collect()
}
pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
if let Some(validator) = matches.value_of("validator") {
config.get_base_mut().set_custom_validator(validator);
if let Some(raw_validators) = matches.value_of("validators") {
config
.get_base_mut()
.set_custom_validator_apis(parse_validators(raw_validators));
}
if let Some(gateway_id) = matches.value_of("gateway") {
@@ -32,10 +35,6 @@ pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Confi
config = config.with_socket(SocketType::None);
}
if matches.is_present("vpn-mode") {
config.get_base_mut().set_vpn_mode(true);
}
if let Some(port) = matches.value_of("port").map(|port| port.parse::<u16>()) {
if let Err(err) = port {
// if port was overridden, it must be parsable
@@ -44,5 +43,14 @@ pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Confi
config = config.with_port(port.unwrap());
}
#[cfg(not(feature = "coconut"))]
if let Some(eth_endpoint) = matches.value_of("eth_endpoint") {
config.get_base_mut().with_eth_endpoint(eth_endpoint);
}
#[cfg(not(feature = "coconut"))]
if let Some(eth_private_key) = matches.value_of("eth_private_key") {
config.get_base_mut().with_eth_private_key(eth_private_key);
}
config
}
+21 -31
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use crate::client::NymClient;
@@ -21,7 +10,7 @@ use log::*;
use version_checker::is_minor_version_compatible;
pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
App::new("run")
let app = App::new("run")
.about("Run the Nym client with provided configuration client optionally overriding set parameters")
.arg(Arg::with_name("id")
.long("id")
@@ -30,10 +19,10 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.required(true)
)
// the rest of arguments are optional, they are used to override settings in config file
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
.arg(Arg::with_name("validators")
.long("validators")
.help("Comma separated list rest rest endpoints of the validators")
.takes_value(true),
)
.arg(Arg::with_name("gateway")
.long("gateway")
@@ -44,23 +33,24 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.long("disable-socket")
.help("Whether to not start the websocket")
)
.arg(Arg::with_name("vpn-mode")
.long("vpn-mode")
.help("Set the vpn mode of the client")
.long_help(
r#"
Special mode of the system such that all messages are sent as soon as they are received
and no cover traffic is generated. If set all message delays are set to 0 and overwriting
'Debug' values will have no effect.
"#
)
)
.arg(Arg::with_name("port")
.short("p")
.long("port")
.help("Port for the socket (if applicable) to listen on")
.takes_value(true)
)
);
#[cfg(not(feature = "coconut"))]
let app = app
.arg(Arg::with_name("eth_endpoint")
.long("eth_endpoint")
.help("URL of an Ethereum full node that we want to use for getting bandwidth tokens from ERC20 tokens")
.takes_value(true))
.arg(Arg::with_name("eth_private_key")
.long("eth_private_key")
.help("Ethereum private key used for obtaining bandwidth tokens from ERC20 tokens")
.takes_value(true));
app
}
// this only checks compatibility between config the binary. It does not take into consideration
@@ -85,7 +75,7 @@ fn version_check(cfg: &Config) -> bool {
pub fn execute(matches: &ArgMatches) {
let id = matches.value_of("id").unwrap();
let mut config = match Config::load_from_file(id) {
let mut config = match Config::load_from_file(Some(id)) {
Ok(cfg) => cfg,
Err(err) => {
error!("Failed to load config for {}. Are you sure you have run `init` before? (Error was: {})", id, err);
+104 -120
View File
@@ -1,28 +1,23 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::{Config, MISSING_VALUE};
use clap::{App, Arg, ArgMatches};
use client_core::config::DEFAULT_VALIDATOR_REST_ENDPOINT;
use config::defaults::default_api_endpoints;
use config::NymConfig;
use std::fmt::Display;
use std::process;
use version_checker::{parse_version, Version};
use version_checker::Version;
#[allow(dead_code)]
fn fail_upgrade<D1: Display, D2: Display>(from_version: D1, to_version: D2) -> ! {
print_failed_upgrade(from_version, to_version);
process::exit(1)
}
fn print_start_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
println!(
"\n==================\nTrying to upgrade mixnode from {} to {} ...",
"\n==================\nTrying to upgrade client from {} to {} ...",
from, to
);
}
@@ -41,147 +36,136 @@ fn print_successful_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
);
}
fn pre_090_upgrade(from: &str, mut config: Config) -> Config {
// this is not extracted to separate function as you only have to manually pass version
// if upgrading from pre090 version
let from = match from.strip_prefix("v") {
Some(stripped) => stripped,
None => from,
};
fn outdated_upgrade(config_version: &Version, package_version: &Version) -> ! {
eprintln!(
"Cannot perform upgrade from {} to {}. Your version is too old to perform the upgrade.!",
config_version, package_version
);
process::exit(1)
}
let from = match from.strip_prefix("V") {
Some(stripped) => stripped,
None => from,
};
fn unsupported_upgrade(current_version: &Version, config_version: &Version) -> ! {
eprintln!("Cannot perform upgrade from {} to {}. Please let the developers know about this issue if you expected it to work!", config_version, current_version);
process::exit(1)
}
let from_version = parse_version(from).expect("invalid version provided!");
if from_version.major == 0 && from_version.minor < 8 {
// technically this could be implemented, but is there any point in that?
eprintln!("upgrading node from before v0.8.0 is not supported. Please run `init` with new binary instead");
pub fn command_args<'a, 'b>() -> App<'a, 'b> {
App::new("upgrade").about("Try to upgrade the client").arg(
Arg::with_name("id")
.long("id")
.help("Id of the nym-client we want to upgrade")
.takes_value(true)
.required(true),
)
}
fn parse_config_version(config: &Config) -> Version {
let version = Version::parse(config.get_base().get_version()).unwrap_or_else(|err| {
eprintln!("failed to parse client version! - {:?}", err);
process::exit(1)
});
if version.is_prerelease() || !version.build.is_empty() {
eprintln!(
"Trying to upgrade from a non-released version {}. This is not supported!",
version
);
process::exit(1)
}
if (from_version.major == 0 && from_version.minor >= 9) || from_version.major >= 1 {
eprintln!("self reported version is higher than 0.9.0. Those releases should have already contained version numbers in config! Make sure you provided correct version");
version
}
fn parse_package_version() -> Version {
let version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
// technically this is not a correct way of checking it as a released version might contain valid build identifiers
// however, we are not using them ourselves at the moment and hence it should be fine.
// if we change our mind, we could easily tweak this code
if version.is_prerelease() || !version.build.is_empty() {
eprintln!(
"Trying to upgrade to a non-released version {}. This is not supported!",
version
);
process::exit(1)
}
// note: current is guaranteed to not have any `build` information suffix (nor pre-release
// information), as this was asserted at the beginning of this command)
//
// upgrade to current (if it's a 0.9.X) or try to upgrade to 0.9.0 as an intermediate
// step in future upgrades (so, for example, we might go 0.8.0 -> 0.9.0 -> 0.10.0)
// this way we don't need to have all the crazy paths on how to upgrade from any version to any
// other version. We just upgrade one minor version at a time.
let current = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
let to_version = if current.major == 0 && current.minor == 9 {
current
version
}
fn minor_0_12_upgrade(
mut config: Config,
_matches: &ArgMatches,
config_version: &Version,
package_version: &Version,
) -> Config {
let to_version = if package_version.major == 0 && package_version.minor == 12 {
package_version.clone()
} else {
Version::new(0, 9, 0)
Version::new(0, 12, 0)
};
if config.get_base().get_validator_rest_endpoint() != MISSING_VALUE {
eprintln!("existing config seems to have specified new validator rest endpoint which was only introduced in 0.9.0! Can't perform upgrade.");
print_failed_upgrade(&from_version, &to_version);
process::exit(1);
}
print_start_upgrade(&config_version, &to_version);
print_start_upgrade(&from_version, &to_version);
println!(
"Setting validator API endpoints to {:?}",
default_api_endpoints()
);
config
.get_base_mut()
.set_custom_validator_apis(default_api_endpoints());
config
.get_base_mut()
.set_custom_version(to_version.to_string().as_ref());
println!(
"Setting validator REST endpoint to to {}",
DEFAULT_VALIDATOR_REST_ENDPOINT
);
config
.get_base_mut()
.set_custom_validator(DEFAULT_VALIDATOR_REST_ENDPOINT);
config.save_to_file(None).unwrap_or_else(|err| {
eprintln!("failed to overwrite config file! - {:?}", err);
print_failed_upgrade(&from_version, &to_version);
print_failed_upgrade(&config_version, &to_version);
process::exit(1);
});
print_successful_upgrade(from_version, to_version);
print_successful_upgrade(config_version, to_version);
config
}
pub fn command_args<'a, 'b>() -> App<'a, 'b> {
App::new("upgrade").about("Try to upgrade the mixnode")
.arg(
Arg::with_name("id")
.long("id")
.help("Id of the nym-client we want to upgrade")
.takes_value(true)
.required(true),
)
// the rest of arguments depend on the upgrade path
.arg(Arg::with_name("current version")
.long("current-version")
.help("REQUIRED FOR PRE-0.9.0 UPGRADES. Specifies current version of the configuration file to help to determine a valid upgrade path. Valid formats include '0.8.1', 'v0.8.1' or 'V0.8.1'")
.takes_value(true)
)
fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version) {
loop {
let config_version = parse_config_version(&config);
if config_version == package_version {
println!("You're using the most recent version!");
return;
}
config = match config_version.major {
0 => match config_version.minor {
9 | 10 => outdated_upgrade(&config_version, &package_version),
11 => minor_0_12_upgrade(config, matches, &config_version, &package_version),
_ => unsupported_upgrade(&config_version, &package_version),
},
_ => unsupported_upgrade(&config_version, &package_version),
}
}
}
pub fn execute(matches: &ArgMatches) {
let current = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
// technically this is not a correct way of checking it as a released version might contain valid build identifiers
// however, we are not using them ourselves at the moment and hence it should be fine.
// if we change our mind, we could easily tweak this code
if current.is_prerelease() || !current.build.is_empty() {
eprintln!(
"Trying to upgrade to a non-released version {}. This is not supported!",
current
);
process::exit(1)
}
let package_version = parse_package_version();
let id = matches.value_of("id").unwrap();
let mut existing_config = Config::load_from_file(id).unwrap_or_else(|err| {
let existing_config = Config::load_from_file(Some(id)).unwrap_or_else(|err| {
eprintln!("failed to load existing config file! - {:?}", err);
process::exit(1)
});
// versions fields were added in 0.9.0
if existing_config.get_base().get_version() == MISSING_VALUE {
let self_reported_version = matches.value_of("current version").unwrap_or_else(|| {
eprintln!(
"trying to upgrade from pre v0.9.0 without providing current system version!"
);
process::exit(1)
});
// upgrades up to 0.9.0
existing_config = pre_090_upgrade(self_reported_version, existing_config);
eprintln!("the existing configuration file does not seem to contain version number.");
process::exit(1);
}
let config_version =
Version::parse(existing_config.get_base().get_version()).unwrap_or_else(|err| {
eprintln!("failed to parse node version! - {:?}", err);
process::exit(1)
});
if config_version.is_prerelease() || !config_version.build.is_empty() {
eprintln!(
"Trying to upgrade to from non-released version {}. This is not supported!",
current
);
process::exit(1)
}
// here be upgrade path to 0.10.0 and beyond based on version number from config
if config_version == current {
println!("You're using the most recent version!");
} else {
eprintln!("Cannot perform upgrade from {} to {}. Please let the developers know about this issue!", config_version, current);
process::exit(1)
}
// here be upgrade path to 0.9.X and beyond based on version number from config
do_upgrade(existing_config, matches, package_version)
}
+2 -13
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub mod client;
pub mod websocket;
+2 -13
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use clap::{App, ArgMatches};
+6 -17
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use client_core::client::{
inbound_messages::{InputMessage, InputMessageSender},
@@ -22,7 +11,7 @@ use futures::channel::mpsc;
use futures::{SinkExt, StreamExt};
use log::*;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::anonymous_replies::ReplySurb;
use nymsphinx::receiver::ReconstructedMessage;
use tokio::net::TcpStream;
use tokio_tungstenite::{
@@ -100,9 +89,9 @@ impl Handler {
None
}
fn handle_reply(&mut self, reply_surb: ReplySURB, message: Vec<u8>) -> Option<ServerResponse> {
if message.len() > ReplySURB::max_msg_len(Default::default()) {
return Some(ServerResponse::new_error(format!("too long message to put inside a reply SURB. Received: {} bytes and maximum is {} bytes", message.len(), ReplySURB::max_msg_len(Default::default()))));
fn handle_reply(&mut self, reply_surb: ReplySurb, message: Vec<u8>) -> Option<ServerResponse> {
if message.len() > ReplySurb::max_msg_len(Default::default()) {
return Some(ServerResponse::new_error(format!("too long message to put inside a reply SURB. Received: {} bytes and maximum is {} bytes", message.len(), ReplySurb::max_msg_len(Default::default()))));
}
let input_msg = InputMessage::new_reply(reply_surb, message);
+14 -23
View File
@@ -1,23 +1,10 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use super::handler::Handler;
use log::*;
use std::{
net::{Shutdown, SocketAddr},
sync::Arc,
};
use std::{net::SocketAddr, process, sync::Arc};
use tokio::io::AsyncWriteExt;
use tokio::runtime;
use tokio::{sync::Notify, task::JoinHandle};
@@ -47,9 +34,13 @@ impl Listener {
}
pub(crate) async fn run(&mut self, handler: Handler) {
let mut tcp_listener = tokio::net::TcpListener::bind(self.address)
.await
.expect("Failed to start websocket listener");
let tcp_listener = match tokio::net::TcpListener::bind(self.address).await {
Ok(listener) => listener,
Err(err) => {
error!("Failed to bind to {} - {}. Are you sure nothing else is running on the specified port and your user has sufficient permission to bind to the requested address?", self.address, err);
process::exit(1);
}
};
let notify = Arc::new(Notify::new());
@@ -61,7 +52,7 @@ impl Listener {
}
new_conn = tcp_listener.accept() => {
match new_conn {
Ok((socket, remote_addr)) => {
Ok((mut socket, remote_addr)) => {
debug!("Received connection from {:?}", remote_addr);
if self.state.is_connected() {
warn!("tried to duplicate!");
@@ -70,7 +61,7 @@ impl Listener {
// while we only ever want to accept a single connection, we don't want
// to leave clients hanging (and also allow for reconnection if it somehow
// was dropped)
match socket.shutdown(Shutdown::Both) {
match socket.shutdown().await {
Ok(_) => trace!(
"closed the connection between attempting websocket handshake"
),
@@ -84,7 +75,7 @@ impl Listener {
let fresh_handler = handler.clone();
tokio::spawn(async move {
fresh_handler.handle_connection(socket).await;
notify_clone.notify();
notify_clone.notify_one();
});
self.state = State::Connected;
}
+2 -13
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub(crate) mod handler;
pub(crate) mod listener;
+3 -14
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use serde::{Deserialize, Serialize};
use std::fmt;
@@ -55,7 +44,7 @@ pub enum ErrorKind {
/// The received request is malformed.
MalformedRequest = 0x04,
// that's an arbitrary division but lets keep 1-127 (hex 0x01 - 0x7F) values request-specific
// that's an arbitrary division but let's keep 1-127 (hex 0x01 - 0x7F) values request-specific
// and 128-254 (hex 0x80 - 0xFE) for responses
/// The received response contained no data.
EmptyResponse = 0x80,
+2 -13
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub mod error;
pub mod requests;
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
// all variable size data is always prefixed with u64 length
// tags are u8
@@ -18,7 +7,7 @@
use crate::error::{self, ErrorKind};
use crate::text::ClientRequestText;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::anonymous_replies::ReplySurb;
use std::convert::{TryFrom, TryInto};
use std::mem::size_of;
@@ -42,7 +31,7 @@ pub enum ClientRequest {
},
Reply {
message: Vec<u8>,
reply_surb: ReplySURB,
reply_surb: ReplySurb,
},
SelfAddress,
}
@@ -119,7 +108,7 @@ impl ClientRequest {
}
// REPLY_REQUEST_TAG || surb_len || surb || message_len || message
fn serialize_reply(message: Vec<u8>, reply_surb: ReplySURB) -> Vec<u8> {
fn serialize_reply(message: Vec<u8>, reply_surb: ReplySurb) -> Vec<u8> {
let reply_surb_bytes = reply_surb.to_bytes();
let surb_len_bytes = (reply_surb_bytes.len() as u64).to_be_bytes();
let message_len_bytes = (message.len() as u64).to_be_bytes();
@@ -164,7 +153,7 @@ impl ClientRequest {
let surb_bound = 1 + size_of::<u64>() + reply_surb_len as usize;
let reply_surb_bytes = &b[1 + size_of::<u64>()..surb_bound];
let reply_surb = match ReplySURB::from_bytes(reply_surb_bytes) {
let reply_surb = match ReplySurb::from_bytes(reply_surb_bytes) {
Ok(reply_surb) => reply_surb,
Err(err) => {
return Err(error::Error::new(
@@ -206,11 +195,11 @@ impl ClientRequest {
}
// SELF_ADDRESS_REQUEST_TAG
fn deserialize_self_address(b: &[u8]) -> Result<Self, error::Error> {
fn deserialize_self_address(b: &[u8]) -> Self {
// this MUST match because it was called by 'deserialize'
debug_assert_eq!(b[0], SELF_ADDRESS_REQUEST_TAG);
Ok(ClientRequest::SelfAddress)
ClientRequest::SelfAddress
}
pub fn serialize(self) -> Vec<u8> {
@@ -255,7 +244,7 @@ impl ClientRequest {
match request_tag {
SEND_REQUEST_TAG => Self::deserialize_send(b),
REPLY_REQUEST_TAG => Self::deserialize_reply(b),
SELF_ADDRESS_REQUEST_TAG => Self::deserialize_self_address(b),
SELF_ADDRESS_REQUEST_TAG => Ok(Self::deserialize_self_address(b)),
n => Err(error::Error::new(
ErrorKind::UnknownRequest,
format!("type {}", n),
@@ -333,7 +322,7 @@ mod tests {
#[test]
fn reply_request_serialization_works() {
let reply_surb_string = "CjfVbHbfAjbC3W1BvNHGXmM8KNAnDNYGaHMLqVDxRYeo352csAihstup9bvqXam4dTWgfHak6KYwL9STaxWJ47E8XFZbSEvs7hEsfCkxr6K9WJuSBPK84GDDEvad8ZAuMCoaXsAd5S2Lj9a5eYyzG4SL1jHzhSMni55LyJwumxo1ZTGZNXggxw1RREosvyzNrW9Rsi3owyPqLCwXpiei2tHZty8w8midVvg8vDa7ZEJD842CLv8D4ohynSG7gDpqTrhkRaqYAuz7dzqNbMXLJRM7v823Jn16fA1L7YQxmcaUdUigyRSgTdb4i9ebiLGSyJ1iDe6Acz613PQZh6Ua3bZ2zVKq3dSycpDm9ngarRK4zJrAaUxRkdih8YzW3BY4nL9eqkfKA4N1TWCLaRU7zpSaf8yMEwrAZReU3d5zLV8c5KBfa2w8R5anhQeBojduZEGEad8kkHuKU52Zg93FeWHvH1qgZaEJMHH4nN7gKXz9mvWDhYwyF4vt3Uy2NhCHC3N5pL1gMme27YcoPcTEia1fxKZtnt6rtEozzTrAgCJGswigkFbkafiV5QaJwLKTUxtzhkZ57eEuLPte9UvJHzhhXUQ2CV7R2BUkJjYZy3Zsx6YYvdYWiAFFkWUwNEGA4QpShUHciBfsQVHQ7pN41YcyYUhbywQDFnTVgEmdUZ1XCBi3gyK5U3tDQmFzP1u9m3mWrUA8qB9mRDE7ptNDm5c3c1458L6uXLUth7sdMaa1Was5LCmCdmNDtvNpCDAEt1in6q6mrZFR85aCSU9b1baNGwZoCqPpPvydkVe63gXWoi8ebvdyxARrqACFrSB3ZdY3uJBw8CTMNkKK6MvcefMkSVVsbLd36TQAtYSCqrpiMc5dQuKcEu5QfciwvWYXYx8WFNAgKwP2mv49KCTvfozNDUCbjzDwSx92Zv5zjG8HbFpB13bY9UZGeyTPvv7gGxCzjGjJGbW6FRAheRQaaje5fUgCNM95Tv7wBmAMRHHFgWafeK1sdFH7dtCX9u898HucGTaboSKLsVh8J78gbbkHErwjMh7y9YRkceq5TTYS5da4kHnyNKYWSbxgZrmFg44XGKoeYcqoHB3XTZrdsf7F5fFeNwnihkmADvhAcaxXUmVqq4rQFZH84a1iC3WBWXYcqiZH2L7ujGWV7mMDT4HBEerDYjc8rNY4xGTPfivCrBCJW1i14aqW8xRdsdgTM88eTksvC3WPJLJ7iMzfKXeL7fMW1Ek6QGyQtLBW98vEESpdcDg6DeZ5rMz6VqjTGGqcCaFGfHoqtfxMDaBAEsyQ8h7XDX6dg1wq9wH6j4Tw7Tj1MEv1b8uj5NJkozZdzVdYA2QyE2Dp8vuurQG6uVdTDNww2d88RBQ8sVgjxN8gR45y4woJLhFAaNTAtrY6wDTxyXST13ni6oyqdYxjFVk9Am4v3DzH7Y2K8iRVSHfTk4FRbPULyaeK6wt2anvMJH1XdvVRgc14h67MnBxMgMD1UFk8AErN7CDj26fppe3c5G6KozJe4cSqQUGbBjVzBnrHCruqrfZBn5hNZHTV37bQiomqhRQXohxhuKEnNrGbAe1xNvJr9X";
let reply_surb = ReplySURB::from_base58_string(reply_surb_string).unwrap();
let reply_surb = ReplySurb::from_base58_string(reply_surb_string).unwrap();
let reply_request = ClientRequest::Reply {
message: b"foomp".to_vec(),
reply_surb,
@@ -1,24 +1,15 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
// all variable size data is always prefixed with u64 length
// tags are u8
#![allow(unknown_lints)] // due to using `clippy::branches_sharing_code` which does not exist on `stable` just yet
use crate::error::{self, ErrorKind};
use crate::text::ServerResponseText;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::anonymous_replies::ReplySurb;
use nymsphinx::receiver::ReconstructedMessage;
use std::convert::TryInto;
use std::mem::size_of;
@@ -96,6 +87,8 @@ impl ServerResponse {
}
};
// this is a false positive as even though the code is the same, it refers to different things
#[allow(clippy::branches_sharing_code)]
if with_reply_surb {
let reply_surb_len =
u64::from_be_bytes(b[2..2 + size_of::<u64>()].as_ref().try_into().unwrap());
@@ -111,7 +104,7 @@ impl ServerResponse {
let surb_bound = 2 + size_of::<u64>() + reply_surb_len as usize;
let reply_surb_bytes = &b[2 + size_of::<u64>()..surb_bound];
let reply_surb = match ReplySURB::from_bytes(reply_surb_bytes) {
let reply_surb = match ReplySurb::from_bytes(reply_surb_bytes) {
Ok(reply_surb) => reply_surb,
Err(err) => {
return Err(error::Error::new(
@@ -339,7 +332,7 @@ mod tests {
let received_with_surb = ServerResponse::Received(ReconstructedMessage {
message: b"foomp".to_vec(),
reply_surb: Some(ReplySURB::from_base58_string(reply_surb_string).unwrap()),
reply_surb: Some(ReplySurb::from_base58_string(reply_surb_string).unwrap()),
});
let bytes = received_with_surb.serialize();
let recovered = ServerResponse::deserialize(&bytes).unwrap();
+7 -18
View File
@@ -1,22 +1,11 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::error::ErrorKind;
use crate::requests::ClientRequest;
use crate::responses::ServerResponse;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::anonymous_replies::ReplySURB;
use nymsphinx::anonymous_replies::ReplySurb;
use serde::{Deserialize, Serialize};
use std::convert::{TryFrom, TryInto};
@@ -75,7 +64,7 @@ impl TryInto<ClientRequest> for ClientRequestText {
reply_surb,
} => {
let message_bytes = message.into_bytes();
let reply_surb = ReplySURB::from_base58_string(reply_surb).map_err(|err| {
let reply_surb = ReplySurb::from_base58_string(reply_surb).map_err(|err| {
Self::Error::new(ErrorKind::MalformedRequest, err.to_string())
})?;
@@ -115,15 +104,15 @@ impl TryFrom<String> for ServerResponseText {
}
}
impl Into<String> for ServerResponseText {
fn into(self) -> String {
impl From<ServerResponseText> for String {
fn from(res: ServerResponseText) -> Self {
// per serde_json docs:
/*
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
/// fail, or if `T` contains a map with non-string keys.
*/
// this is not the case here.
serde_json::to_string(&self).unwrap()
serde_json::to_string(&res).unwrap()
}
}
+13 -5
View File
@@ -1,8 +1,9 @@
[package]
name = "nym-socks5-client"
version = "0.9.0"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
edition = "2018"
rust-version = "1.56"
[lib]
name = "nym_socks5"
@@ -14,15 +15,18 @@ dirs = "3.0" # for determining default store directories in config
dotenv = "0.15.0"
futures = "0.3"
log = "0.4"
pin-project = "0.4"
pretty_env_logger = "0.3"
pin-project = "1.0"
pretty_env_logger = "0.4"
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
serde = { version = "1.0", features = ["derive"] } # for config serialization/deserialization
snafu = "0.4.1"
tokio = { version = "0.2", features = ["rt-threaded"] }
snafu = "0.6"
tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal"] }
url = "2.2"
# internal
client-core = { path = "../client-core" }
coconut-interface = { path = "../../common/coconut-interface", optional = true }
credentials = { path = "../../common/credentials", optional = true }
config = { path = "../../common/config" }
crypto = { path = "../../common/crypto" }
gateway-client = { path = "../../common/client-libs/gateway-client" }
@@ -31,6 +35,10 @@ nymsphinx = { path = "../../common/nymsphinx" }
ordered-buffer = {path = "../../common/socks5/ordered-buffer"}
socks5-requests = { path = "../../common/socks5/requests" }
topology = { path = "../../common/topology" }
pemstore = { path = "../../common/pemstore" }
proxy-helpers = { path = "../../common/socks5/proxy-helpers" }
validator-client = { path = "../../common/client-libs/validator-client" }
version-checker = { path = "../../common/version-checker" }
[features]
coconut = ["coconut-interface", "credentials", "gateway-requests/coconut", "gateway-client/coconut"]
+5 -17
View File
@@ -1,20 +1,10 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::template::config_template;
use client_core::config::Config as BaseConfig;
pub use client_core::config::MISSING_VALUE;
use config::defaults::DEFAULT_SOCKS5_LISTENING_PORT;
use config::NymConfig;
use nymsphinx::addressing::clients::Recipient;
use serde::{Deserialize, Serialize};
@@ -22,8 +12,6 @@ use std::path::PathBuf;
mod template;
const DEFAULT_LISTENING_PORT: u16 = 1080;
#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
@@ -114,7 +102,7 @@ pub struct Socks5 {
impl Socks5 {
pub fn new<S: Into<String>>(provider_mix_address: S) -> Self {
Socks5 {
listening_port: DEFAULT_LISTENING_PORT,
listening_port: DEFAULT_SOCKS5_LISTENING_PORT,
provider_mix_address: provider_mix_address.into(),
}
}
@@ -123,7 +111,7 @@ impl Socks5 {
impl Default for Socks5 {
fn default() -> Self {
Socks5 {
listening_port: DEFAULT_LISTENING_PORT,
listening_port: DEFAULT_SOCKS5_LISTENING_PORT,
provider_mix_address: "".into(),
}
}
+20 -21
View File
@@ -1,22 +1,11 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub(crate) fn config_template() -> &'static str {
// While using normal toml marshalling would have been way simpler with less overhead,
// I think it's useful to have comments attached to the saved config file to explain behaviour of
// particular fields.
// Note: any changes to the template must be reflected in the appropriate structs in mod.rs.
// Note: any changes to the template must be reflected in the appropriate structs in verloc.
r#"
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
@@ -30,13 +19,12 @@ version = '{{ client.version }}'
# Human readable ID of this particular client.
id = '{{ client.id }}'
# URL to the validator server for obtaining network topology.
validator_rest_url = '{{ client.validator_rest_url }}'
# Special mode of the system such that all messages are sent as soon as they are received
# and no cover traffic is generated. If set all message delays are set to 0 and overwriting
# 'Debug' values will have no effect.
vpn_mode = {{ client.vpn_mode }}
# Addresses to APIs running on validator from which the client gets the view of the network.
validator_api_urls = [
{{#each client.validator_api_urls }}
'{{this}}',
{{/each}}
]
# Path to file containing private identity key.
private_identity_key_file = '{{ client.private_identity_key_file }}'
@@ -54,6 +42,17 @@ public_encryption_key_file = '{{ client.public_encryption_key_file }}'
# sent but not received back.
reply_encryption_key_store_path = '{{ client.reply_encryption_key_store_path }}'
# Path to directory containing public/private keys used for bandwidth token purchase.
# Those are saved in case of emergency, to be able to reclaim bandwidth tokens.
# The public key is the name of the file, while the private key is the content.
backup_bandwidth_token_keys_dir = '{{ client.backup_bandwidth_token_keys_dir }}'
# Ethereum private key.
eth_private_key = '{{ client.eth_private_key }}'
# Addess to an Ethereum full node.
eth_endpoint = '{{ client.eth_endpoint }}'
##### additional client config options #####
# ID of the gateway from which the client should be fetching messages.
+64 -74
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use crate::socks::{
@@ -43,9 +32,10 @@ use gateway_client::{
use log::*;
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::addressing::nodes::NodeIdentity;
use nymsphinx::params::PacketMode;
use tokio::runtime::Runtime;
use gateway_client::bandwidth::BandwidthController;
pub(crate) mod config;
pub struct NymClient {
@@ -94,21 +84,20 @@ impl NymClient {
info!("Starting loop cover traffic stream...");
// we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())"
// set in the constructor which HAS TO be called within context of a tokio runtime
self.runtime
.enter(|| {
LoopCoverTrafficStream::new(
self.key_manager.ack_key(),
self.config.get_base().get_average_ack_delay(),
self.config.get_base().get_average_packet_delay(),
self.config
.get_base()
.get_loop_cover_traffic_average_delay(),
mix_tx,
self.as_mix_recipient(),
topology_accessor,
)
})
.start(self.runtime.handle());
let _guard = self.runtime.enter();
LoopCoverTrafficStream::new(
self.key_manager.ack_key(),
self.config.get_base().get_average_ack_delay(),
self.config.get_base().get_average_packet_delay(),
self.config
.get_base()
.get_loop_cover_traffic_average_delay(),
mix_tx,
self.as_mix_recipient(),
topology_accessor,
)
.start(self.runtime.handle());
}
fn start_real_traffic_controller(
@@ -119,12 +108,6 @@ impl NymClient {
input_receiver: InputMessageReceiver,
mix_sender: BatchMixMessageSender,
) {
let packet_mode = if self.config.get_base().get_vpn_mode() {
PacketMode::VPN
} else {
PacketMode::Mix
};
let controller_config = client_core::client::real_messages_control::Config::new(
self.key_manager.ack_key(),
self.config.get_base().get_ack_wait_multiplier(),
@@ -133,26 +116,23 @@ impl NymClient {
self.config.get_base().get_message_sending_average_delay(),
self.config.get_base().get_average_packet_delay(),
self.as_mix_recipient(),
packet_mode,
self.config.get_base().get_vpn_key_reuse_limit(),
);
info!("Starting real traffic stream...");
// we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())"
// set in the constructor [of OutQueueControl] which HAS TO be called within context of a tokio runtime
// When refactoring this restriction should definitely be removed.
let real_messages_controller = self.runtime.enter(|| {
RealMessagesController::new(
controller_config,
ack_receiver,
input_receiver,
mix_sender,
topology_accessor,
reply_key_storage,
)
});
real_messages_controller
.start(self.runtime.handle(), self.config.get_base().get_vpn_mode());
let _guard = self.runtime.enter();
RealMessagesController::new(
controller_config,
ack_receiver,
input_receiver,
mix_sender,
topology_accessor,
reply_key_storage,
)
.start(self.runtime.handle());
}
// buffer controlling all messages fetched from provider
@@ -190,41 +170,53 @@ impl NymClient {
let gateway_identity = identity::PublicKey::from_base58_string(gateway_id)
.expect("provided gateway id is invalid!");
let mut gateway_client = GatewayClient::new(
gateway_address,
self.key_manager.identity_keypair(),
gateway_identity,
Some(self.key_manager.gateway_shared_key()),
mixnet_message_sender,
ack_sender,
self.config.get_base().get_gateway_response_timeout(),
);
self.runtime.block_on(async {
#[cfg(feature = "coconut")]
let bandwidth_controller = BandwidthController::new(
self.config.get_base().get_validator_api_endpoints(),
*self.key_manager.identity_keypair().public_key(),
);
#[cfg(not(feature = "coconut"))]
let bandwidth_controller = BandwidthController::new(
self.config.get_base().get_eth_endpoint(),
self.config.get_base().get_eth_private_key(),
self.config.get_base().get_backup_bandwidth_token_keys_dir(),
)
.expect("Could not create bandwidth controller");
let mut gateway_client = GatewayClient::new(
gateway_address,
self.key_manager.identity_keypair(),
gateway_identity,
Some(self.key_manager.gateway_shared_key()),
mixnet_message_sender,
ack_sender,
self.config.get_base().get_gateway_response_timeout(),
Some(bandwidth_controller),
);
gateway_client
.authenticate_and_start()
.await
.expect("could not authenticate and start up the gateway connection")
});
.expect("could not authenticate and start up the gateway connection");
gateway_client
gateway_client
})
}
// future responsible for periodically polling directory server and updating
// the current global view of topology
fn start_topology_refresher(&mut self, topology_accessor: TopologyAccessor) {
let topology_refresher_config = TopologyRefresherConfig::new(
self.config.get_base().get_validator_rest_endpoint(),
self.config.get_base().get_validator_api_endpoints(),
self.config.get_base().get_topology_refresh_rate(),
env!("CARGO_PKG_VERSION").to_string(),
);
let mut topology_refresher =
TopologyRefresher::new_directory_client(topology_refresher_config, topology_accessor);
TopologyRefresher::new(topology_refresher_config, topology_accessor);
// before returning, block entire runtime to refresh the current network view so that any
// components depending on topology would see a non-empty view
info!(
"Obtaining initial network topology from {}",
self.config.get_base().get_validator_rest_endpoint()
);
info!("Obtaining initial network topology");
self.runtime.block_on(topology_refresher.refresh());
// TODO: a slightly more graceful termination here
@@ -261,8 +253,7 @@ impl NymClient {
msg_input: InputMessageSender,
) {
info!("Starting socks5 listener...");
let mut auth_methods: Vec<u8> = Vec::new();
auth_methods.push(AuthenticationMethods::NoAuth as u8);
let auth_methods = vec![AuthenticationMethods::NoAuth as u8];
let allowed_users: Vec<User> = Vec::new();
let authenticator = Authenticator::new(auth_methods, allowed_users);
@@ -287,7 +278,7 @@ impl NymClient {
}
println!(
"Received SIGINT - the client will terminate now (threads are not YET nicely stopped)"
"Received SIGINT - the client will terminate now (threads are not yet nicely stopped, if you see stack traces that's alright)."
);
}
@@ -340,9 +331,8 @@ impl NymClient {
input_receiver,
sphinx_message_sender.clone(),
);
if !self.config.get_base().get_vpn_mode() {
self.start_cover_traffic_stream(shared_topology_accessor, sphinx_message_sender);
}
self.start_cover_traffic_stream(shared_topology_accessor, sphinx_message_sender);
self.start_socks5_listener(received_buffer_request_sender, input_sender);
info!("Client startup finished!");
+93 -52
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use crate::commands::override_config;
@@ -18,16 +7,20 @@ use clap::{App, Arg, ArgMatches};
use client_core::client::key_manager::KeyManager;
use client_core::config::persistence::key_pathfinder::ClientKeyPathfinder;
use config::NymConfig;
use crypto::asymmetric::identity;
use crypto::asymmetric::{encryption, identity};
use gateway_client::GatewayClient;
use gateway_requests::registration::handshake::SharedKeys;
use rand::{prelude::SliceRandom, rngs::OsRng};
use nymsphinx::addressing::clients::Recipient;
use nymsphinx::addressing::nodes::NodeIdentity;
use rand::{prelude::SliceRandom, rngs::OsRng, thread_rng};
use std::convert::TryInto;
use std::sync::Arc;
use std::time::Duration;
use topology::{gateway, NymTopology};
use topology::{filter::VersionFilterable, gateway};
use url::Url;
pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
App::new("init")
let app = App::new("init")
.about("Initialise a Nym client. Do this first!")
.arg(Arg::with_name("id")
.long("id")
@@ -46,10 +39,10 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Id of the gateway we are going to connect to.")
.takes_value(true)
)
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
.arg(Arg::with_name("validators")
.long("validators")
.help("Comma separated list of rest endpoints of the validators")
.takes_value(true),
)
.arg(Arg::with_name("port")
.short("p")
@@ -57,31 +50,34 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Port for the socket to listen on in all subsequent runs")
.takes_value(true)
)
.arg(Arg::with_name("vpn-mode")
.long("vpn-mode")
.help("Set the vpn mode of the client")
.long_help(
r#"
Special mode of the system such that all messages are sent as soon as they are received
and no cover traffic is generated. If set all message delays are set to 0 and overwriting
'Debug' values will have no effect.
"#
)
)
.arg(Arg::with_name("fastmode")
.long("fastmode")
.hidden(true) // this will prevent this flag from being displayed in `--help`
.help("Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init")
)
);
#[cfg(not(feature = "coconut"))]
let app = app
.arg(Arg::with_name("eth_endpoint")
.long("eth_endpoint")
.help("URL of an Ethereum full node that we want to use for getting bandwidth tokens from ERC20 tokens")
.takes_value(true)
.required(true))
.arg(Arg::with_name("eth_private_key")
.long("eth_private_key")
.help("Ethereum private key used for obtaining bandwidth tokens from ERC20 tokens")
.takes_value(true)
.required(true));
app
}
async fn register_with_gateway(
gateway: &gateway::Node,
our_identity: Arc<identity::KeyPair>,
) -> SharedKeys {
) -> Arc<SharedKeys> {
let timeout = Duration::from_millis(1500);
let mut gateway_client = GatewayClient::new_init(
gateway.client_listener.clone(),
gateway.clients_address(),
gateway.identity_key,
our_identity.clone(),
timeout,
@@ -91,45 +87,88 @@ async fn register_with_gateway(
.await
.expect("failed to establish connection with the gateway!");
gateway_client
.register()
.perform_initial_authentication()
.await
.expect("failed to register with the gateway!")
}
async fn gateway_details(validator_server: &str, chosen_gateway_id: Option<&str>) -> gateway::Node {
let validator_client_config = validator_client::Config::new(validator_server.to_string());
let validator_client = validator_client::Client::new(validator_client_config);
let topology = validator_client.get_active_topology().await.unwrap();
let nym_topology: NymTopology = topology.into();
let version_filtered_topology = nym_topology.filter_system_version(env!("CARGO_PKG_VERSION"));
async fn gateway_details(
validator_servers: Vec<Url>,
chosen_gateway_id: Option<&str>,
) -> gateway::Node {
let validator_api = validator_servers
.choose(&mut thread_rng())
.expect("The list of validator apis is empty");
let validator_client = validator_client::ApiClient::new(validator_api.clone());
let gateways = validator_client.get_cached_gateways().await.unwrap();
let valid_gateways = gateways
.into_iter()
.filter_map(|gateway| gateway.try_into().ok())
.collect::<Vec<gateway::Node>>();
let filtered_gateways = valid_gateways.filter_by_version(env!("CARGO_PKG_VERSION"));
// if we have chosen particular gateway - use it, otherwise choose a random one.
// (remember that in active topology all gateways have at least 100 reputation so should
// be working correctly)
if let Some(gateway_id) = chosen_gateway_id {
version_filtered_topology
.gateways()
filtered_gateways
.iter()
.find(|gateway| gateway.identity_key.to_base58_string() == gateway_id)
.expect(&*format!("no gateway with id {} exists!", gateway_id))
.clone()
} else {
version_filtered_topology
.gateways()
filtered_gateways
.choose(&mut rand::thread_rng())
.expect("there are no gateways on the network!")
.clone()
}
}
fn show_address(config: &Config) {
fn load_identity_keys(pathfinder: &ClientKeyPathfinder) -> identity::KeyPair {
let identity_keypair: identity::KeyPair =
pemstore::load_keypair(&pemstore::KeyPairPath::new(
pathfinder.private_identity_key().to_owned(),
pathfinder.public_identity_key().to_owned(),
))
.expect("Failed to read stored identity key files");
identity_keypair
}
fn load_sphinx_keys(pathfinder: &ClientKeyPathfinder) -> encryption::KeyPair {
let sphinx_keypair: encryption::KeyPair =
pemstore::load_keypair(&pemstore::KeyPairPath::new(
pathfinder.private_encryption_key().to_owned(),
pathfinder.public_encryption_key().to_owned(),
))
.expect("Failed to read stored sphinx key files");
sphinx_keypair
}
let pathfinder = ClientKeyPathfinder::new_from_config(config.get_base());
let identity_keypair = load_identity_keys(&pathfinder);
let sphinx_keypair = load_sphinx_keys(&pathfinder);
let client_recipient = Recipient::new(
*identity_keypair.public_key(),
*sphinx_keypair.public_key(),
// TODO: below only works under assumption that gateway address == gateway id
// (which currently is true)
NodeIdentity::from_base58_string(config.get_base().get_gateway_id()).unwrap(),
);
println!("\nThe address of this client is: {}", client_recipient);
}
pub fn execute(matches: &ArgMatches) {
println!("Initialising client...");
let id = matches.value_of("id").unwrap(); // required for now
let provider_address = matches.value_of("provider").unwrap();
let already_init = if Config::default_config_file_path(id).exists() {
let already_init = if Config::default_config_file_path(Some(id)).exists() {
println!("Socks5 client \"{}\" was already initialised before! Config information will be overwritten (but keys will be kept)!", id);
true
} else {
@@ -157,7 +196,7 @@ pub fn execute(matches: &ArgMatches) {
let registration_fut = async {
let gate_details = gateway_details(
&config.get_base().get_validator_rest_endpoint(),
config.get_base().get_validator_api_endpoints(),
chosen_gateway_id,
)
.await;
@@ -166,11 +205,11 @@ pub fn execute(matches: &ArgMatches) {
.with_gateway_id(gate_details.identity_key.to_base58_string());
let shared_keys =
register_with_gateway(&gate_details, key_manager.identity_keypair()).await;
(shared_keys, gate_details.client_listener)
(shared_keys, gate_details.clients_address())
};
// TODO: is there perhaps a way to make it work without having to spawn entire runtime?
let mut rt = tokio::runtime::Runtime::new().unwrap();
let rt = tokio::runtime::Runtime::new().unwrap();
let (shared_keys, gateway_listener) = rt.block_on(registration_fut);
config
.get_base_mut()
@@ -190,5 +229,7 @@ pub fn execute(matches: &ArgMatches) {
.expect("Failed to save the config file");
println!("Saved configuration file to {:?}", config_save_location);
println!("Using gateway: {}", config.get_base().get_gateway_id(),);
println!("Client configuration completed.\n\n\n")
println!("Client configuration completed.\n\n\n");
show_address(&config);
}
+27 -19
View File
@@ -1,37 +1,36 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use clap::ArgMatches;
use url::Url;
pub(crate) mod init;
pub(crate) mod run;
pub(crate) mod upgrade;
fn parse_validators(raw: &str) -> Vec<Url> {
raw.split(',')
.map(|raw_validator| {
raw_validator
.trim()
.parse()
.expect("one of the provided validator api urls is invalid")
})
.collect()
}
pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Config {
if let Some(validator) = matches.value_of("validator") {
config.get_base_mut().set_custom_validator(validator);
if let Some(raw_validators) = matches.value_of("validators") {
config
.get_base_mut()
.set_custom_validator_apis(parse_validators(raw_validators));
}
if let Some(gateway_id) = matches.value_of("gateway") {
config.get_base_mut().with_gateway_id(gateway_id);
}
if matches.is_present("vpn-mode") {
config.get_base_mut().set_vpn_mode(true);
}
if let Some(port) = matches.value_of("port").map(|port| port.parse::<u16>()) {
if let Err(err) = port {
// if port was overridden, it must be parsable
@@ -40,5 +39,14 @@ pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Confi
config = config.with_port(port.unwrap());
}
#[cfg(not(feature = "coconut"))]
if let Some(eth_endpoint) = matches.value_of("eth_endpoint") {
config.get_base_mut().with_eth_endpoint(eth_endpoint);
}
#[cfg(not(feature = "coconut"))]
if let Some(eth_private_key) = matches.value_of("eth_private_key") {
config.get_base_mut().with_eth_private_key(eth_private_key);
}
config
}
+21 -31
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::Config;
use crate::client::NymClient;
@@ -21,7 +10,7 @@ use log::*;
use version_checker::is_minor_version_compatible;
pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
App::new("run")
let app = App::new("run")
.about("Run the Nym client with provided configuration client optionally overriding set parameters")
.arg(Arg::with_name("id")
.long("id")
@@ -40,33 +29,34 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> {
.help("Address of the socks5 provider to send messages to.")
.takes_value(true)
)
.arg(Arg::with_name("validator")
.long("validator")
.help("Address of the validator server the client is getting topology from")
.takes_value(true),
.arg(Arg::with_name("validators")
.long("validators")
.help("Comma separated list of rest endpoints of the validators")
.takes_value(true),
)
.arg(Arg::with_name("gateway")
.long("gateway")
.help("Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened")
.takes_value(true)
)
.arg(Arg::with_name("vpn-mode")
.long("vpn-mode")
.help("Set the vpn mode of the client")
.long_help(
r#"
Special mode of the system such that all messages are sent as soon as they are received
and no cover traffic is generated. If set all message delays are set to 0 and overwriting
'Debug' values will have no effect.
"#
)
)
.arg(Arg::with_name("port")
.short("p")
.long("port")
.help("Port for the socket to listen on")
.takes_value(true)
)
);
#[cfg(not(feature = "coconut"))]
let app = app
.arg(Arg::with_name("eth_endpoint")
.long("eth_endpoint")
.help("URL of an Ethereum full node that we want to use for getting bandwidth tokens from ERC20 tokens")
.takes_value(true))
.arg(Arg::with_name("eth_private_key")
.long("eth_private_key")
.help("Ethereum private key used for obtaining bandwidth tokens from ERC20 tokens")
.takes_value(true));
app
}
// this only checks compatibility between config the binary. It does not take into consideration
@@ -91,7 +81,7 @@ fn version_check(cfg: &Config) -> bool {
pub fn execute(matches: &ArgMatches) {
let id = matches.value_of("id").unwrap();
let mut config = match Config::load_from_file(id) {
let mut config = match Config::load_from_file(Some(id)) {
Ok(cfg) => cfg,
Err(err) => {
error!("Failed to load config for {}. Are you sure you have run `init` before? (Error was: {})", id, err);
+104 -120
View File
@@ -1,28 +1,23 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use crate::client::config::{Config, MISSING_VALUE};
use clap::{App, Arg, ArgMatches};
use client_core::config::DEFAULT_VALIDATOR_REST_ENDPOINT;
use config::defaults::default_api_endpoints;
use config::NymConfig;
use std::fmt::Display;
use std::process;
use version_checker::{parse_version, Version};
use version_checker::Version;
#[allow(dead_code)]
fn fail_upgrade<D1: Display, D2: Display>(from_version: D1, to_version: D2) -> ! {
print_failed_upgrade(from_version, to_version);
process::exit(1)
}
fn print_start_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
println!(
"\n==================\nTrying to upgrade mixnode from {} to {} ...",
"\n==================\nTrying to upgrade client from {} to {} ...",
from, to
);
}
@@ -41,147 +36,136 @@ fn print_successful_upgrade<D1: Display, D2: Display>(from: D1, to: D2) {
);
}
fn pre_090_upgrade(from: &str, mut config: Config) -> Config {
// this is not extracted to separate function as you only have to manually pass version
// if upgrading from pre090 version
let from = match from.strip_prefix("v") {
Some(stripped) => stripped,
None => from,
};
fn outdated_upgrade(config_version: &Version, package_version: &Version) -> ! {
eprintln!(
"Cannot perform upgrade from {} to {}. Your version is too old to perform the upgrade.!",
config_version, package_version
);
process::exit(1)
}
let from = match from.strip_prefix("V") {
Some(stripped) => stripped,
None => from,
};
fn unsupported_upgrade(current_version: &Version, config_version: &Version) -> ! {
eprintln!("Cannot perform upgrade from {} to {}. Please let the developers know about this issue if you expected it to work!", config_version, current_version);
process::exit(1)
}
let from_version = parse_version(from).expect("invalid version provided!");
if from_version.major == 0 && from_version.minor < 8 {
// technically this could be implemented, but is there any point in that?
eprintln!("upgrading node from before v0.8.0 is not supported. Please run `init` with new binary instead");
pub fn command_args<'a, 'b>() -> App<'a, 'b> {
App::new("upgrade").about("Try to upgrade the client").arg(
Arg::with_name("id")
.long("id")
.help("Id of the nym-client we want to upgrade")
.takes_value(true)
.required(true),
)
}
fn parse_config_version(config: &Config) -> Version {
let version = Version::parse(config.get_base().get_version()).unwrap_or_else(|err| {
eprintln!("failed to parse client version! - {:?}", err);
process::exit(1)
});
if version.is_prerelease() || !version.build.is_empty() {
eprintln!(
"Trying to upgrade from a non-released version {}. This is not supported!",
version
);
process::exit(1)
}
if (from_version.major == 0 && from_version.minor >= 9) || from_version.major >= 1 {
eprintln!("self reported version is higher than 0.9.0. Those releases should have already contained version numbers in config! Make sure you provided correct version");
version
}
fn parse_package_version() -> Version {
let version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
// technically this is not a correct way of checking it as a released version might contain valid build identifiers
// however, we are not using them ourselves at the moment and hence it should be fine.
// if we change our mind, we could easily tweak this code
if version.is_prerelease() || !version.build.is_empty() {
eprintln!(
"Trying to upgrade to a non-released version {}. This is not supported!",
version
);
process::exit(1)
}
// note: current is guaranteed to not have any `build` information suffix (nor pre-release
// information), as this was asserted at the beginning of this command)
//
// upgrade to current (if it's a 0.9.X) or try to upgrade to 0.9.0 as an intermediate
// step in future upgrades (so, for example, we might go 0.8.0 -> 0.9.0 -> 0.10.0)
// this way we don't need to have all the crazy paths on how to upgrade from any version to any
// other version. We just upgrade one minor version at a time.
let current = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
let to_version = if current.major == 0 && current.minor == 9 {
current
version
}
fn minor_0_12_upgrade(
mut config: Config,
_matches: &ArgMatches,
config_version: &Version,
package_version: &Version,
) -> Config {
let to_version = if package_version.major == 0 && package_version.minor == 12 {
package_version.clone()
} else {
Version::new(0, 9, 0)
Version::new(0, 12, 0)
};
if config.get_base().get_validator_rest_endpoint() != MISSING_VALUE {
eprintln!("existing config seems to have specified new validator rest endpoint which was only introduced in 0.9.0! Can't perform upgrade.");
print_failed_upgrade(&from_version, &to_version);
process::exit(1);
}
print_start_upgrade(&config_version, &to_version);
print_start_upgrade(&from_version, &to_version);
println!(
"Setting validator API endpoints to {:?}",
default_api_endpoints()
);
config
.get_base_mut()
.set_custom_validator_apis(default_api_endpoints());
config
.get_base_mut()
.set_custom_version(to_version.to_string().as_ref());
println!(
"Setting validator REST endpoint to to {}",
DEFAULT_VALIDATOR_REST_ENDPOINT
);
config
.get_base_mut()
.set_custom_validator(DEFAULT_VALIDATOR_REST_ENDPOINT);
config.save_to_file(None).unwrap_or_else(|err| {
eprintln!("failed to overwrite config file! - {:?}", err);
print_failed_upgrade(&from_version, &to_version);
print_failed_upgrade(&config_version, &to_version);
process::exit(1);
});
print_successful_upgrade(from_version, to_version);
print_successful_upgrade(config_version, to_version);
config
}
pub fn command_args<'a, 'b>() -> App<'a, 'b> {
App::new("upgrade").about("Try to upgrade the mixnode")
.arg(
Arg::with_name("id")
.long("id")
.help("Id of the nym-socks5-client we want to upgrade")
.takes_value(true)
.required(true),
)
// the rest of arguments depend on the upgrade path
.arg(Arg::with_name("current version")
.long("current-version")
.help("REQUIRED FOR PRE-0.9.0 UPGRADES. Specifies current version of the configuration file to help to determine a valid upgrade path. Valid formats include '0.8.1', 'v0.8.1' or 'V0.8.1'")
.takes_value(true)
)
fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version) {
loop {
let config_version = parse_config_version(&config);
if config_version == package_version {
println!("You're using the most recent version!");
return;
}
config = match config_version.major {
0 => match config_version.minor {
9 | 10 => outdated_upgrade(&config_version, &package_version),
11 => minor_0_12_upgrade(config, matches, &config_version, &package_version),
_ => unsupported_upgrade(&config_version, &package_version),
},
_ => unsupported_upgrade(&config_version, &package_version),
}
}
}
pub fn execute(matches: &ArgMatches) {
let current = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
// technically this is not a correct way of checking it as a released version might contain valid build identifiers
// however, we are not using them ourselves at the moment and hence it should be fine.
// if we change our mind, we could easily tweak this code
if current.is_prerelease() || !current.build.is_empty() {
eprintln!(
"Trying to upgrade to a non-released version {}. This is not supported!",
current
);
process::exit(1)
}
let package_version = parse_package_version();
let id = matches.value_of("id").unwrap();
let mut existing_config = Config::load_from_file(id).unwrap_or_else(|err| {
let existing_config = Config::load_from_file(Some(id)).unwrap_or_else(|err| {
eprintln!("failed to load existing config file! - {:?}", err);
process::exit(1)
});
// versions fields were added in 0.9.0
if existing_config.get_base().get_version() == MISSING_VALUE {
let self_reported_version = matches.value_of("current version").unwrap_or_else(|| {
eprintln!(
"trying to upgrade from pre v0.9.0 without providing current system version!"
);
process::exit(1)
});
// upgrades up to 0.9.0
existing_config = pre_090_upgrade(self_reported_version, existing_config);
eprintln!("the existing configuration file does not seem to contain version number.");
process::exit(1);
}
let config_version =
Version::parse(existing_config.get_base().get_version()).unwrap_or_else(|err| {
eprintln!("failed to parse node version! - {:?}", err);
process::exit(1)
});
if config_version.is_prerelease() || !config_version.build.is_empty() {
eprintln!(
"Trying to upgrade to from non-released version {}. This is not supported!",
current
);
process::exit(1)
}
// here be upgrade path to 0.10.0 and beyond based on version number from config
if config_version == current {
println!("You're using the most recent version!");
} else {
eprintln!("Cannot perform upgrade from {} to {}. Please let the developers know about this issue!", config_version, current);
process::exit(1)
}
// here be upgrade path to 0.9.X and beyond based on version number from config
do_upgrade(existing_config, matches, package_version)
}
+3 -13
View File
@@ -1,15 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
pub mod client;
pub mod socks;
+2 -13
View File
@@ -1,16 +1,5 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use clap::{App, ArgMatches};
+6 -7
View File
@@ -51,9 +51,10 @@ mod tests {
#[test]
fn constructor_works() {
let mut auth_methods: Vec<u8> = Vec::new();
auth_methods.push(AuthenticationMethods::NoAuth as u8);
auth_methods.push(AuthenticationMethods::UserPass as u8);
let auth_methods = vec![
AuthenticationMethods::NoAuth as u8,
AuthenticationMethods::UserPass as u8,
];
let admin = User {
username: "foo".to_string(),
@@ -98,8 +99,7 @@ mod tests {
#[test]
fn allowed_user_passes_authentication_check() {
let mut auth_methods: Vec<u8> = Vec::new();
auth_methods.push(AuthenticationMethods::UserPass as u8);
let auth_methods = vec![AuthenticationMethods::UserPass as u8];
let admin = User {
username: "foo".to_string(),
@@ -115,8 +115,7 @@ mod tests {
#[test]
fn disallowed_user_fails_authentication_check() {
let mut auth_methods: Vec<u8> = Vec::new();
auth_methods.push(AuthenticationMethods::UserPass as u8);
let auth_methods = vec![AuthenticationMethods::UserPass as u8];
let bad_user = User {
username: "ashy".to_string(),
+29 -30
View File
@@ -17,9 +17,10 @@ use proxy_helpers::connection_controller::{
use proxy_helpers::proxy_runner::ProxyRunner;
use rand::RngCore;
use socks5_requests::{ConnectionId, RemoteAddress, Request};
use std::net::{Shutdown, SocketAddr};
use std::io;
use std::net::SocketAddr;
use std::pin::Pin;
use tokio::prelude::*;
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf};
use tokio::{self, net::TcpStream};
#[pin_project(project = StateProject)]
@@ -61,12 +62,12 @@ impl StreamState {
}
}
fn shutdown(&self, how: Shutdown) -> io::Result<()> {
async fn shutdown(&mut self) -> io::Result<()> {
// shutdown should only be called if proxy is not being run. If it is, there's some bug
// somewhere
match self {
StreamState::RunningProxy => panic!("Tried to shutdown stream while proxy is running"),
StreamState::Available(ref stream) => TcpStream::shutdown(stream, how),
StreamState::Available(ref mut stream) => TcpStream::shutdown(stream).await,
}
}
}
@@ -76,8 +77,8 @@ impl AsyncRead for StreamState {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
buf: &mut ReadBuf<'_>,
) -> Poll<io::Result<()>> {
match self.project() {
StateProject::RunningProxy => Poll::Ready(Err(io::Error::new(
io::ErrorKind::NotFound,
@@ -138,15 +139,18 @@ pub(crate) struct SocksClient {
connection_id: ConnectionId,
service_provider: Recipient,
self_address: Recipient,
started_proxy: bool,
}
impl Drop for SocksClient {
fn drop(&mut self) {
// TODO: decrease to debug/trace
debug!("Connection {} is getting closed", self.connection_id);
self.controller_sender
.unbounded_send(ControllerCommand::Remove(self.connection_id))
.unwrap();
// if we never managed to start a proxy, the entry will not exist in the controller
if self.started_proxy {
self.controller_sender
.unbounded_send(ControllerCommand::Remove(self.connection_id))
.unwrap();
}
}
}
@@ -171,6 +175,7 @@ impl SocksClient {
input_sender,
service_provider,
self_address,
started_proxy: false,
}
}
@@ -186,9 +191,9 @@ impl SocksClient {
}
/// Shutdown the TcpStream to the client and end the session
pub fn shutdown(&mut self) -> Result<(), SocksProxyError> {
pub async fn shutdown(&mut self) -> Result<(), SocksProxyError> {
info!("client is shutting down its TCP stream");
self.stream.shutdown(Shutdown::Both)?;
self.stream.shutdown().await?;
Ok(())
}
@@ -206,28 +211,21 @@ impl SocksClient {
// Handle SOCKS4 requests
if header[0] != SOCKS_VERSION {
warn!("Init: Unsupported version: SOCKS{}", self.socks_version);
self.shutdown()?;
self.shutdown().await
}
// Valid SOCKS5
else {
// Authenticate w/ client
self.authenticate().await?;
// Handle requests
self.handle_request().await?;
self.handle_request().await
}
Ok(())
}
async fn send_connect_to_mixnet(&mut self, remote_address: RemoteAddress) {
let req = Request::new_connect(
self.connection_id,
remote_address.clone(),
self.self_address.clone(),
);
let req = Request::new_connect(self.connection_id, remote_address, self.self_address);
let input_message =
InputMessage::new_fresh(self.service_provider.clone(), req.into_bytes(), false);
let input_message = InputMessage::new_fresh(self.service_provider, req.into_bytes(), false);
self.input_sender.unbounded_send(input_message).unwrap();
}
@@ -272,16 +270,17 @@ impl SocksClient {
// setup for receiving from the mixnet
let (mix_sender, mix_receiver) = mpsc::unbounded();
self.controller_sender
.unbounded_send(ControllerCommand::Insert(self.connection_id, mix_sender))
.unwrap();
match request.command {
// Use the Proxy to connect to the specified addr/port
SocksCommand::Connect => {
trace!("Connecting to: {:?}", remote_address.clone());
self.acknowledge_socks5().await;
self.started_proxy = true;
self.controller_sender
.unbounded_send(ControllerCommand::Insert(self.connection_id, mix_sender))
.unwrap();
info!(
"Starting proxy for {} (id: {})",
remote_address.clone(),
@@ -326,7 +325,7 @@ impl SocksClient {
/// username and password from the stream, then check with the Authenticator
/// to see if the resulting user is allowed.
///
/// A lot of this could probably be put into the the `SocksRequest::from_stream()`
/// A lot of this could probably be put into the `SocksRequest::from_stream()`
/// constructor, and/or cleaned up with tokio::codec. It's mostly just
/// read-a-byte-or-two. The bytes being extracted look like this:
///
@@ -392,7 +391,7 @@ impl SocksClient {
self.stream.write_all(&response).await?;
// Shutdown
self.shutdown()?;
self.shutdown().await?;
}
Ok(())
@@ -406,7 +405,7 @@ impl SocksClient {
warn!("Client has no suitable authentication methods!");
response[1] = AuthenticationMethods::NoMethods as u8;
self.stream.write_all(&response).await?;
self.shutdown()?;
self.shutdown().await?;
Err(ResponseCode::Failure.into())
}
}
+1 -1
View File
@@ -32,9 +32,9 @@ impl MixnetResponseListener {
.unwrap();
MixnetResponseListener {
controller_sender,
buffer_requester,
mix_response_receiver,
controller_sender,
}
}
+2 -1
View File
@@ -2,10 +2,11 @@ use super::types::{AddrType, ResponseCode, SocksProxyError};
use super::{utils as socks_utils, SOCKS_VERSION};
use log::*;
use std::fmt::{self, Display};
use tokio::prelude::*;
use tokio::io::{AsyncRead, AsyncReadExt};
/// A Socks5 request hitting the proxy.
pub(crate) struct SocksRequest {
#[allow(dead_code)]
pub version: u8,
pub command: SocksCommand,
pub addr_type: AddrType,
+2 -2
View File
@@ -48,7 +48,7 @@ impl SphinxSocksServer {
input_sender: InputMessageSender,
buffer_requester: ReceivedBufferRequestSender,
) -> Result<(), SocksProxyError> {
let mut listener = TcpListener::bind(self.listening_address).await.unwrap();
let listener = TcpListener::bind(self.listening_address).await.unwrap();
info!("Serving Connections...");
// controller for managing all active connections
@@ -100,7 +100,7 @@ impl SphinxSocksServer {
if client.error(response).await.is_err() {
warn!("Failed to send error code");
};
if client.shutdown().is_err() {
if client.shutdown().await.is_err() {
warn!("Failed to shutdown TcpStream");
};
}
+5
View File
@@ -0,0 +1,5 @@
.DS_Store
/node_modules/
/src/node_modules/@sapper/
yarn-error.log
/__sapper__/
+33
View File
@@ -0,0 +1,33 @@
## Prerequisites
On Ubuntu-ish systems (not tested on Debian but may work):
```
sudo apt update && sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
libssl-dev \
libgtk-3-dev \
libappindicator3-dev \
patchelf \
librsvg2-dev```
## Getting started
1. Start Sapper([docs](https://sapper.svelte.dev/docs/)) -> `yarn run dev`
2. Start Tauri([docs](https://tauri.studio/en/)) in another terminal -> `yarn tauri dev`
3. Start validator-api locally, or override `validator-urls` in `index.svelte`
## Getting around
+ Frontend -> `tauri-client/`
+ logic -> `tauri-client/src/routes/index.svelte`
+ assets -> `tauri-client/static`
+ Backend -> `tauri-client/src/src-tauri`
## Build standalone app
+ yarn tauri build [--debug]
File diff suppressed because it is too large Load Diff
+38
View File
@@ -0,0 +1,38 @@
{
"name": "TODO",
"description": "TODO",
"version": "0.0.1",
"scripts": {
"dev": "sapper dev",
"build": "sapper build --legacy",
"export": "sapper export --legacy",
"start": "node __sapper__/build"
},
"dependencies": {
"@tauri-apps/api": "^1.0.0-beta.4",
"compression": "^1.7.1",
"polka": "next",
"qrious": "^4.0.2",
"sirv": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"@rollup/plugin-babel": "^5.0.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-replace": "^2.4.0",
"@rollup/plugin-url": "^5.0.0",
"@tauri-apps/cli": "^1.0.0-beta.5",
"rollup": "^2.3.4",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"sapper": "^0.28.0",
"sass": "^1.35.2",
"svelte": "^3.17.3",
"svelte-preprocess": "^4.7.4"
}
}
+140
View File
@@ -0,0 +1,140 @@
import path from "path";
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import commonjs from "@rollup/plugin-commonjs";
import url from "@rollup/plugin-url";
import svelte from "rollup-plugin-svelte";
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import config from "sapper/config/rollup.js";
import pkg from "./package.json";
import sveltePreprocess from "svelte-preprocess";
const mode = process.env.NODE_ENV;
const dev = mode === "development";
const legacy = !!process.env.SAPPER_LEGACY_BUILD;
const onwarn = (warning, onwarn) =>
(warning.code === "MISSING_EXPORT" && /'preload'/.test(warning.message)) ||
(warning.code === "CIRCULAR_DEPENDENCY" &&
/[/\\]@sapper[/\\]/.test(warning.message)) ||
onwarn(warning);
export default {
client: {
input: config.client.input(),
output: config.client.output(),
plugins: [
replace({
preventAssignment: true,
values: {
"process.browser": true,
"process.env.NODE_ENV": JSON.stringify(mode),
},
}),
svelte({
compilerOptions: {
dev,
hydratable: true,
},
preprocess: sveltePreprocess(),
}),
url({
sourceDir: path.resolve(__dirname, "src/node_modules/images"),
publicPath: "/client/",
}),
resolve({
browser: true,
dedupe: ["svelte"],
}),
commonjs(),
legacy &&
babel({
extensions: [".js", ".mjs", ".html", ".svelte"],
babelHelpers: "runtime",
exclude: ["node_modules/@babel/**"],
presets: [
[
"@babel/preset-env",
{
targets: "> 0.25%, not dead",
},
],
],
plugins: [
"@babel/plugin-syntax-dynamic-import",
[
"@babel/plugin-transform-runtime",
{
useESModules: true,
},
],
],
}),
!dev &&
terser({
module: true,
}),
],
preserveEntrySignatures: false,
onwarn,
},
server: {
input: config.server.input(),
output: config.server.output(),
plugins: [
replace({
preventAssignment: true,
values: {
"process.browser": false,
"process.env.NODE_ENV": JSON.stringify(mode),
},
}),
svelte({
compilerOptions: {
dev,
generate: "ssr",
hydratable: true,
},
emitCss: false,
}),
url({
sourceDir: path.resolve(__dirname, "src/node_modules/images"),
publicPath: "/client/",
emitFiles: false, // already emitted by client build
}),
resolve({
dedupe: ["svelte"],
}),
commonjs(),
],
external: Object.keys(pkg.dependencies).concat(
require("module").builtinModules
),
preserveEntrySignatures: "strict",
onwarn,
},
serviceworker: {
input: config.serviceworker.input(),
output: config.serviceworker.output(),
plugins: [
resolve(),
replace({
preventAssignment: true,
values: {
"process.browser": true,
"process.env.NODE_ENV": JSON.stringify(mode),
},
}),
commonjs(),
!dev && terser(),
],
preserveEntrySignatures: false,
onwarn,
},
};

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