Minterpress Pinata Proxy is an Express app for interfacing with the Pinata Node SDK. Pinata is a cloud service for storing and managing NFT media, and the Pinata Node SDK provides the quickest / easiest path for using Pinata to pin media and metadata to IPFS for minting NFTs.
The goal of this app is to provide a utility for apps without Node backends to utilize Pinata for pinning media to IPFS. This app is based heavily on the approach described by @claudebarde in the article How to mint NFTs on Tezos using Taquito and Pinata.
npm install
Copy the sample environment file to .env
cp .env.sample .env
npm run dev
starts the server on http://localhost:8080 in develop mode with hot reloading.
npm run start
starts the server on http://localhost:8080 in build mode without hot reloading.
-
URL:
/pin
-
Method:
POST
-
URL Params:
- none
-
Data Params: This app uses multer, an Express middleware for handling
multipart/form-data
. The expected FormData keys are:- For Pinata Authentication:
apiKey
- your Pinata API key string generated at https://app.pinata.cloud/keysapiSecret
- your Pinata API secret string generated at https://app.pinata.cloud/keys
- For passing file to be pinned:
remoteFileUrl
- the absolute URL to the temporary location of the file to be pinned. We pass the URL instead of uploading the file in order to allow using 3rd-party file upload utilities such as the WordPress's native media upload functionality, Uppy, FilePond, or any other upload utility.
- For pinning metadata that will be formatted to match TZIP-21 protocol:
name
- stringdescription
- stringtags
- string of tags separated by commaspublisher
- stringcreator
- string the wallet address of the creatorattributes
- { name: string; value: string }[]
- For Pinata Authentication:
-
Success Response:
{ status: true, msg: { imageHash: <imageHash: string>, metadataHash: <metadataHash: string>, }, }
-
Error Response:
{ status: false, msg: <error message>, }
The application includes a Procfile and is ready to be deployed to Heroku. To deploy to Heroku, follow the instructions at Creating Apps from the CLI.
Wildcard Example (Default):
basePluginUrl=*
If the port is not 80, the port should be specified:
basePluginUrl=http://localhost:3000
Using a test proxy that's not local running port 80:
basePluginUrl=http://104.131.119.16
Using a test proxy that's not local running port 8000:
basePluginUrl=http://104.131.119.16:8000
Ideally, in production this should be an HTTPS connection through port 80:
basePluginUrl=https://mymintingwebsite.com
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.