- ./run.sh
It will generate scan.env file. Edit it as needed.
- ./run.sh
Run the script again, it will:
- Start mysql in a docker container (optional)
- Install dependencies
- automatically generate configuration files
- Compile this project
- Create and start service containers
Generate nginx configuration:
./run.sh nginx
Commands to operate docker containers:
- docker compose ps -a , show services
- docker compose stop|start <serviceName: api/block/open_api...>
- docker compose logs -n 50 -f , check logs
- docker compose stop
- ./run.sh dropDB
- ./run.sh , it will create database again, and then start the service.
There are two configuration files:
- stat/config/Prod.ts
- scan-api/config/local.js
If you did not change them, just :
- docker compose stop
- Edit scan.env
- ./run.sh clean , delete the configuration files mentioned above.
- ./run.sh , generate new config files, compile, start the service.
If you edit stat/config.Prod.ts, you MUST compile it:
npm run compile
and restart the service.
- clone this repo to another folder, with different name.
Docker compose will use that name in container name.
git clone repo_url <FolderName> - ./run.sh
- edit scan.env, change 3 PORTS, DB_NAME, and other things.
- Follow the instructions above.
- Run a confura cfx bridge. see https://github.com/Conflux-Chain/confura.git
export INFURA_RPC_CFXBRIDGE_CFXNODE="http://<YOUR_RPC>:12537" export INFURA_RPC_CFXBRIDGE_ETHNODE="http://<YOUR_RPC>:8545" export INFURA_CFX_REQUESTTIMEOUT="1m" export INFURA_ETH_REQUESTTIMEOUT="1m" export INFURA_LOG_LEVEL="info" ./main rpc --cfxBridge 2>&1 | tee -a bridge.log - set
IS_EVM=truein scan.env - Follow the instructions above.
- docker repository issue: use a standalone cfg file: gc db9b1f45 docker-compose.yaml.