Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Sdkyl committed Nov 7, 2024
2 parents 530603a + 5a2646b commit da76f88
Show file tree
Hide file tree
Showing 65 changed files with 389 additions and 881 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ Four stages:

- [x] Introduce the Stratum protocol for miners

- [ ] Lightweight wallet application: connect to MetaMask, join the browser wallet
- [x] Lightweight wallet application: join the browser wallet

- [x] Standardize the format of public and private keys, follow the BIPXX specification, and add mnemonic words to generate public and private key pairs


#### Expansion phase: XDAGJ & EVM
#### Expansion phase: XDAGJ & XRC

- [x] Improve the address block structure

- [ ] Increase the handling fee
- [x] Increase the handling fee

- [x] Optimize wallets to improve the user experience

- [ ] Support smart contracts, implement EVM that supports Solidity, and be compatible with Ethereum smart contracts
- [ ] Support XRC standards

- [x] Decrease the threshold of mining pool users

Expand Down
6 changes: 3 additions & 3 deletions docs/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ XDAGJ教程可以让您快速加入并体验XDAGJ的钱包及挖矿功能,私
- [x] 挖矿协议改进:引入较成熟的Stratum协议,方便矿机的接入与使用
- [ ] 轻量级钱包应用:接入MateMask,加入浏览器钱包
- [x] 轻量级钱包应用:加入浏览器钱包
- [x] 规范公私钥格式,遵循BIPXX规范,加入助记词方式生成公私钥对
#### 拓展阶段:XDAGJ & EVM 拓展
- [ ] 修改地址块结构,增加手续费
- [x] 修改地址块结构,增加手续费
- [x] 优化改善移动端钱包,提高用户体验
- [ ] 开放智能合约,实现支持Solidity的EVM,兼容以太坊智能合约
- [ ] 支持XRC协议
- [ ] 降低矿池门槛,逐步开放白名单从而实现完全去中心化
Expand Down
102 changes: 56 additions & 46 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,52 @@

<groupId>io.xdag</groupId>
<artifactId>xdagj</artifactId>
<version>0.7.0</version>
<version>0.7.2</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<kotlin.version>1.7.22</kotlin.version>
<kotlin.version>1.8.21</kotlin.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<dist.phase>package</dist.phase>
<dist.base>${project.basedir}/dist</dist.base>

