• User Guide
    • Security Notes
      Security Notes
    • Online/Desktop Apps
      • Account Management
        • Create Account
          Create Account
        • Sign in to Account
          Sign in to Account
        • Recover Account
          Recover Account
        • Find Out Your Waves.Exchange Address
          Find Out Your Waves.Exchange Address
        • Create Personal Alias
          Create Personal Alias
        • Import From Waves Keeper
          Import From Waves Keeper
        • Use Ledger Nano Devices With Waves.Exchange
          Use Ledger Nano Devices With Waves.Exchange
        Account Management
      • Asset Management
        • Transfer Cryptocurrency
          • Transactions Tab
            Transactions Tab
          Transfer Cryptocurrency
        • Buy Cryptocurrency with a Bank Card
          • How to Use Advanced Cash
            How to Use Advanced Cash
          Buy Cryptocurrency with a Bank Card
        • Neutrino Governance
          Neutrino Governance
        • Stake Asset
          • OTC Service
            OTC Service
          • Swap WAVES/USDN
            Swap WAVES/USDN
          • How to Get USDN (Quick Guide)
            How to Get USDN (Quick Guide)
          • How to Get USDT (Quick Guide)
            How to Get USDT (Quick Guide)
          Stake Asset
        • Swap DeFo
          Swap DeFo
        • Neutrino Pools
          Neutrino Pools
        • Create Asset
          Create Asset
        • Distribute Asset
          Distribute Asset
        • Reissue Asset
          Reissue Asset
        • Change Reissuable to Not Reissuable
          Change Reissuable to Not Reissuable
        • Burn Asset
          Burn Asset
        • Sponsored Transaction
          Sponsored Transaction
        • Sponsored Fee
          Sponsored Fee
        Asset Management
      • Advanced Features
        • Script Transaction
          Script Transaction
        • JSON Confirmation
          JSON Confirmation
        Advanced Features
      • Start Trading on Waves.Exchange
        Start Trading on Waves.Exchange
      • Leverage
        Leverage
      Online/Desktop Apps
    • Mobile Apps
      • Account Management
        • Create Account
          Create Account
        • Sign in to Account
          Sign in to Account
        • Recover Account
          Recover Account
        • Find Out Your Waves.Exchange Address
          Find Out Your Waves.Exchange Address
        • Create Personal Alias
          Create Personal Alias
        Account Management
      • Asset Management
        • Transfer Cryptocyrrency
          Transfer Cryptocyrrency
        • Buy Cryptocurrency with a Bank Card
          Buy Cryptocurrency with a Bank Card
        • Stake WAVES
          Stake WAVES
        • Stake USDN
          Stake USDN
        • Burn Asset
          Burn Asset
        Asset Management
      • Start Trading on Waves.Exchange
        Start Trading on Waves.Exchange
      Mobile Apps
    User Guide
  • API and Library
    • CCXT
      CCXT
    • Fees
      Fees
    • Payment API
      Payment API
    • Web Auth API
      Web Auth API
    • Gateway API
      • Access Token
        • Get Access Token in Waves.Exchange App
          Get Access Token in Waves.Exchange App
        • POST /v1/oauth2/token
          POST /v1/oauth2/token
        Access Token
      • Deposit
        • GET /v1/deposit/addresses/{currency}
          GET /v1/deposit/addresses/{currency}
        • GET /v1/deposit/currencies
          GET /v1/deposit/currencies
        • GET /v1/deposit/currencies/{currency}
          GET /v1/deposit/currencies/{currency}
        • Terms of Deposit
          Terms of Deposit
        Deposit
      • Withdraw
        • GET /v1/withdraw/addresses/{currency}/{address}
          GET /v1/withdraw/addresses/{currency}/{address}
        • GET /v1/withdraw/currencies
          GET /v1/withdraw/currencies
        • GET /v1/withdraw/currencies/{currency}
          GET /v1/withdraw/currencies/{currency}
        • Terms of Withdrawal
          Terms of Withdrawal
        Withdraw
      • Movements History
        Movements History
      • Platforms List
        Platforms List
      • Crosschain Supply Consistency
        Crosschain Supply Consistency
      • Error Codes
        Error Codes
      Gateway API
    • Matcher
      • Waves.Exchange Protocol
        Waves.Exchange Protocol
      • Matcher Fee
        Matcher Fee
      • Install Matcher on Ubuntu From Deb-package
        Install Matcher on Ubuntu From Deb-package
      • Matcher Settings
        Matcher Settings
      • Matcher API
        • Order Validation
          Order Validation
        • Exchange Transation Validation
          Exchange Transation Validation
        Matcher API
      Matcher
    API and Library
  • Glossary
    Glossary
      • English
      • Русский
      On this page
        • System Requirements
        • Checking the Version of the Installed OpenJDK
        • OpenJDK Version 8 Installation
        • Node installation
        • Node setup
        • Installing matcher

          # Install Matcher on Ubuntu From Deb-package

          Waves.Exchange Matcher executes orders on buying/selling an asset. Everyone can deploy matcher and start getting a reward from executing orders.

          Let's review the order execution process.

          1. Matcher receives an order to buy/sell some asset pair. The order contains information about asset A amount and its price, expressed in asset B amount.
          2. Matcher accumulates the orders in the order book. When a new order is received, the matcher matches it with the present orders and tries to find mutually satisfying orders.
          3. If mutually satisfying orders are found, then the matcher sends the exchange transaction to the blockchain. As a result, the mentioned orders are being executed. If the mutually satisfying orders are not found, then the new order is sent to the order book.
          4. Matcher gets a matcher fee from each sender of the executed orders.
          5. Matcher repays exchange transaction fee to the miner. Matcher reward is the difference between the matcher fee and the exchange transaction fee.

          The current article considers deploying matcher from deb-package. Because matcher is a node extension, the node must be deployed prior to the matcher activation.

          # System Requirements

          • 2 core CPU
          • 4 GB RAM
          • 50 GB HDD

          # Checking the Version of the Installed OpenJDK

          Make sure that you have OpenJDK version 8 installed. To do so, execute the following command in the console:

          java -version 2>&1 | grep "openjdk version \"1.8" | wc -l
          

          If 0 is being displayed, then proceed to OpenJDK version 8 installation step.

          If 1 is being displayed, then proceed to Node installation.

          # OpenJDK Version 8 Installation

          To install OpenJDK version 8, execute in the console:

          sudo apt-get update
          sudo apt-get install openjdk-8-jre
          

          # Node installation

          1. Download the latest version of waves_<version>_all.deb file from https://github.com/wavesplatform/Waves/releases.

          2. Execute in the console

            sudo dpkg -i /path/to/waves_<version>_all.deb
            
          3. Move to /var/lib/waves folder by executing

            cd /var/lib/waves
            

          # Node setup

          1. Open the /usr/share/waves/conf/waves.conf file using the following command:

            sudo nano /usr/share/waves/conf/waves.conf
            
          2. Decide whether the existing or new account should be used for the node. Use the existing account if you plan to use your node as a mining node.

            • To use a new account, uncomment in wallet section the password parameter and set a value for it. Example:

              wallet {
                # Password to protect wallet file
                password = iAmGoingToUseAnewAccount
                # Wallet seed as BASE58 string
                # seed =
              }
              
            • To use an existing account, input in wallet section the password and, in base58 encoding, the seed.

              wallet {
                # Password to protect wallet file
                password = iAmGoingToUseAnExistingAccount
                # Wallet seed as BASE58 string
                seed = 35S7EzKMHMN4JQyWnwpp84Zot1yqLoP2Q46RsbYRzgFq7n8AiV8L6skeGPq93P2NU4pGcZFeNTAT2TKJTa2XvqRwSdCmBR556MBmtZ3ggAkBtd3CCZFvZwZufz1ZqfzJQ
              }
              
          3. Add to /usr/share/waves/conf/waves.conf file the section:

            waves.extensions = ["com.wavesplatform.dex.Matcher"]
            
          4. Set in /usr/share/waves/conf/waves.conf file in rest_api section the following parameters:

            • enable = yes
            • api_key_hash = " "
            rest-api {
              # Disable node’s REST API
              enable = yes
              …
              api_key_hash = " "
            }
            
          5. Start node by executing the following command:

            sudo systemctl start waves
            
          6. Generate non-empty api_key_hash value. Execute command:

            curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '<YOUR_ARBITRARY_STRING>' '127.0.0.1:6869/utils/hash/secure'
            

            Please use your own value instead of <YOUR_ARBITRARY_STRING>. It is recommended to store it. As a result, you will see the following output:

            {"message": "YOUR_ARBITRARY_STRING", "hash": "3QbuM9nJP9GZQDekgfGboPGDQe4g1nsH4kmK2jbCLAFJ"}
            
          7. Set in the /usr/share/waves/conf/waves.conf file in the rest_api section the value of api_key_hash parameter:

            rest-api {
              …
              api_key_hash = “3QbuM9nJP9GZQDekgfGboPGDQe4g1nsH4kmK2jbCLAFJ”
            }
            
          8. Restart the node by executing the following command:

            sudo systemctl restart waves
            
          9. Make sure that blockchain is downloaded. Execute the following command:

            sudo journalctl -u waves -f
            

            As a result, the blockchain download log will be displayed. If "microblock appended" entries started to appear in the log, then blockchain is completely downloaded.

          10. Press Ctrl-C to close the log.

          11. Discover the node account address. To do so, execute the following command:

          curl 127.0.0.1:6869/addresses
          

          As a result, the node account address will be displayed, for example, 3PAbvhnSesJGUd1Ry6YM1qCALTSD4pYGxG.

          1. Execute the following steps in /usr/share/waves/conf/waves.conf file:

            1. Create a waves.dex section.
            2. Set the node account address for matcher. To do so, assign in waves.dex section the value obtained in the previous step to account parameter.
            waves.dex {
              account = "3PAbvhnSesJGUd1Ry6YM1qCALTSD4pYGxG"
              # bind-address = "0.0.0.0" # uncomment this line to accept connections from any host
            }
            

          Other node parameters are out of the scope of the current article. To get more information about node parameters, refer to Node Configuration (opens new window).

          # Installing matcher

          1. Download the latest version of dex_<version>_all.deb file from https://github.com/wavesplatform/dex/releases (opens new window).

          2. Execute the following command in the console:

            sudo dpkg -i /path/to/dex_<version>_all.deb
            
          3. Restart the node by executing:

            sudo systemctl restart waves
            
          4. Make sure that matcher is successfully started. To do so, execute:

            curl 127.0.0.1:6886/matcher
            

          As a result, the matcher account address will be displayed. Congratulations, you've successfully installed the matcher.

          Matcher Fee
          Matcher Settings
          Matcher Fee
          Matcher Settings