Vincent Sima před 6 roky
rodič
revize
91f12dda6d

binární
.DS_Store Zobrazit soubor


+ 13
- 0
mining/.idea/compiler.xml Zobrazit soubor

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="mining" />
10
+      </profile>
11
+    </annotationProcessing>
12
+  </component>
13
+</project>

+ 14
- 0
mining/.idea/misc.xml Zobrazit soubor

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+  <component name="MavenProjectsManager">
5
+    <option name="originalFiles">
6
+      <list>
7
+        <option value="$PROJECT_DIR$/pom.xml" />
8
+      </list>
9
+    </option>
10
+  </component>
11
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
12
+    <output url="file://$PROJECT_DIR$/out" />
13
+  </component>
14
+</project>

+ 377
- 0
mining/.idea/workspace.xml Zobrazit soubor

@@ -0,0 +1,377 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="9dee7dd1-4209-4991-b597-a5fc9df5d2fd" name="Default" comment="" />
5
+    <ignored path="$PROJECT_DIR$/out/" />
6
+    <ignored path="$PROJECT_DIR$/target/" />
7
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8
+    <option name="TRACKING_ENABLED" value="true" />
9
+    <option name="SHOW_DIALOG" value="false" />
10
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
11
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
12
+    <option name="LAST_RESOLUTION" value="IGNORE" />
13
+  </component>
14
+  <component name="FileEditorManager">
15
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
16
+      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
17
+        <entry file="file://$PROJECT_DIR$/pom.xml">
18
+          <provider selected="true" editor-type-id="text-editor">
19
+            <state relative-caret-position="255">
20
+              <caret line="17" column="19" selection-start-line="17" selection-start-column="19" selection-end-line="17" selection-end-column="19" />
21
+            </state>
22
+          </provider>
23
+        </entry>
24
+      </file>
25
+      <file leaf-file-name="Mining.java" pinned="false" current-in-tab="true">
26
+        <entry file="file://$PROJECT_DIR$/src/main/java/Mining.java">
27
+          <provider selected="true" editor-type-id="text-editor">
28
+            <state relative-caret-position="211">
29
+              <caret line="28" selection-start-line="28" selection-end-line="28" />
30
+            </state>
31
+          </provider>
32
+        </entry>
33
+      </file>
34
+    </leaf>
35
+  </component>
36
+  <component name="FileTemplateManagerImpl">
37
+    <option name="RECENT_TEMPLATES">
38
+      <list>
39
+        <option value="Class" />
40
+      </list>
41
+    </option>
42
+  </component>
43
+  <component name="FindInProjectRecents">
44
+    <findStrings>
45
+      <find>0000</find>
46
+    </findStrings>
47
+  </component>
48
+  <component name="GradleLocalSettings">
49
+    <option name="projectSyncType">
50
+      <map>
51
+        <entry key="$USER_HOME$/Labs/alphavantage4j" value="PREVIEW" />
52
+      </map>
53
+    </option>
54
+  </component>
55
+  <component name="IdeDocumentHistory">
56
+    <option name="CHANGED_PATHS">
57
+      <list>
58
+        <option value="$PROJECT_DIR$/pom.xml" />
59
+        <option value="$PROJECT_DIR$/src/main/java/Mining.java" />
60
+      </list>
61
+    </option>
62
+  </component>
63
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
64
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
65
+  <component name="JsGulpfileManager">
66
+    <detection-done>true</detection-done>
67
+    <sorting>DEFINITION_ORDER</sorting>
68
+  </component>
69
+  <component name="MavenImportPreferences">
70
+    <option name="importingSettings">
71
+      <MavenImportingSettings>
72
+        <option name="importAutomatically" value="true" />
73
+      </MavenImportingSettings>
74
+    </option>
75
+  </component>
76
+  <component name="NodePackageJsonFileManager">
77
+    <packageJsonPaths />
78
+  </component>
79
+  <component name="ProjectFrameBounds" extendedState="6">
80
+    <option name="y" value="23" />
81
+    <option name="width" value="1905" />
82
+    <option name="height" value="985" />
83
+  </component>
84
+  <component name="ProjectView">
85
+    <navigator proportions="" version="1">
86
+      <foldersAlwaysOnTop value="true" />
87
+    </navigator>
88
+    <panes>
89
+      <pane id="Scope" />
90
+      <pane id="PackagesPane" />
91
+      <pane id="AndroidView" />
92
+      <pane id="ProjectPane">
93
+        <subPane>
94
+          <expand>
95
+            <path>
96
+              <item name="mining" type="b2602c69:ProjectViewProjectNode" />
97
+              <item name="mining" type="462c0819:PsiDirectoryNode" />
98
+            </path>
99
+            <path>
100
+              <item name="mining" type="b2602c69:ProjectViewProjectNode" />
101
+              <item name="mining" type="462c0819:PsiDirectoryNode" />
102
+              <item name="src" type="462c0819:PsiDirectoryNode" />
103
+            </path>
104
+            <path>
105
+              <item name="mining" type="b2602c69:ProjectViewProjectNode" />
106
+              <item name="mining" type="462c0819:PsiDirectoryNode" />
107
+              <item name="src" type="462c0819:PsiDirectoryNode" />
108
+              <item name="main" type="462c0819:PsiDirectoryNode" />
109
+            </path>
110
+            <path>
111
+              <item name="mining" type="b2602c69:ProjectViewProjectNode" />
112
+              <item name="mining" type="462c0819:PsiDirectoryNode" />
113
+              <item name="src" type="462c0819:PsiDirectoryNode" />
114
+              <item name="main" type="462c0819:PsiDirectoryNode" />
115
+              <item name="java" type="462c0819:PsiDirectoryNode" />
116
+            </path>
117
+          </expand>
118
+          <select />
119
+        </subPane>
120
+      </pane>
121
+    </panes>
122
+  </component>
123
+  <component name="PropertiesComponent">
124
+    <property name="WebServerToolWindowFactoryState" value="false" />
125
+    <property name="aspect.path.notification.shown" value="true" />
126
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
127
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
128
+    <property name="project.structure.last.edited" value="Modules" />
129
+    <property name="project.structure.proportion" value="0.0" />
130
+    <property name="project.structure.side.proportion" value="0.0" />
131
+    <property name="settings.editor.selected.configurable" value="editor.preferences.gutterIcons" />
132
+  </component>
133
+  <component name="RunDashboard">
134
+    <option name="ruleStates">
135
+      <list>
136
+        <RuleState>
137
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
138
+        </RuleState>
139
+        <RuleState>
140
+          <option name="name" value="StatusDashboardGroupingRule" />
141
+        </RuleState>
142
+      </list>
143
+    </option>
144
+  </component>
145
+  <component name="RunManager">
146
+    <configuration name="Mining" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
147
+      <option name="MAIN_CLASS_NAME" value="Mining" />
148
+      <module name="mining" />
149
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
150
+    </configuration>
151
+    <configuration default="true" type="Application" factoryName="Application">
152
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
153
+    </configuration>
154
+    <configuration default="true" type="JUnit" factoryName="JUnit">
155
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
156
+      <option name="ALTERNATIVE_JRE_PATH" />
157
+      <option name="PACKAGE_NAME" />
158
+      <option name="MAIN_CLASS_NAME" />
159
+      <option name="METHOD_NAME" />
160
+      <option name="TEST_OBJECT" value="class" />
161
+      <option name="VM_PARAMETERS" value="-ea" />
162
+      <option name="PARAMETERS" />
163
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
164
+      <option name="PASS_PARENT_ENVS" value="true" />
165
+      <option name="TEST_SEARCH_SCOPE">
166
+        <value defaultName="singleModule" />
167
+      </option>
168
+      <patterns />
169
+    </configuration>
170
+    <configuration default="true" type="TestNG" factoryName="TestNG">
171
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
172
+      <option name="ALTERNATIVE_JRE_PATH" />
173
+      <option name="SUITE_NAME" />
174
+      <option name="PACKAGE_NAME" />
175
+      <option name="MAIN_CLASS_NAME" />
176
+      <option name="METHOD_NAME" />
177
+      <option name="GROUP_NAME" />
178
+      <option name="TEST_OBJECT" value="CLASS" />
179
+      <option name="VM_PARAMETERS" value="-ea" />
180
+      <option name="PARAMETERS" />
181
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
182
+      <option name="OUTPUT_DIRECTORY" />
183
+      <option name="PASS_PARENT_ENVS" value="true" />
184
+      <option name="TEST_SEARCH_SCOPE">
185
+        <value defaultName="singleModule" />
186
+      </option>
187
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
188
+      <option name="PROPERTIES_FILE" />
189
+      <properties />
190
+      <listeners />
191
+    </configuration>
192
+    <recent_temporary>
193
+      <list>
194
+        <item itemvalue="Application.Mining" />
195
+      </list>
196
+    </recent_temporary>
197
+  </component>
198
+  <component name="SvnConfiguration">
199
+    <configuration />
200
+  </component>
201
+  <component name="TaskManager">
202
+    <task active="true" id="Default" summary="Default task">
203
+      <changelist id="9dee7dd1-4209-4991-b597-a5fc9df5d2fd" name="Default" comment="" />
204
+      <created>1531406760597</created>
205
+      <option name="number" value="Default" />
206
+      <option name="presentableId" value="Default" />
207
+      <updated>1531406760597</updated>
208
+      <workItem from="1531406765675" duration="5494000" />
209
+      <workItem from="1531424831661" duration="2107000" />
210
+    </task>
211
+    <servers />
212
+  </component>
213
+  <component name="TimeTrackingManager">
214
+    <option name="totallyTimeSpent" value="7601000" />
215
+  </component>
216
+  <component name="ToolWindowManager">
217
+    <frame x="0" y="23" width="1280" height="705" extended-state="6" />
218
+    <layout>
219
+      <window_info anchor="right" id="Palette" order="3" />
220
+      <window_info anchor="bottom" id="TODO" order="6" />
221
+      <window_info anchor="bottom" id="Messages" order="7" weight="0.32716763" />
222
+      <window_info anchor="right" id="Palette&#9;" order="3" />
223
+      <window_info id="Image Layers" order="2" />
224
+      <window_info anchor="right" id="Capture Analysis" order="3" />
225
+      <window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
226
+      <window_info anchor="right" id="Maven Projects" order="3" />
227
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
228
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32820514" />
229
+      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
230
+      <window_info anchor="bottom" id="Terminal" order="7" />
231
+      <window_info id="Capture Tool" order="2" />
232
+      <window_info id="Designer" order="2" />
233
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2536349" />
234
+      <window_info anchor="right" id="Database" order="3" />
235
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
236
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
237
+      <window_info id="UI Designer" order="2" />
238
+      <window_info anchor="right" id="Theme Preview" order="3" />
239
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
240
+      <window_info id="Favorites" order="2" side_tool="true" />
241
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
242
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
243
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
244
+      <window_info anchor="bottom" id="Message" order="0" />
245
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
246
+      <window_info anchor="bottom" id="Find" order="1" />
247
+    </layout>
248
+  </component>
249
+  <component name="TypeScriptGeneratedFilesManager">
250
+    <option name="version" value="1" />
251
+  </component>
252
+  <component name="VcsContentAnnotationSettings">
253
+    <option name="myLimit" value="2678400000" />
254
+  </component>
255
+  <component name="XDebuggerManager">
256
+    <breakpoint-manager>
257
+      <option name="time" value="1" />
258
+    </breakpoint-manager>
259
+  </component>
260
+  <component name="editorHistoryManager">
261
+    <entry file="file://$PROJECT_DIR$/pom.xml">
262
+      <provider selected="true" editor-type-id="text-editor">
263
+        <state relative-caret-position="255">
264
+          <caret line="17" column="19" selection-start-line="17" selection-start-column="19" selection-end-line="17" selection-end-column="19" />
265
+        </state>
266
+      </provider>
267
+    </entry>
268
+    <entry file="file://$PROJECT_DIR$/src/main/java/Mining.java">
269
+      <provider selected="true" editor-type-id="text-editor">
270
+        <state relative-caret-position="315">
271
+          <caret line="21" column="39" selection-start-line="21" selection-start-column="39" selection-end-line="21" selection-end-column="39" />
272
+        </state>
273
+      </provider>
274
+    </entry>
275
+    <entry file="file://$PROJECT_DIR$/pom.xml">
276
+      <provider selected="true" editor-type-id="text-editor">
277
+        <state relative-caret-position="255">
278
+          <caret line="17" column="19" selection-start-line="17" selection-start-column="19" selection-end-line="17" selection-end-column="19" />
279
+        </state>
280
+      </provider>
281
+    </entry>
282
+    <entry file="file://$PROJECT_DIR$/src/main/java/Mining.java">
283
+      <provider selected="true" editor-type-id="text-editor">
284
+        <state relative-caret-position="211">
285
+          <caret line="28" selection-start-line="28" selection-end-line="28" />
286
+        </state>
287
+      </provider>
288
+    </entry>
289
+  </component>
290
+  <component name="masterDetails">
291
+    <states>
292
+      <state key="ArtifactsStructureConfigurable.UI">
293
+        <settings>
294
+          <artifact-editor />
295
+          <splitter-proportions>
296
+            <option name="proportions">
297
+              <list>
298
+                <option value="0.2" />
299
+              </list>
300
+            </option>
301
+          </splitter-proportions>
302
+        </settings>
303
+      </state>
304
+      <state key="FacetStructureConfigurable.UI">
305
+        <settings>
306
+          <last-edited>No facets are configured</last-edited>
307
+          <splitter-proportions>
308
+            <option name="proportions">
309
+              <list>
310
+                <option value="0.2" />
311
+              </list>
312
+            </option>
313
+          </splitter-proportions>
314
+        </settings>
315
+      </state>
316
+      <state key="GlobalLibrariesConfigurable.UI">
317
+        <settings>
318
+          <splitter-proportions>
319
+            <option name="proportions">
320
+              <list>
321
+                <option value="0.2" />
322
+              </list>
323
+            </option>
324
+          </splitter-proportions>
325
+        </settings>
326
+      </state>
327
+      <state key="JdkListConfigurable.UI">
328
+        <settings>
329
+          <last-edited>1.8</last-edited>
330
+          <splitter-proportions>
331
+            <option name="proportions">
332
+              <list>
333
+                <option value="0.2" />
334
+              </list>
335
+            </option>
336
+          </splitter-proportions>
337
+        </settings>
338
+      </state>
339
+      <state key="ModuleStructureConfigurable.UI">
340
+        <settings>
341
+          <last-edited>mining</last-edited>
342
+          <splitter-proportions>
343
+            <option name="proportions">
344
+              <list>
345
+                <option value="0.2" />
346
+                <option value="0.6" />
347
+              </list>
348
+            </option>
349
+          </splitter-proportions>
350
+        </settings>
351
+      </state>
352
+      <state key="ProjectJDKs.UI">
353
+        <settings>
354
+          <last-edited>1.8</last-edited>
355
+          <splitter-proportions>
356
+            <option name="proportions">
357
+              <list>
358
+                <option value="0.2" />
359
+              </list>
360
+            </option>
361
+          </splitter-proportions>
362
+        </settings>
363
+      </state>
364
+      <state key="ProjectLibrariesConfigurable.UI">
365
+        <settings>
366
+          <splitter-proportions>
367
+            <option name="proportions">
368
+              <list>
369
+                <option value="0.2" />
370
+              </list>
371
+            </option>
372
+          </splitter-proportions>
373
+        </settings>
374
+      </state>
375
+    </states>
376
+  </component>
377
+</project>

