Blockchain simulator 7

ExSan++

   1 

   2    |ExSan| C++  |ExSan|   MSVSC2019_V16_11.23@01.11

   3                                                         Mon Jan 30 10:24:22 2023

   4 

   5 

   6     exsan.plusplus@gmail.com   https://twitter.com/#!/ExSan_com

   7     JOB:  bch3_2422

   8 

   9    BlockChainSimulator 3

  10     Generate Exsan ( 5 ,  5 )

  11 

  12 

  13    TEST   1 out of 1

  14    RANDOM GENERATED(peer in row, nBitcoins)

  15    ORIGINAL SEED Total Bitcoins available 20  page 0

  16    WORKSHEET 0  @[5, 5] FLOAT

  17               A       B       C       D       E 

  18          >-----------------------------------<

  19       1:      0       0       0       0       0 

  20       2:      7       0       0       0       0 

  21       3:      5       0       0       0       0 

  22       4:      3       0       0       0       0 

  23       5:      5       0       0       0       0 

  24          <----------------------------------->

  25 

  26    Simmulation random peer and bitcoins to traded

  27    Process  1 out of 33

  28    ptr points not to the first neither to the last

  29    Peer[  2, 1] Tx---:nBitcoins 4  ---:> to Peer[ 5]   then update ledger

  30    There was a Tx, update Receptor new block 

  31    Receptor Peer:   5   next block: 2

  32    Rx, ptr points not to the first neither to the last

  33    Peer  5   accepts transfer: 4 in Col[2]   then update ledger

  34    Layout updated

  35    WORKSHEET 0  @[5, 5] FLOAT

  36               A       B       C       D       E 

  37          >-----------------------------------<

  38       2:      7       3       0       0       0 

  39       5:      5       9       0       0       0 

  40          <----------------------------------->

  41 

  42    Process  2 out of 33

  43    ptr points not to the first neither to the last

  44    Peer[  4, 1] Tx---:nBitcoins 3  ---:> to Peer[ 1]   then update ledger

  45    There was a Tx, update Receptor new block 

  46    Receptor Peer:   1   next block: 1

  47    Rx first col

  48    Peer  1   accepts transfer: 3 in Col[1]   then update ledger

  49    Layout updated

  50    WORKSHEET 0  @[4, 5] FLOAT

  51               A       B       C       D       E 

  52          >-----------------------------------<

  53       1:      3       0       0       0       0 

  54       4:      3       0       0       0       0 

  55          <----------------------------------->

  56 

  57    Process  3 out of 33

  58    ptr points not to the first neither to the last

  59    Peer[  5, 2] Tx---:nBitcoins 1  ---:> to Peer[ 3]   then update ledger

  60    There was a Tx, update Receptor new block 

  61    Receptor Peer:   3   next block: 2

  62    Rx, ptr points not to the first neither to the last

  63    Peer  3   accepts transfer: 1 in Col[2]   then update ledger

  64    Layout updated

  65    WORKSHEET 0  @[5, 5] FLOAT

  66               A       B       C       D       E 

  67          >-----------------------------------<

  68       3:      5       6       0       0       0 

  69       5:      5       9       8       0       0 

  70          <----------------------------------->

  71 

  72    Process  4 out of 33

  73    ptr points not to the first neither to the last

  74    Peer[  3, 2] Tx---:nBitcoins 5  ---:> to Peer[ 5]   then update ledger

  75    There was a Tx, update Receptor new block 

  76    Receptor Peer:   5   next block: 4

  77    Rx, ptr points not to the first neither to the last

  78    Peer  5   accepts transfer: 5 in Col[4]   then update ledger

  79    Layout updated

  80    WORKSHEET 0  @[5, 5] FLOAT

  81               A       B       C       D       E 

  82          >-----------------------------------<

  83       3:      5       6       1       0       0 

  84       5:      5       9       8      13       0 

  85          <----------------------------------->

  86 

  87    Process  5 out of 33

  88    last col

  89    Peer  5    will transfer: 11 from Col[5] to row(Rx) 1   then update ledger

  90    There was a Tx, update Receptor new block 

  91    Receptor Peer:   1   next block: 2

  92    Rx, ptr points not to the first neither to the last

  93    Peer  1   accepts transfer: 11 in Col[2]   then update ledger

  94    Layout updated

  95    WORKSHEET 0  @[5, 5] FLOAT

  96               A       B       C       D       E 

  97          >-----------------------------------<

  98       1:      3      14       0       0       0 

  99       5:      5       9       8      13       2 

