ethereum 项目 #43

Merged
honeymoose merged 3 commits from ethereum into main 2025-04-25 17:58:12 +00:00
33 changed files with 184 additions and 71 deletions

1
.idea/compiler.xml generated
View File

@ -13,6 +13,7 @@
<module name="core-java-uuid" />
<module name="core-java-numbers" />
<module name="jackson-polymorphic-deserialization" />
<module name="ethereum" />
<module name="core-java-strings" />
<module name="jackson" />
<module name="core-java-11" />

2
.idea/encodings.xml generated
View File

@ -61,6 +61,8 @@
<file url="file://$PROJECT_DIR$/core-java-modules/core-java/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/core-java-modules/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/core-java-modules/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ethereum/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/ethereum/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/image-compressing/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/image-compressing/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/image-processing/src/main/java" charset="UTF-8" />

View File

@ -66,6 +66,11 @@
<option name="name" value="OSSEZ Private Snapshots" />
<option name="url" value="https://repo.isharkfly.com/repository/maven-snapshots/" />
</remote-repository>
<remote-repository>
<option name="id" value="Ethereum" />
<option name="name" value="Ethereum" />
<option name="url" value="https://dl.bintray.com/ethereum/maven/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />

12
ethereum/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,12 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Environment-dependent path to Maven home directory
/mavenHomeManager.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Zeppelin ignored files
/ZeppelinRemoteNotebooks/

16
ethereum/.idea/checkstyle-idea.xml generated Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA" serialisationVersion="2">
<checkstyleVersion>10.23.0</checkstyleVersion>
<scanScope>JavaOnly</scanScope>
<copyLibs>true</copyLibs>
<option name="thirdPartyClasspath" />
<option name="activeLocationIds" />
<option name="locations">
<list>
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
</list>
</option>
</component>
</project>

13
ethereum/.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="ethereum" />
</profile>
</annotationProcessing>
</component>
</project>

7
ethereum/.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

35
ethereum/.idea/jarRepositories.xml generated Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="Ethereum" />
<option name="name" value="Ethereum" />
<option name="url" value="https://dl.bintray.com/ethereum/maven/" />
</remote-repository>
<remote-repository>
<option name="id" value="ossez-repo-releases" />
<option name="name" value="iSharkFly Private Releases" />
<option name="url" value="https://repo.isharkfly.com/repository/isharkfly-maven-releases/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.isharkfly.com/repository/maven/" />
</remote-repository>
<remote-repository>
<option name="id" value="ossez-repo-snapshots" />
<option name="name" value="iSharkFly Private Snapshots" />
<option name="url" value="https://repo.isharkfly.com/repository/isharkfly-maven-snapshots/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

15
ethereum/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="temurin-17" project-jdk-type="JavaSDK" />
<component name="ThriftCompiler">
<compilers />
</component>
</project>

6
ethereum/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -3,15 +3,14 @@
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>
<groupId>com.baeldung.ethereum</groupId>
<groupId>com.ossez.ethereum</groupId>
<artifactId>ethereum</artifactId>
<name>ethereum</name>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-spring-5</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-spring-5</relativePath>
<groupId>com.ossez</groupId>
<artifactId>parent-modules</artifactId>
<version>0.0.2-SNAPSHOT</version>
</parent>
<dependencies>
@ -76,14 +75,15 @@
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet-api.version}</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
@ -91,9 +91,10 @@
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>${javax.servlet.jsp-api.version}</version>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<!-- Spring Testing -->
<dependency>
@ -113,19 +114,19 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<version>7.0.0-M4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<version>7.0.0-M4</version>
<scope>test</scope>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<version>5.17.0</version>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
@ -170,15 +171,16 @@
</build>
<repositories>
<repository>
<id>Ethereum</id>
<name>Ethereum</name>
<url>https://dl.bintray.com/ethereum/maven/</url>
</repository>
<!-- <repository>-->
<!-- <id>Ethereum</id>-->
<!-- <name>Ethereum</name>-->
<!-- <url>https://dl.bintray.com/ethereum/maven/</url>-->
<!-- </repository>-->
</repositories>
<properties>
<ethereumj-core.version>1.5.0-RELEASE</ethereumj-core.version>
<spring.version>7.0.0-M4</spring.version>
<ethereumj-core.version>1.9.0-RELEASE</ethereumj-core.version>
<web3j.core.version>3.3.1</web3j.core.version>
<spring.boot.version>1.5.6.RELEASE</spring.boot.version>
<jsonpath.version>2.8.0</jsonpath.version>

