-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclass 7.txt
167 lines (96 loc) · 3.35 KB
/
class 7.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
creating smart contracts with UI/Remx IDE
compiling and deploying the contracts manually
CLI ways of creating and deploying applications:
------------------------------------------------
1. Truffle:
------------
a. Install node version 18 -- Done
b. Install truffle -- Done
c. Create a sample truffle project -- Done
Project Name ---
Folder ---
Source ---
Contract ---
test ---
mkdir MetaCoin ---> create a folder called MetaCoin
cd MetaCoin ---> open the folder MetaCoin
truffle unbox metacoin ---> creates a project structre with sample contrcts
d. Explore the options --- Done
contracts folder will have the smart contracts
1 eth === 10 ^ 18 gwei
nano is a command to open files
e. Compile and deploy contracts --- truffle compile
Refercen --- https://trufflesuite.com/docs/truffle/how-to/install/
Step1: Install node js version 18
--------
sudo apt-get update
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 18
Step2:
--------
npm install -g truffle (or) sudo npm install -g truffle
Step3: crete workspace for project
------
mkdir MetaCoin
cd MetaCoin
Step4: truffle unbox for standard folder/project structure
-------
sudo truffle unbox metacoin or truffle unbox metacoin
Step5:
---------
truffle compile or sudo truffle compile
2. Hardhat:
-----------
Reference Link ---> https://hardhat.org/hardhat-runner/docs/guides/project-setup
1. sudo apt-get update
2. npm init -y
2. npm install --save-dev hardhat
3. npx hardhat
4. npx hardhat compile
GETH Installation:
------------------
1. sudo apt-get install software-properties-common
2. sudo add-apt-repository -y ppa:ethereum/ethereum
3. sudo apt-get update
4. sudo apt-get install ethereum
5. geth version
Steps to run a GETH node:
--------------------------
1. geth --datadir ethdata account new ---> take backup or copy the address in this step
2. nano genesis.json ---> copy the contents fro, genesis.jso file from github link (https://github.com/blockchaintraining90/batch6)
3. geth --datadir=”ethdata” init genesis.json
4. geth --datadir=”ethdata” --networkid 15 --nodiscover --networkid 1999 console
5. geth attach ipc:/home/corresponding VM name/”ethdata”/geth.ipc
6. miner.setEtherbase("your account address")
7. miner.start(8)
8. web3.eth.getBalance("your account address")
Process to get accounts:
-------------------------
cd ethdata/
cd keystore/
copy the address
use prefix of 0x
Agenda is to create truffle projc
prerequisites --- node v18, truffle, solidity compiler
Step1: Install node js version 18
--------
sudo apt-get update
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 18
Step2:
--------
npm install -g truffle (or) sudo npm install -g truffle
Step3: crete workspace for project
------
mkdir MetaCoin
cd MetaCoin
Step4: truffle unbox for standard folder/project structure
-------
sudo truffle unbox metacoin or truffle unbox metacoin
Step5:
---------
truffle compile or sudo truffle compile