dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
<properties>
<project.libs>${project.basedir}/libs</project.libs>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.6.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/logging-interceptor -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okio/okio-jvm -->
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.0.0</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.35</version>
</dependency>
<dependency>
<groupId>com.uracle.hecate.client</groupId>
<artifactId>com.uracle.hecate.client</artifactId>
<version>2.0.0</version>
<scope>system</scope>
<systemPath>${project.libs}/hecate-connector-client-v2.0.0.jar</systemPath>
</dependency>
</dependencies>
String bcname = ConnectorApi.getInOperationBcName("http://127.0.0.1:9780");
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.build();
EthConnectorApi api = new EthConnectorApi(client);
OauthClient response = api.signupClient("Uracle");
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.build();
EthConnectorApi api = new EthConnectorApi(client);
OauthClient response = api.getClient("Uracle");
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "bWdmaG13dmhvd2V0bndld25jMHpuemhrbHRnMW9kZXR6Z3EyemRlM256cXluamkzOmVjNzhjM2M3LWEzYWEtM2M3My1hMTNiLTdiY2U5ZjY5OTU1Yw==";
Authorization authorization = new Authorization(token, AuthorizationType.BASIC);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
OauthToken response = api.issueToken();
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal proposal = new EthereumConnectorProposal();
proposal.setSmartContract("0xC001dF2301b8296FD9f31E3940157DA0547190BF"); // 스마트컨트랙트 주소
proposal.setWalletAddress("0x252f373ae00503745f7f9934561bbfdaa92c3846"); // 지갑 주소
proposal.setFuncName("getDidDoc"); // 호출 할 스마트 컨트랙트 메소드명
proposal.setRawData("Uracle key"); // 전달 할 파라미터 값
EthereumProposal response = api.queryData(proposal);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal proposal = new EthereumConnectorProposal();
proposal.setSmartContract("0xC001dF2301b8296FD9f31E3940157DA0547190BF"); // 스마트컨트랙트 주소
proposal.setWalletAddress("0x252f373ae00503745f7f9934561bbfdaa92c3846"); // 지갑 주소
proposal.setFuncName("getDidDoc"); // 호출 할 스마트 컨트랙트 메소드명
LinkedTreeMap<String, Object> rawData = new LinkedTreeMap<String, Object>();
rawData.put("bcKey", "Uracle key");
rawData.put("bcValue", "Hello Uracle");
rawData.put("didTimestamp", "1591851625");
proposal.setRawData(rawData); // 전달 할 파라미터 값
EthereumProposal response = api.invokeData(proposal);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal proposal = new EthereumConnectorProposal();
proposal.setWalletAddress("0x252f373ae00503745f7f9934561bbfdaa92c3846"); // 지갑 주소
LinkedTreeMap<String, Object> rawData = new LinkedTreeMap<String, Object>();
rawData.put("bcKey", "Uracle key");
rawData.put("bcValue", "Hello Uracle");
rawData.put("didTimestamp", "1591851625");
proposal.setRawData(rawData); // 전달 할 파라미터 값
EthereumProposal response = api.commitTransaction(proposal);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
// 트랜잭션 저장 시 바디 데이터 해싱(Hasing)하고 싶을 때
.onBodyHash(true)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal proposal = new EthereumConnectorProposal();
proposal.setWalletAddress("0x252f373ae00503745f7f9934561bbfdaa92c3846"); // 지갑 주소
LinkedTreeMap<String, Object> rawData = new LinkedTreeMap<String, Object>();
rawData.put("bcKey", "Uracle key");
rawData.put("bcValue", "Hello Uracle");
rawData.put("didTimestamp", "1591851625");
proposal.setRawData(rawData); // 전달 할 파라미터 값
EthereumProposal response = api.commitTransaction(proposal);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String txHash = "0xd8313d5bd433621a542682d69c4a1402acea02f1e2e72bace5bf1a2a00215abc";
EthereumProposal response = api.getTransactionReceipt(txHash);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String txHash = "0xd8313d5bd433621a542682d69c4a1402acea02f1e2e72bace5bf1a2a00215abc";
EthereumProposal response = api.getTransactionInfo(txHash);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String txHash = "0xd8313d5bd433621a542682d69c4a1402acea02f1e2e72bace5bf1a2a00215abc";
String funcName = "regDidDoc";
EthereumProposal response = api.getTransactionInfo(txHash, funcName);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal response = api.issueWallet();
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal response = api.updateWalletNonce("0x5492190824570b65ad4e96c4f7452d0160d74e7c");
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String blockHash = "0x405bad87d045d0ff0dad19f72e33532618fd4906c6de0f47dfcb367567de1f60";
String contractAddress = "0xC001dF2301b8296FD9f31E3940157DA0547190BF";
EthereumProposal response = api.getEventLog(blockHash, contractAddress);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String blockHash = "0x405bad87d045d0ff0dad19f72e33532618fd4906c6de0f47dfcb367567de1f60";
EthereumProposal response = api.getEventLog(blockHash);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal response = api.getGasLimit();
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal response = api.getGasPrice();
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
EthereumProposal response = api.getLatestBlock();
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String blockHash = "0x405bad87d045d0ff0dad19f72e33532618fd4906c6de0f47dfcb367567de1f60";
EthereumProposal response = api.getBlockByBlockHash(blockHash);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
String token = "eyJraWQiOiI0N2M4NzE1Mi04MGE2LTQzNGUtYmQzZi03MjU1NWQ2NjY1M2EiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJhdWQiOiJ5bW15bnRtNG16Y3RudGF4eWkwem5ncTVsd2UybWd1dG56dmluMml3bmp6a250YzMiLCJuYmYiOjE2NTY0NzY3NTQsInNjb3BlIjpbInByb2ZpbGUiXSwiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojk3ODAiLCJleHAiOjE2NTY1NjMxNTQsImlhdCI6MTY1NjQ3Njc1NH0.kfNbILRMIbqkQZLMbbf0wwIja9NRAz-ACdouuSJcNtLmH1XRThFThrtN-RsYXPq7CXDyZKimL3MGbLBbGGTjGR6m66NHEUD-HeCzo9QlDj1okr5YFrsoT1q38DtwGSbW6I6jJNQmqs4deYHO5K-UsLTnSRLMEYfFept9va7v5GaUZpFmb7xfnOwoHI0aMccgbVaV-KvbSg2e_H1HWeZrAwBhcItSN4EKD-gIyHYoujEF6zBlK_X1Q1tUuyBuiIRxuC0W2tMZ0Yqamm88IsKzDkEYcjGHVeETXWQlmBuMDCaJGIWIb_KZlgJh47uQLV_6e_MtWBN36e5Vg7iCeXZfRw";
Authorization authorization = new Authorization(token, AuthorizationType.BEARER);
ConnectorClient client = new ConnectorClient.Builder("http://127.0.0.1:9780")
.authorization(authorization)
.build();
EthConnectorApi api = new EthConnectorApi(client);
String blockHeight = "109764";
EthereumProposal response = api.getBlockByBlockHeight(blockHeight);
// 에러체크
if(response.isError()){
return response.getError().getMessage();
}
return response.toJson();
Gson gson = GsonInitializer.getInstance().getGson();
// Json Serialize
EthereumProposal proposal = new EthereumConnectorProposal();
proposal.setSmartContract("ethereum smartcontract");
proposal.setFuncName("hello world");
proposal.setRawData("This is Sample Data!");
String jsonProposal = gson.toJson(proposal);
// Json Deserialize
EthereumProposal deProposal = gson.fromJson(jsonProposal, EthereumConnectorProposal.class);
Truffle Framework를 이용하여 compile & deploy하게 되었을 시 compile를 통하여 생성된 빌드 파일 중 상태변수가 존재하는 스마트 컨트랙트 파일(STEP1)을 아래의 이미지 Step2와 같이 수정하여 HECATE CONNECTOR API 담당자에게 전달 또는 헤카테 커넥터에 업데이트 진행한다.
STEP1