GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add missing mirror node entry in docs.json #281 · hashgraph/hedera-docs@ef9ca68

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • example-status
      • java-status.md
    • examples/java
      • CreateAccountDemo.java
      • CreateTokenDemo.java
      • CreateTopicDemo.java
    • scripts
      • java-gradle-bootstrap.sh
      • run-java.sh
      • update-services.js
    • workflows
      • auto-release-notes.yml
      • examples.yml
      • update-node-tables.yml
  • .gitignore
  • README.md
  • docs.json
  • hedera
    • core-concepts
      • accounts.mdx
      • smart-contracts
        • compiling-smart-contracts.mdx
        • gas-and-fees.mdx
    • getting-started-evm-developers.mdx
    • getting-started-evm-developers
      • deploy-a-smart-contract-using-remix.mdx
      • deploy-a-smart-contract-with-foundry.mdx
      • deploy-a-smart-contract-with-hardhat.mdx
      • hedera-testnet-faucet.mdx
    • getting-started-hedera-native-developers.mdx
    • getting-started-hedera-native-developers
      • create-a-token.mdx
      • create-a-topic.mdx
      • create-an-account.mdx
    • networks
      • mainnet
        • fees.mdx
        • mainnet-nodes.mdx
        • mainnet-nodes
          • node-requirements.mdx
      • release-notes
        • mirror-node.mdx
        • services.mdx
    • open-source-solutions.mdx
    • open-source-solutions
      • asset-tokenization-studio-ats.mdx
      • asset-tokenization-studio-ats
        • frequently-asked-questions-faqs.mdx
        • web-user-interface-ui.mdx
      • hedera-wallet-snap-by-metamask
        • metamask-hedera-wallet-snap-tutorial.mdx
      • interoperability-and-bridging.mdx
      • interoperability-and-bridging
        • chainlink.mdx
      • nft-studio.mdx
      • nft-studio
        • airdrop-list-verifier.mdx
        • metadata-validator.mdx
        • nft-rarity-inspector.mdx
        • nft-risk-calculator.mdx
        • nft-token-holders-list-builder.mdx
    • sdks-and-apis
      • rest-api.mdx
      • sdks.mdx
      • sdks/consensus-service
        • submit-a-message.mdx
    • support-and-community.mdx
    • support-and-community
      • glossary.mdx
    • tutorials.mdx
    • tutorials
      • consensus
        • submit-message-to-private-topic.mdx
        • submit-your-first-message.mdx
      • local-node
        • setup-hedera-node-cli-npm.mdx
      • more-tutorials
        • how-to-auto-create-hedera-accounts-with-hbar-and-token-transfers.mdx
        • how-to-configure-a-mirror-node-and-query-specific-data.mdx
        • how-to-create-a-personal-access-token-api-key-on-the-hedera-portal.mdx
        • how-to-generate-a-random-number-on-hedera.mdx
        • javascript-testing.mdx
        • json-rpc-connections.mdx
      • smart-contracts
        • configuring-hardhat-with-hiero-local-node-a-step-by-step-guide.mdx
        • deploy-a-subgraph-using-the-graph-and-json-rpc.mdx
        • deploy-smart-contracts-on-hedera-using-truffle.mdx
        • foundry.mdx
        • foundry
          • configuring-foundry-with-hedera-localnet-testnet-a-step-by-step-guide.mdx
          • how-to-fork-the-hedera-network-for-local-testing.mdx
          • how-to-mint-and-burn-an-erc-721-token-using-foundry-part-1.mdx
          • how-to-write-tests-in-solidity-part-2.mdx
        • how-to-connect-metamask-to-hedera.mdx
        • how-to-mint-and-burn-an-erc-721-token-using-hardhat-and-ethers-part-1.mdx
        • how-to-set-access-control-a-token-uri-pause-and-transfer-an-erc-721-token-using-hardhat-part-2.mdx
        • how-to-upgrade-an-erc-721-token-with-openzeppelin-uups-proxies-and-hardhat-part-3.mdx
        • how-to-verify-a-smart-contract-on-hashscan.mdx
        • hts-x-evm-part-1-how-to-mint-nfts.mdx
        • hts-x-evm-part-2-kyc-and-update.mdx
        • hts-x-evm-part-3-how-to-pause-freeze-wipe-and-delete-nfts.mdx
        • send-and-receive-hbar-using-solidity-smart-contracts.mdx
      • token
        • create-your-first-frictionless-airdrop-campaign.mdx
        • hedera-token-service-part-1-how-to-mint-nfts.mdx
        • hedera-token-service-part-2-kyc-update-and-scheduled-transactions.mdx
        • hedera-token-service-part-3-how-to-pause-freeze-wipe-and-delete-nfts.mdx
        • hybrid-hts-+-evm-tokenization.mdx
        • structure-your-token-metadata-using-json-schema-v2.mdx
  • images
    • getting-started-evm-developers
      • contract-builder-screenshot.png
    • getting-started-hedera-native-developers
      • playground-screenshot.png
    • index
      • HH60180_HederaDocs_Final.jpg
      • ai-studio-landing.avif
      • ascension-hackathon.png
    • networks/release-notes/services
      • v66-performance-results.avif
    • open-source-solutions
      • asset-tokenization-studio-ats/web-user-interface-ui
        • asset-tokenization-kyc-activate.png
        • asset-tokenization-kyc-external-create.png
        • asset-tokenization-kyc-external-grant-kyc.png
        • asset-tokenization-kyc-external-link-token.png
        • asset-tokenization-kyc-internal.png
        • asset-tokenization-kyc-ssi-add.png
        • asset-tokenization-kyc-vc.png
        • asset-tokenization-studio-create-bond-configuration.png
        • asset-tokenization-studio-create-bond-details.png
        • asset-tokenization-studio-create-bond-erc3643.png
        • asset-tokenization-studio-create-bond-permissions.png
        • asset-tokenization-studio-create-bond-proceed-recipients.png
        • asset-tokenization-studio-create-bond-regulation.png
        • asset-tokenization-studio-create-bond-review.png
        • asset-tokenization-studio-create-equity-create.png
        • asset-tokenization-studio-create-external-lists.png
      • interoperability-and-bridging
        • interoperability-and-bridging-chainlink.png
        • interoperability-and-bridging-hashport.png
        • interoperability-and-bridging-layerzero.png
  • index.mdx
  • public/fonts/styrene
    • StyreneA-Black-Web.woff2
    • StyreneA-BlackItalic-Web.woff2
    • StyreneA-Bold-Web.woff2
    • StyreneA-BoldItalic-Web.woff2
    • StyreneA-Light-Web.woff2
    • StyreneA-LightItalic-Web.woff2
    • StyreneA-Medium-Web.woff2
    • StyreneA-MediumItalic-Web.woff2
    • StyreneA-Regular-Web.woff2
    • StyreneA-RegularItalic-Web.woff2
    • StyreneA-Thin-Web.woff2
    • StyreneA-ThinItalic-Web.woff2
  • style.css
  • update_node_tables.sh

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/example-status/java-status.md‎

