// the find
anthdm/distributedfilesystemgo
distributedfilesystemgo
A toy distributed file system in Go built from scratch: custom TCP-based P2P transport, a handshake/message protocol, and a content-addressable local store. This reads like the companion code for a tutorial series rather than something meant to run in production — it's for developers who want to see how P2P networking and CAS storage work under the hood without reaching for libp2p or IPFS.
The P2P layer (transport.go, tcp_transport.go, handshake.go, message.go, encoding.go) is written against net.Listener directly, which makes the wire protocol fully inspectable instead of hidden behind a library. There's real test coverage on the parts that matter most (tcp_transport_test.go, store_test.go, crypto_test.go), which is more than most repos this size bother with. The codebase is tiny — you can read the whole thing in under an hour and actually understand every line, which is the point if you're using it to learn rather than deploy.
No consensus or replication logic — 'distributed' here means peers exchange files over a custom protocol, not that the system tolerates node failure or network partitions. There's no architecture doc or protocol spec, so understanding the handshake/message framing means reading p2p/*.go directly rather than a README. No activity since mid-2024 and nothing in the tree suggesting CI, so treat it as frozen reference code, not something you'd pull dependency updates into. crypto.go's key handling isn't documented anywhere visible, so anyone adapting this beyond the demo needs to audit it themselves before trusting it with real data.