Skip to content

Commit

Permalink
update client
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 11, 2020
1 parent f5c61e5 commit 3fa3919
Show file tree
Hide file tree
Showing 179 changed files with 466,995 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "darkforest-7f0ab"
}
}
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# production
/dist

# misc
.DS_Store

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# built by local-deploy
/src/utils/local_contract_addr.ts

/public/contracts

# firebase
.firebase
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true
}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:12-alpine as build

RUN apk add --no-cache make gcc g++ python

COPY yarn.lock yarn.lock
COPY package.json package.json

RUN yarn install
COPY . .
RUN yarn run build

FROM node:12-alpine
COPY --from=build dist dist
CMD npx serve dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Dark Forest

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Dark Forest Client

## Development Guide

### Installing Core Dependencies

- Node (v12.18.0)
- Yarn (Javascript Package Manager)
- Ganache CLI

#### Installing The Correct Node Version Using NVM

Dark Forest is built and tested using Node.js v12.18.0 and might not run properly on other Node.js versions. We recommend using NVM to switch between multiple Node.js version on your machine.

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install
```

After the installation is finished, you can run `node --version` to verify that you are running v12.18.0

#### Installing Yarn & Other Dev Dependencies

Refer to [Yarn's official documentation](https://classic.yarnpkg.com/en/docs/install) for the installation guide.

After you have Yarn installed, run the following commands in the root director install the remaining dev depencies:

```
yarn global add ganache-cli
yarn install
```

### Client Development Setup

All of our client related code are located in the `/client` directory.

Currently, after following the setup below, you will be able to have a locally running client that will point towards the current playtest contract on Ropsten. The production contract address is stored in `/client/src/utils/prod_contract_addr.ts`.

**Navigate to the `/client` folder and run the following commands:**

```
yarn install
yarn start:prod
```
1 change: 0 additions & 1 deletion hello.txt

This file was deleted.

131 changes: 131 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Dark Forest, the world's first decentralized real-time strategy game. Built on Ethereum with zkSNARKs."
/>
<meta property="og:title" content="Dark Forest" /> <!-- 70 char max for twitter -->
<meta property="og:type" content="game" />
<meta property="og:url" content="https://zkga.me" />
<meta property="og:image" content="https://zkga.me/public/og_image.png" /> <!-- Size: The recommended size for an OG Image is 1.91:1. The recommended pixel dimensions are 1200:630 -->
<meta property="og:description" content="Dark Forest, the world's first decentralized real-time strategy game. Built on Ethereum with zkSNARKs." /> <!-- 200 char max for twitter -->

<meta name="twitter:card" content="summary_large_image"></meta>
<meta name="twitter:site" content="@darkforest_eth"></meta>

<!-- favicon stuff -->
<link rel="shortcut icon" href="./public/favicons.ico" />
<link
rel="apple-touch-icon"
sizes="57x57"
href="./public/favicons.ico/apple-icon-57x57.png"
/>
<link
rel="apple-touch-icon"
sizes="60x60"
href="./public/favicons.ico/apple-icon-60x60.png"
/>
<link
rel="apple-touch-icon"
sizes="72x72"
href="./public/favicons.ico/apple-icon-72x72.png"
/>
<link
rel="apple-touch-icon"
sizes="76x76"
href="./public/favicons.ico/apple-icon-76x76.png"
/>
<link
rel="apple-touch-icon"
sizes="114x114"
href="./public/favicons.ico/apple-icon-114x114.png"
/>
<link
rel="apple-touch-icon"
sizes="120x120"
href="./public/favicons.ico/apple-icon-120x120.png"
/>
<link
rel="apple-touch-icon"
sizes="144x144"
href="./public/favicons.ico/apple-icon-144x144.png"
/>
<link
rel="apple-touch-icon"
sizes="152x152"
href="./public/favicons.ico/apple-icon-152x152.png"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="./public/favicons.ico/apple-icon-180x180.png"
/>
<link
rel="icon"
type="image/png"
sizes="192x192"
href="./public/favicons.ico/android-icon-192x192.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./public/favicons.ico/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="96x96"
href="./public/favicons.ico/favicon-96x96.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="./public/favicons.ico/favicon-16x16.png"
/>
<link rel="manifest" href="./public/manifest.json" />
<meta name="msapplication-TileColor" content="#080808" />
<meta
name="msapplication-TileImage"
content="./public/favicons.ico/ms-icon-144x144.png"
/>
<meta name="theme-color" content="#080808" />

<link rel="shortcut icon" href="./public/favicon.ico" />
<link rel="apple-touch-icon" sizes="57x57" href="./public/icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="./public/icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="./public/icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="./public/icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="./public/icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="./public/icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="./public/icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="./public/icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="./public/icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="./public/icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="./public/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="./public/icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="./public/icons/favicon-16x16.png">
<link rel="manifest" href="./public/icons/manifest.json">
<meta name="msapplication-TileColor" content="#080808">
<meta name="msapplication-TileImage" content="./public/icons/ms-icon-144x144.png">
<meta name="theme-color" content="#080808">

<script src="public/websnark/websnark.js"></script>
<script>
fetch('./public/proving_key_init.bin');
</script>
<script>
fetch('./public/proving_key_move.bin');
</script>
<title>Dark Forest</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
1 change: 1 addition & 0 deletions last_updated.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
last updated: Fri Sep 11 20:48:41 UTC 2020
87 changes: 87 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.0.5",
"@ethersproject/networks": "^5.0.2",
"@ethersproject/providers": "^5.0.5",
"@metamask/detect-provider": "^1.1.0",
"@types/lodash": "^4.14.157",
"auto-bind": "^4.0.0",
"big-integer": "^1.6.46",
"circomlib": "0.0.20",
"csv-parse": "^4.10.1",
"email-validator": "^2.0.4",
"es6-promisify": "^6.1.1",
"ethers": "^5.0.7",
"events": "^3.0.0",
"global": "^4.4.0",
"html-react-parser": "^0.13.0",
"idb": "^5.0.1",
"json-stable-stringify": "^1.0.1",
"lodash": "^4.17.15",
"lz-string": "^1.4.4",
"normalize.css": "^8.0.1",
"react": "^16.9.0",
"react-dom": "^16.12.0",
"react-icons": "^3.9.0",
"react-router-dom": "^5.1.2",
"react-spinkit": "^3.0.0",
"react-typist": "^2.0.5",
"react-use": "^13.27.1",
"snarkjs": "0.1.20",
"socket.io-client": "^2.3.0",
"styled-components": "^5.0.1",
"websnark": "0.0.5",
"yargs": "^15.1.0"
},
"scripts": {
"start:dev": "webpack-dev-server --mode development --open --hot",
"start:prod": "webpack-dev-server --mode production --open --hot",
"build": "webpack --mode production"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/preset-react": "^7.8.3",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@types/react-router-dom": "^5.1.3",
"@types/socket.io-client": "^1.4.33",
"@types/styled-components": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.2.0",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^2.3.0",
"file-loader": "^6.0.0",
"html-webpack-plugin": "^3.2.0",
"script-loader": "^0.7.2",
"source-map-loader": "^0.2.4",
"speed-measure-webpack-plugin": "^1.3.1",
"style-loader": "^1.0.0",
"ts-loader": "^6.2.1",
"typescript": "^3.7.2",
"typescript-plugin-styled-components": "^1.4.4",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.9.0",
"worker-loader": "^2.0.0"
}
}
Loading

0 comments on commit 3fa3919

Please sign in to comment.