osbc 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.env +5 -0
- data/.rspec +1 -0
- data/.rubocop.yml +273 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Dockerfile +17 -0
- data/Gemfile +109 -0
- data/Gemfile.lock +343 -0
- data/LICENSE.md +21 -0
- data/LICENSE.txt +21 -0
- data/Procfile +3 -0
- data/Procfile.dev +2 -0
- data/README.md +185 -0
- data/Rakefile +6 -0
- data/app/assets/builds/.keep +0 -0
- data/app/assets/config/manifest.js +5 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/bg.png +0 -0
- data/app/assets/images/gimage.png +0 -0
- data/app/assets/images/image.png +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/outerspc.jpg +0 -0
- data/app/assets/images/proxy.jpg +0 -0
- data/app/assets/images/space.jpg +0 -0
- data/app/assets/images/space_four.jpg +0 -0
- data/app/assets/images/space_t.jpg +0 -0
- data/app/assets/images/space_th.jpg +0 -0
- data/app/assets/images/space_two.jpg +0 -0
- data/app/assets/images/th.jpg +0 -0
- data/app/assets/stylesheets/application.css +344 -0
- data/app/assets/stylesheets/application.tailwind.css +13 -0
- data/app/assets/stylesheets/home.css +0 -0
- data/app/channels/application_cable/channel.rb +6 -0
- data/app/channels/application_cable/connection.rb +6 -0
- data/app/controllers/api/v1/block_confirmations_controller.rb +65 -0
- data/app/controllers/application_controller.rb +72 -0
- data/app/controllers/blocks_controller.rb +20 -0
- data/app/controllers/chains_controller.rb +72 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/contracts_controller.rb +25 -0
- data/app/controllers/pools_controller.rb +73 -0
- data/app/controllers/signatures_controller.rb +25 -0
- data/app/controllers/tickets_controller.rb +76 -0
- data/app/controllers/transactions_controller.rb +48 -0
- data/app/controllers/users/confirmations_controller.rb +30 -0
- data/app/controllers/users/omniauth_callbacks_controller.rb +30 -0
- data/app/controllers/users/passwords_controller.rb +34 -0
- data/app/controllers/users/registrations_controller.rb +61 -0
- data/app/controllers/users/sessions_controller.rb +27 -0
- data/app/controllers/users/unlocks_controller.rb +30 -0
- data/app/controllers/wallets_controller.rb +18 -0
- data/app/helpers/application_helper.rb +4 -0
- data/app/helpers/blocks_helper.rb +4 -0
- data/app/helpers/chains_helper.rb +4 -0
- data/app/helpers/contracts_helper.rb +4 -0
- data/app/helpers/pools_helper.rb +4 -0
- data/app/helpers/signatures_helper.rb +4 -0
- data/app/helpers/tickets_helper.rb +4 -0
- data/app/helpers/transactions_helper.rb +4 -0
- data/app/helpers/wallets_helper.rb +4 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/hello_controller.js +7 -0
- data/app/javascript/controllers/index.js +11 -0
- data/app/jobs/application_job.rb +9 -0
- data/app/mailers/application_mailer.rb +6 -0
- data/app/models/acceptable_number_sequence.rb +4 -0
- data/app/models/acceptable_symbol_sequence.rb +4 -0
- data/app/models/acceptable_word.rb +4 -0
- data/app/models/application_record.rb +5 -0
- data/app/models/block.rb +17 -0
- data/app/models/chain.rb +10 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/concerns/sequences_validator.rb +30 -0
- data/app/models/concerns/wallet_exists_validator.rb +13 -0
- data/app/models/contract.rb +7 -0
- data/app/models/pool.rb +5 -0
- data/app/models/signature.rb +12 -0
- data/app/models/ticket.rb +11 -0
- data/app/models/transaction.rb +25 -0
- data/app/models/user.rb +44 -0
- data/app/models/wallet.rb +33 -0
- data/app/services/application_service.rb +23 -0
- data/app/services/assign_contracts_service.rb +162 -0
- data/app/services/create_ticket_service.rb +87 -0
- data/app/services/create_wallet_service.rb +20 -0
- data/app/services/transaction_to_block_service.rb +62 -0
- data/app/views/application/_featured_board.html.erb +77 -0
- data/app/views/application/home.html.slim +1 -0
- data/app/views/application/mining_profile.html.slim +59 -0
- data/app/views/application/privacy_policy.html.erb +0 -0
- data/app/views/application/terms.html.erb +0 -0
- data/app/views/blocks/_block.html.slim +13 -0
- data/app/views/blocks/_block.json.jbuilder +4 -0
- data/app/views/blocks/_form.html.slim +26 -0
- data/app/views/blocks/edit.html.slim +10 -0
- data/app/views/blocks/index.html.slim +12 -0
- data/app/views/blocks/index.json.jbuilder +3 -0
- data/app/views/blocks/new.html.slim +8 -0
- data/app/views/blocks/show.html.slim +8 -0
- data/app/views/blocks/show.json.jbuilder +3 -0
- data/app/views/chains/_chain.html.slim +16 -0
- data/app/views/chains/_chain.json.jbuilder +4 -0
- data/app/views/chains/_form.html.slim +30 -0
- data/app/views/chains/edit.html.slim +10 -0
- data/app/views/chains/index.html.slim +11 -0
- data/app/views/chains/index.json.jbuilder +3 -0
- data/app/views/chains/new.html.slim +8 -0
- data/app/views/chains/show.html.slim +10 -0
- data/app/views/chains/show.json.jbuilder +3 -0
- data/app/views/contracts/_contract.html.slim +8 -0
- data/app/views/contracts/_contract.json.jbuilder +4 -0
- data/app/views/contracts/_form.html.slim +34 -0
- data/app/views/contracts/edit.html.slim +10 -0
- data/app/views/contracts/index.html.slim +12 -0
- data/app/views/contracts/index.json.jbuilder +3 -0
- data/app/views/contracts/new.html.slim +8 -0
- data/app/views/contracts/show.html.slim +8 -0
- data/app/views/contracts/show.json.jbuilder +3 -0
- data/app/views/layouts/_alert.html.slim +6 -0
- data/app/views/layouts/_navbar.html.slim +27 -0
- data/app/views/layouts/_notice.html.slim +6 -0
- data/app/views/layouts/application.html.erb +32 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/pools/_form.html.slim +30 -0
- data/app/views/pools/_pool.html.slim +16 -0
- data/app/views/pools/_pool.json.jbuilder +4 -0
- data/app/views/pools/edit.html.slim +10 -0
- data/app/views/pools/index.html.slim +12 -0
- data/app/views/pools/index.json.jbuilder +3 -0
- data/app/views/pools/new.html.slim +8 -0
- data/app/views/pools/show.html.slim +8 -0
- data/app/views/pools/show.json.jbuilder +3 -0
- data/app/views/signatures/_form.html.slim +46 -0
- data/app/views/signatures/_signature.html.slim +28 -0
- data/app/views/signatures/_signature.json.jbuilder +4 -0
- data/app/views/signatures/edit.html.slim +10 -0
- data/app/views/signatures/index.html.slim +10 -0
- data/app/views/signatures/index.json.jbuilder +3 -0
- data/app/views/signatures/new.html.slim +8 -0
- data/app/views/signatures/show.html.slim +10 -0
- data/app/views/signatures/show.json.jbuilder +3 -0
- data/app/views/tickets/_form.html.slim +26 -0
- data/app/views/tickets/_ticket.html.slim +10 -0
- data/app/views/tickets/_ticket.json.jbuilder +4 -0
- data/app/views/tickets/edit.html.slim +10 -0
- data/app/views/tickets/index.html.slim +16 -0
- data/app/views/tickets/index.json.jbuilder +3 -0
- data/app/views/tickets/new.html.slim +10 -0
- data/app/views/tickets/show.html.slim +8 -0
- data/app/views/tickets/show.json.jbuilder +3 -0
- data/app/views/transactions/_form.html.slim +16 -0
- data/app/views/transactions/_transaction.html.slim +24 -0
- data/app/views/transactions/_transaction.json.jbuilder +4 -0
- data/app/views/transactions/edit.html.slim +10 -0
- data/app/views/transactions/index.html.slim +19 -0
- data/app/views/transactions/index.json.jbuilder +3 -0
- data/app/views/transactions/new.html.slim +9 -0
- data/app/views/transactions/show.html.slim +8 -0
- data/app/views/transactions/show.json.jbuilder +3 -0
- data/app/views/users/confirmations/new.html.erb +16 -0
- data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/users/mailer/email_changed.html.erb +7 -0
- data/app/views/users/mailer/password_change.html.erb +3 -0
- data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/users/passwords/edit.html.erb +25 -0
- data/app/views/users/passwords/new.html.erb +16 -0
- data/app/views/users/registrations/edit.html.erb +43 -0
- data/app/views/users/registrations/new.html.erb +37 -0
- data/app/views/users/sessions/new.html.erb +30 -0
- data/app/views/users/shared/_error_messages.html.erb +15 -0
- data/app/views/users/shared/_links.html.erb +25 -0
- data/app/views/users/unlocks/new.html.erb +16 -0
- data/app/views/wallets/_form.html.slim +30 -0
- data/app/views/wallets/_wallet.html.slim +13 -0
- data/app/views/wallets/_wallet.json.jbuilder +4 -0
- data/app/views/wallets/edit.html.slim +10 -0
- data/app/views/wallets/index.html.slim +18 -0
- data/app/views/wallets/index.json.jbuilder +3 -0
- data/app/views/wallets/new.html.slim +8 -0
- data/app/views/wallets/show.html.slim +11 -0
- data/app/views/wallets/show.json.jbuilder +3 -0
- data/app/workers/application_worker.rb +82 -0
- data/app/workers/assign_contract_worker.rb +27 -0
- data/app/workers/create_ticket_worker.rb +23 -0
- data/app/workers/create_wallet_worker.rb +21 -0
- data/app/workers/transaction_to_block_worker.rb +48 -0
- data/bin/bundle +114 -0
- data/bin/console +15 -0
- data/bin/dev +9 -0
- data/bin/importmap +5 -0
- data/bin/osbc +77 -0
- data/bin/rails +6 -0
- data/bin/rake +6 -0
- data/bin/setup +35 -0
- data/config/application.rb +25 -0
- data/config/boot.rb +6 -0
- data/config/cable.yml +10 -0
- data/config/credentials.yml.enc +1 -0
- data/config/database.yml +21 -0
- data/config/environment.rb +7 -0
- data/config/environments/development.rb +73 -0
- data/config/environments/production.rb +95 -0
- data/config/environments/test.rb +62 -0
- data/config/importmap.rb +9 -0
- data/config/initializers/assets.rb +14 -0
- data/config/initializers/content_security_policy.rb +26 -0
- data/config/initializers/devise.rb +311 -0
- data/config/initializers/filter_parameter_logging.rb +10 -0
- data/config/initializers/inflections.rb +17 -0
- data/config/initializers/permissions_policy.rb +12 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/en.yml +33 -0
- data/config/puma.rb +45 -0
- data/config/routes/api.rb +9 -0
- data/config/routes.rb +30 -0
- data/config/sidekiq.yml +10 -0
- data/config/storage.yml +34 -0
- data/config/tailwind.config.js +23 -0
- data/config.ru +8 -0
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +1853 -0
- data/coverage/.resultset.json.lock +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_asc_disabled.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_both.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc.png +0 -0
- data/coverage/assets/0.12.3/DataTables-1.10.20/images/sort_desc_disabled.png +0 -0
- data/coverage/assets/0.12.3/application.css +1 -0
- data/coverage/assets/0.12.3/application.js +7 -0
- data/coverage/assets/0.12.3/colorbox/border.png +0 -0
- data/coverage/assets/0.12.3/colorbox/controls.png +0 -0
- data/coverage/assets/0.12.3/colorbox/loading.gif +0 -0
- data/coverage/assets/0.12.3/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.12.3/favicon_green.png +0 -0
- data/coverage/assets/0.12.3/favicon_red.png +0 -0
- data/coverage/assets/0.12.3/favicon_yellow.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.12.3/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.12.3/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/assets/0.12.3/loading.gif +0 -0
- data/coverage/assets/0.12.3/magnify.png +0 -0
- data/coverage/index.html +20731 -0
- data/db/migrate/20221018053949_devise_create_users.rb +45 -0
- data/db/migrate/20221019002956_create_chains.rb +13 -0
- data/db/migrate/20221020112137_create_blocks.rb +12 -0
- data/db/migrate/20221020123102_add_chain_to_blocks.rb +5 -0
- data/db/migrate/20221020150504_create_wallets.rb +13 -0
- data/db/migrate/20221022221059_create_transactions.rb +20 -0
- data/db/migrate/20221023011005_add_block_to_transactions.rb +5 -0
- data/db/migrate/20221023014707_create_contracts.rb +11 -0
- data/db/migrate/20221023040749_create_pools.rb +13 -0
- data/db/migrate/20221023041015_create_tickets.rb +11 -0
- data/db/migrate/20221023103509_add_contracts_count_to_block.rb +6 -0
- data/db/migrate/20221023110613_add_acceptable_word_list_to_users.rb +7 -0
- data/db/migrate/20221023113539_create_signatures.rb +19 -0
- data/db/migrate/20221023113750_create_acceptable_words.rb +9 -0
- data/db/migrate/20221023114152_create_acceptable_number_sequences.rb +9 -0
- data/db/migrate/20221023114203_create_acceptable_symbol_sequences.rb +9 -0
- data/db/migrate/20221023114324_add_user_acceptable_hash_to_tickets.rb +7 -0
- data/db/migrate/20221023114408_add_time_ref_to_tickets.rb +5 -0
- data/db/migrate/20221024125047_add_master_hash_to_blocks.rb +5 -0
- data/db/migrate/20221109161845_add_transactions_count_to_blocks.rb +5 -0
- data/db/migrate/20221117135003_add_balance_to_chains.rb +5 -0
- data/db/migrate/20221117203417_add_transaction_id_list_to_tickets.rb +5 -0
- data/db/migrate/20221118080357_add_api_keys_to_users.rb +6 -0
- data/db/schema.rb +179 -0
- data/db/seeds.rb +134 -0
- data/docker-compose.yml +53 -0
- data/entrypoint.sh +8 -0
- data/lib/assets/.keep +0 -0
- data/lib/osbc/osbc.rb +9 -0
- data/lib/outerspace/blockchain/version.rb +7 -0
- data/lib/outerspace/blockchain.rb +10 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/compose.rake +92 -0
- data/lib/tasks/compose_db.rake +71 -0
- data/lib/tasks/compose_logs.rake +95 -0
- data/lib/tasks/compose_test.rake +62 -0
- data/log/.keep +0 -0
- data/mining_concept.ipynb +284 -0
- data/outerspace-blockchain.gemspec +50 -0
- data/public/404.html +67 -0
- data/public/422.html +67 -0
- data/public/500.html +66 -0
- data/public/apple-touch-icon-precomposed.png +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +1 -0
- data/storage/.keep +0 -0
- data/tmp/.keep +0 -0
- data/tmp/pids/.keep +0 -0
- data/tmp/storage/.keep +0 -0
- data/vendor/.keep +0 -0
- data/vendor/javascript/.keep +0 -0
- metadata +643 -0
@@ -0,0 +1,344 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
16
|
+
|
17
|
+
|
18
|
+
body {
|
19
|
+
/* background-color: #f5f5f5;
|
20
|
+
background-repeat: no-repeat;
|
21
|
+
background-position: center;
|
22
|
+
background-size: cover; */
|
23
|
+
background-attachment: fixed;
|
24
|
+
margin: 0;
|
25
|
+
padding: 0;
|
26
|
+
font-family: 'Lato', sans-serif;
|
27
|
+
font-size: 14px;
|
28
|
+
color: #333;
|
29
|
+
height: 100%;
|
30
|
+
min-height: 100%;
|
31
|
+
overflow-x: hidden;
|
32
|
+
overflow-y: scroll;
|
33
|
+
-webkit-overflow-scrolling: touch;
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
.form-group input.form-control, .form-group textarea.form-control, .form-group select.form-control, .form-group .form-control {
|
38
|
+
font-family: 'Lato', sans-serif;
|
39
|
+
font-size: 14px;
|
40
|
+
color: white;
|
41
|
+
background-color: #333;
|
42
|
+
width: 100%;
|
43
|
+
}
|
44
|
+
|
45
|
+
.pt-\[17\%\] {
|
46
|
+
padding-top: 17%;
|
47
|
+
}
|
48
|
+
.mt-\[-10\%\] {
|
49
|
+
margin-top: -10%;
|
50
|
+
}
|
51
|
+
.pt-\[56\.25\%\] {
|
52
|
+
padding-top: 56.25%;
|
53
|
+
}
|
54
|
+
|
55
|
+
.hero img {
|
56
|
+
|
57
|
+
height: auto;
|
58
|
+
width: 100%;
|
59
|
+
max-width: 100%;
|
60
|
+
margin: 0 auto;
|
61
|
+
display: block;
|
62
|
+
padding: 0;
|
63
|
+
border: 0;
|
64
|
+
vertical-align: middle;
|
65
|
+
max-height: 100%;
|
66
|
+
z-index: 1;
|
67
|
+
position: absolute;
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
}
|
73
|
+
|
74
|
+
.bg-future {
|
75
|
+
background-color: rgba(0,0,0,0.6);
|
76
|
+
width: 100%;
|
77
|
+
|
78
|
+
}
|
79
|
+
|
80
|
+
|
81
|
+
.table-container {
|
82
|
+
margin-top: 50px;
|
83
|
+
}
|
84
|
+
|
85
|
+
.backimage {
|
86
|
+
background-image: radial-gradient(#2fff00 1px, transparent 1px);
|
87
|
+
background-size: 32px 32px;
|
88
|
+
background-color: #1e1c1c;
|
89
|
+
}
|
90
|
+
|
91
|
+
.glitch-wrapper {
|
92
|
+
width: 100%;
|
93
|
+
height: 100%;
|
94
|
+
display: flex;
|
95
|
+
align-items: center;
|
96
|
+
justify-content: center;
|
97
|
+
text-align: center;
|
98
|
+
background-color: #222;
|
99
|
+
}
|
100
|
+
|
101
|
+
.glitch {
|
102
|
+
position: relative;
|
103
|
+
font-size: 20px;
|
104
|
+
font-weight: 700;
|
105
|
+
line-height: 1.2;
|
106
|
+
color: #fff;
|
107
|
+
letter-spacing: 5px;
|
108
|
+
animation: shift 4s ease-in-out infinite alternate;
|
109
|
+
z-index: 1;
|
110
|
+
}
|
111
|
+
|
112
|
+
.glitch:before {
|
113
|
+
content: attr(data-glitch);
|
114
|
+
position: absolute;
|
115
|
+
top: 0;
|
116
|
+
left: -2px;
|
117
|
+
text-shadow: 16px 0 rgb(0, 255, 55);
|
118
|
+
width: 100%;
|
119
|
+
color: #fff;
|
120
|
+
background-color: rgba(0,0,0,0.5);
|
121
|
+
overflow: hidden;
|
122
|
+
clip: rect(0, 900px, 0, 0);
|
123
|
+
animation: noise-before 3s infinite linear alternate-reverse;
|
124
|
+
}
|
125
|
+
|
126
|
+
.glitch:after {
|
127
|
+
content: attr(data-glitch);
|
128
|
+
position: absolute;
|
129
|
+
top: 0;
|
130
|
+
left: 2px;
|
131
|
+
text-shadow: 22px 0 #982098;
|
132
|
+
width: 100%;
|
133
|
+
color: #fff;
|
134
|
+
background-color: rgba(0, 0, 0, 0.2);
|
135
|
+
overflow: hidden;
|
136
|
+
clip: rect(0, 900px, 0, 0);
|
137
|
+
animation: noise-after 2s infinite linear alternate-reverse;
|
138
|
+
}
|
139
|
+
|
140
|
+
@keyframes noise-before {
|
141
|
+
0% {
|
142
|
+
clip: rect(61px, 9999px, 52px, 0);
|
143
|
+
}
|
144
|
+
|
145
|
+
5% {
|
146
|
+
clip: rect(33px, 9999px, 144px, 0);
|
147
|
+
}
|
148
|
+
|
149
|
+
10% {
|
150
|
+
clip: rect(121px, 9999px, 115px, 0);
|
151
|
+
}
|
152
|
+
|
153
|
+
15% {
|
154
|
+
clip: rect(144px, 9999px, 162px, 0);
|
155
|
+
}
|
156
|
+
|
157
|
+
20% {
|
158
|
+
clip: rect(62px, 9999px, 180px, 0);
|
159
|
+
}
|
160
|
+
|
161
|
+
25% {
|
162
|
+
clip: rect(34px, 9999px, 42px, 0);
|
163
|
+
}
|
164
|
+
|
165
|
+
30% {
|
166
|
+
clip: rect(147px, 9999px, 179px, 0);
|
167
|
+
}
|
168
|
+
|
169
|
+
35% {
|
170
|
+
clip: rect(99px, 9999px, 63px, 0);
|
171
|
+
}
|
172
|
+
|
173
|
+
40% {
|
174
|
+
clip: rect(188px, 9999px, 122px, 0);
|
175
|
+
}
|
176
|
+
|
177
|
+
45% {
|
178
|
+
clip: rect(154px, 9999px, 14px, 0);
|
179
|
+
}
|
180
|
+
|
181
|
+
50% {
|
182
|
+
clip: rect(63px, 9999px, 37px, 0);
|
183
|
+
}
|
184
|
+
|
185
|
+
55% {
|
186
|
+
clip: rect(161px, 9999px, 147px, 0);
|
187
|
+
}
|
188
|
+
|
189
|
+
60% {
|
190
|
+
clip: rect(109px, 9999px, 175px, 0);
|
191
|
+
}
|
192
|
+
|
193
|
+
65% {
|
194
|
+
clip: rect(157px, 9999px, 88px, 0);
|
195
|
+
}
|
196
|
+
|
197
|
+
70% {
|
198
|
+
clip: rect(173px, 9999px, 131px, 0);
|
199
|
+
}
|
200
|
+
|
201
|
+
75% {
|
202
|
+
clip: rect(62px, 9999px, 70px, 0);
|
203
|
+
}
|
204
|
+
|
205
|
+
80% {
|
206
|
+
clip: rect(24px, 9999px, 153px, 0);
|
207
|
+
}
|
208
|
+
|
209
|
+
85% {
|
210
|
+
clip: rect(138px, 9999px, 40px, 0);
|
211
|
+
}
|
212
|
+
|
213
|
+
90% {
|
214
|
+
clip: rect(79px, 9999px, 136px, 0);
|
215
|
+
}
|
216
|
+
|
217
|
+
95% {
|
218
|
+
clip: rect(25px, 9999px, 34px, 0);
|
219
|
+
}
|
220
|
+
|
221
|
+
100% {
|
222
|
+
clip: rect(173px, 9999px, 166px, 0);
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
@keyframes noise-after {
|
227
|
+
0% {
|
228
|
+
clip: rect(26px, 9999px, 33px, 0);
|
229
|
+
}
|
230
|
+
|
231
|
+
5% {
|
232
|
+
clip: rect(140px, 9999px, 198px, 0);
|
233
|
+
}
|
234
|
+
|
235
|
+
10% {
|
236
|
+
clip: rect(184px, 9999px, 89px, 0);
|
237
|
+
}
|
238
|
+
|
239
|
+
15% {
|
240
|
+
clip: rect(121px, 9999px, 6px, 0);
|
241
|
+
}
|
242
|
+
|
243
|
+
20% {
|
244
|
+
clip: rect(181px, 9999px, 99px, 0);
|
245
|
+
}
|
246
|
+
|
247
|
+
25% {
|
248
|
+
clip: rect(154px, 9999px, 133px, 0);
|
249
|
+
}
|
250
|
+
|
251
|
+
30% {
|
252
|
+
clip: rect(134px, 9999px, 169px, 0);
|
253
|
+
}
|
254
|
+
|
255
|
+
35% {
|
256
|
+
clip: rect(26px, 9999px, 187px, 0);
|
257
|
+
}
|
258
|
+
|
259
|
+
40% {
|
260
|
+
clip: rect(147px, 9999px, 137px, 0);
|
261
|
+
}
|
262
|
+
|
263
|
+
45% {
|
264
|
+
clip: rect(31px, 9999px, 52px, 0);
|
265
|
+
}
|
266
|
+
|
267
|
+
50% {
|
268
|
+
clip: rect(191px, 9999px, 109px, 0);
|
269
|
+
}
|
270
|
+
|
271
|
+
55% {
|
272
|
+
clip: rect(74px, 9999px, 54px, 0);
|
273
|
+
}
|
274
|
+
|
275
|
+
60% {
|
276
|
+
clip: rect(145px, 9999px, 75px, 0);
|
277
|
+
}
|
278
|
+
|
279
|
+
65% {
|
280
|
+
clip: rect(153px, 9999px, 198px, 0);
|
281
|
+
}
|
282
|
+
|
283
|
+
70% {
|
284
|
+
clip: rect(99px, 9999px, 136px, 0);
|
285
|
+
}
|
286
|
+
|
287
|
+
75% {
|
288
|
+
clip: rect(118px, 9999px, 192px, 0);
|
289
|
+
}
|
290
|
+
|
291
|
+
80% {
|
292
|
+
clip: rect(1px, 9999px, 83px, 0);
|
293
|
+
}
|
294
|
+
|
295
|
+
85% {
|
296
|
+
clip: rect(145px, 9999px, 98px, 0);
|
297
|
+
}
|
298
|
+
|
299
|
+
90% {
|
300
|
+
clip: rect(121px, 9999px, 154px, 0);
|
301
|
+
}
|
302
|
+
|
303
|
+
95% {
|
304
|
+
clip: rect(156px, 9999px, 44px, 0);
|
305
|
+
}
|
306
|
+
|
307
|
+
100% {
|
308
|
+
clip: rect(67px, 9999px, 122px, 0);
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
@keyframes shift {
|
313
|
+
0%, 40%, 44%, 58%, 61%, 65%, 69%, 73%, 100% {
|
314
|
+
transform: skewX(0deg);
|
315
|
+
}
|
316
|
+
|
317
|
+
41% {
|
318
|
+
transform: skewX(10deg);
|
319
|
+
}
|
320
|
+
|
321
|
+
42% {
|
322
|
+
transform: skewX(-10deg);
|
323
|
+
}
|
324
|
+
|
325
|
+
59% {
|
326
|
+
transform: skewX(40deg) skewY(10deg);
|
327
|
+
}
|
328
|
+
|
329
|
+
60% {
|
330
|
+
transform: skewX(-40deg) skewY(-10deg);
|
331
|
+
}
|
332
|
+
|
333
|
+
63% {
|
334
|
+
transform: skewX(10deg) skewY(-5deg);
|
335
|
+
}
|
336
|
+
|
337
|
+
70% {
|
338
|
+
transform: skewX(-50deg) skewY(-20deg);
|
339
|
+
}
|
340
|
+
|
341
|
+
71% {
|
342
|
+
transform: skewX(10deg) skewY(-10deg);
|
343
|
+
}
|
344
|
+
}
|
File without changes
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Api::V1::BlockConfirmationsController < ActionController::API
|
4
|
+
def confirm_block
|
5
|
+
return unauthorized_response unless find_user_by_header
|
6
|
+
@ticket = Ticket.find_by(user_id: @user.id, status: :active)
|
7
|
+
return ticket_not_found_response unless @ticket.present?
|
8
|
+
confirmation_hash = block_confirmation_params[:user_confirmation_hash]
|
9
|
+
return confirmation_hash_not_found_response unless confirmation_hash.present?
|
10
|
+
return not_valid_confirmation_hash_response unless @ticket.user_acceptable_hash == confirmation_hash
|
11
|
+
assign_contract
|
12
|
+
end
|
13
|
+
|
14
|
+
def transactions_to_mine
|
15
|
+
return unauthorized_response unless find_user_by_header
|
16
|
+
ticket = Ticket.find_by(user_id: @user.id)
|
17
|
+
return ticket_not_found_response unless ticket.present?
|
18
|
+
transactions_ids = ticket.transaction_id_list
|
19
|
+
transactions = Transaction.where(id: transactions_ids)
|
20
|
+
transactions_json = transactions.to_json
|
21
|
+
render json: transactions_json, status: :ok
|
22
|
+
end
|
23
|
+
|
24
|
+
def info_to_mine
|
25
|
+
return unauthorized_response unless find_user_by_header
|
26
|
+
words = @user.acceptable_words
|
27
|
+
number_sequences = @user.acceptable_number_sequences
|
28
|
+
symbol_sequences = @user.acceptable_symbol_sequences
|
29
|
+
render json: { words: words, number_sequences: number_sequences, symbol_sequences: symbol_sequences }, status: :ok
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def find_user_by_header
|
34
|
+
return unless request.headers["X-Api-Key"].present?
|
35
|
+
api_key = request.headers["X-Api-Key"]
|
36
|
+
@user = User.find_by(api_key: api_key)
|
37
|
+
return unless @user.present?
|
38
|
+
@user.api_secret == request.headers["X-Api-Secret"]
|
39
|
+
end
|
40
|
+
|
41
|
+
def unauthorized_response
|
42
|
+
render json: { error: "Unauthorized" }, status: :unauthorized
|
43
|
+
end
|
44
|
+
|
45
|
+
def ticket_not_found_response
|
46
|
+
render json: { error: "Ticket not found" }, status: :not_found
|
47
|
+
end
|
48
|
+
|
49
|
+
def confirmation_hash_not_found_response
|
50
|
+
render json: { error: "Confirmation hash not found" }, status: :not_found
|
51
|
+
end
|
52
|
+
|
53
|
+
def assign_contract
|
54
|
+
AssignContractWorker.perform_async(@ticket.id)
|
55
|
+
render json: { message: "Contract assigned" }, status: :ok
|
56
|
+
end
|
57
|
+
|
58
|
+
def not_valid_confirmation_hash_response
|
59
|
+
render json: { error: "Not valid confirmation hash" }, status: :not_found
|
60
|
+
end
|
61
|
+
|
62
|
+
def block_confirmation_params
|
63
|
+
params.permit(:user_confirmation_hash)
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This class is Application Controller and his methods is available for all controllers
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
protect_from_forgery with: :exception
|
6
|
+
before_action :configure_permitted_parameters, if: :devise_controller?
|
7
|
+
before_action :authenticate_user!, only: [:mining_profile]
|
8
|
+
before_action :set_contracts, :set_blocks, :set_current_block, :set_current_pool, :set_block_transactions
|
9
|
+
|
10
|
+
|
11
|
+
def home
|
12
|
+
@contracts = contracts
|
13
|
+
end
|
14
|
+
|
15
|
+
def mining_profile
|
16
|
+
@words = current_user.acceptable_words
|
17
|
+
@numbers = current_user.acceptable_number_sequences
|
18
|
+
@symbols = current_user.acceptable_symbol_sequences
|
19
|
+
@ticket = current_user.tickets.where(status: :active).last
|
20
|
+
end
|
21
|
+
|
22
|
+
def terms; end
|
23
|
+
|
24
|
+
|
25
|
+
def privacy_policy; end
|
26
|
+
|
27
|
+
private
|
28
|
+
def blocks
|
29
|
+
@blocks = Block.all.order(created_at: :desc).limit(5)
|
30
|
+
end
|
31
|
+
|
32
|
+
def contracts
|
33
|
+
@contracts = Contract.last(5)
|
34
|
+
end
|
35
|
+
|
36
|
+
def current_block
|
37
|
+
@current_block = Block.find_by(master_hash: nil)
|
38
|
+
end
|
39
|
+
|
40
|
+
def current_pool
|
41
|
+
@current_pool = Pool.find_by(block_id: current_block.id)
|
42
|
+
end
|
43
|
+
|
44
|
+
def block_transactions
|
45
|
+
@block_transactions = Transaction.where(block_id: current_block.id)
|
46
|
+
end
|
47
|
+
|
48
|
+
def set_contracts
|
49
|
+
contracts
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_blocks
|
53
|
+
blocks
|
54
|
+
end
|
55
|
+
|
56
|
+
def set_current_block
|
57
|
+
current_block
|
58
|
+
end
|
59
|
+
|
60
|
+
def set_current_pool
|
61
|
+
current_pool
|
62
|
+
end
|
63
|
+
|
64
|
+
def set_block_transactions
|
65
|
+
block_transactions
|
66
|
+
end
|
67
|
+
|
68
|
+
protected
|
69
|
+
def configure_permitted_parameters
|
70
|
+
devise_parameter_sanitizer.permit(:sign_up)
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class BlocksController < ApplicationController
|
4
|
+
before_action :set_block, only: %i[ show ]
|
5
|
+
|
6
|
+
# GET /blocks or /blocks.json
|
7
|
+
def index
|
8
|
+
@blocks = Block.all
|
9
|
+
end
|
10
|
+
|
11
|
+
# GET /blocks/1 or /blocks/1.json
|
12
|
+
def show
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
# Use callbacks to share common setup or constraints between actions.
|
17
|
+
def set_block
|
18
|
+
@block = Block.find(params[:id])
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ChainsController < ApplicationController
|
4
|
+
before_action :set_chain, only: %i[ show edit update destroy ]
|
5
|
+
|
6
|
+
# GET /chains or /chains.json
|
7
|
+
def index
|
8
|
+
@chains = Chain.all
|
9
|
+
end
|
10
|
+
|
11
|
+
# GET /chains/1 or /chains/1.json
|
12
|
+
def show
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /chains/new
|
16
|
+
def new
|
17
|
+
@chain = Chain.new
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /chains/1/edit
|
21
|
+
def edit
|
22
|
+
end
|
23
|
+
|
24
|
+
# POST /chains or /chains.json
|
25
|
+
def create
|
26
|
+
@chain = Chain.new(chain_params)
|
27
|
+
|
28
|
+
respond_to do |format|
|
29
|
+
if @chain.save
|
30
|
+
format.html { redirect_to chain_url(@chain), notice: "Chain was successfully created." }
|
31
|
+
format.json { render :show, status: :created, location: @chain }
|
32
|
+
else
|
33
|
+
format.html { render :new, status: :unprocessable_entity }
|
34
|
+
format.json { render json: @chain.errors, status: :unprocessable_entity }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# PATCH/PUT /chains/1 or /chains/1.json
|
40
|
+
def update
|
41
|
+
respond_to do |format|
|
42
|
+
if @chain.update(chain_params)
|
43
|
+
format.html { redirect_to chain_url(@chain), notice: "Chain was successfully updated." }
|
44
|
+
format.json { render :show, status: :ok, location: @chain }
|
45
|
+
else
|
46
|
+
format.html { render :edit, status: :unprocessable_entity }
|
47
|
+
format.json { render json: @chain.errors, status: :unprocessable_entity }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# DELETE /chains/1 or /chains/1.json
|
53
|
+
def destroy
|
54
|
+
@chain.destroy
|
55
|
+
|
56
|
+
respond_to do |format|
|
57
|
+
format.html { redirect_to chains_url, notice: "Chain was successfully destroyed." }
|
58
|
+
format.json { head :no_content }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
# Use callbacks to share common setup or constraints between actions.
|
64
|
+
def set_chain
|
65
|
+
@chain = Chain.find(params[:id])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Only allow a list of trusted parameters through.
|
69
|
+
def chain_params
|
70
|
+
params.require(:chain).permit(:name, :blocks_count, :maintainer, :chain_version, :description)
|
71
|
+
end
|
72
|
+
end
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ContractsController < ApplicationController
|
4
|
+
before_action :set_contract, only: %i[ show edit update destroy ]
|
5
|
+
|
6
|
+
# GET /contracts or /contracts.json
|
7
|
+
def index
|
8
|
+
@contracts = Contract.all
|
9
|
+
end
|
10
|
+
|
11
|
+
# GET /contracts/1 or /contracts/1.json
|
12
|
+
def show
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
# Use callbacks to share common setup or constraints between actions.
|
17
|
+
def set_contract
|
18
|
+
@contract = Contract.find(params[:id])
|
19
|
+
end
|
20
|
+
|
21
|
+
# Only allow a list of trusted parameters through.
|
22
|
+
def contract_params
|
23
|
+
params.require(:contract).permit(:first_sig, :second_sig, :third_sig, :fourth_sig, :status, :transaction_id)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class PoolsController < ApplicationController
|
4
|
+
before_action :set_pool, only: %i[ show edit update destroy ]
|
5
|
+
before_action :authenticate_user!
|
6
|
+
|
7
|
+
# GET /pools or /pools.json
|
8
|
+
def index
|
9
|
+
@pools = Pool.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /pools/1 or /pools/1.json
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /pools/new
|
17
|
+
def new
|
18
|
+
@pool = Pool.new
|
19
|
+
end
|
20
|
+
|
21
|
+
# GET /pools/1/edit
|
22
|
+
def edit
|
23
|
+
end
|
24
|
+
|
25
|
+
# POST /pools or /pools.json
|
26
|
+
def create
|
27
|
+
@pool = Pool.new(pool_params)
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
if @pool.save
|
31
|
+
format.html { redirect_to pool_url(@pool), notice: "Pool was successfully created." }
|
32
|
+
format.json { render :show, status: :created, location: @pool }
|
33
|
+
else
|
34
|
+
format.html { render :new, status: :unprocessable_entity }
|
35
|
+
format.json { render json: @pool.errors, status: :unprocessable_entity }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# PATCH/PUT /pools/1 or /pools/1.json
|
41
|
+
def update
|
42
|
+
respond_to do |format|
|
43
|
+
if @pool.update(pool_params)
|
44
|
+
format.html { redirect_to pool_url(@pool), notice: "Pool was successfully updated." }
|
45
|
+
format.json { render :show, status: :ok, location: @pool }
|
46
|
+
else
|
47
|
+
format.html { render :edit, status: :unprocessable_entity }
|
48
|
+
format.json { render json: @pool.errors, status: :unprocessable_entity }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# DELETE /pools/1 or /pools/1.json
|
54
|
+
def destroy
|
55
|
+
@pool.destroy
|
56
|
+
|
57
|
+
respond_to do |format|
|
58
|
+
format.html { redirect_to pools_url, notice: "Pool was successfully destroyed." }
|
59
|
+
format.json { head :no_content }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
# Use callbacks to share common setup or constraints between actions.
|
65
|
+
def set_pool
|
66
|
+
@pool = Pool.find(params[:id])
|
67
|
+
end
|
68
|
+
|
69
|
+
# Only allow a list of trusted parameters through.
|
70
|
+
def pool_params
|
71
|
+
params.require(:pool).permit(:block_id, :users_count, :signatures_count, :amount, :stage)
|
72
|
+
end
|
73
|
+
end
|