version: '3.0'
description: Joystream query-node manifest file for Giza
repository: https://github.com/Joystream/joystream
hydraVersion: "3"
dataSource:
  kind: substrate
  chain: joystream
entities:
  - generated/graphql-server/dist/src/modules/**/*.model.js
typegen:
  metadata:
    source: ../chain-metadata.json
  events:
    # storage
    - storage.StorageBucketCreated
    - storage.StorageBucketInvitationAccepted
    - storage.StorageBucketsUpdatedForBag
    - storage.DataObjectsUploaded
    - storage.StorageOperatorMetadataSet
    - storage.StorageBucketVoucherLimitsSet
    - storage.PendingDataObjectsAccepted
    - storage.StorageBucketInvitationCancelled
    - storage.StorageBucketOperatorInvited
    - storage.StorageBucketOperatorRemoved
    - storage.UploadingBlockStatusUpdated
    - storage.DataObjectPerMegabyteFeeUpdated
    - storage.StorageBucketsPerBagLimitUpdated
    - storage.StorageBucketsVoucherMaxLimitsUpdated
    - storage.DataObjectsMoved
    - storage.DataObjectsDeleted
    - storage.StorageBucketStatusUpdated
    - storage.UpdateBlacklist
    - storage.DynamicBagDeleted
    - storage.DynamicBagCreated
    - storage.VoucherChanged
    - storage.StorageBucketDeleted
    - storage.DistributionBucketFamilyCreated
    - storage.DistributionBucketFamilyDeleted
    - storage.DistributionBucketCreated
    - storage.DistributionBucketStatusUpdated
    - storage.DistributionBucketDeleted
    - storage.DistributionBucketsUpdatedForBag
    - storage.DistributionBucketsPerBagLimitUpdated
    - storage.DistributionBucketModeUpdated
    - storage.DistributionBucketOperatorInvited
    - storage.DistributionBucketInvitationCancelled
    - storage.DistributionBucketInvitationAccepted
    - storage.DistributionBucketMetadataSet
    - storage.DistributionBucketOperatorRemoved
    - storage.DistributionBucketFamilyMetadataSet
    # Not required:
    # - storage.NumberOfStorageBucketsInDynamicBagCreationPolicyUpdated
    # - storage.FamiliesInDynamicBagCreationPolicyUpdated

    # membership
    - members.MemberRegistered
    - members.MemberUpdatedAboutText
    - members.MemberUpdatedAvatar
    - members.MemberUpdatedHandle
    - members.MemberSetRootAccount
    - members.MemberSetControllerAccount

    # content directory
    - content.CuratorGroupCreated
    - content.CuratorGroupStatusSet
    - content.CuratorAdded
    - content.CuratorRemoved
    - content.ChannelCreated
    - content.ChannelUpdated
    - content.ChannelAssetsRemoved
    - content.ChannelCensorshipStatusUpdated
    - content.ChannelOwnershipTransferRequested
    - content.ChannelOwnershipTransferRequestWithdrawn
    - content.ChannelOwnershipTransferred
    - content.ChannelCategoryCreated
    - content.ChannelCategoryUpdated
    - content.ChannelCategoryDeleted
    - content.VideoCategoryCreated
    - content.VideoCategoryUpdated
    - content.VideoCategoryDeleted
    - content.VideoCreated
    - content.VideoUpdated
    - content.VideoDeleted
    - content.VideoCensorshipStatusUpdated
    - content.FeaturedVideosSet
    - content.ChannelDeleted

    # working groups (we're using "storage_working_group" as a reference module)
    - storage_working_group.WorkerStorageUpdated
    - storage_working_group.OpeningFilled
    - storage_working_group.TerminatedWorker
    - storage_working_group.WorkerExited
    - storage_working_group.TerminatedLeader
  calls:
    # members
    - members.buyMembership
    - members.addScreenedMember
    - members.changeMemberAboutText
    - members.changeMemberAvatar
    - members.changeMemberHandle
    - members.setRootAccount
    - members.setControllerAccount
    - members.updateMembership
  outDir: ./mappings/generated/types
  customTypes:
    lib: '@joystream/types/augment/all/types'
    typedefsLoc: '../types/augment/all/defs.json'
mappings:
  # js module that exports the handler functions
  mappingsModule: mappings/lib
  # additinal libraries the processor loads
  # typically it is a module with event and extrinsic types generated by hydra-typegen
  imports:
    - mappings/lib/generated/types
  eventHandlers:
    # membership
    - event: members.MemberRegistered
      handler: members_MemberRegistered
    - event: members.MemberUpdatedAboutText
      handler: members_MemberUpdatedAboutText
    - event: members.MemberUpdatedAvatar
      handler: members_MemberUpdatedAvatar
    - event: members.MemberUpdatedHandle
      handler: members_MemberUpdatedHandle
    - event: members.MemberSetRootAccount
      handler: members_MemberSetRootAccount
    - event: members.MemberSetControllerAccount
      handler: members_MemberSetControllerAccount

    # content directory
    - event: content.CuratorGroupCreated
      handler: content_CuratorGroupCreated
    - event: content.CuratorGroupStatusSet
      handler: content_CuratorGroupStatusSet
    - event: content.CuratorAdded
      handler: content_CuratorAdded
    - event: content.CuratorRemoved
      handler: content_CuratorRemoved
    - event: content.ChannelCreated
      handler: content_ChannelCreated
    - event: content.ChannelUpdated
      handler: content_ChannelUpdated
    - event: content.ChannelAssetsRemoved
      handler: content_ChannelAssetsRemoved
    - event: content.ChannelCensorshipStatusUpdated
      handler: content_ChannelCensorshipStatusUpdated
    # these events are defined in runtime but never emitted (at the time of writing)
    #- event: content.ChannelOwnershipTransferRequested
    #  handler: content_ChannelOwnershipTransferRequested
    #- event: content.ChannelOwnershipTransferRequestWithdrawn
    #  handler: content_ChannelOwnershipTransferRequestWithdrawn
    #- event: content.ChannelOwnershipTransferred
    #  handler: content_ChannelOwnershipTransferred
    - event: content.ChannelCategoryCreated
      handler: content_ChannelCategoryCreated
    - event: content.ChannelCategoryUpdated
      handler: content_ChannelCategoryUpdated
    - event: content.ChannelCategoryDeleted
      handler: content_ChannelCategoryDeleted
    - event: content.VideoCategoryCreated
      handler: content_VideoCategoryCreated
    - event: content.VideoCategoryUpdated
      handler: content_VideoCategoryUpdated
    - event: content.VideoCategoryDeleted
      handler: content_VideoCategoryDeleted
    - event: content.VideoCreated
      handler: content_VideoCreated
    - event: content.VideoUpdated
      handler: content_VideoUpdated
    - event: content.VideoDeleted
      handler: content_VideoDeleted
    - event: content.VideoCensorshipStatusUpdated
      handler: content_VideoCensorshipStatusUpdated
    - event: content.FeaturedVideosSet
      handler: content_FeaturedVideosSet
    - event: content.ChannelDeleted
      handler: content_ChannelDeleted

    # working groups
    ## storage - workers
    - event: storageWorkingGroup.WorkerStorageUpdated
      handler: workingGroup_WorkerStorageUpdated
    - event: storageWorkingGroup.OpeningFilled
      handler: workingGroup_OpeningFilled
    - event: storageWorkingGroup.TerminatedWorker
      handler: workingGroup_TerminatedWorker
    - event: storageWorkingGroup.WorkerExited
      handler: workingGroup_WorkerExited

    ## storage - leader
    - event: storageWorkingGroup.TerminatedLeader
      handler: workingGroup_TerminatedLeader

    ## gateway - workers
    - event: gatewayWorkingGroup.WorkerStorageUpdated
      handler: workingGroup_WorkerStorageUpdated
    - event: gatewayWorkingGroup.OpeningFilled
      handler: workingGroup_OpeningFilled
    - event: gatewayWorkingGroup.TerminatedWorker
      handler: workingGroup_TerminatedWorker
    - event: gatewayWorkingGroup.WorkerExited
      handler: workingGroup_WorkerExited

    ## gateway - leader
    - event: gatewayWorkingGroup.TerminatedLeader
      handler: workingGroup_TerminatedLeader

    # storage v2
    - event: storage.StorageBucketCreated
      handler: storage_StorageBucketCreated
    - event: storage.StorageBucketInvitationAccepted
      handler: storage_StorageBucketInvitationAccepted
    - event: storage.StorageBucketsUpdatedForBag
      handler: storage_StorageBucketsUpdatedForBag
    - event: storage.DataObjectsUploaded
      handler: storage_DataObjectsUploaded
    - event: storage.StorageOperatorMetadataSet
      handler: storage_StorageOperatorMetadataSet
    - event: storage.StorageBucketVoucherLimitsSet
      handler: storage_StorageBucketVoucherLimitsSet
    - event: storage.PendingDataObjectsAccepted
      handler: storage_PendingDataObjectsAccepted
    - event: storage.StorageBucketInvitationCancelled
      handler: storage_StorageBucketInvitationCancelled
    - event: storage.StorageBucketOperatorInvited
      handler: storage_StorageBucketOperatorInvited
    - event: storage.StorageBucketOperatorRemoved
      handler: storage_StorageBucketOperatorRemoved
    - event: storage.UploadingBlockStatusUpdated
      handler: storage_UploadingBlockStatusUpdated
    - event: storage.DataObjectPerMegabyteFeeUpdated
      handler: storage_DataObjectPerMegabyteFeeUpdated
    - event: storage.StorageBucketsPerBagLimitUpdated
      handler: storage_StorageBucketsPerBagLimitUpdated
    - event: storage.StorageBucketsVoucherMaxLimitsUpdated
      handler: storage_StorageBucketsVoucherMaxLimitsUpdated
    - event: storage.DataObjectsMoved
      handler: storage_DataObjectsMoved
    - event: storage.DataObjectsDeleted
      handler: storage_DataObjectsDeleted
    - event: storage.StorageBucketStatusUpdated
      handler: storage_StorageBucketStatusUpdated
    - event: storage.UpdateBlacklist
      handler: storage_UpdateBlacklist
    - event: storage.DynamicBagDeleted
      handler: storage_DynamicBagDeleted
    - event: storage.DynamicBagCreated
      handler: storage_DynamicBagCreated
    - event: storage.VoucherChanged
      handler: storage_VoucherChanged
    - event: storage.StorageBucketDeleted
      handler: storage_StorageBucketDeleted
    - event: storage.DistributionBucketFamilyCreated
      handler: storage_DistributionBucketFamilyCreated
    - event: storage.DistributionBucketFamilyDeleted
      handler: storage_DistributionBucketFamilyDeleted
    - event: storage.DistributionBucketCreated
      handler: storage_DistributionBucketCreated
    - event: storage.DistributionBucketStatusUpdated
      handler: storage_DistributionBucketStatusUpdated
    - event: storage.DistributionBucketDeleted
      handler: storage_DistributionBucketDeleted
    - event: storage.DistributionBucketsUpdatedForBag
      handler: storage_DistributionBucketsUpdatedForBag
    - event: storage.DistributionBucketsPerBagLimitUpdated
      handler: storage_DistributionBucketsPerBagLimitUpdated
    - event: storage.DistributionBucketModeUpdated
      handler: storage_DistributionBucketModeUpdated
    - event: storage.DistributionBucketOperatorInvited
      handler: storage_DistributionBucketOperatorInvited
    - event: storage.DistributionBucketInvitationCancelled
      handler: storage_DistributionBucketInvitationCancelled
    - event: storage.DistributionBucketInvitationAccepted
      handler: storage_DistributionBucketInvitationAccepted
    - event: storage.DistributionBucketMetadataSet
      handler: storage_DistributionBucketMetadataSet
    - event: storage.DistributionBucketOperatorRemoved
      handler: storage_DistributionBucketOperatorRemoved
    - event: storage.DistributionBucketFamilyMetadataSet
      handler: storage_DistributionBucketFamilyMetadataSet
  extrinsicHandlers:
    # infer defaults here
    #- extrinsic: Balances.Transfer
    #- extrinsic: Sudo.batchCall
    #  handler: handleSudoCall(DatabaseManager,SubstrateEvent)
  preBlockHooks:
    - handler: bootstrapData
      filter:
        height: "[0,0]" # will be executed only at genesis
  postBlockHooks:
