UI API
Job type
is all jobs with same name.job type
may have its custom configuration taken from privatix core config
.TryLimit
- Maximum retry countTryPeriod
- Delay between retriesFirstStartDelay
- Delay on first startDuplicated
- Allow duplicate of job type per objectID
- uuidType
- job typeStatus
- Job status
RelatedID
- database id of related objectCreatedAt
- time when job was created. Organize sequenceNotBefore
- delaying start of jobCreatedBy
- who produced this jobTryCount
- number of times was job executedData
- additional data that can be processed during job executionRelatedType
and RelatedID
. It may also have some data that is stored in Data
.NotBefore
. They can be retried several times when TryCount
didn't reached TryLimit
of job type configuration
.core config
.queue.Add()
will check, if desired job can be created, create it or return an error.Job queue workers
- are threads, that periodically scans job queue, retrieves jobs that should be processed and executes them. Workers can run in parallel, can retrieve error codes from underlying functions. Number of workers are defined in dappctrl.config.json
. Jobs that relates to same object are processed by single worker, preventing race.Job queue
gets jobs from database table jobs
. Jobs related to single object (e.g. particular offering) processed sequentially, but jobs for different objects (e.g. two different offerings) maybe processed in parallel. Sequence is defined using sorting by CreatedAt
field.AgentAfterChannelCreate
- registers client and creates AgentPreEndpointMsgCreate
job.LogChannelCreated
or LogOfferingPopedUp
AgentAfterChannelTopUp
- updates deposit of a channel in Agents database.LogChannelToppedUp
AgentAfterUncooperativeCloseRequest
- sets channel's status to challenge period.LogChannelCloseRequested
AgentAfterUncooperativeClose
- marks channel closed uncooperatively.LogUnCooperativeChannelClose
AgentAfterCooperativeClose
- marks channel as closed cooperatively.LogUnCooperativeChannelClose
AgentPreServiceSuspend
- marks service as suspended.changeChannelStatus
VerifyBillingLags()
AgentPreServiceUnsuspend
- marks service as active.changeChannelStatus
VerifySuspendedChannelsAndTryToUnsuspend()
AgentPreServiceTerminate
- terminates the service.changeChannelStatus
VerifyUnitsBasedChannels()
VerifyChannelsForInactivity()
VerifySuspendedChannelsAndTryToTerminate()
AgentPreEndpointMsgCreate
- prepares endpoint message to be sent to client.AgentAfterChannelCreate
AgentPreOfferingMsgBCPublish
- publishes offering to blockchain.ChangeOfferingStatus
AgentAfterOfferingMsgBCPublish
- updates offering status and account balance.LogOfferingCreated
AgentPreOfferingPopUp
- pop ups an offering.ChangeOfferingStatus
AgentAfterOfferingPopUp
- updates the block number when the offering was popped up.LogOfferingPopedUp
AgentPreOfferingDelete
- calls PSC remove an offering.ChangeOfferingStatus
AgentAfterOfferingDelete
- set offering status to 'remove'LogOfferingDeleted
ClientAfterOfferingDelete
- sets offer status to remove
LogOfferingDeleted
ClientAfterOfferingPopUp
- updates offering in DB or retrieves from Agent and stores in DB.LogOfferingPopedUp
ClientPreChannelCreate
- triggers a channel creation.acceptOffering
ClientAfterChannelCreate
- activates channel and triggers access message retrievalLogChannelCreated
ClientEndpointCreate
- decodes endpoint message, saves it in the DB and triggers product configuration.ClientAfterChannelCreate
ClientAfterUncooperativeClose
- changes channel status to closed uncooperatively.LogUnCooperativeChannelClose
ClientAfterCooperativeClose
- changes channel status to closed cooperatively and launches termination of service.LogCooperativeChannelClose
ClientPreUncooperativeClose
- terminates service.ClientAfterUncooperativeCloseRequest
ClientPreChannelTopUp
- checks client balance and creates transaction to increase channel deposit.TopUpChannel
ClientAfterChannelTopUp
- updates deposit of a channel in local DB.LogChannelToppedUp
ClientPreUncooperativeCloseRequest
- requests uncooperative close of channel. Challenge period started.changeChannelStatus
ClientAfterUncooperativeCloseRequest
- waits for channel to close uncooperatively, starts the service termination process.LogUnCooperativeChannelClose
ClientPreServiceTerminate
- terminates service.ClientAfterCooperativeClose
postPayload()
processChannel()
ChangeChannelStatus
ClientPreServiceSuspend
- suspends service.ChangeChannelStatus
ClientPreServiceUnsuspend
- activates service.ChangeChannelStatus
ClientAfterOfferingMsgBCPublish
- creates offering.LogOfferingCreated
ClientCompleteServiceTransition
- complete service state transition. Service status changes.PreAccountAddBalanceApprove
- approve balance if amount exists.transferTokens
PreAccountAddBalance
- adds balance to PSC.Approval
AfterAccountAddBalance
- updates PSC and PTC balance of an account.Transfer
PreAccountReturnBalance
- returns from PSC to PTC.transferTokens
AfterAccountReturnBalance
- updates PSC and PTC balance of an account.Transfer
AccountUpdateBalances
- updates PTC, PSC and ETH account balance values.DecrementCurrentSupply
- finds offering and decrements its current supply for Client.LogChannelCreated
IncrementCurrentSupply
- finds offering and increments its current supply for Client.