HydroScan API
The HydroScan backend built with Go. Collects data about Hydro Protocol exchanges and provides methods for a client to consume the data.
Components
Cron
A scheduler to pull a variety of data about running Exchanges, including current token price, trade volume, etc.
Server
Provides an API for the HydroScan client to query for data.
Requirements
- Go version >= 1.11
- Postgres
- Redis
Getting Started
- Clone this repo to somewhere outside of GOPATH
- Copy .config.sample.yml to .config.yml and Set valid urls for Postgres and Redis
- Install the dependencies:
go mod download
If you get an error like this:
go: modules disabled inside GOPATH/src by GO111MODULE=auto; see 'go help modules'
It means you have cloned the repo inside GOPATH. To solve this, you can try cloning this repo to somewhere outside of GOPATH. Alternatively, if you want to work in your GOPATH:
$ export GO111MODULE=on # manually active module mode
Run Cron
go run ./cmd/cron/cron.go
Run API Server
go run ./cmd/server/server.go # Started on port 8080 by default
Contributing
- Fork it (https://github.com/hydroscan/hydroscan-api/fork)
- Create your feature branch (
git checkout -b feature/fooBar
)
- Commit your changes (
git commit -am 'Add some fooBar'
)
- Push to the branch (
git push origin feature/fooBar
)
- Create a new Pull Request