Testnet Setup#

Setting up a masternode with support for evo services requires a basic understanding of Linux and blockchain technology, as well as an ability to follow instructions closely. It also requires regular maintenance and careful security, particularly if you are not storing your Dash on a hardware wallet. There are some decisions to be made along the way, and optional extra steps to take for increased security.

Если вы предпочитаете делегировать повседневную работу вашей мастерноды профессиональному оператору, то для этого существуют коммерческие сервисы хостинга мастернод. Используя такие сервисы хостинга, вы сохраняете полный контроль над залогом в 1000 DASH и выплачиваете согласованный процент от вашего вознаграждения оператору. Также можно делегировать представителю ваши ключи для голосования, для получения дополнительной информации смотрите документацию по управлению:.

Прежде чем начать#

This guide assumes you are setting up a single testnet masternode for the first time. If you are updating a masternode, see here instead. You will need:

  • 1000 DASH

  • Кошелёк для хранения DASH, предпочтительно аппаратный кошелёк, хотя кошелёк Dash Core также поддерживается

  • Сервер Linux, предпочтительно виртуальный выделенный сервер (VPS)

Dash 0.13.0 and later implement DIP003, which introduces several changes to how a Dash masternode is set up and operated. While this network upgrade was completed in early 2019, a list of available documentation appears below:

This documentation describes the commands as if they were entered in the Dash Core GUI by opening the console from Window > Console, but the same result can be achieved on a masternode by entering the same commands and adding the prefix ~/.dashcore/dash-cli to each command.

Настройка VPS#

VPS, более известный как облачный сервер, является полнофункциональной установкой операционной системы (обычно Linux), работающей на виртуальной машине. Виртуальная машина позволяет провайдеру VPS запускать несколько систем на одном физическом сервере, что делает её более эффективной и намного более дешёвой, чем использование одной операционной системы на «голом железе» каждого сервера. VPS идеально подходит для размещения мастерноды Dash, поскольку он обычно обеспечивает гарантированное время безотказной работы, дублирование в случае аппаратного сбоя и статический IP-адрес, необходимый для того, чтобы вы оставались в очереди получения платежей за работу мастерноды. Хотя технически возможно запустить мастерноду из дома на настольном компьютере, она, скорее всего, не будет работать надёжно, поскольку большинство интернет-провайдеров выделяют динамические IP-адреса домашним пользователям.

We will use Vultr hosting as an example of a VPS, although DigitalOcean, Amazon EC2, Google Cloud, Choopa and OVH are also popular choices. First create an account and add credit. Then go to the Servers menu item on the left and click + to add a new server. Select a location for your new server on the following screen:

../../../_images/setup-server-location.png

Экран выбора расположения Vultr-сервера#

Select Ubuntu 22.04 x64 as the server type. We use this LTS release of Ubuntu instead of the latest version because LTS releases are supported with security updates for 5 years, instead of the usual 9 months.

../../../_images/setup-server-type.png

Экран выбора типа Vultr-сервера#

Выберите размер сервера, в котором имеется как минимум 2ГБ памяти.

../../../_images/setup-server-size.png

Экран выбора размера Vultr-сервера#

Введите имя хоста и метку для вашего сервера. В данном примере в качестве имени хоста мы будем использовать dashmn1.

../../../_images/setup-server-hostname.png

Экран выбора имени хоста и метки для Vultr-сервера#

Vultr теперь выполнит установку вашего сервера. Этот процесс может занять несколько минут.

../../../_images/setup-server-installing.png

Экран инсталляции Vultr-сервера#

Когда инсталляция будет завершена, кликните Manage и обратите внимание на IP-адрес, имя пользователя и пароль.

../../../_images/setup-server-manage.png

Экран управления Vultr-сервера#

Настройте вашу операционную систему#

Начнём с подключения к вашему вновь подготовленному серверу. На Windows для начала скачаем приложение для соединения с сервером, которое называется PuTTY. Отправляйтесь на страницу загрузки PuTTY и выберите там соответствующий вашей системе MSI-установщик. Для Mac или Linux вы можете использовать команду ssh прямо из терминала - просто набрав ssh root@<server_ip> после чего по запросу ввести пароль.

../../../_images/setup-putty-download.png

Страница загрузки PuTTY#

Выполните двойной щелчок по скачанному файлу и установите PuTTY, затем запустите приложение из меню Пуск. Введите IP-адрес сервера в поле Host Name и кликните Open. Вы увидите свидетельство, предупреждающее о том, что к этому серверу вы подсоединяетесь впервые. Будет вполне безопасно, если вы кликните Yes, этим вы доверите соединение с этим сервером в будущем.

../../../_images/setup-putty-alert.png

Оповещение безопасности PuTTY при подсоединении к новому серверу#

You are now connected to your server and should see a terminal window. Begin by logging in to your server with the user root and password supplied by your hosting provider.

../../../_images/setup-putty-connect.png

Проверка пароля при первом соединении с VPS#

Вам необходимо немедленно сменить свой root-пароль и в целях безопасности сохранить его в надёжном месте. Можно скопировать и вставить любую из следующих команд, выбрав её в браузере и нажав Ctrl + C, затем перейти в окно PuTTY и кликнуть правой кнопкой мыши в этом окне. Текст будет вставлен на текущем месте расположения курсора:

passwd root

