automerge / automerge-repo-rs

MIT License
39 stars 6 forks source link

Multiple streams, and TCP example #8

Closed gterzian closed 1 year ago

gterzian commented 1 year ago

How to run the tcp example:

in two separate terminal windows:

  1. cargo run --example tcp-example -- --run-ip 0.0.0.0:3001 --other-ip 0.0.0.0:3000
  2. cargo run --example tcp-example -- --run-ip 0.0.0.0:3000 --other-ip 0.0.0.0:3001

And then press ctr-c. A successful run prints out "Stopped".

gterzian commented 1 year ago

@alexjg Ready for review (why is Orion's handle not showing up here?)

Regarding the business logic, these are more proposals obviously, but the TCP example and 'one adapter per connected remote" stuff opened-up some interesting ideas about how to start syncing with a remote without passing document Id's out of band. So this is a first pass at addressing those issues as well.

orionz commented 1 year ago
  • cargo run --example tcp-example -- --run-ip 0.0.0.0:3001 --other-ip 0.0.0.0:3000
  • cargo run --example tcp-example -- --run-ip 0.0.0.0:3000 --other-ip 0.0.0.0:3001

This should be in the readme

gterzian commented 1 year ago
  • cargo run --example tcp-example -- --run-ip 0.0.0.0:3001 --other-ip 0.0.0.0:3000
  • cargo run --example tcp-example -- --run-ip 0.0.0.0:3000 --other-ip 0.0.0.0:3001

This should be in the readme

done

gterzian commented 1 year ago

Merging this because some of the stuff is needed to look into storage(such as bootstrapping a document when we receive a sync message about it but we don't have it yet and we could ask storage), while looking further into https://github.com/automerge/spanreed/pull/9