richardschneider / net-ipfs-http-client

InterPlanetary File System client for .Net (C#, VB, F# ...)
MIT License
158 stars 52 forks source link

Daemon Implementation #25

Closed bendecoste closed 6 years ago

bendecoste commented 6 years ago

Hey there, I have a question about a use case for this library and wanted to get your insight. Apologies if this isn't the right avenue for discussion.

I want to use IPFS for a project going on in an org I contribute to (https://github.com/OpenMined).

I won't bore you with too many details but I was wondering if I could use this library to do pubsub on an xbox/playstation/whatever. I have implemented this locally and it works awesome, the only problem is that I need also need a daemon running on my machine.

Do you have any plans to implement the daemon in .net as well?

Sorry if this is a silly question/request, I am still pretty new to IPFS.
Happy to provide extra details if needed.

Thanks!

iamtrask commented 6 years ago

Yesss!!! This would be amazing!!!

alberduris commented 6 years ago

This is so needed! Totally up vote 👆

RangerMauve commented 6 years ago

You could probably compile the go IPFS daemon to run on the PS or Xbox and have it running locally along side your app.

iamtrask commented 6 years ago

@RangerMauve how would this work?!?! Please tell us more!

gavinuhma commented 6 years ago

+1

ic-taylorperkins commented 6 years ago

yes yes YES 👍

RangerMauve commented 6 years ago

Well, this is totally hypothetical, but if the platforms allow you to run C code, you could make use of the cgo compiler to compile the IPFS daemon to something you could embed in a C program. You would need to implement whatever transports you need using the platform-specific APIs, but as long as you implement the transfers in a way that libp2p accepts, you should be able to run the rest of the logic as is.

bendecoste commented 6 years ago

Definitely something to try !

On Wed, Jan 10, 2018 at 4:34 PM RangerMauve notifications@github.com wrote:

Well, this is totally hypothetical, but if the platforms allow you to run C code, you could make use of the cgo compiler to compile the IPFS daemon to something you could embed in a C program. You would need to implement whatever transports you need using the platform-specific APIs, but as long as you implement the transfers in a way that libp2p accepts, you should be able to run the rest of the logic as is.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/richardschneider/net-ipfs-api/issues/25#issuecomment-356728040, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWISZBpEbY1uHywqCo_kfVh7bZzycCoks5tJR7VgaJpZM4RZ3xP .

RangerMauve commented 6 years ago

A more long-term approach would be to implement libp2p in whatever platform-specific language you want. There are a lot of test suites in place so making sure your code can interoperate should be pretty easy.

Yet another alternative if you can embed a browser is to make use of js-ipfs and bridge between it and your other code. Once the circuit relay feature lands, js-ipfs will be able to interact with the rest of the network from within browser environments, which means it'll run anywhere that a browser can run.

iamtrask commented 6 years ago

I like your generic Go compilation idea - there's a really good chance we're going to encounter the need to run Go code again... main drawback being a very large deployment overhead. Gotta ship lots of binaries and such and make sure it's compatible with the runtime system, etc. etc.

Do you know if cgo works well with iOS / Android?

richardschneider commented 6 years ago

@iamtrask please stop adding multiple emoji to every comment!

iamtrask commented 6 years ago

Sorry - i'm a very expressive guy :)

RangerMauve commented 6 years ago

@iamtrask Golang has first class support for ios and android so you could use the plain old go compiler and it's APIs

richardschneider commented 6 years ago

@bendecoste Not a silly question at all; look at all the comments!

net-ipfs-api is just a client to an IPFS daemon. Deamons are not required to be running on the local box; see DefaultApiUri.

As for xbox/playstation/whatever, most boxes support nodejs. js-ipfs besides running in browser will also run in node.

> npm install ipfs -g
> jsipfs init
> jsipfs daemon --enable-pubsub-experiment
bendecoste commented 6 years ago

net-ipfs-api is just a client to an IPFS daemon. Deamons are not required to be running on the local box; see DefaultApiUri.

I was looking into this but i wanted to keep the centralized nature of ipfs around .. we'd kind of lose this if we ran our own node to act as a relay.

There are lots of great ideas in this thread to try that will keep me busy for a while :)

just to be clear though, is implementing the daemon in .net something you plan on doing?

richardschneider commented 6 years ago

just to be clear though, is implementing the daemon in .net something you plan on doing?

Yes, it is being planned. Both an out of process server, just like go-ipfs and an `in-proc`` library.

I'm trying to get the https://github.com/richardschneider/net-ipfs-coreinterfaces solid before embarking on the project. This is why this project and [net-ipfs-core]() are seeing breaking changes.

bendecoste commented 6 years ago

Well let us know when you decide to undertake it! Openmined has a pretty big community that could potentially help out if you're open to it!

iamtrask commented 6 years ago

It's taking a lot of strength not to put 4 emojis on that last comment. We are, however, very excited about this feature!

Is there anything we can do to help?

richardschneider commented 6 years ago

I see a need for the following project

And as @RangerMauve mentioned, the libp2p protocols and transport library.

I don't like the name net-ipfs-service, anyone have a better suggestion?

@iamtrask okay go for it this time.

CT83 commented 6 years ago

+1

rajeev921 commented 6 years ago

+1

cereallarceny commented 6 years ago

+1

richardschneider commented 6 years ago

How about net-ipfs-engine instead of net-ipfs-service.

Please vote with the thumbs up/down emoji on this comment. Don't add a comment that simply says +1 or -1.

richardschneider commented 6 years ago

I've created the net-ipfs-engine project.

@bendecoste Feel free to contribute and please share with Open Minded group.

richardschneider commented 6 years ago

Do you have any plans to implement the daemon in .net as well?

See the net-ipfs-engine project.