MyBitFoundation / MyBit-Go.app

🔷 The MyBit Platform™ for investing in alternative assets
https://app.mybit.io
GNU General Public License v3.0
8 stars 31 forks source link

Deploy to IPFS #530

Closed tcrowe closed 4 years ago

tcrowe commented 4 years ago

Related issue #518 Deploy dapp to IPFS

What does it do?

It modifies the app and tooling to create a ⚡️ static-only export ⚡️ without any server functionality.

How to test

Previews

  1. git clone -b deploy-to-ipfs https://github.com/tcrowe/MyBit-Go.app
  2. yarn && yarn run clean && yarn run build && yarn run export
  3. ./node_modules/.bin/ipfs-deploy --no-open -p pinata -d cloudflare out

⍟ Step 3 requires some secret environment variables to run. We've communicated behind the scenes to do it.

Changes

Third-party services removed

Packages removed

Strictly speaking it wasn't necessary to remove all these but they aren't being used anymore.

Upgrades

All modules put up to latest stable version. Most notably:

IPFS gateway

It has a configurable way to pull IPFS files like for avatars. See ./constants/links.js#ExternalLinks.IPFS_GATEWAY_URL

Currently cloudflare-ipfs.com

Ethereum Gas price

It has a configurable way to get Ethereum Gas prices../constants/links.js#ExternalLinks.GAS_PRICE_URL

Currently https://www.etherchain.org/api/gasPriceOracle

Uploads

Previously it was uploading to AWS. Now testing.

Deploy

  1. The CI/CD will build a static export instead of deploying to zeit now.
  2. The nextjs static build goes to Piñata IPFS
  3. CloudFlare DNS and DNS TXT record for DNSLink are set (New technology)
cryptnotiq commented 4 years ago

@tcrowe Please see the following issues I found.

539

540

541

tcrowe commented 4 years ago

It's not totally related to IPFS but it helps us move through testing to tweak and fix a few things along the way. This last patch I changed "undefined" to "Default category" here and allowed customizing the asset value.

Screen Shot 2020-02-22 at 2 09 23 PM

I did see a successful upload to IPFS and then another failure so I will need to refine how it's done in the next patch.

@MyBitIO

tcrowe commented 4 years ago

I'm going to shelve this one for a minimal change to make this work then we can go optimize some things later.