100          <----------------------------------->

101 

102    Process  6 out of 33

103    ptr points not to the first neither to the last

104    Peer[  3, 3] Tx---:nBitcoins 1  ---:> to Peer[ 2]   then update ledger

105    There was a Tx, update Receptor new block 

106    Receptor Peer:   2   next block: 3

107    Rx, ptr points not to the first neither to the last

108    Peer  2   accepts transfer: 1 in Col[3]   then update ledger

109    Layout updated

110    WORKSHEET 0  @[3, 5] FLOAT

111               A       B       C       D       E 

112          >-----------------------------------<

113       2:      7       3       4       0       0 

114       3:      5       6       1       0       0 

115          <----------------------------------->

116 

117    Process  7 out of 33

118    ptr to first col**

119    Peer  5 ---will transfer: 1 from Col[5] to row(Rx) 1   then update ledger

120    There was a Tx, update Receptor new block 

121    Receptor Peer:   1   next block: 3

122    Rx, ptr points not to the first neither to the last

123    Peer  1   accepts transfer: 1 in Col[3]   then update ledger

124    Layout updated

125    WORKSHEET 0  @[5, 5] FLOAT

126               A       B       C       D       E 

127          >-----------------------------------<

128       1:      3      14      15       0       0 

129       5:      1       9       8      13       2 

130          <----------------------------------->

131 

132    Process  8 out of 33

133    ptr points not to the first neither to the last

134    Peer[  5, 1] Tx---:nBitcoins 1  ---:> to Peer[ 3]   then update ledger

135    There was a Tx, update Receptor new block 

136    Receptor Peer:   3   next block: 5

137    ptr in last col

138    Peer[  3]   accepts transfer: 1 in Col[5]   then update ledger

139    Layout updated

140    WORKSHEET 0  @[5, 5] FLOAT

141               A       B       C       D       E 

142          >-----------------------------------<

143       3:      5       6       1       0       1 

144       5:      1       0       8      13       2 

145          <----------------------------------->

146 

147    Process  9 out of 33

148    ptr points not to the first neither to the last

149    Peer[  1, 3] Tx---:nBitcoins 8  ---:> to Peer[ 2]   then update ledger

150    There was a Tx, update Receptor new block 

151    Receptor Peer:   2   next block: 4

152    Rx, ptr points not to the first neither to the last

153    Peer  2   accepts transfer: 8 in Col[4]   then update ledger

154    Layout updated

155    WORKSHEET 0  @[2, 5] FLOAT

156               A       B       C       D       E 

157          >-----------------------------------<

158       1:      3      14      15       7       0 

159       2:      7       3       4      12       0 

160          <----------------------------------->

161 

162    Process 10 out of 33

163    last col

164    Peer  1    will transfer: 7 from Col[5] to row(Rx) 2   then update ledger

165    There was a Tx, update Receptor new block 

166    Receptor Peer:   2   next block: 5

167    ptr in last col

168    Peer[  2]   accepts transfer: 7 in Col[5]   then update ledger

169    Layout updated

170    WORKSHEET 0  @[2, 5] FLOAT

171               A       B       C       D       E 

172          >-----------------------------------<

173       1:      3      14      15       7       0 

174       2:      7       3       4      12      19 

175          <----------------------------------->

176 

177    Process 11 out of 33

178    ptr points not to the first neither to the last

179    Peer[4] has no funds available to transfer: 0

180    Layout updated

181    WORKSHEET 0  @[4, 5] FLOAT

182               A       B       C       D       E 

183          >-----------------------------------<

184       2:      7       3       4      12      19 

185       4:      3       0       0       0       0 

186          <----------------------------------->

187 

188    Process 12 out of 33

189    ptr points not to the first neither to the last

190    Peer[5] has no funds available to transfer: 0

191    Layout updated

192    WORKSHEET 0  @[5, 5] FLOAT

193               A       B       C       D       E 

194          >-----------------------------------<

195       2:      7       3       4      12      19 

196       5:      1       0       8      13       2 

197          <----------------------------------->

198 

199    Process 13 out of 33

200    ptr to first col**

201    Peer[1] has no funds available to transfer: 0

202    Layout updated

203    WORKSHEET 0  @[2, 5] FLOAT

204               A       B       C       D       E 

205          >-----------------------------------<

206       1:      3      14      15       7       0 

207       2:      7       3       4      12      19 

208          <----------------------------------->

209 

210    Process 14 out of 33

211    ptr to first col**

212    Peer[1] has no funds available to transfer: 0

