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

Connecting to Evonet

The Dash Platform development network

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

Overview

Evonet is the initial development network provided for experimentation and evaluation of Dash Platform features.

🚧

Evonet Stability

As a development network, Evonet may be subject to frequent updates and changes that break backwards compatibility.

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.

Prerequisites

Connect via Dash SDK

1. Install the Dash SDK

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

npm install dash

2. Connect to Dash platform

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

const Dash = require('dash');

const clientOpts = {
  network: 'evonet',
};
const client = new Dash.Client(clientOpts);

async function connect() {
  try {
    console.log(await client.getDAPIClient().core.getBestBlockHash())
    console.log('connected');
  } catch (e) {
    console.error('Something went wrong:', e);
  } finally {
    client.disconnect();
  }
}

connect();

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 http://seed-1.evonet.networks.dash.org:3000/ \
  --header 'content-type: application/json' \
  --data '{"method":"getBlockHash","id":1,"jsonrpc":"2.0","params":{"height": 100 }}'
import requests

url = "http://seed-1.evonet.networks.dash.org:3000/"

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)

print(response.text)
require 'uri'
require 'net/http'

url = URI("http://seed-1.evonet.networks.dash.org:3000/")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
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