A C++ tool and library for piping files to Pinata's IPFS pinning service. Upload files, retrieve content, list pins, and delete pins with progress tracking and retries.
- Single/batch uploads with metadata and grouping
- Fetch IPFS content by hash
- List/delete pinned files
- Upload progress (speed, ETA)
- Error handling with retries
- Thread-safe CURL ops
- Config via
config.json
- Clone:
git clone https://github.com/genyleap/pinatapipe.git cd pinatapipe
- Install deps:
- Ubuntu:
sudo apt install libcurl4-openssl-dev libjsoncpp-dev
- macOS:
brew install curl jsoncpp
- Ubuntu:
- Build with PT:
mkdir build && cd build cmake .. -DUSE_JSON=true -DUSE_CURL=true make
Add config.json
in the working directory:
{
"pinataApiKey": "your_pinata_api_key",
"pinataSecret": "your_pinata_secret_api_key"
}
Note: Add config.json
to .gitignore
.
./pinatapipe <command> [args] [--verbose]
- Upload:
./pinatapipe upload <file> [--group <name>] [--metadata '{"key":"value"}']
- Batch:
./pinatapipe batch <file1> <file2> ... [--group <name>] [--metadata '{"key":"value"}']
- Get:
./pinatapipe get <ipfs_hash>
- List:
./pinatapipe list [--group <name>]
- Delete:
./pinatapipe delete <ipfs_hash>
- Options:
--verbose
,--group
./pinatapipe upload file.txt --group mygroup --verbose
./pinatapipe batch img1.jpg img2.png --metadata '{"desc":"pics"}'
./pinatapipe get ipfs://QmHash
#include "ipfs_client.hpp"
int main() {
auto config = Config::load();
if (!config) return 1;
IPFSClient client(*config);
auto result = client.upload({"file.txt"}, Json::Value());
if (result) std::cout << (*result)[0] << "\n";
return 0;
}
Fork, branch (feature/yourfeature
), commit, push, PR.