Subscan Essentials is a high-precision blockchain explorer scaffold project. It supports substrate-based blockchain networks with developer-friendly interface, standard or custom module parsing capabilities. It's developed by the Subscan team and used in subscan.io. Developers are free to use the codebase to extend functionalities and develop unique user experiences for their audiences.
./build.sh build
//UI
cd ui && yarn && yarn dev
The ui part is built with nuxt.js and amis
Demo: blocks, refer to amis docs for further detail.
Please change proxy target in nuxt.config.js to your server name in development.
proxy: {
"/api": {
target: "https://your_server_name.com",
secure: false,
changeOrigin: true,
pathRewrite: {
"^/api": "/api"
}
},
}
Please change browserBaseURL in nuxt.config.js to your server name in production.
axios: {
proxy: process.env.NODE_ENV !== 'production',
browserBaseURL: process.env.NODE_ENV !== 'production' ? "" : "https://your_server_name.com"
},
First choose a search type, and enter search content. Then click search button, result will be shown in the output section.
cp configs/redis.toml.example configs/redis.toml && cp configs/mysql.toml.example configs/mysql.toml && cp configs/http.toml.example configs/http.toml
addr: redis host and port (default: 127.0.0.1:6379)
host: mysql host (default: 127.0.0.1) user: mysql user (default: root) pass: mysql user passwd (default: "") db: mysql db name (default: "subscan")
addr: local http server port (default: 0.0.0.0:4399)
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
Use docker-compose can start projects quickly
Create local network
docker network create app_net
Run mysql and redis container
docker-compose -f docker-compose.db.yml up -d
Run subscan service
docker-compose build
docker-compose up -d
default test mysql database is subscan_test. Please CREATE it or change configs/mysql.toml
go test ./...
//UI
cd ui && yarn && yarn test
We welcome contributions of any kind. Issues labeled can be good (first) contributions.
GPL-3.0