-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
开放网络的账号如何获取余额 #40
Comments
你好,请问是开放网络还是测试网络呢?另外可以把代码发出来看下吗? |
account.setContractAccount("XC2554587461037348@xuper"); 是开放网络,试了在测试网络充值后result也是0 |
你好,你可以从开放网络把账户的私钥下载下来,然后使用这个私钥和合约账号进行部署合约,另外查询余额使用公私钥的对应地址试一下。在上面代码中,account 应该是你从开放网络下载的私钥加载出来的 account。可以参考:https://xuper.baidu.com/n/xuperdoc/advanced_usage/open_network.html |
account 是从开放网络下载的私钥加载出来的,试了用公私钥的对应地址查出来是293128,尝试给合约账号赚钱提示:Error TX_VERIFICATION_ERROR while PostTx,代码如下: |
不需要给合约账户转账,直接部署或者调用合约即可。你可以在浏览器上部署一个合约然后用sdk调用测试一下,然后可以使用sdk进行部署合约。另外开放网络是不支持转账操作的。 |
浏览器上部署的合约sdk是可以调用,用SDK部署合约就会报错:TX_VERIFICATION_ERROR while PostTx |
使用的配置文件是 sdk.yaml 还是 sdk.testnet.yaml ? |
sdk.yaml |
发一下完整的调用代码吧,开放网络部署合约使用的是充值在工作台的资源,getBalance入参应该是 account.address。 |
endorseServiceHost: "39.156.69.83:37100" |
Config.setConfigInputStream(new ClassPathResource("sdk.yaml").getInputStream()); //abi和bin由Counter编译而来,在自建节点通过命令行可以部署 |
com.baidu.xuper.config.Config.setConfigPath(); |
开放网络创建的合约账号,充值后调用接口余额依然为0导致SDK创建合约失败Error TX_VERIFICATION_ERROR while PostTx
The text was updated successfully, but these errors were encountered: