spring-boot - 使用 rpc 连接到 cordapp 时出现错误 404
问题描述
我正在尝试制作一个简单的 Cordapp,并尝试通过 Spring Boot 应用程序使用 rpc 连接到它。Cordapp 和 Spring Boot 应用程序都可以正常工作,没有任何错误,但是在通过邮递员发出请求时显示错误 404。我不知道我做错了什么。有人可以帮我弄这个吗?
我的 Spring Boot 应用程序的 application.properties 文件:
server.contextPath=/Chubb-Insurance
server.port=7090
node.PartyA.rpc.hostport=localhost:50004
db.connection=jdbc:h2:tcp://localhost:2005/node
nodename=insurer
logging.level.org.springframework.web=DEBUG
cron.expression=0 0 0 01 * ?
debit.point.qry.gt.200=100
debit.point.qry.gt.30
我的控制器:
我用于 cordapp 的 build.graddle 文件:
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
directory "./build/nodes"
node {
name "O=Notary,L=London,C=GB"
notary = [validating: true]
rpcSettings {
address("localhost:10008")
adminAddress("localhost:10048")
}
p2pPort 10006
cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10007
rpcSettings {
address("localhost:50004")
adminAddress("localhost:50005")
}
//webPort 10009
h2Port 59001
cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10010
rpcSettings {
address("localhost:50006")
adminAddress("localhost:50007")
}
//webPort 10012
h2Port 59002
cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyC,L=Sydney,C=AU"
p2pPort 10013
rpcSettings {
address("localhost:50008")
adminAddress("localhost:50009")
}
// webPort 10015
h2Port 59003
cordapps = ["$corda_release_group:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
解决方案
看起来您还没有将自己的 cordapps 添加cordapps
到build.gradle
. 在那里添加它们,它应该可以工作。
推荐阅读
- react-native - 如何正确使用 Expo.DocumentPicker.getDocumentAsync。[博览会] [ReactNative]
- java - 在 java 项目中打开和关闭 2 个不同的扫描仪
- testing - 如何在 Scalatra 测试请求中提供 cookie?
- javascript - 使容器消失后显示带有按钮的容器
- javascript - 如何在asp net中的dbmodel的剃刀视图中显示来自父类的更多字段
- javascript - Manually creating a object list on Mongoose
- java - 转到 RecyclerView 上选择的项目
- amazon-web-services - AWS CLI cp 不会第二次复制文件
- mysql - 将 CONSTRAINT 与 FOREIGN KEY 一起使用
- windows - 八度包安装在 Windows 上不成功