Skip to content

Commit c35fddb

Browse files
authored
Update README.md
1 parent 0915881 commit c35fddb

File tree

1 file changed

+88
-58
lines changed

1 file changed

+88
-58
lines changed

README.md

Lines changed: 88 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,59 @@
1-
# ⛰️ hypermount
2-
A FUSE-mountable distributed filesystem, built with Hyperdrive.
1+
# ⛰️ hyperdrive-daemon
2+
A FUSE-mountable distributed filesystem and remote Hyperdrive manager.
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+
### FUSE Usage
5+
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:
56
```
6-
❯ hypermount mount me
7-
Mounted 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e at friends/me
7+
❯ hyperdrive fs mount
8+
Mounted a drive with the following info:
9+
10+
Mountpoint: /hyperdrive
11+
Key: 49c5b9e4ac75a0f0b00ab911975837dd0c8d429512a13413fe2dad768fc9a0f2
12+
Seeding: false
13+
14+
This drive is private by default. To publish it, run `hyperdrive fs publish /hyperdrive`
815
```
9-
This command will give you a Hyperdrive key you can share with others. A friend can subsequently mount this drive:
16+
17+
You likely won't want to publish or share your root drive with others, but you can create shareable subdrives using the same command:
1018
```
11-
❯ hypermount mount andrew 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e
12-
Mounted 8a18b05e95e2e20eca9e66cdeff5b926c7c553edc34c7ffc06054edbb1810f7e at friends/andrew
19+
❯ hyperdrive fs mount /hyperdrive/home/videos
20+
Mounted a drive with the following info:
21+
22+
Mountpoint: /hyperdrive/home/videos
23+
Key: b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
24+
Seeding: false
25+
26+
This drive is private by default. To publish it, run `hyperdrive fs publish /hyperdrive/home/videos`
1327
```
1428

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

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.
31+
Subdrives are private by default (they will not be advertised on the network), but you can make them available with the `fs publish` command:
32+
```
33+
❯ hyperdrive fs publish /hyperdrive/home/videos
34+
Published the drive mounted at /hyperdrive/home/videos
35+
```
36+
37+
After publishing, another user can either:
38+
1. Mount the same subdrive by key within their own root drive
39+
2. Inspect the drive inside the `/hyperdrive/by-key` directory (can be a symlink target outside the FUSE mount!):
40+
```
41+
❯ cat /hyperdrive/home/videos/.key
42+
b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
43+
44+
❯ ls /hyperdrive/by-key/b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
45+
vid.mkv
46+
```
47+
Or:
48+
```
49+
❯ hyperdrive fs mount /hyperdrive/home/a_friends_videos b432f90b2f817164c32fe5056a06f50c60dc8db946e81331f92e3192f6d4b847
50+
...
51+
❯ ls /hyperdrive/home/a_friends_videos
52+
vid.mkv
53+
```
1854

19-
Under the hood, this module uses [corestore](https://github.com/andrewosh/corestore) to manage and seed your library of hypercores.
55+
### Hyperdrive API
56+
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)
2057

2158
## Installation
2259
```
@@ -27,7 +64,7 @@ npm i hypermount -g
2764

2865
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`.
2966
```
30-
hypermount setup
67+
hyperdrive setup
3168
Configuring FUSE...
3269
[sudo] password for andrewosh:
3370
Successfully configured FUSE!
@@ -41,76 +78,69 @@ After installing/configuring, you'll need to start the daemon before running any
4178

4279
From within this storage directory, run:
4380
```
44-
hypermount start
81+
hyperdrive start
4582
Daemon started at http://localhost:3101
4683
```
4784

4885
If you want to stop the daemon, you can run:
4986
```
50-
hypermount stop
51-
The Hypermount daemon has been stopped.
87+
hyperdrive stop
88+
The Hyperdrive daemon has been stopped.
5289
```
5390

54-
## Usage
91+
## CLI
5592

5693
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:
5794

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

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`.
99+
#### `hyperdrive start`
100+
Start the Hyperdrive daemon.
63101

64-
This command takes options:
102+
Options include:
65103
```
66-
--sparse Create a sparse content feed. [boolean] [default: true]
67-
--sparseMetadata Create a sparse metadata feed. [boolean] [default: true]
104+
--bootstrap ['host:port', 'host:port', ...] // Optional, alternative bootstrap servers
105+
--storage /my/storage/dir // A storage directory for cores and the db. Defaults to ./storage
106+
--log-level info // Logging level
107+
--port 3101 // The port gRPC will bind to.
68108
```
69109

70-
#### `hypermount unmount <mountpoint>`
71-
Unmount a Hyperdrive that's been previously mounted at `mountpoint`, if it exists.
110+
#### `hyperdrive status`
111+
Gives the current status of the daemon.
72112

73-
*Note: This command will currently not delete or unseed the Hyperdrive. Support for this will be added soon.*
113+
#### `hyperdrive stop`
114+
Stop the daemon
74115

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

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-
```
119+
#### `hyperdrive fs mount`
120+
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`.
99121

100-
#### `hypermount status`
101-
Display status information about the Hypermount daemon.
122+
Your root drive will persist across restarts. You can use it as a replacement for your normal home directory!
102123

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.
124+
#### `hyperdrive fs mount <mountpoint> [key]`
125+
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`.
105126

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-
```
127+
Newly-created drives are private by default, and can be made available to the network with `hyperdrive fs publish <mountpoint>`.
128+
129+
- `mountpoint` must be a subdirectory of `/hyperdrive/home`. This command will create a mount within your root Hyperdrive.
130+
- `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.
131+
132+
#### `hyperdrive fs publish <mountpoint>`
133+
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.
134+
135+
- `mountpoint` must be a subdirectory of `/hyperdrive/home` and must have been previously mounted with the mount subcommand described above.
136+
137+
#### `hyperdrive fs unpublish <mountpoint`
138+
Will stop advertising a previously-published subdrive on the network.
139+
140+
*Note: This command will currently not delete the Hyperdrive. Support for this will be added soon.*
111141

112-
#### `hypermount stop`
113-
Unmount all mounted Hyperdrives and stop the daemon.
142+
#### `hyperdrive fs force-unmount`
143+
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.
114144

115145
## License
116146

0 commit comments

Comments
 (0)