If you are using local blockchain (e.g Ganache), provide other endpoint
rpc:
endpoint: "http://127.0.0.1:8545" # or localhost
Open project using IDE (e.g GoLand from JetBrains), open IDE terminal, run
go mod init
go mod vendor
At bsc-checker-events/assets/main.go run two migration related scripts:
//go:generate packr2 clean
//go:generate packr2
Entry point is bsc-checker-events/main.go
Modify run configuration as follows:
KV_VIPER_FILE=config.yaml (environment variable)
Run service twice with the following command arguments:
migrate up
run service
For deployment purposes
Navigate to the cloned repository
Do the step 1 from development build, except modify config at configs/spaceship-staking.yaml, changing contract address and database url (for the contract deployed on the Binance Smart Chain leave the endpoint as it is
Build container image:
docker compose build
Run using docker-compose
docker-compose down -v
docker-compose up -d
API
To change port, configure
listener:
addr: :8888
where 8888 is a port to listen on.
Endpoints
/missions # get all missions
/missions/{mission-id} # get mission by it's id
/explorers/{explorer-address} # get missions joined by explorer address