Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.72 KB

README.md

File metadata and controls

62 lines (46 loc) · 1.72 KB

Go backend

Services

source ../.env.dev  # set environment variables
Service Command Description
Telegram go run main.go service telegram Telegram bot
Discord go run main.go service discord Discord bot
GRPC go run main.go service grpc GRPC server
Chain Crawler go run main.go service chain-crawler Crawler to update chains
Contract Crawler go run main.go service contract-crawler Crawler to update DAODAO contracts
Validator Crawler go run main.go service validator-crawler Crawler to update validators

Database

Install CLI

go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest

Generate models and migrations

Edit ent/schema/*.go and run:

# generate models
go generate ./ent
# generate migrations
go run main.go create-migrations
# or combined
go generate ./ent && go run main.go create-migrations

Apply migrations

migrate -source file://go/database/migrations -database "postgres://postgres:postgres@localhost:5432/cosmos-notifier-db?sslmode=disable&TimeZone=Europe/Zurich" up

Create schema visualization

go run -mod=mod ariga.io/entviz ./ent/schema/

API

Protoc Installation

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest