在升级EOS到dawn 4.2 之后之前运行好好的Dapp报error 3090003

EOS的配置如下

const EOS_CONFIG = {
  contractName: "dapp.token", // Contract name
  contractReceiver: "eosio", // User executing the contract (should be paired with private key)
  clientConfig: {
    keyProvider: '5KeqsXty9Sa8GfJgNfkckYxKKGcAWE4AWmUHiw6ifDcnaa2i', // Your private key
    httpEndpoint: 'http://192.168.1.112:8888' // EOS http endpoint
  }
}

返回

{"code":500,"message":"Internal Service Error","error":{"code":3090003,"name":"unsatisfied_authorization","what":"provided keys, permissions, and delays do not satisfy declared authorizations","details":[{"message":"transaction declares authority '{\"actor\":\"eosio\",\"permission\":\"active\"}', but does not have signatures for it under a provided delay of 0 ms","file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}]}}

问题分析:
是因为新版本EOS配置或者请求时需要添加EOS链上chain_id
chain_id可以通过cleos get info获取到

如果获取没有的话,先确认下本地Eos的版本,或者在build完,没有在build目录下执行 make install

EOS的配置修改如下

const EOS_CONFIG = {
  contractName: "dapp.token", // Contract name
  contractReceiver: "eosio", // User executing the contract (should be paired with private key)
  clientConfig: {
    keyProvider: '5KeqsXty9Sa8GfJgNfkckYxKKGcAWE4AWmUHiw6ifDcnaa2i', // Your private key
    httpEndpoint: 'http://192.168.1.112:8888', // EOS http endpoint
    chain_id: "706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"
  }
}