EOS wallet API 报HTTP 400错误

服务器:192.168.8.144
按照官方的docker方式运行的,因为keosd(钱包)开出来的API只容许本地访问,即:
url --request POST --header 'Host: 0.0.0.0:5555' --url http://192.168.8.144:5555/v1/wallet/list_wallets是可以访问的,必须要指明Host: 0.0.0.0:5555

远程如何访问?

增加参数--http-alias

我的docker启动参数

CONTRACTS_DIR=/root/exchange/eos/contracts
docker run --name eosio \
  --publish 7777:7777 \
  --publish 192.168.8.144:5555:5555 \
  --volume $CONTRACTS_DIR:$CONTRACTS_DIR \
  --detach \
  eosio/eos:v1.4.2 \
  /bin/bash -c \
  "keosd --http-server-address=0.0.0.0:5555 --http-alias=192.168.8.144:5555 --access-control-allow-origin=localhost & exec nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_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:7777 --access-control-allow-origin=* --contracts-console --http-validate-host=false --filter-on='*'"

这样,远程也可以访问了,本地也不用显式指明Host了。

posted on 2018-11-20 19:42  angry-baby  阅读(370)  评论(0编辑  收藏  举报

导航