블로그 이미지
Flying Mr.Cheon youGom

Recent Comment»

Recent Post»

Recent Trackback»

« 2025/5 »
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

 

'Blockchain'에 해당되는 글 3

  1. 2019.01.25 세미나 자료 ( 펌 )
  2. 2019.01.24 Monitoring BlockChain
  3. 2019.01.24 Excute BlockChain - Hello World
 

세미나 자료 ( 펌 )

BlockChain | 2019. 1. 25. 15:00 | Posted by youGom

블럭체인 이더리움 이해하는데 도움되는 자료 링크

https://www.slideshare.net/jaehyun/1-block-chain-as-a-platform?next_slideshow=1

:

Monitoring BlockChain

보안/기술 정보 | 2019. 1. 24. 17:03 | Posted by youGom
geth \
    --rpc \
    --rpcport 8545 \
    --rpcaddr 127.0.0.1 \
    --rpccorsdomain 127.0.0.1 \
    --rpcapi "eth,web3,miner,net,admin,personal,debug" \
    --metrics \
    --bootnodes <your-bootnodes>
geth monitor --attach=http://127.0.0.1:8545 txpool
geth attach http://127.0.0.1:8545 --exec "debug.metrics(false).txpool"
geth attach http://127.0.0.1:8545 --exec "debug.metrics(false)"


:

Excute BlockChain - Hello World

보안/기술 정보 | 2019. 1. 24. 16:54 | Posted by youGom

[ Step 0 : Install : MAC ] - 리눅스일경우 다른 방법으로 설치하거나 빌드하면됨

$ brew tap ethereum/ethereum

$ brew install ethereum


[ Step 1 : Create Genesis Block ]

$ mkdir -p ethereum-tutorial && cd ethereum-tutorial

$ mkdir -p private && cd private

$ puppeth

 > anyname

 > 2. Configure new genesis

 > 1. Create new genesis from scratch

 > 1. Ethash - proof of work

 > 0x100000000000

 > (blank:Default pre-funded with 1wei )

 > 12345 ( networkID)

      << loop answer >>

 > 2. Manage existing genesis

 > 2. Export genesis configuration

 > ( Ctrl + C : breake process )

there are 4 files; 

anyname.json, 

anyname-parity.json 

anyname-harmony.json 

anyname-aleth.json


[Step 2 : Initialize the genesis block]

$ geth --data ~/.ethereum-tutorial/private init anyname.json


[Step 3: Creating accounts]

$ geth --datadir . account new

$ geth --datadir . account list


[Step 4: Write a Shell Script to Start Blockchain]

$ vi startnode.sh

geth --networkid 4224 --mine --minerthreads 1 --datadir "~/Desktop/Playground/ethereum-tutorial/private" --nodiscover --rpc --rpcport "8545" --port "30303" --rpccorsdomain "*" --nat "any" --rpcapi eth,web3,personal,net --unlock 0 --password ~/ethereum-tutorial/private/password.sec --ipcpath "~/Library/Ethereum/geth.ipc"

  << Create another file named password.sec in private folder. >>

$ chmod +x startnode.sh

$ ./startnode.sh


[Step 5: Connect to running geth]

$ geth attach --datadir ~/ethereum-tutorial


[Step 6: Query the blockchain]

> eth.accounts

> eth.getBalance(eth.accounts[0])

> web3.fromWei(eth.getBalance(eth.accounts[0]), "ether")


$ miner.stop()

$ miner.start()


[Step 7: Make transactions]

> eth.sendTransaction({from: eth.coinbase, to: eth.accounts[1], value: web3.toWei(10, "ether")})

> web3.fromWei(eth.getBalance(eth.accounts[1]), "ether")



: