Eric Foster преди 6 години
родител
ревизия
0acd0b0399
променени са 26 файла, в които са добавени 201 реда и са изтрити 68 реда
  1. 1
    1
      .idea/workspace.xml
  2. 1
    1
      ZipCoinRedIonicClient/.sourcemaps/main.js.map
  3. 1
    1
      ZipCoinRedIonicClient/www/build/0.js
  4. 2
    2
      ZipCoinRedIonicClient/www/build/1.js
  5. 2
    2
      ZipCoinRedIonicClient/www/build/2.js
  6. 12
    13
      ZipCoinRedIonicClient/www/build/main.js
  7. 1
    1
      ZipCoinRedIonicClient/www/build/vendor.js.map
  8. 0
    13
      ZipCoinRedJavaServer/.idea/libraries/Maven__com_h2database_h2_1_4_190.xml
  9. 13
    0
      ZipCoinRedJavaServer/.idea/libraries/Maven__mysql_mysql_connector_java_5_1_38.xml
  10. 0
    13
      ZipCoinRedJavaServer/.idea/libraries/Maven__org_flywaydb_flyway_core_3_2_1.xml
  11. 2
    1
      ZipCoinRedJavaServer/.idea/libraries/Spring_4_3_18_RELEASE.xml
  12. 1
    0
      ZipCoinRedJavaServer/ZipCoin-RED.iml
  13. 0
    2
      ZipCoinRedJavaServer/pom.xml
  14. 24
    0
      ZipCoinRedJavaServer/src/main/java/com/zipcoin/ZipCoinApp.java
  15. 40
    1
      ZipCoinRedJavaServer/src/main/java/com/zipcoin/config/TransactionLoader.java
  16. 13
    15
      ZipCoinRedJavaServer/src/main/java/com/zipcoin/model/Transaction.java
  17. 1
    0
      ZipCoinRedJavaServer/src/main/resources/application.properties
  18. 2
    1
      ZipCoinRedJavaServer/target/classes/application.properties
  19. BIN
      ZipCoinRedJavaServer/target/classes/com/zipcoin/config/BlockLoader.class
  20. BIN
      ZipCoinRedJavaServer/target/classes/com/zipcoin/config/TransactionLoader.class
  21. BIN
      ZipCoinRedJavaServer/target/classes/com/zipcoin/config/WalletLoader.class
  22. BIN
      ZipCoinRedJavaServer/target/classes/com/zipcoin/model/Transaction.class
  23. 0
    1
      ZipCoinRedJavaServer/target/classes/db/migration/V2__create_block.sql
  24. 51
    0
      src/main/java/redCoin/Main.java
  25. 34
    0
      src/test/java/redCoin/testMain.java
  26. BIN
      target/test-classes/redCoin/testMain.class

+ 1
- 1
.idea/workspace.xml Целия файл

@@ -900,4 +900,4 @@
900 900
       </state>
901 901
     </states>
902 902
   </component>
903
-</project>
903
+</project>

+ 1
- 1
ZipCoinRedIonicClient/.sourcemaps/main.js.map
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 1
ZipCoinRedIonicClient/www/build/0.js Целия файл

@@ -8,7 +8,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 8
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WalletPageModule", function() { return WalletPageModule; });
9 9
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 10
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(28);
11
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__wallet__ = __webpack_require__(102);
11
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__wallet__ = __webpack_require__(101);
12 12
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 13
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 14
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);

+ 2
- 2
ZipCoinRedIonicClient/www/build/1.js Целия файл