213    Layout updated

214    WORKSHEET 0  @[2, 5] FLOAT

215               A       B       C       D       E 

216          >-----------------------------------<

217       1:      3      14      15       7       0 

218       2:      7       3       4      12      19 

219          <----------------------------------->

220 

221    Process 15 out of 33

222    ptr to first col**

223    Peer  2 ---will transfer: 12 from Col[5] to row(Rx) 4   then update ledger

224    There was a Tx, update Receptor new block 

225    Receptor Peer:   4   next block: 3

226    Rx, ptr points not to the first neither to the last

227    Peer  4   accepts transfer: 12 in Col[3]   then update ledger

228    Layout updated

229    WORKSHEET 0  @[4, 5] FLOAT

230               A       B       C       D       E 

231          >-----------------------------------<

232       2:      7       3       4      12      19 

233       4:      3       0      12       0       0 

234          <----------------------------------->

235 

236    Process 16 out of 33

237    ptr points not to the first neither to the last

238    Peer[  2, 1] Tx---:nBitcoins 2  ---:> to Peer[ 5]   then update ledger

239    There was a Tx, update Receptor new block 

240    Receptor Peer:   5   next block: 3

241    Rx, ptr points not to the first neither to the last

242    Peer  5   accepts transfer: 2 in Col[3]   then update ledger

243    Layout updated

244    WORKSHEET 0  @[5, 5] FLOAT

245               A       B       C       D       E 

246          >-----------------------------------<

247       2:      7       5       4      12      19 

248       5:      1       0       2      13       2 

249          <----------------------------------->

250 

251    Process 17 out of 33

252    ptr to first col**

253    Peer[1] has no funds available to transfer: 0

254    Layout updated

255    WORKSHEET 0  @[5, 5] FLOAT

256               A       B       C       D       E 

257          >-----------------------------------<

258       1:      3      14      15       7       0 

259       5:      1       0       2      13       2 

260          <----------------------------------->

261 

262    Process 18 out of 33

263    ptr points not to the first neither to the last

264    Peer[  2, 2] Tx---:nBitcoins 4  ---:> to Peer[ 5]   then update ledger

265    There was a Tx, update Receptor new block 

266    Receptor Peer:   5   next block: 4

267    Rx, ptr points not to the first neither to the last

268    Peer  5   accepts transfer: 4 in Col[4]   then update ledger

269    Layout updated

270    WORKSHEET 0  @[5, 5] FLOAT

271               A       B       C       D       E 

272          >-----------------------------------<

273       2:      7       5       1      12      19 

274       5:      1       0       2       6       2 

275          <----------------------------------->

276 

277    Process 19 out of 33

278    ptr points not to the first neither to the last

279    Peer[  4, 3] Tx---:nBitcoins 9  ---:> to Peer[ 2]   then update ledger

280    There was a Tx, update Receptor new block 

281    Receptor Peer:   2   next block: 4

282    Rx, ptr points not to the first neither to the last

283    Peer  2   accepts transfer: 9 in Col[4]   then update ledger

284    Layout updated

285    WORKSHEET 0  @[4, 5] FLOAT

286               A       B       C       D       E 

287          >-----------------------------------<

288       2:      7       5       1      10      19 

289       4:      3       0      12       3       0 

290          <----------------------------------->

291 

292    Process 20 out of 33

293    last col

294    Peer  4    will transfer: 2 from Col[5] to row(Rx) 3   then update ledger

295    There was a Tx, update Receptor new block 

296    Receptor Peer:   3   next block: 1

297    Rx first col

298    Peer  3   accepts transfer: 2 in Col[1]   then update ledger

299    Layout updated

300    WORKSHEET 0  @[4, 5] FLOAT

301               A       B       C       D       E 

302          >-----------------------------------<

303       3:      3       6       1       0       1 

304       4:      3       0      12       3       1 

305          <----------------------------------->

306 

307    Process 21 out of 33

308    ptr points not to the first neither to the last

309    Peer[  3, 1] Tx---:nBitcoins 1  ---:> to Peer[ 1]   then update ledger

310    There was a Tx, update Receptor new block 

311    Receptor Peer:   1   next block: 1

312    Rx first col

313    Peer  1   accepts transfer: 1 in Col[1]   then update ledger

314    Layout updated

315    WORKSHEET 0  @[3, 5] FLOAT

316               A       B       C       D       E 

317          >-----------------------------------<

318       1:      1      14      15       7       0 

319       3:      3       2       1       0       1 

320          <----------------------------------->

