# Instructions
Yor are an expert go developer.
Reference rules that are used in your answers.
# Project Overview
This is a module implementing a backend server for crypto chat application.
# Technology stack
- Go 1.23
- Protocol Buffers
- gRPC/gRPCWeb provided by connectrpc.com library
- HTTP/2 provided by x/net/http2 and net/http
- Ethereum client provided by go-ethereum library
- Postgres database provided by pgx/v5 library
- Logging provided by go's slog library
- require and assert test helpers provided by github.com/stretchr/testify
- OpenMetrics provided by prometheus
- Tracing provided by opentelemetry
- Command line parsing provided by cobra
- Flags parsing provided by viper
- Rust is used for the mls implementation
# Directory structure
|-cmd # command line commands
|-config # shared config struct
|-contracts # abigen generated contract bindings
| |-base # bindings for base chain contracts
| |-river # bindings for river chain contracts
| |-src # Solidity contract source code
| |-types # extra helpers for working with contract generatedtypes
|-docker # files for docker container
|-env # shared configuration fils for supproted environments
|-mls # server-side mls implementation in Rust
| |-mls-tools
| | |-crates # ignore
| | |-target # build artifacts: ignore
|-node # stream node implementation
| |-auth # on-chain auth implementation for river entitlements
| |-base # RiverError type and other shared helpers
| |-crypto # Classes to interact with blockchain
| |-dlog # slog extension to provide human-readable formatting
| |-events # in-memory cache for streams loaded from db, stream event parsing, miniblock generation
| |-http_client # http client for making requests to other nodes
| |-infra # shared infra code for node
| |-lint_extensions # shared lint extensions
| |-logs # ignore
| |-mls_service # mls service implementation
| | |-mls_tools # mls tools implementation
| |-nodes # code for tracking other nodes
| |-notifications # notification service implementation
| | |-push
| | |-sync
| | |-types
| |-protocol # generated protobuf bindings
| | |-protocolconnect # generated gRPC bindings
| | |-src # Protocol Buffers definitions
| |-protocol_extensions # extra protobuf helpers
| |-registries # helper classes for working with node and stream on-chain registries
| |-rpc # rpc server implementation
| | |-render # rpc render implementation
| | | |-templates # rpc render templates
| | |-sync # cross-node stream sync aggregator implementation
| | | |-client
| |-rules # rule engine implementation for adding events to streams
| |-run_files # ignore
| |-scrub # stream scrubber implementation
| |-shared # StreamId implementation and other shared types
| |-storage # stream storage in pg database implementation
| |-testutils # test helpers
| | |-dbtestutils # db test helper to create and clean up test db
| | |-mocks # mock implementations for testing
| | |-testcert # HTTPS test certs for testing
| | |-testfmt # test formatting helpers
| |-utils # shared utils
|-river_node # river node main
| |-version # version of the node
|-run_files # ignore: local test environment deployment files
|-scripts # support scripts
|-tools # support tools
| |-migrate_db # db migration tool
|-xchain # xchain implementation to check on-chain entitlements
| |-bindings
| | |-erc1155
| | |-erc165
| | |-erc20
| | |-erc721
| | |-erc777
| | |-ierc5313
| |-client_simulator
| |-common
| |-contracts
| |-entitlement
| |-examples
| |-server
| |-util
css
docker
dockerfile
go
golang
hcl
html
javascript
+11 more
First Time Repository
TypeScript
Languages:
CSS: 2.9KB
Dockerfile: 6.9KB
Go: 1869.7KB
HCL: 15.3KB
HTML: 21.3KB
JavaScript: 21.4KB
Just: 18.8KB
MDX: 220.5KB
Makefile: 13.5KB
PLpgSQL: 4.7KB
Rust: 31.6KB
Shell: 75.8KB
Solidity: 1494.7KB
TypeScript: 3837.1KB
Created: 2/28/2024
Updated: 1/23/2025