mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-10 01:44:14 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5ffc5fb813
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
if [ -a "./PID" ]; then
|
if [ -a "./PID" ]; then
|
||||||
if [ -d '/proc' ]; then
|
if [ -d '/proc' ]; then
|
||||||
ls /proc/$(cat PID)/cmdline
|
ls /proc/$(cat PID)/cmdline 1>/dev/null 2>/dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
kill -9 $(cat PID)
|
kill -9 $(cat PID)
|
||||||
echo "shutdown old contract manager"
|
echo "shutdown old contract manager"
|
||||||
|
@ -588,7 +588,7 @@ public class MasterClientRecoverMechAction {
|
|||||||
try {
|
try {
|
||||||
FileReader fr = new FileReader(file);
|
FileReader fr = new FileReader(file);
|
||||||
BufferedReader br = new BufferedReader(fr);
|
BufferedReader br = new BufferedReader(fr);
|
||||||
String line = "";
|
String line;
|
||||||
String[] arrs = null;
|
String[] arrs = null;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
content[count++] = line;
|
content[count++] = line;
|
||||||
|
@ -79,9 +79,9 @@ public class ContractRepoConfigurer implements DoipServiceInfoConfigurer {
|
|||||||
doipServiceConfig = localConfig;
|
doipServiceConfig = localConfig;
|
||||||
//异步注册
|
//异步注册
|
||||||
ContractManager.threadPool.execute(() -> {
|
ContractManager.threadPool.execute(() -> {
|
||||||
GlobalIrpClient.useInternalIrpClient(GlobalCertifications.localKeypair
|
GlobalIrpClient.useInternalIrpClient(GlobalCertifications.localKeypair,
|
||||||
, GlobalConfigurations.User_Handle
|
GlobalConfigurations.User_Handle,
|
||||||
, GlobalConfigurations.LHS_Address);
|
GlobalConfigurations.LHS_Address);
|
||||||
if (doipServiceInfo.id.equals("")) {
|
if (doipServiceInfo.id.equals("")) {
|
||||||
try {
|
try {
|
||||||
doipServiceInfo.id = GlobalIrpClient.getGlobalClient().register(doipServiceInfo.toServiceHandleRecord());
|
doipServiceInfo.id = GlobalIrpClient.getGlobalClient().register(doipServiceInfo.toServiceHandleRecord());
|
||||||
|
@ -187,7 +187,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
|||||||
block.requests.length,
|
block.requests.length,
|
||||||
block.hash));
|
block.hash));
|
||||||
// TODO create check point
|
// TODO create check point
|
||||||
this.b = new Block(block.hash);
|
this.b = new Block(block.hash, this.b.height + 1);
|
||||||
executedBlocks.add(block.hash);
|
executedBlocks.add(block.hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,6 +228,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
|||||||
static class Block extends SM2Verifiable {
|
static class Block extends SM2Verifiable {
|
||||||
String prevHash = "0";
|
String prevHash = "0";
|
||||||
String hash;
|
String hash;
|
||||||
|
int height;
|
||||||
String checkPoint;
|
String checkPoint;
|
||||||
String body;
|
String body;
|
||||||
String nodePubKey;
|
String nodePubKey;
|
||||||
@ -235,10 +236,12 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
|||||||
long timestamp;
|
long timestamp;
|
||||||
|
|
||||||
public Block() {
|
public Block() {
|
||||||
|
this.height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Block(String prev) {
|
public Block(String prev, int height) {
|
||||||
this.prevHash = prev;
|
this.prevHash = prev;
|
||||||
|
this.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fillBlock(ContractRequest[] requests) {
|
public void fillBlock(ContractRequest[] requests) {
|
||||||
@ -255,6 +258,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
|||||||
|
|
||||||
private String computeHash() {
|
private String computeHash() {
|
||||||
return HashUtil.sha3(
|
return HashUtil.sha3(
|
||||||
|
String.valueOf(this.height),
|
||||||
this.prevHash,
|
this.prevHash,
|
||||||
this.checkPoint,
|
this.checkPoint,
|
||||||
this.body);
|
this.body);
|
||||||
|
Loading…
Reference in New Issue
Block a user