worldwide-asset-exchange / wax-blockchain-legacy

Worldwide Asset eXchange (WAX/wax.io) is an eos compatible blockchain and protocol token designed to make e-commerce transactions faster, easier, and safer.
https://developer.wax.io/
MIT License
125 stars 47 forks source link

[Question] curl: (7) Failed to connect to 127.0.0.1 port 8888: Connection refused #48

Open scheung38 opened 4 years ago

scheung38 commented 4 years ago

Inside docker wavdev:

top 1 root 20 0 18604 3484 2984 S 0.0 0.0 0:00.17 bash
19 root 20 0 221836 10532 9228 S 0.0 0.1 0:02.20 keosd
86 root 20 0 1586412 27976 25188 S 0.0 0.3 0:01.09 nodeos
93 root 20 0 36632 3144 2684 R 0.0 0.0 0:00.00 top

so keosd is already running:

root@4d34bf6cd380:/wax/wax-blockchain# nodeos -e -p eosio \

--plugin eosio::producer_plugin \ --plugin eosio::chain_api_plugin \ --plugin eosio::http_plugin \ --access-control-allow-origin='*' \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors >> nodeos.log 2>&1 & [2] 57

Then accessing API:

root@4d34bf6cd380:/wax/wax-blockchain# curl --request POST \

--url http://127.0.0.1:8888/v1/chain/get_info \ --header 'content-type: application/x-www-form-urlencoded; charset=UTF-8' curl: (7) Failed to connect to 127.0.0.1 port 8888: Connection refused

But expecting:

{
   "server_version":"448287d5",
   "chain_id":"cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
   "head_block_num":1937,
   "last_irreversible_block_num":1936,
   "last_irreversible_block_id":"000007905e94a4406ef34a227cf815154ac6886bf54deaa2d35db606cb4b667d",
   "head_block_id":"00000791a899e1751e60a13b77817f7243496cdd68010cd84505023200fd9e8a",
   "head_block_time":"2019-07-16T21:43:19.500",
   "head_block_producer":"eosio",
   "virtual_block_cpu_limit":1384557,
   "virtual_block_net_limit":7271761,
   "block_cpu_limit":199900,
   "block_net_limit":1048576,
   "server_version_string":"v1.7.3"
}

Doc says:

nodeos must be running to call this endpoint. If not, you’ll receive the following message:

But nodeos is running correct as top command shows?

themeadery commented 3 years ago

Please see the samples/mainnet directory and try cleos with the cleos.sh script, ./cleos.sh get info. I also believe you are missing a -p to expose the api, as seen in the samples/mainnet/nodeos.sh script.