Skip to content

Instantly share code, notes, and snippets.



Created Aug 23, 2018
What would you like to do?
package main
import (
func main() {
node, err := core.NewNode(context.TODO(), &core.BuildCfg{Online: true})
if err != nil {
log.Fatalf("Failed to start IPFS node: %v", err)
dataa := ioutil.NopCloser(bytes.NewBufferString("testfileA"))
str, err := coreunix.Add(node, dataa)
if err != nil {
fmt.Printf("str: %s\n", str)
reader, err := coreunix.Cat(context.TODO(), node, str)
if err != nil {
log.Fatalf("Failed: %v", err)
blob, err := ioutil.ReadAll(reader)
if err != nil {
log.Fatalf("Failed to retrieve: %v", err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.