Skip to content

Commit c0d07ac

Browse files
authored
Update CreateTokenDemo.java
Signed-off-by: SimiHunjan <simi.hunjan.k@gmail.com>
1 parent 70101f9 commit c0d07ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/examples/java/CreateTokenDemo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class CreateTokenDemo {
1111
public static void main(String[] args ) throws Exception {
1212
// .env-provided
1313
String operatorId = AccountId.fromString(System.getenv("OPERATOR_ID"));
14-
String operatorKey = System.getenv("OPERATOR_KEY");
14+
String operatorKey = PrivateKey.fromString(System.getenv("OPERATOR_KEY"));
1515
String network = System.getenv().getOrDefault("HEDERA_NETWORK", "local"); // "local" for Solo
1616
String mirrorNode = System.getenv().getOrDefault(
1717
"MIRROR_NODE_URL",
@@ -27,7 +27,7 @@ public static void main(String[] args ) throws Exception {
2727
? Client.forNetwork(java.util.Map.of("127.0.0.1:50211", new AccountId(3))) // Solo default node + node account (adjust if needed)
2828
: Client.forTestnet();
2929

30-
client.setOperator(AccountId.fromString(operatorId), PrivateKey.fromString(operatorKey));
30+
client.setOperator(operatorId, operatorKey);
3131

3232
// generate token keys
3333
PrivateKey supplyKey = PrivateKey.generateECDSA();

0 commit comments

Comments
 (0)