Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 131 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,133 @@
# meteor
# Meteor

**Meteor** is a type of **Network Of Distributed Entities (NODE)**.
A **Distributed File System** that is designed to store and retrieve files on any computer in the network without the need for a centralized server.

Network consist of **Nodes** which communicate using **peer-to-peer (P2P) protocol**, maintaining connections with a subset of other nodes.
## Meteor Components

### Node

This is the core component of the Meteor. It does all of the work
of storing and retrieving files, as well as maintaining connections with other
nodes in the network.

Node contains the following components:

- **Permanent Storage Service**:
Service built on top of the custom filesystem **MFS** (Meteor FileSystem).

- **Network Service**:
Service responsible for maintaining connections with other nodes in the network.
It handles the 3-way handshake, and the requested *over-the-network* file transfers.

- **Control Service**:
The main relay between the *Eclipse* and the *Commander Service*,
responsible for handling requests from the user interface,
and passing them to the *Commander Service*.

- **Commander Service**:
Coordinator of the node, responsible for redirecting requests
from the *Control Service* to the appropriate receiver.

### Eclipse

This is the user interface of Meteor. It allows users to interact
with the network, and provides a way to upload and lookup files.

## Build

Clone the repository, change the directory to the root of the project and run:

```bash
make
```

The binary will be built in the `build/` directory.

## Deployment

There are several easy steps you need to follow to deploy the Meteor Node.

### 1. Routing Table

As there is no centralized server, to deploy the Meteor you need to have a
routing table (referred to as *RT*), which is the simple `.yaml` file
that contains the list of nodes in the network with their addresses.

---
Example:

```yaml
entries:
- pid: 1
host: 2887516426 # 172.28.1.10
port: 51000
domain: peer-hoba.meteor
- pid: 2
host: 2887516427 # 172.28.1.11
port: 52000
domain: peer-gancedo.meteor
```

Here `pid` is the UID of the node and `domain` is the domain name of the node.

---
**Note:** It is required to specify both the `pid` and `domain`
as the future implementation can be extended to support multiple nodes per domain.

### 2. Configuration

Another essential step is to configure the node itself. For that, you need to create
a `.yaml` conf file.

There are several essential fields in the configuration file (but you can configure a lot more):

- As we use statically allocated ports for the *Router* and *Listeners* it is recommended
to specify your own values for those fields.
- The `routing_table` field should point to the path of your RT file.
- The address of the **Eclipse** interface should be specified in the `control_listen_addr` field.

You can use an example of the [configuration file](deployments/demo/config-1.yaml) as a template.

### 3. Running the Node

Having the previously built **meteor** binary, you can run the node using the following command:

```bash
./build/node --config /path/to/config.yaml
```

**Note:** Run `./build/node --help` to see the available commands and flags.

That's it! Your node is now running and ready to accept connections from other nodes in the network!

Open the address, specified in the `control_listen_addr` field, in your browser to access the **Eclipse** interface.

## Debug

### Debugging Node

You can use flag `-l debug` to set debug log level for `node` logs.

### Debugging MFS

You can use `./build/mfs` utility to debug Meteor FileSystem.

Run `./build/mfs --help` to see available commands and flags.

Example usage:

```bash
# Print filesystem tree with all stored info.
./build/mfs --storage ./default.mfs ls -iT

# Shows filesystem metadata
./build/mfs --storage ./default.mfs metadata
```

## License

Meteor is licensed under the [MIT License](LICENSE).

## Contributing

If you want to contribute to the Meteor project, feel free to open an issue or a pull request.
16 changes: 8 additions & 8 deletions deployments/demo/rt.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
entries:
- pid: 1
host: 2887516426 # 172.28.1.10
port: 51000
domain: peer-hoba.meteor
- pid: 2
host: 2887516427 # 172.28.1.11
port: 52000
domain: peer-gancedo.meteor
- pid: 1
host: 2887516426 # 172.28.1.10
port: 51000
domain: peer-hoba.meteor
- pid: 2
host: 2887516427 # 172.28.1.11
port: 52000
domain: peer-gancedo.meteor