@@ -1,6 +1,6 @@
1 1
 webpackJsonp([1],{
2 2
 
3
-/***/ 280:
3
+/***/ 281:
4 4
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
5 5
 
6 6
 "use strict";
@@ -8,7 +8,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 8
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransactionPageModule", function() { return TransactionPageModule; });
9 9
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 10
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(28);
11
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__transaction__ = __webpack_require__(100);
11
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__transaction__ = __webpack_require__(102);
12 12
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 13
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 14
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);

+ 2
- 2
ZipCoinRedIonicClient/www/build/2.js Целия файл

@@ -1,6 +1,6 @@
1 1
 webpackJsonp([2],{
2 2
 
3
-/***/ 281:
3
+/***/ 280:
4 4
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
5 5
 
6 6
 "use strict";
@@ -8,7 +8,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8 8
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabsPageModule", function() { return TabsPageModule; });
9 9
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
10 10
 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(28);
11
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__tabs__ = __webpack_require__(101);
11
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__tabs__ = __webpack_require__(100);
12 12
 var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
13 13
     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14 14
     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);

+ 12
- 13
ZipCoinRedIonicClient/www/build/main.js Целия файл

@@ -78,7 +78,7 @@ var TabsPage = /** @class */ (function () {
78 78
     }
79 79
     TabsPage = __decorate([
80 80
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
81
-            selector: 'page-tabs',template:/*ion-inline-start:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/tabs/tabs.html"*/'<ion-tabs>\n  <ion-tab [root]="homePage" tabTitle="ZipCoin-BlockChain" tabIcon="link"></ion-tab>\n  <ion-tab [root]="walletPage" tabTitle="ZipCoin Wallet" tabIcon="cash"></ion-tab>\n  <ion-tab [root]="transactionPage" tabTitle="ZipCoin Transactions" tabIcon="contacts"></ion-tab>\n  <ion-tab [root]="tab4" tabTitle="Ziptab" tabIcon="star"></ion-tab>\n\n</ion-tabs>'/*ion-inline-end:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/tabs/tabs.html"*/,
81
+            selector: 'page-tabs',template:/*ion-inline-start:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/tabs/tabs.html"*/'<ion-tabs>\n  <ion-tab [root]="homePage" tabTitle="ZipCoin-BlockChain" tabIcon="link"></ion-tab>\n  <ion-tab [root]="walletPage" tabTitle="ZipCoin Wallet" tabIcon="cash"></ion-tab>\n  <ion-tab [root]="transactionPage" tabTitle="ZipCoin Transactions" tabIcon="contacts"></ion-tab>\n  <ion-tab [root]="tab4" tabTitle="Ziptab" tabIcon="star"></ion-tab>\n\n</ion-tabs>'/*ion-inline-end:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/tabs/tabs.html"*/,
82 82
         }),
83 83
         __metadata("design:paramtypes", [])
84 84
     ], TabsPage);
@@ -129,7 +129,7 @@ var WalletPage = /** @class */ (function () {
129 129
     };
130 130
     WalletPage = __decorate([
131 131
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
132
-            selector: 'page-wallet',template:/*ion-inline-start:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/wallet/wallet.html"*/'<!--\n  Generated template for the WalletPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>Wallet</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n\n  \n  <ion-item>\n      <ion-label>Name</ion-label>\n      <ion-select [(ngModel)]="name">\n        <ion-option value="navya">navya</ion-option>\n        <ion-option value="aleena">aleena</ion-option>\n      </ion-select>\n     </ion-item>\n     <ion-item>\n        <ion-label>current balance</ion-label>\n        <ion-input></ion-input>\n      </ion-item>\n      <ion-item>\n          <ion-label>Public Key</ion-label>\n          <ion-input></ion-input>\n        </ion-item>\n      <br>\n      <br>\n      <div class = "bar bar-subheader bar-assertive">\n          <h2 class = "title">Payment</h2>\n       </div>\n       <ion-item>\n          <ion-label>From</ion-label>\n          <ion-select [(ngModel)]="name">\n            <ion-option value="navya">navya</ion-option>\n            <ion-option value="aleena">aleena</ion-option>\n          </ion-select>\n         </ion-item>\n         <ion-item>\n            <ion-label>To</ion-label>\n            <ion-select [(ngModel)]="to">\n              <ion-option value="navya">navya</ion-option>\n              <ion-option value="aleena">aleena</ion-option>\n            </ion-select>\n           </ion-item>\n      \n          <ion-item>\n              <ion-label>Amount</ion-label>\n              <ion-input></ion-input>\n            </ion-item>\n            <br>\n            <button ion-button>Pay</button>\n</ion-content>\n'/*ion-inline-end:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/wallet/wallet.html"*/,
132
+            selector: 'page-wallet',template:/*ion-inline-start:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/wallet/wallet.html"*/'<!--\n  Generated template for the WalletPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>Wallet</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n\n  \n  <ion-item>\n      <ion-label>Name</ion-label>\n      <ion-select [(ngModel)]="name">\n        <ion-option value="navya">navya</ion-option>\n        <ion-option value="aleena">aleena</ion-option>\n      </ion-select>\n     </ion-item>\n     <ion-item>\n        <ion-label>current balance</ion-label>\n        <ion-input></ion-input>\n      </ion-item>\n      <ion-item>\n          <ion-label>Public Key</ion-label>\n          <ion-input></ion-input>\n        </ion-item>\n      <br>\n      <br>\n      <div class = "bar bar-subheader bar-assertive">\n          <h2 class = "title">Payment</h2>\n       </div>\n       <ion-item>\n          <ion-label>From</ion-label>\n          <ion-select [(ngModel)]="name">\n            <ion-option value="navya">navya</ion-option>\n            <ion-option value="aleena">aleena</ion-option>\n          </ion-select>\n         </ion-item>\n         <ion-item>\n            <ion-label>To</ion-label>\n            <ion-select [(ngModel)]="to">\n              <ion-option value="navya">navya</ion-option>\n              <ion-option value="aleena">aleena</ion-option>\n            </ion-select>\n           </ion-item>\n      \n          <ion-item>\n              <ion-label>Amount</ion-label>\n              <ion-input></ion-input>\n            </ion-item>\n            <br>\n            <button ion-button>Pay</button>\n</ion-content>\n'/*ion-inline-end:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/wallet/wallet.html"*/,
133 133
         }),
134 134
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */], __WEBPACK_IMPORTED_MODULE_2__providers_transaction_service__["a" /* TransactionService */]])
135 135
     ], WalletPage);
@@ -183,7 +183,7 @@ var TransactionPage = /** @class */ (function () {
183 183
     };
184 184
     TransactionPage = __decorate([
185 185
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
186
-            selector: 'page-transaction',template:/*ion-inline-start:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/transaction/transaction.html"*/'<!--\n  Generated template for the TransactionPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>Transaction</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n</ion-content>\n'/*ion-inline-end:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/transaction/transaction.html"*/,
186
+            selector: 'page-transaction',template:/*ion-inline-start:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/transaction/transaction.html"*/'<!--\n  Generated template for the TransactionPage page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>Transaction</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n</ion-content>\n'/*ion-inline-end:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/transaction/transaction.html"*/,
187 187
         }),
188 188
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */],
189 189
             __WEBPACK_IMPORTED_MODULE_2__providers_transaction_service__["a" /* TransactionService */]])
@@ -296,7 +296,7 @@ var HomePage = /** @class */ (function () {
296 296
     };
297 297
     HomePage = __decorate([
298 298
         Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
299
-            selector: 'page-home',template:/*ion-inline-start:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/home/home.html"*/'<ion-header>\n  <ion-navbar>\n    <ion-title>\n      ZipCoin BlockChain\n    </ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n\n  <ion-list>\n    <ion-item-sliding *ngFor="let block of blocks">\n      <ion-item>\n        <ion-card>\n            <ion-card-header>\n              Block #: {{block.blockNumber}}\n            </ion-card-header>\n            <ion-card-content>\n              <div>Nonce: {{ block.nonce }}</div>\n              <div>Data: {{ block.transactionList }}</div>\n              <div>Previous Hash: {{ block.previousHash }}</div>\n              <div>Current Hash: {{ block.currentHash }}</div>\n              <button ion-button (click)="getMinedBlock(block.id)">Mine</button>\n            </ion-card-content>\n        </ion-card>\n      </ion-item>\n    </ion-item-sliding>\n  </ion-list>\n\n</ion-content>'/*ion-inline-end:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/home/home.html"*/
299
+            selector: 'page-home',template:/*ion-inline-start:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/home/home.html"*/'<ion-header>\n  <ion-navbar>\n    <ion-title>\n      ZipCoin BlockChain\n    </ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n\n  <ion-list>\n    <ion-item-sliding *ngFor="let block of blocks">\n      <ion-item>\n        <ion-card>\n            <ion-card-header>\n              Block #: {{block.blockNumber}}\n            </ion-card-header>\n            <ion-card-content>\n              <div>Nonce: {{ block.nonce }}</div>\n              <div>Data: {{ block.transactionList }}</div>\n              <div>Previous Hash: {{ block.previousHash }}</div>\n              <div>Current Hash: {{ block.currentHash }}</div>\n              <button ion-button (click)="getMinedBlock(block.id)">Mine</button>\n            </ion-card-content>\n        </ion-card>\n      </ion-item>\n    </ion-item-sliding>\n  </ion-list>\n\n</ion-content>'/*ion-inline-end:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/home/home.html"*/
300 300
         }),
301 301
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_2__providers_block_service__["a" /* BlockService */]])
302 302
     ], HomePage);
@@ -495,7 +495,7 @@ var MyApp = /** @class */ (function () {
495 495
         });
496 496
     }
497 497
     MyApp = __decorate([
498
-        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/app/app.html"*/'<ion-nav [root]="rootPage"></ion-nav>\n'/*ion-inline-end:"/Users/ericf/ZCWProjects/ZipCoin-RED/ZipCoinRedIonicClient/src/app/app.html"*/
498
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/app/app.html"*/'<ion-nav [root]="rootPage"></ion-nav>\n'/*ion-inline-end:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/app/app.html"*/
499 499
         }),
500 500
         __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* Platform */], __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__["a" /* StatusBar */], __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__["a" /* SplashScreen */]])
501 501
     ], MyApp);
@@ -533,14 +533,13 @@ var TransactionService = /** @class */ (function () {
533 533
     TransactionService.prototype.createTransaction = function (transaction) {
534 534
         return this.http.post(this.TRANSACTION_API, transaction);
535 535
     };
536
-    TransactionService.prototype.getAllTransactions = function () {
537
-        return this.http.get(this.TRANSACTION_API);
538
-    };
539
-    TransactionService = __decorate([
540
-        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
541
-        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */]])
542
-    ], TransactionService);
543
-    return TransactionService;
536
+    Tab4Page = __decorate([
537
+        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
538
+            selector: 'page-tab4',template:/*ion-inline-start:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/tab4/tab4.html"*/'<!--\n  Generated template for the Tab4Page page.\n\n  See http://ionicframework.com/docs/components/#navigation for more info on\n  Ionic pages and navigation.\n-->\n<ion-header>\n\n  <ion-navbar>\n    <ion-title>tab4</ion-title>\n  </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n</ion-content>\n'/*ion-inline-end:"/Users/shivamp/labs/ZipCoin-RED/ZipCoinRedIonicClient/src/pages/tab4/tab4.html"*/,
539
+        }),
540
+        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["e" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* NavParams */]])
541
+    ], Tab4Page);
542
+    return Tab4Page;
544 543
 }());
545 544
 
546 545
 //# sourceMappingURL=transaction-service.js.map

+ 1
- 1
ZipCoinRedIonicClient/www/build/vendor.js.map
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 0
- 13
ZipCoinRedJavaServer/.idea/libraries/Maven__com_h2database_h2_1_4_190.xml Целия файл

@@ -1,13 +0,0 @@
1
-<component name="libraryTable">
2
-  <library name="Maven: com.h2database:h2:1.4.190">
3
-    <CLASSES>
4
-      <root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/1.4.190/h2-1.4.190.jar!/" />
5
-    </CLASSES>
6
-    <JAVADOC>
7
-      <root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/1.4.190/h2-1.4.190-javadoc.jar!/" />
8
-    </JAVADOC>
9
-    <SOURCES>
10
-      <root url="jar://$MAVEN_REPOSITORY$/com/h2database/h2/1.4.190/h2-1.4.190-sources.jar!/" />
11
-    </SOURCES>
12
-  </library>
13
-</component>

