1、用docker-machine建立開發環境 (VM),vm內的docker 環境是完整的,自己灌很浪費時間
http://sueboy.blogspot.com/search/label/docker-machine
然後 記得vm裡面跑 portainer.io 管理docker用,web介面
會省下你一大堆時間!
以上這個步驟是快速建立可以跑docker環境,然後又可以用圖形管理看log、砍image等等
2、docker 一般操作網路上都有,一定要看,就算有圖形化介面,有些時候你還是需要指令
記得一件事,要學docker-compose,然後基本上專案用docker,更正確來說,是要會用、會寫docker-compose
docker-compose 會比 單純用docker,好用很多
http://sueboy.blogspot.com/2018/12/ethereum-poa-docker-compose-docker.html
3、注意iptables,用docker後,常常會碰到iptables的問題,網路有問題,不能連,連不上,解答:把docker服務重開,就會重新設定iptables…這一堆人死在這上面
如果docker服務重開後,網路還是不行,我建議是用docker-machine重建一台vm比較快,再用docker-compose重新執行,比較快,省時間
4、通常用了docker的後端,十之八九就會想上K8s (kubernets)
到這階段就是超級大坑了!!!
非常大的坑! 會死人的坑! 到這階段千萬要避開,一定要避開!
坑指自架
node-gyp rebuild failed windows 10
npm install --global windows-build-tools
https://www.npmjs.com/package/windows-build-tools
https://stackoverflow.com/questions/32457761/how-to-solve-node-gyp-rebuild-issue-on-windows-10
https://www.npmjs.com/package/windows-build-tools
https://stackoverflow.com/questions/32457761/how-to-solve-node-gyp-rebuild-issue-on-windows-10
truffle truffle-hdwallet-provider Error: Error: the tx doesn't have the correct nonce. account has nonce of: 3 tx has nonce of: 2
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. This two step are in one function. This mean is you call two time "new HDWalletProvide". Usually you think “New“ two time is ok, get "new" instance. But
https://github.com/trufflesuite/truffle-hdwallet-provider/blob/master/index.js
function HDWalletProvider(
mnemonic,
provider,
address_index=0,
num_addresses=1,
shareNonce=true,
wallet_hdpath="m/44'/60'/0'/0/"
) {
shareNonce default is true. new HDWalletProvide use same Nonce.
Answer is shareNonce => false, when you set/update data into to contract use api.
訂閱:
文章 (Atom)