+ 2
- 0
mining/mining.iml Zobrazit soubor

@@ -0,0 +1,2 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4" />

+ 21
- 0
mining/pom.xml Zobrazit soubor

@@ -0,0 +1,21 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <groupId>mining</groupId>
8
+    <artifactId>mining</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+
11
+
12
+    <dependencies>
13
+        <dependency>
14
+            <groupId>commons-codec</groupId>
15
+            <artifactId>commons-codec</artifactId>
16
+            <version>1.4</version>
17
+        </dependency>
18
+    </dependencies>
19
+
20
+
21
+</project>

+ 31
- 0
mining/src/main/java/Mining.java Zobrazit soubor

@@ -0,0 +1,31 @@
1
+public class Mining {
2
+
3
+    public static void main(String[] args) {
4
+        String prevHash = "a27f5c79ec375f7754e2c7096ea5b85bc76bed83a822d138d3877269e2687ae0";
5
+        String block = "8";
6
+        String data = "vince -> mexi 54566, clem -> vince 0948533";
7
+        Mining test = new Mining();
8
+        test.mine(prevHash, block, data);
9
+    }
10
+
11
+    public String hash(String string) {
12
+        String hashed = org.apache.commons.codec.digest.DigestUtils.sha256Hex(string);
13
+        return hashed;
14
+    }
15
+
16
+    public void mine(String prevHash, String block, String data) {
17
+        int nonce = 0;
18
+        boolean mined = false;
19
+        while (mined == false) {
20
+            String newHash = hash(prevHash + block + data + Integer.toString(nonce));
21
+            System.out.println(newHash);
22
+            if (newHash.startsWith("000000")) {
23
+                mined = true;
24
+            } else {
25
+                nonce++;
26
+            }
27
+        }
28
+        System.out.println(nonce);
29
+
30
+    }
31
+}

binární
mining/target/classes/Mining.class Zobrazit soubor