GithubHelp home page GithubHelp logo

agoric-labs / dapp-join-game Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samsiegart/simple-game

0.0 0.0 0.0 343 KB

OBSOLETE in favor of https://github.com/agoric-labs/dapp-game-places

JavaScript 55.91% TypeScript 27.66% CSS 8.28% HTML 1.63% Makefile 6.52%

dapp-join-game's Introduction

OBSOLETE

See https://github.com/agoric-labs/dapp-game-places instead.

Agoric App Starter: Simple Game

This is a simple app for the Agoric smart contract platform.

The contract lets you give a small amount of IST in exchange for a few NFTs that represent places in a hypothetical game.

The UI is a React app started with the vite react-ts template. On top of that, we add

Getting started: test the contract

Prerequisites: agoric CLI from Installing the Agoric SDK. Work is in progress to address #3857, making installing from npm more stragithforward.

agoric --version
agoric install
cd contract
yarn
yarn test

Getting started: Deploy to Local Blockchain

Prerequisites: docker-compose, Gov Proposal Builder (or run from source).

Start local chain using docker-compose:

yarn start:docker
yarn docker:logs

We need a few 1000 IST to pay for contract bundle installation:

yarn make:help
yarn docker:make balance-q
yarn docker:make mint4k
yarn docker:make balance-q

To explore in the container where the node runs:

yarn docker:bash
agd query vstorage children published.priceFeed

Build the proposal to start the contract:

cd contract
yarn build:proposal

The filenames of bundles, a permit, and a script are printed.

Use the Install Bundle tab of the Gov Proposal Builder to install the 2 bundles. Get ready to vote with yarn docker:make vote PROPOSAL=n. Use the CoreEval Proposal tab to propose start-game1-permit.json and start-game1.js. Note the proposal number; supposing it is 7, use yarn docker:make vote PROPOSAL=7. Note the voting period is very short! 10s by default.

Buy some game places with the dapp UI

Prerequisites: node, yarn, keplr.

cd ui
yarn
yarn dev

Use yarn docker:bash to print account info, including user1. Add that account to keplr using its mnemonic.

Then hit Connect Wallet. The UI should show your address.

Then Make Offer. Keplr should show an offer to give 0.25 IST and want a few places. Sign and broadcast the offer. After a few seconds, the UI should show the places.

dapp-join-game's People

Contributors

dckc avatar kriskowal avatar samsiegart 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.