以太坊学习笔记(三):cannot unmarshal hex string without 0x prefix

背景

最近通过SDK调用以太坊合约,在部署合约时出现:

chainID:  10001
2022/03/10 15:59:33 failed to deploy demo: json: cannot unmarshal hex string without 0x prefix into Go struct field Header.miner of type common.Address

解决思路

主要尝试以下方法:

1、将address前面加上0x,结果是不起作用

2、更换版本
将引用的以太坊包换成1.10.11版本,之前用的是以太坊最新版本1.10.16;
重新编译运行后问题解决

猜你喜欢

转载自blog.csdn.net/yunlilang/article/details/123406845
hex