January 29, 2026

Capitalizations Index – B ∞/21M

Geth 설정부터 트렌젝션까지 – Sangphil Kim –

Geth 설정부터 트렌젝션까지 – sangphil kim –

Geth 설정부터 트렌젝션까지 – Sangphil Kim –

Geth 설정부터 트렌젝션까지 – sangphil kim –

Geth는 Go언어로 된 이더리움 노드 소프트웨어 코드 입니다.
https://ethereum-homestead.readthedocs.io/en/latest/ethereum-clients/go-ethereum/index.html
널리 사용되고 유지관리가 장점입니다. 설치부터 하겠습니다.
https://geth.ethereum.org/install/
각자 사양에 맞는 걸 찾아서 설치해주시면 되는데 저는 우분투 기준으로 설명하겠습니다.

$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository -y ppa:ethereum/ethereum
$ sudo apt-get update
$ sudo apt-get install -y ethereum

터미널을 열고 차례대로 입력해 줍니다. 최소 3기가의 RAM과 128메가바이트의 비디오 RAM이 있어서 채굴이 가능합니다. 다 설치를 하셨나요?

$ geth version
Geth
Version: 1.6.7-stable
Git Commit: ab5646c532292b51e319f290afccf6a44f874372
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.1
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.8

$ geth

Geth version이라고 입력을 하면 Geth버전을 포함한 정보가 나타나게 됩니다. Geth를 멈추려면 “컨트롤 + C”를 누르시면 됩니다. ~/.ethereum/안에는 geth geth.ipc keystore가 있는데 geth.ipc는 Geth가 실행될 때 나타납니다. 같은 방식으로

$ geth — testnet

를 입력하면 테스트넷 싱크를 할 수 있습니다. ”Ropsten”의 id는 3입니다. (id 1번은 메인넷)

이제 Private Network를 만들어볼껀데요.
Private Network를 만드려면 Genesis Block이 필요합니다.

// 이부분을 삭제하시고 “genesis42.json”로 저장하세요
,
“nonce”: “0x0000000000000042”,
“timestamp”: “0x00”,
“parentHash”: “0x0000000000000000000000000000000000000000000000000000000000000000”,
“extraData”: “0x00”,
“gasLimit”: “0x4c4b40”,
“difficulty”: “0x0400”,
“mixhash”: “0x0000000000000000000000000000000000000000000000000000000000000000”,
coinbase”: “0x0000000000000000000000000000000000000000”,
“alloc”:
}

“genesis42.json”으로 “~/Documents” 에다가 저장하시면 됩니다.
그리고 같은 방식으로 “~/Documents/launch42.sh”을 저장할껀데 내용은 아래와 같습니다.

#!/bin/bash

geth — datadir ~/.ethereum/net42 init ~/Documents/genesis42.json
geth — datadir ~/.ethereum/net42 — networkid 42

“cd ~/Documents”로 이동하신 후에 “chmod a+x launch42.sh” 권한을 부여하시고,
“./launch42.sh” 실행시킴니다.

[그림 2–1] 제네시스 블록확인
[그림 2–2] 커뮤니케이션 채널 확인

[그림 2–1] 처럼 제네시스 블록이 생성되는 것을 확인하고, [그림 2–2]도 확인을 해 줍니다. 미스트와 geth간에 커뮤니케이션 채널 열어 놓은 것을 확인하는 과정입니다.
컨트롤 + C로 잠깐 멈추고 아까 “launch42.sh”파일을 열어 마지막 줄에 “console”을 입력해 줍니다. (geth — datadir ~/.ethereum/net42 — networkid 42 console)
그리고 다시 “./launch42.sh” 을 실행시키면 [그림 2–3]과 같은 화면이 나오게 됩니다.

[그림 2–3] 콘솔 입력창
[그림 2–4] 어카운트와 블록넘버 확인

[그림 2–4]와 같이 입력해주면 블록넘버가 0입니다. 아직 싱크가 되지 않았거나 마이닝 되지 않았다는 얘기죠. [그림 2–5]처럼 0번 블록을 확인해보면 “receiptsRoot”, “stateRoot”, transactionsRoot”가 모두 동일합니다. 이 3개 루트는 이더리움 블록 헤더에 포함된 각각의 머클루트 입니다.

[그림 2–5] 0번 블록 확인
[그림 2–6] 포킹 준비

[그림 2–6]과 같이 입력하면 넷버젼은 42이고 피어카운트는 0입니다. 지금 이 네트워크에 혼자 있다는 이야기 입니다.

[그림 2–7] 어카운트 생성
[그림 2–8] 어카운트 언락
[그림 2–9] 프라이빗 키 확인

[그림 2–7]은 어카운트를 생성하는 화면이고, 사용하려면 [그림 2–8] 처럼 잠긴 것을 풀어줘야 합니다. 그리고 [그림 2–9]와 같이 이동해 프라이빗 키를 확인합니다. 프라이빗 키가 중요한 것은 아시죠? 백업을 해두시기 바랍니다.

[그림 2–10] 어카운트 잔액 확인

방금 만든 어카운트니깐 [그림 2–10]처럼 잔액은 0입니다.

[그림 2–11] 마이닝 시작
[그림 2–12] 마이닝 중

