Prerequisites
- Go 1.21 or later
- A Hedera testnet account with ECDSA keys from the developer portal
Step 1: Initialize the module and install the SDK
Step 2: Credentials
Create a.env file (and add it to .gitignore):
OPERATOR_ID is your Hedera account ID. OPERATOR_KEY is the DER-encoded ECDSA private key; use the HEX Encoded Private Key value from the developer portal.
Step 3: Connect, query, transfer
Createmain.go:
Step 4: Run it
What’s next
Create an Account
Generate a new account programmatically and fund it from your operator.
Create a Token
Mint a native HTS token with custom supply and decimals.
Submit to a Topic
Publish a message to HCS for verifiable, ordered audit logs.
SDK Reference
Full API reference on GitHub.