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

dapps guide: point to up-to-date info #1264

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 4 additions & 91 deletions main/guides/dapps/index.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,7 @@
# Agoric Dapps

**This is a generic guide to Agoric Dapp projects**
See

A dapp is a _decentralized application_ which typically has a browser-based user interface, a public API server, and a contract running on the Agoric blockchain.

## Using a Dapp

If you have installed the [Agoric CLI](../getting-started/) and you want to try running a dapp locally on a simulated Agoric VM (i.e., it won't be running on an actual public chain), do the following:

1. Checkout the latest beta release of the SDK.

```sh
cd agoric-sdk
git checkout beta
yarn && yarn build
```

2. Run `agoric init` to make a new local copy of a dapp template.

```sh
# Here we chose the Fungible Faucet Dapp.
# You can replace `my-fungible-faucet` with a name of your choice.
agoric init --dapp-template dapp-fungible-faucet --dapp-branch beta my-fungible-faucet
cd my-fungible-faucet
# Install the project dependencies
agoric install
# Start the Agoric VM
agoric start --reset
```

3. Leave this command running (it is your simulated environment).
4. In a separate terminal, deploy the contract and API to the VM.

```sh secondary style2
# Deploy a new instance of the contract to the VM
agoric deploy contract/deploy.js
# Reset the VM's API server
agoric deploy api/deploy.js
```

5. In a third terminal, run the following.

```sh secondary style3
# Start the user interface
cd ui && yarn start
```

6. You can now navigate to [http://localhost:3000](http://localhost:3000) to view your dapp.

## Modifying this Dapp

In the Agoric system, components are written in Javascript.

## Components

The following are the important directories in an Agoric dapp project:

- [`contract/`](#contract-directory) defines the on-chain smart contract.
- [`api/`](#api-directory) defines the chain-connected server's `/api` HTTP endpoint.
- [`ui/`](#ui-directory) defines the browser user interface connecting users' personal wallets and the API server.

Other files and directories in this top-level folder should not typically be modified.

### Contract Directory

In the `contract` directory, you can find the following files to edit:

- **src directory**: Contract source code, starting with `src/contract.js`.

There are also files and folders that you usually shouldn't edit:

- **deploy.js**: Generic Agoric contract deployment script.

### API Directory

In the `api` directory, you can find the following files to edit:

- **src directory**: Handler for API HTTP endpoints, starting with `src/handler.js`.

There are also files and folders that you usually shouldn't edit:

- **deploy.js**: Generic Agoric API handler deployment script.

### UI Directory

The `ui` directory is almost completely under your control. The only files and folders that you usually shouldn't edit are:

- **public/lib**: The Agoric UI library.
- **public/conf**: Configuration files that are generated by the `contract/deploy.js` script.

## More Information

You can [learn more about the Agoric smart contract platform](https://agoric.com).
- [Getting Started](/guides/getting-started/)
- [Building Client Dapps](/guides/getting-started/contract-rpc.html)
- [UI Tutorial](/guides/getting-started/ui-tutorial/)
Loading