-
Notifications
You must be signed in to change notification settings - Fork 63
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
First version (reworked) #16
Conversation
* Split pkg into repo/host/node * host build mobile dedicated host (noop for the moment) * repo build mobile dedicated repo, exactly the same as ipfs repo but add the ability to add some custom configuration * node build mobile dedicated node with the particularity to create a mobile host * the main package can be bind using gomobile to create a ready-to-use framework/aar * individual pkg can be imported instead and be used for specific project * Add simple makefile that show how to build the thing
Hello @Stebalien, We have implemented the required changes in the last few commits. To retrieve XKCD cIDs from IPNS we had to find a workaround to resolve DNS from go on Android. We based it on this gist: https://gist.github.com/cs8425/107e01a0652f1f1f6e033b5b68364b5e About passing stream as argument / returning stream for the "command" methods, I will a open PR this week. I've already finished the code on Android, I just need to finish it on iOS. Do the latest changes look good to you?
|
Same as Android, ipns fail to resolve dns on iOS. Use the same fix than Android
We just notice that we have the same problem on iOS physical device (and not in iOS simulator), for the moment we will use this fix for the moment, but we will try to implement
|
@@ -0,0 +1,75 @@ | |||
// from: https://gist.github.com/cs8425/107e01a0652f1f1f6e033b5b68364b5e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
Well, I guess if that's all we can do...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's very hacky :/
We already know how to solve the problem in a cleaner way, we're going to create issues with all the things that need to be done.
} | ||
|
||
datastore := defaultDatastoreConfig() | ||
conf := &ipfs_config.Config{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The connection manager only runs once a minute. Are you seeing a sawtooth pattern? and how many connections are you seeing?
go/bind/ipfs/shell.go
Outdated
return nil, err | ||
} | ||
|
||
ma.ForEach(a, func(c ma.Component) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've cut a v0.0.3 release with your changes. You should be able to drop this code.
go/bind/ipfs/shell.go
Outdated
} | ||
} | ||
|
||
func (s *Shell) Request(uri string, body []byte) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still need this function?
go/bind/ipfs/shell.go
Outdated
} | ||
} | ||
|
||
func (s *Shell) Request(uri string, body []byte) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nothing particularly wrong with it, just awkward to go from a request to a url to a request and then back to the url)
Ideally, you'd be able to override the DNS resolver when constructing IPFS. |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
Co-Authored-By: Steven Allen <steven@stebalien.com>
We have opened a number of issues related to points discussed in this PR:
I will opened several issues about request in/out streams, lifecycle management, etc... |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Hello everyone, :)
Here is the first version of the packages reworked according to the plan established in #14.
Both Android and iOS packages work almost the same way: we have written an
IPFS
class that wrap the underlying golang objects at the initialization of which we can configure the repo path.Then we implemented some methods that allow users to start/stop the node and send command to the API:
By default, the API is configured to only be accessible through UDS (faster and safer). BTW we lowered the minimum RSA key length to 1024 to be able to connect to the bootstrap nodes. More info here.
We have kept things simple in order to implement and maintain as little code as possible, knowing that some things may change. We also implemented helpers for commands (toDict on iOS and toJSON on Android) but we have chosen to leave the configuration of the node accessible only by making request to the API (or using golang object directly).
We have written sample applications for both platforms that display the peer ID, the number of peers connected and allows you to fetch a random XKCD on IPFS then to display it.
We would like a review from a member of the Textile or Protocol labs team before merging on master if possible. :)
Then we think it might cool to make the repo open source so that people can start playing with it (we first need to update the README which is no longer relevant).