Function NetworkClient.setIdentity
Set/get the node's identity
The identity of a node can be accessed through the identity
property.
The logger is also changed to make it easier to identify peers
and selectively enable or disable logging.
Identity has two components: public key and UTXO. Because nodes
are configured with their public key, a node can have a public key but
no UTXO (no stake yet), and later gain one.
To account for this case, setIdentity
can be called twice: Once with
just a public key and the UTXO being Hash
, and a second time
with the same PublicKey
but a non-init UTXO.
Parameters
Name | Description |
---|---|
utxo | UTXO used as collateral by this peer |
key | Public key of this peer |