Skip to content

Commit 353cd1d

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents ee302b6 + 130afed commit 353cd1d

File tree

13 files changed

+792
-119
lines changed

13 files changed

+792
-119
lines changed

docs/quick-start/developers/_deploy.md

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,19 @@ aelf-command create
2424

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

27+
<Tabs>
28+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
2729
```bash title="Terminal"
2830
export WALLET_PASSWORD="YOUR_WALLET_PASSWORD"
2931
```
32+
</TabItem>
33+
34+
<TabItem value="Windows" label="Windows">
35+
```bash title="Command Prompt"
36+
$env:WALLET_PASSWORD = "YOUR_WALLET_PASSWORD"
37+
```
38+
</TabItem>
39+
</Tabs>
3040

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

@@ -44,18 +54,46 @@ import TabItem from '@theme/TabItem';
4454

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

57+
<Tabs>
58+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
4759
```bash title="Terminal"
4860
export WALLET_ADDRESS="YOUR_WALLET_ADDRESS"
4961
curl -X POST "https://faucet.aelf.dev/api/claim?walletAddress=$WALLET_ADDRESS" -H "accept: application/json" -d ""
5062
```
63+
</TabItem>
64+
65+
<TabItem value="Windows" label="Windows">
66+
67+
```bash title="Command Prompt"
68+
$headers = @{
69+
"accept" = "application/json"
70+
}
71+
72+
$env:WALLET_ADDRESS = "YOUR_WALLET_ADDRESS"
73+
74+
Invoke-WebRequest -Uri "https://faucet.aelf.dev/api/claim?walletAddress=$env:WALLET_ADDRESS" -Method POST -Headers $headers -Body ""
75+
```
76+
77+
</TabItem>
78+
</Tabs>
5179

5280
**2. Check ELF Balance:**
5381

5482
To check your ELF balance, use:
5583

84+
<Tabs>
85+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
5686
```bash title="Terminal"
5787
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $WALLET_ADDRESS -p $WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
5888
```
89+
</TabItem>
90+
91+
<TabItem value="Windows" label="Windows">
92+
```bash title="Command Prompt"
93+
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
94+
```
95+
</TabItem>
96+
</Tabs>
5997

6098
You will be prompted for the following:
6199

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

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

83-
Run the following command to deploy a contract. Remember to export the path of LotteryGame.dll.patched to CONTRACT_PATH.
121+
Run the following command to deploy a contract. Remember to export the path of HelloWorld.dll.patched to CONTRACT_PATH.
84122

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

133+
</TabItem>
134+
135+
<TabItem value="Windows" label="Windows">
136+
```bash title="Command Prompt"
137+
$CONTRACT_PATH = Get-ChildItem -Recurse -Filter "*patched*" | Select-Object -First 1 -ExpandProperty FullName
138+
$env:CONTRACT_PATH = $CONTRACT_PATH
139+
```
140+
141+
```bash title="Command Prompt"
142+
aelf-deploy -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -c $env:CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
143+
```
144+
145+
</TabItem>
146+
</Tabs>
147+
93148
- Please wait for approximately 1 to 2 minutes. If the deployment is successful, it will provide you with the contract address.
94-
![result](/img/deploy-result.png)
149+
![result](/img/deploy-result.png)
95150

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

99154
- Export your smart contract address:
100155

101-
```bash title="Terminal"
102-
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
103-
```
156+
<Tabs>
157+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
158+
```bash title="Terminal"
159+
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
160+
```
161+
</TabItem>
162+
163+
<TabItem value="Windows" label="Windows">
164+
```bash title="Command Prompt"
165+
$env:CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
166+
```
167+
</TabItem>
168+
</Tabs>
104169