“miner.start(1)”을 입력하시면 [그림 2–11] 처럼 마이닝이 시작합니다. 첫 마이닝은 시간이 꽤 걸립니다. 대략 1.5기가바이트가 필요하고, 컴퓨터 RAM을 해쉬함수가 사용합니다. 컨센시스 교육 받을 때도 여기서 잠깐 쉴 수 있다면서 농담을 하네요~
몇 개의 블록이 생성되었으면 “miner.stop()”으로 마이닝을 멈춤니다.

[그림 2–13] 블록 확인

[그림 2–13]처럼 저는 12개의 블록까지 생성이 되었습니다.

[그림 2–14] 블록 길이 확인

[그림 2–15] 12번 블록 확인

[그림 2–16] 블록 디버그

12번 블록까지 생성된 것이 확실하네요~ [그림 2–15]를 보시면 “transactionsRoot”와 “receiptsRoot”는 변하지 않았고, “stateRoot”가 변경되었습니다. [그림 2–16]은 단일 주소로 어카운트 잔액을 보여주고, nonce는 이 계정에서 트렌젝션이 이루어지지 않았기 때문에 0 이고, 스마트 컨트렉트가 아니니깐 code가 없고, 스토리지에 업데이트 되지 않았으므로 스토리지부분도 비어 있습니다. Root는 스토리지 트리의 머클루트입니다.

이제 트렌젝션을 할껀데 [그림 2–17]과 같이 어카운트를 하나 더 만들어 줍니다.

[그림 2–17] 트렌젝션 어카운트 생성
[그림 2–18] 이더 보내기

[그림 2–18] 처럼 하지 마시고~ 전송트렌젝션을 하기 전에 먼저 어카운트 언락부터 해줍니다.

[그림 2–19] 트렌젝션 해시

거래를 할 때 트렌젝션 해시를 [그림 2–19]처럼 확인하고 있습니다.

[그림 2–20] 16진수 트렌젝션 값

가스 필드에 90000인데 트렌젝션 할 때 사용한 전체 가스이고, 이 트렌젝션을 위해 소비하는 가스 상한선입니다. 확인하셨으면 마이닝을 다시 시작합니다.

[그림 2–21] 마이닝 시작
[그림 2–22] 트렌젝션 해시 확인

[그림 2–22] 처럼 블록번호 13번에 해시가 있고, 트렌젝션인덱스는 0입니다.

간단하게 geth를 설치하고 트렌젝션까지 해봤습니다.
설명하다가 빠진 내용은 없는 거 같은데~
궁금하신거나~
자세한 설명이 필요하시거나~
따라하시다가 막히는 부분 있으면~
글 남겨주세요~

Published at Tue, 30 Apr 2019 03:26:13 +0000

Previous Article

LEDGER NANO X GUIDE | Boxmining

Next Article

Blockchain is Developing Fast in the Southeast Asia

You might be interested in …

Chinese Chicken? Spooked Investor Sell-Offs Spark Crypto Price Slump

bitcoin and altcoins have taken another serious dive Monday as a Chinese sell-off sent prices plunging up to 15% in hours.


bitcoin Back Below $2600, Ethereum Heads Towards $350

In what was a widely-predicted move downwards, bitcoin fell from highs of over $3000 on GDAX to drop through $2700, trading around $2580 at press time according to average prices on CoinMarketCap.

Talk among experts pointed the finger at futures sales from Chinese exchange Okcoin, with charts showing Ethereum also reversing its recent surge over $400.

In line with behavior witnessed in recent weeks, the majority of leading altcoins followed bitcoin, losing up to 15% of face value.

End Of The Latest bitcoin Bullrun?

Nonetheless, reactions to the falls showed confusion among commentators. Responses to ARK’s Chris Burniske highlighted the simple fact that bitcoin’s recent bull market would sooner or later need to end.

//platform.twitter.com/widgets.js

bitcoin had breached the psychological barrier of $3000 per coin on some exchanges prior to Monday, yet compared with $2000 in May, traders appeared to find keeping above that level considerably more daunting.

While forecasts from figures such as Vinny Lingham and Max Keiser gave the impression the real hurdles would be $5000 and upwards, the lack of momentum to sustain ‘B3K’ suggests that crypto optimism is finally finding its new niche. This, others point out, may not be such a bad thing.

Riches to Rags Ethereum

Ethereum’s Riches-To-Rags Monday

The timing of the sell-off for Ethereum is particularly poignant.

Monday saw the ICO from ETH Blockchain startup Bancor raise an astonishing $150 million in three hours, a new record for even the hugely successful fundraising campaigns seen in the Blockchain industry this year.

On Sunday, Twitter personality and cryptocurrency bagholder WhalePanda published an extended blog post detailing why Ethereum’s “sole use case at the moment is ICOs and token creation.”

The post further reads:

What’s driving the Ethereum price? Greed. Greed from speculators, investors, and developers […] Can you blame them? Speculators and investors: No. Developers: Absolutely.

As of press time, neither bitcoin nor Ethereum appeared to have “bottomed out,” continuing on to test $2500 and $300 respectively.

Rounding out the Ethereum post, WhalePanda delivered some timely advice for traders across crypto assets:

If you’re a trader or investor, be realistic about the bubble. I know you hear this 100 times when you’re trading but: don’t invest what you can’t afford to lose.

What do you think about bitcoin, Ethereum’s latest price drops? Let us know in the comments below!


Images courtesy of OKCoin, AdobeStock, ICanHazGIF

 

The post Chinese Chicken? Spooked Investor Sell-Offs Spark Crypto Price Slump appeared first on Bitcoinist.com.