An IPFS API server for processing file uploads to a localy hosted IPFS node. This can be used with the WeYouMe Application to facilitate image uploading on the endpoint ipfs.yourdomain.com/upload
- Extract the repository to your server and create the data storage directories.
git clone https://github.com/weyoume/weipfs mkdir /data/ipfs mkdir /data/staging
- Host a local IPFS node using the startipfs.sh script. This will create a dockerized node with required ports forwarded.
- Point your server's nginx.conf file (or apache equivalent) to the endpoints at:
- ipfs.yourdomain.com/ipfs -> port 8080 // This is the IPFS Gateway for viewing files using your node.
- ipfs.yourdomain.com/upload -> port 4000 // This is the port used by this API for handling file uploads.
- ipfs.yourdomain.com/ -> port 5001 // This is the port used by the IPFS API for pinning files to your node.
- Ensure that you have added an entry into your nginx.conf file to handle image requests larger than 1MB. Without this entry, you will encounter the error: 413 Request Entity Too Large
server {
client_max_body_size 100M;
...
}
- Ensure that your server's ports (typically in your VPS security group settings) are open on values of 8080, 4000 and 5001.
- Ensure that your IPFS node has its CORS settings open to requests:
docker exec ipfs_host ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
docker exec ipfs_host ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "GET"]'
- Ensure that you have installed Yarn, and GraphicsMagick on your server ( substitute apt-get for your desired package manager i.e. yum , brew ), and then run the deployment script:
apt-get update
apt-get install -y graphicsmagick
npm install yarn
yarn install --non-interactive --frozen-lockfile
yarn deploy
IPFS README: https://ipfs.weyoume.io/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
WeYouMe Whitepaper: https://ipfs.weyoume.io/ipfs/QmacFgC3osnZS2oAAkV5cDXaHBkifZo2JjXkB2X52TUPwA