README.md 36.7 KB
Newer Older
tavit ohanian's avatar
tavit ohanian committed
1
# go-dms3
tavit ohanian's avatar
tavit ohanian committed
2

tavit ohanian's avatar
tavit ohanian committed
3
![banner](https://dms3.io/dms3/QmVk7srrwahXLNmcDYvyUEJptyoxpndnRa57YJ11L4jV26/dms3.go.png)
Richard Littauer's avatar
Richard Littauer committed
4 5

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
tavit ohanian's avatar
tavit ohanian committed
6 7
[![Matrix](https://img.shields.io/badge/matrix-%23dms3%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/room/#dms3:matrix.org)
[![IRC](https://img.shields.io/badge/freenode-%23dms3-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23dms3)
swedneck's avatar
swedneck committed
8
[![Discord](https://img.shields.io/discord/475789330380488707?color=blueviolet&label=discord&style=flat-square)](https://discord.gg/24fmuwR)
tavit ohanian's avatar
tavit ohanian committed
9
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/gitlab.dms3.io/dms3/public/go-dms3)
Richard Littauer's avatar
Richard Littauer committed
10
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
tavit ohanian's avatar
tavit ohanian committed
11
[![CircleCI](https://img.shields.io/circleci/build/github/dms3/go-dms3?style=flat-square)](https://circleci.com/gh/dms3/go-dms3)
Richard Littauer's avatar
Richard Littauer committed
12

tavit ohanian's avatar
tavit ohanian committed
13
## What is DMS3?
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
14

tavit ohanian's avatar
tavit ohanian committed
15
DMS3 is a global, versioned, peer-to-peer filesystem. It combines good ideas from previous systems such as Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single BitTorrent swarm, exchanging git objects. DMS3 provides an interface as simple as the HTTP web, but with permanence built-in. You can also mount the world at /dms3.
Jeromy's avatar
Jeromy committed
16

tavit ohanian's avatar
tavit ohanian committed
17
For more info see: https://docs.dms3.io/introduction/overview/
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
18

David Dias's avatar
David Dias committed
19
Before opening an issue, consider using one of the following locations to ensure you are opening your thread in the right place:
tavit ohanian's avatar
tavit ohanian committed
20 21 22 23 24
  - go-dms3 _implementation_ bugs in [this repo](https://gitlab.dms3.io/dms3/public/go-dms3/issues).
  - Documentation issues in [dms3/docs issues](https://gitlab.dms3.io/dms3/public/docs/issues).
  - DMS3 _design_ in [dms3/specs issues](https://gitlab.dms3.io/dms3/public/specs/issues).
  - Exploration of new ideas in [dms3/notes issues](https://gitlab.dms3.io/dms3/public/notes/issues).
  - Ask questions and meet the rest of the community at the [DMS3 Forum](https://discuss.dms3.io).
Richard Littauer's avatar
Richard Littauer committed
25 26 27 28 29

## Table of Contents

- [Security Issues](#security-issues)
- [Install](#install)
30
  - [System Requirements](#system-requirements)
Richard Littauer's avatar
Richard Littauer committed
31
  - [Install prebuilt packages](#install-prebuilt-packages)
32
  - [From Linux package managers](#from-linux-package-managers)
Richard Littauer's avatar
Richard Littauer committed
33
  - [Build from Source](#build-from-source)
Richard Littauer's avatar
Richard Littauer committed
34
    - [Install Go](#install-go)
tavit ohanian's avatar
tavit ohanian committed
35
    - [Download and Compile DMS3](#download-and-compile-dms3)
Richard Littauer's avatar
Richard Littauer committed
36
    - [Troubleshooting](#troubleshooting)
tavit ohanian's avatar
tavit ohanian committed
37
  - [Updating go-dms3](#updating-go-dms3)
Richard Littauer's avatar
Richard Littauer committed
38 39
- [Getting Started](#getting-started)
  - [Some things to try](#some-things-to-try)
David Dias's avatar
David Dias committed
40
  - [Usage](#usage)
tavit ohanian's avatar
tavit ohanian committed
41
  - [Running DMS3 inside Docker](#running-dms3-inside-docker)
Richard Littauer's avatar
Richard Littauer committed
42
  - [Troubleshooting](#troubleshooting-1)
Henrique Dias's avatar
Henrique Dias committed
43
- [Packages](#packages)
44
- [Development](#development)
David Dias's avatar
David Dias committed
45 46 47
  - [CLI, HTTP-API, Architecture Diagram](#cli-http-api-architecture-diagram)
  - [Testing](#testing)
  - [Development Dependencies](#development-dependencies)
Richard Littauer's avatar
Richard Littauer committed
48
- [Contributing](#contributing)
Richard Littauer's avatar
Richard Littauer committed
49
- [License](#license)
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
50

Richard Littauer's avatar
Richard Littauer committed
51 52
## Security Issues

tavit ohanian's avatar
tavit ohanian committed
53
The DMS3 protocol and its implementations are still in heavy development. This means that there may be problems in our protocols, or there may be mistakes in our implementations. And -- though DMS3 is not production-ready yet -- many people are already running nodes in their machines. So we take security vulnerabilities very seriously. If you discover a security issue, please bring it to our attention right away!
Richard Littauer's avatar
Richard Littauer committed
54

tavit ohanian's avatar
tavit ohanian committed
55
If you find a vulnerability that may affect live deployments -- for example, by exposing a remote execution exploit -- please send your report privately to security@dms3.io. Please DO NOT file a public issue.
Richard Littauer's avatar
Richard Littauer committed
56 57 58

If the issue is a protocol weakness that cannot be immediately exploited or something not yet deployed, just discuss it openly.

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
59 60
## Install

tavit ohanian's avatar
tavit ohanian committed
61
The canonical download instructions for DMS3 are over at: https://docs.dms3.io/guides/guides/install/. It is **highly recommended** you follow those instructions if you are not interested in working on DMS3 development.
Muneeb Ali's avatar
Muneeb Ali committed
62

63 64
### System Requirements

tavit ohanian's avatar
tavit ohanian committed
65
DMS3 can run on most Linux, macOS, and Windows systems. We recommend running it on a machine with at least 2 GB of RAM and 2 CPU cores (go-dms3 is highly parallel). On systems with less memory, it may not be completely stable.
66

@RubenKelevra's avatar
typo  
@RubenKelevra committed
67
If your system is resource-constrained, we recommend:
68

tavit ohanian's avatar
tavit ohanian committed
69 70
1. Installing OpenSSL and rebuilding go-dms3 manually with `make build GOTAGS=openssl`. See the [download and compile](#download-and-compile-dms3) section for more information on compiling go-dms3.
2. Initializing your daemon with `dms3 init --profile=lowpower`
71

Richard Littauer's avatar
Richard Littauer committed
72
### Install prebuilt packages
73

tavit ohanian's avatar
tavit ohanian committed
74
We host prebuilt binaries over at our [distributions page](https://dms3.io/dms3ns/dist.dms3.io#go-dms3).
75 76

From there:
tavit ohanian's avatar
tavit ohanian committed
77
- Click the blue "Download go-dms3" on the right side of the page.
Richard Littauer's avatar
Richard Littauer committed
78
- Open/extract the archive.
tavit ohanian's avatar
tavit ohanian committed
79
- Move `dms3` to your path (`install.sh` can do it for you).
80

tavit ohanian's avatar
tavit ohanian committed
81
You can also download go-dms3 from this project's GitHub releases page if you are unable to access dms3.io.
82

83 84
### From Linux package managers

85
- [Arch Linux](#arch-linux)
86
- [Nix](#nix)
87
- [Solus](#solus)
88 89
- [Snap](#snap)

90 91
#### Arch Linux

tavit ohanian's avatar
tavit ohanian committed
92 93
In Arch Linux go-dms3 is available as
[go-dms3](https://www.archlinux.org/packages/community/x86_64/go-dms3/) package.
94

95
```
tavit ohanian's avatar
tavit ohanian committed
96
$ sudo pacman -S go-dms3
97
```
98

tavit ohanian's avatar
tavit ohanian committed
99 100
Development version of go-dms3 is also on AUR under
[go-dms3-git](https://aur.archlinux.org/packages/go-dms3-git/).
@RubenKelevra's avatar
typo  
@RubenKelevra committed
101
You can install it using your favorite AUR Helper or manually from AUR.
102

103
#### Nix
104 105 106 107

For Linux and MacOSX you can use the purely functional package manager [Nix](https://nixos.org/nix/):

```
tavit ohanian's avatar
tavit ohanian committed
108
$ nix-env -i dms3
109
```
Steven Allen's avatar
Steven Allen committed
110

tavit ohanian's avatar
tavit ohanian committed
111
You can also install the Package by using its attribute name, which is also `dms3`.
112

Steven Allen's avatar
Steven Allen committed
113 114
#### Guix

tavit ohanian's avatar
tavit ohanian committed
115
GNU's functional package manager, [Guix](https://www.gnu.org/software/guix/), also provides a go-dms3 package:
Steven Allen's avatar
Steven Allen committed
116 117

```
tavit ohanian's avatar
tavit ohanian committed
118
$ guix package -i go-dms3
Steven Allen's avatar
Steven Allen committed
119 120
```

121 122
#### Solus

tavit ohanian's avatar
tavit ohanian committed
123 124
In solus, go-dms3 is available in the main repository as
[go-dms3](https://dev.getsol.us/source/go-dms3/repository/master/).
125 126

```
tavit ohanian's avatar
tavit ohanian committed
127
$ sudo eopkg install go-dms3
128 129
```

@RubenKelevra's avatar
typo  
@RubenKelevra committed
130
You can also install it through the Solus software center.
131

132 133
#### Snap

134 135
With snap, in any of the [supported Linux distributions](https://snapcraft.io/docs/core/install):

136
```
tavit ohanian's avatar
tavit ohanian committed
137
$ sudo snap install dms3
138
```
139

140 141 142
### From Windows package managers

- [Chocolatey](#chocolatey)
143
- [Scoop](#scoop)
144 145 146

#### Chocolatey

tavit ohanian's avatar
tavit ohanian committed
147
The package [dms3](https://chocolatey.org/packages/dms3) currently points to go-dms3 and is being maintained.
148 149

```Powershell
tavit ohanian's avatar
tavit ohanian committed
150
PS> choco install dms3
151 152
```

153 154
#### Scoop

tavit ohanian's avatar
tavit ohanian committed
155
Scoop provides `go-dms3` in its 'extras' bucket.
156
```Powershell
157
PS> scoop bucket add extras
tavit ohanian's avatar
tavit ohanian committed
158
PS> scoop install go-dms3
159 160
```

Richard Littauer's avatar
Richard Littauer committed
161
### Build from Source
162

tavit ohanian's avatar
tavit ohanian committed
163
go-dms3's build system requires Go 1.14.4 and some standard POSIX build tools:
164 165 166 167 168 169 170

* GNU make
* Git
* GCC (or some other go compatible C Compiler) (optional)

To build without GCC, build with `CGO_ENABLED=0` (e.g., `make build CGO_ENABLED=0`).

171
#### Install Go
172

tavit ohanian's avatar
tavit ohanian committed
173
The build process for dms3 requires Go 1.14.4 or higher. If you don't have it: [Download Go 1.14+](https://golang.org/dl/).
174

175
You'll need to add Go's bin directories to your `$PATH` environment variable e.g., by adding these lines to your `/etc/profile` (for a system-wide installation) or `$HOME/.profile`:
Richard Littauer's avatar
Richard Littauer committed
176

Muneeb Ali's avatar
Muneeb Ali committed
177 178 179 180 181
```
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$GOPATH/bin
```

Richard Littauer's avatar
Richard Littauer committed
182
(If you run into trouble, see the [Go install instructions](https://golang.org/doc/install)).
183

tavit ohanian's avatar
tavit ohanian committed
184
#### Download and Compile DMS3
185

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
186
```
tavit ohanian's avatar
tavit ohanian committed
187
$ git clone https://gitlab.dms3.io/dms3/public/go-dms3.git
188

tavit ohanian's avatar
tavit ohanian committed
189
$ cd go-dms3
190
$ make install
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
191 192
```

tavit ohanian's avatar
tavit ohanian committed
193
Alternatively, you can run `make build` to build the go-dms3 binary (storing it in `cmd/dms3/dms3`) without installing it.
194

195 196
**NOTE:** If you get an error along the lines of "fatal error: stdlib.h: No such file or directory", you're missing a C compiler. Either re-run `make` with `CGO_ENABLED=0` or install GCC.

197 198 199 200 201 202 203 204 205 206
##### Cross Compiling

Compiling for a different platform is as simple as running:

```
make build GOOS=myTargetOS GOARCH=myTargetArchitecture
```

##### OpenSSL

tavit ohanian's avatar
tavit ohanian committed
207
To build go-dms3 with OpenSSL support, append `GOTAGS=openssl` to your `make` invocation. Building with OpenSSL should significantly reduce the background CPU usage on nodes that frequently make or receive new connections.
208

@RubenKelevra's avatar
typo  
@RubenKelevra committed
209
Note: OpenSSL requires CGO support and, by default, CGO is disabled when cross-compiling. To cross-compile with OpenSSL support, you must:
210 211 212 213

1. Install a compiler toolchain for the target platform.
2. Set the `CGO_ENABLED=1` environment variable.

214
#### Troubleshooting
215

216 217 218
- Separate [instructions are available for building on Windows](docs/windows.md).
- `git` is required in order for `go get` to fetch all dependencies.
- Package managers often contain out-of-date `golang` packages.
219
  Ensure that `go version` reports at least 1.10. See above for how to install go.
220
- If you are interested in development, please install the development
Jeromy's avatar
Jeromy committed
221
dependencies as well.
222
- _WARNING_: Older versions of OSX FUSE (for Mac OS X) can cause kernel panics when mounting!-
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
223
  We strongly recommend you use the [latest version of OSX FUSE](http://osxfuse.github.io/).
tavit ohanian's avatar
tavit ohanian committed
224
  (See https://gitlab.dms3.io/dms3/public/go-dms3/issues/177)
225
- For more details on setting up FUSE (so that you can mount the filesystem), see the docs folder.
tavit ohanian's avatar
tavit ohanian committed
226 227
- Shell command completion is available in `misc/completion/dms3-completion.bash`. Read [docs/command-completion.md](docs/command-completion.md) to learn how to install it.
- See the [misc folder](https://gitlab.dms3.io/dms3/public/go-dms3/tree/master/misc) for how to connect DMS3 to systemd or whatever init system your distro uses.
Richard Littauer's avatar
Richard Littauer committed
228

tavit ohanian's avatar
tavit ohanian committed
229
### Updating go-dms3
Richard Littauer's avatar
Richard Littauer committed
230

tavit ohanian's avatar
tavit ohanian committed
231
#### Using dms3-update
Richard Littauer's avatar
Richard Littauer committed
232

tavit ohanian's avatar
tavit ohanian committed
233 234 235
DMS3 has an updating tool that can be accessed through `dms3 update`. The tool is
not installed alongside DMS3 in order to keep that logic independent of the main
codebase. To install `dms3 update`, [download it here](https://dms3.io/dms3ns/dist.dms3.io/#dms3-update).
Chas Leichner's avatar
Chas Leichner committed
236

tavit ohanian's avatar
tavit ohanian committed
237
#### Downloading DMS3 builds using DMS3
238

tavit ohanian's avatar
tavit ohanian committed
239
List the available versions of go-dms3:
240

241
```
tavit ohanian's avatar
tavit ohanian committed
242
$ dms3 cat /dms3ns/dist.dms3.io/go-dms3/versions
243 244 245
```

Then, to view available builds for a version from the previous command ($VERSION):
246

247
```
tavit ohanian's avatar
tavit ohanian committed
248
$ dms3 ls /dms3ns/dist.dms3.io/go-dms3/$VERSION
249 250 251
```

To download a given build of a version:
252

253
```
tavit ohanian's avatar
tavit ohanian committed
254 255 256 257 258 259 260
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_darwin-386.tar.gz # darwin 32-bit build
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_darwin-amd64.tar.gz # darwin 64-bit build
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_freebsd-amd64.tar.gz # freebsd 64-bit build
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_linux-386.tar.gz # linux 32-bit build
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_linux-amd64.tar.gz # linux 64-bit build
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_linux-arm.tar.gz # linux arm build
$ dms3 get /dms3ns/dist.dms3.io/go-dms3/$VERSION/go-dms3_$VERSION_windows-amd64.zip # windows 64-bit build
261 262
```

David Dias's avatar
David Dias committed
263 264
## Getting Started

tavit ohanian's avatar
tavit ohanian committed
265
See also: https://docs.dms3.io/introduction/usage/
David Dias's avatar
David Dias committed
266

tavit ohanian's avatar
tavit ohanian committed
267 268
To start using DMS3, you must first initialize DMS3's config files on your
system, this is done with `dms3 init`. See `dms3 init --help` for information on
David Dias's avatar
David Dias committed
269
the optional arguments it takes. After initialization is complete, you can use
tavit ohanian's avatar
tavit ohanian committed
270
`dms3 mount`, `dms3 add` and any of the other commands to explore!
David Dias's avatar
David Dias committed
271 272 273

### Some things to try

tavit ohanian's avatar
tavit ohanian committed
274
Basic proof of 'dms3 working' locally:
David Dias's avatar
David Dias committed
275

@RubenKelevra's avatar
typo  
@RubenKelevra committed
276
    echo "hello world" > hello
tavit ohanian's avatar
tavit ohanian committed
277
    dms3 add hello
@RubenKelevra's avatar
typo  
@RubenKelevra committed
278 279
    # This should output a hash string that looks something like:
    # QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o
tavit ohanian's avatar
tavit ohanian committed
280
    dms3 cat <that hash>
David Dias's avatar
David Dias committed
281 282

### Usage
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
283 284

```
tavit ohanian's avatar
tavit ohanian committed
285
  dms3 - Global p2p merkle-dag filesystem.
286

tavit ohanian's avatar
tavit ohanian committed
287
  dms3 [<flags>] <command> [<arg>] ...
288 289 290

SUBCOMMANDS
  BASIC COMMANDS
tavit ohanian's avatar
tavit ohanian committed
291 292 293 294
    init          Initialize dms3 local configuration
    add <path>    Add a file to dms3
    cat <ref>     Show dms3 object data
    get <ref>     Download dms3 objects
295 296 297 298 299 300 301 302 303 304
    ls <ref>      List links from an object
    refs <ref>    List hashes of links from an object

  DATA STRUCTURE COMMANDS
    block         Interact with raw blocks in the datastore
    object        Interact with raw dag nodes
    files         Interact with objects as if they were a unix filesystem

  ADVANCED COMMANDS
    daemon        Start a long-running daemon process
tavit ohanian's avatar
tavit ohanian committed
305
    mount         Mount an dms3 read-only mount point
306
    resolve       Resolve any type of name
tavit ohanian's avatar
tavit ohanian committed
307
    name          Publish or resolve DMS3NS names
308 309
    dns           Resolve DNS links
    pin           Pin objects to local storage
tavit ohanian's avatar
tavit ohanian committed
310
    repo          Manipulate an DMS3 repository
311 312

  NETWORK COMMANDS
tavit ohanian's avatar
tavit ohanian committed
313
    id            Show info about dms3 peers
314 315 316 317 318 319 320 321
    bootstrap     Add or remove bootstrap peers
    swarm         Manage connections to the p2p network
    dht           Query the DHT for values or peers
    ping          Measure the latency of a connection
    diag          Print diagnostics

  TOOL COMMANDS
    config        Manage configuration
tavit ohanian's avatar
tavit ohanian committed
322 323
    version       Show dms3 version information
    update        Download and apply go-dms3 updates
324 325
    commands      List all available commands

tavit ohanian's avatar
tavit ohanian committed
326
  Use 'dms3 <command> --help' to learn more about each command.
327

tavit ohanian's avatar
tavit ohanian committed
328 329
  dms3 uses a repository in the local file system. By default, the repo is located at
  ~/.dms3. To change the repo location, set the $DMS3_PATH environment variable:
330

tavit ohanian's avatar
tavit ohanian committed
331
    export DMS3_PATH=/path/to/dms3repo
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
332
```
333

tavit ohanian's avatar
tavit ohanian committed
334
### Running DMS3 inside Docker
335

tavit ohanian's avatar
tavit ohanian committed
336
An DMS3 docker image is hosted at [hub.docker.com/r/dms3/go-dms3](https://hub.docker.com/r/dms3/go-dms3/).
337
To make files visible inside the container you need to mount a host directory
338
with the `-v` option to docker. Choose a directory that you want to use to
tavit ohanian's avatar
tavit ohanian committed
339 340
import/export files from DMS3. You should also choose a directory to store
DMS3 files that will persist when you restart the container.
341

tavit ohanian's avatar
tavit ohanian committed
342 343
    export dms3_staging=</absolute/path/to/somewhere/>
    export dms3_data=</absolute/path/to/somewhere_else/>
Richard Littauer's avatar
Richard Littauer committed
344

tavit ohanian's avatar
tavit ohanian committed
345
Start a container running dms3 and expose ports 4001, 5001 and 8080:
346

tavit ohanian's avatar
tavit ohanian committed
347
    docker run -d --name dms3_host -v $dms3_staging:/export -v $dms3_data:/data/dms3 -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 dms3/go-dms3:latest
348

tavit ohanian's avatar
tavit ohanian committed
349
Watch the dms3 log:
Michael Lovci's avatar
Michael Lovci committed
350

tavit ohanian's avatar
tavit ohanian committed
351
    docker logs -f dms3_host
352

tavit ohanian's avatar
tavit ohanian committed
353
Wait for dms3 to start. dms3 is running when you see:
354 355

    Gateway (readonly) server
Michael Lovci's avatar
Michael Lovci committed
356
    listening on /ip4/0.0.0.0/tcp/8080
357

Richard Littauer's avatar
Richard Littauer committed
358
You can now stop watching the log.
359

tavit ohanian's avatar
tavit ohanian committed
360
Run dms3 commands:
361

tavit ohanian's avatar
tavit ohanian committed
362
    docker exec dms3_host dms3 <args...>
363 364

For example: connect to peers
365

tavit ohanian's avatar
tavit ohanian committed
366
    docker exec dms3_host dms3 swarm peers
367

368 369
Add files:

tavit ohanian's avatar
tavit ohanian committed
370 371
    cp -r <something> $dms3_staging
    docker exec dms3_host dms3 add -r /export/<something>
372

373 374
Stop the running container:

tavit ohanian's avatar
tavit ohanian committed
375
    docker stop dms3_host
376

tavit ohanian's avatar
tavit ohanian committed
377
When starting a container running dms3 for the first time with an empty data directory, it will call `dms3 init` to initialize configuration files and generate a new keypair. At this time, you can choose which profile to apply using the `DMS3_PROFILE` environment variable:
378

tavit ohanian's avatar
tavit ohanian committed
379
    docker run -d --name dms3_host -e DMS3_PROFILE=server -v $dms3_staging:/export -v $dms3_data:/data/dms3 -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 dms3/go-dms3:latest
380

381 382
#### Private swarms inside Docker

tavit ohanian's avatar
tavit ohanian committed
383
It is possible to initialize the container with a swarm key file (`/data/dms3/swarm.key`) using the variables `DMS3_SWARM_KEY` and `DMS3_SWARM_KEY_FILE`. The `DMS3_SWARM_KEY` creates `swarm.key` with the contents of the variable itself, whilst `DMS3_SWARM_KEY_FILE` copies the key from a path stored in the variable. The `DMS3_SWARM_KEY_FILE` **overwrites** the key generated by `DMS3_SWARM_KEY`.
384

tavit ohanian's avatar
tavit ohanian committed
385
    docker run -d --name dms3_host -e DMS3_SWARM_KEY=<your swarm key> -v $dms3_staging:/export -v $dms3_data:/data/dms3 -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 dms3/go-dms3:latest
386 387 388 389

The swarm key initialization can also be done using docker secrets **(requires docker swarm or docker-compose)**:

    cat your_swarm.key | docker secret create swarm_key_secret -
tavit ohanian's avatar
tavit ohanian committed
390
    docker run -d --name dms3_host --secret swarm_key_secret -e DMS3_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $dms3_staging:/export -v $dms3_data:/data/dms3 -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 dms3/go-dms3:latest
391

392 393
#### Key rotation inside Docker

tavit ohanian's avatar
tavit ohanian committed
394
If needed, it is possible to do key rotation in an ephemeral container that is temporarily executing against a volume that is mounted under `/data/dms3`:
395 396

```sh
tavit ohanian's avatar
tavit ohanian committed
397 398 399
# given container named 'dms3-test' that persists repo at /path/to/persisted/.dms3
$ docker run -d --name dms3-test -v /path/to/persisted/.dms3:/data/dms3 dms3/go-dms3:v0.7.0
$ docker stop dms3-test  
400 401

# key rotation works like this (old key saved under 'old-self')
tavit ohanian's avatar
tavit ohanian committed
402 403
$ docker run --rm -it -v /path/to/persisted/.dms3:/data/dms3 dms3/go-dms3:v0.7.0 key rotate -o old-self -t ed25519
$ docker start dms3-test # will start with the new key
404 405
```

Jeromy's avatar
Jeromy committed
406
### Troubleshooting
407

tavit ohanian's avatar
tavit ohanian committed
408
If you have previously installed DMS3 before and you are running into problems getting a newer version to work, try deleting (or backing up somewhere else) your DMS3 config directory (~/.dms3 by default) and rerunning `dms3 init`. This will reinitialize the config file to its defaults and clear out the local datastore of any bad entries.
409

tavit ohanian's avatar
tavit ohanian committed
410
Please direct general questions and help requests to our [forum](https://discuss.dms3.io) or our IRC channel (freenode #dms3).
411

tavit ohanian's avatar
tavit ohanian committed
412
If you believe you've found a bug, check the [issues list](https://gitlab.dms3.io/dms3/public/go-dms3/issues) and, if you don't see your problem there, either come talk to us on IRC (freenode #dms3) or file an issue of your own!
Jeromy's avatar
Jeromy committed
413

Henrique Dias's avatar
Henrique Dias committed
414 415
## Packages

tavit ohanian's avatar
tavit ohanian committed
416
> This table is generated using the module [`package-table`](https://gitlab.dms3.io/dms3/public-shipyard/package-table) with `package-table --data=package-list.json`.
Henrique Dias's avatar
Henrique Dias committed
417

tavit ohanian's avatar
tavit ohanian committed
418
Listing of the main packages used in the DMS3 ecosystem. There are also three specifications worth linking here:
Henrique Dias's avatar
Henrique Dias committed
419

420 421
| Name | CI/Travis | Coverage | Description |
| ---------|---------|---------|--------- |
Steven Allen's avatar
Steven Allen committed
422
| **Libp2p** |
tavit ohanian's avatar
tavit ohanian committed
423 424 425 426
| [`go-libp2p`](//gitlab.dms3.io/dms3/public/libp2p/go-libp2p) | [![Travis CI](https://flat.badgen.net/travis/libp2p/go-libp2p/master)](https://travis-ci.com/libp2p/go-libp2p) | [![codecov](https://codecov.io/gh/libp2p/go-libp2p/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/libp2p/go-libp2p) | p2p networking library |
| [`go-libp2p-pubsub`](//gitlab.dms3.io/dms3/public/libp2p/go-libp2p-pubsub) | [![Travis CI](https://flat.badgen.net/travis/libp2p/go-libp2p-pubsub/master)](https://travis-ci.com/libp2p/go-libp2p-pubsub) | [![codecov](https://codecov.io/gh/libp2p/go-libp2p-pubsub/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/libp2p/go-libp2p-pubsub) | pubsub built on libp2p |
| [`go-libp2p-kad-dht`](//gitlab.dms3.io/dms3/public/libp2p/go-libp2p-kad-dht) | [![Travis CI](https://flat.badgen.net/travis/libp2p/go-libp2p-kad-dht/master)](https://travis-ci.com/libp2p/go-libp2p-kad-dht) | [![codecov](https://codecov.io/gh/libp2p/go-libp2p-kad-dht/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/libp2p/go-libp2p-kad-dht) | dht-backed router |
| [`go-libp2p-pubsub-router`](//gitlab.dms3.io/dms3/public/libp2p/go-libp2p-pubsub-router) | [![Travis CI](https://flat.badgen.net/travis/libp2p/go-libp2p-pubsub-router/master)](https://travis-ci.com/libp2p/go-libp2p-pubsub-router) | [![codecov](https://codecov.io/gh/libp2p/go-libp2p-pubsub-router/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/libp2p/go-libp2p-pubsub-router) | pubsub-backed router |
Steven Allen's avatar
Steven Allen committed
427
| **Multiformats** |
tavit ohanian's avatar
tavit ohanian committed
428 429
| [`go-cid`](//gitlab.dms3.io/dms3/public/go-cid) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-cid/master)](https://travis-ci.com/dms3/go-cid) | [![codecov](https://codecov.io/gh/dms3/go-cid/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-cid) | CID implementation |
| [`go-multiaddr`](//gitlab.dms3.io/dms3/public/multiformats) | [![Travis CI](https://flat.badgen.net/travis/multiformats/go-multiaddr/master)](https://travis-ci.com/multiformats/go-multiaddr) | [![codecov](https://codecov.io/gh/multiformats/go-multiaddr/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/multiformats/go-multiaddr) | multiaddr implementation |
Steven Allen's avatar
Steven Allen committed
430 431
| [`go-multihash`](//github.com/multiformats/go-multihash) | [![Travis CI](https://flat.badgen.net/travis/multiformats/go-multihash/master)](https://travis-ci.com/multiformats/go-multihash) | [![codecov](https://codecov.io/gh/multiformats/go-multihash/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/multiformats/go-multihash) | multihash implementation |
| [`go-multibase`](//github.com/multiformats/go-multibase) | [![Travis CI](https://flat.badgen.net/travis/multiformats/go-multibase/master)](https://travis-ci.com/multiformats/go-multibase) | [![codecov](https://codecov.io/gh/multiformats/go-multibase/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/multiformats/go-multibase) | mulitbase implementation |
Henrique Dias's avatar
Henrique Dias committed
432
| **Files** |
tavit ohanian's avatar
tavit ohanian committed
433 434 435 436
| [`go-unixfs`](//gitlab.dms3.io/dms3/public/go-unixfs) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-unixfs/master)](https://travis-ci.com/dms3/go-unixfs) | [![codecov](https://codecov.io/gh/dms3/go-unixfs/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-unixfs) | the core 'filesystem' logic |
| [`go-mfs`](//gitlab.dms3.io/dms3/public/go-mfs) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-mfs/master)](https://travis-ci.com/dms3/go-mfs) | [![codecov](https://codecov.io/gh/dms3/go-mfs/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-mfs) | a mutable filesystem editor for unixfs |
| [`go-dms3-posinfo`](//gitlab.dms3.io/dms3/public/go-dms3-posinfo) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-posinfo/master)](https://travis-ci.com/dms3/go-dms3-posinfo) | [![codecov](https://codecov.io/gh/dms3/go-dms3-posinfo/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-posinfo) | helper datatypes for the filestore |
| [`go-dms3-chunker`](//gitlab.dms3.io/dms3/public/go-dms3-chunker) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-chunker/master)](https://travis-ci.com/dms3/go-dms3-chunker) | [![codecov](https://codecov.io/gh/dms3/go-dms3-chunker/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-chunker) | file chunkers |
Henrique Dias's avatar
Henrique Dias committed
437
| **Exchange** |
tavit ohanian's avatar
tavit ohanian committed
438 439 440 441
| [`go-dms3-exchange-interface`](//gitlab.dms3.io/dms3/public/go-dms3-exchange-interface) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-exchange-interface/master)](https://travis-ci.com/dms3/go-dms3-exchange-interface) | [![codecov](https://codecov.io/gh/dms3/go-dms3-exchange-interface/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-exchange-interface) | exchange service interface |
| [`go-dms3-exchange-offline`](//gitlab.dms3.io/dms3/public/go-dms3-exchange-offline) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-exchange-offline/master)](https://travis-ci.com/dms3/go-dms3-exchange-offline) | [![codecov](https://codecov.io/gh/dms3/go-dms3-exchange-offline/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-exchange-offline) | (dummy) offline implementation of the exchange service |
| [`go-bitswap`](//gitlab.dms3.io/dms3/public/go-bitswap) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-bitswap/master)](https://travis-ci.com/dms3/go-bitswap) | [![codecov](https://codecov.io/gh/dms3/go-bitswap/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-bitswap) | bitswap protocol implementation |
| [`go-blockservice`](//gitlab.dms3.io/dms3/public/go-blockservice) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-blockservice/master)](https://travis-ci.com/dms3/go-blockservice) | [![codecov](https://codecov.io/gh/dms3/go-blockservice/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-blockservice) | service that plugs a blockstore and an exchange together |
Henrique Dias's avatar
Henrique Dias committed
442
| **Datastores** |
tavit ohanian's avatar
tavit ohanian committed
443 444 445 446 447 448
| [`go-datastore`](//gitlab.dms3.io/dms3/public/go-datastore) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-datastore/master)](https://travis-ci.com/dms3/go-datastore) | [![codecov](https://codecov.io/gh/dms3/go-datastore/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-datastore) | datastore interfaces, adapters, and basic implementations |
| [`go-dms3-ds-help`](//gitlab.dms3.io/dms3/public/go-dms3-ds-help) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-ds-help/master)](https://travis-ci.com/dms3/go-dms3-ds-help) | [![codecov](https://codecov.io/gh/dms3/go-dms3-ds-help/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-ds-help) | datastore utility functions |
| [`go-ds-flatfs`](//gitlab.dms3.io/dms3/public/go-ds-flatfs) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-ds-flatfs/master)](https://travis-ci.com/dms3/go-ds-flatfs) | [![codecov](https://codecov.io/gh/dms3/go-ds-flatfs/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-ds-flatfs) | a filesystem-based datastore |
| [`go-ds-measure`](//gitlab.dms3.io/dms3/public/go-ds-measure) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-ds-measure/master)](https://travis-ci.com/dms3/go-ds-measure) | [![codecov](https://codecov.io/gh/dms3/go-ds-measure/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-ds-measure) | a metric-collecting database adapter |
| [`go-ds-leveldb`](//gitlab.dms3.io/dms3/public/go-ds-leveldb) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-ds-leveldb/master)](https://travis-ci.com/dms3/go-ds-leveldb) | [![codecov](https://codecov.io/gh/dms3/go-ds-leveldb/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-ds-leveldb) | a leveldb based datastore |
| [`go-ds-badger`](//gitlab.dms3.io/dms3/public/go-ds-badger) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-ds-badger/master)](https://travis-ci.com/dms3/go-ds-badger) | [![codecov](https://codecov.io/gh/dms3/go-ds-badger/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-ds-badger) | a badgerdb based datastore |
Henrique Dias's avatar
Henrique Dias committed
449
| **Namesys** |
tavit ohanian's avatar
tavit ohanian committed
450
| [`go-dms3ns`](//gitlab.dms3.io/dms3/public/go-dms3ns) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3ns/master)](https://travis-ci.com/dms3/go-dms3ns) | [![codecov](https://codecov.io/gh/dms3/go-dms3ns/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3ns) | DMS3NS datastructures and validation logic |
Henrique Dias's avatar
Henrique Dias committed
451
| **Repo** |
tavit ohanian's avatar
tavit ohanian committed
452 453 454 455 456 457 458 459 460 461
| [`go-dms3-config`](//gitlab.dms3.io/dms3/public/go-dms3-config) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-config/master)](https://travis-ci.com/dms3/go-dms3-config) | [![codecov](https://codecov.io/gh/dms3/go-dms3-config/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-config) | go-dms3 config file definitions |
| [`go-fs-lock`](//gitlab.dms3.io/dms3/public/go-fs-lock) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-fs-lock/master)](https://travis-ci.com/dms3/go-fs-lock) | [![codecov](https://codecov.io/gh/dms3/go-fs-lock/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-fs-lock) | lockfile management functions |
| [`fs-repo-migrations`](//gitlab.dms3.io/dms3/public/fs-repo-migrations) | [![Travis CI](https://flat.badgen.net/travis/dms3/fs-repo-migrations/master)](https://travis-ci.com/dms3/fs-repo-migrations) | [![codecov](https://codecov.io/gh/dms3/fs-repo-migrations/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/fs-repo-migrations) | repo migrations |
| **DMS3LD** |
| [`go-block-format`](//gitlab.dms3.io/dms3/public/go-block-format) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-block-format/master)](https://travis-ci.com/dms3/go-block-format) | [![codecov](https://codecov.io/gh/dms3/go-block-format/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-block-format) | block interfaces and implementations |
| [`go-dms3-blockstore`](//gitlab.dms3.io/dms3/public/go-dms3-blockstore) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-blockstore/master)](https://travis-ci.com/dms3/go-dms3-blockstore) | [![codecov](https://codecov.io/gh/dms3/go-dms3-blockstore/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-blockstore) | blockstore interfaces and implementations |
| [`go-dms3ld-format`](//gitlab.dms3.io/dms3/public/go-dms3ld-format) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3ld-format/master)](https://travis-ci.com/dms3/go-dms3ld-format) | [![codecov](https://codecov.io/gh/dms3/go-dms3ld-format/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3ld-format) | DMS3LD interfaces |
| [`go-dms3ld-cbor`](//gitlab.dms3.io/dms3/public/go-dms3ld-cbor) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3ld-cbor/master)](https://travis-ci.com/dms3/go-dms3ld-cbor) | [![codecov](https://codecov.io/gh/dms3/go-dms3ld-cbor/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3ld-cbor) | DMS3LD-CBOR implementation |
| [`go-dms3ld-git`](//gitlab.dms3.io/dms3/public/go-dms3ld-git) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3ld-git/master)](https://travis-ci.com/dms3/go-dms3ld-git) | [![codecov](https://codecov.io/gh/dms3/go-dms3ld-git/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3ld-git) | DMS3LD-Git implementation |
| [`go-merkledag`](//gitlab.dms3.io/dms3/public/go-merkledag) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-merkledag/master)](https://travis-ci.com/dms3/go-merkledag) | [![codecov](https://codecov.io/gh/dms3/go-merkledag/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-merkledag) | DMS3LD-Merkledag implementation (and then some) |
Henrique Dias's avatar
Henrique Dias committed
462
| **Commands** |
tavit ohanian's avatar
tavit ohanian committed
463 464 465 466 467
| [`go-dms3-cmds`](//gitlab.dms3.io/dms3/public/go-dms3-cmds) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-cmds/master)](https://travis-ci.com/dms3/go-dms3-cmds) | [![codecov](https://codecov.io/gh/dms3/go-dms3-cmds/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-cmds) | CLI & HTTP commands library |
| [`go-dms3-files`](//gitlab.dms3.io/dms3/public/go-dms3-files) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-files/master)](https://travis-ci.com/dms3/go-dms3-files) | [![codecov](https://codecov.io/gh/dms3/go-dms3-files/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-files) | CLI & HTTP commands library |
| [`go-dms3-api`](//gitlab.dms3.io/dms3/public/go-dms3-api) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-api/master)](https://travis-ci.com/dms3/go-dms3-api) | [![codecov](https://codecov.io/gh/dms3/go-dms3-api/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-api) | an old, stable shell for the DMS3 HTTP API |
| [`go-dms3-http-client`](//gitlab.dms3.io/dms3/public/go-dms3-http-client) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-http-client/master)](https://travis-ci.com/dms3/go-dms3-http-client) | [![codecov](https://codecov.io/gh/dms3/go-dms3-http-client/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-http-client) | a new, unstable shell for the DMS3 HTTP API |
| [`interface-go-dms3-core`](//gitlab.dms3.io/dms3/public/interface-go-dms3-core) | [![Travis CI](https://flat.badgen.net/travis/dms3/interface-go-dms3-core/master)](https://travis-ci.com/dms3/interface-go-dms3-core) | [![codecov](https://codecov.io/gh/dms3/interface-go-dms3-core/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/interface-go-dms3-core) | core go-dms3 API interface definitions |
Henrique Dias's avatar
Henrique Dias committed
468
| **Metrics & Logging** |
tavit ohanian's avatar
tavit ohanian committed
469 470 471
| [`go-metrics-interface`](//gitlab.dms3.io/dms3/public/go-metrics-interface) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-metrics-interface/master)](https://travis-ci.com/dms3/go-metrics-interface) | [![codecov](https://codecov.io/gh/dms3/go-metrics-interface/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-metrics-interface) | metrics collection interfaces |
| [`go-metrics-prometheus`](//gitlab.dms3.io/dms3/public/go-metrics-prometheus) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-metrics-prometheus/master)](https://travis-ci.com/dms3/go-metrics-prometheus) | [![codecov](https://codecov.io/gh/dms3/go-metrics-prometheus/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-metrics-prometheus) | prometheus-backed metrics collector |
| [`go-log`](//gitlab.dms3.io/dms3/public/go-log) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-log/master)](https://travis-ci.com/dms3/go-log) | [![codecov](https://codecov.io/gh/dms3/go-log/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-log) | logging framework |
Henrique Dias's avatar
Henrique Dias committed
472
| **Generics/Utils** |
tavit ohanian's avatar
tavit ohanian committed
473 474 475
| [`go-dms3-routing`](//gitlab.dms3.io/dms3/public/go-dms3-routing) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-routing/master)](https://travis-ci.com/dms3/go-dms3-routing) | [![codecov](https://codecov.io/gh/dms3/go-dms3-routing/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-routing) | routing (content, peer, value) helpers |
| [`go-dms3-util`](//gitlab.dms3.io/dms3/public/go-dms3-util) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-util/master)](https://travis-ci.com/dms3/go-dms3-util) | [![codecov](https://codecov.io/gh/dms3/go-dms3-util/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-util) | the kitchen sink |
| [`go-dms3-addr`](//gitlab.dms3.io/dms3/public/go-dms3-addr) | [![Travis CI](https://flat.badgen.net/travis/dms3/go-dms3-addr/master)](https://travis-ci.com/dms3/go-dms3-addr) | [![codecov](https://codecov.io/gh/dms3/go-dms3-addr/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/dms3/go-dms3-addr) | utility functions for parsing DMS3 multiaddrs |
Henrique Dias's avatar
Henrique Dias committed
476

tavit ohanian's avatar
tavit ohanian committed
477
For brevity, we've omitted most go-libp2p, go-dms3ld, and go-multiformats packages. These package tables can be found in their respective project's READMEs:
478

tavit ohanian's avatar
tavit ohanian committed
479 480
* [go-libp2p](https://gitlab.dms3.io/dms3/public/libp2p/go-libp2p#packages)
* [go-dms3ld](https://gitlab.dms3.io/dms3/public/dms3ld/go-dms3ld#packages)
481

482
## Development
483

484
Some places to get you started on the codebase:
485

tavit ohanian's avatar
tavit ohanian committed
486 487 488
- Main file: [./cmd/dms3/main.go](https://gitlab.dms3.io/dms3/public/go-dms3/blob/master/cmd/dms3/main.go)
- CLI Commands: [./core/commands/](https://gitlab.dms3.io/dms3/public/go-dms3/tree/master/core/commands)
- Bitswap (the data trading engine): [go-bitswap](https://gitlab.dms3.io/dms3/public/go-bitswap)
489
- libp2p
tavit ohanian's avatar
tavit ohanian committed
490 491 492 493
  - libp2p: https://gitlab.dms3.io/dms3/public/libp2p/go-libp2p
  - DHT: https://gitlab.dms3.io/dms3/public/libp2p/go-libp2p-kad-dht
  - PubSub: https://gitlab.dms3.io/dms3/public/libp2p/go-libp2p-pubsub
- [DMS3 : The `Add` command demystified](https://gitlab.dms3.io/dms3/public/go-dms3/tree/master/docs/add-code-flow.md)
494

tavit ohanian's avatar
tavit ohanian committed
495 496
### Map of go-dms3 Subsystems
**WIP**: This is a high-level architecture diagram of the various sub-systems of go-dms3. To be updated with how they interact. Anyone who has suggestions is welcome to comment [here](https://docs.google.com/drawings/d/1OVpBT2q-NtSJqlPX3buvjYhOnWfdzb85YEsM_njesME/edit) on how we can improve this!
497 498
<img src="https://docs.google.com/drawings/d/e/2PACX-1vS_n1FvSu6mdmSirkBrIIEib2gqhgtatD9awaP2_WdrGN4zTNeg620XQd9P95WT-IvognSxIIdCM5uE/pub?w=1446&amp;h=1036">

499
### CLI, HTTP-API, Architecture Diagram
Richard Littauer's avatar
Richard Littauer committed
500

501
![](./docs/cli-http-api-core-diagram.png)
502

tavit ohanian's avatar
tavit ohanian committed
503
> [Origin](https://gitlab.dms3.io/dms3/public/pm/pull/678#discussion_r210410924)
504

505
Description: Dotted means "likely going away". The "Legacy" parts are thin wrappers around some commands to translate between the new system and the old system. The grayed-out parts on the "daemon" diagram are there to show that the code is all the same, it's just that we turn some pieces on and some pieces off depending on whether we're running on the client or the server.
506

507
### Testing
508

509 510 511 512 513 514 515 516 517 518 519 520 521 522
```
make test
```

### Development Dependencies

If you make changes to the protocol buffers, you will need to install the [protoc compiler](https://github.com/google/protobuf).

### Developer Notes

Find more documentation for developers on [docs](./docs)

## Contributing

tavit ohanian's avatar
tavit ohanian committed
523
[![](https://cdn.rawgit.com/jbenet/contribute-dms3-gif/master/img/contribute.gif)](https://gitlab.dms3.io/dms3/public/community/blob/master/CONTRIBUTING.md)
524

Ali Mirlou's avatar
Ali Mirlou committed
525
We ❤️ all [our contributors](docs/AUTHORS); this project wouldn’t be what it is without you! If you want to help out, please see [CONTRIBUTING.md](CONTRIBUTING.md).
526

tavit ohanian's avatar
tavit ohanian committed
527
This repository falls under the DMS3 [Code of Conduct](https://gitlab.dms3.io/dms3/public/community/blob/master/code-of-conduct.md).
528

tavit ohanian's avatar
tavit ohanian committed
529 530
You can contact us on the freenode #dms3-dev channel or attend one of our
[weekly calls](https://gitlab.dms3.io/dms3/public/team-mgmt/issues/674).
Steven Allen's avatar
Steven Allen committed
531

532 533
## License

tavit ohanian's avatar
tavit ohanian committed
534
The go-dms3 project is dual-licensed under Apache 2.0 and MIT terms:
535

tavit ohanian's avatar
tavit ohanian committed
536 537
- Apache License, Version 2.0, ([LICENSE-APACHE](https://gitlab.dms3.io/dms3/public/go-dms3/blob/master/LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](https://gitlab.dms3.io/dms3/public/go-dms3/blob/master/LICENSE-MIT) or http://opensource.org/licenses/MIT)