Skip to content

P2P social network Pandora

Michael Galyuk edited this page Apr 21, 2016 · 1 revision

Pandora is distributed (p2p) the information system including functions of a social network (it is similar facebook or vkontakte), means vocal and dialogue video (skype), encyclopaedias (wikipedia), file exchange (torrent), business system (1C), electronic shop (ebay), the register of laws and standards (the Adviser +), teamwork over projects (git), and also system of voting and ratings (democratia2.ru).

Pandora it can be used for personal contact, business dealing, creation of projects and a joint management of a society.

What for to us a network?

Computer networks have strongly entered into our life. And are not going to leave. We will list the purposes to which computer networks serve. We learn the new. We communicate with relatives. We conclude transactions. We participate in joint working out of projects. We operate processes.

On the Internet it is a lot of services. Despite a seeming variety, the basic services are centralised enough. Google has servers in a certain place, millions inquiries pass through this centre and are analyzed. Facebook, Vkontakte also have the centres, millions messages of people pass through the central server of a social network and are traced. Skype for today also has the allocated servers through which takes place all traffic. Networks of electronic commerce, working out of projects, forums – all is on someone's central servers. All information passes through the uniform centres and is stored there. It is well-known. In what a problem?

Problem the first. Today we trust the information to the depersonalized corporations. It is necessary to hope sincerely that in many corporations decent people who respect our trust work. But in corporations there can be people who dispose of the information entrusted to it pursuing the intentions.

Problem the second. Today in all countries the governmental services at legislative level supervise all information highways. At each Internet provider the equipment of special services which completely traces all traffic is established. It is considered that the governments always arrive fairly. But among civil servants there can be people who pursue interests of certain groups.

Problem the third. The central points in a network to fail or be subject to risk to destroyed during external intrusion. Cases when servers fail (or them put out of action) and systems cease to work happened repeatedly. Besides, some owners simply stopped the servers, sometimes at all without having notified us. In these cases we cannot use any more the stopped services and frequently we lose the information. The centralised services are physically vulnerable and subordinated to an ox of certain persons.

In three words: the centres are subject to leaks, censorship and crash.

These are three basic problems, but it is far not the unique. Tell, on skolkih sites you had to be registered and over and over again to enter the same information? How many time to you was necessary to penetrate in particular each service and to be reconstructed under various requirements? How many programmers start every day the next site to create for us a new puzzle?

Whether not too it, only that:

  1. to learn the new;
  2. to communicate with relatives;
  3. to conclude transactions;
  4. in common to develop projects;
  5. to supervise processes. Whether not too it is much generated sushchnostej for our simple problems? Whether not too expensive price we pay?

Structures of networks

The centralised social network

These are traditional social networks. The server belongs to one owner or group of people. Users completely trust the information to the owner, a hoster and special services. The data is stored far off and on-line on the server. Such networks podverzhenny to refusal in service, to breaking, mass plum of the data, to acts of vandalism and anonymous irresponsibility. If the person has played a dirty trick on one site, and her have expelled, it freely continues to soil on others. The centralised networks more than ever generate irresponsible dialogue. Owners for attraction of public are ready to hold doors the opened.

Partially decentralised network Diaspora

In this network some centres. Users can choose the server to which they trust. The data still is stored far off on the server. Users completely trust the information to the owner. Thus some servers are placed with hosters, with all that it implies. But even if server Diaspora belongs to the private person – who it? The user again should train force of the trust. Such networks it is less podverzhenny to refusal in service, to less mass plum of the data at breaking, acts of vandalism and anonymous irresponsibility have smaller scale.

Distributed (p2p) information system Pandora

Network completely decentralised. It is impossible to put a network out of action or to take it under control. The public data (for example, encyclopaedic articles) freely plies between sites, the private data is distributed on sites, according to trust schemes. As the data interchange occurs among relatives, friends, colleagues, partners in business, adherents the probability of leaks given to the third parties almost is absent. Photos of your children will get only on computers of relatives. You will poison jokes only with the friends. Your order will be seen only by the seller. Official papers will disperse only to partners. Over projects adherents work only. Dialogue responsible and constructive. Responsible because people care of the reputation. Constructive because nobody wants to support the useless data, placing them on the computer.

