MCPcopy Index your code
hub / github.com/OdyseeTeam/odysee-api

github.com/OdyseeTeam/odysee-api @api-v26.06.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release api-v26.06.1 ↗ · + Follow
2,018 symbols 8,826 edges 239 files 783 documented · 39% updated 20d agov0.7.0 · 2019-08-15★ 24317 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

API Server for Odysee

⚠️ If you are looking for the UI code, that lives here: https://github.com/OdyseeTeam/odysee-frontend. ⚠️

This is the API server used by Odysee, mostly acting as a bridge between web and the blockchain.

Tests Coverage Status

Required tools

go install github.com/volatiletech/sqlboiler
go install github.com/volatiletech/sqlboiler/drivers/sqlboiler-psql

Running off source (the preferred way for development)

1. Launch the core environment containers

docker compose up -d

Note: if you're running a LBRY desktop app or a lbrynet instance, you will have to either shut it down or change its ports

2. Set up database schema if this is your first launch

go run . db_migrate_up

3. Generate RSA key file

ssh-keygen -t rsa -f token_privkey.rsa -m pem

4. Start Odysee API server

go run .

5. Clone odysee-frontend repo, if you don't have it

6. Launch UI in lbry-desktop repo folder

SDK_API_URL=http://localhost:8080 yarn dev:web

Running with Docker

Make sure you have recent enough Docker and docker compose installed.

1. Initialize and launch the containers

This will pull and launch SDK and postgres images, which Odysee API requires to operate.

docker compose -f docker-compose.yml -f docker-compose.app.yml up -d

Note: if you're running a LBRY desktop app or lbrynet instance, you will have to either shut it down or change ports

2. Clone lbry-desktop repo, if you don't have it

cd ..
git clone git@github.com:lbryio/lbry-desktop.git

3. Launch UI in lbry-desktop repo folder

LBRY_WEB_API=http://localhost:8080 yarn dev:web

4. Open http://localhost:9090/ in Chrome or Firefox for best experience

Development tips

Change DB schema

  1. Create a schema migration
  2. Apply schema migration with go run . db_migrate_up
  3. Run make models for sqlboiler to pick up the changes

Testing

Make sure you have lbrynet, postgres and postgres-collector containers running and run make prepare_test test.

Building Docker images

Make sure you have Go 1.26 installed.

Then build the binary, create a docker image locally:

make oapi && make oapi_image

Tools used in development

go install golang.org/x/vuln/cmd/govulncheck@latest

Versioning

This project is using CalVer YY.MM.MINOR since February 2021 (SemVer prior to that)

Contributing

Contributions to this project are welcome.

Please ensure that your code builds and automated tests run successfully before pushing your branch. You must go fmt your code before you commit it, or the build will fail.

License

This project is MIT licensed. For the full license, see LICENSE.

Security

Please contact security@odysee.com regarding any issues you may encounter.

Contact

The primary contact for this project is @anbsky (andrey.beletsky@odysee.com).

Extension points exported contracts — how you extend this code

Authenticator (Interface)
Authenticator authenticates [5 implementers]
app/auth/auth.go
Deleter (Interface)
(no doc) [10 implementers]
apps/forklift/forklift.go
Service (Interface)
Media playback reports [3 implementers]
apps/watchman/gen/reporter/service.go
Authenticator (Interface)
(no doc) [5 implementers]
app/wallet/testing.go
TracedObject (Interface)
(no doc) [4 implementers]
pkg/logging/tracing.go
DSNConfig (Interface)
(no doc) [3 implementers]
pkg/migrator/db.go
Handler (FuncType)
Handler handles API requests
internal/handler/handler.go
TimeSource (Interface)
(no doc) [2 implementers]
app/query/processors.go

Core symbols most depended-on inside this repo

Error
called by 185
pkg/logging/logging.go
Set
called by 149
pkg/sturdycache/sturdycache.go
Run
called by 114
internal/test/http.go
Now
called by 103
app/query/processors.go
Info
called by 96
pkg/logging/logging.go
Log
called by 93
internal/monitor/module_logger.go
Add
called by 69
apps/watchman/gen/reporter/service.go
String
called by 67
internal/metrics/timer.go

Shape

Method 876
Function 826
Struct 251
TypeAlias 27
FuncType 21
Interface 17

Languages

Go100%

Modules by API surface

models/asynqueries.go99 symbols
models/users.go76 symbols
models/uploads.go66 symbols
models/query_log.go58 symbols
models/lbrynet_servers.go57 symbols
apps/lbrytv/config/config.go56 symbols
models/publish_queries.go53 symbols
models/sdk_reconnect_leases.go51 symbols
models/gorp_migrations.go49 symbols
app/query/caller_test.go45 symbols
app/sdkrouter/health.go36 symbols
pkg/logging/logging.go31 symbols

Datastores touched

uploadsDatabase · 1 repos

For agents

$ claude mcp add odysee-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page