This is a simple peer-to-peer (P2P) caching service that allows you to cache
data across multiple nodes in a P2P network. The service exposes a /cache
endpoint which accepts data in the JSON schema {'key': 'foo', 'value: 'bar'}
to store and distribute the cached information
To install and run the P2P caching service, follow these steps
- Clone the repository
$ git clone https://github.com/tuxcanfly/p2p-cache.git
- Install the required dependencies
$ npm install
- Start a peer
$ npm start 3000
- Start a remote peer (Optional)
$ npm start 4000 <peer-multiaddr>
Congratulations! The P2P caching service is now up and running on your local machine
Once the service is running, you can start interacting with it through the
provided API endpoints. The service allows you to cache data across all nodes
in the P2P network by using the /cache
endpoint
This endpoint accepts JSON data in the following format to cache information across all nodes in the P2P network
{
"key": "foo",
"value": "bar"
}
This endpoint queries the JSON data by key across all nodes in the P2P network
We welcome contributions to enhance the functionality, add new features, or solve issues of this P2P caching service. If you would like to contribute, please follow these steps
- Fork the repository
- Create a new branch
- Make your changes and commit them
- Push your changes to the forked repository
- Submit a pull request