Blockchain Simulator 08

ExSan++

   1 

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

   3                                                         Mon Jan 30 11:14:16 2023

   4 

   5 

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

   7     JOB:  bch3_1416

   8 

   9    BlockChainSimulator 3

  10     Generate Exsan ( 5 ,  5 )

  11 

  12 

  13    TEST   1 out of 3

  14    RANDOM GENERATED(peer in row, nBitcoins)

  15    ORIGINAL SEED Total Bitcoins available 14  page 0

  16    WORKSHEET 0  @[5, 5] FLOAT

  17               A       B       C       D       E 

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

  19       1:      0       0       0       0       0 

  20       2:      1       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 5

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

  29    Layout updated

  30    WORKSHEET 0  @[1, 5] FLOAT

  31               A       B       C       D       E 

  32          >-----------------------------------<

  33       1:      0       0       0       0       0 

  34          <----------------------------------->

  35 

  36    Process  2 out of 5

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

  38    Layout updated

  39    WORKSHEET 0  @[1, 5] FLOAT

  40               A       B       C       D       E 

  41          >-----------------------------------<

  42       1:      0       0       0       0       0 

  43          <----------------------------------->

  44 

  45    Process  3 out of 5

  46    ptr points not to the first neither to the last

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

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

  49    Peer  4   accepts transfer: 1 in Col[2]   then update ledger

  50    Layout updated

  51    WORKSHEET 0  @[5, 5] FLOAT

  52               A       B       C       D       E 

  53          >-----------------------------------<

  54       4:      3       4       0       0       0 

  55       5:      5       4       0       0       0 

  56          <----------------------------------->

  57 

  58    Process  4 out of 5

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

  60    Layout updated

  61    WORKSHEET 0  @[4, 5] FLOAT

  62               A       B       C       D       E 

  63          >-----------------------------------<

  64       1:      0       0       0       0       0 

  65       4:      3       4       0       0       0 

  66          <----------------------------------->

  67 

  68    Process  5 out of 5

  69    ptr points not to the first neither to the last

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

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

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

  73    Layout updated

  74    WORKSHEET 0  @[5, 5] FLOAT

  75               A       B       C       D       E 

  76          >-----------------------------------<

  77       4:      3       4       1       0       0 

  78       5:      5       4       7       0       0 

  79          <----------------------------------->

  80 

  81    Layout at the end

  82    WORKSHEET 0  @[5, 5] FLOAT

  83               A       B       C       D       E 

  84          >-----------------------------------<

  85       1:      0       0       0       0       0 

  86       2:      1       0       0       0       0 

  87       3:      5       0       0       0       0 

  88       4:      3       4       1       0       0 

  89       5:      5       4       7       0       0 

  90          <----------------------------------->

  91 

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

  93             Lets see last entry and verify bitCoins sum up  bicoinCheck =   0

  94             ORIGINAL SEED Total Bitcoins available  14

  95    ERROR!!!

  96 

  97 

  98 

  99 

100 

101    TEST   2 out of 3

102    RANDOM GENERATED(peer in row, nBitcoins)

103    ORIGINAL SEED Total Bitcoins available 5  page 0

104    WORKSHEET 0  @[4, 3] FLOAT

105               A       B       C 

106          >---------------------<

107       1:      1       0       0 

108       2:      3       0       0 

109       3:      0       0       0 

110       4:      1       0       0 

111          <--------------------->

112 

113    Simmulation random peer and bitcoins to traded

114    Process  1 out of 5

115    ptr points not to the first neither to the last

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

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

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

119    Layout updated

120    WORKSHEET 0  @[4, 3] FLOAT

121               A       B       C 

122          >---------------------<

123       2:      3       4       0 

124       4:      1       0       0 

125          <--------------------->

126 

127    Process  2 out of 5

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

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

130    Layout updated

131    WORKSHEET 0  @[3, 3] FLOAT

132               A       B       C 

133          >---------------------<

134       2:      3       4       0 

135       3:      4       0       0 

136          <--------------------->

137 

138    Process  3 out of 5

