Code Monkey home page Code Monkey logo

cross-chain-hackathon-plant's Introduction

Bonsai Exchange ๐Ÿ‘‹

alt

Bonsai Exchange Dapp

This 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 contract about exchange bonsai to that blockchain . It does not currently deploy or connect to the Agoric testnet.

This particular dapp UI is written in Reactjs + Redux

Functionality

Bonsai Exchange :

  1. Buy plants from stock
  2. Planting trees in the collection.

Future :

  1. The contract has the ability to update properties such as the life of a plant, which will display other forms of the plant such as sprouting, flowering, and fruiting.

alt

  1. It is possible to resell the trees you have planted

How to run

Prerequisites :

  • Node : > v12.16
  • Agoric : >v0.6.1

How to install Agoric : https://agoric.com/documentation/getting-started/

Run the demo

git clone https://github.com/vinhyenvodoi98/Cross-Chain-Hackathon-Plant

cd Cross-Chain-Hackathon-Plant

Install JavaScript dependencies, which may take a while.

agoric install

Start the Agoric VM.

agoric start --reset

( leave this shell up with the process running )

Open another shell, go to your Cross-Chain-Hackathon-Plant directory

Deploy the Dapp on an Agoric VM

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

Move into the ui directory

Install NPM dependencies

yarn install

Launches the React development server

yarn start

Go to a browser and open http://localhost:3000 to see the Dapp

Go to another tab or browser and open http://localhost:8000/ to see and interact with a basic wallet and a REPL

Here's the interface:

User's garden

alt

Buy plants from the plant shop

alt

Then sign wallet to use moola to buy plant

alt

The plant will be moved to the collection so you can plant it in the garden

alt

After planting

alt

cross-chain-hackathon-plant's People

Contributors

vinhyenvodoi98 avatar hungld-2201 avatar duyhung2201 avatar dependabot[bot] 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.