Installation de l’API Insight#

The open-source Dash Insight REST API provides you with a convenient, powerful and simple way to read data from the Dash network and build your own services with it. Simple HTTP endpoints exist for all common operations on the Dash blockchain familiar from the Bitcore Insight API, as well as Dash-specific features such as InstantSend transactions, budget proposals, sporks and the masternode list. This documentation describes how to set up the Dash Insight API server and (optionally) the Dash Insight UI block explorer.

Une installation standard d’Ubuntu Linux 20.04 LTS sera utilisée comme environnement serveur. Nous supposons que votre utilisateur a les autorisations sudo. Tout d’abord, mettez à jour tous les paquets et installez quelques outils et dépendances :

sudo apt update
sudo apt upgrade
sudo apt install npm build-essential libzmq3-dev

Téléchargez et décompressez la version la plus récente de Dash Core :

cd ~
wget https://github.com/dashpay/dash/releases/download/v20.1.0/dashcore-20.1.0-x86_64-linux-gnu.tar.gz
tar -xvzf dashcore-20.1.0-x86_64-linux-gnu.tar.gz
rm dashcore-20.1.0-x86_64-linux-gnu.tar.gz

Install Dashcore Node and create your configuration:

git clone https://github.com/dashpay/dashcore-node
cd dashcore-node
npm install
./bin/dashcore-node create mynode

Installez le service Insight API et (facultativement) Insight UI :

cd mynode
../bin/dashcore-node install @dashevo/insight-api
../bin/dashcore-node install @dashevo/insight-ui

Modifiez les chemins dans le fichier de configuration, comme suit :

nano dashcore-node.json
  • Définissez la valeur de datadir comme ../../.dashcore

  • Change the value of exec to ../../dashcore-20.1.0/bin/dashd

  • Facultatif : changez la valeur de network sur testnet si vous souhaitez faire tourner Insight sur le réseau de test.

Lancez-le :

../bin/dashcore-node start

Your Insight API node will start up and begin to sync. Progress will be displayed on stdout. Once sync is complete, the API endpoints listed in the documentation will be available at:

https://<ip-address>:3001/insight-api/<endpoint>/

L’explorateur de blocs Insight UI sera disponible :

http://<ip-address>:3001/insight/