Skip to content

Instantly share code, notes, and snippets.

View Krucamper's full-sized avatar

Nattapong Chuenjai Krucamper

  • Thailand
  • 01:17 (UTC +07:00)
View GitHub Profile
config.vm.network "forwarded_port", guest: 3306, host: 3306
nano Vagrantfile
@Krucamper
Krucamper / privateBlockChain
Created November 20, 2018 10:14
privateBlockChain
mkdir privateBlockChain
cd privateBlockChain
@Krucamper
Krucamper / genesis.json
Created November 20, 2018 10:53
genesis file for create private blockchain
{
"config": {
"chainId": 10,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"alloc" : {},
"coinbase" : "0x0000000000000000000000000000000000000000",
"difficulty" : "0x1000",
@Krucamper
Krucamper / init-genesis
Created November 21, 2018 11:15
initial genesis.json
/* ต้องการ node จำนวนกี่ node ก็ต่อลงมาเรื่อย ๆ เลย */
geth --datadir "node1" init "genesis.json"
geth --datadir "node2" init "genesis.json"
geth --datadir "node3" init "genesis.json"
/* ทำการ 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
@Krucamper
Krucamper / create wallet account
Last active November 21, 2018 14:34
create wallet account
/** คำสั่งสร้างบัญชีกระเป๋าตังค์ **/
/** หลังจาก run คำสั่งนี้แล้ว ระบบจะให้ใส่รหัสผ่าน เตรียมปากกากระดาษไว้จดด้วยนะครับ **/
personal.newAccount()
@Krucamper
Krucamper / cp command linux
Created November 22, 2018 12:49
command linux cp
cp [option] [File หรือ Directory ต้นทาง] [File หรือ Directory ปลายทาง]
/** คัดลอกfile file1.txt ไปที่ file2.txt **/
cp file1.txt file2.txt
/** ทำการคัดลอก file ทั้งหมดของ exam1 ไปที่ exam2 **/
cp -rv exam1 exam2
@Krucamper
Krucamper / ethereum-account.json
Created November 22, 2018 15:16
Example Fie Ethereum account
{
"address": "6b8d87e6b66dde76d95588f83be1d39c4cedd80c",
"crypto": {
"cipher": "aes-128-ctr",
"ciphertext": "c4fd6d58e52490b90551b4efc766aa778c3acefba56f303a1dcc09265fc8d5df",
"cipherparams": {
"iv": "147d9c489d02074ff8156b7690c3be48"
},
"kdf": "scrypt",
"kdfparams": {
@Krucamper
Krucamper / eth-node-Information
Created November 23, 2018 10:58
check blockchain node Information
admin.nodeInfo
or
admin.nodeInfo.enode