How To Use

The subnet can utilize multiple record validators that are used in order of priority (see RecordValidatorBase).

Usage

Starting the DHT with:

predicate = hypertensor_consensus_predicate()
consensus_predicate = HypertensorPredicateValidator(
     record_predicate=predicate,
     hypertensor=Hypertensor(),
     subnet_id=self.subnet_id
)

rsa_signature_validator = RSASignatureValidator(pk)
record_validators=[rsa_signature_validator]

self.dht = DHT(
     initial_peers=initial_peers,
     start=True,
     num_workers=DEFAULT_NUM_WORKERS,
     use_relay=use_relay,
     use_auto_relay=use_auto_relay,
     client_mode=reachable_via_relay,
     record_validators=record_validators,
     **kwargs,
)

Last updated