Skip to content

Commit

Permalink
Please update README.md or add scripts folder. (#2688)
Browse files Browse the repository at this point in the history
* Please update README.md or add scripts folder.
Fixes #2684

* update readme.md

---------

Co-authored-by: Credence <[email protected]>
  • Loading branch information
aymericdelab and credence0x authored Feb 13, 2025
1 parent f65119a commit 1d5d3c5
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 32 deletions.
18 changes: 18 additions & 0 deletions client/apps/game/.env.local.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
VITE_PUBLIC_MASTER_ADDRESS="0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec"
VITE_PUBLIC_MASTER_PRIVATE_KEY="0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912"
VITE_PUBLIC_ACCOUNT_CLASS_HASH="0x07dc7899aa655b0aae51eadff6d801a58e97dd99cf4666ee59e704249e51adf2"
VITE_PUBLIC_FEE_TOKEN_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7

VITE_PUBLIC_TORII="http://127.0.0.1:8080"
VITE_PUBLIC_NODE_URL="http://127.0.0.1:5050"
VITE_PUBLIC_GAME_VERSION="v1.0.0-rc0"
VITE_PUBLIC_GRAPHICS_DEV=false
VITE_PUBLIC_TORII_RELAY="/ip4/127.0.0.1/udp/9091/webrtc-direct/certhash/uEiDry6d-bDv3UdIS6L9VMugoiZnfwqOeXyFWm6jgKf7aTw"

VITE_SOCIAL_LINK=http://bit.ly/3Zz1mpp

VITE_PUBLIC_CHAIN=local
VITE_PUBLIC_SLOT="eternum-prod"

VITE_PUBLIC_VRF_PROVIDER_ADDRESS="0x0"
VITE_PUBLIC_CLIENT_FEE_RECIPIENT=0x045c587318c9ebcf2fbe21febf288ee2e3597a21cd48676005a5770a50d433c5
148 changes: 116 additions & 32 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Realms: Eternum

Eternum has been designed to be a foundational game for Realms World. It will freely evolve and grow as the game and
world age. Think of it as a living, breathing digital ecosystem, constantly inviting endless exploration. Its both a
world age. Think of it as a living, breathing digital ecosystem, constantly inviting endless exploration. It's both a
game and an open platform.

### Eternum as a Game
Expand Down Expand Up @@ -59,66 +59,150 @@ inhabitants.

## Project Structure

- [Client](./client) Vite App with threejs interface
- [Contracts](./contracts) Cairo Based
- [Eternum Docs](./eternum-docs) Documentation around playing and building on Eternum
- [Scripts](./scripts) Development
- [SDK](./sdk) Npm packages
- [Client](./client) - React apps built with Vite
- [Game](./client/apps/game) - Main game client with Three.js interface
- [Landing](./client/apps/landing) - Landing page
- [Game Docs](./client/apps/game-docs) - Game documentation
- [Balancing](./client/apps/balancing) - Game balancing tools
- [Contracts](./contracts) - Cairo/Dojo smart contracts
- Game contracts
- Season Pass contracts
- Season Resources contracts
- [Packages](./packages) - Shared libraries
- [Core](./packages/core) - Eternum SDK
- [React](./packages/react) - React hooks and components
- [Config](./config) - Configuration and deployment scripts

---
## Prerequisites

- [Dojo](https://book.dojoengine.org) v1.0.4
- [Node.js](https://nodejs.org/)
- [pnpm](https://pnpm.io/) v9.12.3
- [Bun](https://bun.sh/)

## Core Dependencies

- [@dojoengine/react](https://www.npmjs.com/package/@dojoengine/react) - React integration for Dojo
- [@dojoengine/recs](https://www.npmjs.com/package/@dojoengine/recs) - Entity Component System
- [@cartridge/controller](https://www.npmjs.com/package/@cartridge/controller) - Game controller integration
- [Starknet.js](https://www.npmjs.com/package/starknet) v6.23.1 - StarkNet interaction
- [Vite](https://vitejs.dev/) - Frontend build tool

## Setup

1. Install Dojo:

```bash
curl -L https://install.dojoengine.org | bash
```

2. Install pnpm:

```bash
npm install -g pnpm
```

3. Install project dependencies:

```bash
pnpm install
```

4. Build shared packages:

```bash
pnpm run build:packages
```

## Development of Eternum

Development of Eternum is open-source. If you would like to contribute comment on an open issue.

## Prerequisites
## Available Scripts

### Development

- `pnpm dev` - Start game development server
- `pnpm dev:docs` - Start documentation development server
- `pnpm dev:landing` - Start landing page development server

### Building

- `pnpm build` - Build game client
- `pnpm build:docs` - Build documentation
- `pnpm build:landing` - Build landing page
- `pnpm build:packages` - Build shared packages

- [Dojo onchain game engine](https://book.dojoengine.org)
- React
### Testing & Linting

# Setup
- `pnpm test` - Run all tests
- `pnpm lint` - Run linting
- `pnpm format` - Format code
- `pnpm format:check` - Check code formatting

Install dojo via
### Contract Deployment

`curl -L https://install.dojoengine.org | bash`

Make sure install the same version within the `Scarb.toml` file.
Eternum supports multiple deployment environments:

Eternum uses a pnpm workspace and bun for scripts to allow easy npm packages to be created. So you will need pnpm
installed also.
| Environment | Description |
|-------------|-------------|
| Local | For development and testing |
| Slot | Staging environment |
| Sepolia | Public testnet |
| Mainnet | Production environment |

`npm install -g pnpm`
#### Deploying to Local

## Easy Method (3 commands)
Before deploying to any environment, confirm that you have a
`.env.{environment}` file in the `contracts/common` directory,
as well as in the `client/apps/game` directory. <br>

We have bundled up three scripts to run in three different CLI terminals. Run the scripts in order and leave the window
open.
To deploy and run the game locally:

### Terminal 1 - Client setup
```bash
# Start local game contracts
pnpm run contract:start:local
```

#### Deploying to Sepolia

This will set the client up, however you **must** run the other scripts otherwise it will not work
To deploy the contracts to Sepolia testnet, run these commands in order:

1. Deploy game contracts:

```bash
pnpm run game:migrate:sepolia
```
sh scripts/client.sh

2. Deploy season pass contracts:

```bash
pnpm run seasonpass:deploy:sepolia
```

### Terminal 2 - Build the contracts and run the sequencer
3. Deploy season resources contracts:

```bash
pnpm run seasonresources:deploy:sepolia
```
sh scripts/contracts.sh

4. Update TOML configuration:

```bash
pnpm run toml:update:sepolia
```

### Terminal 3 - Migrate the contracts and start the indexer
5. Start the indexer:

```bash
pnpm run indexer:start:sepolia
```
<!-- to set config & deploy test contracts -->
sh scripts/indexer.sh --setConfig --external

<!-- to set config -->
sh scripts/indexer.sh --setConfig
6. Deploy game configuration:

<!-- to just build and index -->
sh scripts/indexer.sh
```bash
pnpm run config:deploy:sepolia
```

## License
Expand Down

0 comments on commit 1d5d3c5

Please sign in to comment.