๊ต์ฌ์ Code ๋ฅผ Copy&Paste ํ ๋ ๋ง๋ค PDF Reader ์ ๋ฐ๋ผ ๊ฐ์ด ๋ฌ๋ผ์ง๋ ๊ฒฝ์ฐ ๋ฐ์ (์ค๋ฐ๋ ๋ฐ ๋์ด์ฐ๊ธฐ ๋ฐ์) ์๋ ์ฝ๋๋ฅผ ์ฌ์ฉํ์ธ์
// ํด๋ ๋ง๋ค๊ณ ์ด๋ํ๊ธฐ
mkdir MyNetwork
cd MyNetwork
// puppeth ํตํด์ ์ ๋ค์์ค ๋ธ๋ก ์
ํ
ํ๊ธฐ
puppeth
// ์ดํ ์ค์ ์ ๊ต์ฌ ์ฐธ์กฐ
#### puppeth ์คํ์ด ์๋๋ ๊ฒฝ์ฐ - Windows
- geth-alltools ์ค์น์ ์๋์ผ๋ก Path ์ ์ถ๊ฐ ๋ฉ๋๋ค
- CMD ์ฐฝ์ ๋ซ์๋ค ์๋ก ์ด์ด๋ณด์ธ์
#### puppeth ์คํ์ด ์๋๋ ๊ฒฝ์ฐ - macOS
- ํธ์ง๊ธฐ ์ด๊ณ : vi ~/.bash_profile
- ๋ค์ ๋ด์ฉ ์ถ๊ฐ(JongKwang ๊ฒฝ๋ก ์์ ํ์) : export PATH=$PATH:/Users/JongKwang/bin/geth-alltools-1.8.15
- terminal ์ ์๋ก ์ฝ๋๋ค
// MyNetwork.json ์ผ๋ก ๋ธ๋ก ์์ฑํ๊ธฐ
geth --datadir . init MyNetwork.json
// Account ์์ฑ ๋ฐ ์กฐํ
geth --datadir . account new
geth --datadir . account list
// ๋น๋ฐ๋ฒํธ ํ์ผ ์์ฑํ๊ธฐ
code password.txt
12341234
// ๋ธ๋ก์ฒด์ธ ์์ ํ์ผ ์์ฑ
code startblockchain.bat
geth --datadir . --networkid 9999 --nodiscover --rpc --rpcport 8545 --rpccorsdomain "*" --rpcapi "eth,web3,personal,net" --nat any --unlock 0 --password ./password.txt
#### macOS์ ๊ฒฝ์ฐ
- ํ์ผ ์์ฑ : code startblockchain.sh
- ๊ถํ ๋ถ์ฌ : chmod 755 startblockchain.sh
// ๋ธ๋ก์ฒด์ธ ์์
startblockchain.bat
#### macOS์ ๊ฒฝ์ฐ : startblockchain.sh
// Geth Console ๋ฐฐ์นํ์ผ ์์ฑ
code startgethconsole.bat
geth attach ipc:\\.\pipe\geth.ipc
#### macOS์ ๊ฒฝ์ฐ
- ํ์ผ ์์ฑ : code startgethconsole.sh
- ๊ถํ ๋ถ์ฌ : chmod 755 startgethconsole.sh
// Geth Console ์์
startgethconsole.bat #### macOS์ ๊ฒฝ์ฐ : startgethconsole.sh
// Mist ์คํ ํ์ผ ์์ฑ
code startmist.bat
"c:\Program Files\Mist\Mist.exe" --ipc \\\\.\\pipe\\geth.ipc
#### macOS์ ๊ฒฝ์ฐ
- code startmist.sh
- /Applications/Mist.app/Contents/MacOS/Mist --ipc \\\\.\\pipe\\geth.ipc
// Mist ์คํ
startmist.bat #### macOS์ ๊ฒฝ์ฐ : startmist.sh
- ๊ณ์ ๋ชฉ๋ก :
eth.accounts - 1๋ฒ์งธ ๊ณ์ ์ฃผ์ :
eth.accounts[0] - ์ ๊ท ๊ณ์ ์์ฑ :
personal.newAccount() - ๊ณ์ ์ ๊ธ ํด์ :
personal.unlockAccount
- ์ฑ๊ตด ์์ :
miner.start(1) - ์ฑ๊ตด ์ค์ง :
miner.stop()
- ๋๊ธฐ์ค์ธ ํธ๋์ ์
:
eth.pendingTransactions - ํธ๋์ ์
ID ๋ก ์์ธ์กฐํ :
eth.getTransaction("ํธ๋์ญ์ ID") - ํ์ฌ ๋ธ๋ก ๋๋ฒ :
eth.blockNumber- web3.eth.getBlock('latest') // ๋ง์ง๋ง ๋ธ๋ก ์ ๋ณด
- debug.verbosity(2) // (0=silent, 1=error, 2=warn, 3=info, 4=core, 5=debug, 6=debug detail)
- solidity ํด๋์ ํ์ผ๋ค์ ์ฌ์ฉํ์ธ์