Private
_connectingPrivate
_epochPrivate
_epochPrivate
_networkPrivate
_stakingPrivate
_stakingPrivate
_connectPrivate
_getPrivate
_handlePrivate
_listenPrivate
_runPrivate
Handshakes with all nodes that are in bootstrapUrls
Returns a set of the urls of nodes that we successfully connected to, an object containing their returned keys, and our 'core' config (most common values for critical values)
Private
_schedulePrivate
Schedule an update to the current epoch number for EPOCH_PROPAGATION_DELAY seconds from now
We don't immediately update this value on NextValidatorSetLocked
state changes because we want to give the nodes
a few seconds to update to the new epoch before we start sending the new epoch number with requests
This function should only be called as a result of a rare state change (NextValidatorSetLocked
)
So we don't debounce setting the timeout handler.
Private
_schedulePrivate
Currently, we perform a full sync every 30s, including handshaking with every node However, we also have a state change listener that watches for staking contract state change events, which should be the only time that we need to perform handshakes with every node.
However, the current block hash does need to be updated regularly, and we currently update it only when we handshake with every node.
We can remove this network sync code entirely if we refactor our code to fetch latest blockhash on-demand.
Throw node error
Calculates a Key Id for claiming a pkp based on a user identifier and an app identifier. The key Identifier is an Auth Method Id which scopes the key uniquely to a specific application context. These identifiers are specific to each auth method and will derive the public key portion of a pkp which will be persisted when a key is claimed.
Auth Method | User ID | App ID |
---|---|---|
Google OAuth | token sub |
token aud |
Discord OAuth | user id | client app identifier |
Stytch OTP | token sub |
token aud |
Lit Actions | user defined | ipfs cid |
Note Lit Action claiming uses a different schema than other auth methods |
public key of pkp when claimed
user identifier for the Key Identifier
app identifier for the Key Identifier
should be set for true if using claiming through actions
Private
fetchGet different formats of access control conditions, eg. evm, sol, unified etc.
Get hash of access control conditions
Get either auth sig or session auth sig
Optional
authOptional
mustOptional
sessionHandle node promises
requestId to be logged in case of error
number of nodes we need valid results from in order to resolve
Private
handshakeHandshake with Node
Send a command to nodes
Asynchronously updates the configuration settings for the LitNodeClient. This function fetches the minimum node count and bootstrap URLs for the specified Lit network.
It validates these values and updates the client's configuration accordingly.
It also stashes a handle on the Staking Contract so that we can use it for polling for epoch-related state changes
Will throw an error if the minimum node count is invalid or if the bootstrap URLs array is empty.
A promise that resolves when the configuration is updated.
Generated using TypeDoc
Sets up a listener to detect state changes (new epochs) in the staking contract. When a new epoch is detected, it triggers the
setNewConfig
function to update the client's configuration based on the new state of the network. This ensures that the client's configuration is always in sync with the current state of the staking contract.Returns
A promise that resolves when the listener is successfully set up.