# Starting a Project
The Agoric platform is at the beta stage. It is in the process of being formally evaluated for vulnerabilities, and is undergoing security treatment and hardening to support mainnet-1 launch. Do not use for production purposes.
Before we begin, you should use
agoric --version to double-check that you have installed the Agoric SDK.
If it is available, then you successfully installed the Agoric SDK. If not, then please do so before continuing.
After you've installed the Agoric SDK, then you're ready for your first Agoric Dapp (decentralized application) by continuing the instructions below.
We'll be running three terminal windows. See below:
# Terminal 1: simulated blockchain and "solo" client
# Terminal 2: contract interaction
# Terminal 3: web user interface
Watch: Prepare Your Agoric Environment (November 2020)
This presentation includes starting a project, but note an outdated detail:
- In the REPL
x~.go()tildot support has been postponed; use
demo from Dapp Template
The following section will explain how to initialize a demo, install the Agoric SDK into the Dapp template, and then launch the Agoric Solo Client and Simulated Blockchain.
Use the Agoric CLI to fetch from a Dapp template
and put it in a
demo directory not located in your
# Terminal 1 # Don't use your agoric-sdk as the parent of the demo directory. cd $HOME agoric init demo # use `agoric init $DIRNAME` with any name you like cd demo agoric install # will take a minute to install all dependencies agoric start --verbose # `agoric start --reset` to start over
demo is an arbitrary suggestion.
Mac Dev Tools
On a Mac, you must first install Xcode (opens new window)
Leave this process and its logs running in its own terminal window.
# Open the Agoric Wallet and REPL
# Terminal 2 cd demo agoric open --repl
This should automatically open http://127.0.0.1:8000 (opens new window) in a new browser window or tab.
To begin using the wallet, click the "Connect Solo Wallet" button.
After your solo wallet is connected, then you're ready to deploy the contract and API.
# Deploy the Contract and API
In our second terminal, deploy the contract to the simulated blockchain and the API to the solo client.
# Terminal 2 cd demo # if not already there agoric deploy ./contract/deploy.js agoric deploy ./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.
# Terminal 3 cd demo # if not already there cd ui && yarn start
Leave this running in its own terminal window and visit http://localhost:3000 (opens new window) in a web browser.
Once here, you will be asked to enable the dapp in your Agoric wallet.
# Connect the Dapp to the Agoric Wallet
Navigate back to http://127.0.0.1:8000 (opens new window) and accept the Dapp's request to connect to your wallet.
Navigating to the "Dapps" section of the Agoric Wallet should now show that you have successfully connected.
# Use the Dapp to collect your (simulated) tokens
Once your wallet has been connected, return to http://localhost:3000 (opens new window) and click the "Mint Fungible Tokens" button.
Navigate back to http://127.0.0.1:8000 (opens new window) to approve the offer and collect the tokens.
Your wallet's FungibleFaucet purse will now hold 1000 FungibleFaucet tokens.
Visit the documentation's wallet UI section to learn more.