Введите и подтвердите новый пароль (предпочтительно, чтобы он был длинным и сгенерированным случайным образом). Далее произойдёт создание нового пользователя с использованием следующей команды, заменяющей <username> выбранное вами имя пользователя:

adduser <username>

Тут же вам предложат выбрать пароль. Введите его и подтвердите, используя новый пароль (который отличается от вашего рут-пароля) и сохраните его в безопасном месте. Также тут вы можете ввести информацию о пользователе, но эти поля можно не заполнять. После создания пользователя, мы добавим их в sudo группу, таким образом, они смогу выполнять те же команды, что и рут-пользователи:

usermod -aG sudo <username>

Теперь, пока мы все ещё с правами администратора, обновим систему с помощью пакета репозитория Ubuntu:

apt update
apt upgrade

The system will show a list of upgradable packages. Press Y and Enter to install the packages. We will now install a firewall, add swap memory and reboot the server to apply any necessary kernel updates, and then login to our newly secured environment as the new user:

ufw allow ssh/tcp
ufw limit ssh/tcp
ufw allow 19999/tcp
ufw allow 26656/tcp
ufw allow 3000/tcp
ufw allow 3010/tcp
ufw logging on
ufw enable

(нажмите Y и Enter для подтверждения)

fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
nano /etc/fstab

В конце файла добавьте следующую строку (чтобы разделить каждое слово/цифру, нажмите tab), затем нажмите Ctrl + X, чтобы закрыть редактор и потом Y и Enter для сохранения файла.

/swapfile none swap sw 0 0

Наконец, чтобы предотвратить атаки взлома паролей методом «грубой силы», установим fail2ban и отключим root-авторизацию через SSH. Эти шаги не являются обязательными, но выполнить их настоятельно рекомендуется. Начнём с установки fail2ban:

apt install fail2ban

Создайте новый файл конфигурации:

nano /etc/fail2ban/jail.local

И вставьте в него следующую конфигурацию:

[sshd]
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry = 3

Затем нажмите Ctrl + X, чтобы закрыть редактор, а затем Y и Enter, чтобы сохранить файл. Перезапуститесь и активируйте сервис fail2ban:

systemctl restart fail2ban
systemctl enable fail2ban

Далее откройте файл конфигурации SSH, чтобы отключить root-авторизацию через SSH:

nano /etc/ssh/sshd_config

Найдите строку с надписью PermitRootLogin yes и измените её на PermitRootLogin no. Прямо под ней добавьте строку с надписью AllowUsers <username>, заменив <username> именем пользователя, которое вы задали выше. Затем нажмите Ctrl + X, чтобы закрыть редактор, далее Y и Enter, чтобы сохранить файл.

Затем перезагрузите сервер:

reboot now

При перезагрузке сервера PuTTY отсоединится.

Несмотря на то, что данная настройка содержит только базовые шаги для защиты вашего сервера от атак, на самом деле можно сделать гораздо больше. В частности, аутентификацию с публичным ключом вместо комбинации имя пользователя/пароль, а также желательно активировать автоматические обновления безопасности. Больше советов доступно здесь. Однако, поскольку мастернода не хранит ключи всех Dash, указанные способы защиты рассматриваются за рамками данного руководства.

Отправьте залог#

A Dash address with a single unspent transaction output (UTXO) of exactly 1000 DASH is required to operate a masternode. Once it has been sent, various keys regarding the transaction must be extracted for later entry in a configuration file and registration transaction as proof to write the configuration to the blockchain so the masternode can be included in the deterministic list. A masternode can be registered from a hardware wallet or the official Dash Core wallet, although a hardware wallet is highly recommended to enhance security and protect yourself against hacking. This guide will describe the steps for both hardware wallets and Dash Core.

Option 1: Holding collateral in a hardware wallet#

Set up your Trezor using the Trezor wallet at https://wallet.trezor.io/ and send a test transaction to verify that it is working properly. For help on this, see this guide - you may also choose to (carefully!) add a passphrase to your Trezor to further protect your collateral. Create a new account in your Trezor wallet by clicking Add account. Then click the Receive tab and send exactly 1000 DASH to the address displayed. If you are setting up multiple masternodes, send 1000 DASH to consecutive addresses within the same new account. You should see the transaction as soon as the first confirmation arrives, usually within a few minutes.

../../../_images/setup-collateral-trezor.png

Вкладка Receive из кошелька Trezor, в которой отображается успешно переведённый залог в размере 1000 DASH#

Когда транзакция появится, кликните на QR-код справа, чтобы увидеть транзакцию в блокчейне. Не закрывайте это окно, пока выполняете дальнейшие шаги, поскольку скоро нам понадобится подтвердить, что существует 15 подтверждений транзакции, как показано на скриншоте ниже.

../../../_images/setup-collateral-blocks.png

Блокчейн обозреватель Trezor показывает, что прошло 15 подтверждений перевода#

Во время ожидания завершения 15 подтверждений, загрузите последнюю версию Dash Masternode Tool (DMT) со страницы релизов GitHub здесь. Распакуйте и запустите файл. Появится следующее окно.

../../../_images/setup-collateral-dmt-start.png

Экран запуска Dash Masternode Tool#

