Skip to content

Commit e71915c

Browse files
committed
fix: revert demo
1 parent e05dec9 commit e71915c

File tree

1 file changed

+32
-13
lines changed

1 file changed

+32
-13
lines changed

demo/projection-typeorm.js

+32-13
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ const {
66
withTypeormTransaction,
77
typeormTransactionCommit,
88
TypeormStabilityWindowBuffer,
9+
BlockDataEntity,
910
BlockEntity,
10-
BlockEntity,
11-
CredentialEntity,
12-
TransactionEntity,
13-
storeUtxo,
11+
StakePoolEntity,
12+
PoolRegistrationEntity,
13+
PoolRetirementEntity,
14+
OutputEntity,
15+
AssetEntity,
16+
TokensEntity,
1417
storeBlock,
15-
storeCredentials,
16-
storeTransactions,
18+
storeAssets,
19+
storeUtxo,
20+
storeStakePools,
21+
storeStakePoolMetadataJob,
1722
isRecoverableTypeormError
1823
} = require('@cardano-sdk/projection-typeorm');
1924
const { OgmiosObservableCardanoNode } = require('@cardano-sdk/ogmios');
@@ -27,9 +32,14 @@ const logger = {
2732
};
2833

2934
const entities = [
35+
BlockDataEntity,
3036
BlockEntity,
31-
CredentialEntity,
32-
TransactionEntity,
37+
StakePoolEntity,
38+
PoolRegistrationEntity,
39+
PoolRetirementEntity,
40+
AssetEntity,
41+
TokensEntity,
42+
OutputEntity
3343
];
3444
const extensions = {
3545
pgBoss: true
@@ -91,17 +101,26 @@ Bootstrap.fromCardanoNode({
91101
logger
92102
})
93103
.pipe(
104+
Mappers.withCertificates(),
105+
Mappers.withStakePools(),
106+
Mappers.withMint(),
94107
Mappers.withUtxo(),
95-
Mappers.withAddresses(),
108+
// Single-tenant example
109+
// Mappers.filterProducedUtxoByAddresses({
110+
// addresses: [
111+
// 'addr_test1qpgn04xka0857kh6859za75tfvlrlu2lft0yc9z87598yjezw8yvpkv977yj5va20xmd9vw5fczfl3uu4expskz8adfqpydths'
112+
// ]
113+
// }),
96114
shareRetryBackoff(
97115
(evt$) =>
98116
evt$.pipe(
99117
withTypeormTransaction({ dataSource$, logger }, extensions),
100-
storeUtxo(),
101118
storeBlock(),
102-
storeCredentials(),
103-
storeTransactions(),
104-
// buffer.storeBlockData(),
119+
buffer.storeBlockData(),
120+
storeAssets(),
121+
storeUtxo(),
122+
storeStakePools(),
123+
storeStakePoolMetadataJob(),
105124
typeormTransactionCommit()
106125
),
107126
{ shouldRetry: isRecoverableTypeormError }

0 commit comments

Comments
 (0)