The previous section Create Static Blocklets introduced in detail how to create a static blocklet that can be deployed and run in ABT Node from scratch. This section is about creating and deploying a DApp blocklet from scratch in ABT Node.
- First, set up Node.js development environment.
- Then, install Forge CLI.
- Next, initialize and run ABT Node.
- Finally, install MongoDB and run it locally.
We will use the
forge blocklet:use forge-react-starter command in
forge cli to generate a Dapp Blocklet template
- First, create a project directory and enter it.
forge blocklet:use forge-react-starterwill be run from this directory
mkdir dapp-blocklet-demo cd dapp-blocklet-demo
- Next, run
forge blocklet:use forge-react-starterto complete the creation of the template project.
For the steps here, please refer to the document: Use Starter Blocklet
- Then, run the project.
yarn start in the project's main directory to run the project.
After the generated template project is successfully configured, it can run locally.
Ctrl+C to stop the local test process, and then execute the
abtnode deploy . command.
After the deployment succeeded, take a look at the ABT Node
Corner Program page.
If we directly click on the More menu on the far right of
dapp blocklet demo, the gray button cannot be clicked when
Start button will appear. The appearance of the
Start button indicates that our DApp needs some configure. Click
on the details page.
MONGO_URI as local:
Click to open the three dots on the right side of the just deployed
dapp blocklet demo, and select
The blocklet should now be in the
running state. Click on the
public interface to verify that it's running:
We have now successfully created a DApp blocklet in ABT Node.