Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
duniter4j
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
java
duniter4j
Commits
2c98c073
Commit
2c98c073
authored
9 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
- Prepare first release
parent
303715e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+58
-4
58 additions, 4 deletions
README.md
with
58 additions
and
4 deletions
README.md
+
58
−
4
View file @
2c98c073
...
...
@@ -29,7 +29,7 @@ The elasticsearch component is ready to use !
-
Linux (Ubuntu):
```
bash
$
sudo
apt-get
install
openjdk-8-jre
sudo
apt-get
install
openjdk-8-jre
```
-
Install
[
libsodium
](
http://doc.libsodium.org/installation/index.html
)
(
Linux
only)
...
...
@@ -44,9 +44,9 @@ $ sudo apt-get install openjdk-8-jre
-
Unzip, then start a elasticsearch node, just do :
```
bash
$
unzip ucoinj-elasticsearch-X.Y-standalone.zip
$
cd
ucoinj-elasticsearch-X.Y
$
./ucoinj-elasticsearch.sh start index
-h
<node_host>
-p
<node_port>
unzip ucoinj-elasticsearch-X.Y-standalone.zip
cd
ucoinj-elasticsearch-X.Y
./ucoinj-elasticsearch.sh start index
-h
<node_host>
-p
<node_port>
```
Example on meta_brouzouf test currency :
...
...
@@ -92,6 +92,60 @@ Options:
```
## Use it
When a blockchain currency has been indexed, you can test some fun queries :
-
get a block by number (e.g the block #0):
http://localhost:9200/meta_brouzouf/block/0 -> with some additional metadata given by ES
http://localhost:9200/meta_brouzouf/block/0/_source1 -> the original JSON block
-
Block #125 with only hash, dividend and memberCount:
http://localhost:9200/meta_brouzouf/block/125/_source?_source=number,hash,dividend,membersCount
-
All blocks using a pubkey (or whatever):
http://localhost:9200/meta_brouzouf/block/_search?q=9sbUKBMvJVxtEVhC4N9zV1GFTdaempezehAmtwA8zjKQ1
-
All blocks with a dividend, with only some selected fields (like dividend, number, hahs).
Note : Query executed in command line, using CURL:
```
bash
curl
-XGET
'http://localhost:9200/meta_brouzouf/block/_search'
-d
'{
"query": {
"filtered" : {
"filter": {
"exists" : { "field" : "dividend" }
}
}
},
"_source": ["number", "dividend", "hash", "membersCount"]
}'
```
-
Get blocks from 0 to 100
```
bash
curl
-XGET
'http://localhost:9200/meta_brouzouf/block/_search'
-d
'{
"query": {
"filtered" : {
"filter": {
"exists" : { "field" : "dividend" }
}
}
}
}'
```
More documentation here :
-
ElasticSearch
[
official web site
](
http://www.elastic.co/guide/en/elasticsearch/reference/1.3/docs-get.html#get-source-filtering
)
-
a good
[
tutorial
](
http://okfnlabs.org/blog/2013/07/01/elasticsearch-query-tutorial.html
)
## Compile
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment