Skip to content

Commit 793d41e

Browse files
committed
增加默克尔树根节点hash等参数值
1 parent aa9818c commit 793d41e

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/main/java/com/uifuture/springbootblockchain/block/Block.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
@Data
2626
@ToString
2727
public class Block {
28+
private String version = "1.0.0";
2829
/**
2930
* 区块hash值
3031
*/

src/main/java/com/uifuture/springbootblockchain/controller/IndexController.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import org.springframework.stereotype.Controller;
88
import org.springframework.web.bind.annotation.RequestMapping;
99

10+
import java.io.IOException;
11+
1012
/**
1113
* @author chenhx
1214
* @version IndexController.java, v 0.1 2018-10-13 下午 4:21
@@ -15,15 +17,15 @@
1517
@RequestMapping("ui")
1618
public class IndexController {
1719

18-
// /**
19-
// * 该Servlet用于输出整个区块链的数据
20-
// * @param req
21-
// * @param resp
22-
// * @throws IOException
23-
// */
20+
/**
21+
* 该Servlet用于输出整个区块链的数据
22+
* @param req
23+
* @param resp
24+
* @throws IOException
25+
*/
2426
// @RequestMapping("chain")
2527
// public void chain(HttpServletRequest req, HttpServletResponse resp) throws IOException {
26-
// Blockchain blockChain = Blockchain.getInstance();
28+
// Blockchain blockChain = Blockchain.initBlockchainFromDB();
2729
// Map<String, Object> response = new HashMap<String, Object>();
2830
// response.put("chain", blockChain.getChain());
2931
// response.put("length", blockChain.getChain().size());
@@ -107,4 +109,5 @@ public class IndexController {
107109
// printWriter.println(new JSONObject(response));
108110
// printWriter.close();
109111
// }
112+
110113
}

src/test/java/com/uifuture/blockchainspringboot/BlockchainTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
public class BlockchainTest {
1616

1717
public static void main(String[] args) {
18-
// 1AycK28gqDpWJ4e6oo2oqG9Smr43K3QcTW 200 100
19-
// 15J63sETC6WuoVKZbtKxbWXsiA9W6THRAv
18+
// 1AycK28gqDpWJ4e6oo2oqG9Smr43K3QcTW 219999765 179999060
19+
// 15J63sETC6WuoVKZbtKxbWXsiA9W6THRAv 180000235 540000705
2020
try {
21-
// String[] argss = {"createwallet"};
21+
String[] argss = {"createwallet"};
2222
// String[] argss = {"createblockchain", "-address", "1AycK28gqDpWJ4e6oo2oqG9Smr43K3QcTW"};
2323
//获取地址
2424
// String[] argss = {"printaddresses"};
2525
//获取钱包余额
26-
// String[] argss = {"getbalance", "-address", "1AycK28gqDpWJ4e6oo2oqG9Smr43K3QcTW"};
26+
// String[] argss = {"getbalance", "-address", "15J63sETC6WuoVKZbtKxbWXsiA9W6THRAv"};
2727
// String[] argss = {"send", "-from", "1AycK28gqDpWJ4e6oo2oqG9Smr43K3QcTW"
2828
// , "-to", "15J63sETC6WuoVKZbtKxbWXsiA9W6THRAv", "-amount", "180000235"};
2929
//打印链
30-
String[] argss = {"printchain"};
30+
// String[] argss = {"printchain"};
3131
// String[] argss = {"mining", "-address", "1AycK28gqDpWJ4e6oo2oqG9Smr43K3QcTW"};
3232
CLI cli = new CLI(argss);
3333
cli.parse();

0 commit comments

Comments
 (0)