Skip to content

Commit fe29a73

Browse files
committed
Use dapp templates
1 parent 1599515 commit fe29a73

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

Diff for: docs/dapps/ecosystem.md

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ sidebar_label: Ecosystem
1010
- [Local Devnet](https://github.com/alephium/alephium-stack#devnet) (explorer included)
1111
- Public APIs for mainnet and testnet are documented [here](/infrastructure/public-services#api-aliases)
1212

13+
## Templates
14+
15+
- [Node.js template](https://github.com/alephium/nodejs-dapp-template)
16+
- [Next.js template](https://github.com/alephium/nextjs-dapp-template)
17+
- [React template](https://github.com/alephium/react-dapp-template)
18+
1319
## dApp SDK
1420
- [@alephium/web3](https://www.npmjs.com/package/@alephium/web3)
1521
- [@alephium/web3-wallet](https://www.npmjs.com/package/@alephium/web3-wallet)

Diff for: docs/dapps/index.md

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ SDK](/sdk/getting-started), which offers powerful tools to
1212
interact with the blockchain and a developer friendly framework
1313
for compiling, testing and deploying smart contracts.
1414

15+
## Getting Started with a template
16+
17+
The easiest way to get started with building dApps on Alephium is to use one of the available templates.
18+
19+
* [Node.js template](https://github.com/alephium/nodejs-dapp-template): A simple faucet dApp built with Node.js.
20+
* [Next.js template](https://github.com/alephium/nextjs-dapp-template): A simple faucet dApp built with Next.js.
21+
* [React template](https://github.com/alephium/react-dapp-template): A simple react template.
22+
23+
## Concepts and Standards
24+
1525
Here, you'll find information on high-level
1626
[concepts](/dapps/concepts/overview) and
1727
[standards](/dapps/standards/fungible-tokens), as well as practical

Diff for: docs/dapps/tutorials/quick-start.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you experience slowness with `npm` and `npx`, consider give
2929
To create the tutorial project, open a new terminal and run:
3030

3131
```shell
32-
npx @alephium/cli@latest init alephium-tutorial
32+
git clone https://github.com/alephium/nodejs-dapp-template alephium-tutorial
3333
```
3434

3535
This will create a new directory `alephium-tutorial` and initialize a sample project inside that directory.
@@ -51,7 +51,7 @@ through REST endpoints.
5151
Next, change the workspace to the tutorial project:
5252

5353
```
54-
cd alephium-tutorial
54+
cd alephium-tutorial && npm install
5555
```
5656

5757
In the `contracts/` folder, you will find `token.ral` and `withdraw.ral`:
@@ -153,7 +153,7 @@ TxScript Withdraw(token: TokenFaucet, amount: U256) {
153153
To compile your contracts, run:
154154

155155
```
156-
npx @alephium/cli@latest compile
156+
npm run compile
157157
```
158158

159159
The compiled artifacts are in the `artifacts` directory. This command also generates Typescript code based on the compiled artifacts, which is in the `artifacts/ts` directory. You can use the generated Typescript code to interact with the alephium blockchain more conveniently.
@@ -215,12 +215,6 @@ You can run the tests with:
215215
npm run test
216216
```
217217

218-
or
219-
220-
```
221-
npx @alephium/cli@latest test
222-
```
223-
224218
## Deploy your contract
225219

226220
To deploy the contract, use Alephium CLI and a deployment script `scripts/0_deploy_faucet.ts`:
@@ -266,13 +260,13 @@ export default deployFaucet
266260
You can run the deployment script with:
267261

268262
```
269-
npx @alephium/cli@latest deploy
263+
npm run deploy
270264
```
271265

272266
This will deploy the token faucet to group 0 of devnet. To deploy on testnet (or any other network), update your `alephium.config.ts` and use the `--network` option:
273267

274268
```
275-
npx @alephium/cli@latest deploy --network testnet
269+
npm run deploy --network testnet
276270
```
277271

278272
## Interact with the deployed contract

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
"devDependencies": {
4242
"node-fetch": "^2.6.7",
4343
"prettier": "2.6.0"
44-
}
44+
},
45+
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
4546
}

0 commit comments

Comments
 (0)