From c733a2a4a1e33d5660904d94f96af5982013ca66 Mon Sep 17 00:00:00 2001 From: TenderIronh Date: Fri, 11 Feb 2022 18:33:50 +0800 Subject: [PATCH] doc --- README-ZH.md | 3 ++- README.md | 3 ++- USAGE-ZH.md | 4 ++-- USAGE.md | 4 ++-- config.go | 2 +- daemon.go | 6 +++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README-ZH.md b/README-ZH.md index eed3c04..1d19806 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -1,7 +1,8 @@ # [English](/README.md)|中文 网站: [openp2p.cn](https://openp2p.cn) ## OpenP2P是什么 -它是一个开源、免费、轻量级的P2P共享网络。任何设备接入OpenP2P,随时随地访问它们。相比BT网络用来共享文件,OpenP2P网络用来共享带宽。 +它是一个开源、免费、轻量级的P2P共享网络。你的设备将组成一个私有P2P网络,里面的设备可以直接访问其它成员,或者通过其它成员转发数据间接访问。如果私有网络无法完成通信,将会到公有P2P网络寻找共享节点协助通信。 +相比BT网络用来共享文件,OpenP2P网络用来共享带宽。 我们的目标是:充分利用带宽,利用共享节点转发数据,建设一个远程连接的通用基础设施。 ## 为什么选择OpenP2P diff --git a/README.md b/README.md index 8838398..c5e6125 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # English|[中文](/README-ZH.md) Website: [openp2p.cn](https://openp2p.cn) ## What is OpenP2P -It is an open source, free, and lightweight P2P sharing network. As long as any device joins in, you can access them anywhere. Compared with the BT network used to share files, the OpenP2P network is used to share bandwidth. +It is an open source, free, and lightweight P2P sharing network. Your devices will form a private P2P network, in which devices can directly access other members, or indirectly access through other members forwarding data. +If the private network cannot complete the communication, it will go to the public P2P network to find a shared node to assist in the communication. Compared with the BT network used to share files, the OpenP2P network is used to share bandwidth. Our goal is to make full use of bandwidth, use shared nodes to relay data, and build a common infrastructure for remote connections. ## Why OpenP2P ### 1. Free diff --git a/USAGE-ZH.md b/USAGE-ZH.md index bac6a7a..00e925f 100644 --- a/USAGE-ZH.md +++ b/USAGE-ZH.md @@ -14,7 +14,7 @@ >* -d: daemon模式。发现worker进程意外退出就会自动启动新的worker进程 >* -node: 独一无二的节点名字,唯一标识 >* -token: 在“我的”里面找到 ->* -sharebandwidth: 作为共享节点时提供带宽,默认10mbps. 如果是光纤大带宽,设置越大效果越好. -1表示不共享,该节点只在私有的P2P网络使用。不加入共享的P2P网络,这样也意味着无法使用别人的共享节点 +>* -sharebandwidth: 作为共享节点时提供带宽,默认10mbps. 如果是光纤大带宽,设置越大效果越好. 0表示不共享,该节点只在私有的P2P网络使用。不加入共享的P2P网络,这样也意味着无法使用别人的共享节点 >* -loglevel: 需要查看更多调试日志,设置0;默认是1 ## 连接 @@ -39,7 +39,7 @@ "network": { "Node": "hhd1207-222", "Token": "TOKEN", - "ShareBandwidth": -1, + "ShareBandwidth": 0, "ServerHost": "api.openp2p.cn", "ServerPort": 27183, "UDPPort1": 27182, diff --git a/USAGE.md b/USAGE.md index b54f6bb..1da3009 100644 --- a/USAGE.md +++ b/USAGE.md @@ -16,7 +16,7 @@ Or >* -d: daemon mode run once. When the worker process is found to exit unexpectedly, a new worker process will be automatically started >* -node: Unique node name, unique identification >* -token: See "Profile" ->* -sharebandwidth: Provides bandwidth when used as a shared node, the default is 10mbps. If it is a large bandwidth of optical fiber, the larger the setting, the better the effect. -1 means not shared, the node is only used in a private P2P network. Do not join the shared P2P network, which also means that you CAN NOT use other people’s shared nodes +>* -sharebandwidth: Provides bandwidth when used as a shared node, the default is 10mbps. If it is a large bandwidth of optical fiber, the larger the setting, the better the effect. 0 means not shared, the node is only used in a private P2P network. Do not join the shared P2P network, which also means that you CAN NOT use other people’s shared nodes >* -loglevel: Need to view more debug logs, set 0; the default is 1 ## Connect @@ -41,7 +41,7 @@ Configuration example "network": { "Node": "hhd1207-222", "Token": "TOKEN", - "ShareBandwidth": -1, + "ShareBandwidth": 0, "ServerHost": "api.openp2p.cn", "ServerPort": 27183, "UDPPort1": 27182, diff --git a/config.go b/config.go index 9af4b64..0d168ab 100644 --- a/config.go +++ b/config.go @@ -142,7 +142,7 @@ func parseParams() { srcPort := flag.Int("srcport", 0, "source port ") protocol := flag.String("protocol", "tcp", "tcp or udp") appName := flag.String("appname", "", "app name") - flag.Bool("noshare", false, "deprecated. uses -sharebandwidth -1") // Deprecated, rm later + flag.Bool("noshare", false, "deprecated. uses -sharebandwidth 0") // Deprecated, rm later shareBandwidth := flag.Int("sharebandwidth", 10, "N mbps share bandwidth limit, private node no limit") flag.Bool("f", false, "deprecated. config file") // Deprecated, rm later daemonMode := flag.Bool("d", false, "daemonMode") diff --git a/daemon.go b/daemon.go index 0bd0c87..34571f0 100644 --- a/daemon.go +++ b/daemon.go @@ -106,9 +106,9 @@ func (d *daemon) Control(ctrlComm string, exeAbsPath string, args []string) erro // examples: // listen: -// ./openp2p install -node hhd1207-222 -token YOUR-TOKEN -sharebandwidth -1 +// ./openp2p install -node hhd1207-222 -token YOUR-TOKEN -sharebandwidth 0 // listen and build p2papp: -// ./openp2p install -node hhd1207-222 -token YOUR-TOKEN -sharebandwidth -1 -peernode hhdhome-n1 -dstip 127.0.0.1 -dstport 50022 -protocol tcp -srcport 22 +// ./openp2p install -node hhd1207-222 -token YOUR-TOKEN -sharebandwidth 0 -peernode hhdhome-n1 -dstip 127.0.0.1 -dstport 50022 -protocol tcp -srcport 22 func install() { gLog.Println(LevelINFO, "install start") defer gLog.Println(LevelINFO, "install end") @@ -127,7 +127,7 @@ func install() { srcPort := installFlag.Int("srcport", 0, "source port ") protocol := installFlag.String("protocol", "tcp", "tcp or udp") appName := flag.String("appname", "", "app name") - installFlag.Bool("noshare", false, "deprecated. uses -sharebandwidth -1") + installFlag.Bool("noshare", false, "deprecated. uses -sharebandwidth 0") shareBandwidth := installFlag.Int("sharebandwidth", 10, "N mbps share bandwidth limit, private node no limit") logLevel := installFlag.Int("loglevel", 1, "0:debug 1:info 2:warn 3:error") installFlag.Parse(os.Args[2:])