Skip to content

Getting Started

Akamig edited this page Feb 27, 2023 · 12 revisions

This document guides you through building and running the Nine Chronicles launcher (a.k.a. 9c-launcher) with the game on your own computer from scratch. Following this guide, you can play NineChronicles with a launcher connected to the mainnet that works like the released launcher. We hope you can easily start participating and/or contributing to Nine Chronicles from here.

Instructions

1. Environment

  • Windows 10 or 11 is recommended.
  • Linux/macOS also works, but the compatibility is not guaranteed.

2. Requirements

  • Node.js
    • LTS version is recommended. (In Aug. 2022, v16 is recommended)
  • yarn
  • Optional
    • curl

3. Cloning repository

Due to the usage of symbolic links and submodules, you need to use some flags when cloning. In case if you forgot to do so, follow the guides in the Troubleshooting section.

git clone https://github.com/planetarium/9c-launcher
cd 9c-launcher
git switch main  # In case you're contributing, skip this
git pull
yarn
yarn lefthook install # installs git hook for contributing, feel free to skip

4. Build 9c-launcher

yarn
yarn codegen # This generates GraphQL API codes for Apollo and etc.
yarn release

5. Config and run 9c-launcher

The launcher needs a configuration to tell the headless to which chain to use and how to set up and communicate with the desired chain. You can easily do this when if you're connecting to the mainnet.

yarn download-config 
or
curl https://release.nine-chronicles.com/9c-launcher-config.json -o dist/config.json

yarn codegen
yarn dev
# Press `Ctrl + C` on terminal to shut down the launcher
# This is IMPORTANT, causing launcher restart from UI while on yarn dev
# would cause orphaned electron process without main process, which 
# you need to find and kill process specifically otherwise next yarn dev will not work.
  • yarn download-config
    • Downloads the latest configuration of the mainnet, which allows you to use it just like a released launcher.
  • yarn codegen
    • Generates graphQL code from defined schema.

That's it! Enjoy the game with your own launcher! 🎮


Troubleshooting

Note In case you're using your customized source code or running under unsupported platform, this may not work but you can run the launcher itself.

yarn dev command exits with 0 (yarn start exited with code 0)

If you close the launcher on your taskbar, not terminal, this could happen when you run yarn dev again.

Fixing on Windows

  1. Open the Task Manager. - You can open it by pressing Ctrl + Shift + Esc.
  2. See details in Process tab, you can find the living Electron app. - If you see an instance of 'Nine Chronicles' they need to be terminated as well.
  3. Manually kill those living processes.
  4. The yarn dev should work now. - To prevent this, we recommend terminating the launcher with Ctrl + C.

References