# Magnet\_Link or Torrent based Package Manager

## Important Note

The current torrent network is highly dependent on the public network.

The seeder must have an public ip address, otherwise, you can't download anything.

I think I probably need to create a new system to allow those people who do not have public ip address to be able to use their disk to seed data.

## Yingshaoxo Torrent Protocol

1. For all those clients, it will need at least one tracker service. That service has an public ip address. It only need to have one open port.
2. When a client open a new torrent, I mean seeding. That client will do a report to the tracker with the following infomation: {"has\_public\_ip": "_._._._", "hash": "", "size": 100}
3. When a client want to download a file with certain hash from a magnet link, it will do a asking to the tracker. If the tracker found there has a resource that matchs the hash code, if the seeder has public ip address, then it will let the client do a download directly from that seeder, otherwise, if that seeder does not have an public ip address, then the tracker will ask the seeder to upload its resources first, then transfer it to the client that asks the resources.

## At First

At the first, it is only for linux.&#x20;

Because Mac or Windows system is some companies private properties, they can ban anything if they want. So we do not touch those systems.

## Basic Ideas

This software should have two binary files: "magnet\_link\_package\_manager" and "magnet\_link\_package\_manager\_gui".

For the first one, it is a pure command line software, for the second one, it has a user interface where user could do a package search and install and uninstall.

For each package, they should have 3 information:

```
{
    "package_name": "", # this should be the excutable binary name
    "magnet_link": "", # this is the download link for a zip file
    "size": 0, # In MB, this tells user how big that zip file is
}
```

For each package zip file, they should have this structure (suppose the package\_name == "echo"):

```
.
├── more_resources
├── some_resources
├── README.md
└── echo
```

> That zip file should at least have a excutable binary file in root folder level, and have exact same name with the pacakge\_name.

When the package\_manager install that zip file, it will simply:

```
1. do a uncompress, put that folder into f"/bin/{package_name}_folder"
2. use f"ln -s /bin/{package_name}_folder/{package_name} /bin/{package_name}" to create a real excutable file for shell to run globally
```

If those package or software wants to save some configurations, they could put it into "/home/{username}/.{package\_name}" folder

This package manager also support source link change, for example, if you have a torrent server running at somewhere, you could put the tracker link into "/root/.magnet\_trackers.txt".

If you want to upload your own package to the network, you can use a command like "magnet\_link\_package\_manager upload package\_folder\_name" to do it, we'll check if the format is OK, then if it is OK, we'll compress it to zip, then serve it on the torrent network.

We default has a deamon service in the background to serve those uploaded files in torrent network, but if it is failed to start, user can simply use "magnet\_link\_package\_manager serve" to serve their uploaded packages.

> For those who downloaded a package, they have responsibility to serve those package in torrent network for sure. (By using "magnet\_link\_package\_manager serve" if necessary)

## For the magnet server service part

We will provide amd64 binary files, so everyone could set up a torrent tracker service.

> For this service, we could even do a check to make sure it has the folder structure we required for that package manager.

## New update

I actually implemented a magnet\_software that could get running as service, and also client.

It is just one single software. It is called "magic\_magnet".

I decided to merge that software into one single package manager, called "YPPM(yingshaoxo python package manager)".

In the end, it will look like:

```
Exists Command:
  create_a_global_entry_for_this_project
  create_a_new_project
  init
  run
  install
  uninstall
  build
  build_with_nuitka
  clean
  about

New Command that need to get developed:
  1. yppm start_dependence_deamon (this is the server service)
  2. yppm upload <file_path>
  3. yppm search <keyword>
  4. yppm download <magic_magnet>
  5. yppm download_full_version_of_yppm <optional url> (download a ZIP file where has static python and yppm in ./bin folder)
  6. yppm start_community_deamon (this is the server service)
  7. yppm community (this will start a question and answer website, the thing you could do is search, ask_question, answer_question, comment question, if no search results, then show yingshaoxo bot database results; for any post that get reported, it will get hide in webpage but alive in terminal)
  8. yppm ask_ai (it will simply use yingshaoxo dataset to answer questions. When you start it, it will print out "welcome to use yingshaoxo AI, you can ask any questions you like.")
  9. yppm todo <backup_file_path> <load_file_path> (it will simply launch life is a loop
  10. yppm config (for modifying Json configuration
```
