@blinklabs/dingo 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/.dockerignore +5 -0
  2. package/.github/CODEOWNERS +5 -0
  3. package/.github/assets/dingo-ate-my-blockchain.png +0 -0
  4. package/.github/assets/dingo-illustration.png +0 -0
  5. package/.github/assets/dingo-logo-with-text-horizontal.png +0 -0
  6. package/.github/assets/dingo-logo-with-text.png +0 -0
  7. package/.github/dependabot.yml +19 -0
  8. package/.github/dingo-20241210.png +0 -0
  9. package/.github/dingo.md +56 -0
  10. package/.github/workflows/ci-docker.yml +36 -0
  11. package/.github/workflows/conventional-commits.yml +17 -0
  12. package/.github/workflows/go-test.yml +29 -0
  13. package/.github/workflows/golangci-lint.yml +23 -0
  14. package/.github/workflows/publish.yml +207 -0
  15. package/.golangci.yml +71 -0
  16. package/Dockerfile +25 -0
  17. package/LICENSE +201 -0
  18. package/Makefile +53 -0
  19. package/README.md +150 -0
  20. package/blockfetch.go +144 -0
  21. package/chain/chain.go +504 -0
  22. package/chain/chain_test.go +468 -0
  23. package/chain/errors.go +80 -0
  24. package/chain/event.go +33 -0
  25. package/chain/iter.go +64 -0
  26. package/chainsync/chainsync.go +97 -0
  27. package/chainsync.go +223 -0
  28. package/cmd/dingo/load.go +52 -0
  29. package/cmd/dingo/main.go +118 -0
  30. package/cmd/dingo/serve.go +49 -0
  31. package/config/cardano/node.go +192 -0
  32. package/config/cardano/node_test.go +85 -0
  33. package/config/cardano/preview/README.md +4 -0
  34. package/config/cardano/preview/alonzo-genesis.json +196 -0
  35. package/config/cardano/preview/byron-genesis.json +117 -0
  36. package/config/cardano/preview/config.json +114 -0
  37. package/config/cardano/preview/conway-genesis.json +297 -0
  38. package/config/cardano/preview/shelley-genesis.json +68 -0
  39. package/config.go +245 -0
  40. package/connmanager/connection_manager.go +105 -0
  41. package/connmanager/connection_manager_test.go +185 -0
  42. package/connmanager/event.go +37 -0
  43. package/connmanager/listener.go +140 -0
  44. package/connmanager/outbound.go +93 -0
  45. package/connmanager/socket.go +55 -0
  46. package/connmanager/unix.go +78 -0
  47. package/custom-p2p-topology.json +24 -0
  48. package/custom-p2p-topology.json.backup +24 -0
  49. package/custom-p2p-topology.json.mainnet +37 -0
  50. package/database/account.go +138 -0
  51. package/database/block.go +362 -0
  52. package/database/certs.go +53 -0
  53. package/database/commit_timestamp.go +77 -0
  54. package/database/database.go +118 -0
  55. package/database/database_test.go +62 -0
  56. package/database/drep.go +27 -0
  57. package/database/epoch.go +121 -0
  58. package/database/immutable/chunk.go +182 -0
  59. package/database/immutable/immutable.go +350 -0
  60. package/database/immutable/immutable_test.go +59 -0
  61. package/database/immutable/primary.go +106 -0
  62. package/database/immutable/secondary.go +103 -0
  63. package/database/immutable/testdata/08893.chunk +0 -0
  64. package/database/immutable/testdata/08893.primary +0 -0
  65. package/database/immutable/testdata/08893.secondary +0 -0
  66. package/database/immutable/testdata/08894.chunk +0 -0
  67. package/database/immutable/testdata/08894.primary +0 -0
  68. package/database/immutable/testdata/08894.secondary +0 -0
  69. package/database/immutable/testdata/README.md +4 -0
  70. package/database/plugin/blob/badger/commit_timestamp.go +50 -0
  71. package/database/plugin/blob/badger/database.go +152 -0
  72. package/database/plugin/blob/badger/logger.go +63 -0
  73. package/database/plugin/blob/badger/metrics.go +98 -0
  74. package/database/plugin/blob/blob.go +19 -0
  75. package/database/plugin/blob/store.go +40 -0
  76. package/database/plugin/log.go +27 -0
  77. package/database/plugin/metadata/metadata.go +19 -0
  78. package/database/plugin/metadata/sqlite/account.go +224 -0
  79. package/database/plugin/metadata/sqlite/certs.go +58 -0
  80. package/database/plugin/metadata/sqlite/commit_timestamp.go +68 -0
  81. package/database/plugin/metadata/sqlite/database.go +218 -0
  82. package/database/plugin/metadata/sqlite/epoch.go +120 -0
  83. package/database/plugin/metadata/sqlite/models/account.go +81 -0
  84. package/database/plugin/metadata/sqlite/models/auth_committee_hot.go +26 -0
  85. package/database/plugin/metadata/sqlite/models/deregistration_drep.go +26 -0
  86. package/database/plugin/metadata/sqlite/models/drep.go +27 -0
  87. package/database/plugin/metadata/sqlite/models/epoch.go +31 -0
  88. package/database/plugin/metadata/sqlite/models/models.go +45 -0
  89. package/database/plugin/metadata/sqlite/models/pool.go +97 -0
  90. package/database/plugin/metadata/sqlite/models/pparam_update.go +27 -0
  91. package/database/plugin/metadata/sqlite/models/pparams.go +27 -0
  92. package/database/plugin/metadata/sqlite/models/registration_drep.go +28 -0
  93. package/database/plugin/metadata/sqlite/models/resign_committee_cold.go +27 -0
  94. package/database/plugin/metadata/sqlite/models/stake_registration_delegation.go +27 -0
  95. package/database/plugin/metadata/sqlite/models/stake_vote_delegation.go +27 -0
  96. package/database/plugin/metadata/sqlite/models/stake_vote_registration_delegation.go +27 -0
  97. package/database/plugin/metadata/sqlite/models/tip.go +26 -0
  98. package/database/plugin/metadata/sqlite/models/update_drep.go +27 -0
  99. package/database/plugin/metadata/sqlite/models/utxo.go +30 -0
  100. package/database/plugin/metadata/sqlite/models/vote_delegation.go +26 -0
  101. package/database/plugin/metadata/sqlite/models/vote_registration_delegation.go +26 -0
  102. package/database/plugin/metadata/sqlite/pool.go +240 -0
  103. package/database/plugin/metadata/sqlite/pparams.go +110 -0
  104. package/database/plugin/metadata/sqlite/tip.go +83 -0
  105. package/database/plugin/metadata/sqlite/utxo.go +292 -0
  106. package/database/plugin/metadata/store.go +168 -0
  107. package/database/plugin/option.go +190 -0
  108. package/database/plugin/plugin.go +20 -0
  109. package/database/plugin/register.go +118 -0
  110. package/database/pparams.go +145 -0
  111. package/database/tip.go +45 -0
  112. package/database/txn.go +147 -0
  113. package/database/types/types.go +74 -0
  114. package/database/types/types_test.go +83 -0
  115. package/database/utxo.go +263 -0
  116. package/dist/artifacts.json +1 -0
  117. package/dist/checksums.txt +22 -0
  118. package/dist/config.yaml +253 -0
  119. package/dist/dingo-0.5.0-SNAPSHOT-d9431e4.tar.gz +0 -0
  120. package/dist/dingo-0.5.0-SNAPSHOT-d9431e4.tar.gz.sbom.json +1 -0
  121. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_arm64.tar.gz +0 -0
  122. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_arm64.tar.gz.sbom.json +1 -0
  123. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_x86_64.tar.gz +0 -0
  124. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_x86_64.tar.gz.sbom.json +1 -0
  125. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.apk +0 -0
  126. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.apk.sbom.json +1 -0
  127. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.deb +0 -0
  128. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.deb.sbom.json +1 -0
  129. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.rpm +0 -0
  130. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.rpm.sbom.json +1 -0
  131. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.apk +0 -0
  132. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.apk.sbom.json +1 -0
  133. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.deb +0 -0
  134. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.deb.sbom.json +1 -0
  135. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.rpm +0 -0
  136. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.rpm.sbom.json +1 -0
  137. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.tar.gz +0 -0
  138. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.tar.gz.sbom.json +1 -0
  139. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_x86_64.tar.gz +0 -0
  140. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_x86_64.tar.gz.sbom.json +1 -0
  141. package/dist/dingo_darwin_amd64_v1/dingo +0 -0
  142. package/dist/dingo_darwin_arm64_v8.0/dingo +0 -0
  143. package/dist/dingo_linux_amd64_v1/dingo +0 -0
  144. package/dist/dingo_linux_arm64_v8.0/dingo +0 -0
  145. package/dist/homebrew/dingo.rb +51 -0
  146. package/dist/metadata.json +1 -0
  147. package/event/event.go +141 -0
  148. package/event/event_test.go +115 -0
  149. package/event/metrics.go +44 -0
  150. package/go.mod +98 -0
  151. package/go.sum +358 -0
  152. package/internal/config/config.go +145 -0
  153. package/internal/config/config_test.go +118 -0
  154. package/internal/node/load.go +149 -0
  155. package/internal/node/node.go +176 -0
  156. package/internal/version/version.go +33 -0
  157. package/ledger/certs.go +113 -0
  158. package/ledger/chainsync.go +578 -0
  159. package/ledger/eras/allegra.go +154 -0
  160. package/ledger/eras/alonzo.go +156 -0
  161. package/ledger/eras/babbage.go +154 -0
  162. package/ledger/eras/byron.go +42 -0
  163. package/ledger/eras/conway.go +158 -0
  164. package/ledger/eras/eras.go +44 -0
  165. package/ledger/eras/mary.go +154 -0
  166. package/ledger/eras/shelley.go +164 -0
  167. package/ledger/error.go +19 -0
  168. package/ledger/event.go +50 -0
  169. package/ledger/metrics.go +53 -0
  170. package/ledger/queries.go +260 -0
  171. package/ledger/slot.go +127 -0
  172. package/ledger/slot_test.go +147 -0
  173. package/ledger/state.go +726 -0
  174. package/ledger/view.go +73 -0
  175. package/localstatequery.go +50 -0
  176. package/localtxmonitor.go +44 -0
  177. package/localtxsubmission.go +52 -0
  178. package/mempool/consumer.go +98 -0
  179. package/mempool/mempool.go +322 -0
  180. package/node.go +320 -0
  181. package/package.json +33 -0
  182. package/peergov/event.go +27 -0
  183. package/peergov/peer.go +67 -0
  184. package/peergov/peergov.go +290 -0
  185. package/peersharing.go +70 -0
  186. package/preview-local-topology.json +23 -0
  187. package/topology/topology.go +69 -0
  188. package/topology/topology_test.go +179 -0
  189. package/tracing.go +65 -0
  190. package/txsubmission.go +233 -0
  191. package/utxorpc/query.go +311 -0
  192. package/utxorpc/submit.go +395 -0
  193. package/utxorpc/sync.go +276 -0
  194. package/utxorpc/utxorpc.go +166 -0
  195. package/utxorpc/watch.go +310 -0
