Insight API 安装#

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.

A standard installation of Ubuntu Linux 20.04 LTS will be used as an environment for the server. We assume you are running as a user with sudo permissions. First update all packages and install some tools and dependencies:

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

下载并获取最新版本的 Dash Core:

cd ~
wget https://github.com/dashpay/dash/releases/download/v20.0.4/dashcore-20.0.4-x86_64-linux-gnu.tar.gz
tar -xvzf dashcore-20.0.4-x86_64-linux-gnu.tar.gz
rm dashcore-20.0.4-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

安装 Insight API 服务和(可选)Insight UI:

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

改变配置文件中的路径如下:

nano dashcore-node.json
  • Change the value of datadir to ../../.dashcore

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

  • **可选**将”network“的值改为”testnet“如果你想在测试网络上运行 Insight 的话

运行:

../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>/

Insight UI 区块浏览器可在:

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