Categorygithub.com/filecoincrypto/ipfsmgr
repositorypackage
0.9.5
Repository: https://github.com/filecoincrypto/ipfsmgr.git
Documentation: pkg.go.dev

# README

IPFS Manager

Abstract

This is a golang module to manager IPFS file and directory.

It's a part of IPFS grant service for enterprice.

The main functions of the library is:

  • Add files and directories to IPFS
  • Get files and directories from IPFS

This module tested on Ubuntu Linux 2020

If you have any problem please contact the author.

Env

Getting started

get ipfsmgr mod

go get -u github.com/filecoincrypto/ipfsmgr

then import the mod as normal.

import (
  m "github.com/filecoincrypto/ipfsmgr"
)

Build from source

First you must add golang and ipfs CLI.

git clone https://github.com/filecoincrypto/ipfsmgr.git

go clean --modcache

go mod tidy

go build -mod=mod

go install

Install ipfs on Linux

wget https://dist.ipfs.io/go-ipfs/v0.13.1/go-ipfs_v0.13.1_linux-amd64.tar.gz --no-check-certificate
tar -xvzf go-ipfs_v0.13.1_linux-amd64.tar.gz

> x go-ipfs/install.sh
> x go-ipfs/ipfs

cd go-ipfs
sudo bash install.sh

> Moved ./ipfs to /usr/local/bin
ipfs --version

> ipfs version 0.13.1

Running a test

To run the test, just do:

> go test

Trouble shooting

  • missing go.sum entry for module providing package ...
    run go build -mod=mod will generate go.sum

  • panic: failed to spawn ephemeral node: no IPFS repo found in /home/zhh/.ipfs.
    please install go-ipfs and run: 'ipfs init'.

  • failed to spawn ephemeral node: failed to init ephemeral node: unknown datastore type: flatfs
    run ipfs init first

  • failed to spawn ephemeral node: no version file found, please run 0-to-1 migration tool.
    See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md
    Sorry for the inconvenience. In the future, these will run automatically.
    not init repo directory correctly. run ipfs init first.

  • failed to sufficiently increase receive buffer size
    run sudo sysctl -w net.core.rmem_max=2500000, This command would increase the maximum receive buffer size to roughly 2.5 MB

Reference