Refer Setup Wiki for setting up Dalal-Street-Server
git submodule init
git submodule update --recursive
mysql -u root -p -e "CREATE DATABASE dalalstreet_dev; CREATE DATABASE dalalstreet_test;"
migrate -path "./migrations" -database "mysql://root:YOUR_MYSQL_PASSWORD@/dalalstreet_dev" up
./scripts/build_proto.sh
cp config.json.example config.json
Dev
section of config.json.air
go run main.go
migrate create -ext sql -dir ./migrations MIGRATION_NAME
./scripts/test.sh
Install docker and docker-compose.
Run cp .env.example .env
and cp config.json.example config.json
.
Fill in the DB_PASS in .env and make any additional changes if necessary.
Use the same credentials in Docker section config.json (DbPassword)
Running server
docker-compose up
docker exec -it <CONTAINER_NAME> bash
To access phpMyAdmin, visit http://localhost:{PMA_PORT}/ (or http://localhost:9040/ by default)
If changes are made to the server files, rebuild image and run server with
docker-compose build
docker-compose up
(might require sudo, depending on permissions of volume mount './docker/' )
To view all running docker containers:
docker ps
Server logs are present in ./docker/logs/
//go:generate mockgen -source {YOUR_FILE_NAME}.go -destination ../mocks/{YOUR_FILE_NAME}.go -package mocks
go generate ./...
mockgen -destination=mocks/{YOUR_FILE_NAME}.go -package=mocks {PATH_TO_YOUR_FILE}