Tuxman / dablchess

DABL Chess game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample code

This repo contains sample code to help you get started with DAML. Please bear in mind that it is provided for illustrative purposes only, and as such may not be production quality and/or may not fit your use-cases. You may use the contents of this repo in parts or in whole according to the BSD0 license:

Copyright © 2020 Digital Asset (Switzerland) GmbH and/or its affiliates

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

DABL Chess

License CircleCI

Welcome to DABL Chess! A DAML app that can be deployed to project:DABL. DABL Chess is a fog-of-war variant of Chess where you see only your pieces and where they can move. We demonstrate the power of DAML as the state of the two sides are encoded in separate smart contracts; what you know depends on DAML's ledger model, but you can still play via an intermediary.

Copyright (c) 2020, Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. SPDX-License-Identifier: 0BSD

Getting Started

Deploying to project:DABL.

1. Create a ledger to run DABL Chess on

Log in to project:DABL and create a new ledger under an existing or a new project.

2. Upload and deploy to DABL

Unzip and upload the three release files to your project:DABL collections. Then drag and drop the each one of them to your newly created ledger.

3. Set up your automation and UI

Click on your ledger and navigate to the Automation tab. Click on change next to Running as: and redeploy the bot as the UserAdmin party.

4. Log in and start playing!

You can find the subdomain url of your DABLChess app in the UI Assets tab. When you login, give yourself an alias so that you are discoverable to other players.

Developing

1. Prerequisites

2. Clone this repo

git clone https://github.com/digital-asset/dablchess.git

3. Start the game locally:

# A DAML in memory ledger, a sandbox
$ make start_daml_server
# An bot that listens to ledger requests and advances play.
$ make start_operator
# A React app that displays game logic.
$ make start_ui_server

or

$ make start_all

4. Release

$ make package

This will create a versioned dablchess-x.x.x.dar file containing the compiled DAML model, a dablchess-bot-x.x.x.tar.gz tarball containing the python automation, and a dablchess-ui-x.x.x.zip archive containing the UI static assets. These files will be zipped into a dabl-chess.zip under the target/ directory.

About

DABL Chess game

License:BSD Zero Clause License


Languages

Language:TypeScript 86.8%Language:Python 8.0%Language:Makefile 4.2%Language:HTML 1.0%