Skip to content
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

创建合约账户,io.grpc.StatusRuntimeException: UNAVAILABLE #28

Open
lamaxiyali opened this issue Dec 23, 2021 · 8 comments
Open

Comments

@lamaxiyali
Copy link

Exception in thread "main" java.lang.RuntimeException: io.grpc.StatusRuntimeException: UNAVAILABLE
at com.baidu.xuper.api.Proposal.build(Proposal.java:193)
at com.baidu.xuper.api.XuperClient.invokeContract(XuperClient.java:114)
at com.baidu.xuper.api.XuperClient.createContractAccount(XuperClient.java:172)
at Demo2.main(Demo2.java:17)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:240)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:221)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:140)
at com.baidu.xuper.pb.XchainGrpc$XchainBlockingStub.preExecWithSelectUTXO(XchainGrpc.java:1763)
at com.baidu.xuper.api.Proposal.build(Proposal.java:187)
... 3 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:162)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
at java.net.Socket.connect(Socket.java:606)
at java.net.Socket.connect(Socket.java:555)
at java.net.Socket.(Socket.java:451)
at java.net.Socket.(Socket.java:261)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:277)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:552)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

代码

// 1、创建钱包账户
Account account = Account.create(1,1);
// 2、连接节点
XuperClient xuperClient = new XuperClient(ip+ ":37101");
// 3、创建合约账户
xuperClient.createContractAccount(account,"1111111111111112");

@lamaxiyali
Copy link
Author

lamaxiyali commented Dec 23, 2021

版本:xuperchain:5.1.0 sdk:0.2.0

为什么连不上区块链呢

@godeamon
Copy link
Collaborator

@lamaxiyali
配置文件中的 isNeedComplianceCheck 改成 false 试一下。

@lamaxiyali
Copy link
Author

lamaxiyali commented Dec 23, 2021

@lamaxiyali 配置文件中的 isNeedComplianceCheck 改成 false 试一下。

还是一样的错误,请问有没有示例的demo我测试一下?

这是我的sdk.yaml文件,我就是linux按照官网起了一个单节点实例网络,用java sdk测试就是这个错误

endorseServiceHost: "ip地址:37101"
complianceCheck:
是否需要进行合规性背书
isNeedComplianceCheck: false
是否需要支付合规性背书费用
isNeedComplianceCheckFee: true
合规性背书费用
complianceCheckEndorseServiceFee: 400
支付合规性背书费用的收款地址
complianceCheckEndorseServiceFeeAddr: aB2hpHnTBDxko3UoP2BpBZRujwhdcAFoT
如果通过合规性检查,签发认证签名的地址
complianceCheckEndorseServiceAddr: jknGxa6eyum1JrATWvSJKW3thJ9GKHA9n
创建平行链所需要的最低费用
minNewChainAmount: "100"
crypto: "xchain"

@godeamon
Copy link
Collaborator

你要连接本地自己搭建的节点还是要连接开放网络?

@lamaxiyali
Copy link
Author

你要连接本地自己搭建的节点还是要连接开放网络?

自己在虚拟机上搭建的网络

@godeamon
Copy link
Collaborator

先用 xchain-cli 试一下节点是否正常。

@lamaxiyali
Copy link
Author

先用 xchain-cli 试一下节点是否正常。

可以啦,刚节点确实是有问题,我重新搭建了一个可以连上创建账户了,谢谢哈

@godeamon
Copy link
Collaborator

不客气,可以加入百度超级链微信群随时沟通。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants