anthdm/distributedfilesystemgo — reverse-engineered prompt
Reverse engineered prompt
Build me a small Go project that works like a simple distributed file system. I want to be able to start multiple nodes on my machine, have them connect to each other, and save a file through one node so it gets stored locally and can be found or fetched from another node.
Please include basic peer to peer networking, a server loop for each node, a simple content address or key based store, and encryption helpers so files are not just written in plain text. Add a small demo in main that starts a couple of nodes and shows storing and reading a file.
Include tests for the storage and crypto parts, and keep the code easy to read because I’m trying to learn how this works. Use Go modules and make it runnable with normal go test and go run commands. If you need current Go docs, look them up online.
Want more depth? Deep Reverse