|
1 | 1 |
|
2 | 2 | # redux-scuttlebutt
|
3 | 3 |
|
4 |
| -<!-- |
5 |
| -Self-replicating, self-ordering log of actions shared between all clients. |
6 |
| -Using the power behind redux's hot reloading and time travel, your client |
7 |
| -dispatches actions itself and so does every other client, they share the state, |
8 |
| -and it all just works. |
9 |
| ---> |
| 4 | +Self-replicating, self-ordering log of actions shared between peers. |
| 5 | +Using the power of time travel enabled by redux, your application |
| 6 | +dispatches and receives actions between its connected peers, creating an |
| 7 | +eventually consistent shared state. |
10 | 8 |
|
11 | 9 | ## scuttlebutt
|
12 | 10 |
|
13 | 11 | > This seems like a silly name, but I assure you, this is real science.
|
14 | 12 | > — [dominictarr/scuttlebutt](https://github.com/dominictarr/scuttlebutt)
|
15 | 13 |
|
16 | 14 | Efficient peer to peer reconciliation. We use it as the underlying
|
17 |
| -protocol to share dispatched redux actions among peers, and eventually agree on |
18 |
| -their order in time. As actions from the past arrive, we replay history as if |
19 |
| -they had always existed. |
| 15 | +protocol to share actions among peers, and to eventually agree on |
| 16 | +their logical order. When we encounter actions with a (one or more |
| 17 | +actions ago), we rewind and replay history in the correct order. |
20 | 18 |
|
21 |
| -A sample "server" peer is included, which might sync state changes to a |
22 |
| -database, write a persistent log, or manage system/world/NPC actors. |
| 19 | +For more about the protocol, read the |
| 20 | +[Scuttlebutt paper](http://www.cs.cornell.edu/home/rvr/papers/flowgossip.pdf). |
23 | 21 |
|
24 |
| -While it works great in a traditional client-server set up, you can flexibly |
25 |
| -upgrade/downgrade to peer-to-peer connections, go offline for minutes or days, |
26 |
| -and changes will sync when you next connect to another scuttlebutt instance. |
| 22 | +## use |
| 23 | + |
| 24 | +Add the store enhancer to your existing redux application and connect to a |
| 25 | +scuttlebutt peer. Peers will gossip and reconciliate any actions (received |
| 26 | +or dispatched) with all their connected peers. |
| 27 | +A sample "server" peer is included which could be extended to sync state changes |
| 28 | +with a database, write a persistent log, or manage system/world/bot actors. |
| 29 | + |
| 30 | +While it works great in a traditional client-server set up, you could flexibly |
| 31 | +upgrade/downgrade to peer-to-peer connections. The protocol supports going offline |
| 32 | +for any amount of time, and any changes will sync when you next connect to another |
| 33 | +scuttlebutt instance. |
27 | 34 |
|
28 | 35 | Note, by default, scuttlebutt itself does not make any guarantees of security or
|
29 | 36 | identity: peer `Bob` is able to lie to `Jane` about `Amy`'s actions. Security
|
30 | 37 | guarantees can added using the [`signAsync` and `verifyAsync`](#signasync--verifyasync)
|
31 | 38 | dispatcher options.
|
32 | 39 |
|
33 |
| -For more, read the [Scuttlebutt paper](http://www.cs.cornell.edu/home/rvr/papers/flowgossip.pdf). |
34 |
| - |
35 | 40 | ## dispatcher
|
36 | 41 |
|
37 | 42 | `Dispatcher` is our Scuttlebutt model. It handles remote syncing of local
|
|
0 commit comments