Kirtan Patel
Kirtan Patel

Reputation: 57

How can an agent package/start another agent?

If I have an Agent A that is installed and running on the platform, can I start an Agent B from within Agent A? (similar to the way volttron-ctl commands work from terminal)

Context: I want to do this because I need Agent B to make a RPC to Agent A, but Agent B needs to know Agent A's peer name in order to make this call (so I could pass this into the config of Agent A if I made it from within Agent B). I just need an alternative to hard coding the peer name each time I want to use Agent B to make an RPC to Agent A, which I'm hoping this will do.

Upvotes: 2

Views: 129

Answers (1)

Craig
Craig

Reputation: 949

Please take a look at the voltron central agent and the volttron central platform agent.

https://github.com/VOLTTRON/volttron/blob/develop/services/core/VolttronCentralPlatform/vcplatform/agent.py#L821

Basically all instances (platform instances) have a service with a vip identity of control. You will use that to start stop install modify etc the agents on that instance. I would recommend using the volttron central platform agent for this, however you can repeat it if you want.

If you do chose to use the volttron central platform agent then you will want to give your agent the manager authorization as those agents with that privilege are the only ones that can call those rpc methods (in the develop branch).

Upvotes: 1

Related Questions