Skip to content

Commit 4a712f9

Browse files
authored
Merge pull request #25 from RTradeLtd/docs/readme
TEM-241: update readme for lensv2
2 parents 78428e9 + d92a1bb commit 4a712f9

File tree

1 file changed

+77
-32
lines changed

1 file changed

+77
-32
lines changed

README.md

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,97 @@
1-
# Lens
1+
# 🔍 Lens
22

3-
[![GoDoc](https://godoc.org/github.com/RTradeLtd/Lens?status.svg)](https://godoc.org/github.com/RTradeLtd/Lens) [![codecov](https://codecov.io/gh/RTradeLtd/Lens/branch/master/graph/badge.svg)](https://codecov.io/gh/RTradeLtd/Lens) [![Build Status](https://travis-ci.com/RTradeLtd/Lens.svg?branch=master)](https://travis-ci.com/RTradeLtd/Lens) [![Go Report Card](https://goreportcard.com/badge/github.com/RTradeLtd/Lens)](https://goreportcard.com/report/github.com/RTradeLtd/Lens)
3+
> Search engine for the distributed web
44
5-
Lens is an opt-in search engine and data collection tool to aid content discovery of the distributed web. Initially integrated with TEMPORAL, Lens will allow users to optionally have the data they upload be searched and indexed and be awarded with RTC for participating in the data collection process. Users can then search for "keywords" of content, such as "document" or "api". Lens will then use this keyword to retrieve all content which matched.
5+
Lens is an opt-in search engine and data collection tool to aid content discovery
6+
of the distributed web. It exposes a simple, minimal API for intelligently indexing
7+
and querying content on [IPFS](https://ipfs.io/).
68

7-
Searching through Lens will be facilitated through the TEMPORAL web interface. Optionally, we will have a service independent from TEMPORAL which users can submit content to have it be indexed. This however, is not compensated with RTC. In order to receive the RTC, you must participate through Lens indexing within the TEMPORAL web interface.
9+
[![GoDoc](https://godoc.org/github.com/RTradeLtd/Lens?status.svg)](https://godoc.org/github.com/RTradeLtd/Lens)
10+
[![Build Status](https://travis-ci.com/RTradeLtd/Lens.svg?branch=master)](https://travis-ci.com/RTradeLtd/Lens)
11+
[![codecov](https://codecov.io/gh/RTradeLtd/Lens/branch/master/graph/badge.svg)](https://codecov.io/gh/RTradeLtd/Lens)
12+
[![Go Report Card](https://goreportcard.com/badge/github.com/RTradeLtd/Lens)](https://goreportcard.com/report/github.com/RTradeLtd/Lens)
13+
[![Latest Release](https://img.shields.io/github/release/RTradeLtd/Lens.svg?colorB=red)](https://github.com/RTradeLtd/Lens/releases)
814

9-
## Supported Formats
15+
## Features and Usage
1016

11-
Only IPFS CIDs are supported, and they must be plaintext files. We attempt to determine the content type via mime type sniffing, and use that to determine whether or not we can analyze the content.
17+
Initially integrated with Temporal, Lens will allow users to optionally have the
18+
data they upload be searched and indexed and be awarded with RTC for participating
19+
in the data collection process. Users can then search for content using a
20+
simple-to-use API.
1221

13-
Please see the following table for supported content types that we can index. Note if the type is listed as `<type>/*` it means that any "sub type" of that mime type is supported.
22+
Searching through Lens will be facilitated through [Temporal web](https://temporal.cloud/lens).
23+
Optionally, we will have a service independent from Temporal which users can
24+
submit content to have it be indexed. This however, is not compensated with RTC.
25+
In order to receive the RTC, you must participate through Lens indexing within
26+
the Temporal web interface.
27+
28+
### API
29+
30+
Lens exposes a simple API via [gRPC](https://grpc.io/). The definitions are in
31+
[`RTradeLtd/grpc`](https://github.com/RTradeLtd/grpc/blob/master/lensv2/service.proto).
32+
33+
The Lens API, summarized, currently consists of three core RPCs:
34+
35+
```proto
36+
service LensV2 {
37+
rpc Index(IndexReq) returns (IndexResp) {}
38+
rpc Search(SearchReq) returns (SearchResp) {}
39+
rpc Remove(RemoveReq) returns (RemoveResp) {}
40+
}
41+
```
42+
43+
Golang bindings for the Lens API can be found in
44+
[`RTradeLtd/grpc`](https://github.com/RTradeLtd/grpc).
45+
46+
### Supported Formats
47+
48+
Only IPFS [CIDs](https://github.com/multiformats/cid) are supported, and they
49+
must be plaintext files. We attempt to determine the content type via mime type
50+
sniffing, and use that to determine whether or not we can analyze the content.
51+
52+
Please see the following table for supported content types that we can index.
53+
Note if the type is listed as `<type>/*` it means that any "sub type" of that
54+
mime type is supported.
1455

1556
| Mime Type | Support Level | Tested Types |
1657
|------------------|---------------|--------------------------|
17-
| `text/*` | Alpha | `text/plain`, `text/html`|
18-
| `image/*` | Alpha | `image/jpeg` |
19-
| `application/pdf`| Alpha | `application/pdf` |
20-
21-
## Processing
58+
| `text/*` | Beta | `text/plain`, `text/html`|
59+
| `image/*` | Beta | `image/jpeg` |
60+
| `application/pdf`| Beta | `application/pdf` |
2261

23-
We support two types of processing, index and search requests
62+
## Deployment
2463

25-
### Indexing
64+
The recommended way to deploy a Lens instance is via the
65+
[`rtradetech/lens`](https://cloud.docker.com/u/rtradetech/repository/docker/rtradetech/lens)
66+
Docker image.
2667

27-
1) When receiving an index request, we check to make sure the object to be indexed is a supported data type.
28-
2) We then attempt to determine the mime type of whatever object is being indexed, and validate it to make sure its a supported format.
29-
3) We then extract consumable data from the object through an `xtractor` service.
30-
4) After extracting usable data, we then send it to an `analyzer` service which is responsible for analyzer content to create meta-data
31-
5) After the meta-data is generated, we then pass it onto the core of the lens service
32-
6) The lens service is responsible for creating lens objects, which are valid IPLD objects, and storing them within IPFS, and within a local badgerds instance
68+
```sh
69+
$> docker pull rtradetech/lens:latest
70+
```
3371

34-
The following objects are created during an indexing request:
72+
A [`docker-compose`](https://docs.docker.com/compose/) [configuration](/lens.yml)
73+
is available that also starts up other prerequisites:
3574

36-
Keyword Object:
75+
```sh
76+
$> wget -O lens.yml https://raw.githubusercontent.com/RTradeLtd/Lens/master/lens.yml
77+
$> LENS=latest BASE=/my/dir docker-compose -f lens.yml up
78+
```
3779

38-
* A keyword object contains all of the Lens Identifiers for content that can be searched for with this keyword
80+
## Development
3981

40-
Object:
82+
This project requires:
4183

42-
* An object is content that was indexed, and includes a Lens Identifier for this content within the lens system (note, this is simply to enable easy lookup and is not valid outside of Lens)
43-
* Also includes are all the keywords that can be used to search for this particular content
84+
* [Go 1.11+](https://golang.org/dl/)
85+
* [dep](https://github.com/golang/dep#installation)
86+
* [Tesseract](https://github.com/tesseract-ocr/tesseract#installing-tesseract)
87+
* [Tensorflow](https://www.tensorflow.org/install)
88+
* [go-fitz](https://github.com/gen2brain/go-fitz#install)
4489

45-
For image indexing, we currently run the images against pre-trained InceptionV5 tensorflow models. In the future we will more than likely migrate to models we train ourselves, leveraging our extensive GPU computing infrastructure.
90+
To fetch the codebase, use `go get`:
4691

47-
## Searching
92+
```sh
93+
$> go get github.com/RTradeLtd/Lens
94+
```
4895

49-
1) When receiving a search request, we are simply provided with a list of keywords to search through.
50-
2) Using these keywords, we then search through badgerds to see if these keywords have been seen before. If they have, we then pull a list of all lens identifiers that can be matched by this keyword.
51-
3) After repeating step 2 for all keywords, we then search through badgerds to find the objects that the lens identifiers refer to
52-
4) The user is then sent a list of all object names (ie, ipfs content hashes) for which.
96+
A rudimentary Makefile target [`make dep`](https://github.com/RTradeLtd/Lens/blob/master/Makefile#L13)
97+
is available for installing the required dependencies.

0 commit comments

Comments
 (0)