Кликните третью кнопку слева Check Dash Network Connection в верхнем левом углу главного окна, чтобы убедиться, что соединение работает. Затем соединитесь с вашим устройством Trezor и кликните следующую кнопку Test Hardware Wallet Connection, чтобы убедиться, что соединение с Trezor работает.

../../../_images/setup-collateral-connection.png
../../../_images/setup-collateral-hardware.png

Подтверждения успешного соединения Dash Masternode Tool#

We will now use DMT to enter some basic information about the masternode and extract the transaction ID. Carry out the following sequence of steps as shown in this screenshot:

../../../_images/setup-collateral-dmt-steps.png

Шаги настройки Dash Masternode Tool#

  1. Кликните на кнопку New.

  2. Введите имя вашей мастерноды. Имя хоста, которое вы указали для VPS выше, является хорошим вариантом.

  3. Enter the IP address of your masternode. This was given to you by the VPS provider when you set up the server. Then enter the TCP port number. This should be 19999.

  4. Click Locate collateral to view unused collateral funding transactions available on the connected hardware wallet. Select the address to which you sent 1000 Dash and click Apply. The Collateral address, path, Collateral TX hash and index fields should be filled automatically.

../../../_images/setup-collateral-dmt-ready.png

Dash Masternode Tool with masternode configuration#

Leave DMT open and continue with the next step: installing Dash Core on your VPS.

Option 2: Holding collateral in Dash Core wallet#

Откройте кошелёк Dash Core и дождитесь пока он синхронизируется с сетью. По завершении это должно выглядеть вот так:

../../../_images/setup-collateral-dashcore.png

Полностью синхрониируйте кошелёк Dash Core#

Click Window > Console to open the console. Type the following command into the console to generate a new Dash address for the collateral:

getnewaddress
yiFfzbwiN9oneftd7cEfr3kQLRwQ4kp7ue

Take note of the collateral address, since we will need it later. The next step is to secure your wallet (if you have not already done so). First, encrypt the wallet by selecting Settings > Encrypt wallet. You should use a strong, new password that you have never used somewhere else. Take note of your password and store it somewhere safe or you will be permanently locked out of your wallet and lose access to your funds. Next, back up your wallet file by selecting File > Backup Wallet. Save the file to a secure location physically separate to your computer, since this will be the only way you can access our funds if anything happens to your computer. For more details on these steps, see here.

Now send exactly 1000 DASH in a single transaction to the new address you generated in the previous step. This may be sent from another wallet, or from funds already held in your current wallet. Once the transaction is complete, view the transaction in a blockchain explorer by searching for the address. You will need 15 confirmations before you can register the masternode, but you can continue with the next step at this point already: generating your masternode operator key.

../../../_images/setup-collateral-blocks.png

Блокчейн обозреватель Trezor показывает, что прошло 15 подтверждений перевода#

Masternode Installation#

The following tools are available for installing a Dash masternode:

dashmate installation#

dashmate replaces the dashman masternode installer by moocowmoo. dashmate is based on Docker technology and features an interactive setup command and the ability to manage multiple node configs and multiple networks. It handles the installation of Dash Core and Tenderdash, as well as all dependencies and supporting services. Full dashmate documentation is available here.

Open PuTTY or a console again and connect using the username and password you just created for your new, non-root user. Begin by installing dashmate dependencies:

curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh
sudo usermod -aG docker $USER
newgrp docker
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install 16

Install dashmate:

npm install -g dashmate

Run the interactive setup wizard:

dashmate setup

You will be prompted to select a network, node type, IP address and BLS private key. Enter this information or accept the detected/generated defaults. Start your node as follows:

dashmate start

You can manage your masternode status, configuration, and running state entirely from within dashmate. See the documentation here or use the built-in help system to learn more:

  • dashmate --help

  • dashmate <command> --help

../../../_images/dashmate-status.png

dashmate displaying a range of status output#

You can check the status of your masternode using the various dashmate status commands as follows:

- dashmate status
- dashmate status core
- dashmate status host
- dashmate status masternode
- dashmate status platform
- dashmate status services

Continue with the Registration step to setup the collateral, keys and construct the ProTx transaction required to enable your masternode.

Masternode Update#

You can use dashmate to update minor versions of the software on your masternode as follows:

dashmate stop
dashmate update
dashmate start

Adding the following git and npm commands optionally also ensures you are using the latest stable version of dashmate:

dashmate stop
npm update -g dashmate
dashmate update
dashmate start

Adding the following command will drop all data from Dash Platform (necessary if Platform has been wiped) and restart with the latest version:

dashmate stop
npm update -g dashmate
dashmate reset --platform-only
dashmate update
dashmate start

Masternode registration#

DIP003 introduced several changes to how a masternode is set up and operated. These changes and the three keys required for the different masternode roles are described briefly under Изменения для мастернод DIP003 in this documentation.

Способ 1: Регистрация из аппаратного кошелька#

Возвращайтесь назад в DMT и убедитесь, что все поля из предыдущего шага остались заполнены правильно. Кликните Generate new, чтобы сгенерировать три приватных ключа, которые необходимы для детерминированной мастерноды DIP003:

  • Приватный ключ владельца

  • Operator private key (generate new or use private key generated by dashmate)

  • Приватный ключ голосования

../../../_images/setup-dmt-full.png

Dash Masternode Tool готов к регистрации новой мастерноды#

