Sovrun Docs 2025
  • INTRO TO SOVRUN
    • Introduction to Sovrun
    • Autonomous Worlds
    • About Sovrun
      • Sovrun Genesis
      • Sovrun Labs
      • Sovrun Nexus
      • Case Study: Eve Frontier
      • Case Study: Plunder Quest
      • History of Sovrun (BreederDAO)
  • The SOVRN Token
    • About $SOVRN
    • Token Utility
    • $SOVRN Tokenomics
    • $SOVRN on EVM Chains
      • Ethereum
      • Hyperliquid
        • Network Info
          • Block Explorer
          • Acquiring test SOVRN
        • Sessionchains
      • Base
      • BREED to SOVRN Migration
  • Build with Sovrun
    • Chain Tactics
      • Who is Chain Tactics for?
      • Why Mod Chain Tactics?
      • Headless Client
      • Sovrun SDK
      • Game Phases
      • Game Mechanics
      • Game Architecture
      • Expanding Chain Tactics Across EVM-Compatible Chains
      • Chain Tactics Development Roadmap
      • Terminology
      • Getting Started Guides
        • Chain Tactics Local Development & Headless Client
        • Lightweight Unity Client
        • Chain Tactics Modding Tutorials
        • Troubleshooting Chain Tactics Local Development
    • ReadyGamer
      • Joint Venture
      • Services
      • Architecture
      • GAME Framework
      • ReadyGamer API
      • Integration Workflow
      • Roblox Integration
        • Roblox Demo Game - Carnival AI
        • AI Agent NPC's
        • Roblox AI Agent Module
          • Getting Started
          • Module Components
          • Creating a Smart NPC
          • Creating a Continuous Behaviour Script
  • More
    • Sovrun Website
Powered by GitBook
On this page
  1. Build with Sovrun
  2. Chain Tactics
  3. Getting Started Guides

Chain Tactics Local Development & Headless Client

PreviousGetting Started GuidesNextLightweight Unity Client

Last updated 7 days ago

Setup Chain Tactics for Local Development

Installation and Setup

  • Prerequisites:

    • To get started with the Chain Tactics Headless Client, ensure you have the following prerequisites installed and configured:

      • Smart Contract Dependencies:

        • Node.js (v20): Required for package management and script execution.

        • pnpm: Preferred package manager for handling dependencies efficiently.

        • Foundry: A powerful toolkit for developing, testing, and deploying smart contracts. Install via.

      • Headless Client Dependencies:

        • .NET 9: The runtime required for executing the headless client written in C#.

  • Installation Steps & Setup:

    • Unix/Linux Setup:

      • Install npm version 20.

      • Install Foundry:.

      • Clone: git clone .

      • Run the build_and_run_contract.sh script to deploy the solidity smart contracts to local node.

      • Run the build_and_run_server.sh script to start the server. (Note: On MacOS you may need to enable extra permissions via Apple settings and use the following command sh build_and_run_server.sh )

      • Go to ./tactics-war-sc/packages/contracts/.env and update the following variables:

        • RPC_URL=http://127.0.0.1:8545 # local chain

        • CHAIN_ID=31337 # local default chain ID

        • PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # local default anvil account

      • Note: You may change the configurations above to use another chain network (e.g., for testnet, update RPC_URL to https://testnet-12-rpc-hyperliquid.sovrun.org/http).

    • Windows Setup:

      • The same as Unix/Linux setup above, but scripts should be run on Git Bash.

Upon running both scripts, you will now how two terminals with similar output to the following:

Game Installation:

  • Download the installer (link provided separately).

  • Run and launch the game, then click "Find Match" to play.

Using the Headless Client

  • Initialization:

    • var client = new CTServerContext("http://127.0.0.1:8545");

  • Key APIs:

    • GetUnits(): Retrieves units on the board.

    • GetAvailableMoves(): Lists possible moves.

    • ExecuteMove(move): Submits a move to the blockchain.

  • Example: List Units:

using Sovrun.CTServer; class UnitLister { static void Main() { var client = new CTServerContext("http://127.0.0.1:8545"); var units = client.GetUnits(); foreach (var unit in units) { Console.WriteLine(unit.Name); } } }

  • Note: .NET Standard and Python Bindings are also supported for additional integration options.

How to Run the Terminal DOTNET Test Implementation Locally

Testing of the DOTNET server, smart contracts, and local anvil network can be tested via terminal. This is useful for confirming all configurations and code interoperates successfully, before testing on external testnets and mainnets.

  1. Once you have run the DOTNET server and deployed the smart contracts successfully in separate terminal windows (see Installation), navigate to /tactics-war-server/CTClientExample folder.

  2. Run the following command in a third terminal window:

dotnet run --framework net9.0 http://127.0.0.1:8545 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 0x8d8b6b8414e1e3dcfd4168561b9be6bd3bf6ec4b

  1. In terminal window 4, run the same command, but with the second Anvil default private key:

dotnet run --framework net9.0 http://127.0.0.1:8545 59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d 0x8d8b6b8414e1e3dcfd4168561b9be6bd3bf6ec4b

build_and_run_contract.sh expected output
build_and_run_server.sh expected output
https://book.getfoundry.sh/getting-started/installation
https://book.getfoundry.sh/getting-started/installation
https://github.com/sovrun/chain-tactics-server