Neon Labs recently partnered with Robonomics Network to validate the readiness of the Neon platform for production using a complex workflow. The exercise involved deploying and testing Robonomics’ smart contracts to Neon EVM. The deployed contracts allow cyber-physical systems (robots) to perform certain actions based on technical-economic transactions.
Neon Labs 最近与 Robonomics网络(机器人经济学) 合作,使用复杂的工作流程验证 Neon 平台是否已准备好进行生产。该练习涉及将 Robonomics 的智能合约部署和测试到 Neon EVM。部署的合约允许网络物理系统(机器人)根据技术经济交易执行某些操作。
In the Robonomics network, engagement is formed between two parties: the Promisee, who orders the service, provides a technical task description and funds for its execution, and the Promisor, who actually executes the service. The interaction is coordinated by a special node called the Provider. The Provider is constantly observing the network for signals from Promisee and Promisor.
在 Robonomics 网络中,参与在两方之间形成的:订购服务的承诺人,提供技术任务描述和执行资金,以及实际执行服务的被承诺人。交互由称为Provider(供应者) 的特殊节点协调。Provider(供应者) 不断观察网络以获取来自 承诺人和被承诺人的信号。
The exercise examined a common use case flow:
该练习检查了一个常见的用例流程:
1.A contract between a Promisee and a Promisor was established.
承诺人和被承诺人之间的合约成立
2.The resulting “work/action” was executed by the Promisor and validated by a third party.
由此产生的“工作/行动”由承诺人执行并由第三方验证
3.The node that facilitated the contract between the two parties (Promisee and Promisor) was paid a commission.
促成双方(承诺人和被承诺人)之间合约的节点获得了佣金。
For the commissioned work/action, a simulation of a robotic arm performed a sequence of actions based on the contract between the Promisee and Promisor. Telemetry data representing the robot’s actions was recorded by the robot and saved in order to verify the completion of work.
对于委托的工作/动作,机器人手臂的模拟根据承诺人和被承诺人之间的合约执行一系列动作。代表机器人动作的遥测数据由机器人记录并保存,以验证工作是否完成。
谁是Robonomics?(Who is Robonomics?)
Robonomics Network is an open-source IoT application platform that aims to leverage decentralized architecture by atomically transferring technical and financial data between user applications, IoT services, and sophisticated robotics. Launching secure, serverless dApps that put user data privacy and device security first at every level of communication is made easy by Robonomics.
Robonomics网络是一个开源物联网应用平台,旨在通过在通过以下方式利用去中心化架构架构:用户应用、物联网服务和复杂机器人技术之间自动传输技术和财务数据。 Robonomics 可以轻松启动安全的无需服务器的,将用户数据隐私和设备安全放在各个通信级别首位的dApp。
我们的目标 (Our Objective)
The objective of deploying and testing the Robonomics smart contracts via Neon EVM was to verify the efficacy of the Neon network with complex workflows. That workflow involves:
通过 Neon EVM 部署和测试 Robonomics 智能合约的目的是通过复杂的工作流验证 Neon 网络的有效性。该工作流程涉及:
1.A successful commitment between a Promisee and a Promisor as defined by a Liability contract. The Liability contract is a smart contract that replicates the regular connection between a service’s Promisee (the consumer) and Promisor (the services provider). It also includes the technical and financial terms of their exchange. The Promisee and Promisor can be autonomous agents or humans.
责任 合同所定义的承诺人与被承诺人之间的成功承诺。责任合约是一个智能合约,它复原了服务的承诺者(消费者)和被承诺者(服务提供者)之间的常规连接。还包括他们交换的技术和财务条款。 承诺人和被承诺人可以是自主代理或人类。
2.A payment to the Promisor (service provider) by the Promisee after the successful execution of an agreed upon “work/action”.
承诺人在成功执行约定的“工作/行动”后向被承诺人(服务提供商)付款。
3.A verification of the Promisor’s agreed upon “work/action” by a third party observing the Neon network.
由观察 Neon 网络的第三方对承诺人同意的“工作/行动”进行验证。
测试方法 (Testing Methodology)
To simulate a use case involving fully automated businesses and services delivered by cyber-physical systems (CPS), we chose a scenario with two autonomous agents acting as Promisee and Promisor. The use case illustrates how future “smart cities” or enterprises might make use of blockchain networks. Neon EVM’s success with this use case will demonstrate its viability as a cutting-edge product.
为了模拟涉及由网络物理系统 (CPS) 提供的全自动业务和服务的用例,我们选择了一个场景,其中两个自治代理分别充当承诺人与被承诺人。该用例说明了未来的“智慧城市”或企业如何利用区块链网络。 Neon EVM 在此用例上的成功将证明其作为尖端产品的可行性。
The testing will assess the Liability contract life cycle in the Robonomics network as depicted below:
该测试将评估 Robonomics 网络中的责任合同生命周期,如下所示:
The illustration shows the actions that are taken to construct a Liability contract. First, the Robonomics network provider calls the Lighthouse contract, a special smart contract that executes a transaction when a Provider node establishes a market match between a Promisee and a Promisor pair. The Lighthouse contract in turn calls the Factory contract. Information regarding the transaction, including the terms of reference, payment for the service, the address of the validator, and the deadline, is contained in the Liability contract.
该图显示了为构建责任合同而采取的行动。首先,Robonomics 网络提供商调用Lighthouse 合约,这是一个特殊的智能合约,当Provider在承诺人和被承诺人之间建立匹配时会产生一个交易。 Lighthouse 合约又调用 Factory 合约。有关交易的信息,包括职权范围、服务付款、验证者的地址和截止日期,都包含在责任合同中。
The team implemented a robot launch scenario through a Liability contract similar to this example in order to replicate the Robonomics infrastructure on the Neon network. If you’re interested in more potential use cases for Robonomics, check out the Robonomics R&D page.
该团队通过类似于 这个例子 的责任合约实施了机器人启动场景,以便在 Neon 网络上复制 Robonomics 基础设施。如果您对 Robonomics 的更多潜在用例感兴趣,请查看 Robonomics 研发页面。
测试范围 (Testing Scope)
The scope of the testing focused on the deployed contracts:
测试的范围集中在已部署的合约上:
测试执行 (Testing Execution)
The Robonomics team began the simulation by creating an offer message and a demand message from the Promisee. During this stage, the team expected the open offer message and demand message to trigger the creation of a Liability contract via the Lighthouse contract’s createLiability function.
Robonomics 团队通过创建来自被承诺人的报价消息和需求消息来开始模拟。在这个阶段,团队期望公开报价消息和需求消息,通过 Lighthouse 合约的 createLiability 函数触发创建一个责任合约。
Following the creation of the Liability contract, the XRT contract was observed to verify that tokens were transferred correctly from the Promisee’s address to the address of the Liability contract
在创建责任合约之后,观察到 XRT 合约验证代币是否正确地从承诺人的地址转移到了责任合约的地址。
Once the new Liability contract was detected on the Neon devnet, the Promisor agent (simulated robot) began working according to the instructions in the Liability contract. The telemetry data representing the simulated robot’s work output was written to a file and sent to IPFS. The hash of the telemetry data file was saved as a result.
一旦在 Neon devnet 上检测到新的责任合同,被承诺人的代理(模拟机器人)就开始按照责任合同中的说明工作。代表模拟机器人工作输出的遥测数据被写入文件并发送到 IPFS。结果,遥测数据文件的哈希值被保存。
The Liability contract was then finalized using the Lighthouse contract’s finalizeLiability() function. In the final phase, the Robonomics team confirmed that tokens were transferred from the Liability contract’s address to the addresses of the Promisor and Validator.
然后使用 Lighthouse 合约的 finalizeLiability() 函数完成责任合约。在最后阶段,Robonomics 团队确认代币已从责任合约的地址转移到被承诺人和验证人的地址。
You can watch a recording of the process here. Below is a diagram outlining the test scenario on Neon EVM.
您可以在 此处 观看该过程的记录。下图概述了 Neon EVM 上的测试场景。
The project deliverables include source code for the Robonomics contracts and the source code for implementing the test scenario. All the contracts are written for Solidity 0.5.0. As such, no changes were required when deploying and using the contracts on Neon EVM. Step-by-step instructions for launching the test exercise can also be found in README.md
项目可交付成果包括Robonomics 合约的源代码 和[实现测试场景的源代码](https://github.com/Multi-Agent-io /霓虹灯库卡演示)。所有合约都是为 Solidity 0.5.0 编写的。因此,在 Neon EVM 上部署和使用合约时无需进行任何更改。也可以在 README.md 。所有合约都是为 Solidity 0.5.0 编写的。因此,在 Neon EVM 上部署和使用合约时无需进行任何更改。启动测试练习的分步说明也可以在 README.md 中找到。
发现 (Findings)
All contracts functioned as expected. The simulated robot fulfilled its obligation to the Promisee party and delivered a file with telemetry data documenting its actions. The Provider node also correctly facilitated the engagement between the Promisor (simulated robot) and Promisee, and was compensated accurately for its involvement. The work output was also verified by a third party.
所有合约都按预期运行。模拟机器人履行了对承诺人的义务,并交付了一份包含遥测数据的文件,记录了其行为。Provider(供应者) 节点也正确地促进了被承诺人(模拟机器人)和承诺人之间的接合,并因其参与得到了准确的补偿。工作输出也经过第三方验证。
In regards to Neon platform drawbacks, the Robonomics team noted an interesting network trait to be investigated by Neon Labs:
关于 Neon 平台的缺点,Robonomics 团队注意到 Neon Labs 需要研究的一个有趣的网络特征:
Neon EVM does not have a WS/WSS endpoint. Unlike Ethereum, Neon EVM doesn’t have a WS/WSS endpoint, which makes it impossible to subscribe to events from the network. As a result, the Robonomics Team monitored the events manually during testing.
Neon EVM 没有 WS/WSS 端点。 与以太坊不同,Neon EVM 没有 WS/WSS 端点,因此无法从网络订阅事件。因此,Robonomics 团队在测试期间手动监控事件。
结论 (Conclusion)
Now it’s your turn to deploy your smart contracts to Neon EVM. Make sure to let us know what you think. If you have any issues or need additional guidance, check out our Neon Docs or reach out to a team member on Discord. We know that you’ll create something great!
现在轮到您将智能合约部署到 Neon EVM。请务必让我们知道您的想法。如果您有任何问题或需要更多指导,请查看我们的 Neon Docs 或通过 Discord 联系团队成员/邀请。我们知道你会创造出伟大的东西!