Then click Register masternode. Optionally specify a different Payout address and/or Operator reward, then click Continue. Select Remote Dash RPC Node (automatic method). (See here for documentation on using your own local RPC node.) and confirm the following two messages:

../../../_images/setup-dmt-send.png
../../../_images/setup-dmt-sent.png

Запрашивающие подтверждение диалоги в Dash Masternode Tool для регистрации мастерноды#

The public key will be used in following steps. The private key must be entered in the configuration on the masternode. This allows the masternode to watch the blockchain for relevant Pro*Tx transactions, and will cause it to start serving as a masternode when the signed ProRegTx is broadcast by the owner (final step below). If you are using the BLS key generated by dashmate setup, this information is already configured for your masternode. If you generated your own BLS key pair, edit the dashmate configuration as follows:

dashmate config set core.masternode.operator.privateKey <bls_private_key>
dashmate restart

At this point you can go back to your terminal window and monitor your masternode by entering dashmate status or using the Get status function in DMT.

You can now safely log out of your server by typing exit. Congratulations! Your masternode is now running.

Способ 2: Регистрация из кошелька Dash Core#

Идентификация транзакции финансирования#

If you used an address in Dash Core wallet for your collateral transaction, you now need to find the txid of the transaction. Click Window > Console and enter the following command:

masternode outputs

This should return a string of characters similar to the following:

{
"16347a28f4e5edf39f4dceac60e2327931a25fdee1fb4b94b63eeacf0d5879e3" : "1",
}

The first long string is your collateralHash, while the last number is the collateralIndex.

Генерация пары BLS-ключей#

A public/private BLS key pair is required to operate a masternode. The private key is specified on the masternode itself, and allows it to be included in the deterministic masternode list once a provider registration transaction with the corresponding public key has been created.

If you are using a hosting service, they may provide you with their public key, and you can skip this step. If you are hosting your own masternode or have agreed to provide your host with the BLS private key, you can use the BLS key generated by the dashmate setup command. Alternatively, you can generate a BLS public/private keypair in Dash Core by clicking Window > Console and entering the following command:

bls generate

{
  "secret": "395555d67d884364f9e37e7e1b29536519b74af2e5ff7b62122e62c2fffab35e",
  "public": "99f20ed1538e28259ff80044982372519a2e6e4cdedb01c96f8f22e755b2b3124fbeebdf6de3587189cf44b3c6e7670e"
}

These keys are NOT stored by the wallet or dashmate and must be kept secure, similar to the value provided in the past by the masternode genkey command.

Добавьте приватный ключ в конфигурацию вашей мастерноды#

The public key will be used in following steps. The private key must be entered in the dash.conf file on the masternode. This allows the masternode to watch the blockchain for relevant Pro*Tx transactions, and will cause it to start serving as a masternode when the signed ProRegTx is broadcast by the owner (final step below). If you are using the BLS key generated by dashmate setup, this information is already configured for your masternode. If you generated your own BLS key pair, edit the dashmate configuration as follows:

dashmate config set core.masternode.operator.privateKey <bls_private_key>
dashmate restart

We will now prepare the transaction used to register the masternode on the network.

Подготовка транзакции ProRegTx#

A pair of BLS keys for the operator were already generated above, and the private key was entered on the masternode. The public key is used in this transaction as the operatorPubKey.

First, we need to get a new, unused address from the wallet to serve as the owner key address (ownerKeyAddr). This is not the same as the collateral address holding 1000 Dash. Generate a new address as follows:

getnewaddress

yfgxFhqrdDG15ZWKJAN6dQvn6dZdgBPAip

This address can also be used as the voting key address (votingKeyAddr). Alternatively, you can specify an address provided to you by your chosen voting delegate, or simply generate a new voting key address as follows:

getnewaddress

yfRaZN8c3Erpqj9iKnmQ9QDBeUuRhWV3Mg

Then either generate or choose an existing address to receive the owner’s masternode payouts (payoutAddress). It is also possible to use an address external to the wallet:

getnewaddress

yjZVt49WsQd6XSrPVAUGXtJccxviH9ZQpN

You can also optionally generate and fund another address as the transaction fee source (feeSourceAddress). If you selected an external payout address, you must specify a fee source address.

Either the payout address or fee source address must have enough balance to pay the transaction fee, or the register_prepare transaction will fail.

Приватные ключи владельца и адреса источника оплаты комиссии должны присутствовать в кошельке, отправляющем транзакцию в сеть. Если ваш кошелёк защищён паролем, то для выполнения указанных команд его необходимо разблокировать. Разблокируйте свой кошелёк на 5 минут:

walletpassphrase yourSecretPassword 300

Сейчас мы подготовим неподписанную специальную ProRegTx-транзакцию, использовав команду protx register_prepare. Эта команда имеет следующий синтаксис:

protx register_prepare collateralHash collateralIndex ipAndPort ownerKeyAddr
  operatorPubKey votingKeyAddr operatorReward payoutAddress (feeSourceAddress)

Откройте текстовый редактор, например Блокнот и подготовьте эту команду. Замените каждый аргумент команды следующим образом:

  • collateralHash: txid транзакции залогового финансирования на 1000 DASH

  • collateralIndex: Индекс выхода транзакции финансирования на 1000 DASH

  • ipAndPort: IP-адрес и порт мастерноды в формате x.x.x.x:yyyy

  • ownerKeyAddr: Сгенерированный выше новый адрес Dash для владельца/голосования

  • operatorPubKey: Публичный BLS-ключ, сгенерированный выше (или предоставленный хостинг-сервисом)

  • votingKeyAddr: Новый адрес Dash, сгенерированный выше или адрес делегата, используемый для голосования по предложениям

  • operatorReward: Процент награды за блок, который выделен оператору в качестве оплаты

  • payoutAddress: Новый или существующий адрес Dash для получения платежей от владельца мастерноды

  • feeSourceAddress: (Необязательный) адрес, используемый для финансирования комиссий ProTx. Если не указан, то будет использоваться payoutAddress.

Обратите внимание, что оператор несёт ответственность за указание адреса, на который будет начисляться его собственная награда в отдельной транзакции update_service в случае, если вы укажете отличную от нуля награду operatorReward. Владелец залогового подтверждения не указывает адрес для выплаты оператору.

Пример (удалите разрывы строк при копировании):

protx register_prepare
  16347a28f4e5edf39f4dceac60e2327931a25fdee1fb4b94b63eeacf0d5879e3
  1
  45.76.230.239:19999
  yfgxFhqrdDG15ZWKJAN6dQvn6dZdgBPAip
  99f20ed1538e28259ff80044982372519a2e6e4cdedb01c96f8f22e755b2b3124fbeebdf6de3587189cf44b3c6e7670e
  yfRaZN8c3Erpqj9iKnmQ9QDBeUuRhWV3Mg
  0
  yjZVt49WsQd6XSrPVAUGXtJccxviH9ZQpN
  yR83WsikBaBaNusTnHZf28kAcL8oVmp1TE

На выходе:

{
  "tx": "030001000175c9d23c2710798ef0788e6a4d609460586a20e91a15f2097f56fc6e007c4f8e0000000000feffffff01a1949800000000001976a91434b09363474b14d02739a327fe76e6ea12deecad88ac00000000d1010000000000e379580dcfea3eb6944bfbe1de5fa2317932e260acce4d9ff3ede5f4287a34160100000000000000000000000000ffff2d4ce6ef4e1fd47babdb9092489c82426623299dde76b9c72d9799f20ed1538e28259ff80044982372519a2e6e4cdedb01c96f8f22e755b2b3124fbeebdf6de3587189cf44b3c6e7670ed1935246865dce1accce6c8691c8466bd67ebf1200001976a914fef33f56f709ba6b08d073932f925afedaa3700488acfdb281e134504145b5f8c7bd7b47fd241f3b7ea1f97ebf382249f601a0187f5300",
  "collateralAddress": "yjSPYvgUiAQ9AFj5tKFA8thFLoLBUxQERb",
  "signMessage": "yjZVt49WsQd6XSrPVAUGXtJccxviH9ZQpN|0|yfgxFhqrdDG15ZWKJAN6dQvn6dZdgBPAip|yfRaZN8c3Erpqj9iKnmQ9QDBeUuRhWV3Mg|ad5f82257bd00a5a1cb5da1a44a6eb8899cf096d3748d68b8ea6d6b10046a28e"
}

Теперь используем поля collateralAddress и signMessage для подписания транзакции и поле выхода tx для отправления транзакции.

Подпишите транзакцию ProRegTx#

Теперь подпишем содержимое поля signMessage используя приватный ключ для залогового адреса, указанный в collateralAddress. Обратите внимание, что для выполнения этого шага не требуется интернет-соединение, что значит, что для подписи сообщения кошелёк может оставаться отключённым от интернета в состоянии холодного хранилища. В этом примере мы снова используем Dash Core, но в равной степени возможно использовать функцию подписи аппаратного кошелька. Команда имеет следующий синтаксис:

signmessage collateralAddress signMessage

Пример:

signmessage yjSPYvgUiAQ9AFj5tKFA8thFLoLBUxQERb yjZVt49WsQd6XSrPVAUGXtJccxviH9ZQpN|0|yfgxFhqrdDG15ZWKJAN6dQvn6dZdgBPAip|yfRaZN8c3Erpqj9iKnmQ9QDBeUuRhWV3Mg|ad5f82257bd00a5a1cb5da1a44a6eb8899cf096d3748d68b8ea6d6b10046a28e

На выходе:

II8JvEBMj6I3Ws8wqxh0bXVds6Ny+7h5HAQhqmd5r/0lWBCpsxMJHJT3KBcZ23oUZtsa6gjgISf+a8GzJg1BfEg=

Подтвердите подписанное сообщение#

We will now submit the ProRegTx special transaction to the blockchain to register the masternode. This command must be sent from a Dash Core wallet holding a balance on either the feeSourceAddress or payoutAddress, since a standard transaction fee is involved. The command takes the following syntax:

protx register_submit tx sig

Где:

  • tx: Сериализованная транзакция, ранее возвращённая в поле выхода tx из protx register_prepare

  • sig: Сообщение, подписанное залоговым ключом с помощью команды signmessage

Пример:

