@audius/sdk 1.0.36 → 1.0.37

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.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@audius/sdk",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "audius": {
5
- "releaseSHA": "f5d39ff9c22d1fe9b5ca9c14261a1690575af34d"
5
+ "releaseSHA": "dd0ddae94286c577c8a34ada50f2f79f613b55d2"
6
6
  },
7
7
  "description": "",
8
8
  "main": "dist/index.cjs.js",
@@ -131,8 +131,7 @@ export class Account extends Base {
131
131
  handleUserBankOutcomes = (_outcome?: string, _errorCodes?: {}) => {},
132
132
  userBankOutcomes: Partial<UserBankOutcomes> = {},
133
133
  feePayerOverride: Nullable<string> = null,
134
- generateRecoveryLink = true,
135
- useEntityManager = false
134
+ generateRecoveryLink = true
136
135
  ) {
137
136
  const phases = {
138
137
  ADD_REPLICA_SET: 'ADD_REPLICA_SET',
@@ -200,35 +199,15 @@ export class Account extends Base {
200
199
  })()
201
200
  }
202
201
  // Add user to chain
203
- if (!useEntityManager) {
204
- phase = phases.ADD_USER
205
- const response = await this.User.addUser(metadata)
206
- userId = response.userId
207
- blockHash = response.blockHash
208
- blockNumber = response.blockNumber
209
-
210
- // Assign replica set to user, updates creator_node_endpoint on chain, and then update metadata object on content node + chain (in this order)
211
- phase = phases.ADD_REPLICA_SET
212
- metadata = (await this.User.assignReplicaSet({ userId }))!
213
- // Upload profile pic and cover photo to primary Content Node and sync across secondaries
214
- phase = phases.UPLOAD_PROFILE_IMAGES
215
- await this.User.uploadProfileImages(
216
- profilePictureFile!,
217
- coverPhotoFile!,
218
- metadata,
219
- useEntityManager
220
- )
221
- } else {
222
- const newMetadata = await this.User.createEntityManagerUser({
223
- metadata
224
- })
225
- await this.User.uploadProfileImages(
226
- profilePictureFile!,
227
- coverPhotoFile!,
228
- newMetadata,
229
- useEntityManager
230
- )
231
- }
202
+ const newMetadata = await this.User.createEntityManagerUser({
203
+ metadata
204
+ })
205
+
206
+ await this.User.uploadProfileImages(
207
+ profilePictureFile!,
208
+ coverPhotoFile!,
209
+ newMetadata
210
+ )
232
211
  } catch (e: any) {
233
212
  return {
234
213
  error: e.message,
package/src/api/Track.ts CHANGED
@@ -396,8 +396,7 @@ export class Track extends Base {
396
396
  trackFile: File,
397
397
  coverArtFile: File,
398
398
  metadata: TrackMetadata,
399
- onProgress: () => void,
400
- useEntityManager: boolean
399
+ onProgress: () => void
401
400
  ) {
402
401
  this.REQUIRES(Services.CREATOR_NODE)
403
402
  this.FILE_IS_VALID(trackFile)
@@ -461,36 +460,22 @@ export class Track extends Base {
461
460
  phase = phases.ADDING_TRACK
462
461
 
463
462
  // Write metadata to chain
464
- let txReceipt: TransactionReceipt
465
- let trackId: number
466
- if (useEntityManager) {
467
- trackId = await this._generateTrackId()
468
- const response = await this.contracts.EntityManagerClient!.manageEntity(
469
- ownerId,
470
- EntityManagerClient.EntityType.TRACK,
471
- trackId,
472
- EntityManagerClient.Action.CREATE,
473
- metadataMultihash
474
- )
475
- txReceipt = response.txReceipt
476
- } else {
477
- const multihashDecoded = Utils.decodeMultihash(metadataMultihash)
478
- const response = await this.contracts.TrackFactoryClient.addTrack(
479
- ownerId,
480
- multihashDecoded.digest,
481
- multihashDecoded.hashFn,
482
- multihashDecoded.size
483
- )
484
- txReceipt = response.txReceipt
485
- trackId = response.trackId
486
- }
463
+ const trackId = await this._generateTrackId()
464
+ const response = await this.contracts.EntityManagerClient!.manageEntity(
465
+ ownerId,
466
+ EntityManagerClient.EntityType.TRACK,
467
+ trackId,
468
+ EntityManagerClient.Action.CREATE,
469
+ metadataMultihash
470
+ )
471
+ const txReceipt = response.txReceipt
487
472
 
488
473
  phase = phases.ASSOCIATING_TRACK
489
474
  // Associate the track id with the file metadata and block number
490
475
  await this.creatorNode.associateTrack(
491
476
  trackId,
492
477
  metadataFileUUID,
493
- txReceipt!.blockNumber,
478
+ txReceipt.blockNumber,
494
479
  transcodedTrackUUID
495
480
  )
496
481
  return {
@@ -577,10 +562,7 @@ export class Track extends Base {
577
562
  * Adds tracks to chain for this user
578
563
  * Associates tracks with user on creatorNode
579
564
  */
580
- async addTracksToChainAndCnode(
581
- trackMultihashAndUUIDList: ChainInfo[],
582
- useEntityManager: boolean
583
- ) {
565
+ async addTracksToChainAndCnode(trackMultihashAndUUIDList: ChainInfo[]) {
584
566
  this.REQUIRES(Services.CREATOR_NODE)
585
567
  const ownerId = this.userStateManager.getCurrentUserId()
586
568
  if (!ownerId) {
@@ -601,30 +583,16 @@ export class Track extends Base {
601
583
  trackInfo
602
584
 
603
585
  // Write metadata to chain
604
- let txReceipt: TransactionReceipt
605
- let trackId: number
606
- if (useEntityManager && this.contracts.EntityManagerClient) {
607
- trackId = await this._generateTrackId()
608
- const response =
609
- await this.contracts.EntityManagerClient.manageEntity(
610
- ownerId,
611
- EntityManagerClient.EntityType.TRACK,
612
- trackId,
613
- EntityManagerClient.Action.CREATE,
614
- metadataMultihash
615
- )
616
- txReceipt = response.txReceipt
617
- } else {
618
- const multihashDecoded = Utils.decodeMultihash(metadataMultihash)
619
- const response = await this.contracts.TrackFactoryClient.addTrack(
586
+ const trackId = await this._generateTrackId()
587
+ const response =
588
+ await this.contracts.EntityManagerClient!.manageEntity(
620
589
  ownerId,
621
- multihashDecoded.digest,
622
- multihashDecoded.hashFn,
623
- multihashDecoded.size
590
+ EntityManagerClient.EntityType.TRACK,
591
+ trackId,
592
+ EntityManagerClient.Action.CREATE,
593
+ metadataMultihash
624
594
  )
625
- txReceipt = response.txReceipt
626
- trackId = response.trackId
627
- }
595
+ const txReceipt = response.txReceipt
628
596
  addedToChain[i] = {
629
597
  trackId,
630
598
  metadataFileUUID,
@@ -680,7 +648,7 @@ export class Track extends Base {
680
648
  * such as track content, cover art are already on creator node.
681
649
  * @param metadata json of the track metadata with all fields, missing fields will error
682
650
  */
683
- async updateTrack(metadata: TrackMetadata, useEntityManager: boolean) {
651
+ async updateTrack(metadata: TrackMetadata) {
684
652
  this.REQUIRES(Services.CREATOR_NODE)
685
653
  this.IS_OBJECT(metadata)
686
654
 
@@ -696,28 +664,15 @@ export class Track extends Base {
696
664
  const { metadataMultihash, metadataFileUUID } =
697
665
  await this.creatorNode.uploadTrackMetadata(metadata)
698
666
  // Write the new metadata to chain
699
- let txReceipt: TransactionReceipt
700
667
  const trackId: number = metadata.track_id
701
- if (useEntityManager) {
702
- const response = await this.contracts.EntityManagerClient!.manageEntity(
703
- ownerId,
704
- EntityManagerClient.EntityType.TRACK,
705
- trackId,
706
- EntityManagerClient.Action.UPDATE,
707
- metadataMultihash
708
- )
709
- txReceipt = response.txReceipt
710
- } else {
711
- const multihashDecoded = Utils.decodeMultihash(metadataMultihash)
712
- const response = await this.contracts.TrackFactoryClient.updateTrack(
713
- trackId,
714
- ownerId,
715
- multihashDecoded.digest,
716
- multihashDecoded.hashFn,
717
- multihashDecoded.size
718
- )
719
- txReceipt = response.txReceipt
720
- }
668
+ const response = await this.contracts.EntityManagerClient!.manageEntity(
669
+ ownerId,
670
+ EntityManagerClient.EntityType.TRACK,
671
+ trackId,
672
+ EntityManagerClient.Action.UPDATE,
673
+ metadataMultihash
674
+ )
675
+ const txReceipt = response.txReceipt
721
676
  // Re-associate the track id with the new metadata
722
677
  await this.creatorNode.associateTrack(
723
678
  trackId,
@@ -805,22 +760,18 @@ export class Track extends Base {
805
760
  * Marks a tracks as deleted
806
761
  * @param trackId
807
762
  */
808
- async deleteTrack(trackId: number, useEntityManager: boolean) {
809
- if (useEntityManager) {
810
- const ownerId = this.userStateManager.getCurrentUserId()
763
+ async deleteTrack(trackId: number) {
764
+ const ownerId = this.userStateManager.getCurrentUserId()
811
765
 
812
- if (!ownerId) throw new Error('No users loaded for this wallet')
766
+ if (!ownerId) throw new Error('No users loaded for this wallet')
813
767
 
814
- return await this.contracts.EntityManagerClient!.manageEntity(
815
- ownerId,
816
- EntityManagerClient.EntityType.TRACK,
817
- trackId,
818
- EntityManagerClient.Action.DELETE,
819
- ''
820
- )
821
- } else {
822
- return await this.contracts.TrackFactoryClient.deleteTrack(trackId)
823
- }
768
+ return await this.contracts.EntityManagerClient!.manageEntity(
769
+ ownerId,
770
+ EntityManagerClient.EntityType.TRACK,
771
+ trackId,
772
+ EntityManagerClient.Action.DELETE,
773
+ ''
774
+ )
824
775
  }
825
776
 
826
777
  /* ------- PRIVATE ------- */
package/src/api/Users.ts CHANGED
@@ -422,8 +422,7 @@ export class Users extends Base {
422
422
  async uploadProfileImages(
423
423
  profilePictureFile: File,
424
424
  coverPhotoFile: File,
425
- metadata: UserMetadata,
426
- useEntityManager: boolean
425
+ metadata: UserMetadata
427
426
  ) {
428
427
  let didMetadataUpdate = false
429
428
  if (profilePictureFile) {
@@ -440,8 +439,7 @@ export class Users extends Base {
440
439
  if (didMetadataUpdate) {
441
440
  await this.updateAndUploadMetadata({
442
441
  newMetadata: metadata,
443
- userId: metadata.user_id,
444
- useEntityManager
442
+ userId: metadata.user_id
445
443
  })
446
444
  }
447
445
 
@@ -541,8 +539,7 @@ export class Users extends Base {
541
539
  phase = phases.UPLOAD_METADATA_AND_UPDATE_ON_CHAIN
542
540
  await this.updateAndUploadMetadata({
543
541
  newMetadata,
544
- userId,
545
- useEntityManager: true
542
+ userId
546
543
  })
547
544
  console.log(
548
545
  `${logPrefix} [phase: ${phase}] updateAndUploadMetadata() completed in ${
@@ -667,17 +664,13 @@ export class Users extends Base {
667
664
  /**
668
665
  * Updates a creator (updates their data on the creator node)
669
666
  */
670
- async updateCreator(
671
- userId: number,
672
- metadata: UserMetadata,
673
- useEntityManager?: boolean
674
- ) {
667
+ async updateCreator(userId: number, metadata: UserMetadata) {
675
668
  this.REQUIRES(Services.CREATOR_NODE, Services.DISCOVERY_PROVIDER)
676
669
  this.IS_OBJECT(metadata)
677
670
  const newMetadata = this.cleanUserMetadata(metadata)
678
671
  this._validateUserMetadata(newMetadata)
672
+ const logPrefix = `[User:updateCreator()] [userId: ${userId}]`
679
673
 
680
- const logPrefix = `[User:updateCreator()] [userId: ${userId}] [useEntityManager: ${useEntityManager}]`
681
674
  const fnStartMs = Date.now()
682
675
  let startMs = fnStartMs
683
676
 
@@ -728,43 +721,16 @@ export class Users extends Base {
728
721
  updateEndpointTxBlockNumber
729
722
  )
730
723
 
731
- let txReceipt
732
- let latestBlockHash
733
- let latestBlockNumber
734
-
735
- if (!useEntityManager) {
736
- // Write metadata multihash to chain
737
-
738
- const updatedMultihashDecoded = Utils.decodeMultihash(metadataMultihash)
739
- const updateMultiHashResp =
740
- await this.contracts.UserFactoryClient.updateMultihash(
741
- userId,
742
- updatedMultihashDecoded.digest
743
- )
744
- txReceipt = updateMultiHashResp.txReceipt
745
-
746
- // Write remaining metadata fields to chain
747
- const updateUserResp = await this._updateUserOperations(
748
- newMetadata,
749
- oldMetadata,
750
- userId
751
- )
752
- latestBlockHash = updateUserResp.latestBlockHash
753
- latestBlockNumber = Math.max(
754
- txReceipt.blockNumber,
755
- updateUserResp.latestBlockNumber
756
- )
757
- } else {
758
- const response = await this.contracts.EntityManagerClient!.manageEntity(
759
- userId,
760
- EntityManagerClient.EntityType.USER,
761
- userId,
762
- EntityManagerClient.Action.UPDATE,
763
- metadataMultihash
764
- )
765
- txReceipt = response.txReceipt
766
- latestBlockNumber = txReceipt.blockNumber
767
- }
724
+ const response = await this.contracts.EntityManagerClient!.manageEntity(
725
+ userId,
726
+ EntityManagerClient.EntityType.USER,
727
+ userId,
728
+ EntityManagerClient.Action.UPDATE,
729
+ metadataMultihash
730
+ )
731
+ const txReceipt = response.txReceipt
732
+ const latestBlockNumber = txReceipt.blockNumber
733
+ const latestBlockHash = txReceipt.blockHash
768
734
 
769
735
  // Write to CN to associate blockchain user id with updated metadata and block number
770
736
  await this.creatorNode.associateCreator(
@@ -776,11 +742,6 @@ export class Users extends Base {
776
742
  // Update libs instance with new user metadata object
777
743
  this.userStateManager.setCurrentUser({ ...oldMetadata, ...newMetadata })
778
744
 
779
- if (!latestBlockHash || !latestBlockNumber) {
780
- latestBlockHash = txReceipt.blockHash
781
- latestBlockNumber = txReceipt.blockNumber
782
- }
783
-
784
745
  return {
785
746
  blockHash: latestBlockHash,
786
747
  blockNumber: latestBlockNumber,
@@ -791,28 +752,15 @@ export class Users extends Base {
791
752
  /**
792
753
  * Updates a user on whether they are verified on Audius
793
754
  */
794
- async updateIsVerified(
795
- userId: number,
796
- isVerified: boolean,
797
- privateKey: string,
798
- useEntityManager?: boolean
799
- ) {
800
- if (useEntityManager) {
801
- return await this.contracts.EntityManagerClient!.getManageEntityParams(
802
- userId,
803
- EntityManagerClient.EntityType.USER,
804
- userId,
805
- EntityManagerClient.Action.VERIFY,
806
- '',
807
- privateKey
808
- )
809
- } else {
810
- return await this.contracts.UserFactoryClient.updateIsVerified(
811
- userId,
812
- isVerified,
813
- privateKey
814
- )
815
- }
755
+ async updateIsVerified(userId: number, privateKey: string) {
756
+ return await this.contracts.EntityManagerClient!.getManageEntityParams(
757
+ userId,
758
+ EntityManagerClient.EntityType.USER,
759
+ userId,
760
+ EntityManagerClient.Action.VERIFY,
761
+ '',
762
+ privateKey
763
+ )
816
764
  }
817
765
 
818
766
  /**
@@ -893,12 +841,10 @@ export class Users extends Base {
893
841
  */
894
842
  async updateAndUploadMetadata({
895
843
  newMetadata,
896
- userId,
897
- useEntityManager
844
+ userId
898
845
  }: {
899
846
  newMetadata: UserMetadata
900
847
  userId: number
901
- useEntityManager?: boolean
902
848
  }) {
903
849
  this.REQUIRES(Services.CREATOR_NODE, Services.DISCOVERY_PROVIDER)
904
850
  this.IS_OBJECT(newMetadata)
@@ -940,34 +886,20 @@ export class Users extends Base {
940
886
  Date.now() - startMs
941
887
  }ms`
942
888
  )
943
- if (useEntityManager) {
944
- startMs = Date.now()
945
- await this.waitForReplicaSetDiscoveryIndexing(
946
- userId,
947
- replicaSetSPIDs,
948
- txReceipt.blockNumber
949
- )
950
- // @ts-expect-error
951
- newMetadata.primary_id = replicaSetSPIDs[0]
952
- newMetadata.secondary_ids = replicaSetSPIDs.slice(1)
953
- console.log(
954
- `${logPrefix} [phase: ${phase}] waitForReplicaSetDiscoveryIndexing() completed in ${
955
- Date.now() - startMs
956
- }ms`
957
- )
958
- } else {
959
- startMs = Date.now()
960
-
961
- await this._waitForURSMCreatorNodeEndpointIndexing(
962
- userId,
963
- replicaSetSPIDs
964
- )
965
- console.log(
966
- `${logPrefix} [phase: ${phase}] _waitForURSMCreatorNodeEndpointIndexing() completed in ${
967
- Date.now() - startMs
968
- }ms`
969
- )
970
- }
889
+ startMs = Date.now()
890
+ await this.waitForReplicaSetDiscoveryIndexing(
891
+ userId,
892
+ replicaSetSPIDs,
893
+ txReceipt.blockNumber
894
+ )
895
+ // @ts-expect-error
896
+ newMetadata.primary_id = replicaSetSPIDs[0]
897
+ newMetadata.secondary_ids = replicaSetSPIDs.slice(1)
898
+ console.log(
899
+ `${logPrefix} [phase: ${phase}] waitForReplicaSetDiscoveryIndexing() completed in ${
900
+ Date.now() - startMs
901
+ }ms`
902
+ )
971
903
  }
972
904
 
973
905
  // Upload new metadata object to CN
@@ -984,47 +916,15 @@ export class Users extends Base {
984
916
 
985
917
  // Write metadata multihash to chain
986
918
  phase = phases.UPDATE_METADATA_ON_CHAIN
987
- let txReceipt
988
- let blockNumber
989
- if (useEntityManager) {
990
- const response = await this.contracts.EntityManagerClient!.manageEntity(
991
- userId,
992
- EntityManagerClient.EntityType.USER,
993
- userId,
994
- EntityManagerClient.Action.UPDATE,
995
- metadataMultihash
996
- )
997
- txReceipt = response.txReceipt
998
- blockNumber = txReceipt.blockNumber
999
- } else {
1000
- const updatedMultihashDecoded = Utils.decodeMultihash(metadataMultihash)
1001
- const res = await this.contracts.UserFactoryClient.updateMultihash(
1002
- userId,
1003
- updatedMultihashDecoded.digest
1004
- )
1005
- txReceipt = res.txReceipt
1006
- console.log(
1007
- `${logPrefix} [phase: ${phase}] UserFactoryClient.updateMultihash() completed in ${
1008
- Date.now() - startMs
1009
- }ms`
1010
- )
1011
- startMs = Date.now()
1012
-
1013
- // Write remaining metadata fields to chain
1014
- phase = phases.UPDATE_USER_ON_CHAIN_OPS
1015
- const { latestBlockNumber } = await this._updateUserOperations(
1016
- newMetadata,
1017
- oldMetadata,
1018
- userId,
1019
- ['creator_node_endpoint']
1020
- )
1021
- console.log(
1022
- `${logPrefix} [phase: ${phase}] _updateUserOperations() completed in ${
1023
- Date.now() - startMs
1024
- }ms`
1025
- )
1026
- blockNumber = Math.max(txReceipt.blockNumber, latestBlockNumber)
1027
- }
919
+ const response = await this.contracts.EntityManagerClient!.manageEntity(
920
+ userId,
921
+ EntityManagerClient.EntityType.USER,
922
+ userId,
923
+ EntityManagerClient.Action.UPDATE,
924
+ metadataMultihash
925
+ )
926
+ const txReceipt = response.txReceipt
927
+ const blockNumber = txReceipt.blockNumber
1028
928
 
1029
929
  startMs = Date.now()
1030
930
 
@@ -1366,65 +1266,47 @@ export class Users extends Base {
1366
1266
  this._retrieveSpIDFromEndpoint(secondaries[0]!),
1367
1267
  this._retrieveSpIDFromEndpoint(secondaries[1]!)
1368
1268
  ])
1369
- let txReceipt
1370
1269
  const currentUser = this.userStateManager.getCurrentUser()
1371
1270
  if (!currentUser) throw new Error('Current user missing')
1372
1271
 
1373
1272
  // First try to update with URSM
1374
1273
  // Fallback to EntityManager when relay errors
1375
- let updateEndpointTxBlockNumber
1376
- let replicaSetSPIDs
1377
- try {
1378
- txReceipt =
1379
- await this.contracts.UserReplicaSetManagerClient?.updateReplicaSet(
1380
- userId,
1381
- primarySpID,
1382
- [secondary1SpID, secondary2SpID]
1383
- )
1384
- replicaSetSPIDs = [primarySpID, secondary1SpID, secondary2SpID]
1385
- updateEndpointTxBlockNumber = txReceipt?.blockNumber
1274
+ const currentPrimaryEndpoint = CreatorNode.getPrimary(
1275
+ currentUser.creator_node_endpoint
1276
+ )
1277
+ const currentSecondaries = CreatorNode.getSecondaries(
1278
+ currentUser.creator_node_endpoint
1279
+ )
1386
1280
 
1387
- await this._waitForURSMCreatorNodeEndpointIndexing(
1388
- userId,
1389
- replicaSetSPIDs
1390
- )
1391
- } catch {
1392
- const currentPrimaryEndpoint = CreatorNode.getPrimary(
1393
- currentUser.creator_node_endpoint
1394
- )
1395
- const currentSecondaries = CreatorNode.getSecondaries(
1396
- currentUser.creator_node_endpoint
1281
+ if (currentSecondaries.length < 2) {
1282
+ throw new Error(
1283
+ `Invalid number of secondaries found - received ${currentSecondaries}`
1397
1284
  )
1285
+ }
1398
1286
 
1399
- if (currentSecondaries.length < 2) {
1400
- throw new Error(
1401
- `Invalid number of secondaries found - received ${currentSecondaries}`
1402
- )
1403
- }
1287
+ const [oldPrimary, oldSecondary1SpID, oldSecondary2SpID] =
1288
+ await Promise.all([
1289
+ this._retrieveSpIDFromEndpoint(currentPrimaryEndpoint!),
1290
+ this._retrieveSpIDFromEndpoint(currentSecondaries[0]!),
1291
+ this._retrieveSpIDFromEndpoint(currentSecondaries[1]!)
1292
+ ])
1404
1293
 
1405
- const [oldPrimary, oldSecondary1SpID, oldSecondary2SpID] =
1406
- await Promise.all([
1407
- this._retrieveSpIDFromEndpoint(currentPrimaryEndpoint!),
1408
- this._retrieveSpIDFromEndpoint(currentSecondaries[0]!),
1409
- this._retrieveSpIDFromEndpoint(currentSecondaries[1]!)
1410
- ])
1294
+ const txReceipt = await this.updateEntityManagerReplicaSet({
1295
+ userId,
1296
+ primary: primarySpID,
1297
+ secondaries: [secondary1SpID, secondary2SpID],
1298
+ oldPrimary: oldPrimary,
1299
+ oldSecondaries: [oldSecondary1SpID, oldSecondary2SpID]
1300
+ })
1301
+ const replicaSetSPIDs = [primarySpID, secondary1SpID, secondary2SpID]
1302
+ const updateEndpointTxBlockNumber = txReceipt?.blockNumber
1411
1303
 
1412
- txReceipt = await this.updateEntityManagerReplicaSet({
1413
- userId,
1414
- primary: primarySpID,
1415
- secondaries: [secondary1SpID, secondary2SpID],
1416
- oldPrimary: oldPrimary,
1417
- oldSecondaries: [oldSecondary1SpID, oldSecondary2SpID]
1418
- })
1419
- replicaSetSPIDs = [primarySpID, secondary1SpID, secondary2SpID]
1420
- updateEndpointTxBlockNumber = txReceipt?.blockNumber
1304
+ await this.waitForReplicaSetDiscoveryIndexing(
1305
+ userId,
1306
+ replicaSetSPIDs,
1307
+ updateEndpointTxBlockNumber
1308
+ )
1421
1309
 
1422
- await this.waitForReplicaSetDiscoveryIndexing(
1423
- userId,
1424
- replicaSetSPIDs,
1425
- updateEndpointTxBlockNumber
1426
- )
1427
- }
1428
1310
  if (!txReceipt) {
1429
1311
  throw new Error('Unable to update replica set on chain')
1430
1312
  }
@@ -97,11 +97,7 @@ export const rolloverNodes = async (
97
97
  console.debug(
98
98
  `Sanity Check - rolloverNodes - new nodes ${newMetadata.creator_node_endpoint}`
99
99
  )
100
- await libs.User?.updateCreator(
101
- user.user_id,
102
- newMetadata,
103
- true /* useEntityManager */
104
- )
100
+ await libs.User?.updateCreator(user.user_id, newMetadata)
105
101
  } catch (e) {
106
102
  console.error(e)
107
103
  }