| @@ -0,0 +1,20 @@ | |||
| package com.jd.blockchain; | |||
| import static org.junit.Assert.assertTrue; | |||
| import org.junit.Test; | |||
| /** | |||
| * Unit test for simple App. | |||
| */ | |||
| public class AppTest | |||
| { | |||
| /** | |||
| * Rigorous Test :-) | |||
| */ | |||
| @Test | |||
| public void shouldAnswerWithTrue() | |||
| { | |||
| assertTrue( true ); | |||
| } | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| package com.jd.blockchain; | |||
| import static org.junit.Assert.assertTrue; | |||
| import org.junit.Test; | |||
| /** | |||
| * Unit test for simple App. | |||
| */ | |||
| public class AppTest | |||
| { | |||
| /** | |||
| * Rigorous Test :-) | |||
| */ | |||
| @Test | |||
| public void shouldAnswerWithTrue() | |||
| { | |||
| assertTrue( true ); | |||
| } | |||
| } | |||
| @@ -17,20 +17,19 @@ | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>manager</artifactId> | |||
| <artifactId>runtime-modular</artifactId> | |||
| <version>${project.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>runtime-modular</artifactId> | |||
| <artifactId>runtime-modular-booter</artifactId> | |||
| <version>${project.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>runtime-modular-booter</artifactId> | |||
| <artifactId>ump-booter</artifactId> | |||
| <version>${project.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>storage-composite</artifactId> | |||
| @@ -36,7 +36,6 @@ | |||
| <include>com.jd.blockchain:runtime-modular</include> | |||
| <include>com.jd.blockchain:runtime-modular-booter</include> | |||
| <include>com.jd.blockchain:peer</include> | |||
| <include>com.jd.blockchain:manager</include> | |||
| <include>com.jd.blockchain:deployment-peer</include> | |||
| </includes> | |||
| </dependencySet> | |||
| @@ -53,10 +52,19 @@ | |||
| <exclude>com.jd.blockchain:runtime-modular</exclude> | |||
| <exclude>com.jd.blockchain:runtime-modular-booter</exclude> | |||
| <exclude>com.jd.blockchain:peer</exclude> | |||
| <exclude>com.jd.blockchain:manager</exclude> | |||
| <exclude>com.jd.blockchain:deployment-peer</exclude> | |||
| </excludes> | |||
| </dependencySet> | |||
| <dependencySet> | |||
| <unpack>false</unpack> | |||
| <useProjectArtifact>true</useProjectArtifact> | |||
| <outputDirectory>ext</outputDirectory> | |||
| <includes> | |||
| <include>com.jd.blockchain:ump-booter</include> | |||
| </includes> | |||
| </dependencySet> | |||
| </dependencySets> | |||
| <moduleSets> | |||
| @@ -0,0 +1,9 @@ | |||
| #!/bin/bash | |||
| HOME=$(cd `dirname $0`;cd ../; pwd) | |||
| UMP=$(ls $HOME/ext | grep ump-booter-) | |||
| if [ ! -n "UMP" ]; then | |||
| echo "Unified Management Platform Is Null !!!" | |||
| else | |||
| nohup java -jar -server -Djump.log=$HOME $HOME/ext/$UMP $* >$HOME/bin/jump.out 2>&1 & | |||
| fi | |||
| @@ -0,0 +1,16 @@ | |||
| #!/bin/bash | |||
| #启动Home路径 | |||
| BOOT_HOME=$(cd `dirname $0`;cd ../; pwd) | |||
| #获取进程PID | |||
| PID=`ps -ef | grep $BOOT_HOME/ext/ump-booter | grep -v grep | awk '{print $2}'` | |||
| #通过Kill命令将进程杀死 | |||
| if [ -z "$PID" ]; then | |||
| echo "Unable to find UMP PID. stop aborted." | |||
| else | |||
| echo "Start to kill PID = $PID ..." | |||
| kill -9 $PID | |||
| echo "Unified Management Platform has been stopped ..." | |||
| fi | |||
| @@ -2,52 +2,17 @@ | |||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
| <modelVersion>4.0.0</modelVersion> | |||
| <modules> | |||
| <module>ump-booter</module> | |||
| <module>ump-web</module> | |||
| <module>ump-service</module> | |||
| <module>ump-model</module> | |||
| </modules> | |||
| <parent> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>jdchain-root</artifactId> | |||
| <version>1.1.0-SNAPSHOT</version> | |||
| </parent> | |||
| <artifactId>manager</artifactId> | |||
| <dependencies> | |||
| <dependency> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-starter-web</artifactId> | |||
| <exclusions> | |||
| <exclusion> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-starter-logging</artifactId> | |||
| </exclusion> | |||
| </exclusions> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-starter-log4j2</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-starter-security</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-configuration-processor</artifactId> | |||
| <optional>true</optional> | |||
| </dependency> | |||
| </dependencies> | |||
| <build> | |||
| <plugins> | |||
| <plugin> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <artifactId>maven-deploy-plugin</artifactId> | |||
| <configuration> | |||
| <skip>true</skip> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| </build> | |||
| <packaging>pom</packaging> | |||
| </project> | |||
| @@ -32,6 +32,24 @@ | |||
| </exclusions> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>ump-web</artifactId> | |||
| <version>${project.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>ump-service</artifactId> | |||
| <version>${project.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>ump-model</artifactId> | |||
| <version>${project.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-starter-log4j2</artifactId> | |||
| @@ -57,4 +75,53 @@ | |||
| <scope>test</scope> | |||
| </dependency> | |||
| </dependencies> | |||
| <build> | |||
| <plugins> | |||
| <plugin> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-maven-plugin</artifactId> | |||
| </plugin> | |||
| <plugin> | |||
| <groupId>org.apache.maven.plugins</groupId> | |||
| <artifactId>maven-assembly-plugin</artifactId> | |||
| <executions> | |||
| <execution> | |||
| <id>make-assembly</id> | |||
| <phase>package</phase> | |||
| <goals> | |||
| <goal>single</goal> | |||
| </goals> | |||
| <configuration> | |||
| <finalName>jump</finalName> | |||
| <descriptors> | |||
| <descriptor>src/main/resources/assembly.xml</descriptor> | |||
| </descriptors> | |||
| </configuration> | |||
| </execution> | |||
| </executions> | |||
| </plugin> | |||
| </plugins> | |||
| <resources> | |||
| <resource> | |||
| <directory>${project.basedir}/libs</directory> | |||
| <targetPath>BOOT-INF/lib/</targetPath> | |||
| <includes> | |||
| <include>*.jar</include> | |||
| </includes> | |||
| </resource> | |||
| <resource> | |||
| <directory>${project.basedir}/src/main/resources</directory> | |||
| <targetPath>BOOT-INF/classes/</targetPath> | |||
| <includes> | |||
| <include>log4j2-jump.xml</include> | |||
| <include>*.txt</include> | |||
| <include>*.properties</include> | |||
| </includes> | |||
| </resource> | |||
| </resources> | |||
| </build> | |||
| </project> | |||
| @@ -30,22 +30,12 @@ public class UmpBooter { | |||
| private static final String CONFIG_PROP_DB_URL_DEFAULT = "rocksdb://#project#/jumpdb"; | |||
| public static void main(String[] args) { | |||
| try { | |||
| startServer(server(args)); | |||
| System.out.println("Server Start SUCCESS !!!"); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| System.err.printf("Server Start FAIL -> %s, Exit JVM !!!", e.toString()); | |||
| // 正常退出 | |||
| System.exit(0); | |||
| } | |||
| startServer(server(args)); | |||
| System.out.println("Unified Management Platform Server Start SUCCESS !!!"); | |||
| } | |||
| private static void startServer(Server server) { | |||
| System.out.printf("server.address = %s, server.port = %s, db.url = %s \r\n", | |||
| server.host, server.port, server.dbUrl); | |||
| List<String> argList = new ArrayList<>(); | |||
| argList.add(String.format("--server.address=%s", server.host)); | |||
| argList.add(String.format("--server.port=%s", server.port)); | |||
| @@ -92,6 +92,11 @@ | |||
| <artifactId>reflections</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.google.guava</groupId> | |||
| <artifactId>guava</artifactId> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>org.apache.httpcomponents</groupId> | |||
| <artifactId>httpclient</artifactId> | |||
| @@ -0,0 +1,122 @@ | |||
| # Copyright (c) 2007-2013 Alysson Bessani, Eduardo Alchieri, Paulo Sousa, and the authors indicated in the @author tags | |||
| # | |||
| # Licensed under the Apache License, Version 2.0 (the "License"); | |||
| # you may not use this file except in compliance with the License. | |||
| # You may obtain a copy of the License at | |||
| # | |||
| # http://www.apache.org/licenses/LICENSE-2.0 | |||
| # | |||
| # Unless required by applicable law or agreed to in writing, software | |||
| # distributed under the License is distributed on an "AS IS" BASIS, | |||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| # See the License for the specific language governing permissions and | |||
| # limitations under the License. | |||
| ############################################ | |||
| ####### Communication Configurations ####### | |||
| ############################################ | |||
| #HMAC algorithm used to authenticate messages between processes (HmacMD5 is the default value) | |||
| #This parameter is not currently being used | |||
| #system.authentication.hmacAlgorithm = HmacSHA1 | |||
| #Specify if the communication system should use a thread to send data (true or false) | |||
| system.communication.useSenderThread = true | |||
| #Force all processes to use the same public/private keys pair and secret key. This is useful when deploying experiments | |||
| #and benchmarks, but must not be used in production systems. | |||
| system.communication.defaultkeys = true | |||
| ############################################ | |||
| ### Replication Algorithm Configurations ### | |||
| ############################################ | |||
| #Number of servers in the group | |||
| system.servers.num = 4 | |||
| #Maximum number of faulty replicas | |||
| system.servers.f = 1 | |||
| #Timeout to asking for a client request | |||
| system.totalordermulticast.timeout = 2000 | |||
| #Maximum batch size (in number of messages) | |||
| system.totalordermulticast.maxbatchsize = 400 | |||
| #Number of nonces (for non-determinism actions) generated | |||
| system.totalordermulticast.nonces = 10 | |||
| #if verification of leader-generated timestamps are increasing | |||
| #it can only be used on systems in which the network clocks | |||
| #are synchronized | |||
| system.totalordermulticast.verifyTimestamps = false | |||
| #Quantity of messages that can be stored in the receive queue of the communication system | |||
| system.communication.inQueueSize = 500000 | |||
| # Quantity of messages that can be stored in the send queue of each replica | |||
| system.communication.outQueueSize = 500000 | |||
| #Set to 1 if SMaRt should use signatures, set to 0 if otherwise | |||
| system.communication.useSignatures = 0 | |||
| #Set to 1 if SMaRt should use MAC's, set to 0 if otherwise | |||
| system.communication.useMACs = 1 | |||
| #Set to 1 if SMaRt should use the standard output to display debug messages, set to 0 if otherwise | |||
| system.debug = 0 | |||
| #Print information about the replica when it is shutdown | |||
| system.shutdownhook = true | |||
| ############################################ | |||
| ###### State Transfer Configurations ####### | |||
| ############################################ | |||
| #Activate the state transfer protocol ('true' to activate, 'false' to de-activate) | |||
| system.totalordermulticast.state_transfer = true | |||
| #Maximum ahead-of-time message not discarded | |||
| system.totalordermulticast.highMark = 10000 | |||
| #Maximum ahead-of-time message not discarded when the replica is still on EID 0 (after which the state transfer is triggered) | |||
| system.totalordermulticast.revival_highMark = 10 | |||
| #Number of ahead-of-time messages necessary to trigger the state transfer after a request timeout occurs | |||
| system.totalordermulticast.timeout_highMark = 200 | |||
| ############################################ | |||
| ###### Log and Checkpoint Configurations ### | |||
| ############################################ | |||
| system.totalordermulticast.log = true | |||
| system.totalordermulticast.log_parallel = false | |||
| system.totalordermulticast.log_to_disk = false | |||
| system.totalordermulticast.sync_log = false | |||
| #Period at which BFT-SMaRt requests the state to the application (for the state transfer state protocol) | |||
| system.totalordermulticast.checkpoint_period = 1000 | |||
| system.totalordermulticast.global_checkpoint_period = 120000 | |||
| system.totalordermulticast.checkpoint_to_disk = false | |||
| system.totalordermulticast.sync_ckp = false | |||
| ############################################ | |||
| ###### Reconfiguration Configurations ###### | |||
| ############################################ | |||
| #Replicas ID for the initial view, separated by a comma. | |||
| # The number of replicas in this parameter should be equal to that specified in 'system.servers.num' | |||
| system.initial.view = 0,1,2,3 | |||
| #The ID of the trust third party (TTP) | |||
| system.ttp.id = 7002 | |||
| #This sets if the system will function in Byzantine or crash-only mode. Set to "true" to support Byzantine faults | |||
| system.bft = true | |||
| #Custom View Storage; | |||
| #view.storage.handler=bftsmart.reconfiguration.views.DefaultViewStorage | |||
| @@ -43,6 +43,8 @@ | |||
| <my.utils.version>0.8.1-SNAPSHOT</my.utils.version> | |||
| <bft-smart.version>0.0.8.RELEASE</bft-smart.version> | |||
| <explorer.version>0.7.0.RELEASE</explorer.version> | |||
| <ump-explorer.version>1.0.0-SNAPSHOT</ump-explorer.version> | |||
| <commons-io.version>2.4</commons-io.version> | |||
| <!-- <spring.framework.version>4.3.4.RELEASE</spring.framework.version> --> | |||
| <!-- <spring.mongo.version>1.9.3.RELEASE</spring.mongo.version> <spring.dao.version>2.0.8</spring.dao.version> | |||
| <spring.security.version>4.2.0.RELEASE</spring.security.version> --> | |||
| @@ -116,6 +118,18 @@ | |||
| <version>${explorer.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.jd.blockchain</groupId> | |||
| <artifactId>ump-explorer</artifactId> | |||
| <version>${ump-explorer.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>commons-io</groupId> | |||
| <artifactId>commons-io</artifactId> | |||
| <version>${commons-io.version}</version> | |||
| </dependency> | |||
| <!-- The test dependency --> | |||
| <dependency> | |||
| <groupId>junit</groupId> | |||
| @@ -0,0 +1,20 @@ | |||
| package com.jd.blockchain; | |||
| import static org.junit.Assert.assertTrue; | |||
| import org.junit.Test; | |||
| /** | |||
| * Unit test for simple App. | |||
| */ | |||
| public class AppTest | |||
| { | |||
| /** | |||
| * Rigorous Test :-) | |||
| */ | |||
| @Test | |||
| public void shouldAnswerWithTrue() | |||
| { | |||
| assertTrue( true ); | |||
| } | |||
| } | |||