Skip to content

Commit a8ed60f

Browse files
committed
initial commit
1 parent 2c8178e commit a8ed60f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5560
-0
lines changed

LICENSE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2018 Center for Secure Energy Informatics - Salzburg University of Applied Sciences
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
4. When any part of the source code is used, the paper specified in paper.bib or paper.txt has to be cited.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

build.xml

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<project name="ResselChain" default="deploy" basedir=".">
2+
<description>
3+
Build all required jars for running ResselChain
4+
</description>
5+
6+
<!-- set global properties for this build -->
7+
<property name="src" location="src"/>
8+
<property name="bin" location="build/bin"/>
9+
<property name="build" location="build"/>
10+
<!-- add any other library folder here -->
11+
<property name="lib.dir1" location="lib"/>
12+
<!--<property name="lib.dir2" location="lib/neo4j"/>-->
13+
14+
<!-- build classpath for jar files, add library folder here -->
15+
<target name="unjar_dependencies" depends="clean">
16+
<unzip dest="${build}/lib">
17+
<fileset dir="${lib.dir1}">
18+
<include name="**/*.jar" />
19+
</fileset>
20+
</unzip>
21+
</target>
22+
23+
<target name="init">
24+
<echo> Java version: ${ant.java.version}</echo>
25+
<!-- create the time stamp -->
26+
<tstamp/>
27+
<!-- create the build directory structure used by compile -->
28+
<mkdir dir="${build}"/>
29+
<mkdir dir="${build}/bin"/>
30+
<mkdir dir="${build}/lib"/>
31+
</target>
32+
33+
<!-- compile the java code from ${src} into ${build} -->
34+
<target name="compile" depends="init" description="compile the source">
35+
<javac srcdir="${src}" destdir="${bin}" debug="true">
36+
<compilerarg line="-XDignore.symbol.file=true" />
37+
<classpath>
38+
<fileset dir="${lib.dir1}">
39+
<include name="*.jar" />
40+
</fileset>
41+
<!--<fileset dir="${lib.dir2}">
42+
<include name="*.jar" />
43+
</fileset>-->
44+
</classpath>
45+
</javac>
46+
</target>
47+
48+
<!-- build jars, include all libraries and set classpath accordingly -->
49+
<target name="jars" depends="compile">
50+
<!-- unjar_dependencies -->
51+
<jar destfile="${build}/jars/RC.jar" basedir="${bin}">
52+
<manifest>
53+
<attribute name="Main-Class" value="at.entrust.resselchain.main.Start"/>
54+
</manifest>
55+
<fileset dir="${build}/lib">
56+
<exclude name="META-INF/*.*"/>
57+
<include name="**/*.*" />
58+
</fileset>
59+
</jar>
60+
61+
62+
<jar destfile="${build}/jars/TxSender.jar" basedir="${bin}">
63+
<manifest>
64+
<attribute name="Main-Class" value="at.entrust.resselchain.main.TxSender"/>
65+
</manifest>
66+
<fileset dir="${build}/lib">
67+
<exclude name="META-INF/*.*"/>
68+
<include name="**/*.*" />
69+
</fileset>
70+
</jar>
71+
72+
<jar destfile="${build}/jars/UtilityTxSender.jar" basedir="${bin}">
73+
<manifest>
74+
<attribute name="Main-Class" value="at.entrust.resselchain.main.UtilityTxSender"/>
75+
</manifest>
76+
<fileset dir="${build}/lib">
77+
<exclude name="META-INF/*.*"/>
78+
<include name="**/*.*" />
79+
</fileset>
80+
</jar>
81+
82+
<jar destfile="${build}/jars/Status.jar" basedir="${bin}">
83+
<manifest>
84+
<attribute name="Main-Class" value="at.entrust.resselchain.main.Status"/>
85+
<attribute name="Class-Path" value="${lib.list.Status}"/>
86+
</manifest>
87+
<fileset dir="${build}/lib">
88+
<exclude name="META-INF/*.*"/>
89+
<include name="**/*.*" />
90+
</fileset>
91+
</jar>
92+
93+
<jar destfile="${build}/jars/Portion.jar" basedir="${bin}">
94+
<manifest>
95+
<attribute name="Main-Class" value="at.entrust.resselchain.main.Portion"/>
96+
<attribute name="Class-Path" value="${lib.list.Portion}"/>
97+
</manifest>
98+
<fileset dir="${build}/lib">
99+
<exclude name="META-INF/*.*"/>
100+
<include name="**/*.*" />
101+
</fileset>
102+
</jar>
103+
104+
<jar destfile="${build}/jars/BlockList.jar" basedir="${bin}">
105+
<manifest>
106+
<attribute name="Main-Class" value="at.entrust.resselchain.main.BlockList"/>
107+
<attribute name="Class-Path" value="${lib.list.BlockList}"/>
108+
</manifest>
109+
<fileset dir="${build}/lib">
110+
<exclude name="META-INF/*.*"/>
111+
<include name="**/*.*" />
112+
</fileset>
113+
</jar>
114+
115+
<jar destfile="${build}/jars/XMLSender.jar" basedir="${bin}">
116+
<manifest>
117+
<attribute name="Main-Class" value="at.entrust.resselchain.main.XMLSender"/>
118+
<!--attribute name="Class-Path" value="${lib.list.XMLSender}"/-->
119+
</manifest>
120+
<fileset dir="${build}/lib">
121+
<exclude name="META-INF/*.*"/>
122+
<include name="**/*.*" />
123+
</fileset>
124+
</jar>
125+
</target>
126+
127+
<!-- delete the ${build} and ${dist} directory trees -->
128+
<target name="clean" description="clean up">
129+
</target>
130+
</project>

