Spreadable - a variant of the decentralized network

image



Why decentralization at all? Many people do not quite understand the meaning, because everything seems to work well. There are actually several reasons, but usually the proponents of the approach only touch on complex technical issues, and it becomes difficult for the layman to discern the essence. For me, for example, everything is very simple.



Let's say you've started a cool project. With development, it will begin to require more and more computer resources. The problem is that the average person has very limited resources. But if other people are interested in your idea, they will be able to independently launch their servers, change and add new functionality, expand the general capabilities, etc. At the same time, the costs are not so significant for an individual. They are distributed among all, and the total profit for each is summarized. This enables ordinary people to create not simple solutions.



, , , , . , , , , " " ... - , , .



- , . , . , β€” spreadable.



:



: master slave (M S). . . M S, , . M : 9 , M 3 . M S. S . , 9 3 M 3 S. , M .





:



  • -
  • β€” , .
  • , M, .
  • M S , .
  • , , , - .


. . 50ms. 3 * 50 = 150 ms .





, . , , , .



:



  • /
  • ,


:



  • .
  • , .


. 10000-100000 . , .



:



, . , . 2 . . , ... (M1, M2 ...). M3 M2, M2 -> M1,  M1 -> S.





. 4, M2, 6, M3, 12 .



, , . .





:



  • ,


:







. , , - . , . , :



  • .
  • , .
  • , .
  • - , .
  • , .


. , β€” . , , , , , . , . , . ,



. . - , , , . , . - . , . , β€” .





, , - . , , ip , . ? β€” . - , , . approval. ip . .



, :



  • approversCount β€” , . , , - .
  • decisionLevel β€” . , 66.6%. .
  • period β€” . , 5 .


decisionLevel , . , . .



. , . , approversCount=3, decisionLevel=2, period=10m - . , 3 . , , - .





, , , , . (, ). , . 2 3 , , .





, , " " 2 , ( , ) , , - N .



, , , .



.





, . , , . . . , . . . , . , .





nodejs. :



:



const Node = require('spreadable').Node;

(async () => {
  try {
    const node = new Node({
      port: 4000,
      hostname: 'localhost',
      initialNetworkAddress: 'localhost:4000'   
    });
    await node.init();
  }
  catch(err) {
    console.error(err.stack);
    process.exit(1);
  }
})();


:



const Client = require('spreadable').Client;

(async () => {
  try {
    const client = new Client({
      address: 'localhost:4000'
    });
    await client.init();
  }
  catch(err) {
    console.error(err.stack);
    process.exit(1);
  }
})();


Node. Client.



:



  • http . https. 
  • (port) (initialNetworkAddress). β€” , . (hostname).
  • . : . IP-. ipv6 [ip]: .
  • , . .
  • , .
  • .


readme.





, - , , , ... , , . (EventEmitter). , , .



At the moment, you can see how to inherit everything using the example of existing extensions: metastocle , storacle , museria . If it makes sense, then I will write an article somehow how to expand and use the library for my project.



My contacts:






All Articles