Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base implementation #1

Merged
merged 64 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3373dac
Add base docs, improve generate.sh, generate models
violog Jan 18, 2024
10119ae
Add SQL migration
violog Jan 18, 2024
aef4ad6
Changes of service API
violog Jan 19, 2024
54c3553
Change DB schema and formatting
violog Jan 19, 2024
2b3fa90
Fix Event meta in docs, regenerate models
violog Jan 19, 2024
938d5f2
Add basic models to work with DB
violog Jan 19, 2024
7e0b78c
Add 2 simple handlers, fix amount in balance model
violog Jan 22, 2024
088c775
Implement events list handler
violog Jan 22, 2024
5903344
Drop sorting leaderboard by number of events until this is necessary
violog Jan 22, 2024
79f7859
Add leaderboard endpoint handler
violog Jan 22, 2024
7132cbb
Get user rank among all balances
violog Jan 22, 2024
9c52056
Save received points amount when event is claimed
violog Jan 22, 2024
3965587
Add config for event types
violog Jan 23, 2024
604ceaf
Simplify config by dropping ID, use in handlers, drop triggers from DB
violog Jan 23, 2024
f3df5ca
Balance creation endpoint with open events insertion
violog Jan 23, 2024
92441c9
Status filter for events must be multiple
violog Jan 23, 2024
0666a5d
Add frequency for event types
violog Jan 23, 2024
a7d4eaa
Update docker build base for Go 1.21
violog Jan 23, 2024
11cf985
Update go.mod for Go 1.21
violog Jan 23, 2024
69aa27b
Upgrade Go version in werf.yaml also
violog Jan 23, 2024
b41d816
Add events counting
violog Jan 23, 2024
496dec9
Change actions.yaml to build pullable image
violog Jan 23, 2024
9fe8570
Change actions.yaml to build pullable image (2)
violog Jan 23, 2024
18e3806
Fix werf.yaml
violog Jan 23, 2024
52dcef8
Delete werf-giterminism.yaml, drop triggers in actions.yaml
violog Jan 23, 2024
12024b6
Change module name
violog Jan 23, 2024
2841ee9
Add auth middleware with hacks
violog Jan 24, 2024
7a04dbc
Add docs CI, fix example config and readme
violog Jan 24, 2024
9e0d1c7
Make everything JSON:API compliant 🤓
violog Jan 24, 2024
4c72cab
Add events filter by type name
violog Jan 24, 2024
8d3ddca
Fix missing request body and response in docs
violog Jan 24, 2024
ecf4e98
Do not include event in events list to reduce response size because o…
violog Jan 24, 2024
3910d84
Edit API according to new JSON:API compliant docs ✅
violog Jan 24, 2024
2218ba8
Add indexes☝️ to events, make balance_id not nullable 🐞
violog Jan 24, 2024
f1951d8
Fix deps broken for some reason 😑
violog Jan 24, 2024
d850ecc
Rename points-svc to rarime-points-svc in docs
violog Jan 24, 2024
423c6ec
Allow docs deployment to be triggered manually
violog Jan 24, 2024
e6f7d5d
Rewrite DB schema: use UUID for unpredictable IDs, add fields and ind…
violog Jan 29, 2024
354e734
Replace dates with Unix time to allow seamless pagination
violog Jan 29, 2024
f4111d0
Rewrite models to REST and DB requirements
violog Jan 29, 2024
521c50c
Rewrite handlers to new models
violog Jan 29, 2024
8d46727
Add cursor pagination for the leaderboard
violog Jan 29, 2024
dc7b3b5
Replace with offset pagination in leaderboard
violog Jan 30, 2024
5f38bcd
API models improvements, fixes in paths and handlers
violog Jan 30, 2024
c466663
Add SBT check config and connector
violog Jan 24, 2024
dbe92e5
Fully rewrite PoH SBT logic to runner
violog Jan 25, 2024
7bd70f9
Forgot to init SBT runner 😨 fix
violog Jan 25, 2024
93b9438
Fully rewrite ✍️ SBT runner from to HTTP due to bad WS implementation…
violog Jan 26, 2024
4b25bec
Fix multiple errors in events fetching and DB
violog Jan 26, 2024
f3c0fe0
Minor fixes after rebasing
violog Jan 31, 2024
c757e70
Add broadcaster config and Rarimo address for balance
violog Feb 1, 2024
1dc20c1
Withdrawal endpoint docs
violog Feb 1, 2024
d13f71a
Withdrawal handler
violog Feb 1, 2024
187396e
Configurable point price in urmo
violog Feb 1, 2024
0839548
Drop unnecessary address from DB
violog Feb 1, 2024
224064b
Drop unnecessary address from DB model too
violog Feb 1, 2024
ea64812
Add option to disable open event auto-creation on balance creation
violog Feb 1, 2024
29eabdf
Merge branch 'feature/check-sbt-owning' into feature/base
violog Feb 1, 2024
6b93676
Fix numerous errors in DB API
violog Feb 1, 2024
47b6d28
Wrap some operations in atomic transaction ⚛️
violog Feb 1, 2024
265e3b4
Add basic cron⏳ job to reopen claimed events
violog Feb 5, 2024
20b3a77
Fix reopener logger, fix and improve background running in cli package
violog Feb 5, 2024
e57d65f
Add initial run of reopener before scheduling job to perform update a…
violog Feb 5, 2024
fc8668e
Withdrawal history docs and models
violog Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/actions_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ on:
push:
branches:
- 'main'
- 'feature/base'