protx register_submit 030001000175c9d23c2710798ef0788e6a4d609460586a20e91a15f2097f56fc6e007c4f8e0000000000feffffff01a1949800000000001976a91434b09363474b14d02739a327fe76e6ea12deecad88ac00000000d1010000000000e379580dcfea3eb6944bfbe1de5fa2317932e260acce4d9ff3ede5f4287a34160100000000000000000000000000ffff2d4ce6ef4e1fd47babdb9092489c82426623299dde76b9c72d9799f20ed1538e28259ff80044982372519a2e6e4cdedb01c96f8f22e755b2b3124fbeebdf6de3587189cf44b3c6e7670ed1935246865dce1accce6c8691c8466bd67ebf1200001976a914fef33f56f709ba6b08d073932f925afedaa3700488acfdb281e134504145b5f8c7bd7b47fd241f3b7ea1f97ebf382249f601a0187f5300 II8JvEBMj6I3Ws8wqxh0bXVds6Ny+7h5HAQhqmd5r/0lWBCpsxMJHJT3KBcZ23oUZtsa6gjgISf+a8GzJg1BfEg=

На выходе:

aba8c22f8992d78fd4ff0c94cb19a5c30e62e7587ee43d5285296a4e6e5af062

Your masternode is now registered and will appear on the Deterministic Masternode List after the transaction is mined to a block. You can view this list on the Masternodes -> DIP3 Masternodes tab of the Dash Core wallet, or in the console using the command protx list valid, where the txid of the final protx register_submit transaction identifies your masternode.

At this point you can go back to your terminal window and monitor your masternode by entering dashmate status or using the Get status function in DMT.

Manual installation#

The manual installation guide is currently a work in progress.

This guide describes how to manually download and install the components of your Dash masternode under Ubuntu Linux 22.04 LTS «Jammy Jellyfish» assuming you have a non-root user named dash. You will need to manually adjust apt commands if using a different distro.

Core services#

Prepare your environment for installing keys through GPG:

sudo mkdir -m 600 /root/.gnupg

Dash Core#

Dash Core is a fork of Bitcoin Core and is responsible for all consensus and communication relating to the base blockchain. Download Dash Core as follows:

cd /tmp
wget https://github.com/dashpay/dash/releases/download/v18.2.1/dashcore-18.2.1-$(uname -m)-linux-gnu.tar.gz

Verify the authenticity of your download by checking its detached signature against the public key published by the Dash Core development team. All releases of Dash are signed using GPG with one of the following keys:

curl https://keybase.io/codablock/pgp_keys.asc | gpg --import
curl https://keybase.io/pasta/pgp_keys.asc | gpg --import
wget https://github.com/dashpay/dash/releases/download/v18.2.1/dashcore-18.2.1-$(uname -m)-linux-gnu.tar.gz.asc
gpg --verify dashcore-18.2.1-$(uname -m)-linux-gnu.tar.gz.asc

Extract the compressed archive and copy the necessary files to the directory:

