Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@vsuharnikov vsuharnikov released this 17 Mar 13:15
· 562 commits to master since this release
e9ea0be

In this release

The project was split into parts:

  1. The DEX server. Contains matching engine, provides a REST API to place and cancel orders, getting order books and etc. It contains only one artifact for any blockchain network. The DEX server should know a host with a Waves DEX extension.
  2. The NODE extension called Waves DEX extension which needs to be installed on NODE. It starts a gRPC server and provides a blockchain API for DEX server.

We recommend to install DEX server on a dedicated machine. An installation on the same machine is possible too.
For a better availablity we suggest to setup several NODEs with Waves DEX extension using round-robin DNS.

Note! Make sure the DEX server will connect to the NODE with the actual blockchain. The DEX server has to collect some information about assets during start.

See installation instructions on the main page.

Changes

We were focused more on splitting and testing, but some features and fixes were included too.

Severe

  • DEX Server won't issue ExchangeTransactionV1 anymore. Make sure, your blockchain supports "Smart Account Trading" (feature 10)

New

  • Added an ability to make the fee different for maker and taker. See waves.dex.order-fee in application.conf for more information;
  • Added a possibility of fee changing. The DEX Server restart is required anyway, but you can specify the new rule from a some offset on all your DEX Servers and they will change an algorithm in a consistent way. See waves.dex.order-fee for more information;
  • Introduced a new binary waves-dex-cli. It can do some useful things now and will be improved later. Just write waves-dex-cli --help
  • A fresh Swagger UI;

Fixes

  • History database: fixed improperly formatted amounts, prices and fee when they have huge values (e.g. 98778998 WAVES). Also this fix solves an akin issue in errors output;
  • Improved a thread pools management. This solves a small set of performance issues;
  • Solved 10 seconds delay during DEX server starting;
  • Better handling of invalid JSONs those are sent to REST API;
  • Improved logging. Some log entries could not be written before this fix;
  • A DEX server has different exit codes for different starting issues. If your instance stopped during start, please attach this code to the issue;

Other notable technical changes

  • DEX project doesn't depend on NODE at all. Required dependencies are downloaded automatically.
  • Updated dependencies of used libraries to fresh versions;
  • DEB artifacts: waves-dex-extension is marked as incompatible with grpc-server extension, because they both had a common set of dependencies, probably with incompatible versions;

Migration

No data migration is required, only a configuration.

1. Waves DEX extension

  1. If "Smart Account Trading" wasn't activated before update:

    1. Block requests to DEX
    2. Make snapshots for order books via POST /matcher/debug/saveSnapshots
  2. Save the previous DEX configuration

  3. Uninstall the DEX extension

  4. Remove the previous DEX configuration from the NODE's config. Add instead settings:

# Waves NODE settings
# ...

waves {
  extensions += "com.wavesplatform.dex.grpc.integration.DEXExtension"
  dex {
    # gRPC integration settings for Waves Node
    grpc.integration {
      # "0.0.0.0" if the DEX server connects to the DEX extension from other machine
      host = "127.0.0.1"
      port = 6887
    }
  }
}
  1. Install the new DEX extension. Note, it requires NODE 1.1.8

2. DEX Server

Install DEX Server. Old settings now are DEX server settings, but a migration is required:

  1. The database should be moved from NODE's directory to the DEX Server's one, e.g.: mv /var/lib/waves-testnet/matcher to /var/lib/waves-dex

  2. Added a new mandatory field: waves.dex.address-scheme-character. It should have a following value:

    • W for MainNet. For example: waves.dex.address-scheme-character = "W";
    • T for TestNet;
    • S for StageNet;
    • or your custom network byte;
  3. Added a new mandatory field: waves.dex.waves-blockchain-client. Sample configuration:

    # external_or_host_with_extension:port_of_extension
    waves.dex.waves-blockchain-client.grpc.target = "192.168.1.2:6887"
  4. account was replaced by account-storage. Generate an account storage and follow instructions.

  5. bind-address and port were replaced by rest-api. Sample configuration:

    waves.dex.rest-api {
      # Here is old "bind-address"
      address = "127.0.0.1"
    
      # Here is your old "port"
      port = 6886 
    
      # Hash of API key string in the Base58 encoding
      # Run "waves-cli-dex create-api-key" and follow instructions to replace
      #   this value
      api-key-hash = "4Cmi2ZMmH7nTRig9fnDVzSmfXA9mCcyeqyswPbRhLS34"
      
      # Enable/disable CORS support
      # If you want to access DEX Server REST API from the other hosts in a browser, 
      #   otherwise set to "no"
      cors = yes
    
      # Enable/disable X-API-Key from different host
      # If enabled, a client from other hosts can pass X-Api-Key in a browser and
      #   therefore has an access to the private API
      api-key-different-host = no
    }
  6. The order-fee setting now supports a switching of a fee algorithm. The default rule has -1offset. Sample configuration:

    waves.dex.order-fee {
      -1: {
        # Here is your old "order-fee" content
      }
    }

SHA256 Checksums

bff2410564387bbff0bcd413f218a1e15d31dd9838a80098bb279385555da60b waves-dex-2.0.0.zip
0490e383d014d42dacd72a60c08daa484c89f8a016cd10cb8f34a2c2672fad1f waves-dex_2.0.0_all.deb
a20b80c9ceecf0195801eabcac3d84dc602fa2cb5abe0256c65b19c2351468ba waves-dex-extension-2.0.0.zip
1542c2b5fa445b9dfd36a4c9c6ed4d62c0e19fff48fe0ca5ed17e7dac531e02d waves-dex-extension_2.0.0_all.deb
4f807fa497d63ed2eba5da6edb8f8d534fe538aeedc18e906e12b2f5f985e931 waves-dex-extension-testnet_2.0.0_all.deb
10ac062b8f6b0605057b413b5d79f4e81158c6ceb2dd8c92649cd5d8abd401a8 waves-dex-extension-stagenet_2.0.0_all.deb