You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+88-59Lines changed: 88 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,69 @@
1
-
# ⛰️ hypermount
2
-
A FUSE-mountable distributed filesystem, built with Hyperdrive.
1
+
# ⛰️ hyperdrive-daemon
2
+
A daemon for creating, storing and sharing Hyperdrives. Provides both a gRPC API (see [`hyperdrive-daemon-client`](https://github.com/andrewosh/hyperdrive-daemon-client)), and a FUSE interface for mounting drives as directories.
3
3
4
-
Hypermount lets your mount Hyperdrives as directories on both OSX and Linux. To generate and seed a new Hyperdrive, mounted at a just run:
4
+
The Hyperdrive daemon lets your mount Hyperdrives as directories on both OSX and Linux. The daemon requires all users to have a private "root" drive, into which additional subdrives can be mounted and shared with others. After starting the daemon, you can create your root drive as follows:
5
5
```
6
-
❯ hypermount mount me
7
-
Mounted 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e at friends/me
This drive is private by default. To publish it, run `hyperdrive fs publish /hyperdrive/home/videos`
13
26
```
14
27
15
28
Once your drives are mounted, you can treat them as you would any other directory!
16
29
17
-
To make it easier to mount multiple drives, Hypermount runs as a daemonized HTTP server. It maintains a database of mounted Hyperdrives, which it will automatically remount when the daemon is started and unmount when it's stopped.
30
+
Subdrives are private by default (they will not be advertised on the network), but you can make them available with the `fs publish` command:
31
+
```
32
+
❯ hyperdrive fs publish /hyperdrive/home/videos
33
+
Published the drive mounted at /hyperdrive/home/videos
34
+
```
35
+
36
+
After publishing, another user can either:
37
+
1. Mount the same subdrive by key within their own root drive
38
+
2. Inspect the drive inside the `/hyperdrive/by-key` directory (can be a symlink target outside the FUSE mount!):
❯ ls /hyperdrive/by-key/b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
44
+
vid.mkv
45
+
```
46
+
Or:
47
+
```
48
+
❯ hyperdrive fs mount /hyperdrive/home/a_friends_videos b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
49
+
...
50
+
❯ ls /hyperdrive/home/a_friends_videos
51
+
vid.mkv
52
+
```
18
53
19
-
Under the hood, this module uses [corestore](https://github.com/andrewosh/corestore) to manage and seed your library of hypercores.
54
+
### Hyperdrive API
55
+
The daemon also provides a gRPC API for interacting with remote Hyperdrives. [`hyperdrive-daemon-client`](https://github.com/andrewosh/hyperdrive-daemon-client) is a Node client that you can use to interact with the API. If you'd like to write a client in another language, check out the schema definitions in [`hyperdrive-schemas`](https://github.com/andrewosh/hypedrive-schemas)
20
56
21
57
## Installation
22
58
```
23
-
npm i hypermount -g
59
+
npm i hyperdrive-daemon -g
24
60
```
25
61
26
62
### Setup
27
63
28
64
When you first install Hypermount, you'll need to perform a setup step that will install native, prebuilt FUSE bindings. We currently only provide bindings for OSX and Linux. The setup step is the only step that requires `sudo`.
29
65
```
30
-
❯ hypermount setup
66
+
❯ hyperdrive setup
31
67
Configuring FUSE...
32
68
[sudo] password for andrewosh:
33
69
Successfully configured FUSE!
@@ -41,76 +77,69 @@ After installing/configuring, you'll need to start the daemon before running any
41
77
42
78
From within this storage directory, run:
43
79
```
44
-
❯ hypermount start
80
+
❯ hyperdrive start
45
81
Daemon started at http://localhost:3101
46
82
```
47
83
48
84
If you want to stop the daemon, you can run:
49
85
```
50
-
❯ hypermount stop
51
-
The Hypermount daemon has been stopped.
86
+
❯ hyperdrive stop
87
+
The Hyperdrive daemon has been stopped.
52
88
```
53
89
54
-
## Usage
90
+
## CLI
55
91
56
92
Hypermount provides an HTTP interface for mounting, unmounting, and providing status information about all current mounts. There's also a bundled CLI tool which wraps the HTTP interfaces and provides the following commands:
57
93
58
-
#### `hypermount setup`
94
+
### Basic Commands
95
+
#### `hyperdrive setup`
59
96
Performs a one-time configuration step that installs FUSE. This command will prompt you for `sudo`.
60
97
61
-
#### `hypermount mount <mountpoint> [key]`
62
-
If a key is specified, create a Hyperdrive using that key. If not, generate a new one. Once the drive has been created, mount it at `mountpoint`.
98
+
#### `hyperdrive start`
99
+
Start the Hyperdrive daemon.
63
100
64
-
This command takes options:
101
+
Options include:
65
102
```
66
-
--sparse Create a sparse content feed. [boolean] [default: true]
67
-
--sparseMetadata Create a sparse metadata feed. [boolean] [default: true]
103
+
--bootstrap ['host:port', 'host:port', ...] // Optional, alternative bootstrap servers
104
+
--storage /my/storage/dir // A storage directory for cores and the db. Defaults to ./storage
105
+
--log-level info // Logging level
106
+
--port 3101 // The port gRPC will bind to.
68
107
```
69
108
70
-
#### `hypermount unmount <mountpoint>`
71
-
Unmount a Hyperdrive that's been previously mounted at `mountpoint`, if it exists.
109
+
#### `hyperdrive status`
110
+
Gives the current status of the daemon.
72
111
73
-
*Note: This command will currently not delete or unseed the Hyperdrive. Support for this will be added soon.*
112
+
#### `hyperdrive stop`
113
+
Stop the daemon
74
114
75
-
#### `hypermount list`
76
-
Display information about all mounted Hyperdrives.
115
+
###FUSE Commands
116
+
All FUSE-related commands are accessed through the `fs` subcommand.
Mounts your root drive at `/hyperdrive`. This is your top-level, private Hyperdrive -- any drives you'd like to share with others must be created by mounting (a Hyperdrive mount, not a FUSE mount) a subdrive at a specified mountpoint within `/hyperdrive/home`.
99
120
100
-
#### `hypermount status`
101
-
Display status information about the Hypermount daemon.
121
+
Your root drive will persist across restarts. You can use it as a replacement for your normal home directory!
102
122
103
-
#### `hypermount start`
104
-
Launch the Hypermount daemon. When this command is executed, it will use the current working directory as its storage/logging directory. This command must be run before any additional commands (except for `setup`) will work.
123
+
#### `hyperdrive fs mount <mountpoint> [key]`
124
+
Mounts a subdrive within your root drive. The mountpoint must be within `/hyperdrive/home`, and the subdrive's key can be accessed at `/hyperdrive/home/<mountpoint>/.key`.
105
125
106
-
Takes these options:
107
-
```
108
-
--port The HTTP port that the daemon will bind to. [number] [default: 3101]
109
-
--replicationPort The port that the hypercore replicator will bind to. [number] [default: 3102]
110
-
```
126
+
Newly-created drives are private by default, and can be made available to the network with `hyperdrive fs publish <mountpoint>`.
127
+
128
+
-`mountpoint` must be a subdirectory of `/hyperdrive/home`. This command will create a mount within your root Hyperdrive.
129
+
-`key` is an optional drive key. If `key` is specified, it will be advertised on the network by default, and your drive will be read-only.
130
+
131
+
#### `hyperdrive fs publish <mountpoint>`
132
+
Makes a subdrive available to the network. If another user has access to the drive key (in `/hyperdrive/home/<mountpoint>/.key`, then they will only be able to sync the drive after the owner has published it.
133
+
134
+
-`mountpoint` must be a subdirectory of `/hyperdrive/home` and must have been previously mounted with the mount subcommand described above.
135
+
136
+
#### `hyperdrive fs unpublish <mountpoint>`
137
+
Will stop advertising a previously-published subdrive on the network.
138
+
139
+
*Note: This command will currently not delete the Hyperdrive. Support for this will be added soon.*
111
140
112
-
#### `hypermount stop`
113
-
Unmount all mounted Hyperdrives and stop the daemon.
141
+
#### `hyperdrive fs force-unmount`
142
+
If the daemon fails or is not stopped cleanly, then the `/hyperdrive` mountpoint might be left in an unusable state. Running this command before restarting the daemon will forcibly disconnect the mountpoint.
0 commit comments