Copy file name to clipboard
+40Lines changed: 40 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## ✅ Java example passed
2+
- Timestamp (UTC): 2025-10-19 16:10:35Z
3+
- Network: local
4+
5+
<details><summary>Output</summary>
6+
=== Java Examples Runner ===
7+
Timestamp (UTC): 2025-10-19 16:09:52Z
8+
Network: local
9+
Mirror: http://localhost:8080/api/v1
10+
11+
▶️ Running all examples…
12+
13+
Hedera account created: 0.0.1032
14+
EVM Address: 0xdd9f6d1d356a8b8a77b916c37d2278edb08feb15
15+
16+
17+
Waiting for Mirror Node to update...
18+
19+
Account balance: 20.0 ?
20+
21+
0.0.1012
22+
23+
Fungible token created: 0.0.1033
24+
25+
Waiting for Mirror Node to update...
26+
27+
Treasury holds: 100000 DEMO
28+
29+
30+
Topic created: 0.0.1034
31+
32+
Message submitted: Hello, Hedera!
33+
34+
Waiting for Mirror Node to update...
35+
36+
Latest message: Hello, Hedera!
37+
38+
39+
✅ All examples passed.
40+
</details>
Collapse file

‎.github/examples/java/CreateAccountDemo.java‎

Copy file name to clipboard
+67Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import com.hedera.hashgraph.sdk.*;
2+
import java.net.http.*;
3+
import java.net.URI;
4+
import com.google.gson.*;
5+
6+
public class CreateAccountDemo {
7+
public static void main(String[] args) throws Exception {
8+
// .env-provided
9+
AccountId operatorId = AccountId.fromString(System.getenv("OPERATOR_ID"));
10+
PrivateKey operatorKey = PrivateKey.fromStringECDSA(System.getenv("OPERATOR_KEY"));
11+
12+
String network = System.getenv().getOrDefault("HEDERA_NETWORK", "local");
13+
String mirrorNodeUrl = System.getenv().getOrDefault(
14+
"MIRROR_NODE_URL",
15+
"http://localhost:8080/api/v1"
16+
);
17+
18+
if (operatorId == null || operatorKey == null) {
19+
throw new IllegalStateException("OPERATOR_ID / OPERATOR_KEY not set");
20+
}
21+
22+
Client client =
23+
"local".equalsIgnoreCase(network)
24+
? Client.forNetwork(java.util.Map.of("127.0.0.1:50211", new AccountId(3)))
25+
: Client.forTestnet();
26+
27+
client.setOperator(operatorId, operatorKey);
28+
29+
PrivateKey newPrivateKey = PrivateKey.generateECDSA();
30+
PublicKey newPublicKey = newPrivateKey.getPublicKey();
31+
32+
AccountCreateTransaction transaction = new AccountCreateTransaction()
33+
.setKeyWithAlias(newPublicKey)
34+
.setInitialBalance(new Hbar(20));
35+
36+
TransactionResponse txResponse = transaction.execute(client);
37+
TransactionReceipt receipt = txResponse.getReceipt(client);
38+
AccountId newAccountId = receipt.accountId;
39+
40+
System.out.println("\nHedera account created: " + newAccountId);
41+
System.out.println("EVM Address: 0x" + newPublicKey.toEvmAddress() + "\n");
42+
43+
System.out.println("\nWaiting for Mirror Node to update...\n");
44+
Thread.sleep(10000);
45+
46+
String url = mirrorNodeUrl + "/balances?account.id=" + newAccountId;
47+
48+
HttpClient httpClient = HttpClient.newHttpClient();
49+
HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url)).build();
50+
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
51+
52+
Gson gson = new Gson();
53+
JsonObject data = gson.fromJson(response.body(), JsonObject.class);
54+
55+
if (data.has("balances") && data.getAsJsonArray("balances").size() > 0) {
56+
JsonArray balances = data.getAsJsonArray("balances");
57+
JsonObject accountBalance = balances.get(0).getAsJsonObject();
58+
long tinybars = accountBalance.get("balance").getAsLong();
59+
double hbar = tinybars / 100_000_000.0;
60+
System.out.println("Account balance: " + hbar + " ℏ\n");
61+
} else {
62+
System.out.println("Account balance not yet available in Mirror Node");
63+
}
64+
65+
client.close();
66+
}
67+
}
Collapse file

