我似乎无法干净地运行example-cordapp。
我正在关注以下教程: https://docs.corda.net/tutorial-cordapp.html#opening-the-example-cordapp-in-intellij
gradle构建运行后,我收到以下警告(不确定是否相关):
Duplicate content roots detected: Path [C:/Users/Andrew/Desktop/CordaProjects/samples/cordapp-example/config/dev] of module [cordapp-example.clients.main] was removed from modules [cordapp-example.workflows-java.main, cordapp-example.workflows-kotlin.main]
然后,当我尝试运行“ Run Example Cordapp”配置时,按照指示按绿色箭头,然后继续出现以下错误。 它打开一个窗口,要求我指定模块。我使用cordapp-example,但是会产生以下错误:
Class 'com.example.test.NodeDriverKt' not found in module cordapp-example
我已经完成了Java,Intellij的干净重建,并且重新克隆了存储库。我不确定从这里去哪里。我完全按照教程学习。
我也尝试过这里给出的建议,只是得到了同样的错误: error Class 'com.example.NodeDriverKt' not found in module 'cordapp-example'
对此将提供任何帮助
答案 0 :(得分:0)
请更改以下文件中的代码 样本/cordapp-example/workflows-kotlin/src/test/kotlin/com/example/test/NodeDriver.kt 希望它对您有用
fun main(args: Array<String>) {
val user = User("user1", "test", permissions = setOf("ALL"))
driver(DriverParameters(waitForAllNodesToFinish = true)) {
val nodeFutures = listOf(
startNode(
providedName = CordaX500Name("PartyA", "London", "GB"),
customOverrides = mapOf("rpcSettings.address" to "localhost:10008", "rpcSettings.adminAddress" to "localhost:10048", "webAddress" to "localhost:10009"),
rpcUsers = listOf(user)),
startNode(
providedName = CordaX500Name("PartyB", "New York", "US"),
customOverrides = mapOf("rpcSettings.address" to "localhost:10011", "rpcSettings.adminAddress" to "localhost:10051", "webAddress" to "localhost:10012"),
rpcUsers = listOf(user)),
startNode(
providedName = CordaX500Name("PartyC", "Paris", "FR"),
customOverrides = mapOf("rpcSettings.address" to "localhost:10014", "rpcSettings.adminAddress" to "localhost:10054", "webAddress" to "localhost:10015"),
rpcUsers = listOf(user)))
val (nodeA, nodeB, nodeC) = nodeFutures.map { it.getOrThrow() }
startWebserver(nodeA)
startWebserver(nodeB)
startWebserver(nodeC)
}