Skip to content

Commit 35540ee

Browse files
committed
Merge branch 'master' of github.com:andrewosh/hypermount
2 parents a065fa6 + a8a9f52 commit 35540ee

File tree

1 file changed

+88
-59
lines changed

1 file changed

+88
-59
lines changed

README.md

Lines changed: 88 additions & 59 deletions
Original file line numberDiff line numberDiff 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.
33

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:
55
```
6-
❯ hypermount mount me
7-
Mounted 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e at friends/me
6+
❯ hyperdrive fs mount
7+
Mounted a drive with the following info:
8+
9+
Mountpoint: /hyperdrive
10+
Key: 49c5b9e4ac75a0f0b00ab911975837dd0c8d429512a13413fe2dad768fc9a0f2
11+
Seeding: false
12+
13+
This drive is private by default. To publish it, run `hyperdrive fs publish /hyperdrive`
814
```
9-
This command will give you a Hyperdrive key you can share with others. A friend can subsequently mount this drive:
15+
16+
You likely won't want to publish or share your root drive with others, but you can create shareable subdrives using the same command:
1017
```
11-
❯ hypermount mount andrew 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e
12-
Mounted 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e at friends/andrew
18+
❯ hyperdrive fs mount /hyperdrive/home/videos
19+
Mounted a drive with the following info:
20+
21+
Mountpoint: /hyperdrive/home/videos
22+
Key: b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
23+
Seeding: false
24+
25+
This drive is private by default. To publish it, run `hyperdrive fs publish /hyperdrive/home/videos`
1326
```
1427

1528
Once your drives are mounted, you can treat them as you would any other directory!
1629

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!):
39+
```
40+
❯ cat /hyperdrive/home/videos/.key
41+
b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
42+
43+
❯ 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+
```
1853

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)
2056

2157
## Installation
2258
```
23-
npm i hypermount -g
59+
npm i hyperdrive-daemon -g
2460
```
2561

2662
### Setup
2763

2864
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`.
2965
```
30-
hypermount setup
66+
hyperdrive setup
3167
Configuring FUSE...
3268
[sudo] password for andrewosh:
3369
Successfully configured FUSE!
@@ -41,76 +77,69 @@ After installing/configuring, you'll need to start the daemon before running any
4177

4278
From within this storage directory, run:
4379
```
44-
hypermount start
80+
hyperdrive start
4581
Daemon started at http://localhost:3101
4682
```
4783

4884
If you want to stop the daemon, you can run:
4985
```
50-
hypermount stop
51-
The Hypermount daemon has been stopped.
86+
hyperdrive stop
87+
The Hyperdrive daemon has been stopped.
5288
```
5389

54-
## Usage
90+
## CLI
5591

5692
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:
5793

58-
#### `hypermount setup`
94+
### Basic Commands
95+
#### `hyperdrive setup`
5996
Performs a one-time configuration step that installs FUSE. This command will prompt you for `sudo`.
6097

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.
63100

64-
This command takes options:
101+
Options include:
65102
```
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.
68107
```
69108

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.
72111

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
74114

75-
#### `hypermount list`
76-
Display information about all mounted Hyperdrives.
115+
### FUSE Commands
116+
All FUSE-related commands are accessed through the `fs` subcommand.
77117

78-
The output takes the form:
79-
```
80-
❯ hypermount list
81-
35127c7db33e884a8b5b054aa8bef510c6faf3688265f0d885241731bf0354b4 => /home/andrewosh/friends/a
82-
Network Stats:
83-
Metadata:
84-
Uploaded: 0 MB
85-
Downloaded: 0 MB
86-
Content:
87-
Uploaded: 0 MB
88-
Downloaded: 0 MB
89-
1fb343ab8362b84155e7554a42d023b376aa71cdc9d94ca9a4efee8a58326d03 => /home/andrewosh/friends/b
90-
Network Stats:
91-
Metadata:
92-
Uploaded: 0 MB
93-
Downloaded: 0 MB
94-
Content:
95-
Uploaded: 0 MB
96-
Downloaded: 0 MB
97-
...
98-
```
118+
#### `hyperdrive fs mount`
119+
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`.
99120

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!
102122

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`.
105125

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.*
111140

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.
114143

115144
## License
116145

0 commit comments

Comments
 (0)