Distributed network for Lishogi.org
git clone https://github.com/WandererXII/shoginet.git
cd shoginet
npm installNote: You must obtain and install engines before running Shoginet:
- Linux - from source: Use
./scripts/yaneuraou.shand./scripts/fairy.shto download and build engines yourself. Make sure you have a C/C++ compiler and build tools installed. It will take a few minutes per engine. - Ready to use binary: Make sure to download the correct version for your OS and CPU.
- YaneuraOu - YaneuraOu repo releases
- Fairy Stockfish - Fairy Stockfish website, download largeboard (all variants) version
Do not forget to check if path to engines is correct set (next step)
Configuration is stored in config directory. Write your own overrides to local.json.
Most importantly you want to make sure that engine path is correctly set. By default we look into engines directory. Yaneuraou engine default name is YaneuraOu-by-gcc and Fairy Stockfish default name is fairy-stockfish
Run tests first to make sure everything works, especially the engines:
npm run testIf tests pass successfully, you can start Shoginet directly by running:
npm run startYou will probably want to run Shoginet with a process manager. For systemd (Linux) integration:
node ./scripts/systemd.js | sudo tee /etc/systemd/system/shoginet.service > /dev/null
sudo systemctl daemon-reload
sudo systemctl start shoginet-
Start!
- Shoginet is initiated and fetches config from the server. The config sets parameters for move generation, analysis and puzzle verification.
-
Request work
- Shoginet -> Lishogi: "Give me work!"
-
Receive work
- Lishogi -> Shoginet: "Here's a game to analyse"
- The work could be analysis, move generation or puzle verification. Or nothing, if the queue is empty.
-
Process work
- Shoginet is analyzing the game...
- This consumes CPU
-
Submit Results
- Shoginet -> Lishogi: "Here are the analysis result"
-
Repeat
- Lishogi -> Shoginet: "Thanks, here's more work :)"
- Rinse & repeat
-
Stop
- Stop Shoginet when you need CPU power. Shoginet will try to finish the work in progress and only then exit, if you wish to abort immediately press CTRL^C again.