321 

322    Process 22 out of 33

323    last col

324    Peer  2    will transfer: 10 from Col[5] to row(Rx) 4   then update ledger

325    There was a Tx, update Receptor new block 

326    Receptor Peer:   4   next block: 1

327    Rx first col

328    Peer  4   accepts transfer: 10 in Col[1]   then update ledger

329    Layout updated

330    WORKSHEET 0  @[4, 5] FLOAT

331               A       B       C       D       E 

332          >-----------------------------------<

333       2:      7       5       1      10       0 

334       4:     11       0      12       3       1 

335          <----------------------------------->

336 

337    Process 23 out of 33

338    ptr points not to the first neither to the last

339    Peer[  1, 1] Tx---:nBitcoins 1  ---:> to Peer[ 3]   then update ledger

340    There was a Tx, update Receptor new block 

341    Receptor Peer:   3   next block: 3

342    Rx, ptr points not to the first neither to the last

343    Peer  3   accepts transfer: 1 in Col[3]   then update ledger

344    Layout updated

345    WORKSHEET 0  @[3, 5] FLOAT

346               A       B       C       D       E 

347          >-----------------------------------<

348       1:      1       0      15       7       0 

349       3:      3       2       3       0       1 

350          <----------------------------------->

351 

352    Process 24 out of 33

353    last col

354    Peer  5    will transfer: 6 from Col[5] to row(Rx) 3   then update ledger

355    There was a Tx, update Receptor new block 

356    Receptor Peer:   3   next block: 4

357    Rx, ptr points not to the first neither to the last

358    Peer  3   accepts transfer: 6 in Col[4]   then update ledger

359    Layout updated

360    WORKSHEET 0  @[5, 5] FLOAT

361               A       B       C       D       E 

362          >-----------------------------------<

363       3:      3       2       3       9       1 

364       5:      1       0       2       6       0 

365          <----------------------------------->

366 

367    Process 25 out of 33

368    ptr to first col**

369    Peer[2] has no funds available to transfer: 0

370    Layout updated

371    WORKSHEET 0  @[3, 5] FLOAT

372               A       B       C       D       E 

373          >-----------------------------------<

374       2:      7       5       1      10       0 

375       3:      3       2       3       9       1 

376          <----------------------------------->

377 

378    Process 26 out of 33

379    ptr points not to the first neither to the last

380    Peer[  4, 1] Tx---:nBitcoins 8  ---:> to Peer[ 1]   then update ledger

381    There was a Tx, update Receptor new block 

382    Receptor Peer:   1   next block: 3

383    Rx, ptr points not to the first neither to the last

384    Peer  1   accepts transfer: 8 in Col[3]   then update ledger

385    Layout updated

386    WORKSHEET 0  @[4, 5] FLOAT

387               A       B       C       D       E 

388          >-----------------------------------<

389       1:      1       0       8       7       0 

390       4:     11       3      12       3       1 

391          <----------------------------------->

392 

393    Process 27 out of 33

394    last col

395    Peer  3    will transfer: 6 from Col[5] to row(Rx) 2   then update ledger

396    There was a Tx, update Receptor new block 

397    Receptor Peer:   2   next block: 1

398    Rx first col

399    Peer  2   accepts transfer: 6 in Col[1]   then update ledger

400    Layout updated

401    WORKSHEET 0  @[3, 5] FLOAT

402               A       B       C       D       E 

403          >-----------------------------------<

404       2:      6       5       1      10       0 

405       3:      3       2       3       9       3 

406          <----------------------------------->

407 

408    Process 28 out of 33

409    ptr points not to the first neither to the last

410    Peer[  4, 2] Tx---:nBitcoins 3  ---:> to Peer[ 1]   then update ledger

411    There was a Tx, update Receptor new block 

412    Receptor Peer:   1   next block: 4

413    Rx, ptr points not to the first neither to the last

414    Peer  1   accepts transfer: 3 in Col[4]   then update ledger

415    Layout updated

416    WORKSHEET 0  @[4, 5] FLOAT

417               A       B       C       D       E 

418          >-----------------------------------<

419       1:      1       0       8      11       0 

420       4:     11       3       0       3       1 

421          <----------------------------------->

422 

423    Process 29 out of 33

424    last col

425    Peer  1    will transfer: 4 from Col[5] to row(Rx) 3   then update ledger

426    There was a Tx, update Receptor new block 

427    Receptor Peer:   3   next block: 1

428    Rx first col

429    Peer  3   accepts transfer: 4 in Col[1]   then update ledger

