klaytn / klaytn-contracts-old

MIT License
75 stars 75 forks source link

Fails to run Local Klaytn Network #6

Closed sgc109 closed 2 years ago

sgc109 commented 2 years ago

When I run following command after pulling master branch, installing required packages, and running ganache without any configuration changes, it prints out an error.

➜  klaytn-contracts git:(master) ✗ npm run run:klaytn            

> klaytn-contract@1.0.0 run:klaytn /Users/kakao/work/klaytn-contracts
> ./test/prepare.sh

~/work/klaytn-contracts/test ~/work/klaytn-contracts
~/work/klaytn-contracts ~/work/klaytn-contracts/test
./init_accounts.sh: line 7: jq: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to localhost port 8551: Connection refused
FUND_ADDR = 
curl: (7) Failed to connect to localhost port 8551: Connection refused
(node:56739) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
    at /Users/kakao/work/klaytn-contracts/test/init_accounts.js:9:26
    at Object._fireError (/Users/kakao/work/klaytn-contracts/node_modules/caver-js/packages/caver-utils/src/index.js:63:9)
    at /Users/kakao/work/klaytn-contracts/node_modules/caver-js/packages/caver-core-method/src/index.js:255:22
    at /Users/kakao/work/klaytn-contracts/node_modules/caver-js/packages/caver-core-requestmanager/src/index.js:151:28
    at XMLHttpRequest.request.onreadystatechange (/Users/kakao/work/klaytn-contracts/node_modules/caver-js/packages/caver-core-requestmanager/caver-providers-http/src/index.js:122:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/kakao/work/klaytn-contracts/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (/Users/kakao/work/klaytn-contracts/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpRequestError (/Users/kakao/work/klaytn-contracts/node_modules/xhr2-cookies/dist/xml-http-request.js:349:14)
    at ClientRequest.<anonymous> (/Users/kakao/work/klaytn-contracts/node_modules/xhr2-cookies/dist/xml-http-request.js:252:61)
    at ClientRequest.emit (events.js:400:28)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:56739) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:56739) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
~/work/klaytn-contracts/test
~/work/klaytn-contracts

But, all tests just work well with $ npm run test:ganache.

sgc109 commented 2 years ago

Resolved after installing jq