Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy dapp to IPFS #518

Closed
MyBitIO opened this issue Dec 11, 2019 · 29 comments
Closed

Deploy dapp to IPFS #518

MyBitIO opened this issue Dec 11, 2019 · 29 comments

Comments

@MyBitIO
Copy link
Contributor

MyBitIO commented Dec 11, 2019

Our goal is to go serverless and decentralised with the MyBit application. We no longer want to rely on a centralised server hosting company such as AWS. If possible, we would like it to be deployed to IPFS and we will redirect the domain to the IPFS URL where the application can be located.

We understand this is a new approach to deploying applications and may have some limitations or not be feasible. Please ask all the questions you have and share any uncertainties, constraints, limitations, or otherwise issues that you believe may arise from taking on this approach.

This task was inspired by this blog: https://medium.com/elbstack/decentralized-hosting-of-a-static-react-app-with-ipfs-aae11b860f5e

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 1000.0 DAI (1000.0 USD @ $1.0/DAI) attached to it.

@gitcoinbot
Copy link

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@iamonuwa
Copy link
Contributor

@gitcoinbot waiting for feedback from the team

@think-in-universe
Copy link

Does this issue allow or need cooperative work? I don't mean to request for the bounty since it's already approved to the developer.

I'm interested to do some research for this issue if needed.

@gitcoinbot
Copy link

@iamonuwa Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@iamonuwa due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@crypto-guys
Copy link

I think I can do this project if your current developer is unable to complete. I have some experience with IPFS and Arweave. Please see this article for more information
https://medium.com/@arweave/arweave-ipfs-persistence-for-the-interplanetary-file-system-9f12981c36c3

@cryptnotiq
Copy link
Contributor

hey @crypto-guys the current developer was unable to complete so it is now available on gitcoin if you are interested in tackling it. But before you start on it let's have a quick discussion to make sure we're on the same page. We can either do that here or on telegram t.me/mybitio

I'm curious about the limitations specifically. Such as managing updates and if that requires a redeployment to IPFS for even small changes, and then having to update the hash/URL after each update.

@gitcoinbot
Copy link

gitcoinbot commented Jan 16, 2020

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 days, 23 hours from now.
Please review their action plans below:

1) tcrowe has been approved to start work.

Very cool! I've checked out MyBit apps and docs before. I recently put in some patches for ipfs-deploy. Maybe some of my experience can help you get deployed!
2) mikehibbert has applied to start work (Funders only: approve worker | reject worker).

Hi

I've deployed several ReactJS apps to the Arweave permaweb network which sounds like its doing what you would like to achieve. You can also redirect your sites domain to the permaweb link once created, (see the example below).

Here's an example:
https://arweave.net/I24VcIjNFAQQpyXLcu-eBSl3DPGL2aioaltIeXpSUlc

You can get a free wallet with 1AR worth of coin so you can access the site and look it over here:
https://tokens.arweave.org/

I'm happy to assist you in converting your app to a serverless version and deploying to the permaweb for you.

Kind Regards

Mike
3) devilla has applied to start work (Funders only: approve worker | reject worker).

We're able to deploy the DAPP to IPFS recently. Hope we can do it again. Thanks.
4) kryptos-ke has applied to start work (Funders only: approve worker | reject worker).

Hello, I am interested in taking on the project. Thanks, let's do it!

Learn more on the Gitcoin Issue Details page.

@cryptnotiq
Copy link
Contributor

@tcrowe could you expand on how you plan to approach this deployment to IPFS?

And also explain how publishing updates works? Does it require having to redeploy to IPFS for even very small changes to the codebase? And will that create a new hash each time which we will have to repoint the URL to?

If there are any other limitations or aspects that may be a concern for running an application efficiently please also mention those here.

@tcrowe
Copy link
Collaborator

tcrowe commented Jan 21, 2020

@cryptnotiq Yes, your understanding is correct. Finding the correct solution could be somewhat involved. Let me show why.


app.mybit.io subdomain runs with Lets Encrypt possibly on zeit now.

app mybit io-lets-encrypt-ssl

There's some connections to static assets and API servics across these hosts. Most of these would not need to change.

app mybit io-umatrix-assets

mybit.io domain runs on a different server but could be unified into IPFS if there is a solution for proper domain, subdomain, and SSL certs.

mybit io-cloudflare-ssl


Now that we've mapped out the static and dynamic assets there's a few things to consider.

IPFS direct

If someone has an IPFS extension in their browser they would be able to directly view the dApp.

Pinners & Gateways

These are the public gateways: https://ipfs.github.io/public-gateway-checker/

They will mostly give you URLs like:

  • https://ipfs.infura.io/ipfs/{mybit-dapp-CID}
  • https://gateway.ipfs.io/ipfs/{mybit-dapp-CID}

Some will provide:

  • https://{mybit-dapp-CID}.ipfs.dweb.link
  • https://{mybit-dapp-CID}.ipfs.2read.net