430    Layout updated

431    WORKSHEET 0  @[3, 5] FLOAT

432               A       B       C       D       E 

433          >-----------------------------------<

434       1:      1       0       8      11       7 

435       3:      7       2       3       9       3 

436          <----------------------------------->

437 

438    Process 30 out of 33

439    ptr points not to the first neither to the last

440    Peer[  2, 1] Tx---:nBitcoins 6  ---:> to Peer[ 5]   then update ledger

441    There was a Tx, update Receptor new block 

442    Receptor Peer:   5   next block: 1

443    Rx first col

444    Peer  5   accepts transfer: 6 in Col[1]   then update ledger

445    Layout updated

446    WORKSHEET 0  @[5, 5] FLOAT

447               A       B       C       D       E 

448          >-----------------------------------<

449       2:      6       0       1      10       0 

450       5:      6       0       2       6       0 

451          <----------------------------------->

452 

453    Process 31 out of 33

454    ptr points not to the first neither to the last

455    Peer[  5, 1] Tx---:nBitcoins 5  ---:> to Peer[ 3]   then update ledger

456    There was a Tx, update Receptor new block 

457    Receptor Peer:   3   next block: 2

458    Rx, ptr points not to the first neither to the last

459    Peer  3   accepts transfer: 5 in Col[2]   then update ledger

460    Layout updated

461    WORKSHEET 0  @[5, 5] FLOAT

462               A       B       C       D       E 

463          >-----------------------------------<

464       3:      7      12       3       9       3 

465       5:      6       1       2       6       0 

466          <----------------------------------->

467 

468    Process 32 out of 33

469    ptr points not to the first neither to the last

470    Peer[  3, 2] Tx---:nBitcoins 12  ---:> to Peer[ 4]   then update ledger

471    There was a Tx, update Receptor new block 

472    Receptor Peer:   4   next block: 4

473    Rx, ptr points not to the first neither to the last

474    Peer  4   accepts transfer: 12 in Col[4]   then update ledger

475    Layout updated

476    WORKSHEET 0  @[4, 5] FLOAT

477               A       B       C       D       E 

478          >-----------------------------------<

479       3:      7      12       0       9       3 

480       4:     11       3       0      12       1 

481          <----------------------------------->

482 

483    Process 33 out of 33

484    last col

485    Peer  4    will transfer: 2 from Col[5] to row(Rx) 2   then update ledger

486    There was a Tx, update Receptor new block 

487    Receptor Peer:   2   next block: 3

488    Rx, ptr points not to the first neither to the last

489    Peer  2   accepts transfer: 2 in Col[3]   then update ledger

490    Layout updated

491    WORKSHEET 0  @[4, 5] FLOAT

492               A       B       C       D       E 

493          >-----------------------------------<

494       2:      6       0       2      10       0 

495       4:     11       3       0      12      10 

496          <----------------------------------->

497 

498    Layout at the end

499    WORKSHEET 0  @[5, 5] FLOAT

500               A       B       C       D       E 

501          >-----------------------------------<

502       1:      1       0       8      11       7 

503       2:      6       0       2      10       0 

504       3:      7      12       0       9       3 

505       4:     11       3       0      12      10 

506       5:      6       1       2       6       0 

507          <----------------------------------->

508 

509    At the end, let's veryfiy Sum Up of bitCoins[peer, col] = val

510    Last block entry  [ 1,  5 ] =    10     current sum up = 10

511    Last block entry  [ 2,  3 ] =     2     current sum up = 12

512    Last block entry  [ 3,  3 ] =     0     current sum up = 12

513    Last block entry  [ 4,  5 ] =    10     current sum up = 22

514    Last block entry  [ 5,  2 ] =     1     current sum up = 23

515    Lets see last entry and verify bitCoins sum up  bicoinCheck =  23

516    ORIGINAL SEED Total Bitcoins available  20

517    ERROR!!!

518    

519    ENDS  bch3_2422   Elapsed Time: 0.924  sec

520    Boost version: 1.80.0

521 

522    EXIT FROM EXSAN 

Polulating ExSan with Market Data Tick by Tick
Previous         Low Latency Systematic Trading Algorithm         Next

+ + C   E x S a n   C + +
D o   N o t   A c c e p t   D e f a u l t s
T h i n k   D i f f e r e n t

Flag Counter

Comments

Popular posts from this blog

Blockchain Simulator - Hashing internal nodes of Merkle Tree - 13

Blockchain simulator - Sha256 Merkle Tree 12b

Simulator 09