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>`__区块链浏览器。
一个在Ubuntu Linux 18.04 LTS标准安装将作为服务器环境。我们假使你使用一个具有 sudo 权限的账号。首先升级所有包和安装一些工具及依赖:
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.14.0.0/dashcore-0.14.0.0-x86_64-linux-gnu.tar.gz
tar -xvzf dashcore-0.14.0.0-x86_64-linux-gnu.tar.gz
rm dashcore-0.14.0.0-x86_64-linux-gnu.tar.gz
安装 Dashcore Node 并创建你的配置:
sudo npm install -g @dashevo/dashcore-node
dashcore-node create mynode
安装 Insight API 服务和(可选)Insight UI:
cd mynode
dashcore-node install @dashevo/insight-api
dashcore-node install @dashevo/insight-ui
改变配置文件中的路径如下:
nano dashcore-node.json
- 将“datadir”的值改为”../.dashcore“
- Change the value of
exec
to../dashcore-0.14.0/bin/dashd
- **可选**将”network“的值改为”testnet“如果你想在测试网络上运行 Insight 的话
运行:
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/