package/.dockerignore ADDED
@@ -0,0 +1,5 @@
1
+ .dingo/
2
+ .github/
3
+ dingo
4
+ Dockerfile
5
+ README.md
@@ -0,0 +1,5 @@
1
+ # Blink Labs
2
+ #
3
+ * @blinklabs-io/core
4
+ *.md @blinklabs-io/core @blinklabs-io/docs @blinklabs-io/pms
5
+ LICENSE @blinklabs-io/core @blinklabs-io/pms
@@ -0,0 +1,19 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "docker"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ - package-ecosystem: "github-actions"
13
+ directory: "/"
14
+ schedule:
15
+ interval: "weekly"
16
+ - package-ecosystem: "gomod"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
Binary file
@@ -0,0 +1,56 @@
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
+ Created using https://itoa.hex.dance/
@@ -0,0 +1,36 @@
1
+ name: Docker CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: ['main']
6
+ paths: ['Dockerfile','cmd/**','docs/**','internal/**','go.*','.github/workflows/ci-docker.yml']
7
+
8
+ env:
9
+ GHCR_IMAGE_NAME: ghcr.io/blinklabs-io/dingo
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ docker:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: '0'
21
+ - name: qemu
22
+ uses: docker/setup-qemu-action@v3
23
+ - uses: docker/setup-buildx-action@v3
24
+ - id: meta
25
+ uses: docker/metadata-action@v5
26
+ with:
27
+ images: ${{ env.GHCR_IMAGE_NAME }}
28
+ - name: build
29
+ uses: docker/build-push-action@v6
30
+ with:
31
+ context: .
32
+ push: false
33
+ ### TODO: test multiple platforms
34
+ # platforms: linux/amd64,linux/arm64
35
+ tags: ${{ steps.meta.outputs.tags }}
36
+ labels: ${{ steps.meta.outputs.labels }}
@@ -0,0 +1,17 @@
1
+ # The below is pulled from upstream and slightly modified
2
+ # https://github.com/webiny/action-conventional-commits/blob/master/README.md#usage
3
+
4
+ name: Conventional Commits
5
+
6
+ on:
7
+ pull_request:
8
+
9
+ jobs:
10
+ build:
11
+ name: Conventional Commits
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: webiny/action-conventional-commits@v1.3.0
@@ -0,0 +1,29 @@
1
+ name: go-test
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+ branches:
8
+ - main
9
+ pull_request:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ go-test:
16
+ name: go-test
17
+ strategy:
18
+ matrix:
19
+ go-version: [1.23.x, 1.24.x]
20
+ # We want to make sure that this builds on Linux and Darwin
21
+ platform: [ubuntu-latest, macos-latest]
22
+ runs-on: ${{ matrix.platform }}
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: actions/setup-go@v5
26
+ with:
27
+ go-version: ${{ matrix.go-version }}
28
+ - name: go-test
29
+ run: go test ./...
@@ -0,0 +1,23 @@
1
+ name: golangci-lint
2
+ on:
3
+ push:
4
+ tags:
5
+ - v*
6
+ branches:
7
+ - main
8
+ pull_request:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ golangci:
15
+ name: lint
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-go@v5
20
+ with:
21
+ go-version: 1.23.x
22
+ - name: golangci-lint
23
+ uses: golangci/golangci-lint-action@v7
@@ -0,0 +1,207 @@
1
+ name: publish
2
+
3
+ on:
4
+ push:
5
+ branches: ['main']
6
+ tags:
7
+ - 'v*.*.*'
8
+
9
+ concurrency: ${{ github.ref }}
10
+
11
+ env:
12
+ APPLICATION_NAME: 'dingo'
13
+
14
+ jobs:
15
+ create-draft-release:
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: write
19
+ outputs:
20
+ RELEASE_ID: ${{ steps.create-release.outputs.result }}
21
+ steps:
22
+ - run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
23
+ - uses: actions/github-script@v7
24
+ id: create-release
25
+ if: startsWith(github.ref, 'refs/tags/')
26
+ with:
27
+ github-token: ${{ secrets.GITHUB_TOKEN }}
28
+ result-encoding: string
29
+ script: |
30
+ try {
31
+ const response = await github.rest.repos.createRelease({
32
+ draft: true,
33
+ generate_release_notes: true,
34
+ name: process.env.RELEASE_TAG,
35
+ owner: context.repo.owner,
36
+ prerelease: false,
37
+ repo: context.repo.repo,
38
+ tag_name: process.env.RELEASE_TAG,
39
+ });
40
+
41
+ return response.data.id;
42
+ } catch (error) {
43
+ core.setFailed(error.message);
44
+ }
45
+
46
+ build-binaries:
47
+ strategy:
48
+ matrix:
49
+ include:
50
+ - runner: macos-latest
51
+ os: darwin
52
+ arch: arm64
53
+ - runner: ubuntu-latest
54
+ os: freebsd
55
+ arch: amd64
56
+ - runner: ubuntu-latest
57
+ os: freebsd
58
+ arch: arm64
59
+ - runner: ubuntu-latest
60
+ os: linux
61
+ arch: amd64
62
+ - runner: ubuntu-latest
63
+ os: linux
64
+ arch: arm64
65
+ runs-on: ${{ matrix.runner }}
66
+ needs: [create-draft-release]
67
+ permissions:
68
+ actions: write
69
+ attestations: write
70
+ checks: write
71
+ contents: write
72
+ id-token: write
73
+ packages: write
74
+ statuses: write
75
+ steps:
76
+ - name: Set RELEASE_TAG
77
+ run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
78
+ - uses: actions/checkout@v4
79
+ with:
80
+ fetch-depth: '0'
81
+ - uses: actions/setup-go@v5
82
+ with:
83
+ go-version: 1.23.x
84
+ - name: Build binary
85
+ run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make build
86
+ - name: Upload release asset
87
+ if: startsWith(github.ref, 'refs/tags/')
88
+ run: |
89
+ _filename=${{ env.APPLICATION_NAME }}-${{ env.RELEASE_TAG }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
90
+ if [[ "${{ matrix.os }}" != "darwin" ]]; then
91
+ tar czf ${_filename} ${{ env.APPLICATION_NAME }}
92
+ fi
93
+ if [[ "${{ matrix.os }}" == "darwin" ]]; then
94
+ _filename=${{ env.APPLICATION_NAME }}-${{ env.RELEASE_TAG }}-${{ matrix.os }}-${{ matrix.arch }}.zip
95
+ zip -r ${_filename} ${{ env.APPLICATION_NAME }}
96
+ fi
97
+ curl \
98
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
99
+ -H "Content-Type: application/octet-stream" \
100
+ --data-binary @${_filename} \
101
+ https://uploads.github.com/repos/${{ github.repository_owner }}/${{ env.APPLICATION_NAME }}/releases/${{ needs.create-draft-release.outputs.RELEASE_ID }}/assets?name=${_filename}
102
+ - name: Attest binary
103
+ if: startsWith(github.ref, 'refs/tags/')
104
+ uses: actions/attest-build-provenance@v2
105
+ with:
106
+ subject-path: '${{ env.APPLICATION_NAME }}'
107
+
108
+ build-images:
109
+ runs-on: ubuntu-latest
110
+ needs: [create-draft-release]
111
+ permissions:
112
+ actions: write
113
+ attestations: write
114
+ checks: write
115
+ contents: write
116
+ id-token: write
117
+ packages: write
118
+ statuses: write
119
+ steps:
120
+ - run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
121
+ - uses: actions/checkout@v4
122
+ with:
123
+ fetch-depth: '0'
124
+ - name: Set up QEMU
125
+ uses: docker/setup-qemu-action@v3
126
+ - name: Set up Docker Buildx
127
+ uses: docker/setup-buildx-action@v3
128
+ - name: Login to Docker Hub
129
+ uses: docker/login-action@v3
130
+ with:
131
+ username: blinklabs
132
+ password: ${{ secrets.DOCKER_PASSWORD }} # uses token
133
+ - name: Login to GHCR
134
+ uses: docker/login-action@v3
135
+ with:
136
+ username: ${{ github.repository_owner }}
137
+ password: ${{ secrets.GITHUB_TOKEN }}
138
+ registry: ghcr.io
139
+ - id: meta
140
+ uses: docker/metadata-action@v5
141
+ with:
142
+ images: |
143
+ blinklabs/dingo
144
+ ghcr.io/${{ github.repository }}
145
+ tags: |
146
+ # Only version, no revision
147
+ type=match,pattern=v(.*)-(.*),group=1
148
+ # branch
149
+ type=ref,event=branch
150
+ # semver
151
+ type=semver,pattern={{version}}
152
+ - name: Build images
153
+ id: push
154
+ uses: docker/build-push-action@v6
155
+ with:
156
+ outputs: "type=registry,push=true"
157
+ platforms: linux/amd64,linux/arm64
158
+ tags: ${{ steps.meta.outputs.tags }}
159
+ labels: ${{ steps.meta.outputs.labels }}
160
+ - name: Attest Docker Hub image
161
+ uses: actions/attest-build-provenance@v2
162
+ with:
163
+ subject-name: index.docker.io/blinklabs/dingo
164
+ subject-digest: ${{ steps.push.outputs.digest }}
165
+ push-to-registry: true
166
+ - name: Attest GHCR image
167
+ uses: actions/attest-build-provenance@v2
168
+ with:
169
+ subject-name: ghcr.io/${{ github.repository }}
170
+ subject-digest: ${{ steps.push.outputs.digest }}
171
+ push-to-registry: true
172
+ # Update Docker Hub from README
173
+ - name: Docker Hub Description
174
+ uses: peter-evans/dockerhub-description@v4
175
+ with:
176
+ username: blinklabs
177
+ password: ${{ secrets.DOCKER_PASSWORD }}
178
+ repository: blinklabs/${{ env.APPLICATION_NAME }}
179
+ readme-filepath: ./README.md
180
+ short-description: "Dingo is a Cardano blockchain data node"
181
+
182
+ finalize-release:
183
+ runs-on: ubuntu-latest
184
+ permissions:
185
+ contents: write
186
+ needs: [create-draft-release, build-binaries, build-images]
187
+ steps:
188
+ - uses: actions/github-script@v7
189
+ if: startsWith(github.ref, 'refs/tags/')
190
+ with:
191
+ github-token: ${{ secrets.GITHUB_TOKEN }}
192
+ script: |
193
+ try {
194
+ await github.rest.repos.updateRelease({
195
+ owner: context.repo.owner,
196
+ repo: context.repo.repo,
197
+ release_id: ${{ needs.create-draft-release.outputs.RELEASE_ID }},
198
+ draft: false,
199
+ });
200
+ } catch (error) {
201
+ core.setFailed(error.message);
202
+ }
203
+
204
+ # This updates the documentation on pkg.go.dev and the latest version available via the Go module proxy
205
+ - name: Pull new module version
206
+ if: startsWith(github.ref, 'refs/tags/')
207
+ uses: andrewslotin/go-proxy-pull-action@v1.3.0
package/.golangci.yml ADDED
@@ -0,0 +1,71 @@
1
+ version: "2"
2
+ run:
3
+ issues-exit-code: 1
4
+ tests: false
5
+ linters:
6
+ enable:
7
+ - asasalint
8
+ - asciicheck
9
+ - bidichk
10
+ - bodyclose
11
+ - contextcheck
12
+ - copyloopvar
13
+ - durationcheck
14
+ - errchkjson
15
+ - errorlint
16
+ - exhaustive
17
+ - fatcontext
18
+ - gocheckcompilerdirectives
19
+ - gochecksumtype
20
+ - gomodguard
21
+ - gosec
22
+ - gosmopolitan
23
+ - loggercheck
24
+ - makezero
25
+ - musttag
26
+ - nilerr
27
+ - nilnesserr
28
+ - noctx
29
+ - perfsprint
30
+ - prealloc
31
+ - protogetter
32
+ - reassign
33
+ - recvcheck
34
+ - rowserrcheck
35
+ - spancheck
36
+ - sqlclosecheck
37
+ - testifylint
38
+ - unparam
39
+ - usestdlibvars
40
+ - whitespace
41
+ - zerologlint
42
+ disable:
43
+ - depguard
44
+ exclusions:
45
+ generated: lax
46
+ presets:
47
+ - comments
48
+ - common-false-positives
49
+ - legacy
50
+ - std-error-handling
51
+ paths:
52
+ - docs
53
+ - third_party$
54
+ - builtin$
55
+ - examples$
56
+ issues:
57
+ max-issues-per-linter: 0
58
+ max-same-issues: 0
59
+ formatters:
60
+ enable:
61
+ - gci
62
+ - gofmt
63
+ - gofumpt
64
+ - goimports
65
+ exclusions:
66
+ generated: lax
67
+ paths:
68
+ - docs
69
+ - third_party$
70
+ - builtin$
71
+ - examples$
package/Dockerfile ADDED
@@ -0,0 +1,25 @@
1
+ FROM ghcr.io/blinklabs-io/go:1.24.2-1 AS build
2
+
3
+ WORKDIR /code
4
+ COPY go.* .
5
+ RUN go mod download
6
+ COPY . .
7
+ RUN make build
8
+
9
+ FROM ghcr.io/blinklabs-io/cardano-configs:20250213-1 AS cardano-configs
10
+ FROM ghcr.io/blinklabs-io/txtop:0.12.3 AS txtop
11
+
12
+ FROM debian:bookworm-slim AS dingo
13
+ COPY --from=build /code/dingo /bin/
14
+ COPY --from=cardano-configs /config/ /opt/cardano/config/
15
+ COPY --from=txtop /bin/txtop /usr/local/bin/
16
+ ENV CARDANO_CONFIG=/opt/cardano/config/preview/config.json
17
+ ENV CARDANO_NETWORK=preview
18
+ # Create database dir owned by container user
19
+ VOLUME /data/db
20
+ ENV CARDANO_DATABASE_PATH=/data/db
21
+ # Create socket dir owned by container user
22
+ VOLUME /ipc
23
+ ENV CARDANO_NODE_SOCKET_PATH=/ipc/dingo.socket
24
+ ENV CARDANO_SOCKET_PATH=/ipc/dingo.socket
25
+ ENTRYPOINT ["dingo"]