‎.github/examples/java/CreateTokenDemo.java‎

Copy file name to clipboard
+89Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import com.hedera.hashgraph.sdk.*;
2+
import java.net.http.*;
3+
import java.net.URI;
4+
import com.google.gson.*;
5+
6+
public class CreateTokenDemo {
7+
public static void main(String[] args ) throws Exception {
8+
// .env-provided
9+
AccountId operatorId = AccountId.fromString(System.getenv("OPERATOR_ID"));
10+
PrivateKey operatorKey = PrivateKey.fromStringECDSA(System.getenv("OPERATOR_KEY"));
11+
String network = System.getenv().getOrDefault("HEDERA_NETWORK", "local"); // "local" for Solo
12+
String mirrorNode = System.getenv().getOrDefault(
13+
"MIRROR_NODE_URL",
14+
"http://localhost:8080/api/v1"
15+
);
16+
17+
if (operatorId == null || operatorKey == null) {
18+
throw new IllegalStateException("OPERATOR_ID / OPERATOR_KEY not set");
19+
}
20+
21+
Client client =
22+
"local".equalsIgnoreCase(network)
23+
? Client.forNetwork(java.util.Map.of("127.0.0.1:50211", new AccountId(3))) // Solo default node + node account (adjust if needed)
24+
: Client.forTestnet();
25+
26+
client.setOperator(operatorId, operatorKey);
27+
System.out.println(operatorId);
28+
29+
// generate token keys
30+
PrivateKey supplyKey = PrivateKey.generateECDSA();
31+
PrivateKey adminKey = supplyKey;
32+
33+
// build & execute the token creation transaction
34+
TokenCreateTransaction transaction = new TokenCreateTransaction()
35+
.setTokenName("Demo Token")
36+
.setTokenSymbol("DEMO")
37+
.setDecimals(2)
38+
.setInitialSupply(100_000)
39+
.setSupplyType(TokenSupplyType.FINITE)
40+
.setMaxSupply(100_000)
41+
.setTreasuryAccountId(operatorId)
42+
.setAdminKey(adminKey.getPublicKey())
43+
.setSupplyKey(supplyKey.getPublicKey())
44+
.setTokenMemo("Created via tutorial")
45+
.freezeWith(client);
46+
47+
TokenCreateTransaction signedTx = transaction.sign(adminKey);
48+
TransactionResponse txResponse = signedTx.execute(client);
49+
TransactionReceipt receipt = txResponse.getReceipt(client);
50+
TokenId tokenId = receipt.tokenId;
51+
52+
System.out.println("\nFungible token created: " + tokenId );
53+
54+
// Wait for Mirror Node to populate data
55+
System.out.println("\nWaiting for Mirror Node to update...");
56+
Thread.sleep(10000);
57+
58+
// query balance using Mirror Node
59+
String mirrorNodeUrl = String.format(
60+
"%s/accounts/%s/tokens?token.id=%s",
61+
mirrorNode, operatorId, tokenId
62+
);
63+
64+
HttpClient httpClient = HttpClient.newHttpClient( );
65+
HttpRequest request = HttpRequest.newBuilder().uri(URI.create(mirrorNodeUrl)).build();
66+
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString( ));
67+
68+
try {
69+
if (response.statusCode() != 200) {
70+
System.out.println("Mirror Node returned status " + response.statusCode() + ". Skipping balance read.");
71+
} else {
72+
JsonObject data = new Gson().fromJson(response.body(), JsonObject.class);
73+
JsonArray tokens = (data != null) ? data.getAsJsonArray("tokens") : null;
74+
75+
if (tokens != null && tokens.size() > 0) {
76+
long balance = tokens.get(0).getAsJsonObject().get("balance").getAsLong();
77+
System.out.println("\nTreasury holds: " + balance + " DEMO\n");
78+
} else {
79+
System.out.println("Token balance not yet available in Mirror Node");
80+
}
81+
}
82+
} catch (Exception e) {
83+
System.out.println("Error reading token balance from Mirror Node: " + e.getMessage());
84+
// continue without failing
85+
}
86+
87+
client.close();
88+
}
89+
}
Collapse file