Let's consider more close device Pandora.

Data of four levels

=1. The world – the most obvious essence

Data, clear to teenagers till 12 years in an every spot on the globe. Objects: Human. Community. Country. A city. Street. The address. Language. A word. A thing. Article. A file. Opinion.

Primary window Pandora

=2. Business – productive and economic activities

Data, clear to teenagers of any nationality till 18 years. Objects: the Goods. Service. The worker. The client. A warehouse. The order. The transaction. Payment.

=3. Region – records of regional value

Data, clear to the socially-adapted citizens of concrete region. Objects: Resource (deposit). The law — the certificate developed and confirmed by community. The project (social). For example, the project of a new kindergarten. The decision (accepted by community on the basis of voting). Payment — payment in support of the project; if payment on the general social purposes it is the tax, if on the project not confirmed by the decision, it kraudfanding. The expense — payment the realising project. For example, payment for a brick. Infringement — a proven fact of social infringement. Punishment — the measures, accepted to communities for infringement indemnification. The given cities, area, area or the country can be the regional data.

=4. Node – the data and the services serving for work of a network of Pandora.

Objects: Parameter. A key. The signature. The site. A patch. Event. Storehouse.

Services

Authorisation is an activation of a key of the user by the password. After authorisation signature and enciphering functions are accessible.

Hearing – program start on reception of entering connections.

Hunting – program start on cyclic poll of sites of a network of Pandora in search of the new data on which the authorised user, and also for distribution of the new data which could be in this time created on the site-hunter is signed. Usually hunting is desirable, if the site any time has been disconnected. If the site constantly was in a hearing mode about changes of the data notification messages are dispatched. Mailing of notification messages occurs within the limits of the next hunting at once at occurrence of new record, or through the set intervals of time – in case of occurrence of a portion of the new data.

Search – unary poll of sites in search of concrete type of record. For example search of world object "Person" on a name and a surname. By search, unlike hunting, the deep water of poll of a network tree on the entrusted branches is set.

Identification of records (objects)

Each record in Pandore has unique compound hesh, called "panhesh". Panhesh it is formed from truncated heshej writing fields. Text boxes heshirujutsja md5, dates are coded in 3 bytes, at the link to other records of Pandory undertakes them panhesh (partially).

For example, panhesh the person looks the following sequence: [type/lang:FirstName/LastName/BirthDate/BirthCity/FatherFN/MotherFN] Panhesh can register in cheloveko a readable kind: [person/ru: Линус/Торвальдс/28.12.1969/Хельсинки/Нильс/Анна] Panhesh the person it is coded under the following formula: FLDCAM, 6/10/3/3/2/2 = 16+6+4 = 22+4 = 26 byte + 2 bytes (type and language) Or an approximate kind in 16-richnoj to the coding: [0108: e6fb7d1b01dc ebb27cf540a56f05fd98 d343e3 5de465 f547 72fd]

Here: 01 – type of record "person" 08 – Russian e6fb7d1b01dc, ebb27cf540a56f05fd98, f547 and 72fd – truncated md5 from "Linus" and "Torvalds", "Nils" and "Anna" d343e3 – The date coded in 3 byte 5de465 – truncated panhesh records a city "Helsinki" in Russian.

Some fields can be passed (empty, i.e. not filled), in this case compound heshi are filled with zero. For example, if are set only a name, a surname and date of birth (FLD=19 byte) panhesh will look approximately so: [0108 e6fb7d1b01dc ebb27cf540a56f05fd98 d343e3 000000 0000 0000] It is possible not to specify trailer zero: [0108 e6fb7d1b01dc ebb27cf540a56f05fd98 d343e3] Reduced panhesh in cheloveko a readable kind can look so: [The person: Linus/Torvalds]

Even if the same record has been entered into networks twice (three times etc.), it panhesh will be absolutely identical, and such record will be identified as same.

Incomplete records (panheshi which zero admissions have) can corresponds with fuller (at which panheshi have less admissions). Such parity is called similarity, and is adjusted in addition.