<netty.version>4.1.107.Final</netty.version>
<tuweni.version>2.3.1</tuweni.version>
<json.version>2.14.2</json.version>
<kryo.version>5.4.0</kryo.version>
<lombok.version>1.18.26</lombok.version>
<caffeine.version>3.1.5</caffeine.version>
<jline.version>3.25.0</jline.version>
<netty.version>4.1.111.Final</netty.version>
<tuweni.version>2.4.2</tuweni.version>
<jackson.version>2.17.1</jackson.version>
<kryo.version>5.5.0</kryo.version>
<lombok.version>1.18.32</lombok.version>
<caffeine.version>3.1.8</caffeine.version>
<jline.version>3.26.2</jline.version>
<junit.version>4.13.2</junit.version>
<mockito.version>5.2.0</mockito.version>
<mockito.version>5.11.0</mockito.version>
<system-lambda.version>1.2.1</system-lambda.version>
<log4j.version>2.20.0</log4j.version>
<commons-lang3.version>3.13.0</commons-lang3.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-codec.version>1.16.0</commons-codec.version>
<commons-io.version>2.13.0</commons-io.version>
<commons-cli.version>1.5.0</commons-cli.version>
<guava.version>32.1.2-jre</guava.version>
<rocksdbjni.version>8.0.0</rocksdbjni.version>
<log4j.version>2.23.1</log4j.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-rng.version>1.5</commons-rng.version>
<commons-collections4.version>4.5.0-M1</commons-collections4.version>
<commons-codec.version>1.17.0</commons-codec.version>
<commons-io.version>2.16.1</commons-io.version>
<commons-cli.version>1.8.0</commons-cli.version>
<guava.version>33.2.1-jre</guava.version>
<rocksdbjni.version>9.2.1</rocksdbjni.version>
<okhttp.version>4.12.0</okhttp.version>
<assertj-core.version>3.24.2</assertj-core.version>
<assertj-core.version>3.26.0</assertj-core.version>
<crypto.version>23.1.3</crypto.version>
<bcprov-jdk18on.version>1.76</bcprov-jdk18on.version>
<bcpkix-jdk18on.version>1.76</bcpkix-jdk18on.version>
<vertx-core.version>4.4.0</vertx-core.version>
<bcprov-jdk18on.version>1.78</bcprov-jdk18on.version>
<bcpkix-jdk18on.version>1.78</bcpkix-jdk18on.version>
<vertx-core.version>4.5.7</vertx-core.version>
<jsonrpc4j.version>1.6</jsonrpc4j.version>
<jaxws-ri.version>4.0.1</jaxws-ri.version>
<config.version>1.4.2</config.version>
<agrona.version>1.17.1</agrona.version>
<jaxws-ri.version>4.0.2</jaxws-ri.version>
<config.version>1.4.3</config.version>
<agrona.version>1.21.2</agrona.version>
<snappy-java.version>1.1.10.4</snappy-java.version>
<druid.version>1.2.18</druid.version>
<mysql-connector.version>8.0.33</mysql-connector.version>
<h2.version>2.2.220</h2.version>
<druid.version>1.2.23</druid.version>
<mysql-connector.version>8.4.0</mysql-connector.version>
<h2.version>2.2.224</h2.version>
<gson.version>2.10</gson.version>
<jws-api.version>2.1.0</jws-api.version>
<surefire.test.excludes>**/*RandomXSyncTest.java,**/*SyncTest.java,**/*SnapshotJTest.java</surefire.test.excludes>
</properties>

Expand Down Expand Up @@ -90,6 +93,11 @@
<id>hyperledger.jfrog.io</id>
<url>https://hyperledger.jfrog.io/artifactory/besu-maven/</url>
</repository>
<repository>
<id>maven_central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>

<pluginRepositories>
Expand Down Expand Up @@ -388,7 +396,6 @@
</build>

<dependencies>
<!-- https://mvnrepository.com/artifact/io.xdag/xdagj-native-randomx -->
<dependency>
<groupId>io.xdag</groupId>
<artifactId>xdagj-native-randomx</artifactId>
Expand Down Expand Up @@ -432,6 +439,12 @@
<version>${commons-collections4.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-rng-simple</artifactId>
<version>${commons-rng.version}</version>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
Expand Down Expand Up @@ -619,7 +632,7 @@
</dependency>

<dependency>
<groupId>org.apache.tuweni</groupId>
<groupId>io.tmio</groupId>
<artifactId>tuweni-bytes</artifactId>
<version>${tuweni.version}</version>
<exclusions>
Expand All @@ -635,7 +648,7 @@
</dependency>

<dependency>
<groupId>org.apache.tuweni</groupId>
<groupId>io.tmio</groupId>
<artifactId>tuweni-units</artifactId>
<version>${tuweni.version}</version>
<exclusions>
Expand All @@ -647,7 +660,7 @@
</dependency>

<dependency>
<groupId>org.apache.tuweni</groupId>
<groupId>io.tmio</groupId>
<artifactId>tuweni-io</artifactId>
<version>${tuweni.version}</version>
<exclusions>
Expand Down Expand Up @@ -793,22 +806,21 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${json.version}</version>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${json.version}</version>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${json.version}</version>
<version>${jackson.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.github.briandilley.jsonrpc4j/jsonrpc4j -->
<dependency>
<groupId>com.github.briandilley.jsonrpc4j</groupId>
<artifactId>jsonrpc4j</artifactId>
Expand Down Expand Up @@ -862,22 +874,25 @@
</exclusions>
</dependency>

<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>${jws-api.version}</version>
</dependency>

<!--config-->
<!-- https://mvnrepository.com/artifact/com.typesafe/config -->
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>${config.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.agrona/agrona -->
<dependency>
<groupId>org.agrona</groupId>
<artifactId>agrona</artifactId>
<version>${agrona.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.xerial.snappy/snappy-java -->
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
Expand All @@ -901,16 +916,11 @@
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
<version>${gson.version}</version>
<scope>compile</scope>
</dependency>

Expand Down
50 changes: 9 additions & 41 deletions src/main/java/io/xdag/Kernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
import io.xdag.rpc.cors.CorsConfiguration;
import io.xdag.rpc.modules.xdag.*;
import io.xdag.rpc.netty.*;
import io.xdag.rpc.serialize.JacksonBasedRpcSerializer;
import io.xdag.rpc.serialize.JsonRpcSerializer;
import io.xdag.utils.XdagTime;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -112,10 +110,8 @@ public class Kernel {
// rpc
private JsonRpcWeb3ServerHandler jsonRpcWeb3ServerHandler;
private Web3 web3;
private Web3WebSocketServer web3WebSocketServer;
private Web3HttpServer web3HttpServer;
private JsonRpcWeb3FilterHandler jsonRpcWeb3FilterHandler;
private JacksonBasedRpcSerializer jacksonBasedRpcSerializer;

public Kernel(Config config, Wallet wallet) {
this.config = config;
Expand Down Expand Up @@ -300,7 +296,6 @@ public synchronized void testStart() throws Exception {
// ====================================
if (config.getRPCSpec().isRPCEnabled()) {
getWeb3HttpServer().start();
getWeb3WebSocketServer().start();
}

// ====================================
Expand Down Expand Up @@ -335,36 +330,13 @@ private JsonRpcWeb3ServerHandler getJsonRpcWeb3ServerHandler() {
config.getRPCSpec().getRpcModules()
);
} catch (Exception e) {
log.error("catch an error " + e.getMessage());
log.error("catch an error {}", e.getMessage());
}
}

return jsonRpcWeb3ServerHandler;
}

public WebSocketServer getWsServer() {
if (webSocketServer == null) {
webSocketServer = new WebSocketServer(this, config.getPoolWhiteIPList(),
config.getWebsocketServerPort());
}
return webSocketServer;
}

private Web3WebSocketServer getWeb3WebSocketServer() throws UnknownHostException {
if (web3WebSocketServer == null) {
JsonRpcSerializer jsonRpcSerializer = getJsonRpcSerializer();
XdagJsonRpcHandler jsonRpcHandler = new XdagJsonRpcHandler(jsonRpcSerializer);
web3WebSocketServer = new Web3WebSocketServer(
InetAddress.getByName(config.getRPCSpec().getRPCHost()),
config.getRPCSpec().getRPCPortByWebSocket(),
jsonRpcHandler,
getJsonRpcWeb3ServerHandler()
);
}

return web3WebSocketServer;
}

private Web3HttpServer getWeb3HttpServer() throws UnknownHostException {
if (web3HttpServer == null) {
web3HttpServer = new Web3HttpServer(
Expand All @@ -381,6 +353,14 @@ private Web3HttpServer getWeb3HttpServer() throws UnknownHostException {
return web3HttpServer;
}

public WebSocketServer getWsServer() {
if (webSocketServer == null) {
webSocketServer = new WebSocketServer(this, config.getPoolWhiteIPList(),
config.getWebsocketServerPort());
}
return webSocketServer;
}

private JsonRpcWeb3FilterHandler getJsonRpcWeb3FilterHandler() throws UnknownHostException {
if (jsonRpcWeb3FilterHandler == null) {
jsonRpcWeb3FilterHandler = new JsonRpcWeb3FilterHandler(
Expand All @@ -393,14 +373,6 @@ private JsonRpcWeb3FilterHandler getJsonRpcWeb3FilterHandler() throws UnknownHos
return jsonRpcWeb3FilterHandler;
}

private JsonRpcSerializer getJsonRpcSerializer() {
if (jacksonBasedRpcSerializer == null) {
jacksonBasedRpcSerializer = new JacksonBasedRpcSerializer();
}

return jacksonBasedRpcSerializer;
}

/**
* Stops the kernel.
*/
Expand All @@ -416,9 +388,6 @@ public synchronized void testStop() {
if (web3HttpServer != null) {
web3HttpServer.stop();
}
if (web3WebSocketServer != null) {
web3WebSocketServer.stop();
}

// 1. 工作层关闭
// stop consensus
Expand Down Expand Up @@ -465,7 +434,6 @@ public synchronized void testStop() {
log.info("Pool award manager stop.");
}


public enum Status {
STOPPED, SYNCING, BLOCK_PRODUCTION_ON, SYNCDONE
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/xdag/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ protected void addOption(Option option) {

/**
* Parses options from the given arguments.
*
* Priority: arguments => system property => console input
*/
protected CommandLine parseOptions(String[] args) throws ParseException {
Expand Down
Loading

0 comments on commit da76f88

Please sign in to comment.