16 Apr 2022
購買網域並使用Cloudflare配置DNS後,想在github page勾選Enforce https讓網頁可以進行安全連線,卻發現如下問題:

原因:
Cloudflare會預設啟用代理功能(顯示Proxied的橘色雲朵狀態),因此github沒辦法查看生成證書需要的DNS資訊。
解決方法:
將和github page有關的DNS設定改為灰色雲朵DNS only,回到github page頁面,重新設定一次custom domain。
資料來源
06 Apr 2022
test 智能合約時,透過ethers.getSigners()建立Signer並使用
跑 npx hardhat test 發現問題:Error: invalid address or ENS name (argument=”name”, value=”<SignerWithAddress 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266>”, code=INVALID_ARGUMENT, version=contracts/5.6.0)

把alice使用console.log印出來看看

把 {from: alice}
改成 {from: alice.address}
Problem solved!
06 Mar 2022
當我在建置完geth客戶端私有鏈後,想要把truffle範例中的Metacoin部署上去,卻出現了以下的問題:

在genesis.json中定義的gasLimit是8000000,而現在的gasprice可以透過javascript console內的指令eth.gasPrice來查詢,得到如下圖結果:

解決辦法
如果是在私有鏈的情況下,可以透過在geth指令後方加上--miner.gasprice '0'
來解決這個問題。
加上此flag後再重啟客戶端,透過eth.gasPrice指令查詢,此時gasPrice變成0了!當然也就不會有insufficient funds的問題。
26 Feb 2022
當我在使用Docker啟用postgreSQL建置資料庫時,遇到了5432這個port被佔用的問題 (Ports are not available: listen tcp 0.0.0.0:5432: bind: address already in use)
按照官網說明使用:
之後,如果port還是被佔用的狀態,先用下面指令確認 port 5432 被佔用的狀況:
我的Mac是出現以下畫面

輸入下列指令
再確認一次應該就可以了!
26 Feb 2022
於terminal輸入:
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
輸入以下指令將.DS_Store加入.gitignore
echo .DS_Store >> .gitignore
commit .gitignore file
git add .gitignore
git commit -m '.DS_Store banished!'
資料來源