- contracts
- CrowdFunding.sol
- HelloWorld.sol
- MatchMaker.sol
- utils
- gensis.json
- mineWhenNeeded.js
- addDefaultAccount_in_Gensis.js
- call_CrowdFunding.js
- call_HelloWorld.js
- call_MatchMaker.js
- deploy_contract.js
- package.json
- geth_firstRun .sh
- geth_start .sh
-
# On Ubuntu sudo apt-get update sudo apt-get install ethereum # On Mac brew tap ethereum/ethereum brew install ethereum
-
初始化區塊鏈環境
./geth_firstRun.sh
-
安裝相關套件
sudo npm install
-
執行區塊鏈server
./geth_start.sh
-
開啟另一個terminal並部署合約上去
node deploy_contract.js
-
複製顯示的地址到call_HelloWorld.js的第9行
-
呼叫合約
node call_HelloWorld.js
- ERROR: Invalid Address
- Invalid asm.js: Invalid member of stdlib
Solution: Add "--no-warnings" while using node
node --no-warnings deploy_contract.js
- Error: invalid argument 0: json: cannot unmarshal hex string of odd length into Go value of type hexutil.Bytes
Solution: 合約有寫錯
- BigNumber Error: new BigNumber() not a base 16 number
Solution: 合約的Construct寫錯
- https://ethereum.stackexchange.com/questions/729/how-to-concatenate-strings-in-solidity
- https://stackoverflow.com/questions/54499116/how-do-you-compare-strings-in-solidity
- https://ethereum.stackexchange.com/questions/63515/how-to-access-string-arguments-from-calldata-in-external-functions-0-5-x
- https://ethereum.stackexchange.com/questions/45972/ive-got-an-error-while-compiling-use-constructor-instead