-
Notifications
You must be signed in to change notification settings - Fork 16
Setup Docs
Wiki for setting up Dalal Street Server locally.
Dala Street Server currently uses Golang 1.16. Download the same from this link.
Follow this link to setup Golang. After this you should get go version go1.16.9
upon running go version
.
Golang needs 2 path variables for it to locate and store dependencies and executables
$GOPATH: Directory where all packages and modules for Go projects are located.
$GOBIN: Directory where binary executables of Go projects are located.
Create a directory go/
wherever you want and setup $GOPATH and $GOBIN paths in .bashrc file.$GOBIN also need to be appended to $PATH variable
export PATH=$PATH:`$OTHER_STUFF`:$GOBIN
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
All Go packages will be stored under $GOPATH/src
and modules under $GOPATH/pkg/mod
and executables under $GOBIN
Protocol buffers Download link
Follow this link for setting up Protobuf.
To check if protobuf is installed properly run the following command.
protoc --version
go get github.com/delta/dalal-street-server
Binary executables
go install -tags 'mysql' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/[email protected]
Required Modules
cd $GOPATH/src/github.com/delta/dalal-street-server/
go get ./...
git submodule init
git submodule update --recursive
Proto files have to be built and converted to .pb.go files so that it can be used imported and used in our .go files
Go to dalal-street-server root directory and run this command
./scripts/build_proto.sh
migrate -path "./migrations" -database "mysql://root:YOUR_MYSQL_PASSWORD@/dalalstreet_dev" up
migrate create -ext sql -dir ./migrations MIGRATION_NAME
To create TLS keys for docker
mkdir tls_keys/docker/
cd tls_keys/docker/
openssl req -x509 -out server.crt -keyout server.key -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
cd ../../