jobs:
converge:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Builds the docs and deploys to GitHub pages
#
# https://github.com/actions/setup-node
# Using https://github.com/marketplace/actions/deploy-to-github-pages
name: Deploy to Github pages

on:
workflow_dispatch:
push:
branches:
- main
- master

jobs:
deploy_pages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'

- run: |
cd ./docs
npm install
npm run build

- run: touch docs/.nojekyll
- name: Deploy docs 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/web_deploy # The folder the action should deploy.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vscode/
.idea/
config.*.yaml
docker-compose.yaml
docs/node_modules
docs/web_deploy
vendor/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-alpine as buildbase
FROM golang:1.21-alpine as buildbase

RUN apk add git build-base

Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,3 @@ use `docker run ` with `-p 8080:80` to expose port 80 to 8080
### Database
For services, we do use ***PostgresSQL*** database.
You can [install it locally](https://www.postgresql.org/download/) or use [docker image](https://hub.docker.com/_/postgres/).


### Third-party services


## Contact

Responsible
The primary contact for this project is [//]: # (TODO: place link to your telegram and email)
51 changes: 50 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ log:
disable_sentry: true

db:
url: db_url
url: postgres://points:points@localhost:5432/points?sslmode=disable

listener:
addr: :8000
Expand All @@ -14,3 +14,52 @@ cop:
upstream: "http://..."
service_name: rarime-points-svc
service_port: 80

event_types:
types:
- name: get_poh
title: Get PoH credential
reward: 50
description: Lorem ipsum dolor sit amet
frequency: one-time
expires_at: 2020-01-01T00:00:00Z
- name: daily_login
title: Daily login
reward: 5
frequency: daily
description: Lorem ipsum dolor sit amet
- name: verify_proof
title: Verify proof {:id}
reward: 10
frequency: unlimited
description: Lorem ipsum dolor sit amet
no_auto_open: true

auth:
addr: http://rarime-auth

broadcaster:
addr: "http://broadcaster"
sender_account: "rarimo15hcd6tv7pe8hk2re7hu0zg0aphqdm2dtjrs0ds"

withdrawal:
point_price_urmo: 100

sbt_check:
networks:
- name: polygon
rpc: https://your-rpc
contract: 0x...
request_timeout: 5s
start_from_block: 48984542
block_window: 3
max_blocks_per_request: 5000
- name: ethereum
rpc: https://your-rpc
contract: 0x...
request_timeout: 5s
- name: disabled_sample
disabled: true
rpc: https://your-rpc
contract: 0x...
request_timeout: 5s
Loading
Loading