Begin build phase
This commit is contained in:
@@ -7,6 +7,7 @@ const path = require('bare-path')
|
||||
const process = require('bare-process')
|
||||
const b4a = require('b4a')
|
||||
const Protomux = require('protomux')
|
||||
const HyperP2PVectorClock = require('../../core-infrastructure/hyper-p2p-vector-clock/index.js')
|
||||
|
||||
const TASK_PROTOCOL = 'hyper-p2p-task-orchestrator/v1'
|
||||
const DEFAULT_DEADLINE_MS = 300000 // 5 min
|
||||
@@ -59,6 +60,12 @@ class HyperP2PTaskOrchestrator extends EventEmitter {
|
||||
p2pGossips: 0
|
||||
}
|
||||
this._localClock = 0
|
||||
this.clock = opts.clock || new HyperP2PVectorClock(this.publicKeyHex)
|
||||
}
|
||||
|
||||
_tickClock (event) {
|
||||
this.clock.tick(this.publicKeyHex)
|
||||
return { event, vector: this.clock.toJSON() }
|
||||
}
|
||||
|
||||
_nextId () {
|
||||
@@ -219,6 +226,7 @@ class HyperP2PTaskOrchestrator extends EventEmitter {
|
||||
|
||||
task.ts = Date.now()
|
||||
task.signature = this._signTask(task)
|
||||
task.causal = this._tickClock('submit')
|
||||
|
||||
// Verify self
|
||||
if (!this._verifyTask(task, task.signature)) {
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
"hyper-p2p-vector-clock": "file:../../core-infrastructure/hyper-p2p-vector-clock"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"hyperbee": "^2.0.0",
|
||||
"hyperswarm": "^4.0.0",
|
||||
"hyper-p2p-capabilities": "file:../../core-infrastructure/hyper-p2p-capabilities",
|
||||
"bare": ">=1.0.0"
|
||||
|
||||
Reference in New Issue
Block a user