Metadata-Version: 2.4
Name: blocklink
Version: 0.1.2
Summary: A distributed node network framework for secure registration and instruction transmission
Home-page: https://github.com/derek44554/BlockLink
Author: Derek X
Author-email: Derek X <me@derekx.com>
License: MIT
Project-URL: Homepage, https://github.com/derek44554/BlockLink
Project-URL: Bug Reports, https://github.com/derek44554/BlockLink/issues
Project-URL: Source, https://github.com/derek44554/BlockLink
Keywords: distributed,networking,protocol,blockchain,node
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Networking
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=41.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: starlette>=0.27.0
Requires-Dist: websockets>=11.0
Requires-Dist: uvicorn>=0.23.0
Requires-Dist: sqlmodel>=0.0.8
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: requests>=2.31.0
Requires-Dist: netifaces>=0.11.0
Requires-Dist: pycryptodome>=3.18.0
Requires-Dist: Pillow>=10.0.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# BlockLink

<div align="center">

🔗 突破网络边界的分布式节点通信框架

[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Development Status](https://img.shields.io/badge/status-alpha-orange.svg)]()

[English](#english) | [中文](#中文)

</div>

---

## 💫 灵感

还记得《钢铁侠》中的贾维斯吗？托尼·斯塔克只需一句话，贾维斯就能调动所有资源、协调各个系统、处理复杂任务。或是《生化危机》中的红后，一个强大的中央智能系统，掌控着整个设施的数据与运作。

**让我们拥有这样一个属于自己的智能系统。**

- 🏗️ **数据** - 将所有数据（笔记、日记、文章、账号等）以 Block 为单位存储和管理
- 🔌 **关联** - 数据可以相互关联，不再是数据孤岛
- 🔌 **节点** - 节点扩展自己的功能，松耦合与可插拔，节点功能独立，可随意接入或移除。
- 🔌 **网络** - 每个节点都相互连接，跨 NAT 通信，不需要关注IP。
- 🔌 **协作** - Block 在设备间自由传递与链接，节点智能协同，共同构建你的个人数据网络
- 🔌 **灵活扩展**：通过扩展系统实现各种功能，打造专属于你的应用生态

## 💡 BlockLink 是什么？

BlockLink = **Block**（数据块）+ **Link**（链接网络）+ **Node**（节点）

这是一个三层架构的分布式系统：

### 📦 数据层 - Block 生态

- **Block 是最小数据单元**：可以存储任何数据（文本、图片、笔记、文章等）
- **Block 之间可以链接**：通过 `link` 建立 Block 间的关系
- **Block 可以打标签**：通过 `tag` 组织和检索 Block
- **Block 可以跨设备传递**：在你的所有设备间同步和共享

### 🌐 网络层 - 通信基础设施

- **跨 NAT 通信**：通过中继转发，让内网设备也能互相通信
- **智能路由**：自动选择最优路径（直连或中继）
- **局域网发现**：同一网络内自动发现并直连
- **全网寻址**：只需 BID 即可定位任何节点或数据，无需关心 IP 地址、存储位置或网络路径。

### 🔌 扩展层 - 应用生态

- **扩展系统**：开发或使用扩展来实现不同功能
- **灵活组合**：在不同服务器上部署不同扩展
- **自定义应用**：构建你自己的笔记系统、知识库、内容管理平台等

## 💡 解决的核心问题

### 🆔 全网寻址 - 只需知道 BID 即可通信

在传统网络中，你需要知道对方的 IP 地址、端口、是否在 NAT 后面等复杂信息。在 BlockLink 中，**只需要知道对方的 BID **，框架会自动：

- 🔍 在整个网络中定位目标节点或是Block
- 🛤️ 计算最优通信路径（直连或中继）
- 📡 自动处理消息路由和转发

## 🎯 典型应用场景

### 个人数据管理

- 📝 **个人知识库**: 将笔记、日记、文章存储为 Block，在所有设备间同步
- 🗂️ **分布式文件系统**: 构建自己的云存储，数据分散在多个设备
- 🔐 **密码管理器**: 将账号信息存储为加密 Block，安全访问

## 🚀 快速开始

### 安装

```bash
pip install blocklink
```