‎.github/examples/java/CreateTopicDemo.java‎

Copy file name to clipboard
+77Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import com.hedera.hashgraph.sdk.*;
2+
import java.net.http.*;
3+
import java.net.URI;
4+
import com.google.gson.*;
5+
6+
public class CreateTopicDemo {
7+
public static void main(String[] args ) throws Exception {
8+
// .env-provided
9+
AccountId operatorId = AccountId.fromString(System.getenv("OPERATOR_ID"));
10+
PrivateKey operatorKey = PrivateKey.fromStringECDSA(System.getenv("OPERATOR_KEY"));
11+
String network = System.getenv().getOrDefault("HEDERA_NETWORK", "local");
12+
String mirrorNode = System.getenv().getOrDefault(
13+
"MIRROR_NODE_URL",
14+
"http://localhost:8080/api/v1"
15+
);
16+
17+
if (operatorId == null || operatorKey == null) {
18+
throw new IllegalStateException("OPERATOR_ID / OPERATOR_KEY not set");
19+
}
20+
21+
Client client =
22+
"local".equalsIgnoreCase(network)
23+
? Client.forNetwork(java.util.Map.of("127.0.0.1:50211", new AccountId(3)))
24+
: Client.forTestnet();
25+
26+
client.setOperator(operatorId, operatorKey);
27+
// build & execute the topic creation transaction
28+
TopicCreateTransaction transaction = new TopicCreateTransaction()
29+
.setTopicMemo("My first HCS topic");
30+
31+
TransactionResponse txResponse = transaction.execute(client);
32+
TransactionReceipt receipt = txResponse.getReceipt(client);
33+
TopicId topicId = receipt.topicId;
34+
35+
System.out.println("\nTopic created: " + topicId);
36+
37+
// build & execute the message submission transaction
38+
String message = "Hello, Hedera!";
39+
40+
TopicMessageSubmitTransaction messageTransaction = new TopicMessageSubmitTransaction()
41+
.setTopicId(topicId)
42+
.setMessage(message);
43+
44+
messageTransaction.execute(client);
45+
46+
System.out.println("\nMessage submitted: " + message);
47+
48+
// wait for Mirror Node to populate data
49+
System.out.println("\nWaiting for Mirror Node to update...");
50+
Thread.sleep(10000);
51+
52+
// query messages using Mirror Node
53+
String mirrorNodeUrl = mirrorNode + "/topics/" + topicId + "/messages";
54+
55+
HttpClient httpClient = HttpClient.newHttpClient( );
56+
HttpRequest request = HttpRequest.newBuilder()
57+
.uri(URI.create(mirrorNodeUrl))
58+
.build();
59+
60+
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString( ));
61+
Gson gson = new Gson();
62+
JsonObject data = gson.fromJson(response.body(), JsonObject.class);
63+
64+
if (data.has("messages") && data.getAsJsonArray("messages").size() > 0) {
65+
JsonArray messages = data.getAsJsonArray("messages");
66+
JsonObject latestMessage = messages.get(messages.size() - 1).getAsJsonObject();
67+
String encodedMessage = latestMessage.get("message").getAsString();
68+
String messageContent = new String(java.util.Base64.getDecoder().decode(encodedMessage)).trim();
69+
70+
System.out.println("\nLatest message: " + messageContent + "\n");
71+
} else {
72+
System.out.println("No messages found yet in Mirror Node");
73+
}
74+
75+
client.close();
76+
}
77+
}
Collapse file

