Deploy LASR Chess
This guide outlines the necessary steps to deploy your own LASR Chess instance. All the required steps are described below.
Step 1: Clone the LASR Chess Repository
Begin by cloning the LASR Chess project from the @versatus/laser-chess GitHub repository to your local machine:
git clone git@github.com:versatus/lasr-chess.git
Step 2: Building the Project
Since LASR Chess is already an initialized project, you only need to install and build it. Execute the following commands:
cd lasr-chess/lasr && npm install
There is no need to initialize the project using lasrctl init
as the LASR Chess project is pre-configured.
With the project installed, you need to build the program. Execute the commands below:
npx lasrctl build lasr-chess.ts
Step 3: Test your Program
Before trying to use the program, you should test it. It'll ensure the program functions correctly before deployment. Use this command to run the tests:
npx lasrctl test -b lasr-chess -i lasr-chess-inputs
All LASR Chess functions will be tested to ensure you won't face problems while trying the program. The output should look something like this:
...
All tests completed. Summary of results:
Test 1 (lasr-chess-accept-game.json): Passed
Test 2 (lasr-chess-create.json): Passed
Test 3 (lasr-chess-make-move.json): Passed
Test 4 (lasr-chess-new-game.json): Passed
Test 5 (lasr-chess-register-user.json): Passed
Test 6 (lasr-chess-update.json): Passed
Step 4: Deploy LASR Chess
Once all tests have passed, you are ready to deploy LASR Chess. Use the following command, which includes all necessary parameters for a successful deployment:
npx lasrctl deploy --build lasr-chess --programName CHESS --symbol CHESS --initializedSupply 5 --totalSupply 5
See the CLI or Deploy Configuration for additional information about the deploy.
After a successful deployment, the command line will provide a program address
. Make sure to save this address, as you will need it to run the frontend later.
What's Next?
With a successfully deployed LASR Chess program, you now can learn more about how the program was created, or go check out how to spin up the frontend to interact with LASR Chess: