Local dev environment setup
Setting up a local development environment involves a few key steps. First, cloning the repository gives you access to the complete source code, including examples and tests. The go mod download command then fetches all required dependencies. The provided.env.example file serves as a template for your configuration. Copying this to .env and filling in your details ensures the SDK has the necessary credentials to interact with the Autheo network. This file should never be committed to version control.
For contributors, this setup also enables running the full test suite and experimenting with changes before submitting pull requests. The included Makefile provides convenient shortcuts for common development tasks.
Rebuilding protobufs (if modifying SDK internals)
Protocol Buffers (protobufs) are used internally for efficient network communication. While most users won’t need to regenerate these files, doing so is necessary when modifying the communication protocol or contributing changes to these definitions. The process requires the protobuf compiler (protoc) and Go plugins. The Makefile includes a ‘proto’ target that automates generation once these tools are installed. This ensures consistency in how protocol buffer messages are generated across different development environments. When working with protocol buffers, it’s important to maintain backward compatibility when making changes, as these definitions are used for communication between different components of the Autheo ecosystem.IDE integration (recommended for VS Code)
Proper IDE configuration significantly enhances the development experience. The recommended settings enable features like automatic imports, code formatting, and linting. These tools help maintain code quality and consistency across projects using the SDK. The Go language server provides intelligent code completion and navigation, making it easier to explore the SDK’s capabilities. Linting catches potential issues early, while goimports ensures proper formatting and import organization. These tools are particularly valuable given the SDK’s comprehensive API. They help developers discover available methods and understand their signatures without constantly referring to documentation. Make sure you have:Using the REST and JSON-RPC clients
The Autheo Go SDK provides two main ways to communicate with the Autheo blockchain:- REST client: Great for API endpoints
- JSON-RPC client: Ideal for lower level, Ethereum style interaction
REST client
Use this when you want to call traditional HTTPS endpoints (e.g., /blocks, /addresses, /withdrawals, etc.)Creating a REST client
Custom options
JSON-RPC client
Use this when you want to talk directly to a blockchain node using methods likeeth_getBalance, eth_blockNumber, or eth_sendTransaction.