Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 2.37 KB

File metadata and controls

53 lines (41 loc) · 2.37 KB

Overview

  • any-sync-bundle wraps the Anytype coordinator, consensus, filenode, and sync services into one binary (lightnode/anynodes.go).
  • All services share the coordinator's network stack: TCP 33010, QUIC/UDP 33020, one PeerID, one DRPC mux.
  • The filenode supports two storage backends (auto-selected based on configuration):
    • BadgerDB (default): Local embedded storage via lightcmp/lightfilenodestore
    • S3 (optional): Cloud storage via upstream s3store implementation
  • External dependencies: MongoDB for coordinator/consensus, Redis for filenode cache. Sync node persists to AnyStore on disk.

Config bootstrap (cmd/start.go):

  1. Load existing bundle YAML if present.
  2. Otherwise create one via config.CreateWrite, injecting values from env/flags.
  3. Always write the client config (YamlClientConfig) to the target path.

Architecture Notes

  • Coordinator starts first, then consensus, filenode, sync (runBundleServices).
  • extractSharedNetwork copies network components from the coordinator into other apps.
  • DRPC routes by method prefix (/CoordinatorService, /ConsensusService, /FileService, /SpaceSyncService).
  • Data layout (default ./data):
    • bundle-config.yml – persisted configuration (credentials, keys)
    • client-config.yml – generated client config (regenerated on start)
    • storage/ – local storage directory:
      • network-store/ – network configuration
      • storage-sync/ – sync node persistence (AnyStore)
      • storage-file/ – filenode data (BadgerDB, when not using S3)

Development

Compose files

  • compose.dev.yml – development dependencies (MongoDB replica set + Redis Stack).
  • compose.aio.yml – bundle image with embedded MongoDB/Redis.
  • compose.external.yml – bundle image plus external MongoDB and Redis containers.
  • compose.s3.yml – bundle with MinIO for S3 storage testing.
  • compose.traefik.yml – Traefik reverse proxy example.
go build -o any-sync-bundle .
golangci-lint run --fix
go test -race -shuffle=on -vet=all -failfast ./...
go test -tags=integration ./integration/...  # requires Docker

Integration Tests

Uses testcontainers-go to spin up MongoDB, Redis, and MinIO containers.

Test files:

  • integration/containers.go – container lifecycle helpers
  • integration/bundle.go – bundle process manager
  • integration/integration_test.go – test cases