+ 13
- 0
ZipCoinRedJavaServer/.idea/libraries/Maven__mysql_mysql_connector_java_5_1_38.xml Целия файл

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: mysql:mysql-connector-java:5.1.38">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 0
- 13
ZipCoinRedJavaServer/.idea/libraries/Maven__org_flywaydb_flyway_core_3_2_1.xml Целия файл

@@ -1,13 +0,0 @@
1
-<component name="libraryTable">
2
-  <library name="Maven: org.flywaydb:flyway-core:3.2.1">
3
-    <CLASSES>
4
-      <root url="jar://$MAVEN_REPOSITORY$/org/flywaydb/flyway-core/3.2.1/flyway-core-3.2.1.jar!/" />
5
-    </CLASSES>
6
-    <JAVADOC>
7
-      <root url="jar://$MAVEN_REPOSITORY$/org/flywaydb/flyway-core/3.2.1/flyway-core-3.2.1-javadoc.jar!/" />
8
-    </JAVADOC>
9
-    <SOURCES>
10
-      <root url="jar://$MAVEN_REPOSITORY$/org/flywaydb/flyway-core/3.2.1/flyway-core-3.2.1-sources.jar!/" />
11
-    </SOURCES>
12
-  </library>
13
-</component>

+ 2
- 1
ZipCoinRedJavaServer/.idea/libraries/Spring_4_3_18_RELEASE.xml Целия файл

@@ -1,5 +1,6 @@
1 1
 <component name="libraryTable">
2
-  <library name="Spring-4.3.18.RELEASE">
2
+  <library name="Spring-4.3.18.RELEASE" type="spring">
3
+    <properties version="4.3.18.RELEASE" />
3 4
     <CLASSES>
4 5
       <root url="jar://$PROJECT_DIR$/lib/spring-aspects-4.3.18.RELEASE.jar!/" />
5 6
       <root url="jar://$PROJECT_DIR$/lib/spring-context-support-4.3.18.RELEASE.jar!/" />

+ 1
- 0
ZipCoinRedJavaServer/ZipCoin-RED.iml Целия файл

@@ -26,6 +26,7 @@
26 26
     </content>
27 27
     <orderEntry type="inheritedJdk" />
28 28
     <orderEntry type="sourceFolder" forTests="false" />
29
+    <orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.38" level="project" />
29 30
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.3.1.RELEASE" level="project" />
30 31
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.3.1.RELEASE" level="project" />
31 32
     <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.3.1.RELEASE" level="project" />

+ 0
- 2
ZipCoinRedJavaServer/pom.xml Целия файл

@@ -57,6 +57,4 @@
57 57
     </dependencies>
58 58
 
59 59
 
60
-
61
-
62 60
 </project>

+ 24
- 0
ZipCoinRedJavaServer/src/main/java/com/zipcoin/ZipCoinApp.java Целия файл

@@ -11,3 +11,27 @@ public class ZipCoinApp {
11 11
     }
12 12
 
13 13
 }
14
+
15
+
16
+
17
+/*
18
+*
19
+*
20
+*
21
+* figure out how to send serialized coins
22
+* tabbed interface
23
+* :payment,wallet, transaction
24
+* :blocks - show all blocks on chain
25
+* LocalDate for transactions, /wallet/getID
26
+* coin ONLY, coin objects, hashcoded. talk to yauheni about this.
27
+* List<Coin> of coins
28
+*
29
+*
30
+*
31
+* springboot run on hiroku ************
32
+*
33
+*
34
+*
35
+* @return coin with serialized number
36
+*
37
+* */

+ 40
- 1
ZipCoinRedJavaServer/src/main/java/com/zipcoin/config/TransactionLoader.java Целия файл

@@ -1,4 +1,43 @@
1 1
 package com.zipcoin.config;
2 2
 
