在作业定义中连接任务结果?
在 Chainlink 的作业定义中,开发人员如何连接两个结果,例如字符串(而不是值的总和)?我在下面提供了一种理想的方法。
example1:
$(result1) + $(result2)
example2:
string_result_1 [type="jsonparse" path="$(decode_cbor.path_1)" data="$(fetch_encoded)"]
string_result_2 [type="jsonparse" path="$(decode_cbor.path_2)" data="$(fetch)"]
encode_data [type="ethabiencode" abi="(bytes32 requestId, bytes result)" data="{ \\"requestId\\": $(decode_log.requestId), \\"assetId\\": $(string_result_1) + $(string_result_2) }"]
我希望能够通过连接两个结果来发出新的 GET 请求。
Within Chainlink a Job definition, how would developers go about concatenating two results, like strings (Not the sum of values)? I provided an ideal approach below.
example1:
$(result1) + $(result2)
example2:
string_result_1 [type="jsonparse" path="$(decode_cbor.path_1)" data="$(fetch_encoded)"]
string_result_2 [type="jsonparse" path="$(decode_cbor.path_2)" data="$(fetch)"]
encode_data [type="ethabiencode" abi="(bytes32 requestId, bytes result)" data="{ \\"requestId\\": $(decode_log.requestId), \\"assetId\\": $(string_result_1) + $(string_result_2) }"]
I want to be able to make a new GET request by concatenating the two results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要执行 多字响应 请求,然后执行链上的串联。节点尚不支持作业定义级别的串联
You would need to do a multi-word response request, and then do the concatenation on-chain. The nodes do not support concatenation at the job definition level yet
根据您的设置,您还可以耕种所有繁重的举重,即弦乐串联和响应准备对a 链条外部适配器。
Depending on your setup, you could also farm all that heavy lifting, i.e. the string concatenation and response prep to a Chainlink External Adapter.