From 3217de90c30dfaf3f7a02adba68b739564c4d3ba Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Mon, 13 Nov 2023 17:26:18 -0600 Subject: [PATCH] build: simplified README instructions --- README.md | 38 ++++++++++++++------------------------ package.json | 16 +++++++++++----- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ed87e11..59b0674 100644 --- a/README.md +++ b/README.md @@ -5,32 +5,23 @@ TL;DR: The Fungible Faucet Dapp sends tokens to a user's wallet when they click the "Mint Fungible Tokens" button. -Install the [prerequisites](https://agoric.com/documentation/getting-started/before-using-agoric.html). Then checkout the latest `beta` release for the sdk: -```sh -cd agoric-sdk -git checkout beta -yarn && yarn build -``` +Install the [prerequisites](https://agoric.com/documentation/getting-started/before-using-agoric.html). -Then in a first terminal in the directory where you want to put your dapp, install the dapp: +In the parent directory of where you want to put your dapp project, create your own (`my-fungible-faucet` in this example, based on the `dapp-fungible-faucet` repository): ```sh -agoric init --dapp-template dapp-fungible-faucet --dapp-branch beta my-fungible-faucet -cd my-fungible-faucet -# Start the Agoric platform -agoric install && agoric start --reset +yarn create @agoric/dapp --dapp-template dapp-fungible-faucet --dapp-branch beta my-fungible-faucet ``` -In a second terminal, deploy this contract and the API server -```sh -agoric deploy contract/deploy.js -agoric deploy api/deploy.js +Install and run just like any other NPM application: ``` - -In a third terminal, -```sh -# Navigate to the `ui` directory and start a local server -cd ui && yarn start +# Enter the dapp folder +cd my-fungible-faucet +# Install dependencies +yarn install +# Start the Agoric platform with this dapp +yarn start ``` + Then navigate to http://127.0.0.1:3000. The Fungible Faucet Dapp is the simplest [Agoric @@ -50,10 +41,9 @@ opposed to using a framework). ## Using the Dapp -1. Navigate to http://127.0.0.1:3000. -2. Enter `agoric open` in your terminal -3. A window for your wallet should open. -4. Under "Dapps" in the wallet, enable the FungibleFaucet Dapp: +1. Enter `yarn start:wallet` in your terminal to open the Wallet UI. +2. Navigate a fresh browser tab to http://127.0.0.1:3000 to go to the Dapp UI. +3. Under "Dapps" in the wallet, enable the FungibleFaucet Dapp: ![Enable Dapp](./readme-assets/enable-dapp.png) diff --git a/package.json b/package.json index bf4765c..6476343 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,13 @@ "ui" ], "devDependencies": { + "@agoric/cosmic-swingset": "beta", + "@agoric/solo": "beta", "@endo/eslint-plugin": "^0.3.24", "@jessie.js/eslint-plugin": "^0.1.3", + "agoric": "beta", "ava": "^4.3.1", + "concurrently": "^8.2.2", "eslint": "^7.32.0", "eslint-config-airbnb": "^18.0.1", "eslint-config-airbnb-base": "^14.2.0", @@ -24,17 +28,19 @@ "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", - "prettier": "^2.7.1", - "@agoric/solo": "beta", - "@agoric/cosmic-swingset": "beta" + "prettier": "^2.7.1" }, "scripts": { - "preinstall": "node -e \"process.env.AGORIC_INSTALL && process.exit(0); console.warn('please use: agoric install . For details, see https://agoric.com/documentation/'); process.exit(1)\"", "lint": "yarn workspaces run lint-fix", "lint-check": "yarn workspaces run lint-check", "test": "yarn workspaces run test", "integration-test": "yarn ava", - "build": "yarn workspaces run build" + "build": "yarn workspaces run build", + "start:wallet": "agoric open", + "start:deploy": "agoric deploy contract/deploy.js api/deploy.js", + "start:sim": "agoric start --reset", + "start:ui": "cd ui && yarn start", + "start": "concurrently --kill-others -c \"bgBlue.bold,bgMagenta,bgYellow.bold\" --names \"SIM,DEP,UI \" \"yarn start:sim\" \"yarn start:deploy\" \"yarn start:ui\"" }, "dependencies": { "agoric": "beta"