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

Making dapp work on GHCS #47

Merged
merged 30 commits into from
Jul 18, 2024
Merged

Making dapp work on GHCS #47

merged 30 commits into from
Jul 18, 2024

Conversation

amessbee
Copy link
Contributor

@amessbee amessbee commented Jul 5, 2024

=================
Instructions to run dapp-agoric-basic in GHCS
Several people asked therefore I am putting it at the top.

  1. Go to branch here: https://github.com/Agoric/dapp-agoric-basics/tree/ms/making-agoric-basic-on-GHCS
  2. Click on Green <> Code button
  3. Click on Codespaces tab and create a new Codespace. If you are already using Codespaces on current repo then click the "+" button on top right of the Codespaces tab to create a new one.
  4. You should see a VSCode environment load in your browser followed by a setup. This should take a few minutes.
  5. Once it's done do yarn install in the terminal.
  6. Do yarn start:docker followed by yarn docker:logs - kill it after you see begin/commit.
  7. Do yarn start:contract.
  8. Do yarn start:ui - a pop-up should appear in bottom right. Click open in browser if needed.
  9. DApp should be load in your browser.
  10. Connect your Wallet and interact with DApp as usual.
    =================

refs:

Changes include (for now):

  1. Making ports public (done manually)
  2. Updating hostname (using a bash script) - dynamically takes CODESPACE_NAME from env and updates in App.tsx
  3. This should still work on localhost after a more recent update.
  4. Adding mode: 'no-cors' to makeHttpClient.js

TODO:

  • (1) should be done through a script as well.
  • Regarding (2) - there is got to be a less invasive way of updating hostname.
  • Not sure if (4) compromises security in a critical way.

We (@amessbee and @rabi-siddique ) checked SWAP and it should work as is at this point. WIP.

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple questions...

@@ -45,6 +45,7 @@ export const makeHttpClient = (url, fetch) => {
execute: async request => {
const settings = {
method: 'POST',
mode: 'no-cors',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is no-cors a reasonable thing to use in all circumstances? What are the security considerations?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does no-cors do?

ui/src/App.tsx Outdated Show resolved Hide resolved
@dckc
Copy link
Member

dckc commented Jul 7, 2024

How do I test it?

@rabi-siddique rabi-siddique force-pushed the ms/making-agoric-basic-on-GHCS branch from 7e8c54c to e73546f Compare July 8, 2024 08:41
@rabi-siddique rabi-siddique force-pushed the ms/making-agoric-basic-on-GHCS branch 3 times, most recently from 9aec24d to 97c4db9 Compare July 8, 2024 10:50
@dckc
Copy link
Member

dckc commented Jul 8, 2024

by way of motivation / rationale, I added a link in the description to

please make sure each PR includes justification; typically by way of a reference to an issue

cc @toliaqat

@amessbee amessbee marked this pull request as ready for review July 8, 2024 15:39
@amessbee amessbee requested review from dckc and erights July 8, 2024 15:40
ui/src/App.tsx Outdated Show resolved Hide resolved
"onAutoForward": "silent"
}
},
"postStartCommand": "bash -i -c 'nvm install 18.20 && nvm alias default 18.20' && bash ./make_ports_public.sh 5173 1317 26657"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rabi-siddique @amessbee I think we need a lot of testing to sure ./make_ports_public.sh 5173 1317 26657 works every time. If there is flakyness then we should address it.

@rabi-siddique rabi-siddique force-pushed the ms/making-agoric-basic-on-GHCS branch from 97c4db9 to ea3e985 Compare July 9, 2024 01:44
@amessbee amessbee merged commit 668d8ec into main Jul 18, 2024
2 checks passed
@amessbee amessbee deleted the ms/making-agoric-basic-on-GHCS branch July 18, 2024 12:42
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

Successfully merging this pull request may close these issues.

5 participants