Mahuta (formerly known as IPFS-Store) is a library to aggregate and consolidate files or documents stored by your application on the IPFS network. It provides a solution to collect, store, index, cache and search IPFS data handled by your system in a convenient way.

Project status

Service Master Development
CI Status
Test Coverage Coverage Coverage
Bintray Bintray
Sonar Quality Gate Status



Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.


Mahuta depends of two components:

See how to run those two components first run IPFS and ElasticSearch

Java library

  1. Import the Maven dependencies (core module + indexer)
  1. Configure Mahuta to connect to an IPFS node and an indexer
Mahuta mahuta = new MahutaFactory()
    .configureStorage(IPFSService.connect("localhost", 5001))
    .configureIndexer(ElasticSearchService.connect("localhost", 9300, "cluster-name"))
  1. Execute high-level operations
IndexingResponse response = mahuta.prepareStringIndexing("article", "## This is my first article")
    .indexFields(ImmutableMap.of("title", "First Article", "author", "greg"))

GetResponse response = mahuta.prepareGet()

SearchResponse response = mahuta.prepareSearch()
    .query(Query.newQuery().equals("author", "greg"))
    .pageRequest(PageRequest.of(0, 20))

For more info, Mahuta Java API


  1. Import the Maven dependencies
  1. Configure your spring-data repository
@IPFSDocument(index = "article", indexConfiguration = "article_mapping.json", indexContent = true)
public class Article {

    private String id;

    private String hash;

    private String title;

    private String content;

    private Date createdAt;

    private String createdBy;

public class ArticleRepository extends MahutaRepositoryImpl<Article, String> {

    public ArticleRepository(Mahuta mahuta) {

For more info, Mahuta Spring Data

HTTP API with Docker



$ docker run -it --name mahuta \ 
    -p 8040:8040 \
    -e MAHUTA_IPFS_HOST=ipfs \
    -e MAHUTA_ELASTICSEARCH_HOST=elasticsearch \

Docker Compose

Check out the documentation to configure Mahuta HTTP-API with Docker.


To access the API documentation, go to Mahuta HTTP API

Create the index article

curl -X POST \
  http://localhost:8040/mahuta/config/index/article \
  -H 'Content-Type: application/json' 

Store and index an article and its metadata

curl -X POST \
  'http://localhost:8040/mahuta/index' \
  -H 'content-type: application/json' \
  -d '{"content":"# Hello world,\n this is my first file stored on **IPFS**","indexName":"article","indexDocId":"hello_world","contentType":"text/markdown","index_fields":{"title":"Hello world","author":"Gregoire Jeanmart","votes":10,"date_created":1518700549,"tags":["general"]}}'

Search by query

curl -X POST \
 'http://localhost:8040/mahuta/query/search?index=article' \
 -H 'content-type: application/json' \
 -d '{"query":[{"name":"title","operation":"CONTAINS","value":"Hello"},{"name":"author.keyword","operation":"EQUALS","value":"Gregoire Jeanmart"},{"name":"votes","operation":"GT","value":"5"}]}'
  "status": "SUCCESS",
  "page": {
    "pageRequest": {
      "page": 0,
      "size": 20,
      "sort": null,
      "direction": "ASC"
    "elements": [
        "metadata": {
          "indexName": "article",
          "indexDocId": "hello_world",
          "contentId": "Qmd6VkHiLbLPncVQiewQe3SBP8rrG96HTkYkLbMzMe6tP2",
          "contentType": "text/markdown",
          "content": null,
          "pinned": true,
          "indexFields": {
            "author": "Gregoire Jeanmart",
            "votes": 10,
            "title": "Hello world",
            "createAt": 1518700549,
            "tags": [
        "payload": null
    "totalElements": 1,
    "totalPages": 1