PS C:\Users\JYAHN\Desktop\jeannft\console> truffle console --network cypress
C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\eachOfLimit.js:61
callback(null);
^
Error: When requesting the chain id from the node, itreturned the malformed result undefined.
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\truffle-hdwallet-provider-klaytn\src\index.ts:232:19
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules@trufflesuite\web3-provider-engine\index.js:240:9
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\once.js:12:16
at replenish (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\eachOfLimit.js:61:25)
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\eachOfLimit.js:71:9
at eachLimit (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\eachLimit.js:43:36)
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\doLimit.js:9:16
at end (C:\Users\JYAHN\Desktop\jeannft\console\node_modules@trufflesuite\web3-provider-engine\index.js:217:5)
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\truffle-hdwallet-provider-klaytn\dist\subproviders\provider.js:19:5
at XMLHttpRequest.request.onreadystatechange (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\caver-js\packages\caver-core-requestmanager\caver-providers-http\src\index.js:122:13)
at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request.ts:345:8)
at IncomingMessage. (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:387:35)
at IncomingMessage.emit (domain.js:470:12)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
truffle에서 cypress 콘솔에 접근하려고 하면 이런 에러가 납니다. deploy할 때도 마찬가지입니다.
truffle-config.js 내용은 아래와 같습니다.
cypress: {
provider: () => {
const option = {
headers: [
{
name: "Authorization",
value: "Basic " + kas,
},
{ name: "x-chain-id", value: "8217" },
],
keepAlive: false,
};
return new HDWalletProvider(
privateKey,
new Caver.providers.HttpProvider(
"https://node-api.klaytnapi.com/v1/klaytn",
option
)
);
},
network_id: "8217", //Klaytn baobab testnet's network id
gas: "850000000",
gasPrice: "25000000000",
},
baobab은 접속이 잘 됩니다.