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

- Replace "ucoin" with "Duniter"

 - fix plugin config file
 - add license header
parent 6b60232f
No related branches found
No related tags found
No related merge requests found
Showing
with 225 additions and 48 deletions
[submodule "duniter4j-cesium/src/main/cesium"]
path = duniter4j-cesium/src/main/cesium
url = git://github.com/ucoin-io/cesium.git
url = git://github.com/duniter/cesium.git
[submodule "duniter4j-elasticsearch/src/main/resources/cities"]
path = duniter4j-elasticsearch/src/main/resources/cities
url = git://github.com/David-Haim/CountriesToCitiesJSON.git
duniter4j
======
uCoin Java Client API.
duniter4j is a Java Client API for [Duniter](http://duniter.org).
## Architecture
......@@ -11,18 +9,18 @@ duniter4j has four main components :
- shared: common classes
- core-client: a Client API to access to a uCoin network.
- core-client: a Client API to access to a Duniter network.
- elasticsearch: a tools to index all blockchain and more.
- web: a web client (HTML + JS + REST service), elasticsearch for data navigation, payement and more !
- web: an web/mobile client, for data navigation, payment and more !
## Test it
The elasticsearch component is ready to use !
- Install Java JRE 7 or more.
- Install Java JRE 8 or more.
- Windows: see [Oracle web site](http://oracle.com/java/index.html)
......@@ -52,13 +50,13 @@ cd duniter4j-elasticsearch-X.Y
Example on meta_brouzouf test currency :
```bash
$ ./duniter4j-elasticsearch.sh start index -h metab.ucoin.io -p 9201
$ ./duniter4j-elasticsearch.sh start index -h cgeek.fr -p 9330
2016-01-07 23:34:34,771 INFO Starting duniter4j :: ElasticSearch Indexer with arguments [start, index, -h, metab.ucoin.io, -p, 9201]
2016-01-07 23:34:34,856 INFO Application basedir: /home/user/.duniter4j-elasticsearch
2016-01-07 23:34:34,861 INFO Starts i18n with locale [fr] at [/home/user/.duniter4j-elasticsearch/data/i18n]
2016-01-07 23:34:35,683 INFO Starts ElasticSearch node with cluster name [duniter4j-elasticsearch] at [/home/user/.duniter4j-elasticsearch/data].
*** duniter4j :: Elasticsearch successfully started *** >> To quit, press [Q] or enter
2016-01-07 23:34:45,015 INFO Indexing last blocks of [meta_brouzouf] from peer [metab.ucoin.io:9201]
2016-01-07 23:34:45,015 INFO Indexing last blocks of [test_net] from peer [cgeek.fr:9330]
2016-01-07 23:35:01,597 INFO Indexing block #999 / 47144 (2%)...
2016-01-07 23:35:15,554 INFO Indexing block #1998 / 47144 (4%)...
2016-01-07 23:35:30,713 INFO Indexing block #2997 / 47144 (6%)...
......@@ -98,23 +96,23 @@ 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/test_net/block/0 -> with some additional metadata given by ES
http://localhost:9200/meta_brouzouf/block/0/_source -> the original JSON block
http://localhost:9200/test_net/block/0/_source -> 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
http://localhost:9200/test_net/block/125/_source?_source=number,hash,dividend,membersCount
- All blocks using a pubkey (or whatever):
http://localhost:9200/meta_brouzouf/block/_search?q=9sbUKBMvJVxtEVhC4N9zV1GFTdaempezehAmtwA8zjKQ1
http://localhost:9200/test_net/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 '{
curl -XGET 'http://localhost:9200/test_net/block/_search' -d '{
"query": {
"filtered" : {
"filter": {
......@@ -129,7 +127,7 @@ curl -XGET 'http://localhost:9200/meta_brouzouf/block/_search' -d '{
- Get blocks from 0 to 100
```bash
curl -XGET 'http://localhost:9200/meta_brouzouf/block/_search' -d '{
curl -XGET 'http://localhost:9200/test_net/block/_search' -d '{
"query": {
"filtered" : {
"filter": {
......@@ -169,7 +167,7 @@ More documentation here :
- Get the source code, then compile using Maven:
```
git clone https://github.com/ucoin-io/duniter4j.git
git clone https://github.com/duniter/duniter4j.git
cd duniter4j
git submodule init
git submodule sync
......@@ -186,8 +184,8 @@ $ mvn install -DskipTests -DperformRelease
## Roadmap
- Detect blockchain rollback
- Allow to store data in embedded database (SQLLite or HsqlDB)
- Refactor to only use HTML + JS in UI (remove wicket dependencies)
- Add an embedded [Cesium](https://www.github.com/duniter/cesium) inside the ElasticSearch plugin
- Detect blockchain rollback
package org.duniter.core.client.model.bma;
/*
* #%L
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import java.io.Serializable;
/**
......
package org.duniter.core.client.model.bma;
/*
* #%L
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
/**
* Created by blavenie on 31/03/16.
*/
......
package org.duniter.core.client.model.bma;
/*
* #%L
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
/**
* Created by blavenie on 31/03/16.
*/
......
package org.duniter.core.client.model.elasticsearch;
/*
* #%L
* Duniter4j :: Core Client API
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
/**
* Created by blavenie on 01/03/16.
*/
......
package org.duniter.core.util.websocket;
/*
* #%L
* Duniter4j :: Core Shared
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import com.google.common.collect.Lists;
import org.duniter.core.util.CollectionUtils;
import org.slf4j.Logger;
......
......@@ -38,7 +38,7 @@ public class Plugin extends org.elasticsearch.plugins.Plugin {
@Override
public String description() {
return "duniter4j ElasticSearch Plugin";
return "Duniter4j ElasticSearch Plugin";
}
@Override
......@@ -48,4 +48,10 @@ public class Plugin extends org.elasticsearch.plugins.Plugin {
modules.add(new RestModule());
return modules;
}
/* -- protected methods -- */
protected void initInstance() {
}
}
\ No newline at end of file
package org.duniter.elasticsearch.service.exception;
/*
* #%L
* Duniter4j :: ElasticSearch Plugin
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import org.duniter.core.exception.BusinessException;
/**
......
/*
* #%L
* Duniter4j :: ElasticSearch Plugin
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
{ "index": { "_id": "cat71"}}
{ "name": "EMPLOI" , "parent": null}
{ "index": { "_id": "cat33"}}
......
/*
* #%L
* Duniter4j :: ElasticSearch Plugin
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
{"index": {"_id": "0"}}
{"name": "Autres", "parent": null}
{"index": {"_id": "particulier"}}
......
......@@ -3,7 +3,7 @@ description=duniter4j :: ElasticSearch Plugin
version=0.1-SNAPSHOT
site=false
jvm=true
classname=io.ucoin.duniter4j.elasticsearch.plugin.Plugin
classname=org.duniter.elasticsearch.plugin.Plugin
java.version=1.7
elasticsearch.version=2.3.1
isolated=false
\ No newline at end of file
......@@ -5,15 +5,12 @@
<artifactId>duniter4j</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>UCoin Java Client</name>
<name>Duniter4j : a Duniter Java Client API</name>
<properties>
<!-- source file encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- UCoin version -->
<ucoin.version>0.9.7</ucoin.version>
<!-- Commons versions -->
<file.encoding>UTF-8</file.encoding>
<log4j.version>1.2.17</log4j.version>
......@@ -40,9 +37,6 @@
<junit.version>4.12</junit.version>
<jetty.version>9.0.4.v20130625</jetty.version>
<!-- IDE & Development process -->
<maven-eclipse-plugin.version>2.9</maven-eclipse-plugin.version>
<!--license-maven-plugin config -->
<maven.license.file>${project.basedir}/LICENSE</maven.license.file>
<license.useMissingFile>true</license.useMissingFile>
......@@ -105,14 +99,14 @@
</modules>
<scm>
<url>https://github.com/ucoin-io/duniter4j/</url>
<connection>scm:svn:https://github.com/ucoin-io/duniter4j/</connection>
<developerConnection>scm:svn:https://github.com/ucoin-io/duniter4j/</developerConnection>
<url>https://github.com/duniter/duniter4j/</url>
<connection>scm:svn:https://github.com/duniter/duniter4j/</connection>
<developerConnection>scm:svn:https://github.com/duniter/duniter4j/</developerConnection>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/ucoin-io/duniter4j/issues</url>
<url>https://github.com/duniter/duniter4j/issues</url>
</issueManagement>
<dependencyManagement>
......@@ -364,22 +358,6 @@
<version>${nuitonI18nVersion}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>${maven-eclipse-plugin.version}</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>${yuicompressor-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.tunyk.mvn.plugins.htmlcompressor</groupId>
<artifactId>htmlcompressor-maven-plugin</artifactId>
<version>${htmlcompressor-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
......
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