geth – 연습기록

2018/02/25

red@ubuntu:~/data_testnet$ geth –networkid 4649 –nodiscover –maxpeers 0 –datadir /home/red/data_testnet console 2>> /home/red/data_testnet/geth.log Welcome to the Geth JavaScript console!

instance: Geth/v1.5.5-stable-ff07d548/linux/go1.6.2
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> personal.newAccount(“pass0”)
“0x16d018f46014e41e5cbfc2c3aba432783b390764”
>

> eth.accounts
[“0x16d018f46014e41e5cbfc2c3aba432783b390764”]
>
>
> personal.newAccount(“pass1”)
“0xf01ca1789ad0989e372297595b3f55dcf92ebd9c”
>
> eth.accounts
[“0x16d018f46014e41e5cbfc2c3aba432783b390764”, “0xf01ca1789ad0989e372297595b3f55dcf92ebd9c”]
>
> eth.accounts[0]
“0x16d018f46014e41e5cbfc2c3aba432783b390764”
> eth.accounts[1]
“0xf01ca1789ad0989e372297595b3f55dcf92ebd9c”
>

exit로 나온후 쉘에서 아래와 같이 eth 계정생성

red@ubuntu:~/data_testnet$ geth –datadir /home/red/data_testnet/ account new
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat passphrase:
Address: {d9ae7643a17ef13e09ed9f012f7f025fc3fff309}
red@ubuntu:~/data_testnet$
red@ubuntu:~/data_testnet$
red@ubuntu:~/data_testnet$

쉘에서 생성된 계정 확인

red@ubuntu:~/data_testnet$ geth –datadir /home/red/data_testnet/ account list
Account #0: {16d018f46014e41e5cbfc2c3aba432783b390764} /home/red/data_testnet/keystore/UTC–2018-02-25T14-59-49.313262891Z–16d018f46014e41e5cbfc2c3aba432783b390764
Account #1: {f01ca1789ad0989e372297595b3f55dcf92ebd9c} /home/red/data_testnet/keystore/UTC–2018-02-25T15-02-15.372136682Z–f01ca1789ad0989e372297595b3f55dcf92ebd9c
Account #2: {d9ae7643a17ef13e09ed9f012f7f025fc3fff309} /home/red/data_testnet/keystore/UTC–2018-02-25T15-06-13.152731226Z–d9ae7643a17ef13e09ed9f012f7f025fc3fff309
red@ubuntu:~/data_testnet$
red@ubuntu:~/data_testnet$
red@ubuntu:~/data_testnet$

계정확인

eth.coinbase
“0xf01ca1789ad0989e372297595b3f55dcf92ebd9c”
>
> miner.setEtherbase(eth.accounts[0])
true
> eth.coinbase
“0x16d018f46014e41e5cbfc2c3aba432783b390764”
>
>
> eth.getBalance
function()
> eth.getBalance(eth.accounts[0])
0
> eth.getBalance(eth.accounts[1])
0
> eth.getBalance(eth.accounts[2])
0
>

채굴된 블록 확인
> eth.blockNumber
0
>

채굴시작

> miner.start
function()
> miner.start(1)
true
>

geth.log 에 생기는 내용

red@ubuntu:~/data_testnet$ tail -1000f geth.log
Welcome to the Geth JavaScript console!

instance: Geth/v1.5.5-stable-ff07d548/linux/go1.6.2
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

I0225 23:59:01.387199 cmd/utils/flags.go:615] WARNING: No etherbase set and no accounts found as default
I0225 23:59:01.387370 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /home/red/data_testnet/geth/chaindata
I0225 23:59:01.413813 ethdb/database.go:176] closed db:/home/red/data_testnet/geth/chaindata
I0225 23:59:01.414280 node/node.go:176] instance: Geth/v1.5.5-stable-ff07d548/linux/go1.6.2
I0225 23:59:01.414313 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /home/red/data_testnet/geth/chaindata
I0225 23:59:01.454788 eth/backend.go:191] Protocol Versions: [63 62], Network Id: 4649
I0225 23:59:01.455235 eth/backend.go:219] Chain config: {ChainID: 0 Homestead: <nil> DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: <nil> EIP158: <nil>}
I0225 23:59:01.456166 core/blockchain.go:219] Last header: #0 [3b3326d5…] TD=16384
I0225 23:59:01.456215 core/blockchain.go:220] Last block: #0 [3b3326d5…] TD=16384
I0225 23:59:01.456244 core/blockchain.go:221] Fast block: #0 [3b3326d5…] TD=16384
I0225 23:59:01.458083 p2p/server.go:342] Starting Server
I0225 23:59:01.466026 p2p/server.go:610] Listening on [::]:30303
I0225 23:59:01.467317 node/node.go:341] IPC endpoint opened: /home/red/data_testnet/geth.ipc
I0226 00:10:58.008212 miner/miner.go:136] Starting mining operation (CPU=1 TOT=2)
I0226 00:10:58.008681 eth/backend.go:475] Automatic pregeneration of ethash DAG ON (ethash dir: /home/red/.ethash)
I0226 00:10:58.008811 eth/backend.go:482] checking DAG (ethash dir: /home/red/.ethash)
I0226 00:10:58.011124 miner/worker.go:516] commit new work on block 1 with 0 txs & 0 uncles. Took 2.410714ms
I0226 00:10:58.011229 vendor/github.com/ethereum/ethash/ethash.go:259] Generating DAG for epoch 0 (size 1073739904) (0000000000000000000000000000000000000000000000000000000000000000)
I0226 00:10:59.284518 vendor/github.com/ethereum/ethash/ethash.go:291] Generating DAG: 0%
I0226 00:11:06.673811 vendor/github.com/ethereum/ethash/ethash.go:291] Generating DAG: 1%
I0226 00:11:14.415564 vendor/github.com/ethereum/ethash/ethash.go:291] Generating DAG: 2%
I0226 00:11:21.884891 vendor/github.com/ethereum/ethash/ethash.go:291] Generating DAG: 3%
I0226 00:11:29.380542 vendor/github.com/ethereum/ethash/ethash.go:291] Generating DAG: 4%

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s