Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/vpavlin/go-ipfs-upload
- Owner: vpavlin
- License: mit
- Created: 2022-09-27T12:25:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-27T13:33:18.000Z (over 2 years ago)
- Last Synced: 2024-11-22T16:12:14.802Z (2 months ago)
- Topics: golang, ipfs
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"
}```