ipfs_api_test.go 360 B

123456789101112131415161718192021
  1. package ipfs_api
  2. import (
  3. "testing"
  4. "net/http"
  5. go_ipfs_api "github.com/ipfs/go-ipfs-api"
  6. )
  7. func TestShell(t *testing.T) {
  8. sh := go_ipfs_api.NewShellWithClient("127.0.0.1:5001", http.DefaultClient)
  9. id, _ := sh.ID()
  10. t.Log(id)
  11. root, _ := sh.Resolve("/ipns/" + id.ID)
  12. ls, _ := sh.FileList(root)
  13. t.Log(ls)
  14. for _, x := range ls.Links {
  15. t.Log(x)
  16. }
  17. }