我从runnode转到了docker-compose with partya/b和公证节点。一个使用runnode的用例不再工作了,显然它一定与新的网络设置有关。我试图下载这些工具,但大多数下载链接都不起作用。谁能给我一个提示,我能做什么?rest服务器通过rpc调用party-a,它在一段时间后抛出一个错误,如下所示:
api-gateway | D 17:47:23 71 RPCClientProxyHandler.artemisMessageHandler - Got message from RPC server Observation(id=99f3bc35-10ec-4b0f-8fa2-15156fec43e4, timestamp: 2019-06-25T17:47:15.587Z, entityType: Invocation, content=[rx.Notification@66fc17ad OnNext [(0, Starting), (0, Generating transaction.), (0, Verifying contract constraints.), (0, Signing transaction with our private key.), (1, Collecting signatures from counterparties.), (1, Verifying collected signatures.), (0, Gathering the counterparty's signature.), (1, Collecting signatures from counterparties.), (1, Verifying collected signatures.), (0, Obtaining notary signature and recording transaction.), (1, Requesting signature by notary service), (2, Requesting signature by Notary service), (2, Validating response from Notary service), (1, Broadcasting transaction to participants), (0, Done)]], deduplicationIdentity=fb9d4547-bd57-4b50-81e0-a6a01077b4a2)
party-a | [ERROR] 17:47:25+0000 [nioEventLoopGroup-2-1] netty.AMQPChannelHandler.invoke - Provided certificate subject O=PartyA, L=London, C=GB not in expected set [O=Notary, L=London, C=GB] {allowedRemoteLegalNames=O=Notary, L=London, C=GB, localCert=O=PartyA, L=London, C=GB, remoteAddress=localhost/127.0.0.1:10002, remoteCert=O=PartyA, L=London, C=GB, serverMode=false}
party-a | [ERROR] 17:47:25+0000 [nioEventLoopGroup-2-1] netty.AMQPClient.invoke - Blocking future connection attempts to localhost:10002 due to bad certificate on endpoint
party-a | [ERROR] 17:47:26+0000 [nioEventLoopGroup-2-2] netty.AMQPClient.nextTarget - No targets have presented acceptable certificates for [O=Notary, L=London, C=GB]. Halting retriesDocker Compose:
version: '3'
services:
notary:
depends_on:
- "party-a"
container_name: notary
image: notary
build: build/nodes/Notary
party-a:
container_name: party-a
image: party-a
build: build/nodes/PartyA
party-b:
depends_on:
- "party-a"
container_name: party-b
image: party-b
build: build/nodes/PartyB
api-gateway:
depends_on:
- "notary"
container_name: api-gateway
image: api-gateway
build: server/
ports:
- 8080:8080部署节点:
task deployNodes(type: net.corda.plugins.Dockerform, dependsOn: ['jar']) {
nodeDefaults {
cordapp project(':contracts')
cordapp project(':workflows')
}
node {
name "O=Notary,L=London,C=GB"
rpcUsers = rpcUsersList
notary = [validating: false]
useTestClock true
p2pAddress "localhost:10002"
rpcSettings {
address("0.0.0.0:10003")
adminAddress("0.0.0.0:10004")
}
}
node {
name "O=PartyA,L=London,C=GB"
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
useTestClock true
p2pAddress "localhost:10002"
rpcSettings {
address("0.0.0.0:10003")
adminAddress("0.0.0.0:10004")
}
}
node {
name "O=PartyB,L=New York,C=US"
rpcUsers = rpcUsersList
useTestClock true
p2pAddress "localhost:10002"
rpcSettings {
address("0.0.0.0:10003")
adminAddress("0.0.0.0:10004")
}
}
new File('build/nodes').mkdir()
new File('build/nodes/docker-compose.yml')
}连接到A方的API网关:
FROM java:8
ADD build/libs/server-0.1.jar server-0.1.jar
ENV JPDA_ADDRESS="8000"
ENV JPDA_TRANSPORT="dt_socket"
ENTRYPOINT ["java", \
"-jar", \
"server-0.1.jar", \
"--config.rpc.host=party-a", \
"--config.rpc.port=10003", \
"--config.rpc.username=user1", \
"--config.rpc.password=test"]发布于 2019-06-26 15:04:28
您需要将本地主机部分替换为目录网络的IP地址:https://docs.docker.com/v17.09/engine/userguide/networking/#default-networks
还要确保在每个容器上公开正确的端口,以便其他容器可以访问它们:https://docs.docker.com/compose/networking/
我怀疑您得到的错误是因为PartyA连接到它自己,而不是连接到运行公证节点的容器
https://stackoverflow.com/questions/56759705
复制相似问题