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

preparing tutorial RML8

parent 4102dc50
Branches
Tags
No related merge requests found
...@@ -7,11 +7,11 @@ duniter4j is a Java Client API for [Duniter](http://duniter.org). ...@@ -7,11 +7,11 @@ duniter4j is a Java Client API for [Duniter](http://duniter.org).
duniter4j has four main components : 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 ## Install as ES plugin
...@@ -44,7 +44,7 @@ sudo apt-get install openjdk-8-jre ...@@ -44,7 +44,7 @@ sudo apt-get install openjdk-8-jre
```bash ```bash
/bin/plugin install mapper-attachments /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 ### Install libsodium
...@@ -72,7 +72,7 @@ sudo apt-get install openjdk-8-jre ...@@ -72,7 +72,7 @@ sudo apt-get install openjdk-8-jre
- Install Libsodium (see on top) - 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 - Unzip
...@@ -140,32 +140,6 @@ $ ./elasticsearch ...@@ -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] [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) ## Use API (Developer)
...@@ -201,20 +175,6 @@ curl -XGET 'http://localhost:9200/test_net/block/_search' -d '{ ...@@ -201,20 +175,6 @@ curl -XGET 'http://localhost:9200/test_net/block/_search' -d '{
}' }'
``` ```
- 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 : More documentation here :
......
...@@ -52,15 +52,18 @@ cluster.name: duniter4j-elasticsearch ...@@ -52,15 +52,18 @@ cluster.name: duniter4j-elasticsearch
# #
# Set the bind address to a specific IP (IPv4 or IPv6): # 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: # Set a custom port for HTTP:
# #
# http.port: 9200 # http.port: 9200-9300
http.cors.allow-origin: "/.*/" http.cors.allow-origin: "/.*/"
http.cors.enabled: true http.cors.enabled: true
# Internal transport layer
#
# transport.tcp.port: 9210-9220
# #
# For more information, see the documentation at: # For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html> # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
...@@ -129,7 +132,7 @@ duniter.port: 9330 ...@@ -129,7 +132,7 @@ duniter.port: 9330
# #
# Enable security, to disable HTTP access to the default ES admin API # 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-') # Security token prefix (default: 'duniter-')
# #
......
...@@ -21,7 +21,7 @@ cluster.name: duniter4j-elasticsearch-TEST ...@@ -21,7 +21,7 @@ cluster.name: duniter4j-elasticsearch-TEST
# #
# Use a descriptive name for the node: # Use a descriptive name for the node:
# #
node.name: TEST # node.name: node-1
# #
# Add custom attributes to the node: # Add custom attributes to the node:
# #
...@@ -52,18 +52,18 @@ node.name: TEST ...@@ -52,18 +52,18 @@ node.name: TEST
# #
# Set the bind address to a specific IP (IPv4 or IPv6): # Set the bind address to a specific IP (IPv4 or IPv6):
# #
# network.host: 192.168.0.1 # network.host: 192.168.233.1
network.host: 192.168.0.28
# #
# Set a custom port for HTTP: # Set a custom port for HTTP:
# #
# http.port: 9200 # http.port: 9200-9300
http.port: 9203
http.cors.allow-origin: "/.*/" http.cors.allow-origin: "/.*/"
http.cors.enabled: true http.cors.enabled: true
# Internal transport layer
#
# transport.tcp.port: 9210-9220
# #
# For more information, see the documentation at: # For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html> # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
...@@ -73,8 +73,8 @@ http.cors.enabled: true ...@@ -73,8 +73,8 @@ http.cors.enabled: true
# Pass an initial list of hosts to perform discovery when new node is started: # 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]"] # 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: ["host1", "host2"]
discovery.zen.ping.unicast.hosts: ["127.0.0.1"] #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): # 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"] ...@@ -100,53 +100,52 @@ discovery.zen.ping.unicast.hosts: ["127.0.0.1"]
# #
# Require explicit names when deleting indices: # Require explicit names when deleting indices:
# #
action.destructive_requires_name: true # action.destructive_requires_name: true
security.manager.enabled: false security.manager.enabled: false
#
#duniter.enabled: true # ---------------------------------- Duniter4j ---------------------------------
#duniter.host: cgeek.fr #
#duniter.port: 9330 # Disbale duniter4j plugin
#
duniter.host: 192.168.0.28 # duniter.enabled: false
duniter.port: 9604 #
#duniter.host: 192.168.0.28 # Reset and reload all Duniter4j data at startup - DO SET to true in production
#duniter.port: 9202 #
changes.listenSource: currency,*/block,*/record
duniter.string.analyzer: french
# duniter.indices.reload: true # duniter.indices.reload: true
#
# Should synchronize node blockchain ? # Default string analyzer
#duniter.blockchain.sync.enable: true #
duniter.string.analyzer: french
#
# Enabling node blockchain synchronization
#
duniter.blockchain.sync.enable: true duniter.blockchain.sync.enable: true
#
duniter.security.enable: true # Duniter node to synchronize
#
# Should synchronize data using P2P duniter.host: cgeek.fr
duniter.data.sync.enable: false duniter.port: 9330
duniter.data.sync.host: data.le-sou.org #
duniter.data.sync.port: 80 # ---------------------------------- Duniter4j security -------------------------
#TODO duniter.network.timeout: #
# Enable security, to disable HTTP access to the default ES admin API
# TODO : implement this option (check if same cluster) #
#duniter.data.sync.checkClusterName=false duniter.security.enable: false
#
#duniter.dev.enable: true
#duniter.keyring.salt:
#duniter.keyring.password:
#duniter.keyring.pub:
#duniter.keyring.sec:
#script.groovy.sandbox.enabled: true
# Security token prefix (default: 'duniter-') # Security token prefix (default: 'duniter-')
#
# duniter.auth.token.prefix: duniter- # duniter.auth.token.prefix: duniter-
#
# Token validity duration, in seconds (default: 600) # 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 #!/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": { "query": {
"bool":{ "bool":{
"should": {
"range":{
"time":{
"gte":0
}
}
},
"filter": [ "filter": [
{"term":{ {"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.
Please register or to comment