Created sdk structure in lex's rewrite (markdown)
parent
0001ba7262
commit
610097e7af
1 changed files with 33 additions and 0 deletions
33
sdk-structure-in-lex's-rewrite.md
Normal file
33
sdk-structure-in-lex's-rewrite.md
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
refers to https://github.com/lbryio/lbry-sdk/tree/fast_wallet_server_sync branch
|
||||||
|
|
||||||
|
- overall goal: unify APIs between wallet server and client
|
||||||
|
- service dir
|
||||||
|
- API - the high-level interface that's shared between wallet server and client
|
||||||
|
- wraps Service
|
||||||
|
- has info that's used to generate api docs, cli docs/parsing/validation, etc.
|
||||||
|
- data is in [metadata.py](http://metadata.py/)
|
||||||
|
- [parser.py](http://parser.py/) does the generating
|
||||||
|
- Service - implements the API. comes in two varieties: LightClient and FullNode
|
||||||
|
- LightClient
|
||||||
|
- inherits from Service
|
||||||
|
- conceptually, requires a connection to another FullNode to interact with blockchain
|
||||||
|
- FullNode
|
||||||
|
- inherits from Service
|
||||||
|
- requires a lbrycrd instance to sync from
|
||||||
|
- db dir
|
||||||
|
- Database - interface to the database
|
||||||
|
- instantiates db
|
||||||
|
- mostly calls functions in queries dir
|
||||||
|
- queries dir
|
||||||
|
- contains the actual sql queries
|
||||||
|
- queries written with SQLAlchemy
|
||||||
|
- [tables.py](http://tables.py/) contains DB table structure
|
||||||
|
- migrations are generated from this
|
||||||
|
- also used to validate queries (e.g. makes sure the columns extist, types are correct, etc)
|
||||||
|
- blockchain dir
|
||||||
|
- all new code. pretty self-contained
|
||||||
|
- talks to lbrycrd (binary and sqlite db)
|
||||||
|
- Ledger
|
||||||
|
- similar to chainparams.cpp. defines blockchain constants
|
||||||
|
- sync dir - contains all the blockchain sync code
|
||||||
|
- has some code to make db calls. would be nice if this code lived in db dir, but it doesn't work in practice
|
Loading…
Add table
Reference in a new issue