{"id":13651307,"url":"https://github.com/broadcastmonkey/ChessOnGolem","last_synced_at":"2025-04-22T22:30:58.390Z","repository":{"id":208883883,"uuid":"321377499","full_name":"broadcastmonkey/ChessOnGolem","owner":"broadcastmonkey","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-29T19:36:14.000Z","size":2983,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T01:59:00.624Z","etag":null,"topics":["golem"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broadcastmonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"authors.jpg"}},"created_at":"2020-12-14T14:42:58.000Z","updated_at":"2023-09-22T08:42:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"c059ab2c-7353-44b6-b954-42263ce2b969","html_url":"https://github.com/broadcastmonkey/ChessOnGolem","commit_stats":null,"previous_names":["broadcastmonkey/chessongolem"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadcastmonkey%2FChessOnGolem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadcastmonkey%2FChessOnGolem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadcastmonkey%2FChessOnGolem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broadcastmonkey%2FChessOnGolem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broadcastmonkey","download_url":"https://codeload.github.com/broadcastmonkey/ChessOnGolem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223906215,"owners_count":17223045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golem"],"created_at":"2024-08-02T02:00:47.783Z","updated_at":"2024-11-10T02:30:46.676Z","avatar_url":"https://github.com/broadcastmonkey.png","language":"JavaScript","funding_links":[],"categories":["Apps","Archive"],"sub_categories":["Games","Apps"],"readme":"## Chess on Golem\n\n### Summary\n\nThis project was created as an entry to Golem Hackathon 12/2020.\n\nThe other part of project - Chess on Golem Viewer (react app that works as a GUI for Chess on Golem ) can be viewed here:\nhttps://github.com/broadcastmonkey/ChessOnGolemViewer\n\nIt's purpose is to show that any state based game / problem can be run in Golem Network and solved interactively by provider nodes.\n\nThis particular example shows classical chess game played by two AI players that facilitate golem network for computing.\n\nWhole game is managed by Node.js server which distributes chess computing tasks across Golem Network providers.\n\nEach move request is sent to Golem Market and calculated by provider with best bid.\n\nThe aim is to show how computing power may affect the outcome of the game.\n\nRight now the depth is fixed by allowing particular players to calculate moves with specific search depth. In youtube demos white player plays with depth of 17 / 20 and black player plays with depth of 1.\n\nIn future with more providers in the Golem Network particular players may parallelize their calculations by using more or less providers to achieve better or worse moves in shorter time. It would also probably impact of final cost of game for each player.\n\nHybrid strategies might be also used, e.g.: use more computing power at the beginning of the game and less computing power in the endgame.\n\n### DEMO's\n\n\nDemo v0.3 // january 2021\nhttps://www.youtube.com/watch?v=Wp_lJEeN7UA\u0026feature=youtu.be\u0026ab_channel=Pawe%C5%82Burgchardt\n\nDemo v0.2 // january 2021\nhttps://www.youtube.com/watch?v=C65uTAZAsRA\u0026list=UUxg1Vq50vwy7Pm3kFwb0ZQg\u0026index=2\u0026ab_channel=Pawe%C5%82Burgchardt\n\nDemo v0.1 // january 2021 (problem with some providers' payments ==\u003e invoices that are way too huge)\nhttps://www.youtube.com/watch?v=cTD0zq7jURM\u0026list=UUxg1Vq50vwy7Pm3kFwb0ZQg\u0026index=3\u0026ab_channel=Pawe%C5%82Burgchardt\n\nPresentation:\nhttp://developed.home.pl/chessongolem.pdf\n\n### Subprojects used in development\n\n#### Node Chess App\n\nNode.js Server (can be run on linux or windows machines) that is responsible for handling chess game and requesting Golem Network for aid with calculating next moves for each AI player. Moves are calculated on Node alpine docker image transformed to .gvim with a help of a stockfish.js chess engine.\n\nNode chess app creates a request to golem network for each move that is being performed by AI players. For demo purposes one player asks for best move with depth precision of 20 and the other one uses depth of 1.\n\nThis can be changed in chess/index.js on line 32:\n\nmoveData.depth = moveData.turnId == \"w\" ? 20 : 1;\n\nTypical calculation times:\\\nDepth \\\n \u003c 10 =\u003e \u003c 1s\\\n~ 20 =\u003e ~ 3s\\\n~ 30 =\u003e ~ 157s\n\nExample of a file with task description that is sent to Golem Providers:\n\n//--------\\\nhash_00000132_0003\\\n20\\\nposition fen rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w KQkq d6 0 2\\\n//--------\n\nLine 1 : id of an operation used to distinguish different tasks by chess server.\\\nLine 2 : contains depth that stockfish.js algorithm needs to consider.\\\nLine 3: describes current chess game state in fen notation.\n\nCorrect output should look similar to this file:\n\n//--------\\\nbestmove e4d5 ponder g8f6\\\nexec time:8672.225822\\\ndepth:20\\\nhash:hash_00000132_0003\\\n//--------\n\nWith lines describing suggested move, calculation time[ms], depth of calculations and operation id.\n\nNode Chess app is also used as backend server for GUI App that displays chess game in real time with some statistics regarding provider nodes work.\n\nDemo of Node Chess app currently runs at http:// 20.52.154.16/3970 on Linux Ubuntu VM in MS Azure cloud.\n\nTo run Node Chess app please do the following:\n\ncd chess\\\nyarn install\\\nyarn js:chess\n\nScript runs until game is finished, when some calculation fails or timeouts golem network is being asked to perform it again.\n\nMultiple clients can connect to socket.io websocket server and listen for events that describe current game state\n\nEvents:\\\n• currentTurnEvent\\\n• providerFailed\\\n• computationStarted\\\n• movesRefreshed\\\n• gameFinished\\\n• offersReceived\\\n• agreementCreated\\\n• agreementConfirmed\\\n• computationFinished\\\n• invoiceReceived\\\n• moveEvent\\\n• positionEvent\n\nWhen client reconnects server sends him automatically current state of the game.\n\n#### Chess on Golem Viewer\n\nReact application that serves as GUI for displaying chess game progress for Chess on Golem.\n\nIt displays game progress and some interesting stats regarding provider nodes that took part in calculations.\n\nThere is live app available at:\nhttps://chessongolem.app\n\nIf It's not currently running you can request start at pawel.burgchardt [ A-T] gmail.com\n\nYou can run it locally by going to chess-viewer folder and executing\n\nnpm install\\\nnpm start\n\nYou can then open the browser and see the result at http://localhost:3000/\n\nChess on Golem Viewer connects automatically to node chess app server on 127.0.0.1:3970\n\nTo change it please update .env.development file\n\n//------\\\nREACT_APP_NAME=Chess on Golem 1\\\nREACT_APP_VERSION=0.0.1\\\nREACT_APP_SOCKET_SERVER_URL=http://127.0.0.1:3970/ \\\nREACT_APP_API_URL=http://127.0.0.1:3970/api \\\n//------\n\n## SET UP\n\n- node 12\n- yagna daemon\n- run yarn install / yarn js:chess in chess folder\n- run npm install / npm start in chess-viewer folder\n- enjoy chess game played by two golem AIs at http://localhost:3000/\n\n## Potential growth\n\n- player vs golem mode\n- other state based games implemented\n- golem network tests for interactive tasks\n\n### Used framewroks / libraries\n\n- Node.js / udner MIT license\n- React / under MIT license\n- Bootstrap / under MIT license\n- Chess.js / under BSD license\n- Chessboard.jsx / under MIT license\n- Socket.io / under MIT license\n- stockfish.js / under GNU General Public License\n\n# License\n\nProject is licensed under GPLv3 license.\n\n# Author\n\nPaweł Burgchardt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroadcastmonkey%2FChessOnGolem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroadcastmonkey%2FChessOnGolem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroadcastmonkey%2FChessOnGolem/lists"}