Skip to content

Instantly share code, notes, and snippets.

@iamvon
Last active May 22, 2025 23:11
Show Gist options
  • Select an option

  • Save iamvon/548cdb5af7c7ea386628c3504cd07d43 to your computer and use it in GitHub Desktop.

Select an option

Save iamvon/548cdb5af7c7ea386628c3504cd07d43 to your computer and use it in GitHub Desktop.
Deploy an Open Clockwork worker

Prerequisites

Solana

Go here to install Solana.

Deploy an Open Clockwork worker

1. Download and install the Open Clockwork Geyser plugin

To turn your Solana validator or RPC into a Open Clockwork worker, you need to install the Open Clockwork Geyser plugin. You can get the binary either by building from source or installing the pre-built binary:

curl -L -o open-clockwork-v2.0.20.tar.gz 'https://drive.google.com/uc?export=download&id=1B1xG0_6QYdfZU1Dpa7ND3ZlT8KzuOSq4'
tar -xzvf open-clockwork-v2.0.20.tar.gz

2. Create a keypair

Next, create a new keypair for signing Open Clockwork transactions. Load this keypair with a small amount of SOL (~0.01 β—Ž). You will be compensated for lamports spent by the transactions your worker automates.

solana-keygen new -o open-clockwork-worker-keypair.json

Create a System Account for this key by funding the address with at least 0.1 β—Ž SOL.

solana balance $(solana address -k open-clockwork-worker-keypair.json)

3. Get a worker ID

Register your worker and get a worker ID:

clockwork worker create open-clockwork-worker-keypair.json

4. Configure your node

Then, setup the plugin config file (geyser-plugin-config.json) in a folder where your validator startup script can reference it. Note, the libpath and keypath values should point to the binary and keypair mentioned in the steps above.

{
  "libpath": "/home/sol/libclockwork_plugin.so",
  "keypath": "/home/sol/open-clockwork-worker-keypair.json",
  "rpc_url": "http://127.0.0.1:8899",
  "transaction_timeout_threshold": 150,
  "thread_count": 10,
  "worker_id": πŸ‘ˆ Set this to your worker ID!
}

5. Restart your validator

Finally, add an additional line to your startup script to run your validator with the Open Clockwork plugin (often located at /home/sol/bin/validator.sh):

#!/bin/bash

exec solana-validator \
    --identity /home/sol/validator-keypair.json \
    --known-validator dv1ZAGvdsz5hHLwWXsVnM94hWf1pjbKVau1QVkaMJ92 \
    --known-validator dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV \
    --known-validator dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB \
    --known-validator dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS \
    --only-known-rpc \
    --full-rpc-api \
    --no-voting \
    --ledger /mnt/ledger \
    --accounts /mnt/accounts \
    --log /home/sol/solana-rpc.log \
    --rpc-port 8899 \
    --rpc-bind-address 0.0.0.0 \
    --dynamic-port-range 8000-8020 \
    --entrypoint entrypoint.devnet.solana.com:8001 \
    --entrypoint entrypoint2.devnet.solana.com:8001 \
    --entrypoint entrypoint3.devnet.solana.com:8001 \
    --entrypoint entrypoint4.devnet.solana.com:8001 \
    --entrypoint entrypoint5.devnet.solana.com:8001 \
    --expected-genesis-hash EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG \
    --wal-recovery-mode skip_any_corrupted_record \
    --limit-ledger-size \
    
    # Add this line! πŸ‘‡πŸΌ
    --geyser-plugin-config /home/sol/geyser-plugin-config.json

Now simply restart your validator however you normally would!

P.S. If you have any problems deploying the worker, please feel free to contact me for support at X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment