https://hackernoon.com/your-private-solidity-variable-is-not-private-save-it-before-it-becomes-public-52a723f29f5e
上面範例中,play(100)被呼叫後,從transcation data內得知
0x6587f6ec0000000000000000000000000000000000000000000000000000000000000064
然後先取得play()這部份的data
bytes4(keccak256(‘play(uint)'))
然後得知 0000000000000000000000000000000000000000000000000000000000000064 就是 uint部份,得到的這個值是經過hex才顯示的
byte32:00 為1個byte(16 bits),共32個
64=> 6 * (16^1) + 4 * (16^0) = 100
uint256 => 2^256 => 8^32 => byte32
https://github.com/poanetwork/blockscout/tree/master/docker
https://embark.status.im/docs/cockpit_dashboard.html
What this Error? Example:
transaction A get nonce 1
transaction B get nonce 2
transaction C get nonce 3
But blockchain package B、C first, then package A. If happen this step, get error.
With truffle? Because
Normal
const wallet = new HDWalletProvider(mnemonic, url, id); const AContract = new TruffleContract(Json_contract); AContract.setProvider(wallet); wallet.addresses[] AContract. use contract api Sometime you call contract “set/write” api two times.
Example:
Create contract first. Write data into contract second.
https://medium.com/taipei-ethereum-meetup/%E4%BB%A5%E5%A4%AA%E5%9D%8A%E7%A7%81%E7%B6%B2%E5%BB%BA%E7%AB%8B-%E4%B8%80-43f8677fc9f8
如果要組成一個私人網路,同樣按照上面的流程建立其他節點。如果沒有下–nodiscover參數的話,最後節點應該會找到彼此。如果有下的話就必須用手動的方式加入其他節點,加入的方式有三種:
一是在geth指令加入–bootnodes參數;
二是進到console裡使用 admin.addPeer();
三是存成static-nodes.json檔,讓geth自動連線。
不管是使用哪一種,我們都要先知道要連到
static-nodes.json 裡面使用domain,可能會有問題,要自行更換ip
Example: geth --data ~/data cp static-nodes.json ~/data/geth/static-nodes.json static-nodes.json like this [ "enode://53999cc519079c5190798b1114bd16a05a8d5190796cc51907988a4e80ebda7b6c519079e56b0b161da3475c4dc62f6b51907967a6e327e46aa56329c519079f@192.168.0.10:30303" ]
geth新版的geth.log 會產生豪秒
舊 INFO [04-22|16:29:56]
新 INFO [03-28|13:43:35.004]
差別在.004
看log會發現只有logstash的warning,經同事正確解釋是:
>>因為logstash轉換出來的日期格式2019-03-28 13:43:35.004,Elasticsearch不認得,所以對logstash來說是Warning,但對Elasticsearch是Error,造成Log寫不進去~
所以在logstash.conf上必須在解析date上,補上 “YYYY-MM-dd HH:mm:ss,SSS”, “YYYY-MM-dd HH:mm:ss.SSS”
date { match => \[ "gethdate" , "YYYY-MM-dd HH:mm:ss", "YYYY-MM-dd HH:mm:ss,SSS", "YYYY-MM-dd HH:mm:ss.SSS"\] target => "gethdate" timezone => "Asia/Taipei" } 這樣就可以正常匯入geth.log了
ethereum
ganache-cli https://github.com/trufflesuite/ganache-cli