Ethereum version
0.4.25
0.5.1
0.6.10(final exam)
컨트랙 결합 사용시 0.5대에서는 작동 안되어서 0.6.10으로 버전 upgrade를 진행하였다.
gas를 줄일수 있으면 줄이는 것이 좋다!
반복문이나 연산을 많이하면 gas 비용이 많이 발생
오류의 절반은 버전 문제인 경우가 많다..
geth 콘솔 열기(새로운 cmd), geth 접속한 상태로 해야함
geth attach http :// localhost :8445
계정 확인하기 (jupyter notebook)
!geth - exec eth .accounts attach http :// localhost :8445
eth .getBalance (eth .accounts [0 ]);
miner .start ()
miner .stop ()
authentication 오류 뜰 때 (geth 콘솔)
personal .unlockAccount (eth .coinbase ); #하고 비밀번호 입력
mining 하기(pending 해소) (geth 콘솔)
miner .start (1 );admin .sleepBlocks (1 );miner .stop ();
#sleepBlocks(숫자)를 조절해준다.
가나슈(ganache) 실행하기 (새로운 cmd)
node_modules .bin \ganache - cli .cmd - p 8345
.js 파일 node로 실행하기 (새로운 cmd)
C :\Users \minji \Code \201 810808 > node src / OrderEventUse .js
# 학번경로 폴더에서
node js파일주소
# 이렇게 입력한다.
UnhandledPromiseRejectionWarning
Returned error: VM Exception while processing transaction: out of gas
The contract code couldn't be stored, please check your gas limit.
Returned error: intrinsic gas too low at Object.ErrorResponse
Invalid JSON RPC response: "" at Object.InvalidResponse
connection not open on send()
Returned values aren't valid, did it run Out of Gas?
Expected identifier but got '(' fallback () external { ^
Indexed expression has to be a type, mapping or array (is tuple(uint256,uint256))
myBank.methods.getBalance(...).call.then is not a function
Expected primary expression.
Provided address "undefined" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can't be converted.