# Starting a Project

Beta status

The Agoric platform is at the beta stage. It has not yet been formally tested or hardened. Do not use for production purposes.

Now that you have installed the Agoric SDK, let's try out your first Agoric Dapp (decentralized application).

In addition to a shell window for ordinary commands, open two additional shells for long-running processes and their logs, for a total of three shell windows:

  1. main command shell
  2. simulated blockchain and "solo" client
  3. web user interface

Watch: Prepare Your Agoric Environment (Nov 2020)

This presentation includes starting a project, but note an outdated detail:

  • In the REPL x~.go() tildot support has been postponed; use E(x).go().

# Initialize demo from Dapp Template

Use the Agoric CLI to fetch from a Dapp template and put it in a demo directory not located in your agoric-sdk clone:

# Shell 1
# Don't use your agoric-sdk clone as the parent of the demo directory.
# It doesn't have to be your home directory; any other directory will do.
cd
agoric init demo

The name demo is an arbitrary suggestion; in general, use agoric init DIRNAME with any name you like.

The default template is the Fungible Faucet Dapp (opens new window). Learn more about the available dapp templates.

# Install the Agoric SDK in the Dapp

cd demo
agoric install

It may take a minute or so to install all the dependencies.

Mac Dev Tools

On a Mac, you must first install Xcode (opens new window)

# Start the Agoric Solo Client and Simulated Blockchain

# Shell 2
cd demo # if not already there
agoric start --reset

Leave this process and its logs running in its own shell window.

# Deploy the Contract and API

Deploy the contract to the simulated blockchain and the API to the solo client.

# Shell 1
agoric deploy ./contract/deploy.js ./api/deploy.js

We'll cover deploying smart contracts in detail later.

# Start the Dapp User Interface

The web user interface communicates with the API in the solo client as well as the wallet (below).

# Shell 3
cd ui && yarn start

Leave this running in its own shell window and visit http://localhost:3000 (opens new window) in a web browser.

# Open the Agoric Wallet and REPL

# Shell 1
agoric open --repl

Another browser window or tab should appear.

# Use the Dapp to collect your (simulated) tokens

Use the wallet to grant the Dapp's request to connect. Then use the Fungible Faucet Dapp to collect your tokens.