Gameroom

Gameroom is an example Splinter application that allows you to set up private, multi-party circuits (called “gamerooms”) and play tic tac toe with shared state, as managed by two-phase commit consensus between the participants. This example application, as configured, sets up Splinter nodes for two imaginary organizations: Acme Corporation and Bubba Bakery.

To learn about the Splinter functionality that powers this deceptively simple application, see the Gameroom Technical Walkthrough.

Running the Gameroom Demo with Docker

Note: For the Kubernetes instructions, see Running the Gameroom demo in Kubernetes.

This demo uses the Sabre smart contract engine provided in Sawtooth Sabre and the XO smart contract provided in the Sawtooth Rust SDK.

Prerequisites: This demo requires Docker Engine and Docker Compose.

Note: To run the demo with prebuilt images from Docker Hub, replace docker-compose.yaml with docker-compose-dockerhub.yaml in all commands below.

  1. Clone the splinter repository.

  2. To start Gameroom, run the following command from the Splinter root directory:

    $ docker-compose -f examples/gameroom/docker-compose.yaml up --build
    

    Note: To run Gameroom with experimental features enabled, set an environment variable in your shell before running the command above. For example: export 'CARGO_ARGS= --features experimental'. To go back to building with default features, unset the environment variable: unset CARGO_ARGS

  3. To extract private keys to use in the web application, run bash using the generate-registry image and read the private key. For example, to get Alice’s private key:

    $ docker-compose -f examples/gameroom/docker-compose.yaml run generate-registry bash
    root@<container-id>:/# cat /registry/alice.priv
    <the private key value>
    root@<container-id>:/#
    

    The keys available are alice and bob.

  4. In a browser, navigate to the web application UI for each organization:

  5. When you are finished, shut down the demo with the following command:

    $ docker-compose -f examples/gameroom/docker-compose.yaml down