Skip to content

Commit 159b375

Browse files
standardize variable names for operator account ID and key (#198)
Signed-off-by: krystal <[email protected]>
1 parent 1e566a5 commit 159b375

8 files changed

+60
-60
lines changed

sdks-and-apis/sdks/client.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ client.setOperator(OPERATOR_ID, OPERATOR_KEY);
183183
{% tab title="JavaScript" %}
184184
```javascript
185185
//Grab the account ID and private key of the operator account from the .env file
186-
const myAccountId = process.env.OPERATOR_ID;
187-
const myPrivateKey = process.env.OPERATOR_KEY;
186+
const operatorId = process.env.OPERATOR_ID;
187+
const operatorKey = process.env.OPERATOR_KEY;
188188

189189
// Pre-configured client for test network (testnet)
190190
const client = Client.forTestnet()
191191

192192
//Set the operator with the account ID and private key
193-
client.setOperator(myAccountId, myPrivateKey);
193+
client.setOperator(operatorId, operatorKey);
194194
```
195195
{% endtab %}
196196

@@ -211,7 +211,7 @@ client.setOperator(myAccountId, myPrivateKey);
211211
panic(err)
212212
}
213213

214-
myPrivateKey, err := hedera.PrivateKeyFromString(OPERATOR_KEY)
214+
operatorKey, err := hedera.PrivateKeyFromString(OPERATOR_KEY)
215215
if err != nil {
216216
panic(err)
217217
}
@@ -247,7 +247,7 @@ The **max transaction fee** and **max query payment** are both set to 100\_000\_
247247
Client client = Client.forTestnet()
248248

249249
//Set your account as the client's operator
250-
client.setOperator(myAccountId, myPrivateKey);
250+
client.setOperator(operatorId, operatorKey);
251251

252252
//Set the default maximum transaction fee (in Hbar)
253253
client.setDefaultMaxTransactionFee(new Hbar(10));
@@ -265,7 +265,7 @@ client.setDefaultMaxQueryPayment(new Hbar(5));
265265
const client = Client.forTestnet()
266266

267267
//Set your account as the client's operator
268-
client.setOperator(myAccountId, myPrivateKey);
268+
client.setOperator(operatorId, operatorKey);
269269

270270
//Set the default maximum transaction fee (in Hbar)
271271
client.setDefaultMaxTransactionFee(new Hbar(10));
@@ -283,7 +283,7 @@ client.setDefaultMaxQueryPayment(new Hbar(5));
283283
client := hedera.ClientForTestnet()
284284

285285
//Set your account as the client's operator
286-
client.SetOperator(myAccountId, myPrivateKey)
286+
client.SetOperator(operatorId, operatorKey)
287287

288288
// Set default max transaction fee
289289
client.SetDefaultMaxTransactionFee(hedera.HbarFrom(10, hedera.HbarUnits.Hbar))

sdks-and-apis/sdks/schedule-transaction/create-a-schedule-transaction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Example:
99
```java
1010
TransferTransaction transactionToSchedule = new TransferTransaction()
1111
.addHbarTransfer(newAccountId, Hbar.fromTinybars(-1))
12-
.addHbarTransfer(myAccountId, Hbar.fromTinybars(1));
12+
.addHbarTransfer(operatorId, Hbar.fromTinybars(1));
1313
```
1414

1515
{% hint style="info" %}

tutorials/consensus/query-messages-with-mirror-node.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Copy and execute the following code. Make sure to write down your `topic ID`. Th
3434
```java
3535
// Create a new topic
3636
TransactionResponse txResponse = new TopicCreateTransaction()
37-
.setSubmitKey(myPrivateKey.getPublicKey())
37+
.setSubmitKey(operatorKey.getPublicKey())
3838
.execute(client);
3939

4040
// Get the receipt
@@ -96,7 +96,7 @@ await new TopicMessageSubmitTransaction({
9696
```go
9797
// Create a new topic
9898
transactionResponse, err := hedera.NewTopicCreateTransaction().
99-
SetSubmitKey(myPrivateKey.PublicKey()).
99+
SetSubmitKey(operatorKey.PublicKey()).
100100
Execute(client)
101101

