This repository was archived by the owner on Oct 5, 2023. It is now read-only.
This repository was archived by the owner on Oct 5, 2023. It is now read-only.
No examples of connecting client to a node in README #110
Open
Description
Hi, there is currently no example of how to connect this client to an ipfs node within the README here or within the godocs. Is it possible this can be added? Something similar to what is provided for go-ipfs-api.
package main
import (
"fmt"
"strings"
"os"
shell "github.com/ipfs/go-ipfs-api"
)
func main() {
// Where your local node is running on localhost:5001
sh := shell.NewShell("localhost:5001")
cid, err := sh.Add(strings.NewReader("hello world!"))
if err != nil {
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
fmt.Printf("added %s", cid)
}
That would be very helpful for new users to this library. For context, I am doing some testing against remote Infura IPFS nodes to ensure the supported methods function as expected.
Thanks!