A simple Cordova Plugin that wraps go-ipfs v0.4.8. It fetches the go-ipfs ARM binaries archive, extracts it and offers a simple way of initing the IPFS repo, starting and stopping the IPFS daemon.
IPFS is a new hypermedia distribution protocol, addressed by content and identities. IPFS enables the creation of completely distributed applications. It aims to make the web faster, safer, and more open.
More here:
https://github.com/ipfs/go-ipfs
Want to hack on IPFS?
$ cordova plugin add http://github.com/xSkyripper/cordova-plugin-ipfs.git
Add jniLibs.srcDirs = ['libs']
in /path/to/project/platforms/android/build.gradle
...
android {
sourceSets {
main {
...
jniLibs.srcDirs = ['libs']
}
}
because the plugin uses a custom jar library for archive extraction.
ipfs.init(configObject, winCb, errCb)
configObject needs to have keys "src", "appFilesDir", "resetRepo"
Example:
var ipfs = new CordovaIpfs();
var appFilesPath = cordova.file.dataDirectory.split("file://")[1] + "files/";
ipfs.init({
src: "https://dist.ipfs.io/go-ipfs/v0.4.8/go-ipfs_v0.4.8_linux-arm.tar.gz",
appFilesDir: appFilesPath,
resetRepo: false
}, function(res) {
// success callback
}, function(err) {
// error callback
});
ipfs.start(winCb, errCb)
ipfs.start(function(res){
// success callback
}, function(err){
// error callback
});
ipfs.stop(winCb, errCb)
ipfs.stop(function(res){
// success callback
}, function(err){
// error callback
});
This software is released under the Apache 2.0 License.