osbc 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +7 -0
  2. data/.env +5 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +273 -0
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +5 -0
  7. data/CODE_OF_CONDUCT.md +84 -0
  8. data/Dockerfile +17 -0
  9. data/Gemfile +109 -0
  10. data/Gemfile.lock +343 -0
  11. data/LICENSE.md +21 -0
  12. data/LICENSE.txt +21 -0
  13. data/Procfile +3 -0
  14. data/Procfile.dev +2 -0
  15. data/README.md +185 -0
  16. data/Rakefile +6 -0
  17. data/app/assets/builds/.keep +0 -0
  18. data/app/assets/config/manifest.js +5 -0
  19. data/app/assets/images/.keep +0 -0
  20. data/app/assets/images/bg.png +0 -0
  21. data/app/assets/images/gimage.png +0 -0
  22. data/app/assets/images/image.png +0 -0
  23. data/app/assets/images/logo.png +0 -0
  24. data/app/assets/images/outerspc.jpg +0 -0
  25. data/app/assets/images/proxy.jpg +0 -0
  26. data/app/assets/images/space.jpg +0 -0
  27. data/app/assets/images/space_four.jpg +0 -0
  28. data/app/assets/images/space_t.jpg +0 -0
  29. data/app/assets/images/space_th.jpg +0 -0
  30. data/app/assets/images/space_two.jpg +0 -0
  31. data/app/assets/images/th.jpg +0 -0
  32. data/app/assets/stylesheets/application.css +344 -0
  33. data/app/assets/stylesheets/application.tailwind.css +13 -0
  34. data/app/assets/stylesheets/home.css +0 -0
  35. data/app/channels/application_cable/channel.rb +6 -0
  36. data/app/channels/application_cable/connection.rb +6 -0
  37. data/app/controllers/api/v1/block_confirmations_controller.rb +65 -0
  38. data/app/controllers/application_controller.rb +72 -0
  39. data/app/controllers/blocks_controller.rb +20 -0
  40. data/app/controllers/chains_controller.rb +72 -0
  41. data/app/controllers/concerns/.keep +0 -0
  42. data/app/controllers/contracts_controller.rb +25 -0
  43. data/app/controllers/pools_controller.rb +73 -0
  44. data/app/controllers/signatures_controller.rb +25 -0
  45. data/app/controllers/tickets_controller.rb +76 -0
  46. data/app/controllers/transactions_controller.rb +48 -0
  47. data/app/controllers/users/confirmations_controller.rb +30 -0
  48. data/app/controllers/users/omniauth_callbacks_controller.rb +30 -0
  49. data/app/controllers/users/passwords_controller.rb +34 -0
  50. data/app/controllers/users/registrations_controller.rb +61 -0
  51. data/app/controllers/users/sessions_controller.rb +27 -0
  52. data/app/controllers/users/unlocks_controller.rb +30 -0
  53. data/app/controllers/wallets_controller.rb +18 -0
  54. data/app/helpers/application_helper.rb +4 -0
  55. data/app/helpers/blocks_helper.rb +4 -0
  56. data/app/helpers/chains_helper.rb +4 -0
  57. data/app/helpers/contracts_helper.rb +4 -0
  58. data/app/helpers/pools_helper.rb +4 -0
  59. data/app/helpers/signatures_helper.rb +4 -0
  60. data/app/helpers/tickets_helper.rb +4 -0
  61. data/app/helpers/transactions_helper.rb +4 -0
  62. data/app/helpers/wallets_helper.rb +4 -0
  63. data/app/javascript/application.js +3 -0
  64. data/app/javascript/controllers/application.js +9 -0
  65. data/app/javascript/controllers/hello_controller.js +7 -0
  66. data/app/javascript/controllers/index.js +11 -0
  67. data/app/jobs/application_job.rb +9 -0
  68. data/app/mailers/application_mailer.rb +6 -0
  69. data/app/models/acceptable_number_sequence.rb +4 -0
  70. data/app/models/acceptable_symbol_sequence.rb +4 -0
  71. data/app/models/acceptable_word.rb +4 -0
  72. data/app/models/application_record.rb +5 -0
  73. data/app/models/block.rb +17 -0
  74. data/app/models/chain.rb +10 -0
  75. data/app/models/concerns/.keep +0 -0
  76. data/app/models/concerns/sequences_validator.rb +30 -0
  77. data/app/models/concerns/wallet_exists_validator.rb +13 -0
  78. data/app/models/contract.rb +7 -0
  79. data/app/models/pool.rb +5 -0
  80. data/app/models/signature.rb +12 -0
  81. data/app/models/ticket.rb +11 -0
  82. data/app/models/transaction.rb +25 -0
  83. data/app/models/user.rb +44 -0
  84. data/app/models/wallet.rb +33 -0
  85. data/app/services/application_service.rb +23 -0
  86. data/app/services/assign_contracts_service.rb +162 -0
  87. data/app/services/create_ticket_service.rb +87 -0
  88. data/app/services/create_wallet_service.rb +20 -0
  89. data/app/services/transaction_to_block_service.rb +62 -0
  90. data/app/views/application/_featured_board.html.erb +77 -0
  91. data/app/views/application/home.html.slim +1 -0
  92. data/app/views/application/mining_profile.html.slim +59 -0
  93. data/app/views/application/privacy_policy.html.erb +0 -0
  94. data/app/views/application/terms.html.erb +0 -0
  95. data/app/views/blocks/_block.html.slim +13 -0
  96. data/app/views/blocks/_block.json.jbuilder +4 -0
  97. data/app/views/blocks/_form.html.slim +26 -0
  98. data/app/views/blocks/edit.html.slim +10 -0
  99. data/app/views/blocks/index.html.slim +12 -0
  100. data/app/views/blocks/index.json.jbuilder +3 -0
  101. data/app/views/blocks/new.html.slim +8 -0
  102. data/app/views/blocks/show.html.slim +8 -0
  103. data/app/views/blocks/show.json.jbuilder +3 -0
  104. data/app/views/chains/_chain.html.slim +16 -0
  105. data/app/views/chains/_chain.json.jbuilder +4 -0
  106. data/app/views/chains/_form.html.slim +30 -0
  107. data/app/views/chains/edit.html.slim +10 -0
  108. data/app/views/chains/index.html.slim +11 -0
  109. data/app/views/chains/index.json.jbuilder +3 -0
  110. data/app/views/chains/new.html.slim +8 -0
  111. data/app/views/chains/show.html.slim +10 -0
  112. data/app/views/chains/show.json.jbuilder +3 -0
  113. data/app/views/contracts/_contract.html.slim +8 -0
  114. data/app/views/contracts/_contract.json.jbuilder +4 -0
  115. data/app/views/contracts/_form.html.slim +34 -0
  116. data/app/views/contracts/edit.html.slim +10 -0
  117. data/app/views/contracts/index.html.slim +12 -0
  118. data/app/views/contracts/index.json.jbuilder +3 -0
  119. data/app/views/contracts/new.html.slim +8 -0
  120. data/app/views/contracts/show.html.slim +8 -0
  121. data/app/views/contracts/show.json.jbuilder +3 -0
  122. data/app/views/layouts/_alert.html.slim +6 -0
  123. data/app/views/layouts/_navbar.html.slim +27 -0
  124. data/app/views/layouts/_notice.html.slim +6 -0
  125. data/app/views/layouts/application.html.erb +32 -0
  126. data/app/views/layouts/mailer.html.erb +13 -0
  127. data/app/views/layouts/mailer.text.erb +1 -0
  128. data/app/views/pools/_form.html.slim +30 -0
  129. data/app/views/pools/_pool.html.slim +16 -0
  130. data/app/views/pools/_pool.json.jbuilder +4 -0
  131. data/app/views/pools/edit.html.slim +10 -0
  132. data/app/views/pools/index.html.slim +12 -0
  133. data/app/views/pools/index.json.jbuilder +3 -0
  134. data/app/views/pools/new.html.slim +8 -0
  135. data/app/views/pools/show.html.slim +8 -0
  136. data/app/views/pools/show.json.jbuilder +3 -0
  137. data/app/views/signatures/_form.html.slim +46 -0
  138. data/app/views/signatures/_signature.html.slim +28 -0
  139. data/app/views/signatures/_signature.json.jbuilder +4 -0
  140. data/app/views/signatures/edit.html.slim +10 -0
  141. data/app/views/signatures/index.html.slim +10 -0
  142. data/app/views/signatures/index.json.jbuilder +3 -0
  143. data/app/views/signatures/new.html.slim +8 -0
  144. data/app/views/signatures/show.html.slim +10 -0
  145. data/app/views/signatures/show.json.jbuilder +3 -0
  146. data/app/views/tickets/_form.html.slim +26 -0
  147. data/app/views/tickets/_ticket.html.slim +10 -0
  148. data/app/views/tickets/_ticket.json.jbuilder +4 -0
  149. data/app/views/tickets/edit.html.slim +10 -0
  150. data/app/views/tickets/index.html.slim +16 -0
  151. data/app/views/tickets/index.json.jbuilder +3 -0
  152. data/app/views/tickets/new.html.slim +10 -0
  153. data/app/views/tickets/show.html.slim +8 -0
  154. data/app/views/tickets/show.json.jbuilder +3 -0
  155. data/app/views/transactions/_form.html.slim +16 -0
  156. data/app/views/transactions/_transaction.html.slim +24 -0
  157. data/app/views/transactions/_transaction.json.jbuilder +4 -0
  158. data/app/views/transactions/edit.html.slim +10 -0
  159. data/app/views/transactions/index.html.slim +19 -0
  160. data/app/views/transactions/index.json.jbuilder +3 -0
  161. data/app/views/transactions/new.html.slim +9 -0
  162. data/app/views/transactions/show.html.slim +8 -0
  163. data/app/views/transactions/show.json.jbuilder +3 -0
  164. data/app/views/users/confirmations/new.html.erb +16 -0
  165. data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
  166. data/app/views/users/mailer/email_changed.html.erb +7 -0
  167. data/app/views/users/mailer/password_change.html.erb +3 -0
  168. data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
  169. data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
  170. data/app/views/users/passwords/edit.html.erb +25 -0
  171. data/app/views/users/passwords/new.html.erb +16 -0
  172. data/app/views/users/registrations/edit.html.erb +43 -0
  173. data/app/views/users/registrations/new.html.erb +37 -0
  174. data/app/views/users/sessions/new.html.erb +30 -0
  175. data/app/views/users/shared/_error_messages.html.erb +15 -0
  176. data/app/views/users/shared/_links.html.erb +25 -0
  177. data/app/views/users/unlocks/new.html.erb +16 -0
  178. data/app/views/wallets/_form.html.slim +30 -0
  179. data/app/views/wallets/_wallet.html.slim +13 -0
  180. data/app/views/wallets/_wallet.json.jbuilder +4 -0
  181. data/app/views/wallets/edit.html.slim +10 -0
  182. data/app/views/wallets/index.html.slim +18 -0
  183. data/app/views/wallets/index.json.jbuilder +3 -0
  184. data/app/views/wallets/new.html.slim +8 -0
  185. data/app/views/wallets/show.html.slim +11 -0
  186. data/app/views/wallets/show.json.jbuilder +3 -0
  187. data/app/workers/application_worker.rb +82 -0
  188. data/app/workers/assign_contract_worker.rb +27 -0
  189. data/app/workers/create_ticket_worker.rb +23 -0
  190. data/app/workers/create_wallet_worker.rb +21 -0
  191. data/app/workers/transaction_to_block_worker.rb +48 -0
  192. data/bin/bundle +114 -0
  193. data/bin/console +15 -0
  194. data/bin/dev +9 -0
  195. data/bin/importmap +5 -0
  196. data/bin/osbc +77 -0
  197. data/bin/rails +6 -0
  198. data/bin/rake +6 -0
  199. data/bin/setup +35 -0
  200. data/config/application.rb +25 -0
  201. data/config/boot.rb +6 -0
  202. data/config/cable.yml +10 -0
  203. data/config/credentials.yml.enc +1 -0
  204. data/config/database.yml +21 -0
  205. data/config/environment.rb +7 -0
  206. data/config/environments/development.rb +73 -0
  207. data/config/environments/production.rb +95 -0
  208. data/config/environments/test.rb +62 -0
  209. data/config/importmap.rb +9 -0
  210. data/config/initializers/assets.rb +14 -0
  211. data/config/initializers/content_security_policy.rb +26 -0
  212. data/config/initializers/devise.rb +311 -0
  213. data/config/initializers/filter_parameter_logging.rb +10 -0
  214. data/config/initializers/inflections.rb +17 -0
  215. data/config/initializers/permissions_policy.rb +12 -0
  216. data/config/locales/devise.en.yml +65 -0
  217. data/config/locales/en.yml +33 -0
  218. data/config/puma.rb +45 -0
  219. data/config/routes/api.rb +9 -0
  220. data/config/routes.rb +30 -0
  221. data/config/sidekiq.yml +10 -0
  222. data/config/storage.yml +34 -0
  223. data/config/tailwind.config.js +23 -0
  224. data/config.ru +8 -0
  225. data/coverage/.last_run.json +5 -0
  226. data/coverage/.resultset.json +1853 -0
  227. data/coverage/.resultset.json.lock +0 -0
  228. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
  229. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
  230. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
  231. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
  232. data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
  233. data/coverage/assets/0.12.3/application.css +1 -0
  234. data/coverage/assets/0.12.3/application.js +7 -0
  235. data/coverage/assets/0.12.3/colorbox/border.png +0 -0
  236. data/coverage/assets/0.12.3/colorbox/controls.png +0 -0
  237. data/coverage/assets/0.12.3/colorbox/loading.gif +0 -0
  238. data/coverage/assets/0.12.3/colorbox/loading_background.png +0 -0
  239. data/coverage/assets/0.12.3/favicon_green.png +0 -0
  240. data/coverage/assets/0.12.3/favicon_red.png +0 -0
  241. data/coverage/assets/0.12.3/favicon_yellow.png +0 -0
  242. data/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  243. data/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  244. data/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  245. data/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  246. data/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  247. data/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  248. data/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  249. data/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  250. data/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png +0 -0
  251. data/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png +0 -0
  252. data/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png +0 -0
  253. data/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png +0 -0
  254. data/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png +0 -0
  255. data/coverage/assets/0.12.3/loading.gif +0 -0
  256. data/coverage/assets/0.12.3/magnify.png +0 -0
  257. data/coverage/index.html +20731 -0
  258. data/db/migrate/20221018053949_devise_create_users.rb +45 -0
  259. data/db/migrate/20221019002956_create_chains.rb +13 -0
  260. data/db/migrate/20221020112137_create_blocks.rb +12 -0
  261. data/db/migrate/20221020123102_add_chain_to_blocks.rb +5 -0
  262. data/db/migrate/20221020150504_create_wallets.rb +13 -0
  263. data/db/migrate/20221022221059_create_transactions.rb +20 -0
  264. data/db/migrate/20221023011005_add_block_to_transactions.rb +5 -0
  265. data/db/migrate/20221023014707_create_contracts.rb +11 -0
  266. data/db/migrate/20221023040749_create_pools.rb +13 -0
  267. data/db/migrate/20221023041015_create_tickets.rb +11 -0
  268. data/db/migrate/20221023103509_add_contracts_count_to_block.rb +6 -0
  269. data/db/migrate/20221023110613_add_acceptable_word_list_to_users.rb +7 -0
  270. data/db/migrate/20221023113539_create_signatures.rb +19 -0
  271. data/db/migrate/20221023113750_create_acceptable_words.rb +9 -0
  272. data/db/migrate/20221023114152_create_acceptable_number_sequences.rb +9 -0
  273. data/db/migrate/20221023114203_create_acceptable_symbol_sequences.rb +9 -0
  274. data/db/migrate/20221023114324_add_user_acceptable_hash_to_tickets.rb +7 -0
  275. data/db/migrate/20221023114408_add_time_ref_to_tickets.rb +5 -0
  276. data/db/migrate/20221024125047_add_master_hash_to_blocks.rb +5 -0
  277. data/db/migrate/20221109161845_add_transactions_count_to_blocks.rb +5 -0
  278. data/db/migrate/20221117135003_add_balance_to_chains.rb +5 -0
  279. data/db/migrate/20221117203417_add_transaction_id_list_to_tickets.rb +5 -0
  280. data/db/migrate/20221118080357_add_api_keys_to_users.rb +6 -0
  281. data/db/schema.rb +179 -0
  282. data/db/seeds.rb +134 -0
  283. data/docker-compose.yml +53 -0
  284. data/entrypoint.sh +8 -0
  285. data/lib/assets/.keep +0 -0
  286. data/lib/osbc/osbc.rb +9 -0
  287. data/lib/outerspace/blockchain/version.rb +7 -0
  288. data/lib/outerspace/blockchain.rb +10 -0
  289. data/lib/tasks/.keep +0 -0
  290. data/lib/tasks/compose.rake +92 -0
  291. data/lib/tasks/compose_db.rake +71 -0
  292. data/lib/tasks/compose_logs.rake +95 -0
  293. data/lib/tasks/compose_test.rake +62 -0
  294. data/log/.keep +0 -0
  295. data/mining_concept.ipynb +284 -0
  296. data/outerspace-blockchain.gemspec +50 -0
  297. data/public/404.html +67 -0
  298. data/public/422.html +67 -0
  299. data/public/500.html +66 -0
  300. data/public/apple-touch-icon-precomposed.png +0 -0
  301. data/public/apple-touch-icon.png +0 -0
  302. data/public/favicon.ico +0 -0
  303. data/public/robots.txt +1 -0
  304. data/storage/.keep +0 -0
  305. data/tmp/.keep +0 -0
  306. data/tmp/pids/.keep +0 -0
  307. data/tmp/storage/.keep +0 -0
  308. data/vendor/.keep +0 -0
  309. data/vendor/javascript/.keep +0 -0
  310. metadata +643 -0
data/Gemfile.lock ADDED
@@ -0,0 +1,343 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actioncable (7.0.4)
5
+ actionpack (= 7.0.4)
6
+ activesupport (= 7.0.4)
7
+ nio4r (~> 2.0)
8
+ websocket-driver (>= 0.6.1)
9
+ actionmailbox (7.0.4)
10
+ actionpack (= 7.0.4)
11
+ activejob (= 7.0.4)
12
+ activerecord (= 7.0.4)
13
+ activestorage (= 7.0.4)
14
+ activesupport (= 7.0.4)
15
+ mail (>= 2.7.1)
16
+ net-imap
17
+ net-pop
18
+ net-smtp
19
+ actionmailer (7.0.4)
20
+ actionpack (= 7.0.4)
21
+ actionview (= 7.0.4)
22
+ activejob (= 7.0.4)
23
+ activesupport (= 7.0.4)
24
+ mail (~> 2.5, >= 2.5.4)
25
+ net-imap
26
+ net-pop
27
+ net-smtp
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (7.0.4)
30
+ actionview (= 7.0.4)
31
+ activesupport (= 7.0.4)
32
+ rack (~> 2.0, >= 2.2.0)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (7.0.4)
37
+ actionpack (= 7.0.4)
38
+ activerecord (= 7.0.4)
39
+ activestorage (= 7.0.4)
40
+ activesupport (= 7.0.4)
41
+ globalid (>= 0.6.0)
42
+ nokogiri (>= 1.8.5)
43
+ actionview (7.0.4)
44
+ activesupport (= 7.0.4)
45
+ builder (~> 3.1)
46
+ erubi (~> 1.4)
47
+ rails-dom-testing (~> 2.0)
48
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
+ activejob (7.0.4)
50
+ activesupport (= 7.0.4)
51
+ globalid (>= 0.3.6)
52
+ activemodel (7.0.4)
53
+ activesupport (= 7.0.4)
54
+ activerecord (7.0.4)
55
+ activemodel (= 7.0.4)
56
+ activesupport (= 7.0.4)
57
+ activerecord-import (1.4.1)
58
+ activerecord (>= 4.2)
59
+ activestorage (7.0.4)
60
+ actionpack (= 7.0.4)
61
+ activejob (= 7.0.4)
62
+ activerecord (= 7.0.4)
63
+ activesupport (= 7.0.4)
64
+ marcel (~> 1.0)
65
+ mini_mime (>= 1.1.0)
66
+ activesupport (7.0.4)
67
+ concurrent-ruby (~> 1.0, >= 1.0.2)
68
+ i18n (>= 1.6, < 2)
69
+ minitest (>= 5.1)
70
+ tzinfo (~> 2.0)
71
+ addressable (2.8.1)
72
+ public_suffix (>= 2.0.2, < 6.0)
73
+ ast (2.4.2)
74
+ bcrypt (3.1.18)
75
+ bindex (0.8.1)
76
+ bootsnap (1.13.0)
77
+ msgpack (~> 1.2)
78
+ builder (3.2.4)
79
+ capybara (3.37.1)
80
+ addressable
81
+ matrix
82
+ mini_mime (>= 0.1.3)
83
+ nokogiri (~> 1.8)
84
+ rack (>= 1.6.0)
85
+ rack-test (>= 0.6.3)
86
+ regexp_parser (>= 1.5, < 3.0)
87
+ xpath (~> 3.2)
88
+ childprocess (4.1.0)
89
+ concurrent-ruby (1.1.10)
90
+ connection_pool (2.3.0)
91
+ crass (1.0.6)
92
+ database_cleaner-active_record (2.0.1)
93
+ activerecord (>= 5.a)
94
+ database_cleaner-core (~> 2.0.0)
95
+ database_cleaner-core (2.0.1)
96
+ debug (1.6.2)
97
+ irb (>= 1.3.6)
98
+ reline (>= 0.3.1)
99
+ devise (4.8.1)
100
+ bcrypt (~> 3.0)
101
+ orm_adapter (~> 0.1)
102
+ railties (>= 4.1.0)
103
+ responders
104
+ warden (~> 1.2.3)
105
+ diff-lcs (1.5.0)
106
+ docile (1.4.0)
107
+ erubi (1.11.0)
108
+ factory_bot (6.2.1)
109
+ activesupport (>= 5.0.0)
110
+ factory_bot_rails (6.2.0)
111
+ factory_bot (~> 6.2.0)
112
+ railties (>= 5.0.0)
113
+ faker (2.23.0)
114
+ i18n (>= 1.8.11, < 2)
115
+ globalid (1.0.0)
116
+ activesupport (>= 5.0)
117
+ i18n (1.12.0)
118
+ concurrent-ruby (~> 1.0)
119
+ importmap-rails (1.1.5)
120
+ actionpack (>= 6.0.0)
121
+ railties (>= 6.0.0)
122
+ io-console (0.5.11)
123
+ irb (1.4.2)
124
+ reline (>= 0.3.0)
125
+ jbuilder (2.11.5)
126
+ actionview (>= 5.0.0)
127
+ activesupport (>= 5.0.0)
128
+ json (2.5.1)
129
+ loofah (2.19.0)
130
+ crass (~> 1.0.2)
131
+ nokogiri (>= 1.5.9)
132
+ mail (2.7.1)
133
+ mini_mime (>= 0.1.1)
134
+ marcel (1.0.2)
135
+ matrix (0.4.2)
136
+ method_source (1.0.0)
137
+ mini_mime (1.1.2)
138
+ minitest (5.16.3)
139
+ msgpack (1.6.0)
140
+ net-imap (0.3.1)
141
+ net-protocol
142
+ net-pop (0.1.2)
143
+ net-protocol
144
+ net-protocol (0.1.3)
145
+ timeout
146
+ net-smtp (0.3.2)
147
+ net-protocol
148
+ nio4r (2.5.8)
149
+ nokogiri (1.13.8-x86_64-linux)
150
+ racc (~> 1.4)
151
+ orm_adapter (0.5.0)
152
+ parallel (1.22.1)
153
+ parser (3.1.2.1)
154
+ ast (~> 2.4.1)
155
+ pg (1.4.4)
156
+ public_suffix (5.0.0)
157
+ puma (5.6.5)
158
+ nio4r (~> 2.0)
159
+ racc (1.6.0)
160
+ rack (2.2.4)
161
+ rack-test (2.0.2)
162
+ rack (>= 1.3)
163
+ rails (7.0.4)
164
+ actioncable (= 7.0.4)
165
+ actionmailbox (= 7.0.4)
166
+ actionmailer (= 7.0.4)
167
+ actionpack (= 7.0.4)
168
+ actiontext (= 7.0.4)
169
+ actionview (= 7.0.4)
170
+ activejob (= 7.0.4)
171
+ activemodel (= 7.0.4)
172
+ activerecord (= 7.0.4)
173
+ activestorage (= 7.0.4)
174
+ activesupport (= 7.0.4)
175
+ bundler (>= 1.15.0)
176
+ railties (= 7.0.4)
177
+ rails-controller-testing (1.0.5)
178
+ actionpack (>= 5.0.1.rc1)
179
+ actionview (>= 5.0.1.rc1)
180
+ activesupport (>= 5.0.1.rc1)
181
+ rails-dom-testing (2.0.3)
182
+ activesupport (>= 4.2.0)
183
+ nokogiri (>= 1.6)
184
+ rails-html-sanitizer (1.4.3)
185
+ loofah (~> 2.3)
186
+ railties (7.0.4)
187
+ actionpack (= 7.0.4)
188
+ activesupport (= 7.0.4)
189
+ method_source
190
+ rake (>= 12.2)
191
+ thor (~> 1.0)
192
+ zeitwerk (~> 2.5)
193
+ rainbow (3.1.1)
194
+ rake (13.0.6)
195
+ redis (4.8.0)
196
+ regexp_parser (2.6.0)
197
+ reline (0.3.1)
198
+ io-console (~> 0.5)
199
+ responders (3.0.1)
200
+ actionpack (>= 5.0)
201
+ railties (>= 5.0)
202
+ rexml (3.2.5)
203
+ rspec-core (3.11.0)
204
+ rspec-support (~> 3.11.0)
205
+ rspec-expectations (3.11.1)
206
+ diff-lcs (>= 1.2.0, < 2.0)
207
+ rspec-support (~> 3.11.0)
208
+ rspec-mocks (3.11.1)
209
+ diff-lcs (>= 1.2.0, < 2.0)
210
+ rspec-support (~> 3.11.0)
211
+ rspec-rails (6.0.0)
212
+ actionpack (>= 6.1)
213
+ activesupport (>= 6.1)
214
+ railties (>= 6.1)
215
+ rspec-core (~> 3.11)
216
+ rspec-expectations (~> 3.11)
217
+ rspec-mocks (~> 3.11)
218
+ rspec-support (~> 3.11)
219
+ rspec-support (3.11.1)
220
+ rubocop (1.36.0)
221
+ json (~> 2.3)
222
+ parallel (~> 1.10)
223
+ parser (>= 3.1.2.1)
224
+ rainbow (>= 2.2.2, < 4.0)
225
+ regexp_parser (>= 1.8, < 3.0)
226
+ rexml (>= 3.2.5, < 4.0)
227
+ rubocop-ast (>= 1.20.1, < 2.0)
228
+ ruby-progressbar (~> 1.7)
229
+ unicode-display_width (>= 1.4.0, < 3.0)
230
+ rubocop-ast (1.22.0)
231
+ parser (>= 3.1.1.0)
232
+ rubocop-rails (2.16.1)
233
+ activesupport (>= 4.2.0)
234
+ rack (>= 1.1)
235
+ rubocop (>= 1.33.0, < 2.0)
236
+ rubocop-rspec (2.13.2)
237
+ rubocop (~> 1.33)
238
+ ruby-progressbar (1.11.0)
239
+ rubyzip (2.3.2)
240
+ selenium-webdriver (4.5.0)
241
+ childprocess (>= 0.5, < 5.0)
242
+ rexml (~> 3.2, >= 3.2.5)
243
+ rubyzip (>= 1.2.2, < 3.0)
244
+ websocket (~> 1.0)
245
+ shoulda-matchers (5.2.0)
246
+ activesupport (>= 5.2.0)
247
+ sidekiq (6.5.7)
248
+ connection_pool (>= 2.2.5)
249
+ rack (~> 2.0)
250
+ redis (>= 4.5.0, < 5)
251
+ simplecov (0.21.2)
252
+ docile (~> 1.1)
253
+ simplecov-html (~> 0.11)
254
+ simplecov_json_formatter (~> 0.1)
255
+ simplecov-html (0.12.3)
256
+ simplecov_json_formatter (0.1.4)
257
+ slim (4.1.0)
258
+ temple (>= 0.7.6, < 0.9)
259
+ tilt (>= 2.0.6, < 2.1)
260
+ slim-rails (3.5.1)
261
+ actionpack (>= 3.1)
262
+ railties (>= 3.1)
263
+ slim (>= 3.0, < 5.0)
264
+ sprockets (4.1.1)
265
+ concurrent-ruby (~> 1.0)
266
+ rack (> 1, < 3)
267
+ sprockets-rails (3.4.2)
268
+ actionpack (>= 5.2)
269
+ activesupport (>= 5.2)
270
+ sprockets (>= 3.0.0)
271
+ stimulus-rails (1.1.0)
272
+ railties (>= 6.0.0)
273
+ tailwindcss-rails (2.0.14-x86_64-linux)
274
+ railties (>= 6.0.0)
275
+ temple (0.8.2)
276
+ thor (1.2.1)
277
+ tilt (2.0.11)
278
+ timeout (0.3.0)
279
+ turbo-rails (1.3.1)
280
+ actionpack (>= 6.0.0)
281
+ activejob (>= 6.0.0)
282
+ railties (>= 6.0.0)
283
+ tzinfo (2.0.5)
284
+ concurrent-ruby (~> 1.0)
285
+ unicode-display_width (2.3.0)
286
+ warden (1.2.9)
287
+ rack (>= 2.0.9)
288
+ web-console (4.2.0)
289
+ actionview (>= 6.0.0)
290
+ activemodel (>= 6.0.0)
291
+ bindex (>= 0.4.0)
292
+ railties (>= 6.0.0)
293
+ webdrivers (5.2.0)
294
+ nokogiri (~> 1.6)
295
+ rubyzip (>= 1.3.0)
296
+ selenium-webdriver (~> 4.0)
297
+ websocket (1.2.9)
298
+ websocket-driver (0.7.5)
299
+ websocket-extensions (>= 0.1.0)
300
+ websocket-extensions (0.1.5)
301
+ xpath (3.2.0)
302
+ nokogiri (~> 1.8)
303
+ zeitwerk (2.6.1)
304
+
305
+ PLATFORMS
306
+ x86_64-linux
307
+
308
+ DEPENDENCIES
309
+ activerecord-import
310
+ bootsnap (~> 1.13)
311
+ capybara (~> 3.37)
312
+ database_cleaner-active_record (~> 2.0)
313
+ debug (~> 1.6)
314
+ devise (~> 4.8)
315
+ factory_bot_rails (~> 6.2)
316
+ faker (~> 2.23)
317
+ importmap-rails (~> 1.1)
318
+ jbuilder (~> 2.11)
319
+ pg (~> 1.4)
320
+ puma (~> 5.6)
321
+ rails (~> 7.0)
322
+ rails-controller-testing (~> 1.0)
323
+ rspec-rails (~> 6.0)
324
+ rubocop-rails (~> 2.16)
325
+ rubocop-rspec (~> 2.13)
326
+ selenium-webdriver (~> 4.5)
327
+ shoulda-matchers (~> 5.0)
328
+ sidekiq (~> 6.5)
329
+ simplecov (~> 0.21)
330
+ slim-rails (~> 3.5)
331
+ sprockets-rails (~> 3.4)
332
+ stimulus-rails (~> 1.1)
333
+ tailwindcss-rails (~> 2.0)
334
+ turbo-rails (~> 1.3)
335
+ tzinfo-data
336
+ web-console (~> 4.2)
337
+ webdrivers (~> 5.2)
338
+
339
+ RUBY VERSION
340
+ ruby 3.0.3p157
341
+
342
+ BUNDLED WITH
343
+ 2.2.32
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Igor Lima de Jesus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 JesusGautamah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Procfile ADDED
@@ -0,0 +1,3 @@
1
+ web: bin/rails server
2
+ css: bin/rails tailwindcss:watch
3
+ sidekiq: bundle exec sidekiq -C config/sidekiq.yml
data/Procfile.dev ADDED
@@ -0,0 +1,2 @@
1
+ web: bin/rails server -p 80 -b 0.0.0.0
2
+ css: bin/rails tailwindcss:watch
data/README.md ADDED
@@ -0,0 +1,185 @@
1
+ # <img src="https://outerspace-coding.herokuapp.com/assets/pq-70825bc795d25668cf4f11b06b990ed0d1c2cae887acce0625e5059226a7946a.png" width="25" height="25"> Outerspace Blockchain
2
+ <!-- Outerspace Logo -->
3
+ ### A Ruby implementation of web blockchain framework.
4
+ #### Developed using TDD (Test Driven Development).
5
+ #### Github Actions CI/CD pipeline.
6
+ #### Chrome Selenium tests are used to test the blockchain in a browser and its interaction with the blockchain.
7
+ #### Chrome Selenium are included in the docker compose without any additional setup.
8
+ #### Simplecov is used to test code coverage.
9
+
10
+ #### Rails Engine is used to create the blockchain.
11
+ #### Tailwind CSS is used to style the blockchain web interface.
12
+
13
+ #### Rspec is used to test the blockchain.
14
+
15
+ ## System dependencies
16
+ 1. Docker
17
+ 2. Postgresql
18
+ 3. Ruby
19
+ 4. Redis
20
+
21
+ * Ruby 3.0.3
22
+ * Compose Version 3.3
23
+ * Docker Image: ruby:3.0.3
24
+
25
+ * [Installation](#installation)
26
+ - [Docker](#docker) https://docs.docker.com/engine/install/
27
+ - [RVM](#rvm) https://rvm.io/rvm/install
28
+ - [Redis](#redis) https://redis.io/download
29
+ - [Postgres](#postgres) https://www.postgresql.org/download/
30
+ - [Rails](#rails) https://guides.rubyonrails.org/getting_started.html
31
+
32
+ ### Compile OSBC from source
33
+ ========================
34
+ <!-- Compile OSBC from source -->
35
+ Compile the gem from source with the following commands:
36
+ ```bash
37
+ git clone
38
+ cd outerspace-blockchain
39
+ bundle install
40
+ ```
41
+
42
+ ### Run OSBC
43
+ ========================
44
+ <!-- Run OSBC -->
45
+ Run the gem with the following command:
46
+ ```bash
47
+ bin/osbc
48
+ ```
49
+
50
+ ### Installation
51
+ ========================
52
+ <!-- Installation -->
53
+ Build and install the gem with the following commands:
54
+ ```bash
55
+ gem build osbc.gemspec
56
+ gem install osbc-GENERATED_VERSION.gem
57
+ ```
58
+
59
+ Use the gem with the following command:
60
+ ```bash
61
+ osbc PATH_TO_GENERATE_BLOCKCHAIN
62
+ ```
63
+ ## RVM Commands to install Ruby 3.0.3 and Compile the Gem
64
+ * `rvm install 3.0.3`
65
+ * `rvm use 3.0.3`
66
+ * `rvm gemset create outerspace`
67
+ * `rvm gemset use outerspace`
68
+ * `gem install bundler`
69
+ * `bundle install`
70
+ ## Environment Variables
71
+ The application has a .env file in root folder with the following environment variables:
72
+
73
+ FIRST_CHAIN_NAME=YOUR_CHAIN_NAME
74
+ FIRST_CHAIN_MAINTAINER=YOUR_NAME
75
+ CONTRACTS_LIMIT=100
76
+ SIGNATURES_LIMIT=5
77
+ ## Configuration
78
+ ### Rake tasks
79
+
80
+ This application has rake tasks to help you with the development process with docker.
81
+ The tasks are:
82
+ #### Docker actions
83
+ * `rake compose:install` - build docker compose and migrate the database
84
+ * `rake compose:build` - build docker compose services
85
+ * `rake compose:up` - start the docker compose services
86
+ * `rake compose:down` - stop the docker compose services
87
+ * `rake compose:db_detach` - detach the database from the docker compose services
88
+ * `rake compose:redis_detach` - detach the redis from the docker compose services
89
+ * `rake compose:back_detach` - detach the backend(redis, sidekiq, db) from the docker compose services
90
+ * `rake compose:restart` - restart the docker compose services
91
+ * `rake compose:clean_all` - clean all docker compose services
92
+ #### Database actions
93
+ * `rake compose_db:migrate` - migrate the database
94
+ * `rake compose_db:reset` - reset the database
95
+ * `rake compose_db:drop` - drop the database
96
+ * `rake compose_db:create` - create the database
97
+ * `rake compose_db:seed` - seed the database
98
+ * `rake compose_db:rollback` - rollback the database
99
+ * `rake compose_db:setup` - setup the database
100
+ * `rake compose_db:complete_setup` - complete setup the database
101
+ * `rake compose_db:reset_setup` - drop and setup the database
102
+ * `rake compose_db:reset` - reset the database
103
+
104
+ ### Tests actions
105
+ * `rake compose_test:all` - run all tests
106
+ * `rake compose_test:clean_all` - run all tests after cleaning docker compose services
107
+ * `rake compose_test:controllers` - run controllers tests
108
+ * `rake compose_test:models` - run models tests
109
+ * `rake compose_test:requests` - run requests tests
110
+ * `rake compose_test:helpers` - run helpers tests
111
+ * `rake compose_test:mailers` - run mailers tests
112
+ * `rake compose_test:routing` - run routing tests
113
+ * `rake compose_test:views` - run views tests
114
+
115
+ ### LOGS actions
116
+ * `rake compose_logs:web` - show web logs
117
+ * `rake compose_logs:db` - show db logs
118
+ * `rake compose_logs:redis` - show redis logs
119
+ * `rake compose_logs:sidekiq` - show sidekiq logs
120
+ * `rake compose_logs:all` - show all logs
121
+ * `rake compose_logs:tail_web` - tail web logs
122
+ * `rake compose_logs:tail_db` - tail db logs
123
+ * `rake compose_logs:tail_redis` - tail redis logs
124
+ * `rake compose_logs:tail_sidekiq` - tail sidekiq logs
125
+ * `rake compose_logs:tail_all` - tail all logs
126
+ * `rake compose_logs:follow_web` - follow web logs
127
+ * `rake compose_logs:follow_db` - follow db logs
128
+ * `rake compose_logs:follow_redis` - follow redis logs
129
+ * `rake compose_logs:follow_sidekiq` - follow sidekiq logs
130
+ * `rake compose_logs:follow_all` - follow all logs
131
+
132
+ ## Start the blockchain
133
+ ````bash
134
+ $ rake compose:up
135
+ ````
136
+ ### Access the blockchain web interface
137
+ http://localhost
138
+
139
+ ## Mining Concept
140
+ - Every user will have a **randomized acceptable word list**
141
+ - This word list will have three classes of words
142
+ 1. Common words
143
+ 2. Symbol Sequence
144
+ 3. Number Sequence
145
+
146
+ <p>
147
+ When a user want to mine a block, the user will open a ticket in the server
148
+ and after the ticket is open, the user will start to mine the block
149
+ </p>
150
+
151
+ <p>
152
+ The mine will depend of the contract signatures that will be formed by the server using the word list of the user
153
+ </p>
154
+
155
+
156
+ ## Steps to mine a block:
157
+
158
+ 1. The user will open a TICKET in the server
159
+ 2. The server will send a message to the user to start mining if the POOL is open
160
+ 3. The users will load the RANDOM WORD LIST provided by the server API
161
+ 4. The user have to use 1 common word, 1 symbol sequence and 1 number sequence, randomize the characters
162
+ 5. Transform the chartacters in a SHA256 hash
163
+ 6. Transform the block info in before ticket opened in a SHA256 hash
164
+ 5. Transform (Chars SHA256 hash + block info hash) in a SHA256 hash
165
+ 6. If the hash is valid, the user will send the hash to the server
166
+ 7. The server will check if the hash is valid
167
+ 8. If the hash is valid, check if the same transactions have the same block state confirmation
168
+ 9. If this transactions was not confirmed at this point at block history the server will add the user signature to the transaction contract
169
+ 10. The block only can be hashed when the minimum number of contracts valids with minimum number of signatures is reached
170
+ 11. The server will use the signature timeline to determine what transactions will be added to the block
171
+ 12. The server will calculate the master hash after confirm all valid contracts signatures
172
+ 13. The server will add the block to the blockchain and create a new one with last block unconfirmed transactions but completely unsigned
173
+ 13. The server will start a open/closed pool cycle
174
+ 14. The server will send a message to the user to start mining when the POOL is open and user has a ticket
175
+ <p>
176
+ The timestamps of the signatures will be usefull to version the block, checking it as a timeline
177
+ </p>
178
+
179
+ **The miners will be rewarded with the block reward distributed by the number of signatures**
180
+ ## Contributing
181
+ Bug reports and pull requests are welcome on GitHub at https://github.com/outerspace-coding/outerspace-blockchain
182
+
183
+ ## License
184
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
185
+ * [LICENSE](LICENSE) - MIT License
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler"
2
+ Bundler::GemHelper.install_tasks name: "outerspace-blockchain"
3
+
4
+ require_relative "config/application"
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,5 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
3
+ //= link_tree ../../javascript .js
4
+ //= link_tree ../../../vendor/javascript .js
5
+ //= link_tree ../builds
File without changes
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file