Code Monkey home page Code Monkey logo

capfundme's Introduction

Fungible Faucet Dapp

TL;DR:

The Fungible Faucet Dapp sends tokens to a user's wallet when they click the "Mint Fungible Tokens" button.

Install the prerequisites. Then in a first terminal in the directory where you want to put your dapp, install the dapp:

agoric init --dapp-template dapp-fungible-faucet my-fungible-faucet
cd my-fungible-faucet
# Start the Agoric platform
agoric install && agoric start --reset

In a second terminal, deploy this contract and the API server

agoric deploy contract/deploy.js
agoric deploy api/deploy.js

In a third terminal,

# Navigate to the `ui` directory and start a local server
cd ui && yarn start

Then navigate to http://127.0.0.1:3000.

The Fungible Faucet Dapp is the simplest Agoric Dapp. It demonstrates the three important parts of a dapp and how they should be connected:

  1. the browser UI (the frontend)
  2. the API server (the backend)
  3. the on-chain contract

This dapp starts a local blockchain on your computer, and deploys a basic contract to that blockchain. It does not currently deploy or connect to the Agoric testnet.

This particular dapp UI is written in vanilla JS for simplicity (as 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:

Enable Dapp

  1. Back on the Fungible Faucet page, click the "Mint Fungible Tokens" button.

Mint Fungible Tokens

  1. Go back to your wallet and approve the offer stating that you want 1000 tokens.

Mint Fungible Tokens

  1. Once the offer has been approved, your wallet makes an offer to Zoe on your behalf, giving you tokens from the mintPayments contract. You will receive a message that the offer was successful and should see the tokens in your purses.

Offer Completed

Tokens Received

To learn more about how to build Agoric Dapps, please see the Dapp Guide.

See the Dapp Deployment Guide for how to deploy this Dapp on a public website, such as https://fungiblefaucet.testnet.agoric.com/

capfundme's People

Contributors

dckc avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.