Commit some new networking code, adding integration, broker still not 100%, hasn't been committed

This commit is contained in:
Josip Milovac 2023-04-26 13:02:27 +10:00
parent 1af6d56e2d
commit 050e69e23f
18 changed files with 1829 additions and 359 deletions

15
network/test.js Normal file
View file

@ -0,0 +1,15 @@
const PropServer = require('./blockchain-prop');
const Block = require('../blockchain/block');
const s1 = new PropServer('s1', false);
const s2 = new PropServer('s2', false);
const s3 = new PropServer('s3', false);
s1.start(9100, 'ws://127.0.0.1:9100', []);
s2.start(9101, 'ws://127.0.0.1:9101', ['ws://127.0.0.1:9100']);
s3.start(9102, 'ws://127.0.0.1:9102', ['ws://127.0.0.1:9101']);
const blocks = [Block.genesis()];
blocks.push(Block.debugMine(blocks[blocks.length - 1], 'eh', [], [], [], [], []));
s3.updateBlocks(blocks);