Skip to content

savaslabs/minterpress-pinata-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minterpress Pinata Proxy

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.

Installation

npm install

Copy the sample environment file to .env

cp .env.sample .env

Development & Maintenance

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.

API Usage

Pin

  • 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:
    • 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 - string
      • description - string
      • tags - string of tags separated by commas
      • publisher - string
      • creator - string the wallet address of the creator
      • attributes - { name: string; value: string }[]
  • Success Response:

    {
        status: true,
        msg: {
            imageHash: <imageHash: string>,
            metadataHash: <metadataHash: string>,
        },
    }
    
  • Error Response:

    {
        status: false,
        msg: <error message>,
    }
    

Deployment

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.


Sample valid .env file values (Make sure URLs DO NOT end in a trailing slash '/')

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

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

An Express proxy for minting images on Pinata.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published