Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the HIP to point to testnet #1303

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions examples/account-create-with-hts.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,16 @@ async function main() {
const freezeKey = PrivateKey.generateECDSA();
const wipeKey = PrivateKey.generateECDSA();

// operatorId and operatorKey used on local node
const operatorId = AccountId.fromString("0.0.2");
const operatorKey = PrivateKey.fromString(
"302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"
);

// If we weren't able to get them, we should throw a new error
if (operatorId == null || operatorKey == null) {
if (process.env.OPERATOR_ID == null || process.env.OPERATOR_KEY == null) {
throw new Error(
"Could not fetch 'operatorId' and 'operatorKey' properly"
"Environment variables OPERATOR_ID, and OPERATOR_KEY are required."
);
}
const operatorId = AccountId.fromString(process.env.OPERATOR_ID);
const operatorKey = PrivateKey.fromString(process.env.OPERATOR_KEY);

const node = { "127.0.0.1:50211": new AccountId(3) };
const client = Client.forNetwork(node)
.setMirrorNetwork("127.0.0.1:5600")
.setOperator(operatorId, operatorKey);
const client = Client.forTestnet();
client.setOperator(operatorId, operatorKey);

/**
* Example 1
Expand Down