Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.31 KB

README.md

File metadata and controls

58 lines (38 loc) · 1.31 KB

Light Wallet Service (for FnFn)

Development

Package management

Since Go hasn't a best package management solution until v1.11 (2018-08-31), we use dep (officially supported) for managing packages simply and temporarily.

brew install dep # install dep tool

dep init # migrate depedencies from `vendor/` by other tools

dep ensure # sync and install all dependencies into `vender/`

dep ensure -add github.com/user/xxx-repo # something like `go get` but fetch package into `vendor/` and update Gopkg.toml/Gopkg.lock file

Related 3rd-party Services

LWS requires MySQL, mqtt(mock server), RabbitMQ and redis as related services. In local development, we use Docker to manage them:

# where docker-compose.yml located
cd test/mock
# start services
docker-compose up -d
# stop services
docker-compose down

Environment Variables

We are using godotenv to manange variables in .env file. Notice that to use it correctly, you should specify relative path in load function:

godotenv.Overload("../../.env")

Otherwise it will fail when your entry file is not under package root directory.

Database

Migration

Up:

go run cmd/db/migrate.go

Down:

go run cmd/db/migrate.go -1