Contributions are welcome — new examples, bug fixes, and improvements to existing ones.
- Go 1.26+
goimportsgolangci-lint— install viabrew install golangci-lintor from the official install page (avoidcurl | shin production environments)
cp .env.example .env
# Add TRONGRID_API_KEY and TRON_PRIVATE_KEY to .envmake fmt # format with goimports
make lint # run golangci-lint
make build # compile all examples
make check # fmt-check + lint + build (runs in CI)- Create
examples/{name}/main.goas apackage main - Use shared helpers from
utils/(connection, formatting, signing) - Add a
run/{name}target to theMakefile - Keep the example focused on a single SDK feature
- Support a
-dryrunflag for write operations
- Use
log.Fatalfor unrecoverable errors in examples - Load credentials from
.envvia theutilspackage (auto-loaded viainit()) - Never hardcode private keys or API keys
- Write operations must support
-dryrun(sign but do not broadcast) - Always pass a
feeLimitwhen callingTriggerContract
- Run
make checkbefore opening a PR - Keep each PR focused on one example or fix
- Include example output in the PR description if adding a new example
Open a GitHub issue with:
- Go version (
go version) - The command you ran
- The full error output