@blinklabs/dingo 0.7.0 → 0.8.1

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 (192) hide show
  1. package/README.md +2 -1
  2. package/{bin/dingo → dingo} +0 -0
  3. package/dingo.yaml.example +53 -0
  4. package/package.json +2 -2
  5. package/.github/CODEOWNERS +0 -5
  6. package/.github/assets/dingo-ate-my-blockchain.png +0 -0
  7. package/.github/assets/dingo-illustration.png +0 -0
  8. package/.github/assets/dingo-logo-with-text-horizontal.png +0 -0
  9. package/.github/assets/dingo-logo-with-text.png +0 -0
  10. package/.github/dependabot.yml +0 -19
  11. package/.github/dingo-20241210.png +0 -0
  12. package/.github/dingo.md +0 -56
  13. package/.github/workflows/ci-docker.yml +0 -36
  14. package/.github/workflows/conventional-commits.yml +0 -17
  15. package/.github/workflows/go-test.yml +0 -29
  16. package/.github/workflows/golangci-lint.yml +0 -23
  17. package/.github/workflows/publish.yml +0 -207
  18. package/Dockerfile +0 -25
  19. package/Makefile +0 -53
  20. package/blockfetch.go +0 -144
  21. package/chain/chain.go +0 -504
  22. package/chain/chain_test.go +0 -468
  23. package/chain/errors.go +0 -80
  24. package/chain/event.go +0 -33
  25. package/chain/iter.go +0 -64
  26. package/chainsync/chainsync.go +0 -97
  27. package/chainsync.go +0 -223
  28. package/cmd/dingo/load.go +0 -52
  29. package/cmd/dingo/main.go +0 -118
  30. package/cmd/dingo/serve.go +0 -49
  31. package/config/cardano/node.go +0 -192
  32. package/config/cardano/node_test.go +0 -85
  33. package/config/cardano/preview/README.md +0 -4
  34. package/config/cardano/preview/alonzo-genesis.json +0 -196
  35. package/config/cardano/preview/byron-genesis.json +0 -117
  36. package/config/cardano/preview/config.json +0 -114
  37. package/config/cardano/preview/conway-genesis.json +0 -297
  38. package/config/cardano/preview/shelley-genesis.json +0 -68
  39. package/config.go +0 -245
  40. package/connmanager/connection_manager.go +0 -105
  41. package/connmanager/connection_manager_test.go +0 -185
  42. package/connmanager/event.go +0 -37
  43. package/connmanager/listener.go +0 -140
  44. package/connmanager/outbound.go +0 -93
  45. package/connmanager/socket.go +0 -55
  46. package/connmanager/unix.go +0 -78
  47. package/custom-p2p-topology.json +0 -24
  48. package/custom-p2p-topology.json.backup +0 -24
  49. package/custom-p2p-topology.json.mainnet +0 -37
  50. package/database/account.go +0 -180
  51. package/database/block.go +0 -362
  52. package/database/certs.go +0 -53
  53. package/database/commit_timestamp.go +0 -77
  54. package/database/database.go +0 -118
  55. package/database/database_test.go +0 -62
  56. package/database/drep.go +0 -47
  57. package/database/epoch.go +0 -121
  58. package/database/immutable/chunk.go +0 -182
  59. package/database/immutable/immutable.go +0 -350
  60. package/database/immutable/immutable_test.go +0 -59
  61. package/database/immutable/primary.go +0 -106
  62. package/database/immutable/secondary.go +0 -103
  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 +0 -4
  70. package/database/plugin/blob/badger/commit_timestamp.go +0 -50
  71. package/database/plugin/blob/badger/database.go +0 -152
  72. package/database/plugin/blob/badger/logger.go +0 -63
  73. package/database/plugin/blob/badger/metrics.go +0 -98
  74. package/database/plugin/blob/blob.go +0 -19
  75. package/database/plugin/blob/store.go +0 -40
  76. package/database/plugin/log.go +0 -27
  77. package/database/plugin/metadata/metadata.go +0 -19
  78. package/database/plugin/metadata/sqlite/account.go +0 -313
  79. package/database/plugin/metadata/sqlite/certs.go +0 -58
  80. package/database/plugin/metadata/sqlite/commit_timestamp.go +0 -68
  81. package/database/plugin/metadata/sqlite/database.go +0 -218
  82. package/database/plugin/metadata/sqlite/drep.go +0 -140
  83. package/database/plugin/metadata/sqlite/epoch.go +0 -120
  84. package/database/plugin/metadata/sqlite/models/account.go +0 -118
  85. package/database/plugin/metadata/sqlite/models/auth_committee_hot.go +0 -26
  86. package/database/plugin/metadata/sqlite/models/drep.go +0 -52
  87. package/database/plugin/metadata/sqlite/models/epoch.go +0 -31
  88. package/database/plugin/metadata/sqlite/models/models.go +0 -46
  89. package/database/plugin/metadata/sqlite/models/pool.go +0 -97
  90. package/database/plugin/metadata/sqlite/models/pparam_update.go +0 -27
  91. package/database/plugin/metadata/sqlite/models/pparams.go +0 -27
  92. package/database/plugin/metadata/sqlite/models/resign_committee_cold.go +0 -27
  93. package/database/plugin/metadata/sqlite/models/stake_vote_delegation.go +0 -27
  94. package/database/plugin/metadata/sqlite/models/tip.go +0 -26
  95. package/database/plugin/metadata/sqlite/models/update_drep.go +0 -27
  96. package/database/plugin/metadata/sqlite/models/utxo.go +0 -30
  97. package/database/plugin/metadata/sqlite/models/vote_delegation.go +0 -26
  98. package/database/plugin/metadata/sqlite/models/vote_registration_delegation.go +0 -15
  99. package/database/plugin/metadata/sqlite/pool.go +0 -240
  100. package/database/plugin/metadata/sqlite/pparams.go +0 -110
  101. package/database/plugin/metadata/sqlite/tip.go +0 -83
  102. package/database/plugin/metadata/sqlite/utxo.go +0 -292
  103. package/database/plugin/metadata/store.go +0 -198
  104. package/database/plugin/option.go +0 -190
  105. package/database/plugin/plugin.go +0 -20
  106. package/database/plugin/register.go +0 -118
  107. package/database/pparams.go +0 -145
  108. package/database/tip.go +0 -45
  109. package/database/txn.go +0 -147
  110. package/database/types/types.go +0 -74
  111. package/database/types/types_test.go +0 -83
  112. package/database/utxo.go +0 -263
  113. package/dist/artifacts.json +0 -1
  114. package/dist/checksums.txt +0 -22
  115. package/dist/config.yaml +0 -253
  116. package/dist/dingo-0.5.0-SNAPSHOT-d9431e4.tar.gz +0 -0
  117. package/dist/dingo-0.5.0-SNAPSHOT-d9431e4.tar.gz.sbom.json +0 -1
  118. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_arm64.tar.gz +0 -0
  119. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_arm64.tar.gz.sbom.json +0 -1
  120. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_x86_64.tar.gz +0 -0
  121. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_darwin_x86_64.tar.gz.sbom.json +0 -1
  122. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.apk +0 -0
  123. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.apk.sbom.json +0 -1
  124. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.deb +0 -0
  125. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.deb.sbom.json +0 -1
  126. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.rpm +0 -0
  127. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_amd64.rpm.sbom.json +0 -1
  128. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.apk +0 -0
  129. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.apk.sbom.json +0 -1
  130. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.deb +0 -0
  131. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.deb.sbom.json +0 -1
  132. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.rpm +0 -0
  133. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.rpm.sbom.json +0 -1
  134. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.tar.gz +0 -0
  135. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_arm64.tar.gz.sbom.json +0 -1
  136. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_x86_64.tar.gz +0 -0
  137. package/dist/dingo_0.5.0-SNAPSHOT-d9431e4_linux_x86_64.tar.gz.sbom.json +0 -1
  138. package/dist/dingo_darwin_amd64_v1/dingo +0 -0
  139. package/dist/dingo_darwin_arm64_v8.0/dingo +0 -0
  140. package/dist/dingo_linux_amd64_v1/dingo +0 -0
  141. package/dist/dingo_linux_arm64_v8.0/dingo +0 -0
  142. package/dist/homebrew/dingo.rb +0 -51
  143. package/dist/metadata.json +0 -1
  144. package/event/event.go +0 -141
  145. package/event/event_test.go +0 -115
  146. package/event/metrics.go +0 -44
  147. package/go.mod +0 -98
  148. package/go.sum +0 -358
  149. package/internal/config/config.go +0 -145
  150. package/internal/config/config_test.go +0 -118
  151. package/internal/node/load.go +0 -149
  152. package/internal/node/node.go +0 -176
  153. package/internal/version/version.go +0 -33
  154. package/ledger/certs.go +0 -164
  155. package/ledger/chainsync.go +0 -504
  156. package/ledger/delta.go +0 -99
  157. package/ledger/eras/allegra.go +0 -154
  158. package/ledger/eras/alonzo.go +0 -156
  159. package/ledger/eras/babbage.go +0 -154
  160. package/ledger/eras/byron.go +0 -42
  161. package/ledger/eras/conway.go +0 -166
  162. package/ledger/eras/eras.go +0 -44
  163. package/ledger/eras/mary.go +0 -154
  164. package/ledger/eras/shelley.go +0 -164
  165. package/ledger/error.go +0 -19
  166. package/ledger/event.go +0 -50
  167. package/ledger/metrics.go +0 -53
  168. package/ledger/queries.go +0 -258
  169. package/ledger/slot.go +0 -127
  170. package/ledger/slot_test.go +0 -147
  171. package/ledger/state.go +0 -821
  172. package/ledger/view.go +0 -73
  173. package/localstatequery.go +0 -50
  174. package/localtxmonitor.go +0 -44
  175. package/localtxsubmission.go +0 -52
  176. package/mempool/consumer.go +0 -98
  177. package/mempool/mempool.go +0 -322
  178. package/node.go +0 -320
  179. package/peergov/event.go +0 -27
  180. package/peergov/peer.go +0 -67
  181. package/peergov/peergov.go +0 -290
  182. package/peersharing.go +0 -70
  183. package/preview-local-topology.json +0 -23
  184. package/topology/topology.go +0 -69
  185. package/topology/topology_test.go +0 -179
  186. package/tracing.go +0 -65
  187. package/txsubmission.go +0 -233
  188. package/utxorpc/query.go +0 -311
  189. package/utxorpc/submit.go +0 -395
  190. package/utxorpc/sync.go +0 -276
  191. package/utxorpc/utxorpc.go +0 -166
  192. package/utxorpc/watch.go +0 -310
