{"id":20834002,"url":"https://github.com/trueblocks/trueblocks-examples","last_synced_at":"2026-04-22T15:34:17.095Z","repository":{"id":234939318,"uuid":"789772939","full_name":"TrueBlocks/trueblocks-examples","owner":"TrueBlocks","description":"Examples repo for TrueBlocks core","archived":false,"fork":false,"pushed_at":"2025-03-10T02:16:35.000Z","size":16018,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T03:30:15.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrueBlocks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-21T14:18:39.000Z","updated_at":"2025-01-31T07:16:01.000Z","dependencies_parsed_at":"2024-09-14T11:22:31.774Z","dependency_job_id":"592a2494-71ab-4527-9d07-5085bdbfac71","html_url":"https://github.com/TrueBlocks/trueblocks-examples","commit_stats":null,"previous_names":["trueblocks/trueblocks-examples"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBlocks%2Ftrueblocks-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBlocks%2Ftrueblocks-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBlocks%2Ftrueblocks-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrueBlocks%2Ftrueblocks-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrueBlocks","download_url":"https://codeload.github.com/TrueBlocks/trueblocks-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243188203,"owners_count":20250453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T00:17:46.189Z","updated_at":"2025-12-24T15:56:44.682Z","avatar_url":"https://github.com/TrueBlocks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Examples\n\nThis directory contains examples demonstrating how to use the TrueBlocks core SDK for various blockchain data tasks.\n\n## Overview\n\nThese examples showcase different features and capabilities of TrueBlocks, helping developers understand how to:\n\n- Query and analyze blockchain data\n- Work with addresses, transactions, and blocks\n- Efficiently index and retrieve on-chain information\n- Implement common blockchain data patterns\n\n## Available Examples\n\n- **balanceChart** - Generate charts showing ETH balance changes over time\n- **cancelContext** - Demonstrate context cancellation for long-running operations\n- **chainList** - List and display information about supported chains\n- **checkNodes** - Verify and check node connectivity and status\n- **comparison** - Compare data between different sources or time periods  \n- **findFirst** - Find the first occurrence of specific blockchain events\n- **four_bytes** - Work with four-byte function signatures and method IDs\n- **keystore** - Manage and work with Ethereum keystore files\n- **monitorService** - Monitor blockchain addresses and events\n- **nameManager** - Work with ENS names and address resolution\n- **simple** - Basic example showing fundamental SDK usage\n- **withStreaming** - Demonstrate streaming data capabilities\n\n## Running Examples\n\nMost examples can be run with:\n\n```bash\ncd example-directory\ngo run .\n```\n\n## Creating New Examples\n\n### For Development/Testing (Local Branch)\n\nWhen creating examples to test new features on a local branch:\n\n1. **Create from template:**\n   ```bash\n   cd examples\n   chifra init --example your-example-name\n   ```\n\n2. **Add local replace directives** to the generated `go.mod`:\n   ```go\n   replace github.com/TrueBlocks/trueblocks-sdk/v6 =\u003e ../sdk\n   replace github.com/TrueBlocks/trueblocks-chifra/v6 =\u003e ../chifra\n   ```\n\n3. **Add to .gitignore** to prevent breaking CI:\n   ```bash\n   echo \"your-example-name/\" \u003e\u003e .gitignore\n   ```\n\n4. **Update go.work:**\n   ```bash\n   cd ..\n   ./scripts/go-work-sync.sh\n   ```\n\n### For Production (Ready to Commit)\n\nWhen your example is ready for production:\n\n1. **Remove replace directives** from `go.mod`\n2. **Remove from .gitignore** \n3. **Run go-work-sync.sh** to update dependencies to published versions\n4. **Test the example** works with published dependencies\n5. **Commit and submit PR**\n\n## Dependencies\n\nTo run these examples, you'll need:\n\n1. TrueBlocks core installed\n2. Access to an Ethereum node (local or remote)\n3. Any additional dependencies specified in the example's README\n\n## Important Notes\n\n- **Development Examples**: Examples with `replace` directives in `go.mod` should be in `.gitignore`\n- **CI/CD**: Examples committed to the repo must use published dependencies only\n- **go.work**: Always run `./scripts/go-work-sync.sh` after adding new examples\n- **Testing**: Test examples work with both local and published dependencies\n\n## Documentation\n\nFor more detailed information, visit the [TrueBlocks documentation](https://trueblocks.io/docs/).\n\n## Contributing\n\nWe welcome contributions! When adding new examples:\n\n1. Follow the development process above\n2. Ensure examples work with published dependencies\n3. Include a README.md explaining the example's purpose\n4. Add appropriate error handling and comments\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrueblocks%2Ftrueblocks-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrueblocks%2Ftrueblocks-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrueblocks%2Ftrueblocks-examples/lists"}