MCPcopy Index your code
hub / github.com/clockwork-xyz/clockwork

github.com/clockwork-xyz/clockwork @v2.0.19

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.19 ↗ · + Follow
713 symbols 1,268 edges 149 files 49 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Clockwork

<strong>Solana automation engine</strong>







<a href="https://github.com/clockwork-xyz/clockwork/actions/workflows/code-scan.yaml"><img alt="code scan" src="https://github.com/clockwork-xyz/clockwork/actions/workflows/code-scan.yaml/badge.svg?branch=main" /></a>
<a href="https://discord.com/channels/889725689543143425"><img alt="Discord Chat" src="https://img.shields.io/discord/889725689543143425?color=blueviolet" /></a>
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html"><img alt="License" src="https://img.shields.io/github/license/clockwork-xyz/clockwork?color=turquoise" /></a>

Home | Docs | Twitter

Deployments

Program Address Devnet Mainnet
Network F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa v2.0.15 v2.0.0
Thread v2 CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh v2.0.18 v2.0.17
Thread v1 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv v1.4.2 v1.4.2

SDKs

Language Description Lib Examples
Anchor Anchor bindings for Solana programs. crates.io See Example Repo
Rust Rust bindings for clients. crates.io See Example Repo
Typescript Typescript bindings for clients and frontends. npm Explorer

Notes

  • Clockwork is under active development. All interfaces and implementations are subject to change.
  • Official program deployments to Solana mainnet are secured by a 2-of-2 multisig and managed by the core team of software maintainers.
  • To deploy a worker node on mainnet or devnet, please install the Clockwork geyser plugin on your Solana validator or RPC node and request an earlybird token delegation in the workernet channel on Discord.
  • Occasionally, a new software release may change the state schema and require users to migrate to a new program. These releases will be marked by a new major version upgrade (e.g. v2.x, v3.x, etc.).
  • The smart-contracts in this repository are automatically scanned by Sec3's auto-auditing software and are currently being reviewed by the team at Ottersec. Their audit report is in progress and will be published soon.

Getting Started

Local Development

1. Install clockwork-cli.

If you are on linux, you might need to run this:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev

Install with cargo:

cargo install -f --locked clockwork-cli

2. Run a localnet node.

clockwork localnet

3. Stream program logs.

solana logs --url localhost

Guides & Examples

  • We have ready to run examples apps: https://github.com/clockwork-xyz/examples.
  • If you are looking for walkthough, take a look at the docs: https://docs.clockwork.xyz/developers/guides.
  • If you have a certain use case you would like to discuss, we are happy to help.

Deploying a worker

If you just want to test your smart contracts on localnet, check the previous section.

If you are a node operator looking to deploy the clockwork plugin, please talk to us for a smooth onboarding. Here's a one pager on how to be part of the automation network: https://docs.clockwork.xyz/workernet/deploying-a-worker.

Common Errors

Please refer to the FAQ.

Questions

Come build with us and ask questions on Discord!

Extension points exported contracts — how you extend this code

TimeUnitField (Interface)
(no doc) [7 implementers]
cron/src/time_unit/mod.rs
ProgramLogsDeserializable (Interface)
Parse struct from sol_set_return_data in program's logs [1 implementers]
utils/src/lib.rs
UnstakeAccount (Interface)
UnstakeAccount [1 implementers]
programs/network/src/state/unstake.rs
ThreadAccount (Interface)
Trait for reading and writing to a thread account. [1 implementers]
programs/thread/src/state/thread.rs
WebhookAccount (Interface)
WebhookAccount ... [1 implementers]
programs/webhook/src/state/webhook.rs
AccountGet (Interface)
(no doc) [1 implementers]
plugin/src/executors/mod.rs
PathToString (Interface)
(no doc) [1 implementers]
cli/src/config.rs
TimeUnitSpec (Interface)
Methods exposing a schedule's configured ordinals for each individual unit of time. # Example ``` use clockwork_cron::{S [1 …
cron/src/time_unit/mod.rs

Core symbols most depended-on inside this repo

to_string
called by 73
cli/src/config.rs
payer_pubkey
called by 42
cli/src/client.rs
handler
called by 35
programs/network/src/jobs/take_snapshot/job.rs
parse_string
called by 30
cli/src/parser.rs
ordinals
called by 29
cron/src/time_unit/years.rs
get
called by 28
cli/src/processor/pool.rs
payer
called by 20
cli/src/client.rs
send_and_confirm
called by 19
cli/src/client.rs

Shape

Function 305
Method 251
Class 118
Interface 23
Enum 16

Languages

Rust100%

Modules by API surface

cron/src/parsing.rs80 symbols
programs/network/src/lib.rs35 symbols
cron/src/schedule.rs28 symbols
cli/src/parser.rs25 symbols
cron/src/queries.rs20 symbols
plugin/src/executors/tx.rs18 symbols
plugin/src/plugin.rs17 symbols
cli/src/config.rs17 symbols
cli/src/client.rs17 symbols
relayer/src/main.rs16 symbols
cron/tests/lib.rs15 symbols
programs/thread/src/state/versioned_thread.rs14 symbols

For agents

$ claude mcp add clockwork \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact