An experimental decentralized e-commerce store served entirely from IPFS.
First create a listing on shoporigin.com and make a note of the listing ID.
# Clone and install
git clone [email protected]:OriginProtocol/dshop.git dshop
cd origin-store
yarn
cd shop
# Copy example multi-product store data
cp -r data/example data/mystore
# OR single-product store data
cp -r data/example-single data/mystore
# Copy PGP dist files
cp -r ../node_modules/openpgp/dist public
# Generate PGP keys. Make a note of public and private keys.
node scripts/genKey
# Edit config in data/mystore/config.json
# By default, the back-end uses Sqlite. If you want to use Postgres, do the following:
- Create a new dshop database. For example under psql:
#> CREATE DATABASE dshop;
- Set DATABASE_URL to point to your newly created DB. For example:
export DATABASE_URL="postgres://origin:origin@localhost/dshop"
- Create the DB schema by running the migrations
cd backend; yarn run migration; cd..
# The backend uses redis for queues. While you can skip this,
# it's highly recommended to run a local redis so your testing
# matches production behavior
export REDIS_URL=redis://localhost:6379/
# Optional: If you want to use the super-admin to create new shops, build the bundle.
cd shop; yarn run build:dist; cd ..
# Start the stack (IPFS, local ganache blockchain, back-end, front-end):
yarn start
# This will start a browser pointing to the super-admin interface at:
- Super admin: http://0.0.0.0:9000/#/super-admin
# Create a super-admin account
# Create a local shop
If you encounter this error on MacOS while running yarn install
:
../src/common.cc:25:10: fatal error: 'vips/vips8' file not found
Try to install vips manually by running:
brew install vips
If you encounter this error while using the admin to create a new shop:
UnhandledPromiseRejectionWarning: Error: Invalid version, must be a number equal to 1 or 0
at Function.validateCID
Upgrade the ipfs package to 0.43.2 or higher under packages/origin/services/package.json
PROVIDER=<provider> NETWORK=<mainnet|rinkeby> DATA_DIR=mystore npm run build
First, sign up for Pinata
export IPFS_DEPLOY_PINATA__API_KEY=<YOUR PINATA API KEY>
export IPFS_DEPLOY_PINATA__SECRET_API_KEY=<YOUR PINATA SECRET KEY>
DATA_DIR=mystore yarn build
cp -r data/mystore public
npx ipfs-deploy -p pinata
Make a note of the IPFS hash as you'll need it later...
- Create a CNAME from
subdomain.yourdomain.com
tocloudflare-ipfs.com
- Add a TXT record with the name
_dnslink.subdomain.yourdomain.com
and valuednslink=/ipfs/<your_ipfs_hash_here>
- Visit this page on Cloudflare, scroll to the bottom and add your domain to the form
- Ignore the 'Authentication Error' if there is one
- Wait a minute or so, then visit your URL in a browser
- Visit the ENS App
- Ensure your wallet (MetaMask et al) is pointing to Mainnet
- Register your ENS domain
- Use the Public resolver
- Set content hash to
ipfs://<your_ipfs_hash_here>
- Wait a few minutes, then visit
https://your-ens-domain.eth.link