Repository navigation
Expand file tree
/
Copy pathchanges.diff
More file actions
3872 lines (3816 loc) · 377 KB
/
Copy pathchanges.diff
File metadata and controls
3872 lines (3816 loc) · 377 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml
index e69de29..1b1aa28 100644
--- a/.github/workflows/javadoc.yml
+++ b/.github/workflows/javadoc.yml
@@ -0,0 +1,94 @@
+name: Javadoc Site
+
+# ΓöÇΓöÇΓöÇ Triggers ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+# Publish on every push to main (after a successful merge / direct push) and
+# allow manual runs from the Actions tab via workflow_dispatch.
+on:
+ push:
+ branches: [ main ]
+ workflow_dispatch:
+ inputs:
+ reason:
+ description: 'Reason for manual Javadoc publish'
+ required: false
+ default: 'manual trigger'
+
+# ΓöÇΓöÇΓöÇ Permissions ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+# contents:write is required for peaceiris/actions-gh-pages to push to gh-pages.
+permissions:
+ contents: write
+
+jobs:
+ publish-javadoc:
+ runs-on: ubuntu-latest
+ name: Generate and publish aggregate Javadoc
+
+ steps:
+ # ΓöÇΓöÇ Checkout ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ - uses: actions/checkout@v4
+ with:
+ # Fetch all history so the Javadoc commit message can reference
+ # the triggering commit SHA.
+ fetch-depth: 1
+
+ # ΓöÇΓöÇ JDK setup ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # Use JDK 21 for Javadoc generation ΓÇö produces the richest output
+ # (enhanced search, improved record component docs) while the library
+ # source is still compiled with --release 17.
+ - name: Set up JDK 21
+ uses: actions/setup-java@v4
+ with:
+ java-version: '21'
+ distribution: 'temurin'
+ cache: maven
+
+ # ΓöÇΓöÇ Install all modules (skip tests for speed) ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # mvn install is required before javadoc:aggregate so that all module
+ # JARs are in the local repository and cross-module @see / @link
+ # references resolve correctly.
+ - name: Install project (skip tests)
+ run: mvn -B install -DskipTests -q
+
+ # ΓöÇΓöÇ Generate aggregate Javadoc ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # javadoc:aggregate runs from the root POM and includes all child
+ # modules. The <reporting> section in pom.xml configures:
+ # - doclint: none (aggregate report ΓÇö no build failure on warnings)
+ # - excludePackageNames: com.privatechain.examples
+ # Output lands in: target/site/apidocs/
+ - name: Generate aggregate Javadoc
+ run: mvn -B javadoc:aggregate -pl . -q
+
+ # ΓöÇΓöÇ Verify output exists ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ - name: Verify Javadoc output
+ run: |
+ if [ ! -f "target/site/apidocs/index.html" ]; then
+ echo "ERROR: target/site/apidocs/index.html not found."
+ echo "Check the maven-javadoc-plugin configuration in pom.xml."
+ exit 1
+ fi
+ echo "Javadoc generated successfully."
+ echo "Entry count: $(find target/site/apidocs -type f | wc -l) files"
+
+ # ΓöÇΓöÇ Deploy to GitHub Pages ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # peaceiris/actions-gh-pages pushes the content of publish_dir to the
+ # gh-pages branch under destination_dir. Subsequent publishes append
+ # to the same branch without overwriting other subdirectories.
+ #
+ # Pre-requisite (one-time repo setup):
+ # Settings → Pages → Source: Deploy from branch → Branch: gh-pages / root
+ #
+ # Published URL: https://dhruv0306.github.io/private-blockchain/apidocs/
+ - name: Deploy to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v4
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./target/site/apidocs
+ destination_dir: apidocs
+ # The commit message includes the SHA of the triggering commit
+ # for full traceability of which source revision produced the docs.
+ commit_message: >-
+ docs: update Javadoc site from ${{ github.sha }} [skip ci]
+ # Keep the existing gh-pages history; don't force-push
+ force_orphan: false
+ # Preserve any other directories on gh-pages (e.g. a landing page)
+ keep_files: true
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index aff8c48..4980d26 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,25 +1,138 @@
name: Release
+# ΓöÇΓöÇΓöÇ Trigger ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+# This workflow fires when a version tag matching v* is pushed.
+#
+# Two ways to trigger a release:
+#
+# Option A ΓÇö Use the maven-release-plugin (recommended for atomic version bumps):
+# mvn release:prepare -Prelease # bumps version, commits, pushes tag
+# mvn release:perform -Prelease # CI picks up the tag and runs this workflow
+#
+# Option B ΓÇö Manual tag for a quick hotfix:
+# mvn versions:set -DnewVersion=1.0.1
+# git add -A && git commit -m "[release] set version 1.0.1"
+# git tag v1.0.1 && git push origin main --tags
on:
push:
tags:
- 'v*'
+# ΓöÇΓöÇΓöÇ Permissions ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+# packages:write is required to publish to GitHub Packages.
+# contents:write is required to create a GitHub Release.
+permissions:
+ contents: write
+ packages: write
+
jobs:
release:
runs-on: ubuntu-latest
+ name: Build, verify, and publish to GitHub Packages
steps:
+ # ΓöÇΓöÇ Checkout ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # Fetch all tags and full history so that:
+ # 1. maven-release-plugin can verify the SCM state.
+ # 2. The release notes step can generate a meaningful changelog.
- uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ # ΓöÇΓöÇ JDK 21 with GitHub Packages authentication ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # actions/setup-java writes a settings.xml entry that maps the
+ # server id "github" to the GITHUB_TOKEN. This server id matches
+ # the <distributionManagement> → <repository> id in the root pom.xml.
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
+ # Configures ~/.m2/settings.xml with a <server> block for GitHub Packages:
+ # <server><id>github</id>
+ # <username>${env.GITHUB_ACTOR}</username>
+ # <password>${env.GITHUB_TOKEN}</password></server>
+ server-id: github
+ server-username: GITHUB_ACTOR
+ server-password: GITHUB_TOKEN
+
+ # ΓöÇΓöÇ Extract version from the tag ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # The tag is "v1.0.0"; strip the leading "v" for display purposes.
+ - name: Extract version from tag
+ id: version
+ run: |
+ TAG="${{ github.ref_name }}"
+ VERSION="${TAG#v}"
+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
+ echo "Release version: ${VERSION}"
+
+ # ΓöÇΓöÇ Full build with all quality gates ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # Runs: compile → test → SpotBugs → JaCoCo → Checkstyle
+ # The release profile (activated by -Prelease) additionally attaches
+ # -sources.jar and -javadoc.jar to each module artifact.
+ #
+ # Performance tests are included in the release build to guard against
+ # any regression introduced during the release commit phase.
+ - name: Full build and verify
+ run: mvn -B clean verify -Prelease
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_ACTOR: ${{ github.actor }}
+
+ # ΓöÇΓöÇ Deploy to GitHub Packages ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # Publishes all non-example modules to:
+ # https://github.com/dhruv0306/private-blockchain/packages
+ #
+ # Example modules (examples/*) are excluded from deployment because:
+ # 1. They are not reusable library artifacts ΓÇö they are runnable demos.
+ # 2. The root pom.xml marks them with <packaging>jar</packaging> but
+ # the Checkstyle and JaCoCo exclusions mark them as non-published.
+ #
+ # -DskipTests is intentional here ΓÇö tests ran in the previous step.
+ # Re-running them would be redundant and slow.
+ - name: Deploy to GitHub Packages
+ run: >-
+ mvn -B deploy
+ -Prelease
+ -DskipTests
+ -pl blockchain-core,blockchain-crypto,blockchain-consensus,blockchain-storage,blockchain-network,blockchain-wallet,blockchain-access,blockchain-spring
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_ACTOR: ${{ github.actor }}
+
+ # ΓöÇΓöÇ Create GitHub Release ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
+ # Creates a formal GitHub Release from the pushed tag.
+ # The release body is auto-generated from commit messages between the
+ # previous tag and this one (GitHub's automatic release notes).
+ #
+ # This step does NOT upload the JARs as release assets because they
+ # are already published to GitHub Packages (the canonical package repo).
+ # Consumers use <dependency> coordinates, not direct JAR downloads.
+ - name: Create GitHub Release
+ uses: softprops/action-gh-release@v2
+ with:
+ tag_name: ${{ github.ref_name }}
+ name: private-blockchain ${{ steps.version.outputs.version }}
+ body: |
+ ## private-blockchain ${{ steps.version.outputs.version }}
+
+ Published to GitHub Packages. Add to your project:
+
+ ```xml
+ <dependency>
+ <groupId>com.privatechain</groupId>
+ <artifactId>blockchain-core</artifactId>
+ <version>${{ steps.version.outputs.version }}</version>
+ </dependency>
+ ```
+
+ See [CHANGELOG.md](https://github.com/dhruv0306/private-blockchain/blob/main/CHANGELOG.md)
+ for full release notes.
- - name: Publish to GitHub Packages
- run: mvn -B deploy
+ **Javadoc:** https://dhruv0306.github.io/private-blockchain/apidocs/
+ generate_release_notes: true
+ draft: false
+ prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e69de29..fd424e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -0,0 +1,257 @@
+# Changelog
+
+All notable changes to **private-blockchain** are documented in this file.
+
+The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
+Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+---
+
+## [1.0.0] ΓÇö 2026-06-06
+
+First stable release. All ten milestones (M0ΓÇôM10) complete.
+
+### Summary
+
+A modular, embeddable Java 17+ library for building permission blockchain networks.
+Plug in your own consensus logic, transaction types, and storage backend in Γëñ 10 lines.
+Zero mandatory dependencies in `blockchain-core`; Bouncy Castle, Netty, and LevelDB are
+isolated to their respective modules.
+
+---
+
+### Added ΓÇö Milestone 0: Project scaffold
+
+- Multi-module Maven build (`pom.xml`) with 9 library modules and 3 example modules.
+- `maven-compiler-plugin` targeting Java 17 with `--release` flag and `-Werror`.
+- Checkstyle with Google Java Style (max line 120).
+- SpotBugs with `findsecbugs-plugin`; fails on MEDIUM and higher findings.
+- JaCoCo enforcing ≥ 80% line coverage on `blockchain-core` and `blockchain-crypto`.
+- GitHub Actions: `build.yml` (JDK 17 + 21 matrix), `release.yml`, `qodana_code_quality.yml`.
+- `.editorconfig`, `.gitignore`, `CONTRIBUTING.md`, `LICENSE` (Apache 2.0).
+
+---
+
+### Added ΓÇö Milestone 1: Core data model
+
+- **`Block`** ΓÇö immutable class with `index`, `previousHash`, `hash`, `header`,
+ `transactions` (unmodifiable List), `minerAddress`. Hash computed at construction via
+ SHA-256 in `Block.computeHash()`.
+- **`BlockHeader`** ΓÇö record holding `version`, `bits`, `nonce`, `merkleRoot`, `timestamp`.
+- **`Transaction`** ΓÇö abstract base class with `id`, `senderAddress`, `receiverAddress`,
+ `amount`, `timestamp`, `signature`, `metadata`. Annotated with Jackson
+ `@JsonTypeInfo(use = Id.CLASS)` for zero-registration polymorphic round-trips (AC-09).
+- **`Blockchain`** ΓÇö chain manager with `addBlock()` (hash linkage + consensus validation),
+ `isChainValid()` (full tamper detection without network), `getBlock()`, `getLatestBlock()`,
+ `size()`. Thread-safe via `ReadWriteLock`.
+- **`BlockchainConfig`** ΓÇö fluent builder; `build()` with no args produces a working
+ in-memory PoW node (FR-CFG-02).
+- **`BlockchainNode`** ΓÇö top-level entry point; `start()`, `stop()`, `status()`,
+ `submitTransaction()`, `getChain()`, `getMempool()`, `getEventBus()`.
+- **`GenesisBlockFactory`** ΓÇö creates a deterministic genesis block with
+ `previousHash = "0000...0000"` (64 zeros) (FR-CORE-07).
+- SPI interfaces: `ConsensusEngine`, `TransactionValidator`, `BlockchainStorage`,
+ `TransactionPrioritizer`, `ValidationResult`.
+- Event system: sealed `BlockchainEvent` with 5 permitted inner types
+ (`BlockAddedEvent`, `TransactionSubmittedEvent`, `PeerConnectedEvent`,
+ `PeerDisconnectedEvent`, `ForkDetectedEvent`).
+- `BlockchainEventBus` ΓÇö `CopyOnWriteArrayList` backed; daemon executor; shutdown guard.
+- Exception hierarchy: `BlockchainException` (abstract, unchecked) extended by
+ `BlockValidationException`, `ConsensusException`, `TransactionValidationException`.
+- `BlockSerializer` ΓÇö shared `ObjectMapper` with `JavaTimeModule`, `FAIL_ON_UNKNOWN_PROPERTIES`
+ disabled, getter visibility NONE, field visibility ANY. Used by all storage backends.
+- `package-info.java` added to all 8 packages in `blockchain-core` (M10 ΓÇö T-076).
+
+---
+
+### Added ΓÇö Milestone 2: Cryptography
+
+- **`HashUtil`** ΓÇö `sha256(String/byte[])`, `sha3_256(String)`, `doubleHash(String)`;
+ returns lowercase hex strings. Backed by Bouncy Castle 1.84.
+- **`ECKeyPair`** ΓÇö immutable record holding `PublicKey` + `PrivateKey` over secp256k1.
+ `toString()` masks the private key with `[REDACTED]` (NFR-SEC-01).
+- **`KeyPairGenerator`** ΓÇö `generateECKeyPair()`, `fromPrivateKeyHex()`,
+ `fromRawPrivateScalar()`.
+- **`ECDSASignatureUtil`** ΓÇö `sign(byte[], PrivateKey)`, `sign(byte[], ECKeyPair)`,
+ `verify(byte[], byte[], PublicKey)`, `verify(byte[], byte[], ECKeyPair)`.
+- **`AddressUtil`** — `deriveAddress(PublicKey)` using SHA-256 → RIPEMD-160 → Base58Check.
+- **`MerkleTree`** ΓÇö `buildRoot(List<Transaction>)`, `getProof(String txId)`,
+ `verifyProof(MerkleProof, String root, String txId)`.
+
+---
+
+### Added ΓÇö Milestone 3: Storage
+
+- **`InMemoryStorage`** ΓÇö `LinkedHashMap`-backed; `ReadWriteLock`; for testing/demos.
+- **`LevelDBStorage`** ΓÇö crash-safe persistent storage; keys = block index as big-endian
+ bytes; values = JSON via `BlockSerializer`. Verifies block hash on load (NFR-SEC-03).
+- **`RocksDBStorage`** ΓÇö high-throughput persistent storage via `rocksdbjni`.
+- **`FileSystemStorage`** ΓÇö one JSON file per block; zero native library dependency;
+ path-traversal sanitized and suppressed via `@SuppressFBWarnings(PATH_TRAVERSAL_IN)`.
+- **`StorageContractTest`** ΓÇö abstract TCK run against all four implementations.
+- **`ChainExporter`** ΓÇö `toJson(Blockchain)`, `fromJson(String, BlockchainStorage)`,
+ `toCsv(Blockchain)` (FR-SER-02, FR-SER-03). Added in M10.
+
+---
+
+### Added ΓÇö Milestone 4: Consensus engines
+
+- **`ProofOfWorkEngine`** ΓÇö SHA-256 mining loop; configurable `difficulty` (leading
+ zero-bit count, default 4). Validates that `block.getHash()` starts with the required
+ prefix. `engineName()` = `"ProofOfWork"`.
+- **`DifficultyAdjuster`** ΓÇö sliding-window auto-recalibration over configurable window
+ size; increases or decreases difficulty by 1 bit to hit the target block time.
+- **`ProofOfAuthorityEngine`** ΓÇö validates that `block.getMinerAddress()` is in the
+ configured `Set<String>` of authorized addresses (FR-CONS-03).
+- **`RoundRobinEngine`** ΓÇö deterministic slot-based; expected miner =
+ `peers.get(block.getIndex() % peers.size())`. For dev/test.
+- **`PBFTEngine`** — two-phase (prepare → commit) Byzantine fault-tolerant consensus;
+ configurable `quorumSize`; `ViewChangeManager` for leader rotation.
+- **`ConsensusSupport`** ΓÇö shared `buildBlock(...)`, `isGenesis(Block)`,
+ `hasConsistentIntegrity(Block)` utilities for engine implementors.
+- **`ConsensusEngineContractTest`** ΓÇö abstract TCK run against all four engines.
+
+---
+
+### Added ΓÇö Milestone 5: Wallet and mempool
+
+- **`Wallet`** ΓÇö holds `ECKeyPair`; `getAddress()`, `sign(Transaction)`,
+ `getBalance(Blockchain)` (scans confirmed transactions).
+- **`WalletManager`** ΓÇö `createWallet()`, `importWallet(String pkHex)`,
+ `exportKeystore(Wallet, String password)` (AES-256-GCM), `importKeystore(String, String)`.
+- **`TransactionMempool`** ΓÇö `PriorityQueue` backed; `submit(Transaction)` validates
+ then inserts; `getTopN(int n)` returns by priority; `evictExpired(Duration ttl)`;
+ confirmed transactions auto-removed on `BlockAddedEvent`.
+- **`FeeBasedPrioritizer`** ΓÇö orders by `metadata.get("fee")`, descending.
+- **`TimestampBasedPrioritizer`** ΓÇö orders by `timestamp`, ascending (oldest first).
+
+---
+
+### Added ΓÇö Milestone 6: Access control
+
+- **`PermissionManager`** ΓÇö RBAC with `NodeRole` (`NODE_ADMIN`, `NODE_MINER`,
+ `NODE_OBSERVER`); `assignRole()`, `hasRole()`, `getRole()`.
+- **`AllowlistManager`** ΓÇö `Set<String>` of permitted node IDs; checked before any
+ inbound message is processed (FR-AC-01).
+- **`AllowlistStore`** ΓÇö persists the allowlist to storage across restarts.
+- **`InvitationService`** ΓÇö admin-signed, time-limited `InvitationToken` (ECDSA over
+ `nodeId + expiryEpoch`); `verifyInvitation(token)` checks signature + expiry (FR-AC-04/05).
+
+---
+
+### Added ΓÇö Milestone 7: Networking (P2P)
+
+- **`NodeServer`** / **`NodeClient`** ΓÇö Netty 4.2.13 TCP server and client.
+- **`MessageCodec`** ΓÇö NDJSON framing over TCP; each message is one JSON line followed
+ by `\n` (ADR-001 deferred gRPC to post-1.0; NDJSON chosen for zero-dependency framing).
+- **`PeerManager`** ΓÇö connects, heartbeats (ping/pong every 30 s), and prunes
+ unresponsive peers; publishes `PeerConnectedEvent` / `PeerDisconnectedEvent`.
+- **`PeerStore`** ΓÇö persists known peer addresses across restarts.
+- **`GossipProtocol`** ΓÇö forwards transactions to `ceil(log2(n))` random peers.
+- **`BlockBroadcaster`** ΓÇö pushes newly mined blocks to all connected peers on
+ `BlockAddedEvent`.
+- **`SyncManager`** ΓÇö on startup, queries all peers for chain height, requests
+ missing blocks from the peer with the highest chain (FR-NET-04).
+- **`ForkResolver`** ΓÇö selects the chain with the greatest cumulative difficulty (FR-NET-05).
+- Network SPI interfaces (`NodeServerLifecycle`, `PeerManagerLifecycle`, `ChainSyncer`)
+ defined in `blockchain-core` to preserve zero-dependency contract of the core module.
+
+---
+
+### Added ΓÇö Milestone 8: Event bus and observability
+
+- `BlockchainEventBus` wired into `Blockchain.addBlock()`, `TransactionMempool.submit()`,
+ `PeerManager.connect()`, and `PeerManager.disconnect()`.
+- `BlockchainNode.status()` ΓÇö returns live `NodeStatus` record with `chainHeight`,
+ `mempoolSize`, `peerCount`, `lastBlockTime`, `consensusEngine`.
+- SLF4J log statements at `INFO`/`DEBUG`/`WARN` throughout all modules.
+
+---
+
+### Added ΓÇö Milestone 9: Spring Boot autoconfiguration
+
+- **`BlockchainAutoConfiguration`** ΓÇö `@ConditionalOnProperty("blockchain.enabled")`;
+ creates `BlockchainConfig`, `BlockchainNode`, and `TransactionMempool` beans.
+ All beans are overridable via `@ConditionalOnMissingBean`.
+- **`BlockchainProperties`** ΓÇö `@ConfigurationProperties(prefix = "blockchain")`
+ with nested `Mempool` section; full IDE autocomplete metadata generated.
+- **`BlockchainHealthIndicator`** ΓÇö exposes `chain_height` and `mempool_size` via
+ Spring Boot Actuator health endpoint.
+- `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`
+ registered for Spring Boot 4.x autoconfiguration discovery.
+
+---
+
+### Added ΓÇö Milestone 10: Examples, documentation, and release
+
+- **`MoneyTransferTransaction`** (`examples/simple-chain`) ΓÇö custom `Transaction`
+ subtype with `currency` field bound into the ECDSA signature. Canonical AC-09
+ (JSON round-trip) proof.
+- **`SimpleChainDemo`** (`examples/simple-chain`) ΓÇö 10-step runnable demo: wallet
+ creation, tx signing, PoW mining, chain validation, `ChainExporter` round-trip, balance.
+- **`VotingConsensusEngine`** (`examples/custom-consensus`) ΓÇö custom `ConsensusEngine`
+ requiring a strict majority of validator votes. Demonstrates FR-CONS-06 and AC-08.
+- **`VotingConsensusDemo`** (`examples/custom-consensus`) ΓÇö three scenarios: success,
+ quorum failure, and engine name in `NodeStatus`.
+- **`SpringChainApp`** + **`BlockchainRestController`** (`examples/spring-boot-demo`) ΓÇö
+ Spring Boot REST API: `GET /api/status`, `GET /api/chain`, `GET /api/chain/{index}`,
+ `POST /api/transactions`, `POST /api/mine`. Demonstrates AC-10 (zero-config Spring bean).
+- `PerformanceTest` ΓÇö `isChainValid()` on 10,000 blocks verified under 2 s (T-078).
+- `PrivateKeyLeakTest` ΓÇö regression guard: `toString()`, JUL logs, and Jackson serialization
+ verified to not expose the private key hex (NFR-SEC-01) (T-079).
+- `package-info.java` added to all 8 packages in `blockchain-core` (T-076).
+- README completely rewritten with 5-minute quick-start guide, module coordinates,
+ and extension examples (T-077).
+- `CHANGELOG.md` created (this file) (T-080).
+- `maven-release-plugin 3.1.1` configured; `distributionManagement` updated to
+ GitHub Packages (T-080).
+- Aggregate Javadoc published to GitHub Pages via `javadoc.yml` workflow (T-081).
+
+---
+
+### Fixed
+
+- `Blockchain.java` ΓÇö wrong `SuppressFBWarnings` import
+ (`org.apache.logging.log4j.internal.annotation` → `edu.umd.cs.findbugs.annotations`).
+ The internal Log4j annotation class is not on the classpath and caused SpotBugs
+ and Qodana failures.
+- `scm` section in root `pom.xml` ΓÇö updated placeholder `your-org` to actual GitHub
+ username `dhruv0306`.
+- `distributionManagement` in root `pom.xml` ΓÇö updated from OSSRH staging URLs
+ (Maven Central) to GitHub Packages for correct deployment target.
+
+---
+
+### Security
+
+All CVE findings from the Mend.io dependency scan addressed (see `owasp-suppressions.xml`
+for suppressed findings with documented justification):
+
+| Dependency | Previous | Patched | CVE(s) fixed |
+|-------------------|----------|---------|----------------------------------------------------------------|
+| `jackson-core` | 2.17.1 | 2.21.1 | WS-2026-0003 (CVSS 7.5) |
+| `bcprov-jdk18on` | 1.78.1 | 1.84 | CVE-2026-0636 (CVSS 5.3) |
+| `netty-*` | 4.1.111 | 4.2.13 | CVE-2025-58057, -58056, CVE-2026-33870, -33871, CVE-2025-24970 |
+| `tomcat-embed-*` | 10.1.x | 10.1.55 | CVE-2026-29145 (CVSS 9.1), -29129, -29146, -34483 |
+| `protobuf-java` | 3.25.3 | 4.28.2 | CVE-2024-7254 (CVSS 7.5) |
+| `spring-boot` | 3.3.0 | 4.0.6 | CVE-2026-22733 (CVSS 8.2), CVE-2025-22235 |
+| `logback-classic` | 1.5.6 | 1.5.25 | CVE-2025-11226, CVE-2024-12798, CVE-2026-1225, CVE-2024-12801 |
+
+---
+
+### Known limitations (post-1.0 backlog)
+
+| Backlog ID | Description |
+|------------|----------------------------------------------------------------------------------------|
+| T-B02 | gRPC transport (ADR-001). Current transport: NDJSON over plain TCP. |
+| T-B03 | `blockchain-metrics` ΓÇö Micrometer module for Prometheus/Grafana dashboards. |
+| T-B04 | Chain snapshot / checkpoint for fast node bootstrap on long chains. |
+| T-B05 | WebSocket block-explorer API. |
+| T-B06 | Docker Compose 3-node demo network. |
+| ΓÇö | `FR-NET-06` (Protocol Buffers P2P framing) deferred; NDJSON framing used. |
+| ΓÇö | `FR-WALLET-03` (Web3 Secret Storage v3 keystore) deferred; AES-256-GCM used. |
+| ΓÇö | `PBFTEngine` quorum operates in-process only; distributed PBFT needs networking layer. |
+
+---
+
+[1.0.0]: https://github.com/dhruv0306/private-blockchain/releases/tag/v1.0.0
diff --git a/README.md b/README.md
index fabc4a8..ff4e7e5 100644
--- a/README.md
+++ b/README.md
@@ -1,32 +1,295 @@
# private-blockchain
> A Java 17+ Maven library for building extensible, permission (private) blockchain networks.
-> Plug in your own consensus logic, transaction types, and storage backend.
+> Plug in your own consensus logic, transaction types, and storage backend ΓÇö ship in minutes.
-## Quick start
+[](https://github.com/dhruv0306/private-blockchain/actions/workflows/build.yml)
+[](https://dhruv0306.github.io/private-blockchain/apidocs/)
+[](LICENSE)
+[](https://adoptium.net/)
+
+---
+
+## Quick start ΓÇö 5 minutes to your first private chain
+
+### 1. Add the dependencies
```xml
+<!-- Minimum viable set: core + one consensus engine + one storage backend -->
<dependency>
<groupId>com.privatechain</groupId>
<artifactId>blockchain-core</artifactId>
<version>1.0.0</version>
</dependency>
-<!-- Add only the modules you need -->
+<dependency>
+<groupId>com.privatechain</groupId>
+<artifactId>blockchain-consensus</artifactId>
+<version>1.0.0</version>
+</dependency>
+<dependency>
+<groupId>com.privatechain</groupId>
+<artifactId>blockchain-storage</artifactId>
+<version>1.0.0</version>
+</dependency>
+```
+
+### 2. Start a node in Γëñ 10 lines
+
+```java
+// 1. Build and start
+BlockchainNode node = BlockchainConfig.builder()
+ .consensusEngine(new ProofOfWorkEngine(4)) // 4 leading zero bits
+ .storage(new LevelDBStorage("/data/chain")) // swap for InMemoryStorage in tests
+ .chainId("my-chain")
+ .build();
+node.
+
+start();
+
+// 2. Inspect
+BlockchainNode.NodeStatus status = node.status();
+System.out.
+
+println("Height: "+status.chainHeight()); // 1 (genesis)
+ System.out.
+
+println("Engine: "+status.consensusEngine()); // "ProofOfWork"
+ System.out.
+
+println("Mempool: "+status.mempoolSize()); // 0
+
+// 3. Stop
+ node.
+
+stop();
+```
+
+### 3. Define a custom transaction type
+
+Extend `Transaction` and annotate with `@JsonCreator` / `@JsonProperty` for automatic
+JSON round-trips ΓÇö no registry, no registration step required.
+
+```java
+public final class PaymentTx extends Transaction {
+
+ private final String currency; // included in ECDSA signature
+
+ @JsonCreator
+ public PaymentTx(
+ @JsonProperty("id") UUID id,
+ @JsonProperty("senderAddress") String senderAddress,
+ @JsonProperty("receiverAddress") String receiverAddress,
+ @JsonProperty("amount") BigDecimal amount,
+ @JsonProperty("timestamp") Instant timestamp,
+ @JsonProperty("metadata") Map<String, Object> metadata,
+ @JsonProperty("currency") String currency) {
+
+ super(id, senderAddress, receiverAddress, amount, timestamp, metadata);
+ this.currency = Objects.requireNonNull(currency);
+ }
+
+ // Bind currency into the signature ΓÇö prevents post-signing substitution
+ @Override
+ public byte[] toSignableBytes() {
+ byte[] base = super.toSignableBytes();
+ byte[] ext = ("|" + currency).getBytes(StandardCharsets.UTF_8);
+ byte[] out = new byte[base.length + ext.length];
+ System.arraycopy(base, 0, out, 0, base.length);
+ System.arraycopy(ext, 0, out, base.length, ext.length);
+ return out;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+}
+```
+
+### 4. Sign and submit transactions
+
+```java
+// Create wallets
+WalletManager wm = new WalletManager();
+Wallet alice = wm.createWallet();
+Wallet bob = wm.createWallet();
+
+// Build, sign, and submit a transaction
+PaymentTx tx = new PaymentTx(
+ UUID.randomUUID(), alice.getAddress(), bob.getAddress(),
+ new BigDecimal("50.00"), Instant.now(), null, "USD");
+alice.
+
+sign(tx);
+node.
+
+submitTransaction(tx); // validates → mempool → TransactionSubmittedEvent
+```
+
+### 5. Mine a block
+
+```java
+List<Transaction> pending = node.getMempool().getTopN(100);
+Block mined = node.getChain()
+ .getConsensusEngine()
+ .mineBlock(pending, node.getChain().getLatestBlock());
+node.
+
+getChain().
+
+addBlock(mined); // validates → persists → BlockAddedEvent
+System.out.
+
+println("Block #"+mined.getIndex() +": "+mined.
+
+getHash());
+ System.out.
+
+println("Chain valid: "+node.getChain().
+
+isChainValid());
+```
+
+### 6. Swap the consensus engine
+
+```java
+// Proof of Authority: only these addresses may produce blocks
+Set<String> authorizedMiners = Set.of(aliceAddress, bobAddress);
+
+BlockchainNode node = BlockchainConfig.builder()
+ .consensusEngine(new ProofOfAuthorityEngine(authorizedMiners))
+ .storage(new LevelDBStorage("/data/chain"))
+ .build();
+node.
+
+start();
+```
+
+Or inject a fully custom engine:
+
+```java
+public class VotingEngine implements ConsensusEngine {
+ @Override
+ public boolean validateBlock(Block b, Blockchain c) { /* quorum check */ }
+
+ @Override
+ public Block mineBlock(List<Transaction> txs, Block prev) { /* assemble */ }
+
+ @Override
+ public String engineName() {
+ return "VotingEngine";
+ }
+}
+
+BlockchainNode node = BlockchainConfig.builder()
+ .consensusEngine(new VotingEngine())
+ .build();
+```
+
+### 7. Spring Boot autoconfiguration (zero boilerplate)
+
+Add `blockchain-spring` and two lines of `application.yml`:
+
+```xml
+
<dependency>
<groupId>com.privatechain</groupId>
- <artifactId>blockchain-consensus</artifactId>
+ <artifactId>blockchain-spring</artifactId>
<version>1.0.0</version>
</dependency>
```
+```yaml
+blockchain:
+ enabled: true
+ difficulty: 4
+ chain-id: my-spring-chain
+```
+
+`BlockchainNode` is created, started, and injected as a Spring bean automatically.
+Override any behavior by declaring your own `ConsensusEngine` or `BlockchainStorage` bean.
+
+### 8. Export and import the chain
+
```java
-BlockchainNode node = BlockchainConfig.builder()
- .consensusEngine(new ProofOfAuthorityEngine(authorizedAddresses))
- .storage(new LevelDBStorage("/data/chain"))
- .transactionValidator(new MyDomainValidator())
- .port(8545)
- .build()
- .start();
+// Export full chain as JSON (FR-SER-02)
+String json = ChainExporter.toJson(node.getChain());
+
+// Restore into a fresh backend ΓÇö e.g. for fast node bootstrap
+InMemoryStorage fresh = new InMemoryStorage();
+ChainExporter.
+
+fromJson(json, fresh);
+
+// Export as CSV for audit / analytics (FR-SER-03)
+String csv = ChainExporter.toCsv(node.getChain());
+// columns: blockIndex, blockHash, txId, sender, receiver, amount, timestamp, txType
+```
+
+---
+
+## Module coordinates
+
+All modules share **version `1.0.0`** and **group ID `com.privatechain`**.
+
+| Artifact ID | Depends on | Key external dep |
+|------------------------|-------------------------------------------------------------|--------------------------|
+| `blockchain-core` | JDK only | ΓÇö |
+| `blockchain-crypto` | `blockchain-core` | Bouncy Castle 1.84 |
+| `blockchain-consensus` | `blockchain-core`, `blockchain-crypto` | ΓÇö |
+| `blockchain-storage` | `blockchain-core` | LevelDB JNI, RocksDB JNI |
+| `blockchain-wallet` | `blockchain-core`, `blockchain-crypto` | ΓÇö |
+| `blockchain-access` | `blockchain-core`, `blockchain-crypto` | ΓÇö |
+| `blockchain-network` | `blockchain-core`, `blockchain-crypto`, `blockchain-access` | Netty 4.2.13 |
+| `blockchain-spring` | all above | Spring Boot 4.0.6 |
+
+### Common dependency combinations
+
+**Core + consensus + in-memory storage (tests / prototyping)**
+
+```xml
+
+<dependency>
+ <groupId>com.privatechain</groupId>
+ <artifactId>blockchain-core</artifactId>
+ <version>1.0.0</version>
+</dependency>
+<dependency>
+<groupId>com.privatechain</groupId>
+<artifactId>blockchain-consensus</artifactId>
+<version>1.0.0</version>
+</dependency>
+<dependency>
+<groupId>com.privatechain</groupId>
+<artifactId>blockchain-storage</artifactId>
+<version>1.0.0</version>
+</dependency>
+```
+
+**Full stack with wallets and P2P networking**
+
+```xml
+<!-- Wallets, crypto, consensus, LevelDB/RocksDB, Netty P2P -->
+<dependency>
+ <groupId>com.privatechain</groupId>
+ <artifactId>blockchain-network</artifactId>
+ <version>1.0.0</version>
+</dependency>
+<dependency>
+<groupId>com.privatechain</groupId>
+<artifactId>blockchain-wallet</artifactId>
+<version>1.0.0</version>
+</dependency>
+```
+
+**Spring Boot application**
+
+```xml
+<!-- Brings in all modules transitively -->
+<dependency>
+ <groupId>com.privatechain</groupId>
+ <artifactId>blockchain-spring</artifactId>
+ <version>1.0.0</version>
+</dependency>
```
---
@@ -39,7 +302,8 @@ private-blockchain/
Γö£ΓöÇΓöÇ .github/
Γöé Γö£ΓöÇΓöÇ workflows/
Γöé Γöé Γö£ΓöÇΓöÇ build.yml # Compiles, tests, and lints on every push and pull request
-Γöé Γöé Γö£ΓöÇΓöÇ release.yml # Publishes artifacts to Maven Central on a version tag
+Γöé Γöé Γö£ΓöÇΓöÇ release.yml # Publishes artifacts to GitHub Packages on a version tag
+Γöé Γöé Γö£ΓöÇΓöÇ javadoc.yml # Publishes aggregate Javadoc to GitHub Pages on main push
Γöé Γöé ΓööΓöÇΓöÇ qodana_code_quality.yml # Runs JetBrains Qodana static analysis
Γöé ΓööΓöÇΓöÇ ISSUE_TEMPLATE/
Γöé Γö£ΓöÇΓöÇ bug_report.yml # Structured form for reporting bugs
@@ -56,218 +320,121 @@ private-blockchain/
Γöé Γö£ΓöÇΓöÇ pom.xml
Γöé ΓööΓöÇΓöÇ src/
Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/core/
-Γöé Γöé Γöé
-Γöé Γöé Γö£ΓöÇΓöÇ model/ # Immutable domain objects
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ Block.java # Immutable block containing a list of transactions
-Γöé Γöé Γöé Γöé # and a cryptographic link to the previous block
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockHeader.java # Lightweight block header record holding version,
-Γöé Γöé Γöé Γöé # nonce, Merkle root, and timestamp
-Γöé Γöé Γöé ΓööΓöÇΓöÇ Transaction.java # Abstract base class for all transaction types;
-Γöé Γöé Γöé # extend this to define domain-specific transactions
-Γöé Γöé Γöé
-Γöé Γöé Γö£ΓöÇΓöÇ spi/ # Service Provider Interfaces ΓÇö implement to extend the library
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ ConsensusEngine.java # Pluggable consensus algorithm interface;
-Γöé Γöé Γöé Γöé # defines block validation and production
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ TransactionValidator.java # Pluggable transaction validation interface;
-Γöé Γöé Γöé Γöé # returns a structured ValidationResult
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockchainStorage.java # Pluggable persistence interface;
-Γöé Γöé Γöé Γöé # defines save, load, and query operations
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ TransactionPrioritizer.java # Comparator-based interface for ordering
-Γöé Γöé Γöé Γöé # transactions in the mempool
-Γöé Γöé Γöé ΓööΓöÇΓöÇ ValidationResult.java # Immutable result of a validation check,
-Γöé Γöé Γöé # carrying a status and error descriptions
-Γöé Γöé Γöé
-Γöé Γöé Γö£ΓöÇΓöÇ event/ # Asynchronous publish-subscribe event system
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockchainEvent.java # Sealed base class for all blockchain events;
-Γöé Γöé Γöé Γöé # contains five permitted inner event types:
-Γöé Γöé Γöé Γöé # BlockAddedEvent
-Γöé Γöé Γöé Γöé # TransactionSubmittedEvent
-Γöé Γöé Γöé Γöé # PeerConnectedEvent
-Γöé Γöé Γöé Γöé # PeerDisconnectedEvent
-Γöé Γöé Γöé Γöé # ForkDetectedEvent
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockchainEventBus.java # Thread-safe event bus that delivers events
-Γöé Γöé Γöé Γöé # asynchronously to all registered listeners
-Γöé Γöé Γöé ΓööΓöÇΓöÇ BlockchainEventListener.java # Functional interface for receiving events
-Γöé Γöé Γöé
-Γöé Γöé Γö£ΓöÇΓöÇ exception/ # Unchecked exception hierarchy
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockchainException.java # Abstract root for all library exceptions
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockValidationException.java # Thrown when a block fails validation
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ ConsensusException.java # Thrown on an unrecoverable consensus error
-Γöé Γöé Γöé ΓööΓöÇΓöÇ TransactionValidationException.java # Thrown when a transaction is rejected
-Γöé Γöé Γöé
-Γöé Γöé ΓööΓöÇΓöÇ builder/ # Assembly layer ΓÇö the single place where all modules are wired
-Γöé Γöé Γö£ΓöÇΓöÇ BlockchainConfig.java # Fluent builder that assembles a fully configured node;
-Γöé Γöé Γöé # ships with default in-memory and no-op implementations
-Γöé Γöé Γö£ΓöÇΓöÇ BlockchainNode.java # Top-level entry point for the library; manages the
-Γöé Γöé Γöé # node lifecycle and exposes the primary public API
-Γöé Γöé Γö£ΓöÇΓöÇ Blockchain.java # Chain manager responsible for block appending,
-Γöé Γöé Γöé # integrity verification, and storage delegation
-Γöé Γöé ΓööΓöÇΓöÇ GenesisBlockFactory.java # Creates the deterministic genesis block for a chain
-Γöé Γöé
+Γöé Γöé Γö£ΓöÇΓöÇ model/ # Block, BlockHeader, Transaction (abstract)
+Γöé Γöé Γö£ΓöÇΓöÇ spi/ # ConsensusEngine, TransactionValidator, BlockchainStorage
+Γöé Γöé Γö£ΓöÇΓöÇ event/ # BlockchainEventBus, BlockchainEvent (sealed), listener
+Γöé Γöé Γö£ΓöÇΓöÇ exception/ # BlockchainException hierarchy (all unchecked)
+Γöé Γöé Γö£ΓöÇΓöÇ mempool/ # TransactionMempool, FeeBasedPrioritizer, TimestampPrioritizer
+Γöé Γöé Γö£ΓöÇΓöÇ network/ # NodeServerLifecycle, PeerManagerLifecycle, ChainSyncer
+Γöé Γöé ΓööΓöÇΓöÇ builder/ # BlockchainConfig, BlockchainNode, Blockchain, GenesisBlockFactory
Γöé ΓööΓöÇΓöÇ test/java/com/privatechain/core/
-Γöé Γö£ΓöÇΓöÇ BlockTest.java # Tests for block construction, hashing, and linkage
-Γöé Γö£ΓöÇΓöÇ BlockHeaderTest.java # Tests for header validation and builder paths
-Γöé Γö£ΓöÇΓöÇ BlockchainTest.java # Tests for chain management and event publication
-Γöé Γö£ΓöÇΓöÇ BlockchainNodeExtTest.java # Tests for node lifecycle, validator chain, and config
-Γöé Γö£ΓöÇΓöÇ BlockchainEventTest.java # Tests for all event types and their accessors
-Γöé Γö£ΓöÇΓöÇ BlockchainEventBusTest.java # Tests for async delivery, isolation, and shutdown
-Γöé Γö£ΓöÇΓöÇ GenesisBlockFactoryTest.java # Tests for genesis block structure and determinism
-Γöé Γö£ΓöÇΓöÇ TransactionTest.java # Tests for signing, immutability, and equality
-Γöé Γö£ΓöÇΓöÇ ValidationResultTest.java # Tests for all factory methods and status values
-Γöé ΓööΓöÇΓöÇ ExceptionTest.java # Tests for exception constructors and accessors
-Γöé
-Γö£ΓöÇΓöÇ blockchain-crypto/ # Cryptographic primitives module
-Γöé Γö£ΓöÇΓöÇ pom.xml
-Γöé ΓööΓöÇΓöÇ src/
-Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/crypto/
-Γöé Γöé Γö£ΓöÇΓöÇ HashUtil.java # SHA-256, SHA-3, and double-hash utilities returning hex strings
-Γöé Γöé Γö£ΓöÇΓöÇ ECDSASignatureUtil.java # ECDSA signing and verification over secp256k1
-Γöé Γöé Γö£ΓöÇΓöÇ KeyPairGenerator.java # Generates elliptic curve key pairs
-Γöé Γöé Γö£ΓöÇΓöÇ ECKeyPair.java # Immutable key pair record; masks the private key in toString
-Γöé Γöé Γö£ΓöÇΓöÇ AddressUtil.java # Derives a blockchain address from a public key
-Γöé Γöé ΓööΓöÇΓöÇ MerkleTree.java # Builds Merkle roots and generates inclusion proofs
-Γöé ΓööΓöÇΓöÇ test/java/com/privatechain/crypto/
-Γöé Γö£ΓöÇΓöÇ HashUtilTest.java
-Γöé Γö£ΓöÇΓöÇ SignatureUtilTest.java
-Γöé Γö£ΓöÇΓöÇ MerkleTreeTest.java
-Γöé ΓööΓöÇΓöÇ KeyPairTest.java
-Γöé
-Γö£ΓöÇΓöÇ blockchain-consensus/ # Built-in consensus engine implementations
-Γöé Γö£ΓöÇΓöÇ pom.xml
-Γöé ΓööΓöÇΓöÇ src/
-Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/consensus/
-Γöé Γöé Γö£ΓöÇΓöÇ pow/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ ProofOfWorkEngine.java # Hash-based mining with configurable difficulty
-Γöé Γöé Γöé ΓööΓöÇΓöÇ DifficultyAdjuster.java # Recalibrates difficulty based on observed block time
-Γöé Γöé Γö£ΓöÇΓöÇ poa/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ ProofOfAuthorityEngine.java # Accepts blocks only from a configured signer set
-Γöé Γöé Γöé ΓööΓöÇΓöÇ AuthorizedSignerRegistry.java # Manages the set of authorised signer addresses
-Γöé Γöé Γö£ΓöÇΓöÇ pbft/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ PBFTEngine.java # Three-phase Byzantine fault-tolerant consensus
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ PBFTMessageHandler.java # Handles pre-prepare, prepare, and commit messages
-Γöé Γöé Γöé ΓööΓöÇΓöÇ ViewChangeManager.java # Manages leader rotation on failure
-Γöé Γöé ΓööΓöÇΓöÇ roundrobin/
-Γöé Γöé ΓööΓöÇΓöÇ RoundRobinEngine.java # Deterministic slot-based block production for testing
-Γöé ΓööΓöÇΓöÇ test/java/com/privatechain/consensus/
-Γöé Γö£ΓöÇΓöÇ ProofOfWorkEngineTest.java
-Γöé Γö£ΓöÇΓöÇ ProofOfAuthorityEngineTest.java
-Γöé ΓööΓöÇΓöÇ ConsensusEngineContractTest.java # Abstract contract test executed against all engines
-Γöé
-Γö£ΓöÇΓöÇ blockchain-storage/ # BlockchainStorage implementations
-Γöé Γö£ΓöÇΓöÇ pom.xml
-Γöé ΓööΓöÇΓöÇ src/
-Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/storage/
-Γöé Γöé Γö£ΓöÇΓöÇ memory/
-Γöé Γöé Γöé ΓööΓöÇΓöÇ InMemoryStorage.java # HashMap-backed storage for testing and demos
-Γöé Γöé Γö£ΓöÇΓöÇ leveldb/
-Γöé Γöé Γöé ΓööΓöÇΓöÇ LevelDBStorage.java # Crash-safe persistent storage backed by LevelDB
-Γöé Γöé Γö£ΓöÇΓöÇ rocksdb/
-Γöé Γöé Γöé ΓööΓöÇΓöÇ RocksDBStorage.java # High write-throughput persistent storage via RocksDB
-Γöé Γöé ΓööΓöÇΓöÇ fs/
-Γöé Γöé ΓööΓöÇΓöÇ FileSystemStorage.java # One JSON file per block; requires no native libraries
-Γöé ΓööΓöÇΓöÇ test/java/com/privatechain/storage/
-Γöé ΓööΓöÇΓöÇ StorageContractTest.java # Abstract contract test parameterized over all implementations
-Γöé
-Γö£ΓöÇΓöÇ blockchain-access/ # Private-chain access control module
-Γöé Γö£ΓöÇΓöÇ pom.xml
-Γöé ΓööΓöÇΓöÇ src/
-Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/access/
-Γöé Γöé Γö£ΓöÇΓöÇ rbac/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ Role.java # Enumeration of available node roles
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ Permission.java # Fine-grained permission definitions
-Γöé Γöé Γöé ΓööΓöÇΓöÇ PermissionManager.java # Assigns and enforces roles per node address
-Γöé Γöé Γö£ΓöÇΓöÇ allowlist/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ AllowlistManager.java # Enforces the set of permitted node identifiers
-Γöé Γöé Γöé ΓööΓöÇΓöÇ AllowlistStore.java # Persists the allowlist across restarts
-Γöé Γöé ΓööΓöÇΓöÇ invite/
-Γöé Γöé Γö£ΓöÇΓöÇ InvitationService.java # Generates signed, time-limited invitation tokens
-Γöé Γöé ΓööΓöÇΓöÇ InvitationToken.java # Immutable signed invitation token value object
-Γöé ΓööΓöÇΓöÇ test/java/com/privatechain/access/
-Γöé Γö£ΓöÇΓöÇ AllowlistManagerTest.java
-Γöé Γö£ΓöÇΓöÇ PermissionManagerTest.java
-Γöé ΓööΓöÇΓöÇ InvitationServiceTest.java
-Γöé
-Γö£ΓöÇΓöÇ blockchain-network/ # Peer-to-peer networking module
-Γöé Γö£ΓöÇΓöÇ pom.xml
-Γöé ΓööΓöÇΓöÇ src/
-Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/network/
-Γöé Γöé Γö£ΓöÇΓöÇ peer/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ Peer.java # Value object representing a remote peer
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ PeerManager.java # Manages connections, heartbeats, and peer pruning
-Γöé Γöé Γöé ΓööΓöÇΓöÇ PeerStore.java # Persists known peer addresses across restarts
-Γöé Γöé Γö£ΓöÇΓöÇ sync/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ SyncManager.java # Synchronises the local chain with the network
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ BlockFetcher.java # Requests missing blocks from a remote peer
-Γöé Γöé Γöé ΓööΓöÇΓöÇ ForkResolver.java # Selects the canonical chain when a fork is detected
-Γöé Γöé Γö£ΓöÇΓöÇ gossip/
-Γöé Γöé Γöé Γö£ΓöÇΓöÇ GossipProtocol.java # Propagates transactions to a random subset of peers
-Γöé Γöé Γöé ΓööΓöÇΓöÇ BlockBroadcaster.java # Pushes newly produced blocks to all connected peers
-Γöé Γöé ΓööΓöÇΓöÇ rpc/
-Γöé Γöé Γö£ΓöÇΓöÇ NodeServer.java # TCP server for inbound peer connections
-Γöé Γöé Γö£ΓöÇΓöÇ NodeClient.java # Manages outbound connections to remote peers
-Γöé Γöé Γö£ΓöÇΓöÇ MessageCodec.java # Encodes and decodes wire-protocol messages
-Γöé Γöé ΓööΓöÇΓöÇ proto/
-Γöé Γöé ΓööΓöÇΓöÇ blockchain.proto # Protobuf message definitions for peer communication
-Γöé ΓööΓöÇΓöÇ test/java/com/privatechain/network/
-Γöé ΓööΓöÇΓöÇ TwoNodeIntegrationTest.java # Verifies block propagation between two in-process nodes
-Γöé
-Γö£ΓöÇΓöÇ blockchain-wallet/ # Key management and transaction signing module
-Γöé Γö£ΓöÇΓöÇ pom.xml
-Γöé ΓööΓöÇΓöÇ src/
-Γöé Γö£ΓöÇΓöÇ main/java/com/privatechain/wallet/
-Γöé Γöé Γö£ΓöÇΓöÇ Wallet.java # Holds a key pair, derives an address, and signs transactions
-Γöé Γöé Γö£ΓöÇΓöÇ WalletManager.java # Creates, imports, exports, and lists wallets
-Γöé Γöé ΓööΓöÇΓöÇ KeystoreSerializer.java # Encrypts and decrypts wallets using a standard keystore format