This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create the base project folder | |
| mkdir projectFolder | |
| cd projectFolder | |
| # create the backend project structure | |
| mkdir -p backend/src/backend | |
| mkdir backend/dist | |
| # create the frontend project structure | |
| ng new frontend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| touch dfx.json | |
| { | |
| "canisters": { | |
| "backend": { | |
| "main": "src/backend/main.mo", | |
| "type": "motoko" | |
| }, | |
| "frontend": { | |
| "dependencies": [ | |
| "backend" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| touch backend/src/backend/main.mo | |
| actor { | |
| public func greet(name : Text) : async Text { | |
| return "Hello, " # name # "!"; | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in terminal 1 | |
| dfx start -clean | |
| # your local IC replica is running | |
| >Mar 16 09:56:47.497 INFO Starting server. Listening on http://127.0.0.1:8000/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dfx build backend - check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dfx deploy backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dfx canister call backend greet '("RockStar")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dfx generate backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd projectFolder/frontend | |
| ng new frontend | |
| cd frontend |
OlderNewer