MCPcopy Index your code
hub / github.com/blobcache/blobcache

github.com/blobcache/blobcache @v0.8.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8.1 ↗ · + Follow
2,811 symbols 8,965 edges 203 files 613 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Blobcache

GoDoc Matrix

Blobcache reimagines application state as Volumes holding hash-linked data structures. Volumes can be persisted locally, encrypted, and accessed over the network. Hash-linked data structures are efficient to sync and transfer. Corruption is always detected, and the root is a cryptographic commitment to the whole data structure.

Blobcache is a universal backend for E2EE applications.

Quick Docs

Getting Started

For non-user machines (cloud, homelab) it is recommended to run the docker image. For user machines, it is recommended to run blobcache as a systemd service when you log in.

Installation

There is an install script for systemd-based linux, and macOS.

curl blobcache.io/install.sh | sh

The install script does 2 things: - Installs the blobcache executable to /usr/bin/blobcache - Installs the blobcache service: - On Linux: Copies blobcache.service into $HOME/.config/systemd/user/ - On MacOS: Copies io.blobcache.blobcache.plist into $HOME/Library/LibraryAgents

Then you can manage the service using systemctl --user as you would normally. The service is not enabled by default (you can do that with systemctl --user enable blobcache), so this install method is also appropriate for getting the binary into /usr/bin without launching a background process.

Setting BLOBCACHE_API

On user machines, you will probably want to set the BLOBCACHE_API environment variable.

This would set the variable to the unix socket used by default in the systemd service described above.

export BLOBCACHE_API="unix:///run/user/$(id -u)/blobcache.sock"

The environment variable is used by the blobcache command to talk to the blobcache daemon.

You can test that the CLI can connect to the daemon with

$ blobcache endpoint
JcJvfY9tFsfkHSwoMT8IEoSq1ZfxVYBAwpBRvJ0uUJA:[::]:6025

Docker

There is a docker image on the GitHub Container Registry, it can also be built with just build-images. Right now it only builds for linux-amd64.

After that you can test run with

docker run -it --rm ghcr.io/blobcache/blobcache:latest

Images are tagged with the git hash e.g. git-a0b1c3d and the version e.g. v1.2.3

The /state directory is where blobcache stores all of its state. This is where you should mount a volume to persist data on the host. You should also expose the peer port, so other instances can connect.

docker run \
    -v /host/path/to/state:/state \
    -p 6025:6025/udp \
    ghcr.io/blobcache/blobcache:latest

Running a Node in Memory

This is a good option if you just want to play around with the API, and don't want to persist any data, or connect to peers.

$ blobcache daemon ephemeral \
    --serve-ipc ./blobcache.sock \
    --net 0.0.0.0:6025

Running the daemon

The following command runs a daemon with state in the specified directory.

$ blobcache daemon run \
    --state $HOME/.local/blobcache \
    --serve-ipc /run/blobcache/blobcache.sock \
    --net 0.0.0.0:6025

Once the daemon is running, you should be able to connect to it and start building your application on top of content-addressed storage.

License

The Blobcache implementation is licensed under GPLv3. All of the clients are licensed under MPL 2.0 As a genreal rule: everything north of the UNIX or HTTP API is MPL and everything south is GPL.

What this means is: if you improve Blobcache you have to make the improvements available, but if you are just using a client you can do whatever you want with it.

If you need additional clarity with regard to licensing, please reach out. We can add headers to the invidual files if necessary.

Extension points exported contracts — how you extend this code

GroupName (Interface)
GroupName is implemented by all types that can be the name of a group. GroupNames must be comparable and implement the S [8 …
src/internal/groupfile/groupfile.go
Sendable (Interface)
Sendable is a type that can be sent in a message [83 implementers]
src/bcp/message.go
Schema (Interface)
Schema is the most general Schema type. All a Schema has to be able to do is validate the contents of a Volume. [6 implementers]
src/schema/schema.go
RWD (Interface)
RWD is Read-Write-Delete Store methods [22 implementers]
src/bcsdk/stores.go
Component (Interface)
Component renders a blobcache Volume to the terminal [5 implementers]
src/blobcachecmd/bctui/components.go
Tx (Interface)
Tx is a consistent view of a volume, during a transaction. [5 implementers]
src/bccore/backend.go
Service (Interface)
(no doc) [8 implementers]
client/rs/src/service.rs
QueueAPI (Interface)
(no doc) [6 implementers]
src/blobcache/queues.go

Core symbols most depended-on inside this repo

String
called by 188
src/internal/groupfile/groupfile.go
Marshal
called by 175
src/bcp/message.go
Unmarshal
called by 115
src/bcp/server.go
Context
called by 103
src/internal/testutil/testutil.go
Run
called by 94
src/internal/blobcached/daemon.go
Unlock
called by 74
src/bclocal/internal/localvol/mol.go
Lock
called by 72
src/bclocal/internal/localvol/mol.go
Load
called by 71
src/blobcache/volume.go

Shape

Method 1,677
Function 633
Struct 362
Interface 52
Class 50
TypeAlias 32
FuncType 3
Enum 2

Languages

Go92%
Rust7%
Python2%

Modules by API surface

src/bcp/rpc_message.go196 symbols
src/internal/tries/triescnp/trie.capnp.go71 symbols
src/blobcache/volume.go60 symbols
src/bchttp/bchttp.go59 symbols
src/internal/bcsys/bcsys.go58 symbols
client/rs/src/types.rs51 symbols
src/blobcachecmd/bctui/bctui.go50 symbols
src/internal/blobcached/auth.go49 symbols
src/bclocal/bclocal.go48 symbols
client/python/blobcache.py47 symbols
src/bcsdk/tx.go45 symbols
src/blobcachecmd/bctui/components.go41 symbols

For agents

$ claude mcp add blobcache \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact