diff --git a/.env b/.env_sample similarity index 60% rename from .env rename to .env_sample index 882d6fb..50650f9 100644 --- a/.env +++ b/.env_sample @@ -7,4 +7,8 @@ CONTRACTS_LIMIT=2 SIGNATURES_LIMIT=5 REDIS_URL=redis://redis:6379 ENV_MACHINE=docker +GOOGLE_ANALYTICS_ID=UA-XXXXXXXX-X +FIRESTORE_PROJECT_ID=YOUR_FIRESTORE_PROJECT_ID +FIRESTORE_KEY_FILE=YOUR_FIRESTORE_KEY_FILE +FIRESTORE_KEY_FILE_PATH=YOUR_FIRESTORE_KEY_FILE_PATH diff --git a/.gitignore b/.gitignore index 84cf350..ff004ea 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ /coverage /coverage/* osbc-*.gem +.env +/.env +/.env.* \ No newline at end of file diff --git a/Gemfile b/Gemfile index e5fef90..3f361c5 100644 --- a/Gemfile +++ b/Gemfile @@ -66,6 +66,9 @@ gem "rails-controller-testing", "~> 1.0" # Active Record Import gem "activerecord-import" +# Google Firestore +gem "google-cloud-firestore", "~> 2.6" + # Use Sass to process CSS # gem "sassc-rails" diff --git a/Gemfile.lock b/Gemfile.lock index aaceb84..8629a90 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -110,8 +110,57 @@ GEM railties (>= 5.0.0) faker (2.23.0) i18n (>= 1.8.11, < 2) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-net_http (3.0.2) + faraday-retry (2.0.0) + faraday (~> 2.0) + gapic-common (0.16.0) + faraday (>= 1.9, < 3.a) + faraday-retry (>= 1.0, < 3.a) + google-protobuf (~> 3.14) + googleapis-common-protos (>= 1.3.12, < 2.a) + googleapis-common-protos-types (>= 1.3.1, < 2.a) + googleauth (~> 1.0) + grpc (~> 1.36) globalid (1.0.1) activesupport (>= 5.0) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.0) + google-cloud-firestore (2.8.0) + concurrent-ruby (~> 1.0) + google-cloud-core (~> 1.5) + google-cloud-firestore-v1 (~> 0.0) + rbtree (~> 0.4.2) + google-cloud-firestore-v1 (0.8.0) + gapic-common (>= 0.10, < 2.a) + google-cloud-errors (~> 1.0) + google-cloud-location (>= 0.0, < 2.a) + google-cloud-location (0.3.0) + gapic-common (>= 0.16.0, < 2.a) + google-cloud-errors (~> 1.0) + google-protobuf (3.21.12) + googleapis-common-protos (1.4.0) + google-protobuf (~> 3.14) + googleapis-common-protos-types (~> 1.2) + grpc (~> 1.27) + googleapis-common-protos-types (1.5.0) + google-protobuf (~> 3.14) + googleauth (1.3.0) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + grpc (1.50.0) + google-protobuf (~> 3.21) + googleapis-common-protos-types (~> 1.0) i18n (1.12.0) concurrent-ruby (~> 1.0) importmap-rails (1.1.5) @@ -121,6 +170,7 @@ GEM actionview (>= 5.0.0) activesupport (>= 5.0.0) json (2.6.3) + jwt (2.6.0) loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -131,10 +181,12 @@ GEM net-smtp marcel (1.0.2) matrix (0.4.2) + memoist (0.16.2) method_source (1.0.0) mini_mime (1.1.2) minitest (5.17.0) msgpack (1.6.0) + multi_json (1.15.0) net-imap (0.3.4) date net-protocol @@ -148,6 +200,7 @@ GEM nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) orm_adapter (0.5.0) + os (1.1.4) parallel (1.22.1) parser (3.2.0.0) ast (~> 2.4.1) @@ -191,6 +244,7 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) + rbtree (0.4.6) redis (4.8.0) regexp_parser (2.6.2) responders (3.0.1) @@ -236,6 +290,7 @@ GEM rubocop (~> 1.33) rubocop-capybara (~> 2.17) ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) rubyzip (2.3.2) selenium-webdriver (4.7.1) rexml (~> 3.2, >= 3.2.5) @@ -247,6 +302,11 @@ GEM connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -313,6 +373,7 @@ DEPENDENCIES devise (~> 4.8) factory_bot_rails (~> 6.2) faker (~> 2.23) + google-cloud-firestore (~> 2.6) importmap-rails (~> 1.1) jbuilder (~> 2.11) pg (~> 1.4) diff --git a/README.md b/README.md index 59e295e..eeaa69d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # Outerspace Blockchain + +### This application is instable and under development. +### Please, use it with caution and at your own risk. ### A Ruby implementation of web blockchain framework. #### Developed using TDD (Test Driven Development). #### Github Actions CI/CD pipeline. -#### Chrome Selenium tests are used to test the blockchain in a browser and its interaction with the blockchain. -#### Chrome Selenium are included in the docker compose without any additional setup. +#### Firestore is used to store the blockchain. + #### Simplecov is used to test code coverage. #### Rails Engine is used to create the blockchain. @@ -12,20 +15,29 @@ #### Rspec is used to test the blockchain. -## Build Version: 0.1.9 -### Last Update: -#### Edited Gemspec -#### Edited Readme -##### TODO -###### Add more tests -###### Add more features -###### Include pagination -###### Create Queries Folder -###### Test in kubernetes -###### Add more documentation -###### Add NFT Generator -###### Increase the environment variables for autoconfig -###### Add features to autogeneration of blockchain for better configuration +## Build Version: 0.2.0 + +## Todo +* [ ] Firebase integration (this will be use instead of Redis management) +* [ ] Add and correct tests +* [ ] Add and correct documentation +* [ ] Add user verification methods +* [ ] Better mobile layout +* [ ] Create the price visualization and the price history api +* [ ] Add more blockchain features +* [ ] Add more blockchain tests +* [ ] Add more blockchain documentation +* [ ] Add nft's classification class +* [ ] Add nft's modularization class +* [ ] Add nft's generator class +* [ ] Benchmark blockchain and mining +* [ ] Create a blockchain explorer +* [ ] Create a default blockchain wallet android app generator with flutter +* [ ] Create generators that will work with rails and flutter at the same time +* [ ] Create the user marketplace +* [ ] Integrate Blockchain Api in other projects + +Kubernets integration will be worked on in the future. ## System dependencies 1. Docker @@ -52,7 +64,6 @@ gem install osbc ```bash osbc PATH ``` - ### Compile OSBC from source ======================== diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fb98e90..fd52a4f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,6 +1,15 @@ + + + OuterspaceBlockchain <%= csrf_meta_tags %> diff --git a/config/environments/development.rb b/config/environments/development.rb index 28b212b..f0484bd 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -4,6 +4,8 @@ Rails.application.configure do config.hosts << "lvh.me" + config.hosts << "outerspacecoding.com" + config.hosts << "osbc.outerspacecoding.com" # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded any time diff --git a/mining_concept.ipynb b/mining_concept.ipynb index 3924276..2fe80a2 100644 --- a/mining_concept.ipynb +++ b/mining_concept.ipynb @@ -89,8 +89,8 @@ } ], "source": [ - "key = '9e8b3f4bf92577861e06e3bc84a809794dd6a7ab9da1070a78eb763b3399595a'\n", - "secret = 'a239c12ecc42911ecbc3b23a9539976caaa60f7d40028dea17cb67cc538c21bd'\n", + "key = \n", + "secret = \n", "\n", "headers = {\n", " 'X-API-KEY': key,\n", @@ -245,7 +245,7 @@ } ], "source": [ - "hash_to_send = '99893b819abfa80498f244fddd080f570cecdc994199d5c6a8148141401cdff1'\n", + "hash_to_send = \n", "\n", "params = { 'user_confirmation_hash' : hash_to_send }\n", "confirm_request = re.post('http://localhost/api/v1/confirm_block', headers=headers, params=params)\n", @@ -270,7 +270,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.2" + "version": "3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]" }, "orig_nbformat": 4, "vscode": {