EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 462 forks source link

Not getting chain_id in eos.getInfo({}) #170

Closed isha-padalia closed 6 years ago

isha-padalia commented 6 years ago

image

And also getting warning "WARN: chainId mismatch, signatures will not match transaction authority. expected cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f !== actual undefined".

I am using code shown below:

eos = Eos({ httpEndpoint: 'http://127.0.0.1:8888', chainId: "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f", sign: true, authorization: "eosio", keyProvider: "5JT4LZDq5HGzfSeQPYBb74rLbrhef2KBrXFtG3g4Sb9ZkGEgAms" })

jcalfee commented 6 years ago

Check the version table in the README. Ideally upgrade nodeosd and eosjs to the latest versions. The get_info API call did not include chainId until recently.

isha-padalia commented 6 years ago

screenshot from 2018-06-08 10-28-09

Got chain_id by re-cloning and rebuilding EOS v1.0.1.

actual problem was the version of EOS. chain_id not included in other old version of EOS as @jcalfee said.

quocle108 commented 6 years ago

@isha-padalia I've used EOS v1.0.1 in Docker. But there is no chain_id when i tried to get infor. Do you use Docker?

$ cleos get info
{
  "server_version": "19227c9b",
  "head_block_num": 2164,
  "last_irreversible_block_num": 2163,
  "head_block_id": "00000874c0c465a43ac5e7327b7ce3e0fc3d36796f81d7750a6db2b6164db06d",
  "head_block_time": "2018-06-16T04:07:04",
  "head_block_producer": "eosio"
}
quocle108 commented 6 years ago

I've solved this issue. For the docker, we should get the last image by command: docker pull eosio/eos:latest