In Pandore base types of records (as a rule, it it is world records, such as "person", "community", etc.) are described from zero. Other types of records are generated from base (basically it is business and regional records).

The affiliated records generated from other types (for example, "employee" from "person") have extended panhesh concerning the base type, extended on the added fields. Besides, the generated records do not comprise the data parental water. The parental data is stored in record of base type, and the link is stored in the descendant on panhesh the parent, plus heshi additional fields only. For example, if you get the employee «Ivan Ivanov, the manager» two records are created: the person Ivan Ivanov and the employee with panheshem Ivan Ivanov and an additional field – a post. Panhesh the employee plus hesh will represent panhesh persons, fields "post". Panhesh the employee can look so:

[The employee: Ivan/Ivanov/////the manager]

Records are presented in Pandore in the form of objects. To affiliated objects all methods of the parent are applicable. For example, if the person "Ivan Ivanov" it will be found even if it was entered only at business level in the form of the employee is searched. On the other hand, at the beginning of labour activity it is not necessary to enter the data of the person if they exist at world level.

Such hierarchy allows: 1) to enter the data only once, 2) to save disk space, 3) to have through uniform identification of objects, 4) to apply methods of parental classes.

Pandora calculates binary (byte) panheshi, and in the work operates with them at identification and search of objects.

Occurrence of records

There are only two ways with what record gets to your Pandoru:

  1. you have entered record;
  2. record has come to you on a network.

Each record is marked panheshem the founder.

The record once entered, possessing unique panheshem and marked panheshem the founder, begins the travel to networks.

Support of records

If you have entered record, it is automatically marked as "supported". Until you hold included a mark I "support", your Pandora will store this record in base.

Support by something reminds "lajk" in a social network. But when you put "lajk", you anything as a matter of fact do not help record. In Pandore support has a physical essence.

For example, when you look a photo of the friend, and it is pleasant to you — you press I "support". Since then the photo is late in your base. Your general friends can load this photo with Pandory of the friend, or from your computer.

After loading another's records are stored some preset time (for example, for type "person" 3 days it is by default set) then records if it has not been render support or trust automatically leave from your site.

Also you can adjust autosupport, i.e. automatic inclusion of a flag I "support" for records on a certain condition. For example, you can specify that always support Ivan Ivanov's articles, or the questionnaire of the friends.

The trusted records

The trust is a digital signing of record. For example, if you have signed the questionnaire of the friend, you guarantee that this person present. When you sign article, you confirm the validity of data which in it contain. When you render "trust" to the contract with the entered name, you actually accept this contract.

The trust system allows to establish reliability of the data in Pandore. It is one of key functions in network work.

Your friends close, partners, adherents, having seen the signature, understand that it is the checked up data. Enjoy confidence responsibly. Rendering trust to the doubtful data, you can damp the reputation.

The rendered trust does not oblige you to store record, but only the signature of this record. Nevertheless, by default Pandora is adjusted to store the entrusted records also as well as supported.

Public records

The mark on record "public", makes entry of the national. The common data, for example, questionnaires of historical figures, or encyclopaedic articles can be published.

If record is marked as "public" and leaves in a network it will not make most likely any more back private. It not a bug of Pandory – such is the network nature. But even if record is published, she will live in a network while gets support, and-or the trust is rendered it.

Uninteresting records, without support and trust quickly "die away". In Pandore there is a present struggle of records for support and trust.

You can publish both the records, and strangers. But the publication of another's records without the consent of the founder is a bad form.

Change of records

You can change the record or another's. Anyway at record change "patch" which extends among interested sites is created. It can turn out so that initial record is created by one person, and then a little others have made changes. Participants of Pandory can support patches, render them trust and publish, i.e. patches possess all properties of record.

So, in Pandoru possibility of joint working out of records of any type is put, beginning from encyclopaedic article, and finishing the regional decision.

Communications Communication is the record, the showing attitude between two records; contains following fields:

  1. panhesh the first record
  2. panhesh the second record
  3. communication type (1 byte)

By the current moment following types of communications are reserved, the code is meant «by the first record the following refers to the second»: 0 – it is equal 1 – similarity (synonym) 2 – an antipode (antonym) 3 – has generated 4 – is a part 5 – watches for 6 – ignores 7. 254 — another 255 — uncertain communication