102102
if err != nil {

tutorials/consensus/submit-message-to-private-topic.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To create a private topic, you will use [_<mark style="color:purple;">**`setSubm
3434
```java
3535
// Create a new topic
3636
TransactionResponse txResponse = new TopicCreateTransaction()
37-
.setSubmitKey(myPrivateKey.getPublicKey())
37+
.setSubmitKey(operatorKey.getPublicKey())
3838
.execute(client);
3939

4040
// Get the receipt
@@ -55,7 +55,7 @@ Thread.sleep(5000);
5555
```javascript
5656
// Create a new topic
5757
let txResponse = await new TopicCreateTransaction()
58-
.setSubmitKey(myPrivateKey.publicKey)
58+
.setSubmitKey(operatorKey.publicKey)
5959
.execute(client);
6060

6161
// Grab the newly generated topic ID
@@ -71,7 +71,7 @@ await new Promise((resolve) => setTimeout(resolve, 5000));
7171
```go
7272
// Create a new topic
7373
transactionResponse, err := hedera.NewTopicCreateTransaction().
74-
SetSubmitKey(myPrivateKey.PublicKey()).
74+
SetSubmitKey(operatorKey.PublicKey()).
7575
Execute(client)
7676

7777
if err != nil {
@@ -155,7 +155,7 @@ TransactionResponse submitMessage = new TopicMessageSubmitTransaction()
155155
.setTopicId(topicId)
156156
.setMessage("Submitkey set!")
157157
.freezeWith(client)
158-
.sign(myPrivateKey)
158+
.sign(operatorKey)
159159
.execute(client)
160160

161161
// Get the receipt of the transaction
@@ -174,7 +174,7 @@ let submitMsgTx = await new TopicMessageSubmitTransaction({
174174
message: "Submitkey set!",
175175
})
176176
.freezeWith(client)
177-
.sign(myPrivateKey);
177+
.sign(operatorKey);
178178

179179
let submitMsgTxSubmit = await submitMsgTx.execute(client);
180180

@@ -201,7 +201,7 @@ if err != nil {
201201
}
202202

203203
// Sign message with submit key
204-
submitMessageTx.Sign(myPrivateKey)
204+
submitMessageTx.Sign(operatorKey)
205205

206206
// Submit message
207207
submitTxResponse, err := submitMessageTx.Execute(client)
@@ -243,16 +243,16 @@ public class CreateTopicTutorial {
243243
public static void main(String[] args) throws TimeoutException, PrecheckStatusException, ReceiptStatusException, InterruptedException {
244244

245245
// Grab your Hedera testnet account ID and private key
246-
AccountId myAccountId = AccountId.fromString(Dotenv.load().get("OPERATOR_ID"));
247-
PrivateKey myPrivateKey = PrivateKey.fromString(Dotenv.load().get("OPERATOR_KEY"));
246+
AccountId operatorId = AccountId.fromString(Dotenv.load().get("OPERATOR_ID"));
247+
PrivateKey operatorKey = PrivateKey.fromString(Dotenv.load().get("OPERATOR_KEY"));
248248

249249
// Build your Hedera client
250250
Client client = Client.forTestnet();
251-
client.setOperator(myAccountId, myPrivateKey);
251+
client.setOperator(operatorId, operatorKey);
252252

253253
// Create a new topic
254254
TransactionResponse txResponse = new TopicCreateTransaction()
255-
.setSubmitKey(myPrivateKey.getPublicKey())
255+
.setSubmitKey(operatorKey.getPublicKey())
256256
.execute(client);
257257

258258
// Get the receipt
@@ -280,7 +280,7 @@ public class CreateTopicTutorial {
280280
</strong> .setTopicId(topicId)
281281
.setMessage("Submitkey set!")
282282
.freezeWith(client)
283-
.sign(myPrivateKey)
283+
.sign(operatorKey)
284284
.execute(client)
285285

286286
// Get the receipt of the transaction
@@ -311,19 +311,19 @@ const {
311311
} = require("@hashgraph/sdk");
312312

313313
// Grab the OPERATOR_ID and OPERATOR_KEY from the .env file
314-
const myAccountId = process.env.OPERATOR_ID;
315-
const myPrivateKey = process.env.OPERATOR_KEY;
314+
const operatorId = process.env.OPERATOR_ID;
315+
const operatorKey = process.env.OPERATOR_KEY;
316316

317317
// Build Hedera testnet and mirror node client
318318
const client = Client.forTestnet();
319319

320320
// Set the operator account ID and operator private key
321-
client.setOperator(myAccountId, myPrivateKey);
321+
client.setOperator(operatorId, operatorKey);
322322

323323
async function submitPrivateMessage() {
324324
// Create a new topic
325325
let txResponse = await new TopicCreateTransaction()
326-
.setSubmitKey(myPrivateKey.publicKey)
326+
.setSubmitKey(operatorKey.publicKey)
327327
.execute(client);
328328

329329
// Grab the newly generated topic ID
@@ -350,7 +350,7 @@ async function submitPrivateMessage() {
350350
message: "Submitkey set!",
351351
})
352352
.freezeWith(client)
353-
.sign(myPrivateKey);
353+
.sign(operatorKey);
354354

355355
let submitMsgTxSubmit = await submitMsgTx.execute(client);
356356
let getReceipt = await submitMsgTxSubmit.getReceipt(client);
@@ -390,23 +390,23 @@ func main() {
390390
}
391391

392392
// Grab your testnet account ID and private key from the .env file
393-
myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
393+
operatorId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
394394
if err != nil {
395395
panic(err)
396396
}
397397

398-
myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
398+
operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
399399
if err != nil {
400400
panic(err)
401401
}
402402

403403
// Create your testnet client
404404
client := hedera.ClientForTestnet()
405-
client.SetOperator(myAccountId, myPrivateKey)
405+
client.SetOperator(operatorId, operatorKey)
406406

407407
// Create a new topic
408408
transactionResponse, err := hedera.NewTopicCreateTransaction().
409-
SetSubmitKey(myPrivateKey.PublicKey()).
409+
SetSubmitKey(operatorKey.PublicKey()).
410410
Execute(client)
411411

412412
if err != nil {
@@ -447,7 +447,7 @@ func main() {
447447
}
448448

449449
// Sign message with submit key
450-
submitMessageTx.Sign(myPrivateKey)
450+
submitMessageTx.Sign(operatorKey)
451451

452452
// Submit message
453453
submitTxResponse, err := submitMessageTx.Execute(client)

tutorials/consensus/submit-your-first-message.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,12 @@ public class CreateTopicTutorial {
228228
public static void main(String[] args) throws TimeoutException, PrecheckStatusException, ReceiptStatusException, InterruptedException {
229229

230230
// Grab your Hedera testnet account ID and private key
231-
AccountId myAccountId = AccountId.fromString(Dotenv.load().get("OPERATOR_ID"));
232-
PrivateKey myPrivateKey = PrivateKey.fromString(Dotenv.load().get("OPERATOR_KEY"));
231+
AccountId operatorId = AccountId.fromString(Dotenv.load().get("OPERATOR_ID"));
232+
PrivateKey operatorKey = PrivateKey.fromString(Dotenv.load().get("OPERATOR_KEY"));
233233

234234
// Build your Hedera client
235235
Client client = Client.forTestnet();
236-
client.setOperator(myAccountId, myPrivateKey);
236+
client.setOperator(operatorId, operatorKey);
237237

238238
// Create a new topic
239239
TransactionResponse txResponse = new TopicCreateTransaction()
@@ -293,14 +293,14 @@ const {
293293
} = require("@hashgraph/sdk");
294294

295295
// Grab the OPERATOR_ID and OPERATOR_KEY from the .env file
296-
const myAccountId = process.env.OPERATOR_ID;
297-
const myPrivateKey = process.env.OPERATOR_KEY;
296+
const operatorId = process.env.OPERATOR_ID;
297+
const operatorKey = process.env.OPERATOR_KEY;
298298

299299
// Build Hedera testnet and mirror node client
300300
const client = Client.forTestnet();
301301

302302
// Set the operator account ID and operator private key
303-
client.setOperator(myAccountId, myPrivateKey);
303+
client.setOperator(operatorId, operatorKey);
304304

305305
async function submitFirstMessage() {
306306
// Create a new topic
@@ -366,19 +366,19 @@ func main() {
366366
}
367367

368368
// Grab your testnet account ID and private key from the .env file
369-
myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
369+
operatorId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
370370
if err != nil {
371371
panic(err)
372372
}
373373

374-
myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
374+
operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
375375
if err != nil {
376376
panic(err)
377377
}
378378

379379
// Create your testnet client
380380
client := hedera.ClientForTestnet()
381-
client.SetOperator(myAccountId, myPrivateKey)
381+
client.SetOperator(operatorId, operatorKey)
382382

383383
// Create a new topic
384384
transactionResponse, err := hedera.NewTopicCreateTransaction().

tutorials/token/create-and-transfer-your-first-fungible-token.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ public class CreateFungibleTutorial {
318318
public static void main(String[] args) throws TimeoutException, PrecheckStatusException, ReceiptStatusException {
319319

320320
//Grab your Hedera testnet account ID and private key
321-
AccountId myAccountId = AccountId.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_ID")));
322-
PrivateKey myPrivateKey = PrivateKey.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_KEY")));
321+
AccountId operatorId = AccountId.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_ID")));
322+
PrivateKey operatorKey = PrivateKey.fromString(Objects.requireNonNull(Dotenv.load().get("OPERATOR_KEY")));
323323

324324
//Create your Hedera testnet client
325325
Client client = Client.forTestnet();
326-
client.setOperator(myAccountId, myPrivateKey);
326+
client.setOperator(operatorId, operatorKey);
327327

328328
//Treasury Key
329329
PrivateKey treasuryKey = PrivateKey.generateECDSA();
@@ -545,23 +545,23 @@ func main() {
545545
}
546546

547547
//GRAB YOUR TESTNET ACCOUNT ID AND KEY FROMZ THE .ENV FILE
548-
myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
548+
operatorId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
549549
if err != nil {
550550
panic(err)
551551
}
552552

553-
myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
553+
operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
554554
if err != nil {
555555
panic(err)
556556
}
557557

558558
//PRINT ACCOUNT ID AND KEY TO MAKE SURE THERE WASN'T AN ERROR READING FROM THE .ENV FILE
559-
fmt.Printf("The account ID is = %v\n", myAccountId)
560-
fmt.Printf("The private key is = %v\n", myPrivateKey)
559+
fmt.Printf("The account ID is = %v\n", operatorId)
560+
fmt.Printf("The private key is = %v\n", operatorKey)
561561

562562
//CREATE TESTNET CLIENT
563563
client := hedera.ClientForTestnet()
564-
client.SetOperator(myAccountId, myPrivateKey)
564+
client.SetOperator(operatorId, operatorKey)
565565

566566
//CREATE TREASURY KEY
567567
treasuryKey, err := hedera.GenerateEcdsaPrivateKey()

tutorials/token/create-and-transfer-your-first-nft.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,12 @@ public class CreateYourFirstNft {
570570
Dotenv dotenv = Dotenv.load();
571571

572572
// Grab your Hedera testnet account ID and private key
573-
AccountId myAccountId = AccountId.fromString(dotenv.get("OPERATOR_ID"));
574-
PrivateKey myPrivateKey = PrivateKey.fromStringDER(dotenv.get("OPERATOR_KEY"));
573+
AccountId operatorId = AccountId.fromString(dotenv.get("OPERATOR_ID"));
574+
PrivateKey operatorKey = PrivateKey.fromStringDER(dotenv.get("OPERATOR_KEY"));
575575

576576
// Create your Hedera testnet client
577577
Client client = Client.forTestnet();
578-
client.setOperator(myAccountId, myPrivateKey);
578+
client.setOperator(operatorId, operatorKey);
579579

580580
// Treasury Key
581581
PrivateKey treasuryKey = PrivateKey.generateECDSA();
@@ -937,19 +937,19 @@ func main() {
937937
}
938938

939939
// Grab your testnet account ID and private key from the .env file
940-
myAccountId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
940+
operatorId, err := hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))
941941
if err != nil {
942942
panic(err)
943943
}
944944

945-
myPrivateKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
945+
operatorKey, err := hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))
946946
if err != nil {
947947
panic(err)
948948
}
949949

950950
// Create your testnet client
951951
client := hedera.ClientForTestnet()
952-
client.SetOperator(myAccountId, myPrivateKey)
952+
client.SetOperator(operatorId, operatorKey)
953953

954954
// Create a treasury Key
955955
treasuryKey, err := hedera.GenerateEcdsaPrivateKey()

0 commit comments

Comments
 (0)