Tryorama: Players and agents

Hi,

using Tryorama I got confused with the terminology. There are players and agents. From what I understood an agent is a participant in a Holochain network. That’s also how it’s defined in the Glossary.

Technically an agent is a device which runs a Holochain instance. The HC instance in turn runs a conductor that “hosts all of the agent’s cells”, a cell being a DNA + the agent ID.

In Tryorama there are players in addition to all this. Allegedly a player is “very close to being the same as a single conductor”. That sounds like it’s pretty much the same as an agent in a HC network when you look at the definitions above.

But looking at the hierarchy according to the destructuring in the example

// a player is very close to being the same as a single conductor
const [player0] = await s.players([conductorConfig])

// a single player can have installed:
// many agents,
// many apps (collection of cells for an agent),
// and many cells (DNA + AGENT)

// pop off (destructure) the first agent, and the first happ within that
// of the resulting array of arrays
const [[agent0happ0]] = await player0.installAgentsHapps(conductorHapps)
const [agent0happ0cell0] = agent0happ0.cells

that doesn’t fit anymore. Here the hierarchy is players - agents - happs - cells. So a player can run multiple agents as it’s also stated in the comments.

What is a player then conceptually?

1 Like

From my understanding, the “conductor” is what installs the hApps and DNAs and manages the execution of those binaries. I think your confusion comes from taking the definition of agent too literally: an agent is a user. So the Conductor installs a hApp, and then executes it with an active user (agent). The technicality of saying that an agent is “a device” is just to make sure that you understand that if you as a person own use a holochain app on two separate devices, that there will be two separate “agents” (even though there is only one you).

I would also not necessarily think of this as a hierarchy. The conductor is a “container” where you can install happ bundles (collections of DNAs) and agents (“user profiles”). When the conductor “starts an app”, it spins up DNAs from the happ bundles and pairs them with one of those agents. A DNA can’t run without an agent. You can think of the DNA as “instructions” (this is the code that executes) and the agent as identity; only when the instructions have an identity associated with it do they form a live “cell”, which is a running instance of a DNA + Agent.

Not sure if this was that clear…


To try again:

“an agent is a device” yes, but the agent isn’t what runs the holochain instance. The “Holochain Instance” is at the top of the “hierarchy”. So from your example, it seems you’re saying:

Agent (Device) -> HC Instance -> Conductor

when it is actually

HC Instance -> Conductor -> Agent (Device-bound user)

2 Likes

@jakintosh Yeah, that makes sense to me. “Hierarchy” in the sense of one entity enclosing another entity.

when it is actually

HC Instance -> Conductor -> Agent (Device-bound user)

That means that an HC instance on a machine has a conductor and can have multiple agents. Which sounds like it’s the same as a player like mentioned here:

// a single player can have installed:
// many agents,
// many apps (collection of cells for an agent),
// and many cells (DNA + AGENT)

I’m getting to the core of my question :slightly_smiling_face:. If a player or a conductor can have many agents, are they a network? If I have multiple agents installed on the Holochain instance on my machine, I’m running a network of agents on it, am I not?

And if that’s the case, what is the use case for multiple players, if I can already simulate a network of agents with one player?

I think the importance of the player concept here is that you want to simulate an actually geographically distributed network somewhat where individual conductors have full view of all local agents and their data but not that of the agents of other players.

1 Like

Yes, understood, that’s a needed use case indeed.

What is an agent then? :grinning: The conductor runs on one physical machine, so what could be multiple agents on this one machine? Different users of the machine or different profiles of one user for example?

You can “be” or “have” a different agent in each Holochain application you participate with. At least that’s my understanding.

1 Like

Yeah, I think it’s what @bierlingm said. One “human” can have many agents associated with them, in some cases perhaps one for each app even on the same device. I believe that the “DeepKey” infrastructure is meant to make it easy to tie all of your many agents into one conceptual “person” unit, but I haven’t been able to read much lately about what is going on with DeepKey. Again, because an agent can only live on one device, using a holochain app on multiple devices will require you to have more than one agent anyway, so connecting multiple agents as one “person” is necessary either way.

1 Like