Insight API 安装

开源Dash Insight REST API为你提供一个方便强大而简单的方式来从 Dash 网络读取数据和用它来建立你自己的服务。简单 HTTP 端点为那些熟悉 Bitcore Insight API 的人提供所有在 Dash 链上的普通操作,还有 Dash 特性功能如即时支付,预算提案,sporks,主节点列表。此文档描述了如何搭建`Dash Insight API <https://github.com/dashevo/insight-api>`__服务器和(可选)`Dash Insight UI <https://github.com/dashevo/insight-ui>`__区块链浏览器。

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/v0.16.0.1/dashcore-0.16.0.1-x86_64-linux-gnu.tar.gz
tar -xvzf dashcore-0.16.0.1-x86_64-linux-gnu.tar.gz
rm dashcore-0.16.0.1-x86_64-linux-gnu.tar.gz

安装 Dashcore Node  并创建你的配置:

git clone https://github.com/dashevo/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-0.16.0/bin/dashd
  • **可选**将”network“的值改为”testnet“如果你想在测试网络上运行 Insight 的话

运行:

../bin/dashcore-node start

你的 Insight API 节点将启动并开始同步。进度将显示在标准输出。一旦同步完成,可查询 API endpoints listed in the documentation :

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

Insight UI 区块浏览器可在:

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