Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
70a3275
wip: support damm v2
rickyrombo Oct 10, 2025
88681cc
add slot to remove race conditions, move pgNotify watcher
rickyrombo Oct 13, 2025
8add570
typo
rickyrombo Oct 13, 2025
b3b792f
remove unused
rickyrombo Oct 13, 2025
65e1f52
Create TokenIndexer
rickyrombo Oct 14, 2025
f8bf089
removals
rickyrombo Oct 14, 2025
bc781b2
Move indexers to own packages
rickyrombo Oct 14, 2025
b56a433
program indexer, artist_coins columns, etc
rickyrombo Oct 14, 2025
21cda92
tests
rickyrombo Oct 14, 2025
7ccf02d
fix address=>account and test schema
rickyrombo Oct 15, 2025
7b4a6e1
add some tests, fix sql txs
rickyrombo Oct 15, 2025
fa7dba4
fix schema again, more tests
rickyrombo Oct 15, 2025
38b886c
add tests for token indexer
rickyrombo Oct 15, 2025
a8849a2
add program indexer tests, add recipient eth address to reward disbur…
rickyrombo Oct 15, 2025
05a2169
delete unused tests
rickyrombo Oct 15, 2025
f766553
Make grpc factory and test start
rickyrombo Oct 15, 2025
692513a
remove println
rickyrombo Oct 15, 2025
a0f1556
rename
rickyrombo Oct 15, 2025
1ec4c7d
backfiller
rickyrombo Oct 15, 2025
e5229af
Merge remote-tracking branch 'origin/main' into mjp-solana-indexer-pa…
rickyrombo Oct 15, 2025
56fefa9
fix fees to always return a row
rickyrombo Oct 15, 2025
aeee389
always use test db for creating test schema
rickyrombo Oct 15, 2025
4cddb1d
fix test schema
rickyrombo Oct 15, 2025
6609c18
make deterministic test schema
rickyrombo Oct 15, 2025
e86577e
add healthcheck for db
rickyrombo Oct 15, 2025
8400aac
Make dbc job run more often temporarily
rickyrombo Oct 15, 2025
e77bfed
update readme
rickyrombo Oct 15, 2025
47779d0
add new Version field to DAMM V2 pools
rickyrombo Oct 16, 2025
334b6a9
add dbc pool protocol_quote_fee and clarify pools in migration
rickyrombo Oct 16, 2025
d16ba21
stronger test assertions
rickyrombo Oct 16, 2025
433133c
add slot padding constant
rickyrombo Oct 16, 2025
b509ca4
rename update => update_message
rickyrombo Oct 16, 2025
0b22e55
update test schema
rickyrombo Oct 16, 2025
8c849a2
make transactions for migrations
rickyrombo Oct 16, 2025
239eba2
comments
rickyrombo Oct 16, 2025
eec077d
clearer args
rickyrombo Oct 16, 2025
f3f357a
remove sleeps
rickyrombo Oct 16, 2025
7cd1ff9
collect instead of scan loops
rickyrombo Oct 16, 2025
eb3e0c3
clarity for retry queue
rickyrombo Oct 16, 2025
6510713
use discriminator instead of size to check position account
rickyrombo Oct 16, 2025
8a9814c
fix typos
rickyrombo Oct 16, 2025
592f96d
fix test
rickyrombo Oct 17, 2025
7431b04
Use pgxlisten
rickyrombo Oct 17, 2025
25ceaa9
Use NAME constant for logger
rickyrombo Oct 17, 2025
1fae555
Update DBC pool using job, for backfilling prod
rickyrombo Oct 17, 2025
f7f54eb
Make test respect context timeouts
rickyrombo Oct 17, 2025
481701f
fix bug with dbc program indexer listening to wrong program
rickyrombo Oct 17, 2025
985f77b
remove pg notify helpers
rickyrombo Oct 17, 2025
6c5fe82
add retries for other indexers
rickyrombo Oct 17, 2025
937c673
remove pointer
rickyrombo Oct 17, 2025
9bf4f50
update models
rickyrombo Oct 17, 2025
362a34d
further use the DRY query to prevent mistakes
rickyrombo Oct 17, 2025
3e71319
missed commit
rickyrombo Oct 17, 2025
2219e83
remove destructive action
rickyrombo Oct 17, 2025
da20fcb
swagger.yml
rickyrombo Oct 17, 2025
b39d434
more details
rickyrombo Oct 17, 2025
232ecae
keep underscores
rickyrombo Oct 17, 2025
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
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ apidiff::

