Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Adds priv commandline switch
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-richardson committed Jul 23, 2019
1 parent 0fafaca commit 5bc6242
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public PantheonFactoryConfigurationBuilder jsonRpcEnabled() {
public PantheonFactoryConfigurationBuilder enablePrivateTransactions(
final PrivacyParameters privacyParameters) {
this.jsonRpcConfiguration.addRpcApi(RpcApis.EEA);
this.jsonRpcConfiguration.addRpcApi(RpcApis.PRIV);
this.privacyParameters = privacyParameters;
this.privacyParameters.setEnabled(true);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,11 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter),
new EeaSendRawTransaction(
blockchainQueries, privateTransactionHandler, transactionPool, parameter),
new EeaGetTransactionCount(parameter, privateTransactionHandler),
new EeaGetPrivateTransaction(enclave, parameter, privacyParameters),
new EeaGetPrivateTransaction(enclave, parameter, privacyParameters));
}
if (rpcApis.contains(RpcApis.PRIV)) {
addMethods(
enabledMethods,
new PrivCreatePrivacyGroup(new Enclave(privacyParameters.getEnclaveUri()), parameter),
new PrivDeletePrivacyGroup(new Enclave(privacyParameters.getEnclaveUri()), parameter),
new PrivFindPrivacyGroup(new Enclave(privacyParameters.getEnclaveUri()), parameter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class RpcApis {
public static final RpcApi WEB3 = new RpcApi("WEB3");
public static final RpcApi ADMIN = new RpcApi("ADMIN");
public static final RpcApi EEA = new RpcApi("EEA");
public static final RpcApi PRIV = new RpcApi("PRIV");
public static final RpcApi TX_POOL = new RpcApi("TXPOOL");

public static final List<RpcApi> DEFAULT_JSON_RPC_APIS = Arrays.asList(ETH, NET, WEB3);
Expand All @@ -47,6 +48,8 @@ public static Optional<RpcApi> valueOf(final String name) {
return Optional.of(ADMIN);
} else if (name.equals(EEA.getCliValue())) {
return Optional.of(EEA);
} else if (name.equals(PRIV.getCliValue())) {
return Optional.of(PRIV);
} else if (name.equals(TX_POOL.getCliValue())) {
return Optional.of(TX_POOL);
} else {
Expand Down

0 comments on commit 5bc6242

Please sign in to comment.