This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.vm.network "forwarded_port", guest: 3306, host: 3306 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nano Vagrantfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir privateBlockChain | |
cd privateBlockChain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"config": { | |
"chainId": 10, | |
"homesteadBlock": 0, | |
"eip155Block": 0, | |
"eip158Block": 0 | |
}, | |
"alloc" : {}, | |
"coinbase" : "0x0000000000000000000000000000000000000000", | |
"difficulty" : "0x1000", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ต้องการ node จำนวนกี่ node ก็ต่อลงมาเรื่อย ๆ เลย */ | |
geth --datadir "node1" init "genesis.json" | |
geth --datadir "node2" init "genesis.json" | |
geth --datadir "node3" init "genesis.json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ทำการ run node แต่ล่ะตัว โดยแต่ล่ะ node จะต้อง run แยก terminal กัน */ | |
/* node 1 เราจะ set ให้เป็น master node และให้ node อื่นๆ peer mining */ | |
geth --datadir "node1" --networkid 10 --port 30303 --rpc --rpcport 8545 --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcapi="db,eth,net,web3,personal" --nodiscover console 2>node1.log | |
/* ทำการ run node ที่ 2 ใน terminal 2 */ | |
geth --datadir "node2" --networkid 10 --port 30304 --ipcdisable --nodiscover console 2>node2.log | |
/* ทำการ run node ที่ 3 ใน terminal 3 */ | |
geth --datadir "node3" --networkid 10 --port 30305 --ipcdisable --nodiscover console 2>node3.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** คำสั่งสร้างบัญชีกระเป๋าตังค์ **/ | |
/** หลังจาก run คำสั่งนี้แล้ว ระบบจะให้ใส่รหัสผ่าน เตรียมปากกากระดาษไว้จดด้วยนะครับ **/ | |
personal.newAccount() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp [option] [File หรือ Directory ต้นทาง] [File หรือ Directory ปลายทาง] | |
/** คัดลอกfile file1.txt ไปที่ file2.txt **/ | |
cp file1.txt file2.txt | |
/** ทำการคัดลอก file ทั้งหมดของ exam1 ไปที่ exam2 **/ | |
cp -rv exam1 exam2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"address": "6b8d87e6b66dde76d95588f83be1d39c4cedd80c", | |
"crypto": { | |
"cipher": "aes-128-ctr", | |
"ciphertext": "c4fd6d58e52490b90551b4efc766aa778c3acefba56f303a1dcc09265fc8d5df", | |
"cipherparams": { | |
"iv": "147d9c489d02074ff8156b7690c3be48" | |
}, | |
"kdf": "scrypt", | |
"kdfparams": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin.nodeInfo | |
or | |
admin.nodeInfo.enode |