Function buildQuorumConfig

Build the quorum configuration for the given public key and the registered enrollment keys. The random seed is used to introduce partial randomness to the quorum assignment of each node.

QuorumConfig buildQuorumConfig (
  in const(ulong) key,
  in const(geod24.bitblob.BitBlob!(64L)[]) utxo_keys,
  scope nothrow @safe bool delegate(in ref geod24.bitblob.BitBlob!(64L), out UTXO) finder,
  in ref const(geod24.bitblob.BitBlob!(64L)) rand_seed,
  ref const(QuorumParams) params
) nothrow @safe;

Parameters

NameDescription
key the key of the node for which to generate the quorum
utxo_keys the list of UTXO keys of all the active enrollments
finder UTXO finder delegate
rand_seed the random seed
params quorum generator algorithm tweaking parameters

Example

1 node

auto keys = getKeys(1);
auto quorums = buildTestQuorums(Amount.MinFreezeAmount.only, keys,
    hashFull(1), QuorumParams.init, 0);
verifyQuorumsSanity(quorums);
verifyQuorumsIntersect(quorums);
assert(countNodeInclusions(quorums, keys) == [1]);

Example

const hash1 = hashMulti(WK.Keys.A.address, 1);
assert(toShortHash(hash1) == 10134925880926671868);
const hash2 = hashMulti(WK.Keys.A.address, 2);
assert(toShortHash(hash2) == 4925407896521770506);