105170
:::tip
106171
ℹ️ Note: You are to copy the smart contract address as we will be referencing it in the next steps!
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
#### Create A Wallet
2+
3+
To send transactions on the aelf blockchain, you must have a wallet.
4+
5+
- Run this command to create aelf wallet.
6+
7+
```bash title="Terminal"
8+
aelf-command create
9+
```
10+
11+
![result](/img/create_wallet_output.png)
12+
13+
- You will be prompted to save your account, please do **save** your account as shown below:
14+
15+
```bash title="Terminal"
16+
? Save account info into a file? (Y/n) Y
17+
```
18+
19+
**Make sure to choose Y to save your account information.**
20+
21+
:::tip
22+
ℹ️ Note: If you do not save your account information (by selecting n or N), do not export the wallet password. Only **proceed to the next** step if you have saved your account information.
23+
:::
24+
25+
- Next, enter and confirm your password. Then export your wallet password as shown below:
26+
27+
<Tabs>
28+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
29+
```bash title="Terminal"
30+
export WALLET_PASSWORD="YOUR_WALLET_PASSWORD"
31+
```
32+
</TabItem>
33+
34+
<TabItem value="Windows" label="Windows">
35+
```bash title="Command Prompt"
36+
$env:WALLET_PASSWORD = "YOUR_WALLET_PASSWORD"
37+
```
38+
</TabItem>
39+
</Tabs>
40+
41+
#### Acquire Testnet Tokens (Faucet) for Development
42+
43+
To deploy smart contracts or execute on-chain transactions on aelf, you'll require testnet ELF tokens.
44+
45+
**Get ELF Tokens**
46+
47+
import Tabs from '@theme/Tabs';
48+
import TabItem from '@theme/TabItem';
49+
50+
<Tabs>
51+
<TabItem value="cli" label="CLI" default>
52+
53+
**1. Get Testnet ELF Tokens:**
54+
55+
To receive testnet ELF tokens, run this command after replacing `$WALLET_ADDRESS` and `$WALLET_PASSWORD` with your wallet details:
56+
57+
<Tabs>
58+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
59+
```bash title="Terminal"
60+
export WALLET_ADDRESS="YOUR_WALLET_ADDRESS"
61+
curl -X POST "https://faucet.aelf.dev/api/claim?walletAddress=$WALLET_ADDRESS" -H "accept: application/json" -d ""
62+
```
63+
</TabItem>
64+
65+
<TabItem value="Windows" label="Windows">
66+
67+
```bash title="Command Prompt"
68+
$headers = @{
69+
"accept" = "application/json"
70+
}
71+
72+
$env:WALLET_ADDRESS = "YOUR_WALLET_ADDRESS"
73+
74+
Invoke-WebRequest -Uri "https://faucet.aelf.dev/api/claim?walletAddress=$env:WALLET_ADDRESS" -Method POST -Headers $headers -Body ""
75+
```
76+
77+
</TabItem>
78+
</Tabs>
79+
80+
**2. Check ELF Balance:**
81+
82+
To check your ELF balance, use:
83+
84+
<Tabs>
85+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
86+
```bash title="Terminal"
87+
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $WALLET_ADDRESS -p $WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
88+
```
89+
</TabItem>
90+
91+
<TabItem value="Windows" label="Windows">
92+
```bash title="Command Prompt"
93+
aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance
94+
```
95+
</TabItem>
96+
</Tabs>
97+
98+
You will be prompted for the following:
99+
100+
```sh title="Terminal"
101+
Enter the required param <symbol>: ELF
102+
Enter the required param <owner>: **$WALLET_ADDRESS**
103+
```
104+
105+
You should see the result displaying your wallet's ELF balance.
106+
107+
</TabItem>
108+
<TabItem value="web" label="Web" default>
109+
110+
Go to https://faucet-ui.aelf.dev Enter your address and click `Get Tokens`.
111+
112+
![result](/img/get-token-ui.png)
113+
114+
</TabItem>
115+
</Tabs>
116+
117+
**Deploy Smart Contract:**
118+
119+
The smart contract needs to be deployed on the chain before users can interact with it.
120+
121+
Run the following command to deploy a contract. Remember to export the path of BuildersDAO.dll.patched to CONTRACT_PATH.
122+
123+
<Tabs>
124+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
125+
```bash title="Terminal"
126+
export CONTRACT_PATH=$(find ~+ . -path "*patched*" | head -n 1)
127+
```
128+
129+
```bash title="Terminal"
130+
aelf-deploy -a $WALLET_ADDRESS -p $WALLET_PASSWORD -c $CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
131+
```
132+
133+
</TabItem>
134+
135+
<TabItem value="Windows" label="Windows">
136+
```bash title="Command Prompt"
137+
$CONTRACT_PATH = Get-ChildItem -Recurse -Filter "*patched*" | Select-Object -First 1 -ExpandProperty FullName
138+
$env:CONTRACT_PATH = $CONTRACT_PATH
139+
```
140+
141+
```bash title="Command Prompt"
142+
aelf-deploy -a $env:WALLET_ADDRESS -p $env:WALLET_PASSWORD -c $env:CONTRACT_PATH -e https://tdvw-test-node.aelf.io/
143+
```
144+
145+
</TabItem>
146+
</Tabs>
147+
148+
- Please wait for approximately 1 to 2 minutes. If the deployment is successful, it will provide you with the contract address.
149+
![result](/img/deploy-result.png)
150+
151+
- Copy the smart contract address from the `address` field
152+
![result](/img/Contract_Address.png)
153+
154+
- Export your smart contract address:
155+
156+
<Tabs>
157+
<TabItem value="Linux and macOs" label="Linux and macOs" default>
158+
```bash title="Terminal"
159+
export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
160+
```
161+
</TabItem>
162+
163+
<TabItem value="Windows" label="Windows">
164+
```bash title="Command Prompt"
165+
$env:CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS"
166+
```
167+
</TabItem>
168+
</Tabs>
169+
170+
:::tip
171+
ℹ️ Note: You are to copy the smart contract address as we will be referencing it in the next steps!
172+
:::
173+
174+
:::info
175+
🎉 You have successfully deployed your dApp smart contract on the aelf testnet! In the next steps, we will be building the frontend components that allow us to interact with our deployed smart contract!
176+
:::
177+
178+

0 commit comments

Comments
 (0)