test-schema::
@set -a; \
. .env; \
if [ -z "$$writeDbUrl" ]; then \
echo "writeDbUrl is not set in .env - using test db and running migrations"; \
writeDbUrl=postgresql://postgres:example@localhost:21300/postgres; \
make migrate; \
fi; \
writeDbUrl=postgresql://postgres:example@localhost:21300/postgres; \
echo "\033[0;32mBringing down any existing containers to start fresh...\033[0m"; \
docker compose down --volumes; \
docker compose up -d --wait; \
echo "\n\033[0;32mRunning migrations on fresh instance...\033[0m"; \
make migrate; \
echo "\033[0;32mDumping schema...\033[0m"; \
adjustedUrl=$$(echo "$$writeDbUrl" | sed 's/localhost/host.docker.internal/g'); \
docker compose exec db bash -c "pg_dump '$$adjustedUrl' --schema-only --no-owner --no-acl > ./sql/01_schema.sql"; \
sed '/^\\restrict /d;/^\\unrestrict /d' ./sql/01_schema.sql > ./sql/01_schema.sql.tmp && mv ./sql/01_schema.sql.tmp ./sql/01_schema.sql; \
echo "schema dumped to ./sql/01_schema.sql"
echo "Schema dumped to ./sql/01_schema.sql"; \
echo "\n\033[0;32mRestarting containers...\033[0m"; \
docker compose down --volumes; \
docker compose up -d --wait; \
echo "\n\033[0;32mDone\033[0m";
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Audius API Server

The API backend for the Audius mobile apps and [audius.co](https://audius.co)

[![license](https://img.shields.io/github/license/AudiusProject/api)](https://github.com/AudiusProject/api/blob/main/LICENSE) [![releases](https://img.shields.io/github/v/release/AudiusProject/api)](https://github.com/AudiusProject/api/releases/latest)
Expand Down Expand Up @@ -45,20 +46,15 @@ The API backend for the Audius mobile apps and [audius.co](https://audius.co)
### Tests

#### To run tests against the existing schemas

```
docker compose up -d
make test
```

#### To update schema after migration changes and run tests
```
docker compose up -d

# update .env to contain
writeDbUrl=postgresql://postgres:example@localhost:21300/postgres
runMigrations=true

make migrate
```
make test-schema
make test
```
Expand Down
205 changes: 197 additions & 8 deletions api/dbv1/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions api/swagger/swagger-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5594,6 +5594,34 @@ components:
type: string
description: Address of the pool creator's wallet
example: "2AAsAwNPTNBk5N466xyPiwqdgbc5WLbDTdnn9gVuDKaN"
artist_fees:
type: object
description: Information about the fees earned by the artist on the coin's trading.
properties:
unclaimed_dbc_fees:
type: number
description: Unclaimed fees from the dynamic bonding curve, in $AUDIO.
example: 1000000000
total_dbc_fees:
type: number
description: Total fees earned from the dynamic bonding curve, in $AUDIO.
example: 2000000000
unclaimed_damm_v2_fees:
type: number
description: Unclaimed fees from the DAMM v2 pools, in $AUDIO.
example: 1000000000
total_damm_v2_fees:
type: number
description: Total fees earned from the DAMM v2 pools, in $AUDIO.
example: 2000000000
unclaimed_fees:
type: number
description: Total unclaimed fees from all sources, in $AUDIO.
example: 2000000000
total_fees:
type: number
description: Total fees earned from all sources, in $AUDIO.
example: 4000000000
coin_response:
type: object
properties:
Expand Down
Loading
Loading