Skip to main content

Quickstart

Prepare the local environment

Once you have your base project, make sure you have all the tools to execute it:

  • Make sure you have npm or yarn:

    • Follow the instructions on https://nodejs.org/en/download
    • Install yarn if you prefer it over npm: npm install --global yarn
  • To be able to download the ethereal libraries you need access to the repository. For that you need to add a scope to your $HOME/.npmrc (if you are using npm) or $HOME/.yarnrc.yml (if you are using yarn). Your file will look like this:

npmScopes:
ethereal:
npmRegistryServer: "https://gitlab.com/api/v4/projects/67011212/packages/npm/"
npmAlwaysAuth: true
npmAuthToken: "<token_value>"

Replacing <token_value> with a valid token.

Tip

If you don't have a token, you can generate it by going to your User preferences > Access Tokens and create one with the following scopes: read_api, read_repository, write_repository, read_registry.

Setup the game

On your game project, make sure you have the library @ethereal/rgs-connect to have access to the ethereal API definitions as dev-dependency:

yarn add -D @ethereal/rgs-connect

Install the libraries:

yarn

Run the game

Execute:

yarn run dev

Open the game:

http://localhost:3000/index.html?gameId=<gameId>

Where:

  • <gameId>: Unique id of the game.

The final url will look like this:

http://localhost:3000/index.html?gameId=999

This will open the game in DEMO mode, so the game history will not be available.

Tip

To use a player, open the lab, select the casino, create a player, create a wallet with the currency and balance desired, open the Url Data section, copy the token from the Launch url and add it to your local url.

Tip

You can auto generate a new player adding on the url the casinoId parameter with value 3 and using any token using the token parameter and the ignoreToken parameter to false:

http://localhost:3000/index.html?gameId=3&casinoId=3&token=myPlayer&ignoreToken=false
warning

If you have a CORS problem opening the game in local, open the game using a browser with CORS disabled.