tar xfv dashcore-18.2.1-$(uname -m)-linux-gnu.tar.gz
sudo install -t /usr/local/bin dashcore-18.2.1/bin/*

Create a working directory for Dash Core:

mkdir ~/.dashcore

Configure Dash Core:

cat<<EOF>~/.dashcore/dash.conf
#----
rpcuser=dashrpc
rpcpassword=password
rpcallowip=127.0.0.1
#----
listen=1
server=1
daemon=1
#----
txindex=1
addressindex=1
timestampindex=1
spentindex=1
#----
zmqpubrawtx=tcp://0.0.0.0:29998
zmqpubrawtxlock=tcp://0.0.0.0:29998
zmqpubhashblock=tcp://0.0.0.0:29998
zmqpubrawchainlock=tcp://0.0.0.0:29998
#----
#masternodeblsprivkey=
externalip=$(curl ifconfig.co)
proxy=127.0.0.1:9050
torcontrol=127.0.0.1:9051
#----
testnet=1

[test]
port=19999
rpcport=19998
bind=0.0.0.0
rpcbind=0.0.0.0
EOF

Optionally replace the rpcuser and rpcpassword fields with your own values. Leave the masternodeblsprivkey field commented out for now. Configure Dash Core to start as a service:

cat << EOF | sudo tee /etc/systemd/system/dashd.service
[Unit]
Description=Dash Core
After=syslog.target network-online.target

[Service]
Type=forking
User=dash
Group=dash
ExecStart=/usr/local/bin/dashd
TimeoutStartSec=10m
ExecStop=/usr/local/bin/dash-cli stop
SyslogIdentifier=dashd
TimeoutStopSec=120
RestartSec=120

[Install]
WantedBy=multi-user.target
EOF

Start Dash Core:

sudo systemctl daemon-reload
sudo systemctl enable dashd
sudo systemctl start dashd

Verify Dash Core is running:

sudo systemctl status dashd

Sentinel#

Sentinel is a watchdog and works to communicate to the network that your node is working properly. Install Sentinel as follows:

cd
sudo apt install -y software-properties-common python3-venv
git clone -b master https://github.com/dashpay/sentinel.git
cd sentinel
python3 -m venv . sentinel
bin/pip install -r requirements.txt
bin/python bin/sentinel.py

You will see a message reading dashd not synced with network! Awaiting full sync before running Sentinel. Use the following command to monitor sync status:

dash-cli mnsync status

По завершении синхронизации вы увидите следующий ответ:

{
  "AssetID": 999,
  "AssetName": "MASTERNODE_SYNC_FINISHED",
  "AssetStartTime": 1558596597,
  "Attempt": 0,
  "IsBlockchainSynced": true,
  "IsSynced": true,
  "IsFailed": false
}

Tor#

Tor is an internet relay system designed to preserve anonymity on the internet. Install Tor as follows:

sudo gpg --no-default-keyring --keyring /usr/share/keyrings/tor-archive-keyring.gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
echo "deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/tor.list
sudo apt update
sudo apt install -y tor deb.torproject.org-keyring

Platform services#

Next, we will install the Dash Platform services. Start with some common dependencies:

cd
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install 16
sudo apt install -y libzmq3-dev build-essential cmake libgmp-dev gcc-10 g++-10 apt-transport-https gnupg2 curl lsb-release
export CC=gcc-10 && export CXX=g++-10
npm install pm2 -g

Drive#

Drive is a replicated state machine for Dash Platform. Download Drive as follows:

git clone -b master https://github.com/dashevo/platform/
cd platform
corepack enable
yarn workspaces focus --production @dashevo/drive
cp packages/js-drive/.env.example packages/js-drive/.env

Configure Drive:

sed -i 's/^CORE_JSON_RPC_PORT.*/CORE_JSON_RPC_PORT=19998/' packages/js-drive/.env
sed -i 's/^INITIAL_CORE_CHAINLOCKED_HEIGHT.*/INITIAL_CORE_CHAINLOCKED_HEIGHT=415765/' packages/js-drive/.env
sed -i 's/^CORE_JSON_RPC_USERNAME.*/CORE_JSON_RPC_USERNAME=dashrpc/' packages/js-drive/.env
sed -i 's/^CORE_JSON_RPC_PASSWORD.*/CORE_JSON_RPC_PASSWORD=password/' packages/js-drive/.env
sed -i 's/^DPNS_MASTER_PUBLIC_KEY=.*/DPNS_MASTER_PUBLIC_KEY=022a5ffc9f92e005a02401c375f575b3aed5606fb24ddef5b3a05d55c66ba2a2f6/' packages/js-drive/.env
sed -i 's/^DASHPAY_MASTER_PUBLIC_KEY=.*/DASHPAY_MASTER_PUBLIC_KEY=02c6bf10f8cc078866ed5466a0b5ea3a4e8db2a764ea5aa9cb75f22658664eb149/' packages/js-drive/.env
sed -i 's/^FEATURE_FLAGS_MASTER_PUBLIC_KEY=.*/FEATURE_FLAGS_MASTER_PUBLIC_KEY=033d57d03ba602acecfb6fd4ad66c5fdb9a739e163faefa901926bdf28063f9251/' packages/js-drive/.env
sed -i 's/^MASTERNODE_REWARD_SHARES_MASTER_PUBLIC_KEY=.*/MASTERNODE_REWARD_SHARES_MASTER_PUBLIC_KEY=02182c19827a5e3151feb965b2c6e6bbe57bb1f2fe7579595d76b672966da4e8e6/' packages/js-drive/.env

Start Drive:

pm2 start yarn --name "drive" -- workspace @dashevo/drive abci

Verify Drive is running by checking for a time value under uptime:

pm2 list

Tenderdash#

Tenderdash is a fork of Tendermint and is the blockchain implementation used by Dash Platform. As binaries are not yet published, you will need to build from source. Install Go as follows:

cd /tmp
wget https://go.dev/dl/go1.18.2.linux-$(dpkg --print-architecture).tar.gz
sudo tar -C /usr/local -xzf go1.18.2.linux-$(dpkg --print-architecture).tar.gz
export PATH=$PATH:/usr/local/go/bin

Build and install Tenderdash as follows:

cd
git clone -b v0.7.1 https://github.com/dashevo/tenderdash
cd tenderdash
make install-bls
make build-linux
sudo install -t /usr/local/bin build/*

Initialize Tenderdash:

tenderdash init

Several files will be generated in the ~/.tenderdash directory. Modify the configuration with the following commands:

sed -i 's/\(^moniker.*\)/#\1/' ~/.tenderdash/config/config.toml
sed -i 's/^timeout_commit.*/timeout_commit = "500ms"/' ~/.tenderdash/config/config.toml
sed -i 's/^create_empty_blocks_interval.*/create_empty_blocks_interval = "3m"/' ~/.tenderdash/config/config.toml
sed -i 's/^namespace.*/namespace = "drive_tendermint"/' ~/.tenderdash/config/config.toml
sed -i 's/^seeds.*/seeds = "74907790a03b51ac062c8a1453dafd72a08668a3@54.189.200.56:26656,2006632eb20e670923d13d4f53abc24468eaad4d@52.43.162.96:26656"/' ~/.tenderdash/config/config.toml
curl https://gist.githubusercontent.com/strophy/9a564bbc423198a2fdf4e807b7b40bb4/raw/797ed1a074ca90e574ef016cae4f43e97ae07f56/genesis.json > ~/.tenderdash/config/genesis.json

Configure Tenderdash to start as a service:

cat << EOF | sudo tee /etc/systemd/system/tenderdash.service
[Unit]
Description=Tenderdash
After=syslog.target network-online.target

[Service]
User=dash
Group=dash
TimeoutStartSec=10m
TimeoutStopSec=120
RestartSec=120
ExecStart=/usr/local/bin/tenderdash node
SyslogIdentifier=tenderdash

