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

install from npm; smart-wallet / local chain only #881

Closed
wants to merge 9 commits into from
Closed

Conversation

dckc
Copy link
Member

@dckc dckc commented Nov 29, 2023

  • consolidates the whole page of details on installing the SDK from a git clone to one yarn create @agoric/dapp demo to install from npm packages
  • replaces ag-solo style initial dapp (card store) with smart-wallet style game piece dapp running on a local chain in a docker container

refs #894, #726

rendered:

builds on:

related follow-on work:

Copy link

cloudflare-workers-and-pages bot commented Nov 29, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 312d426
Status: ✅  Deploy successful!
Preview URL: https://57d4e2e1.documentation-7tp.pages.dev
Branch Preview URL: https://dc-npm-only.documentation-7tp.pages.dev

View logs

```sh
corepack enable
yarn --version # 1.x
```
Copy link
Member

Choose a reason for hiding this comment

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

I agree it's best to recommend yarn here, but is it also worth highlighting that other package managers work?

I had success with pnpm and npm like mentioned here.

I was also curious to give yarn 4.x a try, and had luck with this:

# upgrade from yarn classic to yarn 4.x
yarn set version berry 

# disable PnP modules
yarn config set nodeLinker node-modules

Copy link
Member Author

Choose a reason for hiding this comment

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

How about a separate issue?

We would want to set up ci to ensure that other package managers continue to work.

development dependencies for testing, code formatting, and static analysis.

```sh
yarn install # may take several minutes
Copy link
Contributor

Choose a reason for hiding this comment

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

I got the following error when I run yarn install following above instructions.

$ yarn install
yarn install v1.22.5
$ 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)"
please use: agoric install . For details, see https://agoric.com/documentation/
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

node --version
v18.12.1

yarn --version
1.22.19

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed in Agoric/dapp-offer-up@d96fb88 , I think. try again?

```shell
yarn build
```sh
yarn start
Copy link
Contributor

Choose a reason for hiding this comment

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

do you plan to wrap all the following commands inside yarn start somehow?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, something like that.

I avoid shell scripts longer than about 10 lines, but I guess it's the right tool for this job.

Copy link
Member Author

Choose a reason for hiding this comment

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

Due to the way starting the UI clears the screen so that you can't see the mnemonic that you need to add to Keplr, I didn't manage to reduce it to one yarn start command.

But I got close: yarn start:contract and yarn start:ui with keplr setup in between.

To run a local Agoric blockchain with [docker-compose](https://docs.docker.com/compose/):

```sh
yarn start:docker
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add cd contract for this command to work.
Also, can we change this to be yarn docker:start to match with other docker related commands?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah... I'm not sure whether to cd or to tweak the top-level package.json so that it's not necessary.

re start:docker vs docker:start ... I got start:docker from the indexing workshop a while back. I don't know how widespread the convention is. Something to think about, yeah.

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'm not sure whether to cd or to tweak the top-level package.json so that it's not necessary.

I did the tweak:

2023-12-04 17:38 c46b334 build: make docker scripts available at top level

still considering start:docker vs docker:start.


Use `yarn link-cli` to install the Agoric CLI (Command Line Interface) in a convenient place of your choosing such as:
2. Use the [Install Bundle](https://cosgov.org/?msgType=installBundle&network=local) tab to install the 2 bundles.
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

We have some contributions for an single yarn start command that would avoid this.

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 "Request body too large" error doesn't look like a cosgov bug but rather a zoe packaging bug:

Meanwhile, please take a look at the recent update using a single yarn start:contract command instead of cosgov.

@dckc
Copy link
Member Author

dckc commented Dec 6, 2023

Using github for hosting draft images...

draft screenshots

image

image

image

and...

image

...

image

don't like this one:
image

 - CLI Commands -> CLI Reference
 - prune initial "in this order" section in favor of list from `agoric help`
 - agoric run: brief usage; cite writeCoreProposals discussion
 - init: deprecate in favor of `yarn create @agoric/dapp`
 - Syntax -> Usage
 - markdown lint: `-` rather than `*` for lists; `_` rather than `*`
   for italic
 - install: deprecate
   This is supposed to be able to install from npm.
   I thought `agoric install agoric-upgrade-11wf` was supposed to do it,
   but I got an endless series of questions about what versions to
   use. If we have a form that's tested in ci, I'm not aware of it.
   Until we do, let's deprecate this.
 - start local-chain: document briefly
 - start: deprecate as beta feature
 - deploy: deprecate as beta feature
 - open: deprecate as beta feature
 - subordinate material with details markup
   - reorg adding Keplr account
 - troubleshooting Symbol.dispose error from node v18.19.0
 - consolidate linux, mac dev tool details
 - fix Keplr wallet wallet typo
 - docker-compose -> docker compose
@dckc dckc marked this pull request as ready for review December 9, 2023 02:40
@dckc dckc changed the title SPIKE: install from npm; smart-wallet / local chain only install from npm; smart-wallet / local chain only Dec 9, 2023
@dckc dckc marked this pull request as draft December 18, 2023 17:46
@dckc
Copy link
Member Author

dckc commented Jan 3, 2024

@dckc dckc closed this Jan 3, 2024
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.

3 participants