- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
将 corda 升级到版本 4 后,我收到 net.corda.core.transactions.MissingContractAttachments:找不到 com.template.contract.ServiceContractnull 的契约(Contract)附件。
此流在本地工作,但在部署到 Azure 时会引发错误消息。
我有
@InitiatingFlow
@StartableByRPC
class CreateServiceFlow(val serviceState: ServiceState) : FlowLogic<SignedTransaction>() {
override val progressTracker = ProgressTracker()
@Suspendable
override fun call(): SignedTransaction {
serviceHub.vaultService.queryBy<ServiceState>().states.forEach{
if (it.state.data.serviceName == serviceState.serviceName) {
throw Exception("There can be only one ${serviceState.serviceName} service per service " +
"provider")
}
}
val notary = serviceHub.networkMapCache.notaryIdentities.first()
val serviceCommand = Command(
ServiceContract.Commands.IssueService(),
serviceState.participants.map { it.owningKey }
)
val builder = TransactionBuilder(notary = notary)
.addOutputState(serviceState, ServiceContract.SERVICE_CONTRACT_ID,
constraint = AlwaysAcceptAttachmentConstraint)
.addCommand(serviceCommand)
builder.verify(serviceHub)
val partSignedTx = serviceHub.signInitialTransaction(builder)
val otherPartySession = initiateFlow(serviceState.accountOperator)
val fullySignedTx = subFlow(CollectSignaturesFlow(partSignedTx, setOf(otherPartySession)))
return subFlow(FinalityFlow(fullySignedTx, setOf(otherPartySession)))
}
}
@InitiatedBy(CreateServiceFlow::class)
class IssueServiceResponder(val otherPartySession: FlowSession) : FlowLogic<SignedTransaction>() {
@Suspendable
override fun call(): SignedTransaction {
val signTransactionFlow = object : SignTransactionFlow(otherPartySession) {
override fun checkTransaction(stx: SignedTransaction) = requireThat {
"there should be no inputs" using(stx.inputs.isEmpty())
"there should be one output" using(stx.tx.outputStates.size == 1)
"The state should serviceState" using(stx.tx.outputStates.single() is ServiceState)
}
}
val txId = subFlow(signTransactionFlow).id
return subFlow(ReceiveFinalityFlow(otherPartySession, expectedTxId = txId))
}
}
package com.template.contract
@LegalProseReference(uri = "<prose_contract_uri>")
class ServiceContract : Contract {
companion object {
@JvmStatic
val SERVICE_CONTRACT_ID = "com.template.contract.ServiceContract"
}
val legalContractReference: SecureHash
get() = SecureHash.randomSHA256()
interface Commands : CommandData {
class IssueService : TypeOnlyCommandData(), ServiceContract.Commands
class AddServiceData : TypeOnlyCommandData(), ServiceContract.Commands
class AddPartner: TypeOnlyCommandData(), ServiceContract.Commands
class RemovePartner: TypeOnlyCommandData(), ServiceContract.Commands
class ExitService : TypeOnlyCommandData(), ServiceContract.Commands
}
override fun verify(tx: LedgerTransaction) {....
}
net.corda.core.transactions.MissingContractAttachments: Cannot find contract attachments for com.template.contract.ServiceContractnull. See https://docs.corda.net/api-contract-constraints.html#debugging
at net.corda.core.transactions.TransactionBuilder.selectAttachmentThatSatisfiesConstraints(TransactionBuilder.kt:445) ~[corda-core-4.0.jar:?]...
{
"wire": {
"id": "3EDD9204FF70AF2B36D78219690946004C7D5625D347F04EE55980A8600141BF",
"notary": "O=NetworkMapAndNotary, L=Helsinki, C=FI",
"inputs": [],
"outputs": [
{
"data": {...},
"contract": "com.template.contract.ServiceContract",
"notary": "O=NetworkMapAndNotary, L=Helsinki, C=FI",
"encumbrance": null,
"constraint": {
"@class": "net.corda.core.contracts.AlwaysAcceptAttachmentConstraint"
}
}
],
"commands": [
{
"value": {
"@class": "com.template.contract.ServiceContract$Commands$IssueService"
},
"signers": [
"GfHq2tTVk9z4eXgyVMCDbvndZWywoFqaPKbGgxeqVUEVBYgpNTqFTqc7mVqe",
"GfHq2tTVk9z4eXgyWB97whuGdtsB8c7EByHbsTxkdsNq695JX8PKSwDPq3d9"
]
}
],
"timeWindow": null,
"attachments": [
"17B22D590137C675AC1B61B7052CCEF739AA36223865BBFF707E6CB2F933FBF0"
],
"references": [],
"privacySalt": "0AFC86A1BBF6D897CCC5AA56F0FC0474DE4CD618FF040BAA96293BAA1BCDBCAF",
"networkParametersHash": "31AF29974115E6BE4418C4080F58DFD77F301E45DC35A05DB855B0D1B25966B2"
},
"signatures": [...]
}
最佳答案
在您的 Azure 部署中,您是否使用 devMode=false
运行在您的 node.conf
?
可能是您的代码由只能在开发模式下使用的 corda dev key 签名(因为 key 不安全),这意味着部署的节点没有加载您的 CorDapp。
为了测试这是否是您的 azure 部署中的问题,您可以尝试将此行添加到您的 node.conf
:
cordappSignerKeyFingerprintBlacklist=[]
关于kotlin - 找不到流量的契约(Contract)附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57656140/
有没有其他方法可以直接使用 terraform 启用这些规则,而无需在 GCP 中创建单独的防火墙规则,然后将标签附加到计算引擎 目前我正在这样做 resource "google_compu
全民国家安全日活动 免费抽随机话费、流量 微信打开链接进入活动 下拉页面点击【我要抽奖】进去完成两个任务获得两次抽奖机会 可抽2-10元话费以及流量 抽奖非必中 仅限移动用户参与 活动期间内每日
随着人们的紧凑生活,从事互联网行业的人大多都把一天的时间安排的满满的,这用户忙碌的时候,根本无心去关注你的推广,只有抓住了用户零零碎碎的时间对其进行推广,同时他也能打发无聊的时间,这样的效果就非常轻
我建立了一个库来做 IGMP 的东西。现在,愚蠢的是,我的图书馆还进行了存在监控以确保其他人仍然是该组的一部分。 IGMP 在较低级别做完全相同的事情。分开消息,轮询路由器它仍然是同一组的一部分,整个
我经营一个具有广告集成功能的媒体网站。最近,我们发现很多人滥用这一点,通过在上传内容上进行流量交换来获取虚假收入。最流行的可能是使用 HitLeap Viewer 应用程序的 HitLeap。 我很好
上下文: 所以我在 AKS 集群中有一个测试脚本;此脚本使用 Azure Active Directory 中的用户的单点登录功能登录到站点。 测试脚本位于集群 A 中,站点位于集群 B 中。还为集群
是否可以指示 Fiddler 仅显示定向到特定主机名的流量?也就是说Fiddler流量可以针对Host进行过滤吗? 最佳答案 请参阅此屏幕截图。位于屏幕的右上方 关于fiddler - 过滤 Fidd
这个问题在这里已经有了答案: Android 8: Cleartext HTTP traffic not permitted (36 个回答) 2年前关闭。 我正在从事一个项目,但我被困在登录/注册页
我有一个 Android VOIP 应用程序。由于某些网络会阻止 VOIP 流量,因此我想找到一些绕过阻止的方法。我认为 VPN 可以做到这一点,但没有任何 VPN 解决方案可以轻松实现。使用 And
我构建了使用 SignalR 的服务器和客户端代码。该网站运行良好,但我在任何浏览器(chrome、IE、Firefox)中都看不到网络流量。我知道网络流量在那里,因为该网站正在运行。 有没有办法在浏
我实现了一个自制的嗅探器(基于 winpcap),并尝试在浏览 HTTPS 网站(gmail 和 facebook)时使用它来嗅探 TCP 连接上的端口 443,但我的代码无法检测到任何流量。 我研究
是否可以使用 Android 手机收集同一小区内手机的 IMEI 或唯一手机 ID?可能已经有一些 hack 可以使用 osmocom ...我正在寻找的是一个易于工作的解决方案来扫描交通(通过计算汽
此 Android 代码是否是在通话期间测试 http 网络可用性的正确方法,或者它是否排除了应包含的网络,反之亦然: public boolean isOnline() { Telephon
我需要能够加密从 Web 服务器到数据库服务器的 MySQL 流量。我知道如何根据 my.cnf 中的服务器和客户端设置将 MySQL 设置为使用 SSL,但是,这需要使用 PHP 中的 mysql_
我想查看所有传出 USB 的流量,并可能根据内容策略阻止进出 USB 的数据交易。这将如何完成?有什么方法可以在 C# 中实现此目的,还是它更像是 C++ 类型的问题? 最佳答案 您可以使用类似 Cr
我需要捕获进程进行的 TCP 通信。但是,我不能只运行该进程,查找其 PID,然后捕获。我需要获取启动后立即发生的通信。 它显然是通过未知端口(不是 80)向另一个进程发出 JSON 请求,该进程注册
如果我有一个名为 www.testsite.com 的页面,并且我使用 url 中的查询字符串链接到该页面,是否可以以某种方式将相同的查询字符串附加到所有传出链接/流量? 例如,假设我像这样链接到该页
我在我的机器上运行本地 HTTP 代理服务器并执行一些日志记录。我也想记录 SSL 流量。为此,我运行了另一个用 Python 编写的代理服务器,它充当 SSL 服务器,带有我的自签名证书,HTTP
我正在编写一个应该检测 VPN 流量的程序。据我了解这个主题,似乎隧道协议(protocol)的检测就像防火墙规则一样容易,使用它们的专用端口: PPTP: 端口 1723/TCP OpenVPN:端
所以,情况是:我想知道程序将请求发送到什么路径。使用 Wireshark,我只能知道它发送的是 https 请求和相应的域,但不知道路径。 我认为即使不破解程序也可以至少检查出站 https 流量。
我是一名优秀的程序员,十分优秀!