Open michielbdejong opened 3 months ago
I should use new Earthstar.ReplicaDriverMemory(shareKeypair.shareAddress)
instead of new Earthstar.ReplicaDriverWeb(shareKeypair.shareAddress)
I can now write message from src/server/sync_test.ts to src/client/chat.js but not yet in the other direction
I need to decide whether to plug LedgerLoops into an Earthstar node or plug Earthstar into a LedgerLoops node.
Given that I was already using the BasicMessageForwarder
and BatchedMessageForwarder
in Strategy Pit, it might make a lot of sense to plug in there.
Also, I want to have code where Earthstar is easily pluggable/replaceable with e.g. Cabal, SSB, Braid, etc.
At the same time, moving beyond proof-of-concept with this, I want the strategies to be pluggable. So I think what I need is a base object where you plug in a messenger and a strategist.
I think this repo should export an implementation of MessageForwarder. For now, I'll also implement the simulator in it, since that is just like 20 lines of code. And I'll use Saiga from the local checkout next to it, the factory makes it too complicated.
I eventually want to run this in separate processes but as a first step I'll just have a single MessageForwarder object, like I did in Strategy Pit, just going over Earthstar each time instead of directly delivering messages through in-process memory.
Trouble is the MessageForwarder from Strategy Pit wants to deal with Node
objects, maybe it should just emit events instead?
I think I want to run the agents from the terminal (with deno), not from browser windows. So I can use src/server/sync_test.ts as a starting point. Have to work out how to send/receive messages there, maybe I can copy that from src/client/chat.js