Subscan Essentials是一个高精度的区块链浏览器脚手架项目,它具有开发人员友好的界面和自定义模块解析功能,支持基于substrate的区块链网络。 它由Subscan团队开发,并在subscan.io中使用。开发人员可以自由使用代码库来扩展功能并为其受众开发独特的用户体验。
- 支持substrate 网络自定义type注册
- 支持索引block, Extrinsic, Event, log
- 可自定义插件索引更多的数据
- Gen 工具可自动生成插件模版
- 内置默认的HTTP API DOC
- Linux / Mac OSX
- Git
- Golang 1.12.4+
- Redis 3.0.4+
- MySQL 5.6+
- Node 8.9.0+
./build.sh build
//UI
cd ui && yarn && yarn dev
Demo: blocks, 更多配置请参考 amis docs
在开发环境中请替换nuxt.config.js中的proxy target
proxy: {
"/api": {
target: "https://your_server_name.com",
secure: false,
changeOrigin: true,
pathRewrite: {
"^/api": "/api"
}
},
}
在生产环境中请替换nuxt.config.js中的browserBaseURL
axios: {
proxy: process.env.NODE_ENV !== 'production',
browserBaseURL: process.env.NODE_ENV !== 'production' ? "" : "https://your_server_name.com"
},
cp configs/redis.toml.example configs/redis.toml && cp configs/mysql.toml.example configs/mysql.toml && cp configs/http.toml.example configs/http.toml
- Redis configs/redis.toml
addr: redis host and port (default: 127.0.0.1:6379)
- Mysql configs/mysql.toml
host: mysql host (default: 127.0.0.1) user: mysql user (default: root) pass: mysql user passwd (default: "") db: mysql db name (default: "subscan")
- Http configs/http.toml
addr: local http server port (default: 0.0.0.0:4399)
- Start DB
Make sure you have started redis and mysql
- Substrate Daemon
cd cmd
./subscan start substrate
- Api Server
cd cmd
./subscan
- Help
NAME:
SubScan - SubScan Backend Service, use -h get help
USAGE:
main [global options] command [command options] [arguments...]
VERSION:
1.0
DESCRIPTION:
SubScan Backend Service, substrate blockchain explorer
COMMANDS:
start Start one worker, E.g substrate
stop Stop one worker, E.g substrate
install Create database and create default conf file
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--conf value (default: "../configs")
--help, -h show help
--version, -v print the version
创建本地docker网络
docker network create app_net
启动mysql和redis的 container
docker-compose -f docker-compose.db.yml up -d
启动subscan服务
docker-compose build
docker-compose up -d
go test ./...
//UI
cd ui && yarn && yarn test
GPL-3.0
- [ITERING] https://github.com/itering
- [Darwinia] https://github.com/darwinia-network/darwinia