Giter Site home page Giter Site logo

cleancoindev / holochess Goto Github PK

View Code? Open in Web Editor NEW

This project forked from holochain/holochess

0.0 0.0 0.0 1.08 MB

Experimental P2P chess game built on Holochain & Javascript

License: GNU General Public License v3.0

Batchfile 0.42% JavaScript 91.88% CSS 2.74% HTML 4.96%

holochess's Introduction

Holochess

License: GPL v3

Code-Status: Playable asynchronous P2P chess games with no time limit.

Holochess is a work in progress, sample application built with Holochain and javascript (jQuery). It's purpose is to learn and experiment holochain app building.

Chess logic is handled by chess.js Board display is handled by chessboard.js Overall UI is made with Twitter Bootstrap v3.3.7

Screenshots

Installation & Usage

Prerequiste: Install holochain on your machine and make sure you do the step to set the $GOPATH.

To see Holochess in action, the fastest way is to locally run 2 instances of Holochess and your own Bootstrap server:

  • Download the latest release from Holochess Release
  • unzip it and make 2 copies of the contents into folders called holochess1 and holochess2. Both folders will have a dna folder and a ui folder in each.

Run the bootstrap server which will let each instance of Holochess know about its peers. The bs command is part of the Holochain install. If it doesn't work you probably need to set the $GO_PATH variable.

  bs

You will get a response like

2018/01/11 11:24:03 app version: 0.0.2; Holochain bootstrap server
2018/01/11 11:24:03 starting up on port 3142

Now start up Holochess in each folder.

  cd holochess1
  hcdev -DHTport=6001 -agentID=alex -mdns=true -bootstrapServer=localhost:3142 web 3141

  cd ..
  cd holochess2
  hcdev -DHTport=6002 -agentID=billy -mdns=true -bootstrapServer=localhost:3142 web 4141

You will see a response like:

Copying chain to: /Users/ddd-mtl/.holochaindev
Serving holochain with DNA hash:QmdfWYCujsbBDd5NwHMsBZtcEfb5yDFuZHSPphh9MdWyuU on port:3141

Now open a browser at http://localhost:3142/QmdfWYCujsbBDd5NwHMsBZtcEfb5yDFuZHSPphh9MdWyuU (substituting in the DNA hash from the response above if different) and look at the Bootstrap server. You will see 2 records like this

  [{"Req":{"Version":1,"NodeID":"QmdfWYCujsbBDd5NwHMsBZtcEfb5yDFuZHSPphh9MdWyuU","NodeAddr":"/ip4/0.0.0.0/tcp/6003"},"Remote":"[::1]:63187","LastSeen":"2018-03-11T12:32:15.659887156+11:00"},{"Req":{"Version":1,"NodeID":"QmdfWYCujsbBDd5NwHMsBZtcEfb5yDFuZHSPphh9MdWyuU","NodeAddr":"/ip4/0.0.0.0/tcp/6002"},"Remote":"[::1]:63153","LastSeen":"2018-03-11T12:28:40.85765899+11:00"}]

Now open a browser to http://localhost:3141 and you will see Holochess. Open another tab to http://localhost:4141 to see the second instance. Each instance should see the other agent's name in the Players list. You now have 2 instances of Holochess that can interact. Challenge an opponent to create a game and submit your move to start a P2P chess game!

Feature Roadmap

  • Set default handle from AgentID string
  • View all player handles
  • View all my games
  • Play a public chess game
  • Chess Move validation on Zome
  • Play a private chess game
  • Enable users to change their handle
  • Filter my games by status (finished, pending challenge, active, etc)
  • Search and view any public game
  • Game scrubbing & playback
  • User profile (first name, last name, location, picture, website, etc.)
  • User UI preferences (background color, board colors, chess piece set, etc.)
  • Integrate with DPKI for bridging app contexts
  • Integrate with chat for bridging app contexts
  • Time sensitive chess games
  • Random player start with cointoss
  • Multilingual
  • Notifications - somehow

Development

Design

See /specs for in depth design & architecture documentation

Tests

To run all the stand alone DNA tests:

hcdev test

Feedback

Any feedback is welcome. Find me on Holochain's Mattermost. My handle is @damien

License

License: GPL v3

This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (GPLv3). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

holochess's People

Contributors

ddd-mtl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.