Skip to content

yetanotherco/zk_arcade

Repository files navigation

ZK_Arcade

Zk arcade repo

Games

Installation

To install Beast, run the following command:

curl -L https://raw.githubusercontent.com/yetanotherco/zk_arcade/main/install_beast.sh | bash

Requirements

  • Rust
  • Elixir
  • Node.js
  • Docker
  • Foundry

Run Locally

  1. You need to run Aligned locally.

  2. Make sure you are running Docker.

  3. Send funds to your wallet from anvil pre-funded account with:

    cast send <YOUR_WALLET_ADDRESS> --value 10ether --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8545
    
  4. Add the devnet network to your wallet using the following parameters:

  5. Deploy the Leaderboard contract with:

    make deploy_contract NETWORK=devnet
    
  6. Set the Contract proxy address in web/config/dev.exs:

    config :zk_arcade, :leaderboard_address, "<COMPLETE_ADDRESS_FROM_OUTPUT>"
  7. Start the server:

    make web_run
    

Other commands

If you want to clean the database, run:

web_clean_db

Deployment

First Deploy

As admin user, run:

cd /tmp
git clone [email protected]:yetanotherco/zk_arcade.git
cd zk_arcade
make debian_deps DB_PASSWORD=<>
make release
make release_install

As app user, run:

  1. cd to the repo
cd zk_arcade
  1. Generate a SECRET_KEY_BASE with:
MIX_ENV=prod mix phx.gen.secret
  1. Create the env file, depending on the network:
  • mainnet
make create_env_mainnet DB_PASSWORD=<> SECRET_KEY_BASE=<> PHX_HOST=<> NEWRELIC_KEY=<>
  1. Run the service with:
make create_service

Redeployments

As admin user, run:

cd /tmp
git clone [email protected]:yetanotherco/zk_arcade.git
cd zk_arcade
make release
make release install

As app user, run:

systemctl restart zk_arcade --user