README.md 1.79 KB
Newer Older
Dapperstout's avatar
Dapperstout committed
1
Pulse-Swift
2 3
==============

4
A port of the [Syncthing][1] synchronization protocol in Swift.
5

6 7 8 9 10
## Status

This library is still very much in development. It is not yet usable by any standard. Only the Block Exchange Protocol
layer and the Connection layer (see below) are completed.

11 12
## Building

13
To build, you need Xcode 7.3.
14
Open the .xcworkspace instead of the .xcodeproj, because it contains the CocoaPods dependencies.
15

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
## Architecture

The Pulse-Swift library is composed of several layers. Each layer only depends on the layers below.

    +----------------------------+
    |      Synchronization       |
    +-------------+--------------+
    |  Discovery  |  Connection  |
    +-------------+--------------+
    |   Block Exchange Protocol  |
    +----------------------------+

The synchronization layer ensures that files get synchronized between the current device and the device that you connect
to. It initiates discovery to find the device that you want to synchronize with, opens the connection, and starts
synchronizing files.

The discovery layer is responsible for finding other devices. Either on the local network by sending multicast or
broadcast UDP messages, or on the internet by using a discovery server.

The connection layer is responsible for connecting securely to a device. It initiates a TCP session, starts TLS
encryption, and sends and receives Block Exchange Protocol messages.

The lowest layer is the Swift implementation of the Block Exchange Protocol. These encode the binary messages that go
back and forth between two devices over a TCP socket. A full description of the protocol itself [can be found here][2].
The classes that implement the Block Exchange Protocol can be found in the pulse-swift/bep folder.

42
[1]: http://syncthing.net/
43
[2]: https://docs.syncthing.net/specs/bep-v1.html