View File

@ -1,4 +1,4 @@
package com.baeldung.ethereumj;
package com.isharkfly.ethereumj;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -8,7 +8,7 @@ import org.springframework.boot.web.support.SpringBootServletInitializer;
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@SpringBootApplication
public class ApplicationMain extends SpringBootServletInitializer {
public abstract class ApplicationMain extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(ApplicationMain.class, args);

View File

@ -1,4 +1,4 @@
package com.baeldung.ethereumj;
package com.isharkfly.ethereumj;
public class Constants {

View File

@ -1,6 +1,6 @@
package com.baeldung.ethereumj.beans;
package com.isharkfly.ethereumj.beans;
import com.baeldung.ethereumj.listeners.EthListener;
import com.isharkfly.ethereumj.listeners.EthListener;
import org.ethereum.core.Block;
import org.ethereum.facade.Ethereum;
import org.ethereum.facade.EthereumFactory;

View File

@ -1,6 +1,6 @@
package com.baeldung.ethereumj.config;
package com.isharkfly.ethereumj.config;
import com.baeldung.ethereumj.beans.EthBean;
import com.isharkfly.ethereumj.beans.EthBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@ -1,8 +1,8 @@
package com.baeldung.ethereumj.controllers;
package com.isharkfly.ethereumj.controllers;
import com.baeldung.ethereumj.Constants;
import com.baeldung.ethereumj.beans.EthBean;
import com.baeldung.ethereumj.transfer.EthResponse;
import com.isharkfly.ethereumj.Constants;
import com.isharkfly.ethereumj.beans.EthBean;
import com.isharkfly.ethereumj.transfer.EthResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,4 +1,4 @@
package com.baeldung.ethereumj.listeners;
package com.isharkfly.ethereumj.listeners;
import org.ethereum.core.Block;
import org.ethereum.core.TransactionReceipt;

View File

@ -1,4 +1,4 @@
package com.baeldung.ethereumj.transfer;
package com.isharkfly.ethereumj.transfer;
public class EthResponse {

View File

@ -1,6 +1,6 @@
package com.baeldung.web3j;
package com.isharkfly.web3j;
import com.baeldung.web3j.contracts.Greeting;
import com.isharkfly.web3j.contracts.Greeting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.web3j.crypto.Credentials;

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.config;
package com.isharkfly.web3j.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -18,7 +18,7 @@ import java.util.concurrent.Executor;
@Configuration
@EnableWebMvc
@EnableAsync
@ComponentScan("com.baeldung.web3j")
@ComponentScan("com.isharkfly.web3j")
public class AppConfig implements WebMvcConfigurer {
public void addViewControllers(ViewControllerRegistry registry) {

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.config;
package com.isharkfly.web3j.config;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.constants;
package com.isharkfly.web3j.constants;
public class Constants {

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.contracts;
package com.isharkfly.web3j.contracts;
import java.math.BigInteger;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.contracts;
package com.isharkfly.web3j.contracts;
import java.math.BigInteger;
import java.util.Arrays;

View File

@ -1,9 +1,9 @@
package com.baeldung.web3j.controllers;
package com.isharkfly.web3j.controllers;
import com.baeldung.web3j.constants.Constants;
import com.baeldung.web3j.helpers.TimeHelper;
import com.baeldung.web3j.services.Web3Service;
import com.baeldung.web3j.transfers.ResponseTransfer;
import com.isharkfly.web3j.constants.Constants;
import com.isharkfly.web3j.helpers.TimeHelper;
import com.isharkfly.web3j.services.Web3Service;
import com.isharkfly.web3j.transfers.ResponseTransfer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -17,7 +17,7 @@ import java.time.Instant;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import static com.baeldung.web3j.constants.Constants.GENERIC_EXCEPTION;
import static com.isharkfly.web3j.constants.Constants.GENERIC_EXCEPTION;
@RestController
public class EthereumRestController {

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.helpers;
package com.isharkfly.web3j.helpers;
import java.time.Duration;
import java.time.Instant;

View File

@ -1,6 +1,6 @@
package com.baeldung.web3j.services;
package com.isharkfly.web3j.services;
import com.baeldung.web3j.contracts.Example;
import com.isharkfly.web3j.contracts.Example;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.web3j.abi.FunctionEncoder;
@ -22,11 +22,10 @@ import java.io.File;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import static com.baeldung.web3j.constants.Constants.DEFAULT_ADDRESS;
import static com.baeldung.web3j.constants.Constants.GENERIC_EXCEPTION;
import static com.baeldung.web3j.constants.Constants.PLEASE_SUPPLY_REAL_DATA;
import static com.isharkfly.web3j.constants.Constants.DEFAULT_ADDRESS;
import static com.isharkfly.web3j.constants.Constants.GENERIC_EXCEPTION;
import static com.isharkfly.web3j.constants.Constants.PLEASE_SUPPLY_REAL_DATA;
@Service
public class Web3Service {

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.transfers;
package com.isharkfly.web3j.transfers;
import java.time.Duration;

View File

@ -1,4 +1,4 @@
package com.baeldung.ethereumj.controllers;
package com.isharkfly.ethereumj.controllers;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertNotNull;
@ -17,9 +17,9 @@ import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.RestTemplate;
import com.baeldung.ethereumj.ApplicationMain;
import com.baeldung.ethereumj.Constants;
import com.baeldung.ethereumj.transfer.EthResponse;
import com.isharkfly.ethereumj.ApplicationMain;
import com.isharkfly.ethereumj.Constants;
import com.isharkfly.ethereumj.transfer.EthResponse;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ApplicationMain.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)

View File

@ -1,8 +1,8 @@
package com.baeldung.web3j.controllers;
package com.isharkfly.web3j.controllers;
import com.baeldung.web3j.config.AppConfig;
import com.baeldung.web3j.constants.Constants;
import com.isharkfly.web3j.config.AppConfig;
import com.isharkfly.web3j.constants.Constants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,7 +1,7 @@
package com.baeldung.web3j.controllers;
package com.isharkfly.web3j.controllers;
import com.baeldung.web3j.constants.Constants;
import com.baeldung.web3j.services.Web3Service;
import com.isharkfly.web3j.constants.Constants;
import com.isharkfly.web3j.services.Web3Service;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package com.baeldung.web3j.services;
package com.isharkfly.web3j.services;
import org.junit.After;
import org.junit.Before;

View File

@ -41,6 +41,7 @@
<modules>
<module>apache</module>
<module>core-java-modules</module>
<module>ethereum</module>
<module>image-compressing</module>
<module>image-processing</module>
<module>libraries-jackson</module>
@ -75,8 +76,6 @@
<commons-cli.version>1.4</commons-cli.version>
<commons-io.version>2.11.0</commons-io.version>
<!-- UTILS -->
<guava.version>31.1-jre</guava.version>
<lombok.version>1.18.28</lombok.version>
@ -84,6 +83,7 @@
<colt.version>1.2.0</colt.version>
<trove4j.version>3.0.3</trove4j.version>
<fastutil.version>5.0.9</fastutil.version>
<jstl.version>1.2</jstl.version>
<!-- Hibernate / JPA -->
<jakarta.persistence.version>3.2.0-M2</jakarta.persistence.version>