VOLTTRON RPC 从外部调用 VOLTTRON 代理

VOLTTRON RPC call to agent from outside VOLTTRON

您可以从 VOLTTRON 外部调用 RPC 端点吗?如果是这样,调用 VOLTTRON 代理 RPC 端点所需的所有身份验证是什么?

例如,当向导工具生成代理时,我创建了一个包含 RPC 端点方法的 agent with the agent creation wizard

@RPC.export
def rpc_method(self, arg1, arg2, kwarg1=None, kwarg2=None):
    """
    RPC method
    May be called from another agent via self.core.rpc.call
    """
    return self.setting1 + arg1 - arg2

这是另一个关于如何使用 RPC 的 SO post,但我认为这个 RPC 调用是在框架本身内进行的,而不是来自外部的 RPC 调用: How to use RPC with Volttron

是否有我可以使用的任何 RPC 测试工具,例如 REST API 测试工具或 python 包?我是否需要 'vctl auth add' 用于 VOLTTRON 外部的身份验证?

为了从 volttron 外部调用,必须建立代理连接才能使用 rpc 功能。 examples/StandaloneListener 就是一个很好的例子。一旦与 volttron 建立连接,您就可以调用允许的 rpc 函数。