-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples for using this repo to download LBRY content? #83
Comments
@gmlewis thanks for your interest. Our Go codebase is a bit scattered right now because we've been focused on our primary Python implementation. We have this repo, and https://github.com/lbryio/reflector.go. What you're looking for is spread across both. Here are some pointers to get you started on downloading something that's free. I'll omit the payment details for now.
I hope this is enough to get you started. I'm planning to unify our Go code into a single repo in the near future and provide clearer examples of the steps. If you want more nitty-gritty details, check out the LBRY spec. What's your LBRY address? I'll send you some LBC to get you started. |
Awesome! Thank you, @lyoshenka ... this is extremely helpful! |
Welcome @gmlewis! Would love to know what you're working on, when you're ready :) |
Thank you, @kauffj! My latest obsession is: http://irmf.io and specifically, I would like to deliver IRMF models via the LBRY protocol from within two of my programs so that the digital files are treated as first-class citizens and gated appropriately based on purchase history: Both programs are written in Go, and the first one compiles to WebAssembly, which has been lots of fun to write. 😄 |
Since irmf-editor is run in the web browser, starting up a dht node server is a non-starter, but if I can use a public wallet server as a launch-point without running a dht node, and still download the content, then I think this just might work! |
@gmlewis how did it go? |
@lyoshenka - I actually hit a roadblock that I've been trying to solve. As far as I can tell,
The error I'm getting is:
Which appears to be this issue: desmos-labs/desmos#2 So it looks like I'm currently stuck. 😞 |
Hey @gmlewis any progress on spf13/viper issue? I am facing the same. |
@gmlewis you could fork the repo and remove the dependency. you may have to change the way we load configs in 1 or 2 places, but feel free to hack around any roadblocks. if that works for you, I can look into removing it from the main repo as part of a refactor we're planning. let me know how it goes |
I made some good progress by forking:
and then removing the dependency upon github.com/spf13/viper by modifying a single file... but then was surprised by an unexpected error message:
I must have some version mismatches now that will take some more investigation. |
try putting this in your go.mod, above the require line
@tiger5226 may know more about this error too |
@lyoshenka - Sweet! I now have a successful build. Thank you! I have to work now, but after work I'll see if I can download the (free) content from the lbry URI from my Go-based WebAssembly client. Have you guys implemented any kind of OpenID/OAuth2 "Log in with lbry.tv" or "Log in with Odysee.com" so that our client programs never have to deal with usernames and passwords even for paid content? |
I just hit the next snag:
Apparently, Go in WebAssembly doesn't support the tcp procotol: |
This is true. Anything to be used in a browser is limited by browser APIs. We have the https://github.com/lbryio/lbrytv-player repository. This exposes a web server to download lbry content from a webpage which would be WASM compatible for you since its over http. Since this is a native application that leverage WASM, it might be interesting to try an alternative route. I am not sure of your web development skills, but one thing I have done in the past with Go is packaging an app into a single binary that contains 2 pieces. A website, so that you can build a UI with a web language. It launches the webpage on startup. Then as part of the binary a web server/app is launched which is what the web page opens to. So that contains the APIs for the webpage to use locally. It leverages some great Go Libs to make it all come together for a fast POC. Namely packr2. The interesting part is that if you had something similar you could use all the native go codebases without change and be able to handle your frontend and backend in the same app, while also leveraging a more native web experience like angular. Just an idea to investigate. |
I would like to write a client program that, given a LBRY URI (e.g.
lbry://@irmf#a/irmf-logo-model-1.irmf#4
),the client downloads the data (provided that either the user has already paid for the content or the content is free).
Eventually, it would be nice to allow the user to optionally send credits if the content is gated and they have not already purchased it. But for starting out, I would just like to download the content that is either free or previously-paid-for.
I'm not finding any examples, and searching through the subdirectories, it is not obvious to me how to get started.
If I were to take a random stab-in-the-dark, for example, I might try doing the following:
lbrycrd.New(lbrycrdURL, chainParams)
(What shouldlbrycrdURL
andchainParams
be?)but then I get stuck, as none of the methods appear to be what I want.
Alternatively, maybe I need to go this route:
blobex.NewBlobExchangeClient(cc)
(How should I getcc
correctly?)blobex.Download(ctx)
(How do I specify the URI for the content?)Can you please provide some guidance on the steps that need to be taken?
Thank you!
The text was updated successfully, but these errors were encountered: