• 카테고리

    질문 & 답변
  • 세부 분야

    블록체인

  • 해결 여부

    미해결

truffle migrate 시에 Given value "TxTypeLegacyTransaction" is not a valid hex string 에러가 발생합니다

21.09.21 19:16 작성 조회수 236

1

안녕하세요 에러가 발생했는데 도저히 원인을 알 수가없어서 질문 남깁니다.

1_initial_migration.js Deploying 중에 발생합니다.

> transaction hash:    0x10b818d4bbbe7658e0a4ab3042b072c716ceb88c50888733ec38182e30e89afb

   ⠦ Blocks: 0            Seconds: 0

Error: Given value "TxTypeLegacyTransaction" is not a valid hex string.

    at Object.hexToNumber (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-utils/lib/utils.js:205:1)

    at Method.outputTransactionFormatter (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/lib/formatters.js:214:1)

    at Method.web3.eth.getTransaction.method.outputFormatter (/usr/local/lib/node_modules/truffle/build/webpack:/packages/interface-adapter/dist/shim/overloads/ethereum.js:52:1)

    at Method.formatOutput (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-eth/node_modules/web3-core-method/lib/index.js:146:1)

    at sendTxCallback (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-eth/node_modules/web3-core-method/lib/index.js:522:1)

    at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3/node_modules/web3-core-requestmanager/lib/index.js:307:1

    at /Users/h662/Node/bapp/crypto-ytt-starter/node_modules/@trufflesuite/web3-provider-engine/index.js:240:9

    at /Users/h662/Node/bapp/crypto-ytt-starter/node_modules/async/internal/once.js:12:16

    at replenish (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/async/internal/eachOfLimit.js:61:25)

    at /Users/h662/Node/bapp/crypto-ytt-starter/node_modules/async/internal/eachOfLimit.js:71:9

    at eachLimit (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/async/eachLimit.js:43:36)

    at /Users/h662/Node/bapp/crypto-ytt-starter/node_modules/async/internal/doLimit.js:9:16

    at end (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/@trufflesuite/web3-provider-engine/index.js:217:5)

    at /Users/h662/Node/bapp/crypto-ytt-starter/node_modules/truffle-hdwallet-provider-klaytn/dist/subproviders/provider.js:19:5

    at XMLHttpRequest.request.onreadystatechange (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/caver-js/packages/caver-core-requestmanager/caver-providers-http/src/index.js:119:13)

    at XMLHttpRequestEventTarget.dispatchEvent (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)

    at XMLHttpRequest._setReadyState (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/xhr2-cookies/xml-http-request.ts:219:8)

    at XMLHttpRequest._onHttpResponseEnd (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/xhr2-cookies/xml-http-request.ts:345:8)

    at IncomingMessage.<anonymous> (/Users/h662/Node/bapp/crypto-ytt-starter/node_modules/xhr2-cookies/xml-http-request.ts:311:39)

    at IncomingMessage.emit (events.js:327:22)

    at endReadableNT (internal/streams/readable.js:1327:12)

    at processTicksAndRejections (internal/process/task_queues.js:80:21)

 

노드 모듈 같은거는 캐시 날린다음 전부 재설치 해봤는데도 같은 에러가 발생합니다.
구글링중 관련에러가 있어서 주소 공유남깁니다.
https://forum.klaytn.com/t/given-value-txtypelegacytransaction-is-not-a-valid-hex-string/1574/5

 

감사합니다!

 

답변 1

답변을 작성해보세요.

2

Roty Lim님의 프로필

Roty Lim

2021.09.29

제가 알기로 트러플 버전이달라서 그런걸로 알고있습니다.

일단 npm uninstall -g truffle 해주시고요

 

npm install -g truffle@5.1.23 으로 해주시면 될것같습니다. 공식 포럼에 나온답변입니다.

 

아마 Truffle version이 호환되지 않는 것 같습니다.

공식 문서상에서는 v5.0.26까지 지원한다고 적혀있고, 제가 개인적으로 테스트한 버전은 5.1.23입니다. 이런 버전들로 사용해 보시길 부탁드립니다.

추가적으로 GitHub - klaytn/klaytn-contracts 5 이 깃헙 코드도 참고 부탁드립니다.

클레이튼에서 트러플로 빌드하는 기본적인 환경이 설정되어 있습니다.

감사합니다.