Dash CoreDash PlatformDash.orgDash User DocsLog In
These docs are for v0.17.0. Click to read the latest docs for v0.25-redirect.

Connect to a Network

The Dash test network

The purpose of this tutorial is to walk through the steps necessary to access the network.


Platform services are provided via a combination of HTTP and gRPC connections to DAPI, and some connections to an Insight API. Although one could interact with DAPI by connecting to these directly, or by using DAPI-client, the easiest approach is to use the JavaScript Dash SDK.



Minimum Supported Version

As of Dash Platform 0.16, NodeJS v12 or higher must be used

Connect via Dash SDK

1. Install the Dash SDK

The JavaScript SDK package is available from and can be installed by running npm install dash (from the command line):

# Until testnet is updated to Platform v0.18, v3.17.0 of the SDK must be used
npm install [email protected]

2. Connect to Dash platform

Create a file with the following contents. Then run it by typing node <file.js> (from the command line):


As of Dash Platform v0.17.0, the SDK connects to testnet by default.

const Dash = require('dash');

const client = new Dash.Client();

async function connect() {
  return await client.getDAPIClient().core.getBestBlockHash();

  .then((d) => console.log('Connected. Best block hash:\n', d))
  .catch((e) => console.error('Something went wrong:\n', e))
  .finally(() => client.disconnect());

Once this returns successfully, you're ready to begin developing! For details on all SDK options and methods, please refer to the SDK documentation.

Connect Directly to DAPI (Optional)


Advanced Topic

Normally, the Dash SDK, dapi-client, or another library should be used to interact with DAPI. This may be helpful for debugging in some cases, but generally is not required.

The example below demonstrates retrieving the hash of the best block hash directly from a DAPI node via command line and several languages:

curl --request POST \
  --url \
  --header 'content-type: application/json' \
  --data '{"method":"getBlockHash","id":1,"jsonrpc":"2.0","params":{"height": 100 }}'
import requests

url = ""

payload = "{\"method\":\"getBlockHash\",\"id\":1,\"jsonrpc\":\"2.0\",\"params\":{\"height\":100}}"
headers = {'content-type': 'application/json'}

response = requests.request("POST", url, data=payload, headers=headers)

require 'uri'
require 'net/http'

url = URI("")

http =, url.port)

request =
request["content-type"] = 'application/json'
request.body = "{\"method\":\"getBlockHash\",\"id\":1,\"jsonrpc\":\"2.0\",\"params\":{\"height\":100}}"

response = http.request(request)
puts response.read_body

What’s Next