Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vpavlin/go-ipfs-upload

Simple go experiment to try uploading content to IPFS
https://github.com/vpavlin/go-ipfs-upload

golang ipfs

Last synced: 7 days ago
JSON representation

Simple go experiment to try uploading content to IPFS

Awesome Lists containing this project

README

        

# go-ipfs-upload
Simple go experiment to try uploading content to IPFS

## Config

* `INFURA_PROJECT_ID` - Infura Project ID (mandatory)
* `INFURA_PROJECT_SECRET` - Infura Project/API Secret (mandatory)
* `IPFS_GATEWAY` - IPFS gateway to be used in output URL (optional, default: `https://ipfs.io`)
* `IPFS_API_ENDPOINT` - IPFS API endpoint to be used for upload (optional, default: `https://ipfs.infura.io:5001`)

## Run

```
cp .env.example .env
#edit .env
go run main.go $PATH_TO_FILE_OR_DIR
```

Example output:

```
{
"url": "https://ipfs.io/ipfs/QmXU1Qd6aPpavzPMMNwLg4cxvqcPrZC1zjVCyvB3o3o62w",
"ipfs_url": "ipfs://QmXU1Qd6aPpavzPMMNwLg4cxvqcPrZC1zjVCyvB3o3o62w",
"cid": "QmXU1Qd6aPpavzPMMNwLg4cxvqcPrZC1zjVCyvB3o3o62w"
}

```