‎.github/scripts/java-gradle-bootstrap.sh‎

Copy file name to clipboard
+105Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cat > build.gradle <<'EOF'
5+
plugins {
6+
id 'java'
7+
}
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
dependencies {
14+
implementation 'com.hedera.hashgraph:sdk:2.60.0'
15+
implementation 'com.google.code.gson:gson:2.11.0'
16+
implementation 'io.grpc:grpc-netty-shaded:1.61.0'
17+
runtimeOnly 'org.slf4j:slf4j-simple:2.0.13'
18+
}
19+
20+
/**
21+
* Define an 'examples' source set for .github/examples/java.
22+
*/
23+
sourceSets {
24+
examples {
25+
java.srcDirs = ['.github/examples/java']
26+
// Add main's compiled classes to examples' classpaths
27+
compileClasspath += sourceSets.main.output + configurations.examplesCompileClasspath
28+
runtimeClasspath += output + sourceSets.main.output + configurations.examplesRuntimeClasspath
29+
}
30+
}
31+
32+
configurations {
33+
examplesImplementation.extendsFrom implementation
34+
examplesRuntimeOnly.extendsFrom runtimeOnly
35+
}
36+
37+
def examplesDir = file('.github/examples/java')
38+
39+
// Derive a fully-qualified class name from a .java file by reading its 'package ...;' line
40+
def fqnFor = { File f ->
41+
def pkgLine = f.readLines().find { it =~ /^\s*package\s+[\w\.]+\s*;/ }
42+
def pkg = pkgLine ? pkgLine.replaceAll(/^\s*package\s+/, '').replace(';','').trim() : null
43+
def cls = f.name.replaceFirst(/\.java$/, '')
44+
pkg ? "${pkg}.${cls}" : cls
45+
}
46+
47+
def exampleFiles = examplesDir.exists()
48+
? fileTree(examplesDir) { include '**/*.java' }.files
49+
: [] as Set<File>
50+
51+
/**
52+
* Run a single example
53+
*/
54+
tasks.register('runExample', JavaExec) {
55+
group = 'examples'
56+
description = 'Run a single Java example (use -PexampleClass=<FQN>)'
57+
// Use the examples source set's runtime classpath
58+
classpath = sourceSets.examples.runtimeClasspath
59+
60+
doFirst {
61+
if (!project.hasProperty('exampleClass')) {
62+
throw new GradleException("Missing -PexampleClass=<fully.qualified.ClassName>")
63+
}
64+
// Set to a concrete String value at execution time
65+
mainClass.set(project.property('exampleClass').toString())
66+
}
67+
}
68+
69+
// Create a JavaExec task per discovered example: run_<FQN with dots replaced by underscores>
70+
exampleFiles.each { f ->
71+
def fqn = fqnFor(f)
72+
tasks.register("run_${fqn.replace('.', '_')}", JavaExec) {
73+
group = 'examples'
74+
description = "Run example ${fqn}"
75+
classpath = sourceSets.examples.runtimeClasspath
76+
mainClass.set(fqn)
77+
}
78+
}
79+
80+
// Aggregate task: run all discovered examples
81+
tasks.register('runAllExamples') {
82+
group = 'examples'
83+
description = 'Run all Java examples in .github/examples/java'
84+
dependsOn tasks.matching { it.name.startsWith('run_') }
85+
}
86+
EOF
87+
88+
echo "rootProject.name = 'docs-examples-runner'" > settings.gradle
89+
90+
# Gradle wrapper
91+
if [ ! -f gradle/wrapper/gradle-wrapper.jar ]; then
92+
curl -sL https://services.gradle.org/distributions/gradle-8.9-bin.zip -o gradle.zip
93+
unzip -q gradle.zip -d .gradle
94+
rm -f gradle.zip
95+
96+
GRADLE_HOME="$(find .gradle -maxdepth 1 -type d -name 'gradle-8.9' | head -n1)"
97+
if [ -z "${GRADLE_HOME:-}" ]; then
98+
echo "Failed to locate Gradle distribution in .gradle"; exit 1
99+
fi
100+
101+
"${GRADLE_HOME}/bin/gradle" -q wrapper
102+
fi
103+
104+
chmod +x gradlew
105+
echo "✅ Gradle bootstrap complete"

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.