FYP
2022-09-01 20:00:00

Local Deployment

To run the newly created project, we can setup a local execution environment by:

# at the root directory of the project
dfx start
# or to run in background:
dfx start --background

This operation require the use of port 8000.

This environment is not a full IC replica, nor does it download any of the state of an IC replica. It is a lightweight environment designed exclusively for deploying dapps.

After the logs successfully displayed, we can register, build, and deploy the project by:

# at the root directory of the project
dfx deploy

To verify the deployment:

dfx canister call fyp_backend greet everyone
# OUTPUT: ("Hello, everyone!")

To test the dapp locally via the browser:

npm start

Open a browser and navigate to http://localhost:8080/.

To stop the execution environment, ctrl+c or:

dfx stop

References

Some information in this note come from the following external links: