1 Run full local stack
Alex Grin edited this page 2021-10-22 10:39:22 -04:00
  1. Recompile lbrycrd with a normalization fork height on regtest less than 100.

  2. From SDK install instructions: sudo apt-get install build-essential python3.7 python3.7-dev git python-virtualenv libssl-dev python-protobuf

  3. Download torba repo: git clone https://github.com/lbryio/torba

     This is optional: you can use the pypi torba that is pulled automatically as part of step 9.
    
  4. Download lbry repo: git clone [https://github.com/lbryio/lbry](https://github.com/lbryio/lbry) && cd lbry

  5. Go to the right branch if it's not in master yet: git checkout handle_case_insensitivity

  6. Set up virtual environment: virtualenv lbry-venv --python=python3.7

  7. Go into the virtual environment (done every time): source lbry-venv/bin/activate

  8. Install torba: cd ../torba && pip install -e .

  9. Install lbry: cd ../lbry && pip install -e .

  10. Verify that the unit tests pass: python -m unittest discover tests

  11. Run SDK locally: orchstr8 —blockchain 127.0.0.1 —spv 127.0.0.1 —wallet 127.0.0.1 & (spv refers to the wallet server, blockchain refers to lbrycrd, wallet refers to the wallet client.)

  12. After a minute, verify that it's working: ../torba/torba/bin/lbrycrd-cli -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword -rpcport=9246 getinfo

  13. Kill the orchstr8 job. Alternately, you could set up the folder for step 14 using orchstr8 download instead of running an instance of everything.

  14. Replace the files in ../torba/torba/bin with links to your local lbrycrd build with something like: ln -s ~/Workspace/lbrycrd/src/lbrycrd-cli . (from the torba/torba/bin folder after you removed the files)

  15. Download desktop app: cd .. && git clone [https://github.com/lbryio/lbry-desktop](https://github.com/lbryio/lbry-desktop) && cd lbry-desktop

  16. Go to the branch for normalization if it hasn't been merged yet.

  17. Install yarn and nodejs if necessary and go to the lbry-desktop folder.

  18. Pull the app's dependencies: yarn

  19. Rerun orchstr8 as in step 11.

  20. Run the app: yarn dev

  21. Verify that the app output shows "failed to bind TCP localhost:5279 for listening. Daemon is already running", meaning that it connected successfully to your local wallet. Also, you should see 10 coins in your wallet as orchstr8 goes 110 blocks.

Note: if any step complains about missing TORBA_LEDGER:

export TORBA_LEDGER=lbrynet.extras.wallet

Caveat 1: we're not using a local lighthouse build yet

Lighthouse is used for the search features in the desktop app. It's URL is hard-coded in the app. Sean was going to add a LBRY_LIGHTHOUSE environment variable to override it. I don't see that it's there yet, though. Lighthouse gets its data from Chainquery — you would need both of those pulling from your temporary regtest instance (spawned by orchstr8) , which means that perhaps orchstr8 should also incorporate them. (And my personal opinion is that the we should only have one indexer — the wallet server and lighthouse should be combined.)

Caveat 2 (the worst one): step 11 (orchstr8) doesn't actually work

The wallet parameter isn't fully implemented. As a temporary work-around, there is a commented-out unit test in test_commands.py that will run the framework indefinitely. It's named test_full_stack . You can run that test to start the SDK. You can run it from PyCharm. Install PyCharm (community edition); it does a good job of detecting the virt-env folder in lbry. From there open test_commands.py and use the gutter commands to run the tests there.

Alternatively, you could run orchestr8 with only spv and blockchain params. You could then run lbrynet manually. Use the example config file, but change the folders in it to point to the folder generated by orchstr8. Also change the lbryum_server parameter there.