Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updated development instruction for every dapp-tutorials #291

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 82 additions & 6 deletions docs/quick-start/developers/_deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ aelf-command create

- Next, enter and confirm your password. Then export your wallet password as shown below:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export WALLET_PASSWORD="YOUR_WALLET_PASSWORD"
```
</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
vasmohi marked this conversation as resolved.
Show resolved Hide resolved
$env:WALLET_PASSWORD = "YOUR_WALLET_PASSWORD"
```
</TabItem>
</Tabs>

#### Acquire Testnet Tokens (Faucet) for Development

Expand All @@ -44,25 +54,64 @@ import TabItem from '@theme/TabItem';

To receive testnet ELF tokens, run this command after replacing `$WALLET_ADDRESS` and `$WALLET_PASSWORD` with your wallet details:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export WALLET_ADDRESS="YOUR_WALLET_ADDRESS"
curl -X POST "https://faucet.aelf.dev/api/claim?walletAddress=$WALLET_ADDRESS" -H "accept: application/json" -d ""
```
</TabItem>

<TabItem value="Windows" label="Windows">

```bash title="Terminal"
$headers = @{
"accept" = "application/json"
}

$env:WALLET_ADDRESS = "YOUR_WALLET_ADDRESS"

Invoke-WebRequest -Uri "https://faucet.aelf.dev/api/claim?walletAddress=$env:WALLET_ADDRESS" -Method POST -Headers $headers -Body ""
```

</TabItem>
</Tabs>

**2. Check ELF Balance:**

To check your ELF balance, use:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $WALLET_ADDRESS -p $WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
```
</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
```
</TabItem>
</Tabs>

You will be prompted for the following:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```sh title="Terminal"
Enter the required param <symbol>: ELF
Enter the required param <owner>: **$WALLET_ADDRESS**
```
</TabItem>
vasmohi marked this conversation as resolved.
Show resolved Hide resolved

<TabItem value="Windows" label="Windows">
```sh title="Terminal"
Enter the required param <symbol>: ELF
Enter the required param <owner>: "YOUR_WALLET_ADDRESS"
```
</TabItem>
</Tabs>

You should see the result displaying your wallet's ELF balance.

Expand All @@ -80,8 +129,10 @@ Go to https://faucet-ui.aelf.dev Enter your address and click `Get Tokens`.

The smart contract needs to be deployed on the chain before users can interact with it.

Run the following command to deploy a contract. Remember to export the path of LotteryGame.dll.patched to CONTRACT_PATH.
Run the following command to deploy a contract. Remember to export the path of ToDoApp.dll.patched to CONTRACT_PATH.
vasmohi marked this conversation as resolved.
Show resolved Hide resolved

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export CONTRACT_PATH=$(find ~+ . -path "*patched*" | head -n 1)
```
Expand All @@ -90,17 +141,42 @@ export CONTRACT_PATH=$(find ~+ . -path "*patched*" | head -n 1)
aelf-deploy -a $WALLET_ADDRESS -p $WALLET_PASSWORD -c $CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
```

</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
$CONTRACT_PATH = Get-ChildItem -Recurse -Filter "*patched*" | Select-Object -First 1 -ExpandProperty FullName
$env:CONTRACT_PATH = $CONTRACT_PATH
```

```bash title="Terminal"
aelf-deploy -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -c $env:CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
```

</TabItem>
</Tabs>

- Please wait for approximately 1 to 2 minutes. If the deployment is successful, it will provide you with the contract address.
![result](/img/deploy-result.png)
![result](/img/deploy-result.png)

- Copy the smart contract address from the `address` field
![result](/img/Contract_Address.png)
![result](/img/Contract_Address.png)

- Export your smart contract address:

```bash title="Terminal"
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
```
<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
```
</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
$env:CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
```
</TabItem>
</Tabs>

:::tip
ℹ️ Note: You are to copy the smart contract address as we will be referencing it in the next steps!
Expand Down
88 changes: 82 additions & 6 deletions docs/quick-start/developers/_deploy_expense_tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ aelf-command create