[Install]
WantedBy=multi-user.target
EOF

Ensure Dash Core is fully synced and start Tenderdash:

sudo systemctl daemon-reload
sudo systemctl enable tenderdash
sudo systemctl start tenderdash

Verify Tenderdash is running:

sudo systemctl status tenderdash

DAPI#

DAPI provides masternode services over the JSON RPC and gRPC protocols. Start DAPI as follows:

cd ~/platform
yarn workspaces focus --production @dashevo/dapi
cp packages/dapi/.env.example packages/dapi/.env

Modify the configuration with the following commands:

sed -i 's/^API_JSON_RPC_PORT.*/API_JSON_RPC_PORT=3004/' packages/dapi/.env
sed -i 's/^API_GRPC_PORT.*/API_GRPC_PORT=3005/' packages/dapi/.env
sed -i 's/^TX_FILTER_STREAM_GRPC_PORT.*/TX_FILTER_STREAM_GRPC_PORT=3006/' packages/dapi/.env
sed -i 's/^DASHCORE_RPC_PORT.*/DASHCORE_RPC_PORT=19998/' packages/dapi/.env
sed -i 's/^DASHCORE_ZMQ_PORT.*/DASHCORE_ZMQ_PORT=29998/' packages/dapi/.env
sed -i 's/^DASHCORE_P2P_PORT.*/DASHCORE_P2P_PORT=19999/' packages/dapi/.env

Start DAPI:

pm2 start yarn --name "dapi" -- workspace @dashevo/dapi api

Start the transaction filter stream:

pm2 start yarn --name "dapi" -- workspace @dashevo/dapi core-streams

Envoy#

Envoy is a gRPC service proxy for cloud-native applications. Install Envoy as follows:

cd
curl -sL 'https://deb.dl.getenvoy.io/public/gpg.8115BA8E629CC074.key' | sudo gpg --dearmor -o /usr/share/keyrings/getenvoy-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/getenvoy-keyring.gpg] https://deb.dl.getenvoy.io/public/deb/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/getenvoy.list
sudo apt update
sudo apt install -y getenvoy-envoy

Configure Envoy as follows:

sudo mkdir /etc/envoy
curl https://gist.githubusercontent.com/strophy/a6f4f6e30212e7cadcefb65b179c9bce/raw/c8c879de320fc93f5c56793c7bb89acb3165bab9/grpc.yaml | sudo tee /etc/envoy/config.yaml

Configure Envoy to start as a service:

cat << EOF | sudo tee -a /etc/systemd/system/envoy.service
[Unit]
Description=Envoy
After=syslog.target network-online.target

[Service]
ExecStart=bash -c '/usr/bin/envoy --config-path /etc/envoy/config.yaml | tee'
Restart=always
RestartSec=5
KillMode=mixed
SyslogIdentifier=envoy

[Install]
WantedBy=multi-user.target
EOF

Start Envoy:

sudo systemctl daemon-reload
sudo systemctl enable envoy
sudo systemctl start envoy

Verify Envoy is running:

sudo systemctl status envoy

Finishing up#

Ensure services managed by pm2 start on reboot:

cat<<"EOF"|crontab
* * * * * cd ~/sentinel && ./bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log
@reboot { sleep 5;cd ~/platform&&pm2 start yarn --name "drive" -- workspace @dashevo/drive abci;}
@reboot { sleep 6;cd ~/platform&&pm2 start yarn --name "dapi" -- workspace @dashevo/dapi api;}
@reboot { sleep 7;cd ~/platform&&pm2 start yarn --name "dapi" -- workspace @dashevo/dapi core-streams;}
EOF

На этом этапе можно безопасно совершить выход из сервера, набрав exit. Поздравляем! Ваша мастернода теперь работает.

Developer installation#

Developers requiring a local masternode can get started quickly by starting dashmate and providing a private key containing collateral directly. Install dependencies if necessary (Docker, NodeJS, NPM, Github CLI). Windows, macOS and Linux are supported, the following example shows how to install dependencies under Ubuntu 20.04 LTS.:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install 16
curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh
sudo usermod -aG docker $USER
newgrp docker

Generate a new Dash address for temporary use using this script or the getnewaddress and dumpprivkey RPC commands in Dash Core in testnet mode. Go to https://testnet-faucet.dash.org/ and request 1000+ tDash to your new address using the promo code „masternode“. Then download and initialize dashmate as follows:

npm install -g dashmate

If you are using Windows, you will need to change the path for two log files. Modify the example below with a log path of your choosing:

dashmate config set platform.drive.abci.log.prettyFile.path C:\Users\strophy\Documents\GitHub\dashmate\testnet-drive-pretty.log
dashmate config set platform.drive.abci.log.jsonFile.path C:\Users\strophy\Documents\GitHub\dashmate\testnet-drive-json.log

Register your masternode on the network as follows:

dashmate setup testnet masternode -p <funding-private-key>

Wait until sync and registration are complete. Then start the masternode:

dashmate start

Your masternode is now providing service on the following local ports:

Core P2P:     19999
Core RPC:     19998
Platform P2P: 26656
Platform RPC: 26657
DAPI HTTP:    3000
DAPI gRPC:    3010

Note that platform sync will take some time after core sync is complete. You can monitor progress with dashmate status platform or use dashmate --help to view other commands.