InitializationΒΆ

If you have not completed Installation, go back and install Dsynq before proceeding. Once you have Dsynq installed, check if it is on your PATH by printing its version.

> dsynq --version
Quantocyte Dsynq CE 0.11.3.467

Since you are new to Dsynq, we will take a step-by-step approach and show how to create a Git/Dsynq project from scratch. Of course, you can initialize Dsynq for any existing Git project as well.

Dsynq relies on Git to track changes in the project's source code. Start a new Git project hello-dsynq.

> mkdir hello-dsynq
> cd hello-dsynq
> git init
Initialized empty Git repository in C:/Users/dsynq/dsynq/docs/_examples/hello-dsynq/.git/

At this point the project directory contains only .git/.

> ls -la
total 4
drwxr-xr-x 1 dsynq 197121 0 Jun  8 07:18 .
drwxr-xr-x 1 dsynq 197121 0 Jun  8 07:18 ..
drwxr-xr-x 1 dsynq 197121 0 Jun  8 07:18 .git

Once a Git project is set up, initializing Dsynq is simply dsynq init.

> dsynq init
Checking requirements...
Creating data/...
Creating configs...
Updating .gitignore...

dsynq init makes a few changes to the project directory.

> ls -la
total 10
drwxr-xr-x 1 dsynq 197121  0 Jun  8 07:18 .
drwxr-xr-x 1 dsynq 197121  0 Jun  8 07:18 ..
drwxr-xr-x 1 dsynq 197121  0 Jun  8 07:18 .dsynq
-rw-r--r-- 1 dsynq 197121 26 Jun  8 07:18 .dsynqconfig.yaml
drwxr-xr-x 1 dsynq 197121  0 Jun  8 07:18 .git
-rw-r--r-- 1 dsynq 197121 51 Jun  8 07:18 .gitignore
drwxr-xr-x 1 dsynq 197121  0 Jun  8 07:18 data

As you can see, there are four new entries.

data/
This is the directory where all the project's binary and other data managed by Dsynq resides.
.dsynqconfig.yaml
It's one of the three Dsynq's identically structured configuration files. This file in the project's home directory is normally under version control by Git and the team shares it as the default Dsynq configuration for the project.
.dsynq/
This directory keeps a local copy of the configuration as well as the local state of the project's data. The settings in .dsynq/.dsynqconfig.yaml override the project defaults in .dsynqconfig.yaml.
.gitignore
Dsynq adds entries for data/ and .dsynq/.

Considering the fact that it's a Git project, it only makes sense to create an initial Git commit.

> git add .dsynqconfig.yaml .gitignore
> git commit -m "initial commit"
[master (root-commit) 07a9378] initial commit
 2 files changed, 5 insertions(+)
 create mode 100644 .dsynqconfig.yaml
 create mode 100644 .gitignore

The last step is to set up a remote Dsynq datastore as a destination for the local data/. For a new server, run dsynq remote init <URL> once. The URL is of the format ssh://<login>@<host>:</path/to/datastore>. The example below uses login dsynq at host example.com and names the datastore .dsynq_tutorials but you should use a URL pointing to your own Linux server.

> dsynq remote init ssh://dsynq@example.com:.dsynq_tutorials
login: dsynq
host: example.com
datastore: .dsynq_tutorials
Trying to connect to "dsynq@example.com"...
Connected successfully!
Updating the remote...
Local config saved
The remote datastore has been initialized successfully!

Dsynq saves the URL as the default one in .dsynqconfig.yaml in the user's home directory.

Note

For SSH remotes, Dsynq uses the standard port 22 and does not expect a port number in the URL.

More often though, you have a remote datastore already set up. Don't use dsynq remote init, simply assign your existing datastore to the project with dsynq init --set-remote <URL>.

> dsynq init --set-remote ssh://dsynq@example.com:.dsynq_tutorials
login: dsynq
host: example.com
datastore: .dsynq_tutorials
Trying to connect to "dsynq@example.com"...
Connected successfully!
Local config saved
The remote datastore has been saved successfully!

If you are setting up or trying to connect to a remote datastore on a new host you will get an error similar to the one below.

> dsynq remote init ssh://dsynq@NEW-HOST.example.com:.dsynq_tutorials
login: dsynq
host: NEW-HOST.example.com
datastore: .dsynq_tutorials
Trying to connect to "dsynq@NEW-HOST.example.com"...
Error: Cannot open an SSH connection. Check the private key, the host's fingerprint, or the network status.

In this case, establish an initial SSH connection manually by running plink <login>@<host>, inspect the host fingerprint, and confirm adding <host> to the trusted hosts.