Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Simplify commands used in README instructions #62

Closed
wants to merge 11 commits into from

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Nov 14, 2023

Lightly tested, but this is the approach I'd like to take.

@sufyaankhan, please take a look at README.md for how this architecture simplifies the flow.

Recommendations appreciated.

@michaelfig michaelfig self-assigned this Nov 14, 2023
@michaelfig
Copy link
Member Author

Here is how it currently fails (because @agoric/xsnap is broken in the beta packages):

$ yarn start
yarn run v1.22.5
$ concurrently --kill-others -c "bgBlue.bold,bgMagenta,bgYellow.bold" --names "SIM,DEP,UI " "yarn start:sim" "yarn start:deploy" "yarn start:ui"
$ agoric deploy contract/deploy.js api/deploy.js
$ agoric start --reset
$ cd ui && yarn start
$ parcel serve --host=127.0.0.1 --port=3000 public/index.html
[DEP] Open CapTP connection to ws://127.0.0.1:8000/private/captp...agoric: start: removing _agstate/agoric-servers/dev
[SIM] agoric: start: rm -rf _agstate/agoric-servers/dev
[SIM] agoric: start: initializing dev
[SIM] agoric: start: /Users/michael/agoric/dapp-fungible-faucet/node_modules/@agoric/solo/src/entrypoint.js init dev --egresses=fake --webport=8000
[UI ] Server running at http://127.0.0.1:3000
[UI ] ✨ Built in 7ms
[SIM] agoric: start: setting sim chain with 0 second delay
[SIM] agoric: start: /Users/michael/agoric/dapp-fungible-faucet/node_modules/@agoric/solo/src/entrypoint.js set-fake-chain --delay=0 sim-chain
[DEP] .agoric: start: /Users/michael/agoric/dapp-fungible-faucet/node_modules/@agoric/solo/src/entrypoint.js start
[DEP] ......Loading makeSlogSender from @agoric/telemetry/src/flight-recorder.js
[SIM] (Error#1)
[SIM] Error#1: spawn /Users/michael/agoric/dapp-fungible-faucet/node_modules/@agoric/xsnap/xsnap-native/xsnap/build/bin/mac/release/xsnap-worker ENOENT
[SIM] 
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[SIM] yarn start:sim exited with code 255
--> Sending SIGTERM to other processes..
[DEP] yarn start:deploy exited with code 1
--> Sending SIGTERM to other processes..
[UI ] yarn start:ui exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
snow:dapp-fungible-faucet michael$ 

@michaelfig
Copy link
Member Author

After yarn agoric install agoric-upgrade-12 didn't fix the issue, I found that the actual problem was in the @agoric/xsnap/package.json. It was using git status to detect if the package was in development vs. production mode, and that gave wrong answers when installed within a dapp project. I switched it to use test -d ./test to detect development mode (since the ./test directory is omitted from the NPM package).

Now I was able to run the README instructions to completion (contract successfully deployed), and the next broken thing appeared to be a problem with running an older ses in the dapp UI.

I call this a victory.

Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

Use getting-started-dev instead of beta

@michaelfig michaelfig changed the title WIP: simplify commands used in README instructions Simplify commands used in README instructions Nov 14, 2023
@michaelfig michaelfig marked this pull request as ready for review November 14, 2023 18:55
@michaelfig michaelfig force-pushed the mfig-hack-getting-started branch 3 times, most recently from c2c1579 to c4698b6 Compare November 15, 2023 15:43
Copy link
Member

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

Quick review. Looks great so far. I have to dig out my notes of when I went through the same a couple month ago.

run: |
if ${{ steps.get-branch.outputs.result == 'NONE' }}; then
yarn install
echo "AGORIC_CMD=[\"$PWD/node_modules/.bin/agoric\"]" >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way we can avoid this workaround? What is it needed for anyway?

Copy link
Member Author

Choose a reason for hiding this comment

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

The agoric-cli/tools integration test needs to know how to find the CLI, and it defaults to using the PATH. I didn't want to munge with the $GITHUB_PATH file, so I used the same $AGORIC_CMD environment variable that the agoric-sdk/scripts/registry.sh uses.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I didn't see this used anywhere, so I thought it was a magic env

@@ -1,5 +1,5 @@
{
"name": "dapp-fungible-faucet-api",
"name": "@agoric/dapp-fungible-faucet-api",
Copy link
Member

Choose a reason for hiding this comment

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

I kinda wish we used another scope for these example dapps

Copy link
Member Author

Choose a reason for hiding this comment

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

Why? The names get replaced when people do npm create or agoric init.

Copy link
Member

Choose a reason for hiding this comment

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

I guess if these packages are never published to NPM, that's fine.

api/package.json Outdated
"dependencies": {
"@endo/eventual-send": "^0.15.5",
"@endo/marshal": "^0.6.9",
"@agoric/dapp-fungible-faucet-ui": "^0.0.1",
Copy link
Member

Choose a reason for hiding this comment

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

The API having a dependency on the UI seems backwards

Copy link
Member Author

Choose a reason for hiding this comment

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

I can try to flip this around, but it was this way when I arrived here.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah it's out of scope, but maybe we should have an issue to track

@@ -55,7 +57,8 @@
"eslintConfig": {
"extends": [
"@agoric"
]
],
"parser": "@typescript-eslint/parser"
Copy link
Member

Choose a reason for hiding this comment

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

👍

api/deploy.js Outdated
// Agoric Dapp api deployment script

import fs from 'fs';
import { E } from '@endo/eventual-send';
import '@agoric/zoe/exported.js';

import installationConstants from '../ui/public/conf/installationConstants.js';
import installationConstants from "@agoric/dapp-fungible-faucet-ui/public/conf/installationConstants.js";
Copy link
Member

Choose a reason for hiding this comment

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

Oh that's the dependency. Yeah this really feels backwards

@mhofman
Copy link
Member

mhofman commented Nov 15, 2023

For reference, I had done something similar to dapp-card-store a couple month ago, but our approach on a some deps seem to have been different in a couple places: Agoric/dapp-card-store@main...mhofman/npm-latest

@mhofman
Copy link
Member

mhofman commented Dec 29, 2023

@dckc another set of dapp work for NPM compatibility during the hackathon

@dckc
Copy link
Member

dckc commented Dec 29, 2023

I'd be inclined to mothball (archive) this dapp. I don't think it's worth maintaining.

@michaelfig
Copy link
Member Author

I'm closing this one since we're not putting more energy into dapp-fungible-faucet. The history here might be useful for someone in the future, though.

@michaelfig michaelfig closed this Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants