How tablelandnetwork/go-tableland works
Tableland Validator materializes SQL mutations emitted by Tableland contracts on EVM chains and serves read queries over HTTP. The main workflow is: contract events are detected, validated and executed against SQLite; clients then query the materialized tables through the REST API. The repository also includes client-side contract operations, backups and telemetry. Connections for event ingestion and API assembly are based on README descriptions and the sampled entry point; unsampled implementation details are not expanded.
Main entry points: main.go Validator process · impl Transaction executor · gateway.go Query gateway · eventprocessor.go Event processor
Components 20
Chain ingestion
- Event feed
pkg/eventprocessor/eventfeed/impl/eventfeed.go - Event processor
pkg/eventprocessor/impl/eventprocessor.go
SQL execution
- Transaction executor
pkg/eventprocessor/impl/executor/impl - SQL validator
pkg/parsing/impl/validator.go - Access control
internal/tableland/acl.go - SQLite database
pkg/database/sqlite_db.go
Read API
- HTTP router
internal/router/router.go - API controller
internal/router/controllers/controller.go - Query gateway
internal/gateway/gateway.go - Gateway store
internal/gateway/impl/gateway_store.go
Operations and observability
- Validator process
cmd/api/main.go - Backup service
pkg/backup/backuper.go - Telemetry storage
pkg/telemetry/storage/db.go - Metrics hub
cmd/metricshub/main.go
Client tooling
- Go client
pkg/client/v1/client.go - Contract client
pkg/tables/impl/ethereum/client.go - Health bot
cmd/healthbot/main.go
Other components
- Node operator
- Application user
- EVM chain
Connections 24
- Node operator → Validator process: runs node
README.md - Application user → EVM chain: submits mutations
README.md - EVM chain → Event feed: emits events
README.md - Event feed → Event processor: delivers events
- Event processor → Transaction executor: dispatches events
- Transaction executor → SQL validator: validates SQL
- Transaction executor → Access control: checks permissions
- Transaction executor → SQLite database: executes mutations
README.md - Application user → HTTP router: sends query
README.md - HTTP router → API controller: routes requests
internal/router/router.go - API controller → Query gateway: runs query
internal/router/controllers/controller.go - Query gateway → SQL validator: validates reads
internal/gateway/gateway.go - Query gateway → Gateway store: delegates storage
- Gateway store → SQLite database: reads tables
- Validator process → Event processor: starts processor
cmd/api/main.go - Validator process → HTTP router: starts HTTP API
cmd/api/main.go - Validator process → Backup service: starts backups
cmd/api/main.go - Validator process → Telemetry storage: sets up telemetry
- Metrics hub → Telemetry storage: stores metrics
- Application user → Go client: uses client
- Go client → Contract client: submits transactions
- Contract client → EVM chain: calls contract
- Node operator → Health bot: runs probe
- Health bot → Go client: creates client
cmd/healthbot/main.go