MCPcopy Create free account
hub / github.com/clockwork-xyz/clockwork / register_worker

Function register_worker

cli/src/processor/localnet.rs:150–169  ·  view source on GitHub ↗
(client: &Client, config: &CliConfig)

Source from the content-addressed store, hash-verified

148}
149
150fn register_worker(client: &Client, config: &CliConfig) -> Result<()> {
151 // Create the worker
152 let signatory = read_keypair_file(&config.signatory()).map_err(|err| {
153 CliError::FailedLocalnet(format!(
154 "Unable to read keypair {}: {}",
155 &config.signatory(),
156 err
157 ))
158 })?;
159
160 client
161 .airdrop(&signatory.pubkey(), LAMPORTS_PER_SOL)
162 .context("airdrop to signatory failed")?;
163 super::worker::create(client, signatory, true).context("worker::create failed")?;
164
165 // Delegate stake to the worker
166 super::delegation::create(client, 0).context("delegation::create failed")?;
167 super::delegation::deposit(client, 100000000, 0, 0).context("delegation::deposit failed")?;
168 Ok(())
169}
170
171fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> {
172 // Create epoch thread.

Callers 1

startFunction · 0.85

Calls 5

depositFunction · 0.85
signatoryMethod · 0.80
airdropMethod · 0.80
createFunction · 0.70
pubkeyMethod · 0.45

Tested by

no test coverage detected