Hello, Bolt!
To initialize a new project, simply run:
bolt init <new-workspace-name>
This creates a new bolt workspace you can move into. The following are some of the important files in the folder:
- The
.anchorfolder: It includes the most recent program logs and a local ledger that is used for testing - The
appfolder: An empty folder that you can use to hold your frontend if you use a monorepo - The
programsfolder: This folder contains your programs. It can contain multiple but initially only contains a program with the same name as<new-workspace-name>. This program already contains alib.rsfile with some sample code. - The
testsfolder: The folder that contains your E2E tests. It will already include a file that tests the sample code in theprograms/<new-workspace-name>. - The
migrationsfolder: In this folder you can save your deploy and migration scripts for your programs. - The
Anchor.tomlfile: This file configures workspace wide settings for your programs. Initially, it configures- The addresses of your programs on localnet (
[programs.localnet]) - A registry your program can be pushed to (
[registry]) - A provider which can be used in your tests (
[provider]) - Scripts that Anchor executes for you (
[scripts]). Thetestscript is run when runninganchor test. You can run your own scripts withanchor run <script_name>.
- The addresses of your programs on localnet (
Run the example unit test with the following command:
bolt test
This command will register a new World instance, create an entity, attach a component, and execute a system on it.
The test script is available as a reference under the tests folder.
Anchor
Bolt is built on top of Anchor and supports all Anchor commands, in addition to some extensions. For the complete list of Anchor commands, refer to the Anchor book.