Skip to content
Snippets Groups Projects
Commit e4ea17fa authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

preparing tutorial RML8

parent 4102dc50
No related branches found
No related tags found
No related merge requests found
......@@ -7,11 +7,11 @@ duniter4j is a Java Client API for [Duniter](http://duniter.org).
duniter4j has four main components :
- shared: common classes
- duniter4j-core-shared: common classes
- core-client: a Client API to access to a Duniter network.
- duniter4j-core-client: a Client API to access to a Duniter network.
- elasticsearch: a ES plugin, to store blockchain, registry, market and more.
- duniter4j-elasticsearch: a ES plugin, to store blockchain, registry, market and more.
## Install as ES plugin
......@@ -40,11 +40,11 @@ sudo apt-get install openjdk-8-jre
Download lastest release of ElasticSearch
### Install ElasticSearch plugins
```bash
/bin/plugin install mapper-attachments
/bin/plugin install https://github.com/duniter/duniter4j/releases/download/0.2.0/duniter4j-elasticsearch-0.2.0.zip
/bin/plugin install https://github.com/duniter/duniter4j/releases/download/0.3.4/duniter4j-elasticsearch-0.3.4.zip
```
### Install libsodium
......@@ -72,7 +72,7 @@ sudo apt-get install openjdk-8-jre
- Install Libsodium (see on top)
- Download lastest release of file duniter4j-elasticsearch-X.Y-standalone.zip
- Download [lastest release](https://github.com/duniter/duniter4j/releases) of file duniter4j-elasticsearch-X.Y-standalone.zip
- Unzip
......@@ -140,32 +140,6 @@ $ ./elasticsearch
[2016-09-24 00:17:11,026][INFO ][duniter.blockchain ] [test_net] [cgeek.fr:9330] Indexing block #41282 - hash [00000AAD73B0E76B870E6779CD7ACCCE175802D7867C13B5C8ED077F380548C5]
```
Show help :
```bash
$ ./elasticseacrh --help
NAME
start - Start Elasticsearch
(...)
OPTIONS
-h,--help Shows this message
-p,--pidfile <pidfile> Creates a pid file in the specified path on start
-d,--daemonize Starts Elasticsearch in the background
-Dproperty=value Configures an Elasticsearch specific property, like -Dnetwork.host=127.0.0.1
--property=value Configures an elasticsearch specific property, like --network.host 127.0.0.1
--property value
NOTE: The -d, -p, and -D arguments must appear before any --property arguments.
```
## Use API (Developer)
......@@ -200,20 +174,6 @@ curl -XGET 'http://localhost:9200/test_net/block/_search' -d '{
"_source": ["number", "dividend", "hash", "membersCount"]
}'
```
- Get blocks from 0 to 100
```bash
curl -XGET 'http://localhost:9200/test_net/block/_search' -d '{
"query": {
"filtered" : {
"filter": {
"exists" : { "field" : "dividend" }
}
}
}
}'
```
More documentation here :
......
......@@ -52,15 +52,18 @@ cluster.name: duniter4j-elasticsearch
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
# network.host: 192.168.0.1
# network.host: 192.168.233.118
#
# Set a custom port for HTTP:
#
# http.port: 9200
# http.port: 9200-9300
http.cors.allow-origin: "/.*/"
http.cors.enabled: true
# Internal transport layer
#
# transport.tcp.port: 9210-9220
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
......@@ -129,7 +132,7 @@ duniter.port: 9330
#
# Enable security, to disable HTTP access to the default ES admin API
#
duniter.security.enable: true
duniter.security.enable: false
#
# Security token prefix (default: 'duniter-')
#
......
......@@ -21,7 +21,7 @@ cluster.name: duniter4j-elasticsearch-TEST
#
# Use a descriptive name for the node:
#
node.name: TEST
# node.name: node-1
#
# Add custom attributes to the node:
#
......@@ -52,18 +52,18 @@ node.name: TEST
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
# network.host: 192.168.0.1
network.host: 192.168.0.28
# network.host: 192.168.233.1
#
# Set a custom port for HTTP:
#
# http.port: 9200
http.port: 9203
# http.port: 9200-9300
http.cors.allow-origin: "/.*/"
http.cors.enabled: true
# Internal transport layer
#
# transport.tcp.port: 9210-9220
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
......@@ -73,8 +73,8 @@ http.cors.enabled: true
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["192.168.0.5", "192.168.0.28"]
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
# discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#discovery.zen.ping.unicast.hosts: ["127.0.0.1", ""]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
......@@ -100,53 +100,52 @@ discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
#
# Require explicit names when deleting indices:
#
action.destructive_requires_name: true
# action.destructive_requires_name: true
security.manager.enabled: false
#duniter.enabled: true
#duniter.host: cgeek.fr
#duniter.port: 9330
duniter.host: 192.168.0.28
duniter.port: 9604
#duniter.host: 192.168.0.28
#duniter.port: 9202
changes.listenSource: currency,*/block,*/record
#
# ---------------------------------- Duniter4j ---------------------------------
#
# Disbale duniter4j plugin
#
# duniter.enabled: false
#
# Reset and reload all Duniter4j data at startup - DO SET to true in production
#
# duniter.indices.reload: true
#
# Default string analyzer
#
duniter.string.analyzer: french
#duniter.indices.reload: true
# Should synchronize node blockchain ?
#duniter.blockchain.sync.enable: true
#
# Enabling node blockchain synchronization
#
duniter.blockchain.sync.enable: true
duniter.security.enable: true
# Should synchronize data using P2P
duniter.data.sync.enable: false
duniter.data.sync.host: data.le-sou.org
duniter.data.sync.port: 80
#TODO duniter.network.timeout:
# TODO : implement this option (check if same cluster)
#duniter.data.sync.checkClusterName=false
#duniter.dev.enable: true
#duniter.keyring.salt:
#duniter.keyring.password:
#duniter.keyring.pub:
#duniter.keyring.sec:
#script.groovy.sandbox.enabled: true
#
# Duniter node to synchronize
#
duniter.host: cgeek.fr
duniter.port: 9330
#
# ---------------------------------- Duniter4j security -------------------------
#
# Enable security, to disable HTTP access to the default ES admin API
#
duniter.security.enable: false
#
# Security token prefix (default: 'duniter-')
#duniter.auth.token.prefix: duniter-
#
# duniter.auth.token.prefix: duniter-
#
# Token validity duration, in seconds (default: 600)
duniter.auth.tokenValidityDuration: 3600 # = 1hour
\ No newline at end of file
#
# duniter.auth.tokenValidityDuration: 3600 # = 1hour
#
# ---------------------------------- Duniter4j P2P sync -------------------------
#
# Should synchronize data using P2P
#
duniter.data.sync.enable: false
#duniter.data.sync.host: data.duniter.fr
#duniter.data.sync.port: 80
\ No newline at end of file
#!/bin/sh
curl -XPOST "http://data.duniter.fr/market/record/_search?pretty&scroll=1m" -d'
curl -XPOST "http://data.duniter.fr/market/comment/_search?pretty" -d'
{
"query": {
"bool":{
"should": {
"range":{
"time":{
"gte":0
}
}
},
"filter": [
{"term":{
"currency":"sou"
"record":"AVbieTIAup9uzWgKipsC"
}
}
}
]
}
},
"from":0,
"size":100
}
}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment