Console Client

To try the library, a simple console client has been built. It can be found in its dedicated GitHub repository here.

Features

Get it

Release 1.0.0 is available for download here.

Deployment

To simplify the deployment process of the library, a Shell script (deploy.sh) is provided in the Git repository. Before invoking, make sure that the project has been assembled. You may want to adjust the listed IP addresses to your needs.

Note: The provided RSA public and private key pair in this repository is only used for test purposes in the local network! Do not use it in your production environment! (Instead generate a new key pair as described here)

Usage

After downloading the client, you will find a ZIP archive in the target directory. To run the client, cd into the bin directory. In there, a log file (sync.log) and an executable bash script is placed.

Help

To display a short help message about the available commands, use

./sync help
To get help about a particular command, type
./sync help <commandName>

Intialise the Client

To create the default application configuration for P2P-Sync, run the following command:

./sync init -p <pathToTheSynchronisedFolder>
whereas <pathToTheSynchronisedFolder> should be replaced with an existing directory on your file system then used as synchronised folder. Besides creating the necessary directories for the shared folders, it will create the default configuration in your home directory (~/.syncconfig). To specify in which folder the configuration should be placed, add the flag -a <pathToConfigDir> to the command above.

Configuration

After having initialised the default configuration, particular values can be modified by using the command config. Use ./sync help config set-config to get a list of available config keys to set. Setting a new value for port, for example, is done by typing:

./sync config set-config --port 4004
To get the current value of a setting, use
./sync config get-config --port

Connect

To create a network using the machine on which the command is invoked, run

./sync connect -p <pathToTheSynchronisedFolder>
In case no default bootstrap location is configured, the node will start up as bootstrap peer. Otherwise, it will try to connect to the IP-address-port pair specified in the configuration.
In order to connect to a well-known node which has joined the network previously, type
./sync connect -p <pathToTheSynchronisedFolder> --bootstrap-ip <ipToNode> --bootstrap-port <portNrOfNode>
with <ipToNode> the ip address (IPv4 or IPv6) and <portNrOfNode> the port of the node to connect. The amendment of -a <pathToConfigFile> specifies the file in which the application configuration resides.

Sharing and Unsharing

After the node has been started successfully, a simple console interface allows to share files or directories within the specified synchronised folder.

Note: Sharing with the own user is not permitted. Any attempt in doing so will result in a sharing failure.

Clean Up

To clean all generated files (especially the configuration folder ~/.syncconfig and the object store in the synchronised folder), use

./sync clean --clean-all <pathToTheSynchronisedFolder>