npm.io
0.8.1 • Published 6 years agoCLI

remote-chess-engine

Licence
MIT
Version
0.8.1
Deps
8
Size
50 kB
Vulns
0
Weekly
0
Stars
3

Remote Chess Engine

Build Status Coverage Status npm version

Remote Chess Engine, ready to process position analysis tasks via Remote Interface for Chess Positions Analysis (RICPA)

Install

npm install -g remote-chess-engine

Configure

create config/local.json with the following properties, setting valid path and values:

{
  "pathToEngine": "stockfish_9_x64.exe",
  "uciOptions": [{"name":"Threads", "value":3}, {"name": "Hash", "value": 4096}],
  "port": 9977,
  "evaluationsFile": "evaluations.json",
  "queueFile": "queue.json",
  "historyFile": "history.json"
}

Run

remote-chess-engine

API

GET /fen: input - fen, depth. Returns bestMove for this fen and depth or placeInQueue and estimatedTime when answer could be provided. If fen is not analyzed and is not in queue, returns {bestMove: underfined, placeInQueue: undefined, estimatedTime: underfined}

POST /fen - posts fen for analysis with specified depth at the end of a queue, triggers analysis from the top of queue if nothing is being analyzed now

  • fen - FEN of chess position
  • depth - depth to analyze
  • pingUrl - url to execute get call when analysis finished
  • returns place in queue starting from 0 and estimated time to analyze ({placeInQueue, estimatedTime})

DELETE /fen - delete specified fen from the queue. Input - fen.

GET /queue - gets queue as [{fen, depth, estimatedTime}, ...]