lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.19k stars 482 forks source link

how to properly link the wallet with lbry account wallet #3717

Open RESDXChgfore9hing opened 1 year ago

RESDXChgfore9hing commented 1 year ago

is there a systematic flow to sync it?

keikari commented 1 year ago

Check how the LBRY desktop app does it. Odysee also does same. It basically does this:

  1. Log in to your account (These calls are made to API server, check network tab in dev tools for more details) -user/new -user/signin

  2. Get wallet from the server if there is one
    -sync/get

  3. Merge sync data to local wallet (This call happens on the LBRY sdk) -sync_apply https://lbry.tech/api/sdk#sync_apply

  4. Send the merged wallet to sync server -sync/set

RESDXChgfore9hing commented 1 year ago

is there a way for me to point to a fixed local wallet path with the lbry sdk?

because ideally I want to have a copy of the LBRY wallet from LBRY desktop app in my other disk for backup/etc.

keikari commented 1 year ago

Not sure what you mean exactly, but maybe setting wallet dir is related https://lbry.tech/resources/daemon-settings

RESDXChgfore9hing commented 1 year ago

ahh yes. I wanted to save and sync the wallet into some other path.

does something like below works?: I open the lbry desktop cmd>curl -d'{"method": "wallet_dir", "params": {"X:\somebackup\lbryum"}' http://localhost:5279/

keikari commented 1 year ago

No, check the link in above comment. Wallet_dir is a config option you can set in daemon_settings.yml.

If you just want to have copy of the wallet else where, can't you just copy/paste the wallet file? Or maybe use symlink.

RESDXChgfore9hing commented 1 year ago

hmmm sadly i mainly use lbry desktop in windows.so there is no symlink. copy/paste is possible but i scare wrongly overwrite,but will try copy paste.