With IPNS+ENS courtesy of ens.domains you get something like mybit.eth.link.

Some of those services can host the content for free, or up to 1GB, or so.

Some R&D would need to be done to figure out which gateway, if any, can correctly give *.mybit.io an SSL certificate.

MyBit domains

The above solutions are fine as mirrors but if you want *.mybit.io to have the correct SSL for non-IPFS-extension users then some other solution is needed. Otherwise we could end up with this for people without IPFS-enabled browser.

Screen Shot 2020-01-21 at 1 46 21 PM

For example you could easily set DNS CNAME or ALIAS some of the above URL patterns. But you will likely get this SSL message above if you don't have it setup correctly with the gateways. Even then there is no guarantee they will have that feature.

Invent a solution

If it's needed to have *.mybit.io hosted on an IPFS gateway and none of the gateways on the list support the feature it may need to be invented. Most of the puzzle pieces are available via node+npm+express.

What is missing?

If you or anyone sees flaws in my arguments comment and we can roll this into an article or tutorial.

@tcrowe
Copy link
Collaborator

tcrowe commented Jan 21, 2020

The above would be repeated similarly for deployment on Dat Protocol with Dat+BeakerBrowser or Dat+hashbase.io Pinner.

@tcrowe
Copy link
Collaborator

tcrowe commented Jan 21, 2020

Ideally, for IPFS, one of the built-in Pinners will suffice on ipfs-deploy:
https://github.com/ipfs-shipyard/ipfs-deploy

@cryptnotiq
Copy link
Contributor

Hey @tcrowe awesome explanation, I really appreciate it. Everything makes sense to me, and I don't think there is actually a need for secret key operations.

@tcrowe
Copy link
Collaborator

tcrowe commented Jan 23, 2020

@MyBitIO @cryptnotiq I didn't see any notifications but gitcoin hints that I'm on it. I'll keep you up to date as I go. I'm available on t.me/tcrowe too.

@tcrowe tcrowe mentioned this issue Jan 25, 2020
@tcrowe
Copy link
Collaborator

tcrowe commented Jan 25, 2020

Update: I'm mapping out what is in the server and how to find existing work in the front-end to replace it. Some pieces are already there and others haven't been hooked up yet. So far so good. 👍🏻

@tcrowe
Copy link
Collaborator

tcrowe commented Jan 27, 2020

Update

So far so good. We're getting to the point where we need to start deploying.

CloudFlare IPFS

CloudFlare was the only one that says it will put up the SSL. It's also built-in to ipfs-deploy.

We need a few secret environment variables added to the CI/CD system(s). Get API token

IPFS_DEPLOY_CLOUDFLARE__API_TOKEN=
IPFS_DEPLOY_CLOUDFLARE__ZONE=app.mybit.io
IPFS_DEPLOY_CLOUDFLARE__RECORD=_dnslink.app.mybit.io

⚠️ If you cannot use CloudFlare DNS we need to find another solution.

IPFS Pinners

The CI/CD will deploy to an IPFS pinner service but the good news is that we can all host it. 🎉

Please also get an account with Piñata so we can get these secret environment variables.

IPFS_DEPLOY_PINATA__API_KEY=
IPFS_DEPLOY_PINATA__SECRET_API_KEY=

CI/CD security

Please also PM me so we can see if the environment variables are secure.

@tcrowe
Copy link
Collaborator

tcrowe commented Jan 27, 2020

Temporary static export: https://tcrowe-mybit-ipfs.commons.host

⚠️This is not on IPFS yet. Parts of it connect to IPFS but not this one.

This was referenced Jan 27, 2020
@gitcoinbot
Copy link

@tcrowe Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 1, 2020

@gitcoinbot WIP PR #530

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 1, 2020

🎉 First successful build since five months ago 🎉
https://circleci.com/gh/MyBitFoundation/MyBit-Go.app/1061

@MyBitIO

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 2, 2020

Test IPFS deploy URL: https://ipfs-app.mybit.io/

Currently it's taking a while for the IPFS changes to propagate. Not all the files appear for me right away. We need a way to do it quick! 🔥

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 2, 2020

Screen Shot 2020-02-01 at 8 53 43 PM

If you view the network console it shows only partial network saturation so far.

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 5, 2020

@gitcoinbot We're just on the last steps talking about CI/CD.

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 7, 2020

@gitcoinbot We're putting on the finishing touches. 💅

@tcrowe
Copy link
Collaborator

tcrowe commented Feb 22, 2020

We're going over a few last touches on this and coordinating with other devs on their PRs. I'll see about making another update before this evening. (MST)

@tcrowe
Copy link
Collaborator

tcrowe commented Mar 3, 2020

We're just scaling back the PR and then we can roll some of the extra goodies into future PRs: #543

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Cancelled


The funding of 1000.0 DAI (1000.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants