All Projects β†’ ipsn β†’ go-ipfs

ipsn / go-ipfs

Licence: MIT license
Ungx-ed fork of go-ipfs

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
shell
77523 projects
Makefile
30231 projects
groovy
2714 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to go-ipfs

Lab
Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
Stars: ✭ 911 (+2838.71%)
Mutual labels:  fork
Fork Sync
πŸ”„ Github action to sync your forks
Stars: ✭ 99 (+219.35%)
Mutual labels:  fork
Fomantic Ui
Fomantic-UI is a community fork of Semantic-UI
Stars: ✭ 2,755 (+8787.1%)
Mutual labels:  fork
Repo Lockdown
GitHub Action that immediately closes and locks issues and pull requests
Stars: ✭ 56 (+80.65%)
Mutual labels:  fork
Gooderp addons
ε―θƒ½ζ˜―δΈ­ε›½η”¨ζˆ·ζ•°ζœ€ε€šηš„εΌ€ζΊERP
Stars: ✭ 1,315 (+4141.94%)
Mutual labels:  fork
Github Sync
‡️ A GitHub Action for syncing current repository with remote
Stars: ✭ 166 (+435.48%)
Mutual labels:  fork
Fork Awesome
A fork of the iconic font and CSS toolkit
Stars: ✭ 878 (+2732.26%)
Mutual labels:  fork
trystero
🀝 Serverless WebRTC matchmaking for painless P2P β€” Make any site multiplayer in a few lines β€” Use BitTorrent, IPFS, or Firebase
Stars: ✭ 512 (+1551.61%)
Mutual labels:  ipfs
Bitcore
BitCore (BTX) - Cryptocurrency 220 Byte Datacarriersize
Stars: ✭ 94 (+203.23%)
Mutual labels:  fork
Enet
⚑️ ENet reliable UDP networking library
Stars: ✭ 202 (+551.61%)
Mutual labels:  fork
Forkcms
Fork is an easy to use open source CMS using Symfony Components.
Stars: ✭ 1,112 (+3487.1%)
Mutual labels:  fork
Branchy
πŸƒ Execute a Node.js function in a separate process
Stars: ✭ 84 (+170.97%)
Mutual labels:  fork
Beefun Pro
Github client for iOS in Swift.
Stars: ✭ 172 (+454.84%)
Mutual labels:  fork
Errand Boy
A memory-conscious alternative to os.fork() and subprocess.Popen().
Stars: ✭ 34 (+9.68%)
Mutual labels:  fork
Pull
πŸ€– Keep your forks up-to-date via automated PRs
Stars: ✭ 3,364 (+10751.61%)
Mutual labels:  fork
Bingehack4
A replacement for bingehack. For information about in-game features and changes:
Stars: ✭ 14 (-54.84%)
Mutual labels:  fork
Alpine Term
Repository has been moved.
Stars: ✭ 121 (+290.32%)
Mutual labels:  fork
metabin
Advanced data sharing ecosystem - main repo
Stars: ✭ 15 (-51.61%)
Mutual labels:  ipfs
Bforartists
Bforartists is a fork of the popular 3D software Blender, with the goal to improve the UI.
Stars: ✭ 240 (+674.19%)
Mutual labels:  fork
Kotatogram Desktop
Experimental Telegram Desktop fork.
Stars: ✭ 200 (+545.16%)
Mutual labels:  fork

πŸŽ‰ Deprecated πŸŽ‰

This repository has been archived and deprecated as the upstream IPFS switched over to Go modules, making it possible to finally use IPFS from Go in an officially supported way!

Head over to https://github.com/ipfs/go-ipfs for the new code (minimum version of v0.4.20-rc1 is needed for Go modules).


Ungx-ed fork of go-ipfs

GoDoc

This repository is an unofficial fork of github.com/ipfs/go-ipfs, converted from a gx based project to a plain Go project. The goal is to act as an IPFS library that can be imported and used from Go apps without the need of switching all dependency management over to gx. As a bonus, this fork is compatible with GoDoc!

For a rundown of why gx is not the best solution at the moment, please see the rationale section behind the ungx project.

Differences from upstream

Upstream go-ipfs is both a gx based project, as well as depends on many third party gx based packages. To use it in plain Go projects, all gx packages need to be resolved into their original canonical versions, or need to be converted into non-gx ones.

This fork uses the following logic to ungx go-ipfs:

  • If a dependency has a plain Go canonical version (e.g. golang.org/x/net), the dependency is converted from an IPFS multihash into its canonical path and vendored into the standard vendor folder. This ensures they play nice with the usual package managers.
  • If a dependency is only available as a gx project (e.g. github.com/libp2p/go-libp2p), the dependency is converted from an IPFS multihash into its canonical path, but is moved into the gxlibs folder within the main repository. This ensures external packages can import them.

Two caveats were also needed to enable this fork:

  • If multiple versions of the same plain Go dependency is found, these cannot be vendored in. In such cases, all clashing dependencies are embedded into the gxlibs/gx/ipfs folder with their original IPFS multihashes. This retains the original behavior whilst still permitting imports.
  • If an embedded dependency contains canonical path constraints (e.g. golang.org/x/sys/unix), these constraints are blindly deleted from the dependency sources. Unfortunately this is the only way to allow external code to import them without Go failing the build.

The ungx-ing process is done automatically for the master branch in a nightly Travis cron job from the ungx branch in this repository. Upstream releases (i.e. tags) are not yet ungx-ed to prevent having to re-tag versions if a bug in ungx is discovered. Those will be added and tagged when the process is deemed reliable enough.

Demo

The hello-world of IPFS is retrieving the official welcome page from the network. With the IPFS command line client this looks something like:

$ ipfs cat QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB
Hello and Welcome to IPFS!

β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β•  β•šβ•β•β•β•β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•β•šβ•β•     β•šβ•β•     β•šβ•β•β•β•β•β•β•
[...]

Doing the same thing from Go is a bit more involved as it entails creating an ephemeral in-process IPFS node and using that as a gateway to retrieve the welcome page:

package main

import (
	"context"
	"fmt"
	"io/ioutil"
	"log"

	"github.com/ipsn/go-ipfs/core"
	"github.com/ipsn/go-ipfs/core/coreapi"
	"github.com/ipsn/go-ipfs/core/coreapi/interface"
)

func main() {
	// Create a new IPFS network node
	node, err := core.NewNode(context.TODO(), &core.BuildCfg{Online: true})
	if err != nil {
		log.Fatalf("Failed to start IPFS node: %v", err)
	}
	path, _ := iface.ParsePath("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB")

	// Resolve the IPFS welcome page
	reader, err := coreapi.NewCoreAPI(node).Unixfs().Get(context.TODO(), path)
	if err != nil {
		log.Fatalf("Failed to look up IPFS welcome page: %v", err)
	}
	// Retrieve and print the welcome page
	blob, err := ioutil.ReadAll(reader)
	if err != nil {
		log.Fatalf("Failed to retrieve IPFS welcome page: %v", err)
	}
	fmt.Println(string(blob))
}

However, after the dependencies are met, our pure Go IPFS code works flawlessly:

$ go get -v github.com/ipsn/go-ipfs/core
$ go run ipfs.go
Hello and Welcome to IPFS!

β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β•  β•šβ•β•β•β•β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
β•šβ•β•β•šβ•β•     β•šβ•β•     β•šβ•β•β•β•β•β•β•
[...]

Proper dependencies

Although the above demo works correctly, running go get -v github.com/ipsn/go-ipfs/core is not for the faint of heart. It will place about 1193 packages into you GOPATH 😱. A much better solution is to use your favorite dependency manager!

Demo with govendor:

$ go get -u github.com/kardianos/govendor
$ govendor init
$ govendor fetch -v +missing
$ go run ipfs.go
[...]

Credits

This repository is maintained by PΓ©ter SzilΓ‘gyi (@karalabe), but authorship of all code contained inside belongs to the upstream go-ipfs project.

License

Same as upstream (MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].