/mosaic

Decentralized Data Parity Broker

Primary LanguageCMakeMozilla Public License 2.0MPL-2.0

Mosaic - Decentralized Data Parity Broker

This project aims to revolutionize data distribution using a high-performant distribution of verifiable and repairable fountain code parity symbols, with a focus on unique encoding methods and blockchain-based consensus mechanisms that aim to exceed 100,000 TPS (transactions per second) by leveraging distributed messaging queue technology.

Key Features

  • Proof of Replication and Geolocation: Our system incorporates proof of replication inspired by Filecoin and proof of geolocation based on cutting-edge research (read more).

  • Utility Tokens: We introduce two utility tokens for bandwidth and storage. Contributors receive tokens for every byte provided to the network, facilitating a fair and efficient resource exchange model.

  • Scalability Protocol: Leveraging ZeroMQ's scalability protocol, we ensure robust communication and scalability for the network.

  • Permissioned Blockchain: Initially designed as permissioned for security, our blockchain architecture allows for seamless evolution to accommodate various use cases and consensus mechanisms.

Project Foundation

The project draws inspiration from ZeroMQ's libraries, and has a dependency on the Malamute C project and aims to build a barebones infrastructure capable of supporting decentralized CDNs while remaining adaptable to specific use cases.

Getting Started

To get started with our project, please refer to the documentation for installation instructions, development guidelines, and more.

We welcome contributions and feedback from the community to help shape the future of decentralized data distribution.

Security Considerations:

While the data storage nodes operate in a permissionless manner, the blockchain initially employs a permissioned model. This approach prioritizes security during development and will be transitioned to a permissionless model once robust mechanisms to mitigate malicious actors are implemented.

Features

Usage

Build and run the standalone target

Use the following command to build and run the executable target.

cmake -S standalone -B build/standalone
cmake --build build/standalone
./build/standalone/Mosaic --help

Build and run test suite

Use the following commands from the project's root directory to run the test suite.

cmake -S test -B build/test
cmake --build build/test
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test

# or simply call the executable: 
./build/test/MosaicTests

To collect code coverage information, run CMake with the -DENABLE_TEST_COVERAGE=1 option.

Build the documentation

The documentation is automatically built and published whenever a GitHub Release is created. To manually build documentation, call the following command.

cmake -S documentation -B build/doc
cmake --build build/doc --target GenerateDocs
# view the docs
open build/doc/doxygen/html/index.html

To build the documentation locally, you will need Doxygen, jinja2 and Pygments installed on your system.

Build everything at once

The project also includes an all directory that allows building all targets at the same time. This is useful during development, as it exposes all subprojects to your IDE and avoids redundant builds of the library.

cmake -S all -B build
cmake --build build

# run tests
./build/test/MosaicTests
# format code
cmake --build build --target fix-format
# run standalone
./build/standalone/Mosaic --help
# build docs
cmake --build build --target GenerateDocs

Additional tools

The test and standalone subprojects include the tools.cmake file which is used to import additional tools on-demand through CMake configuration arguments. The following are currently supported.

Sanitizers

Sanitizers can be enabled by configuring CMake with -DUSE_SANITIZER=<Address | Memory | MemoryWithOrigins | Undefined | Thread | Leak | 'Address;Undefined'>.

Static Analyzers

Static Analyzers can be enabled by setting -DUSE_STATIC_ANALYZER=<clang-tidy | iwyu | cppcheck>, or a combination of those in quotation marks, separated by semicolons. By default, analyzers will automatically find configuration files such as .clang-format. Additional arguments can be passed to the analyzers by setting the CLANG_TIDY_ARGS, IWYU_ARGS or CPPCHECK_ARGS variables.

Ccache

Ccache can be enabled by configuring with -DUSE_CCACHE=<ON | OFF>.

FAQ

Is this ready for production?

No