Giter VIP home page Giter VIP logo

dfares-v0.0.1's Introduction

DF ARES basic demo

Evil Wormhole update 2023.4. 1

how to local deploy DF ARES 0.1.1 basic demo

more information about DF ARES

fork from https://github.com/darkforest-eth/darkforest-v0.6

darkforest

Dark Forest Game on Blockchain.

To run this project you will need to be on Node 14 OR Node 16.

local development

Install dependencies

  • We use yarn to manage packages. Run yarn at the top level to automatically install all dependencies from subfolders. This will also run the monorepo's prepare script, which compiles things like TypeScript or Solidity code.

Running the project

  • Run yarn workspace eth start which starts the hardhat blockchain and deploys the game contracts.
  • Run yarn workspace client start to load the webclient.
  • Run yarn watch to start a typescript watcher to incrementally rebuild changed dependencies.

You can import the private key of one of the accounts hardhat node created and funded, which are printed when you started the node such as:

Account #2: 0x3097403b64fe672467345bf159f4c9c5464bd89e (100 ETH)
Private Key: 0x67195c963ff445314e667112ab22f4a7404bad7f9746564eb409b9bb8c6aed32

If you wish to restart the game from scratch, you will need to clear local storage. To do this in Chrome or Brave Browser, open the inspector, navigate to the "Application" tab, click "Clear storage" on the left pane, and click "Clear site data" under the circle that appears in the main inspector panel. Then hard refresh the website.

Contract Addresses

Both localhost development and production contract addresses are stored in @darkforest_eth/contracts package. If you deploy contracts locally in a fresh node, this file will never change. If the file does change do not check in this file, as you probably have a hardhat node process running in the background.

Production deploys must check in this file, but those will likely be done from CI and committed on a separate (non-development) branch.

Workspaces & Packages

The Dark Forest monorepo is managed using yarn workspaces. To add a new project to the monorepo, you must add it to the workspaces array inside the root package.json.

Note: We use globs for anything in packages/ so you don't need to update the workspaces for a new package.

The packages/ directory is a place to store workspace packages that should be published to something like the https://npmjs.com registry, which allows players to build plugins, game clients, etc using the same code that Dark Forest itself uses.

To add a new package, create a new directory inside the packages/ directory. The package name for anything in packages/ should be prefixed with @darkforest_eth/ to be published to our scope.

circom and snarkjs

If you are modifying anything SNARK-related, you may be interested in rebuilding circuits / redoing setup. Run yarn workspace eth circom:dev or yarn workspace eth circom:prod respectively to rebuild the wasm and zkey files. Then yarn workspace eth compile as usual will build and refresh the Verifier.sol.

Thegraph

To run a local copy of thegraph make sure docker is installed and running, yarn workspace eth start --subgraph df OR if you already have your contracts deployed and running run yarn workspace eth hardhat:dev subgraph:deploy --name df and find your local hosted explorer at http://localhost:8000/subgraphs/name/df

dfares-v0.0.1's People

Contributors

fromddy avatar

Stargazers

 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.