build/conf/all.xml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0"?>
2+
<Participants>
3+
<Participant>
4+
<Name>Example</Name>
5+
<Address>127.0.0.1</Address>
6+
<Port>57972</Port>
7+
<PublicKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDxru2SOzfWTSLCpA1wKwoHbpGAombgC5QKCYLOLoa9qhVxyU2Gkfi0JsEn0ZylDxiU5DYcz+VcIkBH1fY1aFMdDhr+jRYQXTxxynv3fp6X6I7kRr2qsAb2bmgt+3SrviPvM3oe042n/of/WqFgIDWrIPS+SggSPjCs6Rwg7cggdwIDAQAB</PublicKey>
8+
</Participant>
9+
</Participants>

build/conf/nodeExample.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<Participant>
3+
<Name>Example</Name>
4+
<Address>127.0.0.1</Address>
5+
<Port>57972</Port>
6+
<SecretKey>MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAPGu7ZI7N9ZNIsKkDXArCgdukYCiZuALlAoJgs4uhr2qFXHJTYaR+LQmwSfRnKUPGJTkNhzP5VwiQEfV9jVoUx0OGv6NFhBdPHHKe/d+npfojuRGvaqwBvZuaC37dKu+I+8zeh7Tjaf+h/9aoWAgNasg9L5KCBI+MKzpHCDtyCB3AgMBAAECgYBCi5TUZ8PHGPQSPdOJaABZ7YLYtV64H9gCL345wSvOe09uRiw3emfNSsJycU+9TvvIu1F++2s+xBuI7AvfxrrjQy2uHsoQyX18ftZ1FHJzsEWJGIw6HvXKdvKJOoSVrKaAhpMoTizTRmWsy2+DpES6pSOMD7xUBrmqepZPMAwEYQJBAPjW5UUk2mujTgLRVqFLpKtfPTa7KgkpinXPrgF4VGCurTBtYCZ88+IyxXimw9VI+Abd7yrx4ty3l6cTnwy3F0cCQQD4o1Dmj8vY6MxxEjxEgszW4dyEXW4fCsyWKwEIXAraQaTZlh3r01qIR9hjyItbVVtGCXTcfQ5+vp+lahnp36VRAkEA3R44RSTmYleO7roOfO22ugG7Z3MRe2rKer29JdlDQVZ2112Z3xmRriLnjrrBsjlRDOkRqdufd/o8bF7nKmlX6QJAKpzS4LEEXsiHQVm+un8wXCOZh5X7qZZQOexk4OnlckKN3jy8JA61FWY6z98vAxg97GLyhFdqhI5nDhKBHnQWAQJBALqtBWKD205imGMUvFsCWs5EujJyryU40CE96oVjNe0PhMON3NndjgQ/fvmH4OySh61jKeeNGdXw8Mb4N2ZTadI=</SecretKey>
7+
<PublicKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDxru2SOzfWTSLCpA1wKwoHbpGAombgC5QKCYLOLoa9qhVxyU2Gkfi0JsEn0ZylDxiU5DYcz+VcIkBH1fY1aFMdDhr+jRYQXTxxynv3fp6X6I7kRr2qsAb2bmgt+3SrviPvM3oe042n/of/WqFgIDWrIPS+SggSPjCs6Rwg7cggdwIDAQAB</PublicKey>
8+
</Participant>

lib/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Place lib files here!

paper.bib

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please contact andreas.unterweger@en-trust.at for details.

paper.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please contact [email protected] for details.

readme.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ResselChain
2+
===
3+
4+
This is an implementation of a private permissioned blockchain in Java.
5+
6+
Dependencies
7+
---
8+
ResselChain depends on the following software:
9+
- Java8
10+
- Sqlite Jdbc 3.19.3
11+
- Xom 1.2.10
12+
13+
How to run
14+
---
15+
16+
1. Download the necessary dependencies and store them in ./lib.
17+
2. Invoke the *init*, *unjar_dependencies*, *jars*, *compile* Ant Build targets in this order.
18+
3. To implement your own consensus algorithm and state storage, see file *./src/statetable/AssetStateTable.java*.
19+
4. Place the configuration for all nodes in ./conf (see nodeExample.xml and all.xml). You may use *GenerateKeyPair.java* in ./src/main to generate key pairs.
20+
5. Run *RC.jar* from the build directory. (`java -jar RC.jar conf/nodeExample.xml conf/all.xml`)
21+
22+
a) Use *UtilityTxSender.jar* to determine a default distribution of assets.
23+
24+
b) Use *TxSender.jar* to send assets to other participants.
25+
26+
c) Use *Status.jar* to observe the status of a node.
27+
28+
d) Use *Amount.jar* to see the distribution of assets.
29+
30+
e) Optionally use *BlockList.jar* and *XMLSender.jar* for debugging.
31+
32+
33+
Licence
34+
---
35+
This code is licensed under a modified 3-Clause BSD License. See LICENSE file for details.
36+
37+

0 commit comments

Comments
 (0)