Examples of communications: [The person: Linus/Torvalds] 0 [the person: Линус/Торвальдс/28.12.1969] Means that any Linus Torvalds most likely that. [A word: class] 1 [a word: cool] Words "class" and "cool" are very similar [A word: hot] 2 [a word: cold] "Hot" an antonym to a word "cold" [The person: Linus/Torvalds] 3 [the person: the Patrician/torvalds] Linus the parent Patricians [The person: Linus/Torvalds] 4 [community: Developers of kernel Linux] Linus is a part of community [Community: Tenants of the house №98] 5 [the project: Building of a kindergarten №7] Tenants of the house watch working out of the project of a garden in their court yard [The person: Gennadij/Rediskin] 6 [статья:P2P social network Pandora] Gennady is indifferent to some article, and does not want to receive more this record at an exchange with any sites.

Communications can be used in various cases, such as: definition of structure of community, revealing of synonyms, relationships of cause and effect, work of "hunter" etc. to Communications, as well as other records, also can be rendered support and trust.

Opinions

Each record can be commented and estimated participants of Pandory. Special record — opinion is for this purpose created. The opinion contains panhesh made comments object, panhesh the founder of opinion, an estimation from-127. +127 (or 0, if it is neutral), the comment text (or it is empty if only an estimation) and time of creation of opinion.

The opinion can make comments on other opinion. So discussion branches are formed. If the opinion consists only of an estimation it adds, or diminishes a record rating which concerns, but is not displayed in a branch. If the opinion contains also the text except influence on a record rating, it is still displayed in a discussion branch.

Hearing

Usually Pandora at start itself enters into a hearing mode. To manual inclusion and deenergizing of a mode of hearing by well command Pandora-listen. In a hearing mode below in a status line your IP address will be highlighted. Thus the IP address can be always identical (static), and can change from time to time (to be dynamic). If you possess a static IP address can inform friends the IP address that they have added it in the list of sites. Besides, if you the owner of the static address your Pandora will carry out also function trekera for your friends, colleagues, clients, adherents and etc., depending on that adjustment which you will wish. If at you the dynamic address to inform its friends of sense is not present. Dynamic addresses can be defined only through the general friends possessing static sites. When your Pandora is in a hearing mode, other users can be connected to you, read out and write down the data on which at them there are permissions. Right after installations of Pandory are set the minimum permissions with which in due course you can expand for the friends and other entrusted groups.

Addition of sites

In the list Pandora-knots add the site, an IP address which to you it was possible to learn. To specify only an IP address enough, other fields will be automatically filled at a data interchange. Do not worry that you constantly should enter addresses manually. Basically the table of sites will automatically replenish at a data interchange with other sites. Thus sites also are records which extend on trust chains.

Hunting

The site of Pandory touches known sites, and this most as though leaves on hunting. Thus the hunter searches for listening sites. If "hunter" has found "listener", it will be connected to it, and the data interchange begins. Usually, the site of Pandory is both in a mode of hearing and in a hunting mode simultaneously. Though connection is initiated always by the hunter, right after connections distinction between the hunter and the listener are erased, the data interchange goes in both parties. Thus each site exposes the inquiries, and other site should respond to these inquiries. Connection or is broken off right after a data interchange, or remains connected if live dialogue (a chat, a call or game has been requested). Pandora in a hunting mode cyclically interrogates only those sites on which you are signed.

Subscriptions

Subscriptions define what data of type it is necessary to request of the set communities, people or sites. For example, you can specify, that your Pandora requested new photos of group «My friends», or the new goods of the set company. Subscriptions also are regulated by type 5 communications («watches for»).

Fishing

