EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.6k forks source link

get no result when run curl http://localhost:8888/v1/chain/get_info #4658

Closed past2017 closed 6 years ago

past2017 commented 6 years ago

I install eosio by https://developers.eos.io/eosio-nodeos/docs/docker-quickstart docker step 1:

1. docker version
Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:17:20 2018
 OS/Arch:      linux/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:15:30 2018
  OS/Arch:      linux/amd64
  Experimental: false

step 2 docker pull eosio/eos-dev step 3 docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console" step 4. docker logs --tail 5 eosio

2776000ms thread-0   producer_plugin.cpp:1087      produce_block        ] Produced block 0000eb8e345760be... #60302 @ 2018-07-15T00:46:16.000 signed by eosio [trxs: 0, lib: 60301, confirmed: 0]
2776500ms thread-0   producer_plugin.cpp:1087      produce_block        ] Produced block 0000eb8f667e1a37... #60303 @ 2018-07-15T00:46:16.500 signed by eosio [trxs: 0, lib: 60302, confirmed: 0]
2777000ms thread-0   producer_plugin.cpp:1087      produce_block        ] Produced block 0000eb90713f73dc... #60304 @ 2018-07-15T00:46:17.000 signed by eosio [trxs: 0, lib: 60303, confirmed: 0]
2777500ms thread-0   producer_plugin.cpp:1087      produce_block        ] Produced block 0000eb91d20d51b1... #60305 @ 2018-07-15T00:46:17.500 signed by eosio [trxs: 0, lib: 60304, confirmed: 0]
2778000ms thread-0   producer_plugin.cpp:1087      produce_block        ] Produced block 0000eb92edcce82a... #60306 @ 2018-07-15T00:46:18.000 signed by eosio [trxs: 0, lib: 60305, confirmed: 0]

step 5: docker ps and netstan image

step 6: curl http://localhost:8888/v1/chain/get_info

eos@bkex-real-wallet-usdt-3:~/image/eos/Docker$ curl http://localhost:8888/v1/chain/get_info
eos@bkex-real-wallet-usdt-3:~/image/eos/Docker$ 
eos@bkex-real-wallet-usdt-3:~/image/eos/Docker$

it looks step 1~step 4 run well, but run step 5, i get nothing Please help me, thank you very much

wanderingbort commented 6 years ago

Please try curl with http://127.0.0.1:8888 or whitelist the use of the localhost by adding it as an alias with --http-alias=localhost:8888 on the docker run command line for nodeos

On Sat, Jul 14, 2018, 8:54 PM past2017 notifications@github.com wrote:

I install eosio by https://developers.eos.io/eosio-nodeos/docs/docker-quickstart docker step 1:

  1. docker version Client: Version: 18.03.1-ce API version: 1.37 Go version: go1.9.5 Git commit: 9ee9f40 Built: Thu Apr 26 07:17:20 2018 OS/Arch: linux/amd64 Experimental: false Orchestrator: swarm

Server: Engine: Version: 18.03.1-ce API version: 1.37 (minimum version 1.12) Go version: go1.9.5 Git commit: 9ee9f40 Built: Thu Apr 26 07:15:30 2018 OS/Arch: linux/amd64 Experimental: false

step 2 docker pull eosio/eos-dev step 3 docker run --rm --name eosio -d -p 8888:8888 -p 9876:9876 -v /tmp/work:/work -v /tmp/eosio/data:/mnt/dev/data -v /tmp/eosio/config:/mnt/dev/config eosio/eos-dev /bin/bash -c "nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::wallet_plugin --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console" step 4. docker logs --tail 5 eosio

2776000ms thread-0 producer_plugin.cpp:1087 produce_block ] Produced block 0000eb8e345760be... #60302 @ 2018-07-15T00:46:16.000 signed by eosio [trxs: 0, lib: 60301, confirmed: 0] 2776500ms thread-0 producer_plugin.cpp:1087 produce_block ] Produced block 0000eb8f667e1a37... #60303 @ 2018-07-15T00:46:16.500 signed by eosio [trxs: 0, lib: 60302, confirmed: 0] 2777000ms thread-0 producer_plugin.cpp:1087 produce_block ] Produced block 0000eb90713f73dc... #60304 @ 2018-07-15T00:46:17.000 signed by eosio [trxs: 0, lib: 60303, confirmed: 0] 2777500ms thread-0 producer_plugin.cpp:1087 produce_block ] Produced block 0000eb91d20d51b1... #60305 @ 2018-07-15T00:46:17.500 signed by eosio [trxs: 0, lib: 60304, confirmed: 0] 2778000ms thread-0 producer_plugin.cpp:1087 produce_block ] Produced block 0000eb92edcce82a... #60306 @ 2018-07-15T00:46:18.000 signed by eosio [trxs: 0, lib: 60305, confirmed: 0]

step 5: docker ps and netstan [image: image] https://user-images.githubusercontent.com/25541244/42729486-997a1a08-880c-11e8-8b6b-984f92698faa.png

step 6: curl http://localhost:8888/v1/chain/get_info

eos@bkex-real-wallet-usdt-3:~/image/eos/Docker$ curl http://localhost:8888/v1/chain/get_info eos@bkex-real-wallet-usdt-3:~/image/eos/Docker$ eos@bkex-real-wallet-usdt-3:~/image/eos/Docker$

it looks step 1~step 4 run well, but run step 5, i get nothing Please help me, thank you very much

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EOSIO/eos/issues/4658, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYR4lXYMvzp_ctaJzxHngjiMR4khS5Tks5uGpLPgaJpZM4VQEXp .

past2017 commented 6 years ago

it looks --http-validate-host=false should be set

lijameshao commented 6 years ago

try curl http://0.0.0.0:8888/v1/chain/get_info

lcgogo commented 6 years ago

--http-validate-host=false is work for me.

awesometype commented 6 years ago

where should i set http-validate-host=false

awesometype commented 6 years ago

oh i know

and you should docker stop eosio first then set http-validate-host=false

it works for me too

{ server_version: "75635168", chain_id: "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f", head_block_num: 1645, last_irreversible_block_num: 1644, last_irreversible_block_id: "0000066c7911cbbe4b5e5270850dac8df50923a81afe03944ffb1d4ace321016", head_block_id: "0000066d069c4fe5c5769e5668223d6afebdc614a2b2b745edc0bbe85c529ec8", head_block_time: "2018-07-19T08:51:48.000", head_block_producer: "eosio", virtual_block_cpu_limit: 1033918, virtual_block_net_limit: 5429658, block_cpu_limit: 199900, block_net_limit: 1048576 }