```{eval-rst} .. tutorials-setup-masternode: ``` # Dash masternode The purpose of this tutorial is to walk through the steps necessary to set up a development node with Dash Platform services. ## Installation Please follow the steps in [the installation section](https://docs.dash.org/en/stable/docs/user/network/dashmate/index.html#installation) of dashmate documentation. ## Local Network Dashmate can be used to create a local network on a single computer. This network contains multiple nodes to mimic conditions and features found in testnet/mainnet settings. :::{note} Dashmate local networks use the [regtest network type](../../reference/glossary.md#regtest) so layer 1 blocks can be easily mined as needed. ::: ### Setup Run the following command to start the setup wizard, then accept the default values at each step to create a local network: ```shell dashmate setup local ``` The wizard creates a config for each masternode plus a `local_seed` node that mines blocks, then registers the masternodes on the local Core network and configures Tenderdash and SSL certificates for them. System data contracts such as DPNS and DashPay are created automatically when the local Platform chain starts, so there are no keys or identities to record from setup. ### Operation Once the setup completes, start/stop/restart the network via the following commands: ```shell dashmate group start dashmate group stop dashmate group restart ``` The status of the network's nodes can be check via the group status command: ```shell dashmate group status ``` ### Mining Dash During development it may be necessary to obtain Dash to create and topup [identities](../../explanations/identity.md). This can be done using the dashmate `wallet mint` command, which mines Dash to a Dash Core address. Provide a Core address you control, or omit `--address` to have dashmate generate a new address and private key. The Platform address created in the [Create and Fund a Wallet](../../tutorials/create-and-fund-a-wallet.md) tutorial cannot receive mined Dash directly. ::::{tab-set} :::{tab-item} Mine to provided address ```shell # Stop the devnet first dashmate group stop # Mine 10 Dash to a provided address dashmate wallet mint 10 --address= --config=local_seed # Restart the devnet dashmate group start ``` ::: :::{tab-item} Mine to new address ```shell # Stop the devnet first dashmate group stop # Mine 10 Dash to a random address/key # The address and private key will be displayed dashmate wallet mint 10 --config=local_seed # Restart the devnet dashmate group start ``` ::: :::: Example output of `dashmate wallet mint 10 --address=yYqfdpePzn2kWtMxr9nz22HBFM7WBRmAqG --config=local_seed`: ```text ✔ Generate 10 dash to address ✔ Start Core ↓ Use specified address yYqfdpePzn2kWtMxr9nz22HBFM7WBRmAqG [SKIPPED] ✔ Generate ≈10 dash to address yYqfdpePzn2kWtMxr9nz22HBFM7WBRmAqG › Generated 172.59038279 dash ✔ Wait for balance to confirm ✔ Stop Core ``` ### Using the network Once the address is funded, you can begin creating identities, data contracts, etc. and experimenting with Dash Platform. The [other tutorials](../../tutorials/introduction.md) in this section will help you get started. To make the Dash SDK connect to your local network, use the `localTrusted()` factory method: ```javascript import { EvoSDK } from '@dashevo/evo-sdk'; const sdk = EvoSDK.localTrusted(); await sdk.connect(); ``` See [Connect to a Local Devnet](../connecting-to-testnet.md#connect-to-a-local-devnet) for more detail. ## Testnet Masternode Setup :::{important} Running a masternode requires familiarity with Dash Platform services. Improper configuration may impact testing so please exercise caution if running a masternode. ::: When upgrading an existing node, check the [platform release notes](https://github.com/dashpay/platform/releases) for per-release upgrade steps and breaking changes. To setup a testnet masternode, please refer to the comprehensive documentation of the process as described [here](https://docs.dash.org/en/stable/masternodes/setup-testnet.html#dashmate-installation). The following video also details how to complete the process. ```{eval-rst} .. raw:: html
``` A full node with all Platform services can be started by running the [setup command](https://github.com/dashpay/platform/blob/v5.0.1/packages/dashmate/docs/commands/setup.md), selecting `evolution fullnode` when prompted for the node type, and then starting the node. ``` text dashmate setup testnet dashmate start ``` ## Remote Development Network For development we recommend using either a local network created via dashmate as [described above](#local-network) or using Testnet. While configuring a remote development network is possible using the Dash network deployment tool, it is beyond the scope of this documentation. For details regarding this tool, please refer to the [GitHub repository](https://github.com/dashpay/dash-network-deploy).