@@ -1,140 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package sqlite
16
-
17
- import (
18
- "github.com/blinklabs-io/dingo/database/plugin/metadata/sqlite/models"
19
- lcommon "github.com/blinklabs-io/gouroboros/ledger/common"
20
- "gorm.io/gorm"
21
- "gorm.io/gorm/clause"
22
- )
23
-
24
- // GetDrep gets a drep
25
- func (d *MetadataStoreSqlite) GetDrep(
26
- cred []byte,
27
- txn *gorm.DB,
28
- ) (models.Drep, error) {
29
- ret := models.Drep{}
30
- tmpDrep := models.Drep{}
31
- if txn != nil {
32
- if result := txn.First(&tmpDrep, "credential = ?", cred); result.Error != nil {
33
- return ret, result.Error
34
- }
35
- } else {
36
- if result := d.DB().First(&tmpDrep, "credential = ?", cred); result.Error != nil {
37
- return ret, result.Error
38
- }
39
- }
40
- ret = tmpDrep
41
- return ret, nil
42
- }
43
-
44
- // SetDrep saves a drep
45
- func (d *MetadataStoreSqlite) SetDrep(
46
- cred []byte,
47
- slot uint64,
48
- url string,
49
- hash []byte,
50
- active bool,
51
- txn *gorm.DB,
52
- ) error {
53
- tmpItem := models.Drep{
54
- Credential: cred,
55
- AddedSlot: slot,
56
- AnchorUrl: url,
57
- AnchorHash: hash,
58
- Active: active,
59
- }
60
- if txn != nil {
61
- if result := txn.Clauses(clause.OnConflict{UpdateAll: true}).Create(&tmpItem); result.Error != nil {
62
- return result.Error
63
- }
64
- } else {
65
- if result := d.DB().Clauses(clause.OnConflict{UpdateAll: true}).Create(&tmpItem); result.Error != nil {
66
- return result.Error
67
- }
68
- }
69
- return nil
70
- }
71
-
72
- // SetDeregistrationDrep saves a deregistration drep certificate and drep
73
- func (d *MetadataStoreSqlite) SetDeregistrationDrep(
74
- cert *lcommon.DeregistrationDrepCertificate,
75
- slot, deposit uint64,
76
- txn *gorm.DB,
77
- ) error {
78
- drep := cert.DrepCredential.Credential.Bytes()
79
- tmpDrep, err := d.GetDrep(drep, txn)
80
- if err != nil {
81
- return err
82
- }
83
- tmpItem := models.DeregistrationDrep{
84
- DrepCredential: drep,
85
- AddedSlot: slot,
86
- DepositAmount: deposit,
87
- }
88
- tmpDrep.Active = false
89
- if txn != nil {
90
- if drepErr := txn.Save(&tmpDrep); drepErr.Error != nil {
91
- return drepErr.Error
92
- }
93
- if result := txn.Create(&tmpItem); result.Error != nil {
94
- return result.Error
95
- }
96
- } else {
97
- if drepErr := d.DB().Save(&tmpDrep); drepErr.Error != nil {
98
- return drepErr.Error
99
- }
100
- if result := d.DB().Create(&tmpItem); result.Error != nil {
101
- return result.Error
102
- }
103
- }
104
- return nil
105
- }
106
-
107
- // SetRegistrationDrep saves a registration drep certificate and drep
108
- func (d *MetadataStoreSqlite) SetRegistrationDrep(
109
- cert *lcommon.RegistrationDrepCertificate,
110
- slot, deposit uint64,
111
- txn *gorm.DB,
112
- ) error {
113
- drep := cert.DrepCredential.Credential.Bytes()
114
- tmpItem := models.RegistrationDrep{
115
- DrepCredential: drep,
116
- AddedSlot: slot,
117
- DepositAmount: deposit,
118
- }
119
- var anchorUrl string
120
- var anchorHash []byte
121
- if cert.Anchor != nil {
122
- anchorUrl = cert.Anchor.Url
123
- anchorHash = cert.Anchor.DataHash[:]
124
- }
125
- tmpItem.AnchorUrl = anchorUrl
126
- tmpItem.AnchorHash = anchorHash
127
- if err := d.SetDrep(drep, slot, anchorUrl, anchorHash, true, txn); err != nil {
128
- return err
129
- }
130
- if txn != nil {
131
- if result := txn.Create(&tmpItem); result.Error != nil {
132
- return result.Error
133
- }
134
- } else {
135
- if result := d.DB().Create(&tmpItem); result.Error != nil {
136
- return result.Error
137
- }
138
- }
139
- return nil
140
- }
@@ -1,120 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package sqlite
16
-
17
- import (
18
- "errors"
19
- "strconv"
20
-
21
- "github.com/blinklabs-io/dingo/database/plugin/metadata/sqlite/models"
22
- "gorm.io/gorm"
23
- )
24
-
25
- // GetEpochLatest returns the latest epoch
26
- func (d *MetadataStoreSqlite) GetEpochLatest(
27
- txn *gorm.DB,
28
- ) (models.Epoch, error) {
29
- ret := models.Epoch{}
30
- if txn != nil {
31
- result := txn.Order("epoch_id DESC").First(&ret)
32
- if result.Error != nil {
33
- if !errors.Is(result.Error, gorm.ErrRecordNotFound) {
34
- return ret, result.Error
35
- }
36
- }
37
- } else {
38
- result := d.DB().Order("epoch_id DESC").First(&ret)
39
- if result.Error != nil {
40
- if !errors.Is(result.Error, gorm.ErrRecordNotFound) {
41
- return ret, result.Error
42
- }
43
- }
44
- }
45
- return ret, nil
46
- }
47
-
48
- // GetEpochsByEra returns the list of epochs by era
49
- func (d *MetadataStoreSqlite) GetEpochsByEra(
50
- eraId uint,
51
- txn *gorm.DB,
52
- ) ([]models.Epoch, error) {
53
- ret := []models.Epoch{}
54
- if txn != nil {
55
- result := txn.Where("era_id = ?", eraId).Order("epoch_id").Find(&ret)
56
- if result.Error != nil {
57
- return ret, result.Error
58
- }
59
- } else {
60
- result := d.DB().Where("era_id = ?", eraId).Order("epoch_id").Find(&ret)
61
- if result.Error != nil {
62
- return ret, result.Error
63
- }
64
- }
65
- return ret, nil
66
- }
67
-
68
- // GetEpochs returns the list of epochs
69
- func (d *MetadataStoreSqlite) GetEpochs(
70
- txn *gorm.DB,
71
- ) ([]models.Epoch, error) {
72
- ret := []models.Epoch{}
73
- if txn != nil {
74
- result := txn.Order("epoch_id").Find(&ret)
75
- if result.Error != nil {
76
- return ret, result.Error
77
- }
78
- } else {
79
- result := d.DB().Order("epoch_id").Find(&ret)
80
- if result.Error != nil {
81
- return ret, result.Error
82
- }
83
- }
84
- return ret, nil
85
- }
86
-
87
- // SetEpoch saves an epoch
88
- func (d *MetadataStoreSqlite) SetEpoch(
89
- slot, epoch uint64,
90
- nonce []byte,
91
- era, slotLength, lengthInSlots uint,
92
- txn *gorm.DB,
93
- ) error {
94
- tmpItem := models.Epoch{
95
- EpochId: epoch,
96
- StartSlot: slot,
97
- Nonce: nonce,
98
- EraId: era,
99
- SlotLength: slotLength,
100
- LengthInSlots: lengthInSlots,
101
- }
102
- if txn != nil {
103
- if result := txn.Create(&tmpItem); result.Error != nil {
104
- return result.Error
105
- }
106
- } else {
107
- if result := d.DB().Create(&tmpItem); result.Error != nil {
108
- return result.Error
109
- }
110
- }
111
- // Run a vacuum, on error only log
112
- if err := d.runVacuum(); err != nil {
113
- d.logger.Error(
114
- "failed to free space in metdata store",
115
- "epoch", strconv.FormatUint(epoch, 10),
116
- "error", err,
117
- )
118
- }
119
- return nil
120
- }
@@ -1,118 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- type Account struct {
18
- ID uint `gorm:"primarykey"`
19
- StakingKey []byte `gorm:"index,unique"`
20
- Pool []byte `gorm:"index"`
21
- Drep []byte `gorm:"index"`
22
- AddedSlot uint64
23
- Active bool `gorm:"default:true"`
24
- }
25
-
26
- func (a *Account) TableName() string {
27
- return "account"
28
- }
29
-
30
- type Deregistration struct {
31
- ID uint `gorm:"primarykey"`
32
- StakingKey []byte `gorm:"index"`
33
- AddedSlot uint64
34
- }
35
-
36
- func (Deregistration) TableName() string {
37
- return "deregistration"
38
- }
39
-
40
- type Registration struct {
41
- ID uint `gorm:"primarykey"`
42
- StakingKey []byte `gorm:"index"`
43
- AddedSlot uint64
44
- DepositAmount uint64
45
- }
46
-
47
- func (Registration) TableName() string {
48
- return "registration"
49
- }
50
-
51
- type StakeDelegation struct {
52
- ID uint `gorm:"primarykey"`
53
- StakingKey []byte `gorm:"index"`
54
- PoolKeyHash []byte `gorm:"index"`
55
- AddedSlot uint64
56
- }
57
-
58
- func (StakeDelegation) TableName() string {
59
- return "stake_delegation"
60
- }
61
-
62
- type StakeDeregistration struct {
63
- ID uint `gorm:"primarykey"`
64
- StakingKey []byte `gorm:"index"`
65
- AddedSlot uint64
66
- }
67
-
68
- func (StakeDeregistration) TableName() string {
69
- return "stake_deregistration"
70
- }
71
-
72
- type StakeRegistration struct {
73
- ID uint `gorm:"primarykey"`
74
- StakingKey []byte `gorm:"index"`
75
- AddedSlot uint64
76
- DepositAmount uint64
77
- }
78
-
79
- func (StakeRegistration) TableName() string {
80
- return "stake_registration"
81
- }
82
-
83
- type StakeRegistrationDelegation struct {
84
- ID uint `gorm:"primarykey"`
85
- StakingKey []byte `gorm:"index"`
86
- PoolKeyHash []byte `gorm:"index"`
87
- AddedSlot uint64
88
- DepositAmount uint64
89
- }
90
-
91
- func (StakeRegistrationDelegation) TableName() string {
92
- return "stake_registration_delegation"
93
- }
94
-
95
- type StakeVoteRegistrationDelegation struct {
96
- ID uint `gorm:"primarykey"`
97
- StakingKey []byte `gorm:"index"`
98
- PoolKeyHash []byte `gorm:"index"`
99
- Drep []byte `gorm:"index"`
100
- AddedSlot uint64
101
- DepositAmount uint64
102
- }
103
-
104
- func (StakeVoteRegistrationDelegation) TableName() string {
105
- return "stake_vote_registration_delegation"
106
- }
107
-
108
- type VoteRegistrationDelegation struct {
109
- ID uint `gorm:"primarykey"`
110
- StakingKey []byte `gorm:"index"`
111
- Drep []byte `gorm:"index"`
112
- AddedSlot uint64
113
- DepositAmount uint64
114
- }
115
-
116
- func (VoteRegistrationDelegation) TableName() string {
117
- return "vote_registration_delegation"
118
- }
@@ -1,26 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- type AuthCommitteeHot struct {
18
- ID uint `gorm:"primarykey"`
19
- ColdCredential []byte `gorm:"index"`
20
- HostCredential []byte `gorm:"index"`
21
- AddedSlot uint64
22
- }
23
-
24
- func (AuthCommitteeHot) TableName() string {
25
- return "auth_committee_hot"
26
- }
@@ -1,52 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- type Drep struct {
18
- ID uint `gorm:"primarykey"`
19
- Credential []byte `gorm:"index"`
20
- AnchorUrl string
21
- AnchorHash []byte
22
- AddedSlot uint64
23
- Active bool `gorm:"default:true"`
24
- }
25
-
26
- func (d *Drep) TableName() string {
27
- return "drep"
28
- }
29
-
30
- type DeregistrationDrep struct {
31
- ID uint `gorm:"primarykey"`
32
- DrepCredential []byte `gorm:"index"`
33
- AddedSlot uint64
34
- DepositAmount uint64
35
- }
36
-
37
- func (DeregistrationDrep) TableName() string {
38
- return "deregistration_drep"
39
- }
40
-
41
- type RegistrationDrep struct {
42
- ID uint `gorm:"primarykey"`
43
- DrepCredential []byte `gorm:"index"`
44
- AddedSlot uint64
45
- DepositAmount uint64
46
- AnchorUrl string
47
- AnchorHash []byte
48
- }
49
-
50
- func (RegistrationDrep) TableName() string {
51
- return "registration_drep"
52
- }
@@ -1,31 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- type Epoch struct {
18
- ID uint `gorm:"primarykey"`
19
- // NOTE: we would normally use this as the primary key, but GORM doesn't
20
- // like a primary key value of 0
21
- EpochId uint64 `gorm:"uniqueIndex"`
22
- StartSlot uint64
23
- Nonce []byte
24
- EraId uint
25
- SlotLength uint
26
- LengthInSlots uint
27
- }
28
-
29
- func (Epoch) TableName() string {
30
- return "epoch"
31
- }
@@ -1,46 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- // MigrateModels contains a list of model objects that should have DB migrations applied
18
- var MigrateModels = []any{
19
- &Account{},
20
- &AuthCommitteeHot{},
21
- &Deregistration{},
22
- &DeregistrationDrep{},
23
- &Drep{},
24
- &Epoch{},
25
- &Pool{},
26
- &PoolRegistration{},
27
- &PoolRegistrationOwner{},
28
- &PoolRegistrationRelay{},
29
- &PoolRetirement{},
30
- &PParams{},
31
- &PParamUpdate{},
32
- &Registration{},
33
- &RegistrationDrep{},
34
- &ResignCommitteeCold{},
35
- &StakeDelegation{},
36
- &StakeDeregistration{},
37
- &StakeRegistration{},
38
- &StakeRegistrationDelegation{},
39
- &StakeVoteDelegation{},
40
- &StakeVoteRegistrationDelegation{},
41
- &Tip{},
42
- &UpdateDrep{},
43
- &Utxo{},
44
- &VoteDelegation{},
45
- &VoteRegistrationDelegation{},
46
- }
@@ -1,97 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- import (
18
- "net"
19
-
20
- "github.com/blinklabs-io/dingo/database/types"
21
- )
22
-
23
- type Pool struct {
24
- ID uint `gorm:"primarykey"`
25
- PoolKeyHash []byte `gorm:"index"`
26
- VrfKeyHash []byte
27
- Pledge types.Uint64
28
- Cost types.Uint64
29
- Margin *types.Rat
30
- RewardAccount []byte
31
- Owners []PoolRegistrationOwner
32
- Relays []PoolRegistrationRelay
33
- Registration []PoolRegistration
34
- Retirement []PoolRetirement
35
- }
36
-
37
- func (p *Pool) TableName() string {
38
- return "pool"
39
- }
40
-
41
- type PoolRegistration struct {
42
- ID uint `gorm:"primarykey"`
43
- PoolID uint
44
- PoolKeyHash []byte `gorm:"index"`
45
- VrfKeyHash []byte
46
- Pledge types.Uint64
47
- Cost types.Uint64
48
- Margin *types.Rat
49
- RewardAccount []byte
50
- Owners []PoolRegistrationOwner
51
- Relays []PoolRegistrationRelay
52
- MetadataUrl string
53
- MetadataHash []byte
54
- AddedSlot uint64
55
- DepositAmount uint64
56
- }
57
-
58
- func (PoolRegistration) TableName() string {
59
- return "pool_registration"
60
- }
61
-
62
- type PoolRegistrationOwner struct {
63
- ID uint `gorm:"primarykey"`
64
- PoolRegistrationID uint
65
- PoolID uint
66
- KeyHash []byte
67
- }
68
-
69
- func (PoolRegistrationOwner) TableName() string {
70
- return "pool_registration_owner"
71
- }
72
-
73
- type PoolRegistrationRelay struct {
74
- ID uint `gorm:"primarykey"`
75
- PoolRegistrationID uint
76
- PoolID uint
77
- Port uint
78
- Ipv4 *net.IP
79
- Ipv6 *net.IP
80
- Hostname string
81
- }
82
-
83
- func (PoolRegistrationRelay) TableName() string {
84
- return "pool_registration_relay"
85
- }
86
-
87
- type PoolRetirement struct {
88
- ID uint `gorm:"primarykey"`
89
- PoolID uint
90
- PoolKeyHash []byte `gorm:"index"`
91
- Epoch uint64
92
- AddedSlot uint64
93
- }
94
-
95
- func (PoolRetirement) TableName() string {
96
- return "pool_retirement"
97
- }
@@ -1,27 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- type PParamUpdate struct {
18
- ID uint `gorm:"primarykey"`
19
- GenesisHash []byte
20
- Cbor []byte
21
- AddedSlot uint64
22
- Epoch uint64
23
- }
24
-
25
- func (PParamUpdate) TableName() string {
26
- return "pparam_update"
27
- }
@@ -1,27 +0,0 @@
1
- // Copyright 2025 Blink Labs Software
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- package models
16
-
17
- type PParams struct {
18
- ID uint `gorm:"primarykey"`
19
- Cbor []byte
20
- AddedSlot uint64
21
- Epoch uint64
22
- EraId uint
23
- }
24
-
25
- func (PParams) TableName() string {
26
- return "pparams"
27
- }