139    ptr points not to the first neither to the last

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

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

142    Layout updated

143    WORKSHEET 0  @[4, 3] FLOAT

144               A       B       C 

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

146       3:      4       2       0 

147       4:      1       0       2 

148          <--------------------->

149 

150    Process  4 out of 5

151    ptr points not to the first neither to the last

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

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

154    Layout updated

155    WORKSHEET 0  @[4, 3] FLOAT

156               A       B       C 

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

158       1:      1       0       0 

159       4:      3       0       2 

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

161 

162    Process  5 out of 5

163    ptr points not to the first neither to the last

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

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

166    Layout updated

167    WORKSHEET 0  @[4, 3] FLOAT

168               A       B       C 

169          >---------------------<

170       2:      2       4       0 

171       4:      3       1       2 

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

173 

174    Layout at the end

175    WORKSHEET 0  @[4, 3] FLOAT

176               A       B       C 

177          >---------------------<

178       1:      1       0       0 

179       2:      2       4       0 

180       3:      4       2       0 

181       4:      3       1       2 

182          <--------------------->

183 

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

185             Lets see last entry and verify bitCoins sum up  bicoinCheck =   0

186             ORIGINAL SEED Total Bitcoins available   5

187    ERROR!!!

188 

189 

190 

191 

192 

193    TEST   3 out of 3

194    RANDOM GENERATED(peer in row, nBitcoins)

195    ORIGINAL SEED Total Bitcoins available 16  page 0

196    WORKSHEET 0  @[5, 4] FLOAT

197               A       B       C       D 

198          >----------------------------<

199       1:      1       0       0       0 

200       2:      6       0       0       0 

201       3:      4       0       0       0 

202       4:      3       0       0       0 

203       5:      2       0       0       0 

204          <---------------------------->

205 

206    Simmulation random peer and bitcoins to traded

207    Process  1 out of 5

208    ptr points not to the first neither to the last

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

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

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

212    Layout updated

213    WORKSHEET 0  @[4, 4] FLOAT

214               A       B       C       D 

215          >----------------------------<

216       2:      6       8       0       0 

217       4:      3       1       0       0 

218          <---------------------------->

219 

220    Process  2 out of 5

221    ptr points not to the first neither to the last

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

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

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

225    Layout updated

226    WORKSHEET 0  @[4, 4] FLOAT

227               A       B       C       D 

228          >----------------------------<

229       2:      6       8       9       0 

230       4:      3       1       0       0 

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

232 

233    Process  3 out of 5

234    ptr points not to the first neither to the last

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

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

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

238    Layout updated

239    WORKSHEET 0  @[3, 4] FLOAT

240               A       B       C       D 

241          >----------------------------<

242       1:      1       4       0       0 

243       3:      4       1       0       0 

244          <---------------------------->

245 

246    Process  4 out of 5

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

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

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

250    Layout updated

251    WORKSHEET 0  @[3, 4] FLOAT

252               A       B       C       D 

253          >----------------------------<

254       2:      6       8       9       4 

255       3:      4       1       6       0 

256          <---------------------------->

257 

258    Process  5 out of 5

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

260    Layout updated

261    WORKSHEET 0  @[4, 4] FLOAT

262               A       B       C       D 

263          >----------------------------<

264       3:      4       1       6       0 

265       4:      3       1       0       0 

266          <---------------------------->

267 

268    Layout at the end

269    WORKSHEET 0  @[5, 4] FLOAT

270               A       B       C       D 

271          >----------------------------<

272       1:      1       4       0       0 

273       2:      6       8       9       4 

274       3:      4       1       6       0 

275       4:      3       1       0       0 

276       5:      2       0       0       0 

277          <---------------------------->

278 

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

280             Lets see last entry and verify bitCoins sum up  bicoinCheck =   0

281             ORIGINAL SEED Total Bitcoins available  16

282    ERROR!!!

283 

284 

285 

286 

287    

288    ENDS  bch3_1416   Elapsed Time: 1.414  sec

289    Boost version: 1.80.0

290 

291    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