- Next, enter and confirm your password. Then export your wallet password as shown below:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export WALLET_PASSWORD="YOUR_WALLET_PASSWORD"
```
</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
$env:WALLET_PASSWORD = "YOUR_WALLET_PASSWORD"
```
</TabItem>
</Tabs>

#### Acquire Testnet Tokens (Faucet) for Development

Expand All @@ -44,25 +54,64 @@ import TabItem from '@theme/TabItem';

To receive testnet ELF tokens, run this command after replacing `$WALLET_ADDRESS` and `$WALLET_PASSWORD` with your wallet details:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export WALLET_ADDRESS="YOUR_WALLET_ADDRESS"
curl -X POST "https://faucet.aelf.dev/api/claim?walletAddress=$WALLET_ADDRESS" -H "accept: application/json" -d ""
```
</TabItem>

<TabItem value="Windows" label="Windows">

```bash title="Terminal"
$headers = @{
"accept" = "application/json"
}

$env:WALLET_ADDRESS = "YOUR_WALLET_ADDRESS"

Invoke-WebRequest -Uri "https://faucet.aelf.dev/api/claim?walletAddress=$env:WALLET_ADDRESS" -Method POST -Headers $headers -Body ""
```

</TabItem>
</Tabs>

**2. Check ELF Balance:**

To check your ELF balance, use:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $WALLET_ADDRESS -p $WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
```
</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
```
</TabItem>
</Tabs>

You will be prompted for the following:

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```sh title="Terminal"
Enter the required param <symbol>: ELF
Enter the required param <owner>: **$WALLET_ADDRESS**
```
</TabItem>
vasmohi marked this conversation as resolved.
Show resolved Hide resolved

<TabItem value="Windows" label="Windows">
```sh title="Terminal"
Enter the required param <symbol>: ELF
Enter the required param <owner>: "YOUR_WALLET_ADDRESS"
```
</TabItem>
</Tabs>

You should see the result displaying your wallet's ELF balance.

Expand All @@ -80,8 +129,10 @@ Go to https://faucet-ui.aelf.dev Enter your address and click `Get Tokens`.

The smart contract needs to be deployed on the chain before users can interact with it.

Run the following command to deploy a contract. Remember to export the path of ExpenseTracker.dll.patched to CONTRACT_PATH.
vasmohi marked this conversation as resolved.
Show resolved Hide resolved
Run the following command to deploy a contract. Remember to export the path of ToDoApp.dll.patched to CONTRACT_PATH.

<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export CONTRACT_PATH=$(find ~+ . -path "*patched*" | head -n 1)
```
Expand All @@ -90,17 +141,42 @@ export CONTRACT_PATH=$(find ~+ . -path "*patched*" | head -n 1)
aelf-deploy -a $WALLET_ADDRESS -p $WALLET_PASSWORD -c $CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
```

</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
$CONTRACT_PATH = Get-ChildItem -Recurse -Filter "*patched*" | Select-Object -First 1 -ExpandProperty FullName
$env:CONTRACT_PATH = $CONTRACT_PATH
```

```bash title="Terminal"
aelf-deploy -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -c $env:CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
```

</TabItem>
</Tabs>

- Please wait for approximately 1 to 2 minutes. If the deployment is successful, it will provide you with the contract address.
![result](/img/deploy-result.png)
![result](/img/deploy-result.png)

- Copy the smart contract address from the `address` field
![result](/img/Contract_Address.png)
![result](/img/Contract_Address.png)

- Export your smart contract address:

```bash title="Terminal"
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
```
<Tabs>
<TabItem value="Linux and macOs" label="Linux and macOs" default>
```bash title="Terminal"
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
```
</TabItem>

<TabItem value="Windows" label="Windows">
```bash title="Terminal"
$env:CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
```
</TabItem>
</Tabs>

:::tip
ℹ️ Note: You are to copy the smart contract address as we will be referencing it in the next steps!
Expand Down
Loading