Skip to content

Commit 671ebe4

Browse files
authored
Merge pull request #4 from mind-network/dev
Update tutorial document
2 parents 6557932 + 9b01629 commit 671ebe4

3 files changed

Lines changed: 285 additions & 235 deletions

File tree

tutorial/Configure_Node.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<div align="center">
2+
3+
<img src="https://avatars.githubusercontent.com/u/97393721" alt="logo" width="200" height="auto" />
4+
<h1>MindLake Tutorial: Configure Node</h1>
5+
6+
<p>
7+
A step-by-step cookbook for Node Configuration !
8+
</p>
9+
</div>
10+
11+
- [:star2: 0. Step by step tutorial](#star2-0-step-by-step-tutorial)
12+
- [:star2: 1. Install Node Package Management Tools: Nvm](#star2-1-install-node-package-management-tools-nvm)
13+
- [:art: 1.1 For Mac OS](#art-11-for-mac-os)
14+
- [:dart: 1.1.2 Install Nvm with HomeBrew](#dart-112-install-nvm-with-homebrew)
15+
- [:gear: 1.1.2.1 Step1: Install HomeBrew (If you don't have Homebrew installed)](#gear-1121-step1-install-homebrew-if-you-dont-have-homebrew-installed)
16+
- [:gear: 1.1.2.2 Step2: Install Nvm](#gear-1122-step2-install-nvm)
17+
- [:gear: 1.1.2.3 Step3: Verify the Nvm Installation](#gear-1123-step3-verify-the-nvm-installation)
18+
- [:art: 1.2 For Windows](#art-12-for-windows)
19+
- [:dart: 1.2.1 Download Nvm](#dart-121-download-nvm)
20+
- [:dart: 1.2.2 Run exe installation file](#dart-122-run-exe-installation-file)
21+
- [:dart: 1.2.3 Validate nvm installation](#dart-123-validate-nvm-installation)
22+
- [:star2: 2. Install Node](#star2-2-install-node)
23+
- [:art: 2.1 Install Node](#art-21-install-node)
24+
- [:art: 2.2 Select right Node 16 version if not correct](#art-22-select-right-node-16-version-if-not-correct)
25+
- [:art: 2.3 Validate if correct node version](#art-23-validate-if-correct-node-version)
26+
27+
28+
## :star2: 0. Step by step tutorial
29+
This is part of support chapter for MindLake step-by-step tutorial for [Typescript](README.md)
30+
31+
## :star2: 1. Install Node Package Management Tools: Nvm
32+
33+
### :art: 1.1 For Mac OS
34+
35+
#### :dart: 1.1.2 Install Nvm with HomeBrew
36+
If you need to install Nvm from the command line on macOS, the Homebrew package manager is a reliable option. Follow the steps below to install Nvm via Homebrew:
37+
##### :gear: 1.1.2.1 Step1: Install HomeBrew (If you don't have Homebrew installed)
38+
1. Open a browser and go to https://brew.sh.
39+
40+
![image](./imgs/brew.png)
41+
42+
2. Under the "Install Homebrew" title, copy the command
43+
```shell
44+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
45+
```
46+
47+
![image](./imgs/install_brew.png)
48+
49+
3. Then open a terminal window, paste the copied command, and press the 'Enter' or 'Return' button.
50+
51+
![image](./imgs/open_mac_terminal.png)
52+
53+
4. Enter your macOS credentials if and when asked.
54+
5. If prompted, install Apple's command line developer tools.
55+
56+
##### :gear: 1.1.2.2 Step2: Install Nvm
57+
1. Enter the following command in terminal to upgrade Homebrew:
58+
```shell
59+
brew update && brew upgrade
60+
```
61+
2. Install `nvm` using this command:
62+
```shell
63+
brew install nvm
64+
```
65+
Next, create a directory for nvm at home.
66+
```
67+
mkdir ~/.nvm
68+
```
69+
Now, configure the required environment variables. Edit the following configuration file in your home directory
70+
```
71+
vim ~/.bash_profile
72+
```
73+
and, add the below lines to `~/.bash_profile` ( or `~/.zshrc` for macOS Catalina or newer versions)
74+
```
75+
export NVM_DIR=~/.nvm
76+
source $(brew --prefix nvm)/nvm.sh
77+
```
78+
Press `ESC` + `:wq` to save and close your file.
79+
80+
Next, load the variable to the current shell environment. From the next login, it will automatically loaded.
81+
```
82+
source ~/.bash_profile
83+
```
84+
That’s it. The nvm has been installed on your macOS system.
85+
86+
##### :gear: 1.1.2.3 Step3: Verify the Nvm Installation
87+
Enter the following command in terminal:
88+
```shell
89+
nvm --version
90+
```
91+
An example of the output is:
92+
```
93+
1.1.7
94+
```
95+
96+
97+
### :art: 1.2 For Windows
98+
Open Terminal on Windows:
99+
1. press `WIN` + `R` key
100+
2. type `CMD` in the prompt
101+
3. press `ENTRY` key
102+
103+
![image](./imgs/windows_open_terminal.png)
104+
105+
![image](./imgs/windows_terminal.png)
106+
107+
#### :dart: 1.2.1 Download Nvm
108+
1. Open a browser and go to [nvm downloads for Windows](https://github.com/coreybutler/nvm-windows/releases)
109+
2. Download nvm-setup.exe
110+
111+
![image](./imgs/window_download_nvm.png)
112+
113+
#### :dart: 1.2.2 Run exe installation file
114+
Double Click nvm-setup.exe to run
115+
116+
![image](./imgs/nvm_1.png)
117+
118+
![image](./imgs/nvm_2.png)
119+
120+
![image](./imgs/nvm_3.png)
121+
122+
#### :dart: 1.2.3 Validate nvm installation
123+
```cmd
124+
nvm version
125+
```
126+
An example of the output is:
127+
```
128+
1.1.7
129+
```
130+
131+
## :star2: 2. Install Node
132+
### :art: 2.1 Install Node
133+
```
134+
nvm install 16
135+
```
136+
An example of the output is:
137+
```
138+
Downloading node.js version 16.13.1 (64-bit)...
139+
Complete
140+
Creating D:\program\nvm\temp
141+
142+
Downloading npm version 8.1.2... Complete
143+
Installing npm v8.1.2...
144+
145+
Installation complete. If you want to use this version, type
146+
147+
nvm use 16.13.1
148+
```
149+
### :art: 2.2 Select right Node 16 version if not correct
150+
`Node16` is recommended. `Node18` still have issues and is not recommeded right now,
151+
```cmd
152+
nvm use 16
153+
```
154+
An example of the output is:
155+
```
156+
Now using node v16.13.1 (64-bit)
157+
```
158+
159+
### :art: 2.3 Validate if correct node version
160+
```cmd
161+
node -v
162+
```
163+
An example of the output is:
164+
```
165+
v16.13.1
166+
```

tutorial/Configure_Wallet.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<div align="center">
2+
3+
<img src="https://avatars.githubusercontent.com/u/97393721" alt="logo" width="200" height="auto" />
4+
<h1>MindLake Tutorial: Configure Wallet</h1>
5+
6+
<p>
7+
A step-by-step cookbook for Wallet Configuration to access Mind Lake !
8+
</p>
9+
</div>
10+
11+
- [:star2: 0. Step by step tutorial](#star2-0-step-by-step-tutorial)
12+
- [:star2: 4. Prepare myconfig.ts](#star2-4-prepare-myconfigts)
13+
- [:art: 4.1. Prepare Wallet](#art-41-prepare-wallet)
14+
- [:dart: 4.1.1 Install Wallet](#dart-411-install-wallet)
15+
- [:dart: 4.1.2 Wallet Sign In: https://scan.mindnetwork.xyz](#dart-412-wallet-sign-in-httpsscanmindnetworkxyz)
16+
- [:dart: 4.1.3 Register wallets if not in whitelist during testing period](#dart-413-register-wallets-if-not-in-whitelist-during-testing-period)
17+
- [:art: 4.2. Prepare appKey](#art-42-prepare-appkey)
18+
- [:dart: 4.2.1 create Dapp](#dart-421-create-dapp)
19+
20+
21+
## :star2: 0. Step by step tutorial
22+
This is part of support chapter for MindLake step-by-step tutorial for [Typescript](README.md)
23+
24+
## :star2: 4. Prepare myconfig.ts
25+
26+
`myconfig.ts` contains the settings of parameters used in examples and use cases, you can copy `myconfig_template.ts` to the name `myconfig.ts` and modify it as per your requirement. If you want to run the examples of quickStart, Use Case 1 and Use Case 2, you only need to fill out `appKey`. If you want to run Use Case 3, you need to fill out the walltes info for all of Alice, Bob and Charlie
27+
28+
### :art: 4.1. Prepare Wallet
29+
#### :dart: 4.1.1 Install Wallet
30+
1. Install [MetaMask](https://metamask.io/download/) plugins in Chrome Browser
31+
2. [Sign up a MetaMask Wallet](https://myterablock.medium.com/how-to-create-or-import-a-metamask-wallet-a551fc2f5a6b)
32+
3. Change the network to Goerli TestNet. If the TestNets aren't displayed, turn on "Show test networks" in Settings.
33+
34+
![MetaMask TestNet](imgs/metamask_testnet_enable.png)
35+
36+
4. Change the network to Goerli TestNet
37+
5. Goerli Faucet for later gas fee if does not have: [Alchemy Goerli Faucet](https://goerlifaucet.com/), [Quicknode Goerli Faucet](https://faucet.quicknode.com/ethereum/goerli), [Moralis Goerli Faucet](https://moralis.io/faucets/)
38+
39+
![image](./imgs/change_chain.png)
40+
41+
#### :dart: 4.1.2 Wallet Sign In: https://scan.mindnetwork.xyz
42+
1. Open a browser and visit [mind-scan](https://scan.mindnetwork.xyz/scan)
43+
2. Click "Sign in" buttom
44+
45+
![image](./imgs/sign_scan.png)
46+
47+
2.1 During the 'Connect' procedure, the wallet will prompt the user 2-3 times as follows:
48+
Sign a nonce for login authentication.
49+
50+
![image](./imgs/nounce_sign.png)
51+
52+
2.2 If the user's account keys are already on the chain: Decrypt the user's account keys using the wallet's private key.
53+
54+
![image](./imgs/decrypt_request.png)
55+
56+
2.3 If the user's account keys do not exist yet: Obtain the public key of the wallet, which is used to encrypt the randomly generated account keys.
57+
58+
![image](./imgs/request_publickey.png)
59+
60+
2.4 Sign the transaction to upload the encrypted key ciphers to the smart contract on the chain.
61+
62+
![image](./imgs/upload_chain.png)
63+
64+
#### :dart: 4.1.3 Register wallets if not in whitelist during testing period
65+
1. If not in whitelist, there will be a pop-up prompt
66+
67+
![image](./imgs/white_list_popup.png)
68+
69+
2. Click [Apply for test link ](https://bit.ly/mindalphatest)
70+
3. After successful application, Please be patient and wait for the review.
71+
72+
### :art: 4.2. Prepare appKey
73+
##### :dart: 4.2.1 create Dapp
74+
1. Click `myDapp` in left side manu
75+
76+
![image](./imgs/myDapp_menu.png)
77+
78+
2. Click "Create Dapp"
79+
80+
![image](./imgs/create_dapp.png)
81+
82+
3. Input your Dapp name and then click "Create"
83+
84+
![image](./imgs/create_dapp_confirm.png)
85+
86+
4. copy appKey value into myconfig.ts to update "appKey"
87+
88+
![image](./imgs/dapp_list.png)

0 commit comments

Comments
 (0)