3
-public class TransactionLoader {
3
+import com.zipcoin.model.Transaction;
4
+import com.zipcoin.repository.TransactionRepository;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.boot.ApplicationArguments;
7
+import org.springframework.boot.ApplicationRunner;
8
+import org.springframework.stereotype.Component;
9
+
10
+@Component
11
+public class TransactionLoader implements ApplicationRunner {
12
+
13
+  private TransactionRepository repo;
14
+
15
+  @Autowired
16
+  public TransactionLoader(TransactionRepository repo){
17
+      this.repo = repo;
18
+  }
19
+
20
+
21
+    @Override
22
+    public void run(ApplicationArguments applicationArguments){
23
+
24
+        Transaction[] transactions = new Transaction[]{
25
+
26
+                new Transaction("shivam", "khalil", 10),
27
+                new Transaction("eric", "shivam", 100),
28
+                new Transaction("khalil", "eric", (float)30.22),
29
+                new Transaction("aleena", "navya", (float)43.32),
30
+                new Transaction("shivam", "ken", 1)
31
+        };
32
+
33
+
34
+
35
+
36
+        for(Transaction t : transactions){
37
+            this.repo.save(t);
38
+        }
39
+
40
+
41
+
42
+    }
4 43
 }

+ 13
- 15
ZipCoinRedJavaServer/src/main/java/com/zipcoin/model/Transaction.java Целия файл

@@ -1,20 +1,18 @@
1 1
 package com.zipcoin.model;
2 2
 
3
-import com.zipcoin.utilities.StringUtil;
4 3
 import org.apache.commons.codec.digest.DigestUtils;
5 4
 
6 5
 import javax.persistence.*;
7 6
 
8
-import java.security.*;
9
-import java.util.List;
10 7
 
11 8
 @Entity
12 9
 public class Transaction {
13 10
     @Id
14 11
     @GeneratedValue(strategy = GenerationType.AUTO)
15
-    private String transactionId;
16
-    private PublicKey sender;
17
-    private PublicKey reciepient;
12
+    private Long transactionId;
13
+
14
+    private String sender;
15
+    private String reciepient;
18 16
     private float amount;
19 17
 
20 18
     //@OneToMany
@@ -28,7 +26,7 @@ public class Transaction {
28 26
 
29 27
     }
30 28
 
31
-    public Transaction(PublicKey from, PublicKey to, float amount/*List<Integer> coins*/) {
29
+    public Transaction(String from, String to, float amount/*List<Integer> coins*/) {
32 30
         this.sender = from;
33 31
         this.reciepient = to;
34 32
         this.amount = amount;
@@ -36,27 +34,27 @@ public class Transaction {
36 34
 
37 35
     }
38 36
 
39
-    public String getTransactionId() {
37
+    public Long getTransactionId() {
40 38
         return transactionId;
41 39
     }
42 40
 
43
-    public void setTransactionId(String transactionId) {
41
+    public void setTransactionId(Long transactionId) {
44 42
         this.transactionId = transactionId;
45 43
     }
46 44
 
47
-    public PublicKey getSender() {
45
+    public String getSender() {
48 46
         return sender;
49 47
     }
50 48
 
51
-    public void setSender(PublicKey sender) {
49
+    public void setSender(String sender) {
52 50
         this.sender = sender;
53 51
     }
54 52
 
55
-    public PublicKey getReciepient() {
53
+    public String getReciepient() {
56 54
         return reciepient;
57 55
     }
58 56
 
59
-    public void setReciepient(PublicKey reciepient) {
57
+    public void setReciepient(String reciepient) {
60 58
         this.reciepient = reciepient;
61 59
     }
62 60
 
@@ -71,8 +69,8 @@ public class Transaction {
71 69
     private String calulateHash() {
72 70
 
73 71
         return DigestUtils.sha256Hex(
74
-                StringUtil.getStringFromKey(sender) +
75
-                        StringUtil.getStringFromKey(reciepient) +
72
+                sender +
73
+                        (reciepient) +
76 74
                         Float.toString(amount)
77 75
         );
78 76
     }

+ 1
- 0
ZipCoinRedJavaServer/src/main/resources/application.properties Целия файл

@@ -1,3 +1,4 @@
1
+
1 2
 spring.jpa.hibernate.ddl-auto=create-drop
2 3
 spring.datasource.url=jdbc:mysql://localhost:3306/zipcoin?useSSL=false
3 4
 spring.datasource.username=root

+ 2
- 1
ZipCoinRedJavaServer/target/classes/application.properties Целия файл

@@ -1,3 +1,4 @@
1
+
1 2
 spring.jpa.hibernate.ddl-auto=create-drop
2 3
 spring.datasource.url=jdbc:mysql://localhost:3306/zipcoin?useSSL=false
3
-spring.datasource.username=root
4
+spring.datasource.username=root

BIN
ZipCoinRedJavaServer/target/classes/com/zipcoin/config/BlockLoader.class Целия файл


BIN
ZipCoinRedJavaServer/target/classes/com/zipcoin/config/TransactionLoader.class Целия файл


BIN
ZipCoinRedJavaServer/target/classes/com/zipcoin/config/WalletLoader.class Целия файл


BIN
ZipCoinRedJavaServer/target/classes/com/zipcoin/model/Transaction.class Целия файл


+ 0
- 1
ZipCoinRedJavaServer/target/classes/db/migration/V2__create_block.sql Целия файл

@@ -1,15 +0,0 @@
1
---

+ 51
- 0
src/main/java/redCoin/Main.java Целия файл

@@ -0,0 +1,51 @@
1
+package redCoin;
2
+
3
+import org.apache.commons.codec.digest.DigestUtils;
4
+
5
+public class Main {
6
+
7
+
8
+    public static void main(String[] args) {
9
+
10
+        Main test = new Main();
11
+        Thread t1 = new Thread();
12
+        Thread t2 = new Thread();
13
+
14
+        //System.out.println(test.hash("i"));
15
+        t1.start();
16
+        t2.start();
17
+        System.out.println(test.mine("109875890","shivameindslnadgckgvkvskJNf","ken -> shiv9999999999 3030"));
18
+
19
+    }
20
+
21
+    private Integer nonce = 0;
22
+
23
+
24
+    public String hash(String stringToHash) {
25
+        String hashedString = DigestUtils.sha256Hex(stringToHash);
26
+
27
+        return hashedString;
28
+    }
29
+
30
+    public Integer mine(String block, String previousHash, String data){
31
+        boolean hashCodeCheck = false;
32
+
33
+
34
+        while(hashCodeCheck == false){
35
+            String newHash = hash(block + previousHash + data + nonce.toString());
36
+            System.out.println(newHash);
37
+            if(newHash.startsWith("000012f")){
38
+
39
+                hashCodeCheck = true;
40
+            } else{
41
+
42
+                nonce++;
43
+
44
+            }
45
+        }
46
+        System.out.println(nonce);
47
+        return nonce;
48
+    }
49
+
50
+
51
+}

+ 34
- 0
src/test/java/redCoin/testMain.java Целия файл

@@ -0,0 +1,34 @@
1
+package redCoin;
2
+
3
+import org.apache.commons.codec.digest.DigestUtils;
4
+import org.junit.Test;
5
+import static org.junit.Assert.assertEquals;
6
+
7
+
8
+public class testMain {
9
+
10
+    @Test
11
+    public void hash(){
12
+        Main main = new Main();
13
+        String stringToHash = "this is a test hash";
14
+        String expected = DigestUtils.sha256Hex(stringToHash);
15
+
16
+        String actual = main.hash(stringToHash);
17
+        assertEquals(expected,actual);
18
+    }
19
+
20
+    @Test
21
+    public void testMineBoolean(){
22
+        Main main = new Main();
23
+        String previousHash = "hash1";
24
+        String block = "block1";
25
+        String dataToCrypt = "shivam -> eric 200, eric -> khalil 203";
26
+
27
+        String toHash = main.hash(previousHash+block+dataToCrypt);
28
+
29
+
30
+    }
31
+
32
+
33
+
34
+}

BIN
target/test-classes/redCoin/testMain.class Целия файл