### Expected Output of Java Quickstart Source: https://docs.hedera.com/native/quickstart/java This is the typical output you should see when running the Java quickstart example successfully, showing your balance and the transfer status. ```text Operator balance: 10000 ℏ Transfer status: SUCCESS Transaction ID: 0.0.1234@1700000000.123456789 ``` -------------------------------- ### Start Stablecoin CLI Configuration Wizard Source: https://docs.hedera.com/solutions/tokenization/stablecoin/cli Navigate to the CLI directory and run the 'wizard' command to initiate the configuration process. This will guide you through setting up your default network, accounts, and other essential parameters. ```bash cd stablecoin-studio/cli accelerator wizard ``` -------------------------------- ### Hedera Local Node Start Output Example Source: https://docs.hedera.com/native/local-dev/setup-cli-npm Example output observed in the terminal when starting the Hedera local node, including build process and initialization logs. ```bash hedera-local-node % npm run start > @hashgraph/hedera-local@2.26.2 restart > npm run build && node ./build/index.js restart > @hashgraph/hedera-local@2.26.2 build > rimraf ./build && tsc [Hedera-Local-Node] INFO (StateController) [✔︎] Starting restart procedure! [Hedera-Local-Node] INFO (CleanUpState) ⏳ Initiating clean up procedure. Trying to revert unneeded changes to files... [Hedera-Local-Node] INFO (CleanUpState) [✔︎] Clean up of consensus node properties finished. [Hedera-Local-Node] INFO (CleanUpState) [✔︎] Clean up of mirror node properties finished. [Hedera-Local-Node] INFO (StopState) ⏳ Initiating stop procedure. Trying to stop docker containers and clean up volumes... [Hedera-Local-Node] INFO (StopState) ⏳ Stopping the network... [Hedera-Local-Node] INFO (StopState) [✔︎] Hedera Local Node was stopped successfully. [Hedera-Local-Node] INFO (InitState) ⏳ Making sure that Docker is started and it is correct version... [Hedera-Local-Node] INFO (DockerService) ⏳ Checking docker compose version... [Hedera-Local-Node] INFO (DockerService) ⏳ Checking docker resources... [Hedera-Local-Node] WARNING (DockerService) [!] Port 3000 is in use. [Hedera-Local-Node] INFO (InitState) ⏳ Setting configuration with latest images on host 127.0.0.1 with dev mode turned off using turbo mode in single node configuration... [Hedera-Local-Node] INFO (InitState) [✔︎] Local Node Working directory set to /Users/owanate/Library/Application Support/hedera-local. [Hedera-Local-Node] INFO (InitState) [✔︎] Hedera JSON-RPC Relay rate limits were disabled. [Hedera-Local-Node] INFO (InitState) [✔︎] Needed environment variables were set for this configuration. [Hedera-Local-Node] INFO (InitState) [✔︎] Needed bootsrap properties were set for this configuration. [Hedera-Local-Node] INFO (InitState) [✔︎] Needed bootsrap properties were set for this configuration. [Hedera-Local-Node] INFO (InitState) [✔︎] Needed mirror node properties were set for this configuration. [Hedera-Local-Node] INFO (StartState) ⏳ Starting Hedera Local Node... ``` -------------------------------- ### Check Prerequisites Setup Source: https://docs.hedera.com/native/tutorials/advanced/walletconnect-dapp Verify that Git, a code editor, Node.js, and npm are installed and accessible from your terminal. Ensure versions meet the minimum requirements. ```shell git --version code --version node --version npm --version ``` -------------------------------- ### Clone Project and Install Dependencies Source: https://docs.hedera.com/native/tutorials/advanced/javascript-testing Use these commands to clone the tutorial repository and install the necessary npm packages. Ensure you have Git and Node.js with npm installed. ```sh git clone git@github.com:hedera-dev/js-testing.git cd js-testing npm install ``` -------------------------------- ### Clone and Install Subgraph Project Source: https://docs.hedera.com/evm/tools/other/the-graph Clone the example subgraph repository, navigate into the directory, and install project dependencies using npm. ```bash git clone https://github.com/hashgraph/hedera-subgraph-example.git cd hedera-subgraph-example npm install ``` -------------------------------- ### Install pg_trgm PostgreSQL Extension Source: https://docs.hedera.com/learn/release-notes/mirror-node Install the pg_trgm extension on the mirror_node database. This is required for querying tokens by name starting from v0.110.0. ```sql create extension if not exists pg_trgm; ``` -------------------------------- ### Get Block by Hash or Number REST API Response Source: https://docs.hedera.com/learn/release-notes/mirror-node Example response from the GET /api/v1/blocks/{hashOrNumber} endpoint, returning details for a single block. ```json { "count": 4, "gas_limit": 150000000, "gas_used": 50000000, "hapi_version": "0.24.0", "hash": "0xa4ef824cd63a325586bfe1a66396424cd33499f895db2ce2292996e2fc5667a69d83a48f3883f2acab0edfb6bfeb23c4", "logs_bloom": "0x549358c4c2e573e02410ef7b5a5ffa5f36dd7398", "name": "2022-04-07T16_59_23.159846673Z.rcd", "number": 19533336, "previous_hash": "0x4fbcefec4d07c60364ac42286d5dd989bc09c57acc7370b46fa8860de4b8721e63a5ed46addf1564e4f8cd7b956a5afa", "size": 8489, "timestamp": { "from": "1649350763.159846673" "to": "1649350763.382130000" } } ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://docs.hedera.com/native/tutorials/consensus/batch-anchor-verify Clone the tutorial repository and install necessary Node.js dependencies. ```bash git clone https://github.com/hedera-dev/tutorial-hcs-batching-hashing-verifying-js.git cd tutorial-hcs-batching-hashing-verifying-js npm install ``` -------------------------------- ### Network Exchange Rate REST API Response Source: https://docs.hedera.com/learn/release-notes/mirror-node Example response from the GET /api/v1/network/exchangerate endpoint, showing current and next exchange rates. ```json { "current_rate": { "cent_equivalent": 596987 "expiration_time": 1649689200 "hbar_equivalent": 30000 }, "next_rate": { "cent_equivalent": 594920 "expiration_time": 1649692800 "hbar_equivalent": 30000 }, "timestamp": "1649689200.123456789" } ``` -------------------------------- ### List Blocks REST API Response Source: https://docs.hedera.com/learn/release-notes/mirror-node Example response from the GET /api/v1/blocks endpoint, showing block details including gas usage, hash, and timestamp. ```json { "blocks": [{ "count": 4, "gas_limit": 150000000, "gas_used": 50000000, "hapi_version": "0.24.0", "hash": "0xa4ef824cd63a325586bfe1a66396424cd33499f895db2ce2292996e2fc5667a69d83a48f3883f2acab0edfb6bfeb23c4", "logs_bloom": "0x549358c4c2e573e02410ef7b5a5ffa5f36dd7398", "name": "2022-04-07T16_59_23.159846673Z.rcd", "number": 19533336, "previous_hash": "0x4fbcefec4d07c60364ac42286d5dd989bc09c57acc7370b46fa8860de4b8721e63a5ed46addf1564e4f8cd7b956a5afa", "size": 8489, "timestamp": { "from": "1649350763.159846673", "to": "1649350763.382130000" } }], "links": { "next": null } } ``` -------------------------------- ### REST API Example with Repeatable Account IDs Source: https://docs.hedera.com/learn/release-notes/mirror-node This example demonstrates how to use repeatable `account.id` query parameters in the REST API to filter for multiple accounts. This functionality is useful for retrieving information about specific accounts in a single request. ```http GET /api/v1/accounts?account.id=0.0.7&account.id=0.0.9 ``` -------------------------------- ### Retrieve Contract Information Source: https://docs.hedera.com/learn/release-notes/mirror-node Example of how to retrieve specific contract details using the REST API. Replace {id} with the actual contract ID. ```json { "admin_key": { "_type": "ProtobufEncoded", "key": "7b2233222c2233222c2233227d" }, "auto_renew_period": 7776000, "bytecode": "0xc896c66db6d98784cc03807640f3dfd41ac3a48c", "contract_id": "0.0.10001", "created_timestamp": "1633466229.96874612", "deleted": false, "expiration_timestamp": "1633466229.96874612", "file_id": "0.0.1000", "memo": "First contract", "obtainer_id": "0.0.101", "proxy_account_id": "0.0.100", "solidity_address": "0x00000000000000000000000000000000000003E9", "timestamp": { "from": "1633466229.96874612", "to": "1633466568.31556926" } } ``` -------------------------------- ### Run Java Quickstart with Maven Source: https://docs.hedera.com/native/quickstart/java Package your Java application into a JAR with dependencies and then execute it. This command assumes you are using Maven. ```bash # Maven (package as a JAR with dependencies, then run it) mvn package java -cp target/your-artifact-with-dependencies.jar HederaQuickstart ``` -------------------------------- ### Clone and Run Hedera Localnet Node Source: https://docs.hedera.com/evm/tools/foundry/setup Clone the Hiero Local Node repository, install dependencies, and start the local Hedera network. This setup includes a Consensus Node, Mirror Node, and JSON-RPC Relay. ```bash git clone https://github.com/hiero-ledger/hiero-local-node.git cd hiero-local-node npm install npm run start ``` -------------------------------- ### Configure Cloud Storage Failover Sources Source: https://docs.hedera.com/learn/release-notes/mirror-node Configure multiple cloud storage sources for the mirror node importer to ensure resiliency. The example shows a combination of GCP and S3 sources with specific connection and backoff settings. ```yaml hedera: mirror: importer: downloader: sources: - backoff: 30s connectionTimeout: 10s credentials: accessKey: secretKey: maxConcurrency: 50 projectId: myapp region: us-east-2 type: GCP uri: https://storage.googleapis.com - credentials: accessKey: secretKey: type: S3 ``` -------------------------------- ### Accounts Response with Repeatable ID Filtering Source: https://docs.hedera.com/learn/release-notes/mirror-node Example response for an accounts query using repeatable `account.id` parameters, showing details for multiple accounts including their balances and associated tokens. ```APIDOC { "accounts": [ { "balance": { "timestamp": "0.000002345", "balance": 70, "tokens": [ { "token_id": "0.0.100001", "balance": 7 }, { "token_id": "0.0.100002", "balance": 77 } ] }, "account": "0.0.7", "expiry_timestamp": null, "auto_renew_period": null, "key": null, "deleted": false }, { "balance": { "timestamp": "0.000002345", "balance": 90, "tokens": [] }, "account": "0.0.9", "expiry_timestamp": null, "auto_renew_period": null, "key": null, "deleted": false } ], "links": { "next": null } } ``` -------------------------------- ### Initialize Go Project and Install SDK Source: https://docs.hedera.com/learn/getting-started/create-portal-account Use these commands to initialize a new Go module, install the Hedera SDK, and tidy up dependencies. ```go-module go mod init create_account_demo go get github.com/hiero-ledger/hiero-sdk-go/v2@latest go mod tidy ``` -------------------------------- ### Account Token Relationships API Response Source: https://docs.hedera.com/learn/release-notes/mirror-node Example JSON response for the `/api/v1/accounts/{id}/tokens` endpoint, detailing associated fungible and non-fungible tokens with their metadata. ```json { "tokens": [{ "automatic_association": true, "balance": 15, "created_timestamp": "1234567890.000000002", "freeze_status": "UNFROZEN", "kyc_status": "GRANTED", "token_id": "0.0.1135" }], "links": { "next": null } } ``` -------------------------------- ### Get Network Fees Source: https://docs.hedera.com/learn/release-notes/mirror-node Retrieves network fees. This API has been rewritten in Java for improved performance. ```APIDOC ## GET /api/v1/network/fees ### Description Retrieves the network fees. This endpoint was rewritten in Java for an 8x performance improvement. ### Method GET ### Endpoint /api/v1/network/fees ### Parameters (No parameters detailed in source text) ### Response #### Success Response (200) - (Response structure not detailed in source text) ### Response Example (No example provided in source text) ``` -------------------------------- ### Get Account Tokens Source: https://docs.hedera.com/learn/release-notes/mirror-node Retrieves a list of fungible and non-fungible tokens associated with a particular account, including metadata like balance, KYC status, and freeze status. ```APIDOC ## GET /api/v1/accounts/{id}/tokens ### Description Retrieves a list of fungible and non-fungible tokens associated with a particular account, including metadata like balance, KYC status, and freeze status. ### Method GET ### Endpoint /api/v1/accounts/{id}/tokens ### Parameters #### Path Parameters - **id** (string) - Required - The account ID to query. ### Response #### Success Response (200) - **tokens** (array) - A list of token objects. - **automatic_association** (boolean) - Indicates if the token was automatically associated. - **balance** (integer) - The balance of the token for the account. - **created_timestamp** (string) - The timestamp when the token was created. - **freeze_status** (string) - The freeze status of the token for the account (e.g., UNFROZEN). - **kyc_status** (string) - The KYC status of the token for the account (e.g., GRANTED). - **token_id** (string) - The ID of the token. - **links** (object) - Links for pagination. - **next** (string) - URL to the next page of results, or null if none. ### Response Example ```json { "tokens": [ { "automatic_association": true, "balance": 15, "created_timestamp": "1234567890.000000002", "freeze_status": "UNFROZEN", "kyc_status": "GRANTED", "token_id": "0.0.1135" } ], "links": { "next": null } } ``` ``` -------------------------------- ### Example API Call to Get Account by Public Key Source: https://docs.hedera.com/native/tutorials/getting-started/create-api-key An example of a curl command to get a specific account's details, including a sample public key and API token. ```bash curl https://portal.hedera.com/api/account/302d300706052b8104000a03220003aaec818ba60d7f4e259319804317820f7f4aba3d0048a2f43573ddbbfe9a2254 -H "Authorization: Bearer v4.public.eyJzdWIiOiI1M2RlMmI0MC1iOTNiLTExZWUtODk4NC1iYjdkMDE2NTU2ZGQiLCJpYXQiOiIyMDI0LTAxLTIyVDE1OjMyOjA2Ljk1MloiLCJqdGkiOiI2Njg4Nzc4Mi1iOTNiLTExZWUtYmRmYi05ZmEzMWI3Yjc0ZGIifYer-H5VVjpQloP2U4qwUBBSsb-SQFEYNSrr9-8pqsdouDeAp00AWeDre8eGKLEt32JfaQiJ8UrcJyTlwbLfiwk ``` -------------------------------- ### Run Java Quickstart with Gradle Source: https://docs.hedera.com/native/quickstart/java Execute your Java application using Gradle. This command is used after setting up your project with Gradle. ```bash # Gradle ./gradlew run ``` -------------------------------- ### Get NFTs by Token ID Source: https://docs.hedera.com/learn/release-notes/mirror-node Retrieves a list of NFTs associated with a specific token ID. ```APIDOC ## GET /api/v1/tokens/{token.id}/nfts ### Description Retrieves a list of NFTs for a particular token ID. ### Method GET ### Endpoint /api/v1/tokens/{token.id}/nfts ### Parameters #### Path Parameters - **token.id** (string) - Required - The ID of the token to retrieve NFTs for. ### Response #### Success Response (200) - **nfts** (array) - A list of NFT objects. - **account_id** (string) - The account ID holding the NFT. - **created_timestamp** (string) - The timestamp when the NFT was created. - **deleted** (boolean) - Indicates if the NFT has been deleted. - **metadata** (string) - The metadata associated with the NFT. - **modified_timestamp** (string) - The timestamp when the NFT was last modified. - **serial_number** (integer) - The serial number of the NFT. - **token_id** (string) - The ID of the token. - **links** (object) - Links for pagination. - **next** (string) - URL to the next page of results, or null if none. ### Response Example ```json { "nfts": [ { "account_id": "0.0.1002", "created_timestamp": "1234567890.000000010", "deleted": false, "metadata": "ahf=", "modified_timestamp": "1234567890.000000010", "serial_number": 2, "token_id": "0.0.1500" }, { "account_id": "0.0.1001", "created_timestamp": "1234567890.000000009", "deleted": false, "metadata": "bTM=", "modified_timestamp": "1234567890.000000008", "serial_number": 1, "token_id": "0.0.1500" } ], "links": { "next": null } } ``` ``` -------------------------------- ### Contract State API Response Source: https://docs.hedera.com/learn/release-notes/mirror-node Example JSON response for the `/api/v1/contracts/{id}/state` endpoint, showing the rolled-up view of smart contract state changes including slot keys and values. ```json { "state": [{ "address": "0x0000000000000000000000000000000000001f41", "contract_id": "0.0.100", "slot": "0x0000000000000000000000000000000000000000000000000000000000000001", "timestamp": "1676540001.234390005", "value": "0x0000000000000000000000000000000000000000000000000000000000000010" }], "links": { "next": null } } ``` -------------------------------- ### Example REST API GET Request Source: https://docs.hedera.com/operators/mirror-node/one-click-deploy An example of how to submit a GET request to the mirror node's REST API directly from your browser or using a tool like curl. Replace '' with your actual mirror node endpoint. ```bash http:///api/v1/transactions ``` -------------------------------- ### Get Network Exchange Rate Source: https://docs.hedera.com/learn/release-notes/mirror-node Retrieves the network exchange rate. The JavaScript implementation has been removed in favor of the Java implementation. ```APIDOC ## GET /api/v1/network/exchangerate ### Description Retrieves the network exchange rate. The previous JavaScript implementation has been removed. ### Method GET ### Endpoint /api/v1/network/exchangerate ### Parameters (No parameters detailed in source text) ### Response #### Success Response (200) - (Response structure not detailed in source text) ### Response Example (No example provided in source text) ``` -------------------------------- ### Get Transaction Receipt in Rust Source: https://docs.hedera.com/native/transactions/receipt Retrieve the receipt for a transaction in Rust. This example shows how to get the receipt from a transaction response and print it. ```rust // Get the receipt of the transaction let receipt = tx_response.get_receipt(&client).await?; println!("The transaction receipt: {:?}", receipt); // v0.34.0 ``` -------------------------------- ### Create, Mint, and Transfer NFT (Go) Source: https://docs.hedera.com/native/tutorials/tokens/create-transfer-nft This comprehensive Go example covers creating accounts for treasury and Alice, defining and creating an NFT, minting a batch of NFTs with IPFS metadata, and preparing for transfer. It requires environment variables for operator credentials. ```go package main import ( "fmt" "os" hedera "github.com/hiero-ledger/hiero-sdk-go/v2/sdk" "github.com/joho/godotenv" ) func must[T any](v T, err error) T { if err != nil { panic(err) } return v } func main() { if err := godotenv.Load(".env"); err != nil { panic(fmt.Errorf("unable to load .env: %w", err)) } // Load operator credentials operatorID := must(hedera.AccountIDFromString(os.Getenv("OPERATOR_ID"))) operatorKey := must(hedera.PrivateKeyFromString(os.Getenv("OPERATOR_KEY"))) // Initialize Client client := hedera.ClientForTestnet() client.SetOperator(operatorID, operatorKey) client.SetDefaultMaxTransactionFee(hedera.NewHbar(20)) // Generate Treasury key reasuryKey := must(hedera.PrivateKeyGenerateEcdsa()) reasuryPublicKey := treasuryKey.PublicKey() // Create Treasury account reasuryCreate := must(hedera.NewAccountCreateTransaction(). SetECDSAKeyWithAlias(treasuryPublicKey). SetInitialBalance(hedera.NewHbar(20)). Execute(client)) reasuryReceipt := must(treasuryCreate.GetReceipt(client)) reasuryID := *treasuryReceipt.AccountID // Generate Alice's key aliceKey := must(hedera.PrivateKeyGenerateEcdsa()) alicePublicKey := aliceKey.PublicKey() // Create Alice's account aliceCreate := must(hedera.NewAccountCreateTransaction(). SetECDSAKeyWithAlias(alicePublicKey). SetInitialBalance(hedera.NewHbar(20)). Execute(client)) aliceReceipt := must(aliceCreate.GetReceipt(client)) aliceID := *aliceReceipt.AccountID // Generate supply key supplyKey := must(hedera.PrivateKeyGenerateEcdsa()) // Create the NFT nftCreate := must(hedera.NewTokenCreateTransaction(). SetTokenName("diploma"). SetTokenSymbol("GRAD"). SetTokenType(hedera.TokenTypeNonFungibleUnique). SetDecimals(0). SetInitialSupply(0). SetTreasuryAccountID(treasuryID). SetSupplyType(hedera.TokenSupplyTypeFinite). SetMaxSupply(250). SetSupplyKey(supplyKey). FreezeWith(client)) // Sign the transaction with the treasury key nftCreateSigned := nftCreate.Sign(treasuryKey) // Submit the transaction to a Hedera network nftCreateSubmit := must(nftCreateSigned.Execute(client)) // Get the transaction receipt nftCreateRx := must(nftCreateSubmit.GetReceipt(client)) // Get the token ID tokenID := *nftCreateRx.TokenID // Log the token ID fmt.Println("\nCreated NFT with token ID:", tokenID) // IPFS content identifiers for which we will create an NFT CID := [][]byte{ []byte("ipfs://bafyreiao6ajgsfji6qsgbqwdtjdu5gmul7tv2v3pd6kjgcw5o65b2ogst4/metadata.json"), []byte("ipfs://bafyreic463uarchq4mlufp7pvfkfut7zeqsqmn3b2x3jjxwcjqx6b5pk7q/metadata.json"), []byte("ipfs://bafyreihhja55q6h2rijscl3gra7a3ntiroyglz45z5wlyxdzs6kjh2dinu/metadata.json"), []byte("ipfs://bafyreidb23oehkttjbff3gdi4vz7mjijcxjyxadwg32pngod4huozcwphu/metadata.json"), []byte("ipfs://bafyreie7ftl6erd5etz5gscfwfiwjmht3b52cevdrf7hjwxx5ddns7zneu/metadata.json"), } // MINT NEW BATCH OF NFTs mintTx := must(hedera.NewTokenMintTransaction(). SetTokenID(tokenID). SetMetadatas(CID). FreezeWith(client)) // Sign the transaction with the supply key mintTxSign := must(mintTx.Sign(supplyKey)) // Submit the transaction to a Hedera network mintSubmit := must(mintTxSign.Execute(client)) // Get the transaction receipt mintRx := must(mintSubmit.GetReceipt(client)) ``` -------------------------------- ### Get NFT by Token ID and Serial Number Source: https://docs.hedera.com/learn/release-notes/mirror-node Retrieves a single NFT identified by its token ID and serial number. ```APIDOC ## GET /api/v1/tokens/{token.id}/nfts/{serial.number} ### Description Retrieves a single NFT by its token ID and serial number. ### Method GET ### Endpoint /api/v1/tokens/{token.id}/nfts/{serial.number} ### Parameters #### Path Parameters - **token.id** (string) - Required - The ID of the token. - **serial.number** (integer) - Required - The serial number of the NFT. ### Response #### Success Response (200) - **account_id** (string) - The account ID holding the NFT. - **created_timestamp** (string) - The timestamp when the NFT was created. - **deleted** (boolean) - Indicates if the NFT has been deleted. - **metadata** (string) - The metadata associated with the NFT. - **modified_timestamp** (string) - The timestamp when the NFT was last modified. - **serial_number** (integer) - The serial number of the NFT. - **token_id** (string) - The ID of the token. ### Response Example ```json { "account_id": "0.0.1001", "created_timestamp": "1234567890.000000008", "deleted": false, "metadata": "bTM=", "modified_timestamp": "1234567890.000000009", "serial_number": 1, "token_id": "0.0.1500" } ``` ``` -------------------------------- ### Contract Actions REST API Example Source: https://docs.hedera.com/learn/release-notes/mirror-node This payload demonstrates the structure of the contract actions REST API response, as detailed in HIP-513. It includes details about contract calls, including caller, recipient, gas usage, and results. ```json { "actions": [{ "call_depth": 1, "call_type": "CALL", "call_operation_type": "CALL", "caller": "0.0.5001", "caller_type": "CONTRACT", "from": "0x0000000000000000000000000000000000001389", "timestamp": "1676540001.234390005", "gas": 1000, "gas_used": 900, "index": 1, "input": "0xabcd", "to": "0x70f2b2914a2a4b783faefb75f459a580616fcb5e", "recipient": "0.0.8001", "recipient_type": "CONTRACT", "result_data": "0x1234", "result_data_type": "OUTPUT", "value": 100 }], "links": { "next": null } } ``` -------------------------------- ### Run Project with Go Source: https://docs.hedera.com/learn/getting-started/create-portal-account Execute your Go project to create an account. Ensure you have Go installed and the project file is named correctly. ```bash go run create_account_demo.go ``` -------------------------------- ### Account Hook Storage Response Source: https://docs.hedera.com/learn/release-notes/mirror-node Example response structure for retrieving storage state for a specific account hook. This is used by the new /api/v1/accounts/{id}/hooks/{hookId}/storage REST API. ```json { "hook_id": 1, "owner_id": "0.0.123", "storage": [ { "key": "0x0000000000000000000000000000000000000000000000000000000000000000", "value": "0x00000000000000000000000000000000000000000000000000000000000003e8", "timestamp": "1726874345.123456789" } ], "links": { "next": "/api/v1/accounts/0.0.123/hooks/1/storage?key=gt:0x0000000000000000000000000000000000000000000000000000000000000000&limit=1" } } ``` -------------------------------- ### Initialize Go Modules and Install SDK Source: https://docs.hedera.com/learn/getting-started/create-portal-account Initialize Go modules and install the Hedera Go SDK in your project's root directory. ```bash ``` ``` -------------------------------- ### Get Network Supply API Endpoint Source: https://docs.hedera.com/learn/release-notes/mirror-node This endpoint provides the released and total supply of Hedera. It allows users to query multiple mirror nodes for comparison or to run their own. ```json { "timestamp": "123456870.854775807", "released_supply": 1800000000000000000, "total_supply": 5000000000000000000 } ``` -------------------------------- ### Run the Go Hedera Quickstart Program Source: https://docs.hedera.com/native/quickstart/go Executes the Go program to interact with the Hedera testnet. ```bash go run main.go ``` -------------------------------- ### Install LangChain dependencies for v4 (Ollama) Source: https://docs.hedera.com/solutions/ai/agent-kit/js/migration-guide Install v4 dependencies for LangChain with Ollama. This is for local LLM setups and does not require an API key. ```bash # Local, no API key needed npm install @hiero-ledger/sdk @hashgraph/hedera-agent-kit @hashgraph/hedera-agent-kit-langchain @langchain/ollama dotenv ``` -------------------------------- ### Get Specific NFT by Token ID and Serial Number Source: https://docs.hedera.com/learn/release-notes/mirror-node Retrieves details for a single NFT identified by its token ID and serial number. Use this when you need information about a particular NFT. ```json { "account_id": "0.0.1001", "created_timestamp": "1234567890.000000008", "deleted": false, "metadata": "bTM=", "modified_timestamp": "1234567890.000000009", "serial_number": 1, "token_id": "0.0.1500" } ``` -------------------------------- ### Initialize Foundry Project Source: https://docs.hedera.com/evm/quickstart/deploy-with-foundry Sets up a new Foundry project with a standard directory structure. Navigate into the created directory to continue. ```bash forge init hedera-foundry-erc20-tutorial cd hedera-foundry-erc20-tutorial ``` -------------------------------- ### Install AI Provider Packages (LangChain v1) Source: https://docs.hedera.com/solutions/ai/agent-kit/python/quickstart Install the appropriate LangChain integration package for your chosen AI provider. The examples provided are for LangChain v1. ```bash # Option 1: OpenAI (requires API key) pip install langchain langchain-openai # Option 2: Anthropic Claude (requires API key) pip install langchain langchain-anthropic # Option 3: Groq (free tier available) pip install langchain langchain-groq # Option 4: Ollama (100% free, runs locally) pip install langchain langchain-ollama ``` -------------------------------- ### Go Client Setup from .env Source: https://docs.hedera.com/native/fundamentals/client Loads operator account ID and private key from a .env file using godotenv and initializes Hedera client credentials. ```go err := godotenv.Load(".env") if err != nil { panic(fmt.Errorf("Unable to load environment variables from demo.env file. Error:\n%v\n", err)) } //Get the operator account ID and private key OPERATOR_ID := os.Getenv("OPERATOR_ID") OPERATOR_KEY := os.Getenv("OPERATOR_KEY") myAccountID, err := hedera.AccountIDFromString(OPERATOR_ID) if err != nil { panic(err) } operatorKey, err := hedera.PrivateKeyFromString(OPERATOR_KEY) if err != nil { panic(err) } ``` -------------------------------- ### Example Contract Code Source: https://docs.hedera.com/api-reference/verify-contracts/verify-contract-using-solidity-metadatajson These are example Solidity smart contracts. The first contract demonstrates basic number setting and getting functionality, while the second contract manages ownership. ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Number { uint256 number; function setNumber(uint256 newNumber) public { number = newNumber; } function getNumber() public view returns (uint256) { return number; } } ``` ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Owner { address public owner; constructor() { owner = msg.sender; } } ``` -------------------------------- ### Start Local Hedera Network Source: https://docs.hedera.com/native/local-dev/setup-local-node Start the local Hedera network. The first command also generates the initial 30 accounts. Ensure Docker is installed and running. ```bash npm run start -- -d ``` ```bash docker compose up -d ``` -------------------------------- ### Start Virtual Machine with Vagrant Source: https://docs.hedera.com/native/tutorials/advanced/hcs-fabric-plugin/virtual-environment Navigate to the 'vagrant' directory and start the virtual machine using Vagrant. Then, SSH into the virtual machine to access the environment. ```bash cd vagrant vagrant up vagrant ssh ``` -------------------------------- ### Plugin README Template Usage Example Source: https://docs.hedera.com/solutions/ai/agent-kit/python/create-plugins Example of how to integrate a custom plugin within the Hedera Agent Kit, as shown in a plugin's README file. This includes installation and basic usage. ```python # pip install # Usage from hedera_agent_kit.langchain.toolkit import HederaLangchainToolkit from hedera_agent_kit.shared.configuration import Configuration, Context, AgentMode from import my_plugin hedera_toolkit = HederaLangchainToolkit( client=client, configuration=Configuration( context=Context( mode=AgentMode.AUTONOMOUS, ), plugins=[ my_plugin, ], ), ) tools = hedera_toolkit.get_tools() ``` -------------------------------- ### Deployment Output Example Source: https://docs.hedera.com/evm/tutorials/advanced/erc721-hardhat/part2-access-control Example output from running the deployment script, showing the deployer's account and the deployed contract address. ```bash Deploying contract with the account: 0xA98556A4deeB07f21f8a66093989078eF86faa30 Contract deployed at: 0x5f41411477b506FA32DFe3B73BEE52a3D80B755f ```