Fishing is a mechanism of inquiry the hunter at the listener of connection with the third site in a case when the hunter cannot incorporate with requested directly, for example, in case of a finding of the third site for NAT. Depending on that, are the third site on communication, or not, is the hunter the public listener or not, fishing looks as follows. For example, A requests of listener B probros on C site. — A requests at B C site fishing — If C it is connected to B, B site informs C site that searches for it A — If C it is disconnected, but listens, B site is connected to it — If C it is disconnected and does not listen, B requests A: will wait (10 mines maks) or periodically to be connected (each 1 mines)? — If A waits — it the trailing fisherman — If A periodically interrogates — it the jumping fisherman — If C it was connected to B B informs C that on it there is a fishing from A, further one of three: — C it is connected to A site directly — Conversation between A and C through B if still A hangs on B begins — B site gives to C site time for counter trailing fishing of A site (10 minutes), if A the jumping — If jumping A has appeared in this time, them connect, if is not present — both fishermen act in film from fishing — Fishermen act in film from fishing also on tajmautu (10 mines)

In addition: — On (B site the maximum number of demands for fishing, for example 500 is set — The maximum number of the connected fishermen, for example 20 is besides set — In the demand for fishing can appear not only the site, but also panhesh the person or a key — B site can set restrictions on traffic volume in a unit of time or forbid a media exchange.

Messages and calls

Except an exchange of records of Pandora supports an exchange of messages, vocal conversation, video a call and games.

At opening of a window of conversation of Pandora it is connected to the site if has not been connected before then it is possible to send instant messages and to start audio or video a stream. Besides it is possible to play, for example in «Sea fight» or "Chess".

The scheme of work of the site — circulation of the data

At each connection the socket is created. Sockets are created both the listener, and the hunter. On each connection the output agent is started. All established connections are registered in the list of active sites.

Connection data handling

The data interchange occurs asynchronously. Each site sends inquiries and data packages in one turn, and accepts answers and the data in other cycle. Packages with a sound and video at sending are marked with the big priority, and on reception are processed first of all, these media packages do not demand acknowledgement. On the contrary, records are transferred in inquiries, and acknowledgement on reception demand.

Technical realisation

At construction of Pandory platform, popular, clear and well documentary components got out cross-country. Here the current list: ruby, gtk, sqlite, openssl, gstreamer.

The installation

(See Install and first run manual)

=1. Establish git in Ubuntu:

sudo apt-get install git

(In Windows establish «Git-x.x.x... exe» from here: code.google.com/p/msysgit/downloads/list)

=2. Create the empty catalogue «Pandora», remaining in it download Pandora using git:

mkdir /home/user/Pandora cd /home/user/Pandora git clone --depth=1 https://github.com/Novator/Pandora.git

=3. Make script Pandora.sh zapuskamym (only for Ubuntu):

chmod +x ./pandora.sh

=4. Establish additional packages for Ubuntu:

sudo ./pandora.sh --init

(In Windows you can unpack archive from here: github.com/Novator/RubyFull/raw/master/rubyfull.exe)

=5. Start Pandora in Ubuntu:

./pandora.sh

(In Windows start a bat-file pandora.bat)

Stand!

Described above funktsional yet does not work! Some years ago I have sat down to write free accounts department. Repeatedly I changed the name and the system concept. As a result has come to that is described in this article. A code I write by fits, at leisure. Still it is a lot of work, and real life sucks in and constantly distracts from programming … every day more and more. Having been frightened that I and will not have time to realise the project, have decided to publish at least that is. At least to sound idea. Probably, I will manage to finish Pandoru to any working state. But it is possible, the fallen banner should be picked up younger.

Other similar systems Pandora not the first and not a unique social P2P network. There are some interesting projects:

But all of them are limited by social network function. Pandora it urged to be universal system, for dialogue, business and management of a society.

The possible future

The basic idea of Pandory in that not the society was defined by the state, and the state was formed by a society.

I have as though asked a question: «Why we, citizens, run for officials? We look in a mouth to officials, we are arranged under them, and we wait from them for decisions of our problems? Why to officials not to run for us?» Rescue rolling – a handwork rolling.

The society should have a tool, using which, citizens can create projects, in common finish them and render them trust. Decisions should be accepted by authoritative citizens, experts in the branches to which the society has rendered trust. Public services from lazy, insatiable and retaliatory body should turn to mute executors of national will.

Be continued

1/1/2013 heads of "Communication" are added, "Fishing", small typing errors are corrected.

Original: