Property | Type | Description | |
---|---|---|---|
$channelCache | Channel[] | ||
$continuumLogger | Log | ||
$db | |||
$hail | |||
$supplierCache | Supplier[] |
Method | Description | |
---|---|---|
__construct ( |
Keyggdrasil constructor. | |
doUpdate ( ) | Launch the update process. |
Method | Description | |
---|---|---|
checkWithPeer ( Peer $peer, string $expectedRoot ) : boolean | Does this peer notary see the same Merkle root? | |
fetchTreeUpdates ( Channel $chan, string $url, string $root ) : array | Fetch all of the updates from the remote server. | |
getLogData ( TreeUpdate $up ) : array | Given a TreeUpdate, return an array formatted for logging. | |
getMerkleTree ( Channel $chan ) : MerkleTree | Get the tree of existing Merkle roots. | |
insertKey ( Channel $chan, TreeUpdate $update ) | We're storing a new public key for this supplier. | |
parseTreeUpdateResponse ( Channel $chan, array $response ) : array | Interpret the TreeUpdate objects from the API response. OR verify the signature of the "no updates" message to prevent a DoS. | |
processTreeUpdates ( Channel $chan, variadic |
Insert/delete entries in supplier_keys, while updating the database. | |
revokeKey ( Channel $chan, TreeUpdate $update ) : void | We're storing a new public key for this supplier. | |
updateChannel ( Channel $chan ) | Update a particular channel. | |
updatePackageQueue ( TreeUpdate $update, integer $treeUpdateID ) | We're storing metadata about a package in the database. | |
updatesToNodes ( array $updates ) : array | Get a bunch of nodes for inclusion in the Merkle tree. | |
verifyResponseWithPeers ( Channel $channel, MerkleTree $originalTree, variadic |
Return true if the Merkle roots match. |
public __construct ( |
||
$hail | ||
$db | DBInterface | |
$channels | array |
protected checkWithPeer ( Peer $peer, string $expectedRoot ) : boolean | ||
$peer | Peer | |
$expectedRoot | string | |
return | boolean |
protected getLogData ( TreeUpdate $up ) : array | ||
$up | TreeUpdate | |
return | array |
protected getMerkleTree ( Channel $chan ) : MerkleTree | ||
$chan | Channel | |
return | MerkleTree |
protected insertKey ( Channel $chan, TreeUpdate $update ) | ||
$chan | Channel | |
$update | TreeUpdate |
protected parseTreeUpdateResponse ( Channel $chan, array $response ) : array | ||
$chan | Channel | |
$response | array | |
return | array |
protected processTreeUpdates ( Channel $chan, variadic |
||
$chan | Channel | |
$updates | variadic |
|
return | boolean |
protected updateChannel ( Channel $chan ) | ||
$chan | Channel |
protected updatePackageQueue ( TreeUpdate $update, integer $treeUpdateID ) | ||
$update | TreeUpdate | |
$treeUpdateID | integer |
protected updatesToNodes ( array $updates ) : array | ||
$updates | array | |
return | array |
protected verifyResponseWithPeers ( Channel $channel, MerkleTree $originalTree, variadic |
||
$channel | Channel | |
$originalTree | MerkleTree | |
$updates | variadic |
|
return | boolean |