From a215386a8282157f38a5140667a72f5ffb8177ee Mon Sep 17 00:00:00 2001 From: "Jean Marchand (Exotic Markets)" Date: Tue, 6 Feb 2024 17:17:09 +0100 Subject: [PATCH] chore: Reset versioning and name (#13) --- .gitignore | 2 +- Anchor.toml | 18 +- Cargo.lock | 318 +++++++++--------- Cargo.toml | 22 +- OLD_VERSION | 2 +- README.md | 56 +-- VERSION | 2 +- cli/Cargo.toml | 20 +- cli/README.md | 6 +- cli/build.rs | 2 +- cli/src/cli.rs | 46 +-- cli/src/client.rs | 2 +- cli/src/config.rs | 32 +- cli/src/deps.rs | 12 +- cli/src/parser.rs | 6 +- cli/src/processor/config.rs | 8 +- cli/src/processor/crontab.rs | 2 +- cli/src/processor/delegation.rs | 20 +- cli/src/processor/explorer.rs | 4 +- cli/src/processor/initialize.rs | 14 +- cli/src/processor/localnet.rs | 92 ++--- cli/src/processor/mod.rs | 4 +- cli/src/processor/pool.rs | 8 +- cli/src/processor/registry.rs | 10 +- cli/src/processor/secret.rs | 4 +- cli/src/processor/snapshot.rs | 8 +- cli/src/processor/thread.rs | 46 +-- cli/src/processor/webhook.rs | 8 +- cli/src/processor/worker.rs | 14 +- cron/Cargo.toml | 4 +- cron/README.md | 21 +- cron/src/lib.rs | 2 +- cron/src/time_unit/mod.rs | 8 +- cron/tests/lib.rs | 2 +- justfile | 16 +- plugin/Cargo.toml | 22 +- plugin/README.md | 2 +- plugin/build.rs | 2 +- plugin/config.json | 2 +- plugin/src/builders/pool_rotation.rs | 8 +- plugin/src/builders/thread_exec.rs | 22 +- plugin/src/events.rs | 14 +- plugin/src/executors/tx.rs | 6 +- plugin/src/executors/webhook.rs | 4 +- plugin/src/lib.rs | 6 +- plugin/src/observers/thread.rs | 4 +- plugin/src/observers/webhook.rs | 2 +- plugin/src/plugin.rs | 18 +- plugin/utils/Cargo.toml | 6 +- plugin/utils/README.md | 2 +- plugin/vector.toml | 56 +-- programs/network/Cargo.toml | 8 +- programs/network/README.md | 2 +- programs/network/src/errors.rs | 2 +- .../network/src/instructions/fee_collect.rs | 2 +- .../network/src/instructions/penalty_claim.rs | 2 +- .../network/src/instructions/pool_create.rs | 2 +- .../network/src/instructions/pool_rotate.rs | 4 +- .../network/src/instructions/pool_update.rs | 2 +- .../src/instructions/registry_nonce_hash.rs | 2 +- .../src/instructions/unstake_create.rs | 4 +- .../network/src/instructions/worker_create.rs | 4 +- .../network/src/jobs/delete_snapshot/job.rs | 2 +- .../src/jobs/delete_snapshot/process_entry.rs | 2 +- .../src/jobs/delete_snapshot/process_frame.rs | 2 +- .../jobs/delete_snapshot/process_snapshot.rs | 2 +- .../network/src/jobs/distribute_fees/job.rs | 2 +- .../src/jobs/distribute_fees/process_entry.rs | 2 +- .../src/jobs/distribute_fees/process_frame.rs | 2 +- .../jobs/distribute_fees/process_snapshot.rs | 2 +- .../network/src/jobs/increment_epoch/job.rs | 2 +- .../network/src/jobs/process_unstakes/job.rs | 2 +- .../process_unstakes/unstake_preprocess.rs | 2 +- .../jobs/process_unstakes/unstake_process.rs | 4 +- .../network/src/jobs/stake_delegations/job.rs | 2 +- .../stake_delegations/process_delegation.rs | 2 +- .../jobs/stake_delegations/process_worker.rs | 2 +- .../src/jobs/take_snapshot/create_entry.rs | 2 +- .../src/jobs/take_snapshot/create_frame.rs | 2 +- .../src/jobs/take_snapshot/create_snapshot.rs | 2 +- .../network/src/jobs/take_snapshot/job.rs | 2 +- programs/network/src/lib.rs | 4 +- programs/network/src/state/worker.rs | 4 +- programs/thread/Cargo.toml | 12 +- programs/thread/README.md | 2 +- programs/thread/src/errors.rs | 4 +- .../thread/src/instructions/get_crate_info.rs | 4 +- .../thread/src/instructions/thread_create.rs | 2 +- .../thread/src/instructions/thread_exec.rs | 22 +- .../instructions/thread_instruction_add.rs | 2 +- .../thread/src/instructions/thread_kickoff.rs | 43 ++- .../thread/src/instructions/thread_update.rs | 6 +- .../src/instructions/thread_withdraw.rs | 2 +- programs/thread/src/lib.rs | 4 +- programs/thread/src/state/mod.rs | 2 +- programs/thread/src/state/thread.rs | 4 +- programs/webhook/Cargo.toml | 6 +- programs/webhook/README.md | 2 +- programs/webhook/src/errors.rs | 2 +- .../src/instructions/webhook_create.rs | 2 +- programs/webhook/src/state/webhook.rs | 6 +- relayer/Cargo.toml | 8 +- relayer/api/Cargo.toml | 6 +- relayer/src/main.rs | 8 +- scripts/build-all.sh | 18 +- scripts/cargo-publish.sh | 18 +- scripts/ci/bump-version.sh | 2 +- scripts/ci/create-tarball.sh | 2 +- scripts/debug_plugin.sh | 12 +- scripts/refresh-program-ids.sh | 12 +- scripts/stake-localnet.sh | 2 +- sdk/Cargo.toml | 6 +- sdk/README.md | 2 +- sdk/src/lib.rs | 28 +- utils/Cargo.toml | 4 +- utils/README.md | 2 +- utils/src/explorer.rs | 4 +- utils/src/thread.rs | 2 +- 118 files changed, 688 insertions(+), 674 deletions(-) diff --git a/.gitignore b/.gitignore index e0d8a177..3fb608cd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ target **/*.rs.bk -# Clockwork +# Sablier bin/ lib/ .env diff --git a/Anchor.toml b/Anchor.toml index ccea844e..7f38de21 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -3,16 +3,16 @@ cluster = "mainnet" wallet = "~/.config/solana/id.json" [programs.localnet] -clockwork_network_program = "F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa" -clockwork_thread_program = "CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh" -clockwork_webhook_program = "E7p5KFo8kKCDm6BUnWtnVFkQSYh6ZA6xaGAuvpv8NXTa" +sablier_network_program = "F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa" +sablier_thread_program = "CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh" +sablier_webhook_program = "E7p5KFo8kKCDm6BUnWtnVFkQSYh6ZA6xaGAuvpv8NXTa" [programs.testnet] -clockwork_network_program = "F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa" -clockwork_thread_program = "CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh" -clockwork_webhook_program = "E7p5KFo8kKCDm6BUnWtnVFkQSYh6ZA6xaGAuvpv8NXTa" +sablier_network_program = "F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa" +sablier_thread_program = "CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh" +sablier_webhook_program = "E7p5KFo8kKCDm6BUnWtnVFkQSYh6ZA6xaGAuvpv8NXTa" [programs.mainnet] -clockwork_network_program = "F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa" -clockwork_thread_program = "CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh" -clockwork_webhook_program = "E7p5KFo8kKCDm6BUnWtnVFkQSYh6ZA6xaGAuvpv8NXTa" +sablier_network_program = "F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa" +sablier_thread_program = "CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh" +sablier_webhook_program = "E7p5KFo8kKCDm6BUnWtnVFkQSYh6ZA6xaGAuvpv8NXTa" diff --git a/Cargo.lock b/Cargo.lock index e37af31d..828f2f23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,165 +1263,6 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" -[[package]] -name = "clockwork-cli" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "anchor-spl", - "anyhow", - "bincode", - "bzip2", - "cargo_metadata", - "chrono", - "clap 4.4.18", - "clockwork-cron", - "clockwork-network-program", - "clockwork-plugin-utils", - "clockwork-relayer-api", - "clockwork-thread-program", - "clockwork-utils", - "clockwork-webhook-program", - "dirs-next", - "indicatif", - "reqwest", - "serde", - "serde_json", - "solana-cli-config", - "solana-client", - "solana-sdk", - "spl-associated-token-account 1.1.3", - "spl-token 3.5.0", - "tar", - "termcolor", - "thiserror", -] - -[[package]] -name = "clockwork-cron" -version = "2.0.18" -dependencies = [ - "chrono", - "nom", -] - -[[package]] -name = "clockwork-network-program" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "anchor-spl", - "clockwork-utils", -] - -[[package]] -name = "clockwork-plugin-utils" -version = "2.0.18" -dependencies = [ - "serde", - "serde_json", - "solana-geyser-plugin-interface", -] - -[[package]] -name = "clockwork-relayer" -version = "2.0.18" -dependencies = [ - "actix-cors", - "actix-web", - "anchor-lang", - "clockwork-relayer-api", - "clockwork-webhook-program", - "rayon", - "regex", - "reqwest", - "serde", - "serde_json", - "solana-client", - "solana-sdk", - "solana-zk-token-sdk", -] - -[[package]] -name = "clockwork-relayer-api" -version = "2.0.18" -dependencies = [ - "bincode", - "serde", - "solana-sdk", -] - -[[package]] -name = "clockwork-sdk" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "clockwork-thread-program", -] - -[[package]] -name = "clockwork-thread-program" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "chrono", - "clockwork-cron", - "clockwork-network-program", - "clockwork-utils", - "pyth-sdk-solana", - "version", -] - -[[package]] -name = "clockwork-utils" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "base64 0.21.7", - "serde", - "static-pubkey", -] - -[[package]] -name = "clockwork-webhook-program" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "serde", -] - -[[package]] -name = "clockwork_plugin" -version = "2.0.18" -dependencies = [ - "anchor-lang", - "async-trait", - "bincode", - "cargo_metadata", - "chrono", - "clockwork-cron", - "clockwork-network-program", - "clockwork-plugin-utils", - "clockwork-relayer-api", - "clockwork-thread-program", - "clockwork-utils", - "clockwork-webhook-program", - "futures", - "log", - "pyth-sdk-solana", - "reqwest", - "rustc_version", - "solana-account-decoder", - "solana-client", - "solana-geyser-plugin-interface", - "solana-logger", - "solana-program", - "solana-quic-client", - "solana-sdk", - "static-pubkey", - "tokio", -] - [[package]] name = "colorchoice" version = "1.0.0" @@ -3704,6 +3545,165 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +[[package]] +name = "sablier-cli" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "anyhow", + "bincode", + "bzip2", + "cargo_metadata", + "chrono", + "clap 4.4.18", + "dirs-next", + "indicatif", + "reqwest", + "sablier-cron", + "sablier-network-program", + "sablier-plugin-utils", + "sablier-relayer-api", + "sablier-thread-program", + "sablier-utils", + "sablier-webhook-program", + "serde", + "serde_json", + "solana-cli-config", + "solana-client", + "solana-sdk", + "spl-associated-token-account 1.1.3", + "spl-token 3.5.0", + "tar", + "termcolor", + "thiserror", +] + +[[package]] +name = "sablier-cron" +version = "1.0.0-alpha.0" +dependencies = [ + "chrono", + "nom", +] + +[[package]] +name = "sablier-network-program" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "sablier-utils", +] + +[[package]] +name = "sablier-plugin-utils" +version = "1.0.0-alpha.0" +dependencies = [ + "serde", + "serde_json", + "solana-geyser-plugin-interface", +] + +[[package]] +name = "sablier-relayer" +version = "1.0.0-alpha.0" +dependencies = [ + "actix-cors", + "actix-web", + "anchor-lang", + "rayon", + "regex", + "reqwest", + "sablier-relayer-api", + "sablier-webhook-program", + "serde", + "serde_json", + "solana-client", + "solana-sdk", + "solana-zk-token-sdk", +] + +[[package]] +name = "sablier-relayer-api" +version = "1.0.0-alpha.0" +dependencies = [ + "bincode", + "serde", + "solana-sdk", +] + +[[package]] +name = "sablier-sdk" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "sablier-thread-program", +] + +[[package]] +name = "sablier-thread-program" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "chrono", + "pyth-sdk-solana", + "sablier-cron", + "sablier-network-program", + "sablier-utils", + "version", +] + +[[package]] +name = "sablier-utils" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "base64 0.21.7", + "serde", + "static-pubkey", +] + +[[package]] +name = "sablier-webhook-program" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "serde", +] + +[[package]] +name = "sablier_plugin" +version = "1.0.0-alpha.0" +dependencies = [ + "anchor-lang", + "async-trait", + "bincode", + "cargo_metadata", + "chrono", + "futures", + "log", + "pyth-sdk-solana", + "reqwest", + "rustc_version", + "sablier-cron", + "sablier-network-program", + "sablier-plugin-utils", + "sablier-relayer-api", + "sablier-thread-program", + "sablier-utils", + "sablier-webhook-program", + "solana-account-decoder", + "solana-client", + "solana-geyser-plugin-interface", + "solana-logger", + "solana-program", + "solana-quic-client", + "solana-sdk", + "static-pubkey", + "tokio", +] + [[package]] name = "schannel" version = "0.1.23" diff --git a/Cargo.toml b/Cargo.toml index ab435616..da9a6b60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,12 +13,12 @@ incremental = false codegen-units = 1 [workspace.package] -version = "2.0.18" +version = "1.0.0-alpha.0" edition = "2021" license = "AGPL-3.0-or-later" -homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" -documentation = "https://docs.clockwork.xyz" +homepage = "https://sablier.dev" +repository = "https://github.com/sablier-xyz/sablier" +documentation = "https://docs.sablier.dev" readme = "./README.md" keywords = ["solana"] @@ -29,13 +29,13 @@ base64 = "~0.21" serde = "1.0" static-pubkey = "1.0.3" chrono = { version = "0.4.19", default-features = false } -clockwork-thread-program = { path = "./programs/thread", version = "=2.0.18" } -clockwork-cron = { path = "./cron", version = "=2.0.18" } -clockwork-network-program = { path = "./programs/network", version = "=2.0.18" } -clockwork-relayer-api = { path = "./relayer/api", version = "=2.0.18" } -clockwork-plugin-utils = { path = "./plugin/utils", version = "=2.0.18" } -clockwork-utils = { path = "./utils", version = "=2.0.18" } -clockwork-webhook-program = { path = "./programs/webhook", version = "=2.0.18" } +sablier-thread-program = { path = "./programs/thread", version = "=1.0.0-alpha.0" } +sablier-cron = { path = "./cron", version = "=1.0.0-alpha.0" } +sablier-network-program = { path = "./programs/network", version = "=1.0.0-alpha.0" } +sablier-relayer-api = { path = "./relayer/api", version = "=1.0.0-alpha.0" } +sablier-plugin-utils = { path = "./plugin/utils", version = "=1.0.0-alpha.0" } +sablier-utils = { path = "./utils", version = "=1.0.0-alpha.0" } +sablier-webhook-program = { path = "./programs/webhook", version = "=1.0.0-alpha.0" } anyhow = "1.0.61" bincode = "1.3.3" bzip2 = "0.4" diff --git a/OLD_VERSION b/OLD_VERSION index a6e7bcb3..7470d9d4 100644 --- a/OLD_VERSION +++ b/OLD_VERSION @@ -1 +1 @@ -2.0.17 +1.0.0-alpha.0 diff --git a/README.md b/README.md index 62d52488..36b28563 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,17 @@
-

Clockwork

+

Sablier

Solana automation engine

- code scan - Discord Chat + code scan License

- Home + Home | Docs | @@ -22,53 +21,63 @@ # Deployments -| Program | Address| Devnet | Mainnet | -| ------- | ------ | ------ | ------- | -| Network | `F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa` | [v2.0.15](https://explorer.solana.com/address/F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa) | [v2.0.0](https://explorer.solana.com/address/F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa) | +| Program | Address | Devnet | Mainnet | +| --------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| Network | `F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa` | [v2.0.15](https://explorer.solana.com/address/F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa) | [v2.0.0](https://explorer.solana.com/address/F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa) | | Thread v2 | `CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh` | [v2.0.18](https://explorer.solana.com/address/CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh?cluster=devnet) | [v2.0.17](https://explorer.solana.com/address/CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh) | -| Thread v1 | `3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv` | [v1.4.2](https://explorer.solana.com/address/3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv?cluster=devnet) | [v1.4.2](https://explorer.solana.com/address/3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv) | +| Thread v1 | `3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv` | [v1.4.2](https://explorer.solana.com/address/3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv?cluster=devnet) | [v1.4.2](https://explorer.solana.com/address/3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv) | # SDKs -| Language | Description | Lib | Examples | -| ----------- | -------- | ---- | -------- | -| Anchor | Anchor bindings for Solana programs. | [crates.io](https://crates.io/crates/clockwork-sdk) | [See Example Repo](https://github.com/clockwork-xyz/examples) -| Rust | Rust bindings for clients. | [crates.io](https://crates.io/crates/clockwork-client) | [See Example Repo](https://github.com/clockwork-xyz/examples) -| Typescript | Typescript bindings for clients and frontends. | [npm](https://www.npmjs.com/package/@clockwork-xyz/sdk) | [Explorer](https://github.com/clockwork-xyz/explorer) + +| Language | Description | Lib | Examples | +| ---------- | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------- | +| Anchor | Anchor bindings for Solana programs. | [crates.io](https://crates.io/crates/clockwork-sdk) | [See Example Repo](https://github.com/clockwork-xyz/examples) | +| Rust | Rust bindings for clients. | [crates.io](https://crates.io/crates/clockwork-client) | [See Example Repo](https://github.com/clockwork-xyz/examples) | +| Typescript | Typescript bindings for clients and frontends. | [npm](https://www.npmjs.com/package/@clockwork-xyz/sdk) | [Explorer](https://github.com/clockwork-xyz/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](https://v3.squads.so/info/7gqj7UgvKgHihyPsXALW8QKJ3gUTEaLeBYwWbAtZhoCq) and managed by the core team of software maintainers. -- To deploy a worker node on mainnet or devnet, please [install](#deploying-a-worker) the Clockwork geyser plugin on your Solana validator or RPC node and request an earlybird token delegation in the workernet channel [on Discord](https://discord.gg/mwmFtU5BtA). -- 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](https://www.sec3.dev/) auto-auditing software and are currently being reviewed by the team at [Ottersec](https://osec.io/). Their audit report is in progress and will be published soon. + +- Sablier 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](https://v3.squads.so/info/7gqj7UgvKgHihyPsXALW8QKJ3gUTEaLeBYwWbAtZhoCq) and managed by the core team of software maintainers. +- To deploy a worker node on mainnet or devnet, please [install](#deploying-a-worker) the Sablier geyser plugin on your Solana validator or RPC node and request an earlybird token delegation in the workernet channel [on Discord](https://discord.gg/mwmFtU5BtA). +- 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](https://www.sec3.dev/) auto-auditing software and are currently being reviewed by the team at [Ottersec](https://osec.io/). Their audit report is in progress and will be published soon. # Getting Started + - ["I am a developer, and I want to build a program on localnet"](#local-development) -- ["I am a node operator, and I want to deploy a Clockwork worker"](#deploying-a-worker) +- ["I am a node operator, and I want to deploy a Sablier worker"](#deploying-a-worker) # Local Development -#### 1. Install clockwork-cli. +#### 1. Install sablier-cli. + If you are on linux, you might need to run this: + ```sh sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev ``` + Install with cargo: + ```sh -cargo install -f --locked clockwork-cli +cargo install -f --locked sablier-cli ``` #### 2. Run a localnet node. + ```sh -clockwork localnet +sablier localnet ``` #### 3. Stream program logs. + ```sh 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](https://discord.com/channels/889725689543143425/1029516796304306247). @@ -76,12 +85,15 @@ solana logs --url localhost --- # 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](https://docs.clockwork.xyz/developers/faq). ## Questions + Come build with us and ask questions on [Discord](https://discord.gg/epHsTsnUre)! diff --git a/VERSION b/VERSION index c945ef14..d7261d89 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.18 +1.0.0-alpha.0 \ No newline at end of file diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4085442c..67a37671 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "clockwork-cli" +name = "sablier-cli" version.workspace = true -description = "Command line interface for Clockwork" +description = "Command line interface for Sablier" edition.workspace = true license.workspace = true homepage.workspace = true @@ -18,13 +18,13 @@ anyhow.workspace = true bincode.workspace = true bzip2.workspace = true clap = { workspace = true, features = ["derive", "cargo"] } -clockwork-cron.workspace = true -clockwork-network-program = { workspace = true, features = ["no-entrypoint"] } -clockwork-relayer-api.workspace = true -clockwork-plugin-utils.workspace = true -clockwork-thread-program = { workspace = true, features = ["no-entrypoint"] } -clockwork-utils.workspace = true -clockwork-webhook-program = { workspace = true, features = ["no-entrypoint"] } +sablier-cron.workspace = true +sablier-network-program = { workspace = true, features = ["no-entrypoint"] } +sablier-relayer-api.workspace = true +sablier-plugin-utils.workspace = true +sablier-thread-program = { workspace = true, features = ["no-entrypoint"] } +sablier-utils.workspace = true +sablier-webhook-program = { workspace = true, features = ["no-entrypoint"] } chrono = { workspace = true, features = ["alloc"] } dirs-next.workspace = true indicatif.workspace = true @@ -41,7 +41,7 @@ thiserror.workspace = true termcolor.workspace = true [[bin]] -name = "clockwork" +name = "sablier" path = "src/main.rs" [build-dependencies] diff --git a/cli/README.md b/cli/README.md index 5a134674..a924a1e7 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,11 +1,13 @@ -# Clockwork CLI +# Sablier CLI If you are on linux, you might need to run this: + ```sh sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev ``` Install with cargo + ```sh -cargo install -f --locked clockwork-cli +cargo install -f --locked sablier-cli ``` diff --git a/cli/build.rs b/cli/build.rs index 42311482..52f432f0 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -7,7 +7,7 @@ fn main() { .expect("unable to get git commit hash"); let commit_hash = String::from_utf8(output.stdout).unwrap(); let url = format!( - "https://github.com/clockwork-xyz/clockwork/tree/{}/plugin/Cargo.toml", + "https://github.com/sablier-xyz/sablier/tree/{}/plugin/Cargo.toml", commit_hash ); println!("cargo:rustc-env=SPEC={}", url); diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 3055172a..ac0f27e3 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -1,6 +1,6 @@ use clap::{crate_version, Arg, ArgGroup, Command}; -use clockwork_thread_program::state::{SerializableInstruction, Trigger}; -use clockwork_webhook_program::state::HttpMethod; +use sablier_thread_program::state::{SerializableInstruction, Trigger}; +use sablier_webhook_program::state::HttpMethod; use solana_sdk::{pubkey::Pubkey, signature::Keypair}; use crate::parser::ProgramInfo; @@ -55,7 +55,7 @@ pub enum CliCommand { network_url: Option, program_infos: Vec, solana_archive: Option, - clockwork_archive: Option, + sablier_archive: Option, dev: bool, }, @@ -148,14 +148,14 @@ pub enum CliCommand { } pub fn app() -> Command { - Command::new("Clockwork") - .bin_name("clockwork") + Command::new("Sablier") + .bin_name("sablier") .about("An automation engine for the Solana blockchain") .version(crate_version!()) .arg_required_else_help(true) .subcommand( Command::new("config") - .about("Manage the Clockwork network config") + .about("Manage the Sablier network config") .arg_required_else_help(true) .subcommand(Command::new("get").about("Get a config value")) .subcommand( @@ -178,7 +178,7 @@ pub fn app() -> Command { ) .group( ArgGroup::new("config_settings") - .args(&["admin", "epoch_thread", "hasher_thread"]) + .args(["admin", "epoch_thread", "hasher_thread"]) .multiple(true), ), ), @@ -196,7 +196,7 @@ pub fn app() -> Command { ) .subcommand( Command::new("delegation") - .about("Manage a stake delegation to a Clockwork worker") + .about("Manage a stake delegation to a Sablier worker") .subcommand( Command::new("create") .about("Create a new delegation") @@ -306,7 +306,7 @@ pub fn app() -> Command { ) .subcommand( Command::new("initialize") - .about("Initialize the Clockwork network program") + .about("Initialize the Sablier network program") .arg( Arg::new("mint") .long("mint") @@ -317,11 +317,11 @@ pub fn app() -> Command { ) .subcommand( Command::new("localnet") - .about("Launch a local Clockwork worker for app development and testing") + .about("Launch a local Sablier worker for app development and testing") .arg( Arg::new("bpf_program") .long("bpf-program") - .value_names(&["ADDRESS_OR_KEYPAIR", "BPF_PROGRAM.SO"]) + .value_names(["ADDRESS_OR_KEYPAIR", "BPF_PROGRAM.SO"]) .num_args(1..) .number_of_values(2) .help( @@ -334,7 +334,7 @@ pub fn app() -> Command { Arg::new("clone") .long("clone") .short('c') - .value_names(&["ADDRESS"]) + .value_names(["ADDRESS"]) .num_args(1..) .number_of_values(1) .help("Copy an account from the cluster referenced by the --url argument the genesis configuration. If the ledger already exists then this parameter is silently ignored") @@ -343,7 +343,7 @@ pub fn app() -> Command { Arg::new("url") .long("url") .short('u') - .value_names(&["URL_OR_MONIKER"]) + .value_names(["URL_OR_MONIKER"]) .num_args(1) .number_of_values(1) .help("URL for Solana's JSON RPC or moniker (or their first letter): [mainnet-beta, testnet, devnet, localhost]") @@ -361,22 +361,22 @@ pub fn app() -> Command { ") ) .arg( - Arg::new("clockwork_archive") - .long("clockwork-archive") + Arg::new("sablier_archive") + .long("sablier-archive") .help("url or local path to the solana archive containing the necessary \ dependencies such as clocwkork-thread-program, etc. \ - Can be useful for debugging or testing different versions of clockwork releases + Can be useful for debugging or testing different versions of sablier releases ") ) .arg( Arg::new("dev") .long("dev") - .help("Use development versions of clockwork programs") + .help("Use development versions of sablier programs") ) ) .subcommand( Command::new("pool") - .about("Manage the Clockwork network worker pools") + .about("Manage the Sablier network worker pools") .subcommand( Command::new("get") .about("Get a pool") @@ -539,7 +539,7 @@ pub fn app() -> Command { ) .group( ArgGroup::new("trigger") - .args(&["account", "cron", "immediate"]) + .args(["account", "cron", "immediate"]) .required(true), ), ) @@ -629,14 +629,14 @@ pub fn app() -> Command { ) .subcommand( Command::new("registry") - .about("Manage the Clockwork network registry") + .about("Manage the Sablier network registry") .arg_required_else_help(true) .subcommand(Command::new("get").about("Lookup the registry")) .subcommand(Command::new("unlock").about("Manually unlock the registry")), ) .subcommand( Command::new("snapshot") - .about("Lookup the current Clockwork network registry") + .about("Lookup the current Sablier network registry") ) .subcommand( Command::new("webhook") @@ -697,7 +697,7 @@ pub fn app() -> Command { .arg_required_else_help(true) .subcommand( Command::new("create") - .about("Register a new worker with the Clockwork network") + .about("Register a new worker with the Sablier network") .arg( Arg::new("signatory_keypair") .index(1) @@ -707,7 +707,7 @@ pub fn app() -> Command { ) .subcommand( Command::new("get") - .about("Lookup a worker on the Clockwork network") + .about("Lookup a worker on the Sablier network") .arg( Arg::new("id") .index(1) diff --git a/cli/src/client.rs b/cli/src/client.rs index 23d52699..a17c9274 100644 --- a/cli/src/client.rs +++ b/cli/src/client.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::Clock, AccountDeserialize}; -use clockwork_utils::ProgramLogsDeserializable; +use sablier_utils::ProgramLogsDeserializable; use solana_client::{ client_error, rpc_client::RpcClient, rpc_response::RpcSimulateTransactionResult, }; diff --git a/cli/src/config.rs b/cli/src/config.rs index 29d86ab8..8a2fa383 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -8,13 +8,13 @@ use { pub const DEFAULT_RPC_TIMEOUT_SECONDS: Duration = Duration::from_secs(30); pub const DEFAULT_CONFIRM_TX_TIMEOUT_SECONDS: Duration = Duration::from_secs(5); pub const RELAYER_URL: &str = "http://localhost:8000/"; -pub const CLOCKWORK_RELEASE_BASE_URL: &str = - "https://github.com/clockwork-xyz/clockwork/releases/download"; -pub const CLOCKWORK_DEPS: &[&str] = &[ - "clockwork_network_program.so", - "clockwork_thread_program.so", - "clockwork_webhook_program.so", - "libclockwork_plugin.so", +pub const SABLIER_RELEASE_BASE_URL: &str = + "https://github.com/sablier-xyz/sablier/releases/download"; +pub const SABLIER_DEPS: &[&str] = &[ + "sablier_network_program.so", + "sablier_thread_program.so", + "sablier_webhook_program.so", + "libsablier_plugin.so", ]; pub const SOLANA_RELEASE_BASE_URL: &str = "https://github.com/solana-labs/solana/releases/download"; pub const SOLANA_DEPS: &[&str] = &["solana-test-validator"]; @@ -54,7 +54,7 @@ impl CliConfig { pub fn default_home() -> PathBuf { dirs_next::home_dir() .map(|mut path| { - path.extend([".config", "clockwork"]); + path.extend([".config", "sablier"]); path }) .unwrap() @@ -108,10 +108,10 @@ impl CliConfig { pub fn geyser_lib(&self) -> String { if self.dev && env::consts::OS.to_lowercase().contains("mac") { - self.active_runtime("libclockwork_plugin.dylib") + self.active_runtime("libsablier_plugin.dylib") } else { // in the release process, we always rename dylib to so anyway - self.active_runtime("libclockwork_plugin.so") + self.active_runtime("libsablier_plugin.so") } } } @@ -126,7 +126,7 @@ impl PathToString for PathBuf { } } -// Clockwork Deps Helpers +// Sablier Deps Helpers impl CliConfig { // #[tokio::main] fn detect_target_triplet() -> String { @@ -145,18 +145,18 @@ impl CliConfig { .to_owned() } - pub fn clockwork_release_url(tag: &str) -> String { + pub fn sablier_release_url(tag: &str) -> String { format!( "{}/{}/{}", - CLOCKWORK_RELEASE_BASE_URL, + SABLIER_RELEASE_BASE_URL, tag, - &Self::clockwork_release_archive() + &Self::sablier_release_archive() ) } - pub fn clockwork_release_archive() -> String { + pub fn sablier_release_archive() -> String { let target_triplet = Self::detect_target_triplet(); - format!("clockwork-geyser-plugin-release-{}.tar.bz2", target_triplet) + format!("sablier-geyser-plugin-release-{}.tar.bz2", target_triplet) } pub fn solana_release_url(tag: &str) -> String { diff --git a/cli/src/deps.rs b/cli/src/deps.rs index 1b8abbbe..fd6becfc 100644 --- a/cli/src/deps.rs +++ b/cli/src/deps.rs @@ -18,14 +18,14 @@ pub fn download_deps( runtime_dir: &Path, force_init: bool, solana_archive: Option, - clockwork_archive: Option, + sablier_archive: Option, dev: bool, ) -> Result<()> { let solana_tag = env!("GEYSER_INTERFACE_VERSION").to_owned().to_tag_version(); - let clockwork_tag = crate_version!().to_owned().to_tag_version(); + let sablier_tag = crate_version!().to_owned().to_tag_version(); // Create the version directory if it does not exist - let active_runtime = &runtime_dir.join(&clockwork_tag); + let active_runtime = &runtime_dir.join(&sablier_tag); download_and_extract( active_runtime, @@ -37,9 +37,9 @@ pub fn download_deps( if !dev { download_and_extract( active_runtime, - &clockwork_archive.unwrap_or(CliConfig::clockwork_release_url(&clockwork_tag)), - &active_runtime.join(CliConfig::clockwork_release_archive()), - config::CLOCKWORK_DEPS, + &sablier_archive.unwrap_or(CliConfig::sablier_release_url(&sablier_tag)), + &active_runtime.join(CliConfig::sablier_release_archive()), + config::SABLIER_DEPS, force_init, )?; } diff --git a/cli/src/parser.rs b/cli/src/parser.rs index e4972fda..e097a02e 100644 --- a/cli/src/parser.rs +++ b/cli/src/parser.rs @@ -1,8 +1,8 @@ use std::{convert::TryFrom, fs, path::PathBuf, str::FromStr}; use clap::ArgMatches; -use clockwork_thread_program::state::{SerializableAccount, SerializableInstruction, Trigger}; -use clockwork_webhook_program::state::HttpMethod; +use sablier_thread_program::state::{SerializableAccount, SerializableInstruction, Trigger}; +use sablier_webhook_program::state::HttpMethod; use serde::{Deserialize as JsonDeserialize, Serialize as JsonSerialize}; use solana_sdk::{ pubkey::Pubkey, @@ -82,7 +82,7 @@ fn parse_bpf_command(matches: &ArgMatches) -> Result { program_infos, force_init: matches.contains_id("force_init"), solana_archive: parse_string("solana_archive", matches).ok(), - clockwork_archive: parse_string("clockwork_archive", matches).ok(), + sablier_archive: parse_string("sablier_archive", matches).ok(), dev: matches.contains_id("dev"), }) } diff --git a/cli/src/processor/config.rs b/cli/src/processor/config.rs index 7d6b90cd..3aca6e02 100644 --- a/cli/src/processor/config.rs +++ b/cli/src/processor/config.rs @@ -2,7 +2,7 @@ use anchor_lang::{ solana_program::{instruction::Instruction, pubkey::Pubkey}, InstructionData, ToAccountMetas, }; -use clockwork_network_program::state::{Config, ConfigSettings}; +use sablier_network_program::state::{Config, ConfigSettings}; use crate::{client::Client, errors::CliError}; @@ -35,13 +35,13 @@ pub fn set( // Submit tx let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::ConfigUpdate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::ConfigUpdate { admin: client.payer_pubkey(), config: Config::pubkey(), } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::ConfigUpdate { settings }.data(), + data: sablier_network_program::instruction::ConfigUpdate { settings }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client)?; diff --git a/cli/src/processor/crontab.rs b/cli/src/processor/crontab.rs index 54d18d40..30a7664a 100644 --- a/cli/src/processor/crontab.rs +++ b/cli/src/processor/crontab.rs @@ -1,5 +1,5 @@ use chrono::{DateTime, NaiveDateTime, Utc}; -use clockwork_cron::Schedule; +use sablier_cron::Schedule; use std::str::FromStr; use crate::{client::Client, errors::CliError}; diff --git a/cli/src/processor/delegation.rs b/cli/src/processor/delegation.rs index 1d1e33d6..a6ecf1fa 100644 --- a/cli/src/processor/delegation.rs +++ b/cli/src/processor/delegation.rs @@ -2,7 +2,7 @@ use anchor_lang::{ solana_program::{instruction::Instruction, system_program}, AccountDeserialize, InstructionData, ToAccountMetas, }; -use clockwork_network_program::state::{Config, Delegation, Worker}; +use sablier_network_program::state::{Config, Delegation, Worker}; use spl_associated_token_account::get_associated_token_address; use crate::{client::Client, errors::CliError}; @@ -27,8 +27,8 @@ pub fn create(client: &Client, worker_id: u64) -> Result<(), CliError> { // Build ix let delegation_pubkey = Delegation::pubkey(worker_pubkey, worker.total_delegations); let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::DelegationCreate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::DelegationCreate { associated_token_program: anchor_spl::associated_token::ID, authority: client.payer_pubkey(), config: Config::pubkey(), @@ -40,7 +40,7 @@ pub fn create(client: &Client, worker_id: u64) -> Result<(), CliError> { worker: worker_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DelegationCreate {}.data(), + data: sablier_network_program::instruction::DelegationCreate {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); @@ -67,8 +67,8 @@ pub fn deposit( let worker_pubkey = Worker::pubkey(worker_id); let delegation_pubkey = Delegation::pubkey(worker_pubkey, delegation_id); let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::DelegationDeposit { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::DelegationDeposit { authority: client.payer_pubkey(), authority_tokens: get_associated_token_address(&client.payer_pubkey(), &config.mint), config: Config::pubkey(), @@ -77,7 +77,7 @@ pub fn deposit( token_program: anchor_spl::token::ID, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DelegationDeposit { amount }.data(), + data: sablier_network_program::instruction::DelegationDeposit { amount }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); @@ -104,8 +104,8 @@ pub fn withdraw( let worker_pubkey = Worker::pubkey(worker_id); let delegation_pubkey = Delegation::pubkey(worker_pubkey, delegation_id); let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::DelegationWithdraw { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::DelegationWithdraw { authority: client.payer_pubkey(), authority_tokens: get_associated_token_address(&client.payer_pubkey(), &config.mint), config: Config::pubkey(), @@ -114,7 +114,7 @@ pub fn withdraw( token_program: anchor_spl::token::ID, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DelegationWithdraw { amount }.data(), + data: sablier_network_program::instruction::DelegationWithdraw { amount }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); diff --git a/cli/src/processor/explorer.rs b/cli/src/processor/explorer.rs index 1e7085bd..d77312fc 100644 --- a/cli/src/processor/explorer.rs +++ b/cli/src/processor/explorer.rs @@ -1,9 +1,9 @@ -use {crate::config::CliConfig, crate::errors::CliError, clockwork_utils::explorer::Explorer}; +use {crate::config::CliConfig, crate::errors::CliError, sablier_utils::explorer::Explorer}; pub fn thread_url(thread: T, config: CliConfig) -> Result<(), CliError> { println!( "thread: {}", - explorer(config).thread_url(thread, clockwork_thread_program::ID) + explorer(config).thread_url(thread, sablier_thread_program::ID) ); Ok(()) } diff --git a/cli/src/processor/initialize.rs b/cli/src/processor/initialize.rs index d6b8566d..ea6b6c6a 100644 --- a/cli/src/processor/initialize.rs +++ b/cli/src/processor/initialize.rs @@ -2,7 +2,7 @@ use anchor_lang::{ solana_program::{instruction::Instruction, pubkey::Pubkey, system_program}, InstructionData, ToAccountMetas, }; -use clockwork_network_program::state::{Config, Pool, Registry, Snapshot}; +use sablier_network_program::state::{Config, Pool, Registry, Snapshot}; use crate::{client::Client, errors::CliError}; @@ -10,8 +10,8 @@ pub fn initialize(client: &Client, mint: Pubkey) -> Result<(), CliError> { // Initialize the programs let admin = client.payer_pubkey(); let ix_a = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::Initialize { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::Initialize { admin, config: Config::pubkey(), mint, @@ -20,11 +20,11 @@ pub fn initialize(client: &Client, mint: Pubkey) -> Result<(), CliError> { system_program: system_program::ID, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::Initialize {}.data(), + data: sablier_network_program::instruction::Initialize {}.data(), }; let ix_b = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::PoolCreate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::PoolCreate { admin, config: Config::pubkey(), payer: admin, @@ -33,7 +33,7 @@ pub fn initialize(client: &Client, mint: Pubkey) -> Result<(), CliError> { system_program: system_program::ID, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::PoolCreate {}.data(), + data: sablier_network_program::instruction::PoolCreate {}.data(), }; // Submit tx diff --git a/cli/src/processor/localnet.rs b/cli/src/processor/localnet.rs index 3b5f404a..59cc5c2b 100644 --- a/cli/src/processor/localnet.rs +++ b/cli/src/processor/localnet.rs @@ -10,8 +10,8 @@ use { }, anyhow::{Context, Result}, clap::crate_version, - clockwork_network_program::state::{Config, ConfigSettings, Registry}, - clockwork_thread_program::state::{Thread, Trigger}, + sablier_network_program::state::{Config, ConfigSettings, Registry}, + sablier_thread_program::state::{Thread, Trigger}, solana_sdk::{ native_token::LAMPORTS_PER_SOL, program_pack::Pack, @@ -36,7 +36,7 @@ pub fn start( program_infos: Vec, force_init: bool, solana_archive: Option, - clockwork_archive: Option, + sablier_archive: Option, dev: bool, ) -> Result<(), CliError> { config.dev = dev; @@ -44,7 +44,7 @@ pub fn start( &CliConfig::default_runtime_dir(), force_init, solana_archive, - clockwork_archive, + sablier_archive, dev, ) .map_err(|err| CliError::FailedLocalnet(err.to_string()))?; @@ -57,9 +57,9 @@ pub fn start( &mut start_test_validator(config, client, program_infos, network_url, clone_addresses) .map_err(|err| CliError::FailedLocalnet(err.to_string()))?; - // Initialize Clockwork + // Initialize Sablier let mint_pubkey = - mint_clockwork_token(client).map_err(|err| CliError::FailedTransaction(err.to_string()))?; + mint_sablier_token(client).map_err(|err| CliError::FailedTransaction(err.to_string()))?; super::initialize::initialize(client, mint_pubkey) .map_err(|err| CliError::FailedTransaction(err.to_string()))?; register_worker(client, config).map_err(|err| CliError::FailedTransaction(err.to_string()))?; @@ -72,7 +72,7 @@ pub fn start( Ok(()) } -fn mint_clockwork_token(client: &Client) -> Result { +fn mint_sablier_token(client: &Client) -> Result { // Calculate rent and pubkeys let mint_keypair = Keypair::new(); let mint_rent = client @@ -121,7 +121,7 @@ fn mint_clockwork_token(client: &Client) -> Result { // Submit tx client .send_and_confirm(&ixs, &[client.payer(), &mint_keypair]) - .context("mint_clockwork_token failed")?; + .context("mint_sablier_token failed")?; Ok(mint_keypair.pubkey()) } @@ -149,78 +149,78 @@ fn register_worker(client: &Client, config: &CliConfig) -> Result<()> { fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> { // Create epoch thread. - let epoch_thread_id = "clockwork.network.epoch"; + let epoch_thread_id = "sablier.network.epoch"; let epoch_thread_pubkey = Thread::pubkey(client.payer_pubkey(), epoch_thread_id.into()); let ix_a1 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::DistributeFeesJob { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::DistributeFeesJob { config: Config::pubkey(), registry: Registry::pubkey(), thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DistributeFeesJob {}.data(), + data: sablier_network_program::instruction::DistributeFeesJob {}.data(), }; let ix_a2 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::ProcessUnstakesJob { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::ProcessUnstakesJob { config: Config::pubkey(), registry: Registry::pubkey(), thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::ProcessUnstakesJob {}.data(), + data: sablier_network_program::instruction::ProcessUnstakesJob {}.data(), }; let ix_a3 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::StakeDelegationsJob { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::StakeDelegationsJob { config: Config::pubkey(), registry: Registry::pubkey(), thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::StakeDelegationsJob {}.data(), + data: sablier_network_program::instruction::StakeDelegationsJob {}.data(), }; let ix_a4 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::TakeSnapshotJob { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::TakeSnapshotJob { config: Config::pubkey(), registry: Registry::pubkey(), thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::TakeSnapshotJob {}.data(), + data: sablier_network_program::instruction::TakeSnapshotJob {}.data(), }; let ix_a5 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::EpochCutover { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::EpochCutover { config: Config::pubkey(), registry: Registry::pubkey(), thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::IncrementEpoch {}.data(), + data: sablier_network_program::instruction::IncrementEpoch {}.data(), }; let ix_a6 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::DeleteSnapshotJob { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::DeleteSnapshotJob { config: Config::pubkey(), registry: Registry::pubkey(), thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DeleteSnapshotJob {}.data(), + data: sablier_network_program::instruction::DeleteSnapshotJob {}.data(), }; let ix_a = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadCreate { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadCreate { authority: client.payer_pubkey(), payer: client.payer_pubkey(), system_program: system_program::ID, thread: epoch_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadCreate { + data: sablier_thread_program::instruction::ThreadCreate { amount: LAMPORTS_PER_SOL, id: epoch_thread_id.into(), instructions: vec![ @@ -240,28 +240,28 @@ fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> { }; // Create hasher thread. - let hasher_thread_id = "clockwork.network.hasher"; + let hasher_thread_id = "sablier.network.hasher"; let hasher_thread_pubkey = Thread::pubkey(client.payer_pubkey(), hasher_thread_id.into()); let registry_hash_ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::RegistryNonceHash { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::RegistryNonceHash { config: Config::pubkey(), registry: Registry::pubkey(), thread: hasher_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::RegistryNonceHash {}.data(), + data: sablier_network_program::instruction::RegistryNonceHash {}.data(), }; let ix_b = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadCreate { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadCreate { authority: client.payer_pubkey(), payer: client.payer_pubkey(), system_program: system_program::ID, thread: hasher_thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadCreate { + data: sablier_thread_program::instruction::ThreadCreate { amount: LAMPORTS_PER_SOL, id: hasher_thread_id.into(), instructions: vec![registry_hash_ix.into()], @@ -281,13 +281,13 @@ fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> { mint: mint_pubkey, }; let ix_c = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::ConfigUpdate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::ConfigUpdate { admin: client.payer_pubkey(), config: Config::pubkey(), } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::ConfigUpdate { settings }.data(), + data: sablier_network_program::instruction::ConfigUpdate { settings }.data(), }; client @@ -304,7 +304,7 @@ fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> { } fn create_geyser_plugin_config(config: &CliConfig) -> Result<()> { - let geyser_config = clockwork_plugin_utils::PluginConfig { + let geyser_config = sablier_plugin_utils::PluginConfig { keypath: Some(config.signatory().to_owned()), libpath: Some(config.geyser_lib().to_owned()), ..Default::default() @@ -327,9 +327,9 @@ fn start_test_validator( let path = config.active_runtime("solana-test-validator").to_owned(); let cmd = &mut Command::new(path); cmd.arg("-r") - .bpf_program(config, clockwork_network_program::ID, "network") - .bpf_program(config, clockwork_thread_program::ID, "thread") - .bpf_program(config, clockwork_webhook_program::ID, "webhook") + .bpf_program(config, sablier_network_program::ID, "network") + .bpf_program(config, sablier_thread_program::ID, "thread") + .bpf_program(config, sablier_webhook_program::ID, "webhook") .network_url(network_url) .clone_addresses(clone_addresses) .add_programs_with_path(program_infos) @@ -338,7 +338,7 @@ fn start_test_validator( let mut process = cmd .spawn() .context(format!("solana-test-validator command: {:#?}", cmd))?; - print_status!("Running", "Clockwork Validator {}\n", crate_version!()); + print_status!("Running", "Sablier Validator {}\n", crate_version!()); // Wait for the validator to become healthy let ms_wait = 10_000; @@ -397,7 +397,7 @@ impl TestValidatorHelpers for Command { program_id: Pubkey, program_name: &str, ) -> &mut Command { - let filename = format!("clockwork_{}_program.so", program_name); + let filename = format!("sablier_{}_program.so", program_name); self.arg("--bpf-program") .arg(program_id.to_string()) .arg(config.active_runtime(filename.as_str())) diff --git a/cli/src/processor/mod.rs b/cli/src/processor/mod.rs index 68f01ac2..3950256d 100644 --- a/cli/src/processor/mod.rs +++ b/cli/src/processor/mod.rs @@ -73,7 +73,7 @@ pub fn process(matches: &ArgMatches) -> Result<(), CliError> { program_infos, force_init, solana_archive, - clockwork_archive, + sablier_archive, dev, } => localnet::start( &mut config, @@ -83,7 +83,7 @@ pub fn process(matches: &ArgMatches) -> Result<(), CliError> { program_infos, force_init, solana_archive, - clockwork_archive, + sablier_archive, dev, ), CliCommand::PoolGet { id } => pool::get(&client, id), diff --git a/cli/src/processor/pool.rs b/cli/src/processor/pool.rs index 466fc189..39ff5b36 100644 --- a/cli/src/processor/pool.rs +++ b/cli/src/processor/pool.rs @@ -2,7 +2,7 @@ use anchor_lang::{ solana_program::{instruction::Instruction, system_program}, InstructionData, ToAccountMetas, }; -use clockwork_network_program::state::{Config, Pool, PoolSettings, Registry}; +use sablier_network_program::state::{Config, Pool, PoolSettings, Registry}; use crate::{client::Client, errors::CliError}; @@ -36,8 +36,8 @@ pub fn update(client: &Client, id: u64, size: usize) -> Result<(), CliError> { let pool_pubkey = Pool::pubkey(id); let settings = PoolSettings { size }; let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::PoolUpdate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::PoolUpdate { admin: client.payer_pubkey(), config: Config::pubkey(), payer: client.payer_pubkey(), @@ -45,7 +45,7 @@ pub fn update(client: &Client, id: u64, size: usize) -> Result<(), CliError> { system_program: system_program::ID, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::PoolUpdate { settings }.data(), + data: sablier_network_program::instruction::PoolUpdate { settings }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, id)?; diff --git a/cli/src/processor/registry.rs b/cli/src/processor/registry.rs index 124ef75f..2476af66 100644 --- a/cli/src/processor/registry.rs +++ b/cli/src/processor/registry.rs @@ -1,10 +1,10 @@ use anchor_lang::{solana_program::instruction::Instruction, InstructionData, ToAccountMetas}; -use clockwork_network_program::state::{Config, Registry, Snapshot}; +use sablier_network_program::state::{Config, Registry, Snapshot}; use crate::{client::Client, errors::CliError}; pub fn get(client: &Client) -> Result<(), CliError> { - let registry_pubkey = clockwork_network_program::state::Registry::pubkey(); + let registry_pubkey = sablier_network_program::state::Registry::pubkey(); let registry = client .get::(®istry_pubkey) .map_err(|_err| CliError::AccountDataNotParsable(registry_pubkey.to_string()))?; @@ -21,14 +21,14 @@ pub fn get(client: &Client) -> Result<(), CliError> { pub fn unlock(client: &Client) -> Result<(), CliError> { let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::RegistryUnlock { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::RegistryUnlock { admin: client.payer_pubkey(), config: Config::pubkey(), registry: Registry::pubkey(), } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::RegistryUnlock {}.data(), + data: sablier_network_program::instruction::RegistryUnlock {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client)?; diff --git a/cli/src/processor/secret.rs b/cli/src/processor/secret.rs index d2343579..4c8a7b41 100644 --- a/cli/src/processor/secret.rs +++ b/cli/src/processor/secret.rs @@ -1,8 +1,8 @@ use anchor_lang::prelude::Pubkey; -use clockwork_relayer_api::{ +use reqwest::header::CONTENT_TYPE; +use sablier_relayer_api::{ SecretApprove, SecretCreate, SecretGet, SecretList, SecretRevoke, SignedRequest, }; -use reqwest::header::CONTENT_TYPE; use solana_sdk::signer::Signer; use crate::{client::Client, errors::CliError}; diff --git a/cli/src/processor/snapshot.rs b/cli/src/processor/snapshot.rs index 1c7a502f..939a8cf5 100644 --- a/cli/src/processor/snapshot.rs +++ b/cli/src/processor/snapshot.rs @@ -1,16 +1,16 @@ -use clockwork_network_program::state::{Registry, Snapshot, SnapshotEntry}; +use sablier_network_program::state::{Registry, Snapshot, SnapshotEntry}; use solana_sdk::pubkey::Pubkey; use crate::{client::Client, errors::CliError}; pub fn get(client: &Client, entry_id: Option) -> Result<(), CliError> { - let registry_pubkey = clockwork_client::network::objects::Registry::pubkey(); + let registry_pubkey = sablier_client::network::objects::Registry::pubkey(); let registry = client .get::(®istry_pubkey) .map_err(|_err| CliError::AccountDataNotParsable(registry_pubkey.to_string()))?; let snapshot_pubkey = - clockwork_client::network::objects::Snapshot::pubkey(registry.snapshot_count - 1); + sablier_client::network::objects::Snapshot::pubkey(registry.snapshot_count - 1); let snapshot = client .get::(&snapshot_pubkey) .map_err(|_err| CliError::AccountDataNotParsable(snapshot_pubkey.to_string()))?; @@ -33,7 +33,7 @@ pub fn get_snapshot_entry( entry_id: u64, ) -> Result<(), CliError> { let entry_pubkey = - clockwork_client::network::objects::SnapshotEntry::pubkey(snapshot_pubkey, entry_id); + sablier_client::network::objects::SnapshotEntry::pubkey(snapshot_pubkey, entry_id); let entry = client .get::(&entry_pubkey) diff --git a/cli/src/processor/thread.rs b/cli/src/processor/thread.rs index 55b14ad5..47e34fdd 100644 --- a/cli/src/processor/thread.rs +++ b/cli/src/processor/thread.rs @@ -2,22 +2,22 @@ use anchor_lang::{ solana_program::{instruction::Instruction, system_program}, AccountDeserialize, InstructionData, ToAccountMetas, }; -use clockwork_thread_program::state::{ +use sablier_thread_program::state::{ SerializableInstruction, Thread, ThreadSettings, Trigger, VersionedThread, }; -use clockwork_utils::CrateInfo; +use sablier_utils::CrateInfo; use solana_sdk::pubkey::Pubkey; use crate::{client::Client, errors::CliError}; pub fn crate_info(client: &Client) -> Result<(), CliError> { let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::GetCrateInfo { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::GetCrateInfo { system_program: system_program::ID, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::GetCrateInfo {}.data(), + data: sablier_thread_program::instruction::GetCrateInfo {}.data(), }; let crate_info: CrateInfo = client.get_return_data(ix).unwrap(); println!("{:#?}", crate_info); @@ -32,15 +32,15 @@ pub fn create( ) -> Result<(), CliError> { let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.clone().into_bytes()); let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadCreate { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadCreate { authority: client.payer_pubkey(), payer: client.payer_pubkey(), system_program: system_program::ID, thread: thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadCreate { + data: sablier_thread_program::instruction::ThreadCreate { amount: 0, id: id.into_bytes(), instructions, @@ -56,14 +56,14 @@ pub fn create( pub fn delete(client: &Client, id: String) -> Result<(), CliError> { let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes()); let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadDelete { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadDelete { authority: client.payer_pubkey(), close_to: client.payer_pubkey(), thread: thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadDelete {}.data(), + data: sablier_thread_program::instruction::ThreadDelete {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); Ok(()) @@ -79,13 +79,13 @@ pub fn get(client: &Client, address: Pubkey) -> Result<(), CliError> { pub fn pause(client: &Client, id: String) -> Result<(), CliError> { let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes()); let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadPause { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadPause { authority: client.payer_pubkey(), thread: thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadPause {}.data(), + data: sablier_thread_program::instruction::ThreadPause {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; @@ -95,13 +95,13 @@ pub fn pause(client: &Client, id: String) -> Result<(), CliError> { pub fn resume(client: &Client, id: String) -> Result<(), CliError> { let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes()); let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadResume { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadResume { authority: client.payer_pubkey(), thread: thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadResume {}.data(), + data: sablier_thread_program::instruction::ThreadResume {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; @@ -111,13 +111,13 @@ pub fn resume(client: &Client, id: String) -> Result<(), CliError> { pub fn reset(client: &Client, id: String) -> Result<(), CliError> { let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes()); let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadReset { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadReset { authority: client.payer_pubkey(), thread: thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadReset {}.data(), + data: sablier_thread_program::instruction::ThreadReset {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; @@ -143,14 +143,14 @@ pub fn update( trigger, }; let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadUpdate { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadUpdate { authority: client.payer_pubkey(), system_program: system_program::ID, thread: thread_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadUpdate { settings }.data(), + data: sablier_thread_program::instruction::ThreadUpdate { settings }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; diff --git a/cli/src/processor/webhook.rs b/cli/src/processor/webhook.rs index 9af3748e..b1bfb3c0 100644 --- a/cli/src/processor/webhook.rs +++ b/cli/src/processor/webhook.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use anchor_lang::{InstructionData, ToAccountMetas}; -use clockwork_webhook_program::state::{HttpMethod, Webhook}; +use sablier_webhook_program::state::{HttpMethod, Webhook}; use solana_sdk::{instruction::Instruction, system_program}; use crate::{client::Client, errors::CliError}; @@ -19,15 +19,15 @@ pub fn create( "TEST {HBUh9g46wk2X89CvaNN15UmsznP59rh6od1h8JwYAopk:hello}".into(), ); let ix = Instruction { - program_id: clockwork_webhook_program::ID, - accounts: clockwork_webhook_program::accounts::WebhookCreate { + program_id: sablier_webhook_program::ID, + accounts: sablier_webhook_program::accounts::WebhookCreate { authority: client.payer_pubkey(), payer: client.payer_pubkey(), webhook: Webhook::pubkey(client.payer_pubkey(), id.clone()), system_program: system_program::ID, } .to_account_metas(Some(true)), - data: clockwork_webhook_program::instruction::WebhookCreate { + data: sablier_webhook_program::instruction::WebhookCreate { body, headers, id: id.clone(), diff --git a/cli/src/processor/worker.rs b/cli/src/processor/worker.rs index 0f4f85bf..e8c0f3cd 100644 --- a/cli/src/processor/worker.rs +++ b/cli/src/processor/worker.rs @@ -3,7 +3,7 @@ use anchor_lang::{ AccountDeserialize, InstructionData, ToAccountMetas, }; use anchor_spl::{associated_token, associated_token::get_associated_token_address, token}; -use clockwork_network_program::state::{ +use sablier_network_program::state::{ Config, Fee, Penalty, Registry, Snapshot, SnapshotFrame, Worker, WorkerSettings, }; use solana_sdk::signature::{Keypair, Signer}; @@ -89,8 +89,8 @@ pub fn create(client: &Client, signatory: Keypair, silent: bool) -> Result<(), C let worker_id = registry.total_workers; let worker_pubkey = Worker::pubkey(worker_id); let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::WorkerCreate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::WorkerCreate { associated_token_program: associated_token::ID, authority: client.payer_pubkey(), config: Config::pubkey(), @@ -105,7 +105,7 @@ pub fn create(client: &Client, signatory: Keypair, silent: bool) -> Result<(), C worker_tokens: get_associated_token_address(&worker_pubkey, &config.mint), } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::WorkerCreate {}.data(), + data: sablier_network_program::instruction::WorkerCreate {}.data(), }; client .send_and_confirm(&[ix], &[client.payer(), &signatory]) @@ -129,14 +129,14 @@ pub fn update(client: &Client, id: u64, signatory: Option) -> Result<() signatory: signatory.map_or(worker.signatory, |v| v.pubkey()), }; let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::WorkerUpdate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::WorkerUpdate { authority: client.payer_pubkey(), system_program: system_program::ID, worker: worker_pubkey, } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::WorkerUpdate { settings }.data(), + data: sablier_network_program::instruction::WorkerUpdate { settings }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, worker.id)?; diff --git a/cron/Cargo.toml b/cron/Cargo.toml index 576d4bee..cd74b965 100644 --- a/cron/Cargo.toml +++ b/cron/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "clockwork-cron" +name = "sablier-cron" version.workspace = true description = "A cron expression parser that's safe to use in the Solana runtime" edition.workspace = true @@ -11,7 +11,7 @@ readme.workspace = true keywords.workspace = true [lib] -name = "clockwork_cron" +name = "sablier_cron" [dependencies] chrono = { workspace = true, features = ["alloc"] } diff --git a/cron/README.md b/cron/README.md index b2518a22..e82fc797 100644 --- a/cron/README.md +++ b/cron/README.md @@ -1,9 +1,9 @@ -# clockwork-cron [![](https://img.shields.io/crates/v/clockwork-cron.svg)](https://crates.io/crates/clockwork-cron) [![](https://docs.rs/cron/badge.svg)](https://docs.rs/clockwork-cron) +# sablier-cron [![](https://img.shields.io/crates/v/clockwork-cron.svg)](https://crates.io/crates/clockwork-cron) [![](https://docs.rs/cron/badge.svg)](https://docs.rs/clockwork-cron) A cron expression parser that's safe to use in the Solana runtime. Works with stable Rust v1.28.0. ```rust -use clockwork_cron::Schedule; +use sablier_cron::Schedule; use chrono::{DateTime, NaiveDateTime, Utc}; use std::str::FromStr; @@ -41,29 +41,32 @@ Upcoming fire times: ``` ## ⚠️ Syntax + ```bash sec min hour day of month month day of week year ``` -If you use tools such as crontab guru, note that the clockwork parser is a __7__ columns string. -You probably need to add the __seconds__ _(left most column)_ and can optionally add the year _(right most column)_. + +If you use tools such as crontab guru, note that the clockwork parser is a **7** columns string. +You probably need to add the **seconds** _(left most column)_ and can optionally add the year _(right most column)_. e.g. the following 5 columns cron: | min | hour | day of month | month | day of week | -|-----|------|--------------|-------|-------------| -| 0 | 18 | * | * | FRI | +| --- | ---- | ------------ | ----- | ----------- | +| 0 | 18 | \* | \* | FRI | becomes | sec | min | hour | day of month | month | day of week | year | |-----|-----|------|--------------|-------|-------------|------| -| 0 | 0 | 18 | * | * | FRI | * | +| 0 | 0 | 18 | _ | _ | FRI | \* | or | sec | min | hour | day of month | month | day of week | -|-----|-----|------|--------------|-------|-------------| -| 0 | 0 | 18 | * | * | FRI | +| --- | --- | ---- | ------------ | ----- | ----------- | +| 0 | 0 | 18 | \* | \* | FRI | These are also supported: + ```bash "@yearly" "@weekly" diff --git a/cron/src/lib.rs b/cron/src/lib.rs index cb5e94a6..c14184d1 100644 --- a/cron/src/lib.rs +++ b/cron/src/lib.rs @@ -3,7 +3,7 @@ //! A cron expression parser and schedule explorer //! # Example //! ``` -//! use clockwork_cron::Schedule; +//! use sablier_cron::Schedule; //! use chrono::{DateTime, NaiveDateTime, Utc}; //! use std::str::FromStr; //! diff --git a/cron/src/time_unit/mod.rs b/cron/src/time_unit/mod.rs index 444121c7..c9129790 100644 --- a/cron/src/time_unit/mod.rs +++ b/cron/src/time_unit/mod.rs @@ -23,7 +23,7 @@ use std::iter; /// Methods exposing a schedule's configured ordinals for each individual unit of time. /// # Example /// ``` -/// use clockwork_cron::{Schedule,TimeUnitSpec}; +/// use sablier_cron::{Schedule,TimeUnitSpec}; /// use std::ops::Bound::{Included,Excluded}; /// use std::str::FromStr; /// @@ -42,7 +42,7 @@ pub trait TimeUnitSpec { /// being described. /// # Example /// ``` - /// use clockwork_cron::{Schedule,TimeUnitSpec}; + /// use sablier_cron::{Schedule,TimeUnitSpec}; /// use std::str::FromStr; /// /// let expression = "* * * * * * 2015-2044"; @@ -57,7 +57,7 @@ pub trait TimeUnitSpec { /// Returns the number of ordinals included in the associated schedule /// # Example /// ``` - /// use clockwork_cron::{Schedule,TimeUnitSpec}; + /// use sablier_cron::{Schedule,TimeUnitSpec}; /// use std::str::FromStr; /// /// let expression = "* * * 1,15 * * *"; @@ -70,7 +70,7 @@ pub trait TimeUnitSpec { /// Checks if this TimeUnitSpec is defined as all possibilities (thus created with a '*', '?' or in the case of weekdays '1-7') /// # Example /// ``` - /// use clockwork_cron::{Schedule,TimeUnitSpec}; + /// use sablier_cron::{Schedule,TimeUnitSpec}; /// use std::str::FromStr; /// /// let expression = "* * * 1,15 * * *"; diff --git a/cron/tests/lib.rs b/cron/tests/lib.rs index 4e1f9120..58ff6c6f 100644 --- a/cron/tests/lib.rs +++ b/cron/tests/lib.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { use chrono::*; - use clockwork_cron::{Schedule, TimeUnitSpec}; + use sablier_cron::{Schedule, TimeUnitSpec}; use std::str::FromStr; #[test] diff --git a/justfile b/justfile index 37b4c9e8..ed3ef418 100644 --- a/justfile +++ b/justfile @@ -12,7 +12,7 @@ tarball: clean: cargo clean - rm -rfv bin target lib clockwork-geyser-plugin-release* + rm -rfv bin target lib sablier-geyser-plugin-release* re: clean just make @@ -35,13 +35,13 @@ release-patch: gh workflow run bump-release.yaml -F bump=patch cli *args: - cargo run --bin clockwork {{args}} + cargo run --bin sablier {{args}} localnet *args: build - cargo run --bin clockwork localnet --dev {{args}} + cargo run --bin sablier localnet --dev {{args}} net: - cargo run --bin clockwork localnet --dev + cargo run --bin sablier localnet --dev logs: less test-ledger/validator.log @@ -53,16 +53,16 @@ watch: cargo watch -c -x "check" watch-cli: - cargo watch -c -x "check --bin clockwork" + cargo watch -c -x "check --bin sablier" # links pr: - open https://github.com/clockwork-xyz/clockwork/pulls + open https://github.com/sablier-xyz/sablier/pulls actions: - open https://github.com/clockwork-xyz/clockwork/actions + open https://github.com/sablier-xyz/sablier/actions releases: - open https://github.com/clockwork-xyz/clockwork/releases + open https://github.com/sablier-xyz/sablier/releases diff --git a/plugin/Cargo.toml b/plugin/Cargo.toml index b507848d..4d519c4c 100644 --- a/plugin/Cargo.toml +++ b/plugin/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "clockwork_plugin" +name = "sablier_plugin" version.workspace = true # this needs to match whatever solana uses! -rust-version = "1.60.0" -description = "Clockwork plugin for Solana validators" +rust-version = "1.73.0" +description = "Sablier plugin for Solana validators" edition.workspace = true license.workspace = true homepage.workspace = true @@ -16,20 +16,20 @@ publish = false [lib] crate-type = ["cdylib", "rlib"] -name = "clockwork_plugin" +name = "sablier_plugin" [dependencies] anchor-lang.workspace = true async-trait.workspace = true bincode.workspace = true chrono = { workspace = true, features = ["alloc"] } -clockwork-cron.workspace = true -clockwork-network-program.workspace = true -clockwork-plugin-utils.workspace = true -clockwork-relayer-api.workspace = true -clockwork-thread-program.workspace = true -clockwork-webhook-program.workspace = true -clockwork-utils.workspace = true +sablier-cron.workspace = true +sablier-network-program.workspace = true +sablier-plugin-utils.workspace = true +sablier-relayer-api.workspace = true +sablier-thread-program.workspace = true +sablier-webhook-program.workspace = true +sablier-utils.workspace = true log.workspace = true pyth-sdk-solana.workspace = true reqwest.workspace = true diff --git a/plugin/README.md b/plugin/README.md index 57a1de20..e24b4a0c 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -1 +1 @@ -# Clockwork Geyser Plugin +# Sablier Geyser Plugin diff --git a/plugin/build.rs b/plugin/build.rs index 176b4353..5b76afb1 100644 --- a/plugin/build.rs +++ b/plugin/build.rs @@ -22,7 +22,7 @@ fn main() { .expect("unable to get git commit hash"); let commit_hash = String::from_utf8(output.stdout).unwrap(); let url = format!( - "https://github.com/clockwork-xyz/clockwork/tree/{}/cli/Cargo.toml", + "https://github.com/sablier-xyz/sablier/tree/{}/cli/Cargo.toml", commit_hash ); println!("cargo:rustc-env=SPEC={}", url); diff --git a/plugin/config.json b/plugin/config.json index 81d29d63..4d083618 100644 --- a/plugin/config.json +++ b/plugin/config.json @@ -1,5 +1,5 @@ { - "libpath": "../target/debug/libclockwork_plugin.dylib", + "libpath": "../target/debug/libsablier_plugin.dylib", "keypath": "./test-ledger/validator-keypair.json", "slot_timeout_threshold": 150, "worker_threads": 10 diff --git a/plugin/src/builders/pool_rotation.rs b/plugin/src/builders/pool_rotation.rs index f4a8ac6a..1acc16a6 100644 --- a/plugin/src/builders/pool_rotation.rs +++ b/plugin/src/builders/pool_rotation.rs @@ -1,8 +1,8 @@ use std::sync::Arc; use anchor_lang::{solana_program::instruction::Instruction, InstructionData, ToAccountMetas}; -use clockwork_network_program::state::{Config, Pool, Registry, Snapshot, SnapshotFrame, Worker}; use log::info; +use sablier_network_program::state::{Config, Pool, Registry, Snapshot, SnapshotFrame, Worker}; use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::{signature::Keypair, signer::Signer, transaction::Transaction}; @@ -64,8 +64,8 @@ pub async fn build_pool_rotation_tx<'a>( // Build rotation instruction to rotate the worker into pool 0. let snapshot_pubkey = Snapshot::pubkey(snapshot.id); let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::PoolRotate { + program_id: sablier_network_program::ID, + accounts: sablier_network_program::accounts::PoolRotate { config: Config::pubkey(), pool: Pool::pubkey(0), registry: Registry::pubkey(), @@ -75,7 +75,7 @@ pub async fn build_pool_rotation_tx<'a>( worker: Worker::pubkey(worker_id), } .to_account_metas(Some(false)), - data: clockwork_network_program::instruction::PoolRotate {}.data(), + data: sablier_network_program::instruction::PoolRotate {}.data(), }; // Build and sign tx. diff --git a/plugin/src/builders/thread_exec.rs b/plugin/src/builders/thread_exec.rs index 09189c6b..d52566aa 100644 --- a/plugin/src/builders/thread_exec.rs +++ b/plugin/src/builders/thread_exec.rs @@ -1,10 +1,10 @@ use std::sync::Arc; use anchor_lang::{InstructionData, ToAccountMetas}; -use clockwork_network_program::state::Worker; -use clockwork_thread_program::state::{Trigger, VersionedThread}; -use clockwork_utils::thread::PAYER_PUBKEY; use log::info; +use sablier_network_program::state::Worker; +use sablier_thread_program::state::{Trigger, VersionedThread}; +use sablier_utils::thread::PAYER_PUBKEY; use solana_account_decoder::UiAccountEncoding; use solana_client::{ nonblocking::rpc_client::RpcClient, @@ -216,14 +216,14 @@ fn build_kickoff_ix( // Build the instruction. let mut kickoff_ix = match thread { VersionedThread::V1(_) => Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadKickoff { + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadKickoff { signatory: signatory_pubkey, thread: thread_pubkey, worker: worker_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadKickoff {}.data(), + data: sablier_thread_program::instruction::ThreadKickoff {}.data(), }, }; @@ -262,16 +262,16 @@ fn build_exec_ix( // Build the instruction. let mut exec_ix = match thread { VersionedThread::V1(_) => Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadExec { - fee: clockwork_network_program::state::Fee::pubkey(worker_pubkey), - pool: clockwork_network_program::state::Pool::pubkey(0), + program_id: sablier_thread_program::ID, + accounts: sablier_thread_program::accounts::ThreadExec { + fee: sablier_network_program::state::Fee::pubkey(worker_pubkey), + pool: sablier_network_program::state::Pool::pubkey(0), signatory: signatory_pubkey, thread: thread_pubkey, worker: worker_pubkey, } .to_account_metas(Some(true)), - data: clockwork_thread_program::instruction::ThreadExec {}.data(), + data: sablier_thread_program::instruction::ThreadExec {}.data(), }, }; diff --git a/plugin/src/events.rs b/plugin/src/events.rs index d1657677..033adcfe 100644 --- a/plugin/src/events.rs +++ b/plugin/src/events.rs @@ -1,8 +1,8 @@ use anchor_lang::{prelude::AccountInfo, AccountDeserialize, Discriminator}; use bincode::deserialize; -use clockwork_thread_program::state::{Thread, VersionedThread}; -use clockwork_webhook_program::state::Webhook; use pyth_sdk_solana::{load_price_feed_from_account_info, PriceFeed}; +use sablier_thread_program::state::{Thread, VersionedThread}; +use sablier_webhook_program::state::Webhook; use solana_geyser_plugin_interface::geyser_plugin_interface::{ GeyserPluginError, ReplicaAccountInfo, }; @@ -41,14 +41,14 @@ impl TryFrom<&mut ReplicaAccountInfo<'_>> for AccountUpdateEvent { } // If the account belongs to the thread v2 program, parse it. - if owner_pubkey.eq(&clockwork_thread_program::ID) && account_info.data.len() > 8 { + if owner_pubkey.eq(&sablier_thread_program::ID) && account_info.data.len() > 8 { let d = &account_info.data[..8]; if d.eq(&Thread::discriminator()) { return Ok(AccountUpdateEvent::Thread { thread: VersionedThread::V1( Thread::try_deserialize(&mut account_info.data).map_err(|_| { GeyserPluginError::AccountsUpdateError { - msg: "Failed to parse Clockwork thread v2 account".into(), + msg: "Failed to parse Sablier thread v2 account".into(), } })?, ), @@ -80,18 +80,18 @@ impl TryFrom<&mut ReplicaAccountInfo<'_>> for AccountUpdateEvent { } // If the account belongs to the webhook program, parse in - if owner_pubkey.eq(&clockwork_webhook_program::ID) && account_info.data.len() > 8 { + if owner_pubkey.eq(&sablier_webhook_program::ID) && account_info.data.len() > 8 { return Ok(AccountUpdateEvent::Webhook { webhook: Webhook::try_deserialize(&mut account_info.data).map_err(|_| { GeyserPluginError::AccountsUpdateError { - msg: "Failed to parse Clockwork webhook".into(), + msg: "Failed to parse Sablier webhook".into(), } })?, }); } Err(GeyserPluginError::AccountsUpdateError { - msg: "Account is not relevant to Clockwork plugin".into(), + msg: "Account is not relevant to Sablier plugin".into(), }) } } diff --git a/plugin/src/executors/tx.rs b/plugin/src/executors/tx.rs index 6f0d540c..040a27fb 100644 --- a/plugin/src/executors/tx.rs +++ b/plugin/src/executors/tx.rs @@ -8,9 +8,9 @@ use std::{ }; use bincode::serialize; -use clockwork_network_program::state::{Pool, Registry, Snapshot, SnapshotFrame, Worker}; -use clockwork_thread_program::state::VersionedThread; use log::info; +use sablier_network_program::state::{Pool, Registry, Snapshot, SnapshotFrame, Worker}; +use sablier_thread_program::state::VersionedThread; use solana_client::{ nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient}, rpc_config::RpcSimulateTransactionConfig, @@ -555,7 +555,7 @@ async fn get_tpu_client() -> TpuClient *mut dyn GeyserPlugin { - let plugin: Box = Box::::default(); + let plugin: Box = Box::::default(); Box::into_raw(plugin) } diff --git a/plugin/src/observers/thread.rs b/plugin/src/observers/thread.rs index b0e62b38..f6f738aa 100644 --- a/plugin/src/observers/thread.rs +++ b/plugin/src/observers/thread.rs @@ -6,10 +6,10 @@ use std::{ }; use chrono::{DateTime, NaiveDateTime, Utc}; -use clockwork_cron::Schedule; -use clockwork_thread_program::state::{Equality, Trigger, TriggerContext, VersionedThread}; use log::info; use pyth_sdk_solana::PriceFeed; +use sablier_cron::Schedule; +use sablier_thread_program::state::{Equality, Trigger, TriggerContext, VersionedThread}; use solana_geyser_plugin_interface::geyser_plugin_interface::{ GeyserPluginError, Result as PluginResult, }; diff --git a/plugin/src/observers/webhook.rs b/plugin/src/observers/webhook.rs index c2ba2c15..5f492f51 100644 --- a/plugin/src/observers/webhook.rs +++ b/plugin/src/observers/webhook.rs @@ -1,6 +1,6 @@ use std::{collections::HashSet, fmt::Debug, sync::Arc}; -use clockwork_webhook_program::state::Webhook; +use sablier_webhook_program::state::Webhook; use solana_geyser_plugin_interface::geyser_plugin_interface::Result as PluginResult; use solana_program::pubkey::Pubkey; use tokio::sync::RwLock; diff --git a/plugin/src/plugin.rs b/plugin/src/plugin.rs index 24fdcdb7..4e889e5f 100644 --- a/plugin/src/plugin.rs +++ b/plugin/src/plugin.rs @@ -12,11 +12,11 @@ use crate::{ config::PluginConfig, events::AccountUpdateEvent, executors::Executors, observers::Observers, }; -pub struct ClockworkPlugin { +pub struct SablierPlugin { pub inner: Arc, } -impl Debug for ClockworkPlugin { +impl Debug for SablierPlugin { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "inner: {:?}", self.inner) } @@ -30,22 +30,22 @@ pub struct Inner { pub runtime: Arc, } -impl GeyserPlugin for ClockworkPlugin { +impl GeyserPlugin for SablierPlugin { fn name(&self) -> &'static str { - "clockwork-plugin" + "sablier-plugin" } fn on_load(&mut self, config_file: &str) -> PluginResult<()> { solana_logger::setup_with_default("info"); info!( - "clockwork-plugin crate-info - spec: {}, geyser_interface_version: {}, rustc: {}", + "sablier-plugin crate-info - spec: {}, geyser_interface_version: {}, rustc: {}", env!("SPEC"), env!("GEYSER_INTERFACE_VERSION"), env!("RUSTC_VERSION") ); info!("Loading snapshot..."); let config = PluginConfig::read_from(config_file)?; - *self = ClockworkPlugin::new_from_config(config); + *self = SablierPlugin::new_from_config(config); Ok(()) } @@ -197,7 +197,7 @@ impl GeyserPlugin for ClockworkPlugin { } } -impl ClockworkPlugin { +impl SablierPlugin { fn new_from_config(config: PluginConfig) -> Self { let runtime = build_runtime(config.clone()); let observers = Arc::new(Observers::new()); @@ -213,7 +213,7 @@ impl ClockworkPlugin { } } -impl Default for ClockworkPlugin { +impl Default for SablierPlugin { fn default() -> Self { Self::new_from_config(PluginConfig::default()) } @@ -232,7 +232,7 @@ fn build_runtime(config: PluginConfig) -> Arc { Arc::new( Builder::new_multi_thread() .enable_all() - .thread_name("clockwork-plugin") + .thread_name("sablier-plugin") .worker_threads(config.thread_count) .max_blocking_threads(config.thread_count) .build() diff --git a/plugin/utils/Cargo.toml b/plugin/utils/Cargo.toml index 43f3530b..6216945e 100644 --- a/plugin/utils/Cargo.toml +++ b/plugin/utils/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "clockwork-plugin-utils" +name = "sablier-plugin-utils" version.workspace = true edition.workspace = true -description = "Clockwork Plugin Utils" +description = "Sablier Plugin Utils" license.workspace = true homepage.workspace = true repository.workspace = true @@ -12,7 +12,7 @@ keywords.workspace = true [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_plugin_utils" +name = "sablier_plugin_utils" [dependencies] serde = { workspace = true, features = ["derive"] } diff --git a/plugin/utils/README.md b/plugin/utils/README.md index afb9e98e..a31d1536 100644 --- a/plugin/utils/README.md +++ b/plugin/utils/README.md @@ -1 +1 @@ -# Clockwork Geyser Plugin Utils +# Sablier Geyser Plugin Utils diff --git a/plugin/vector.toml b/plugin/vector.toml index df6b57fc..09e3b7d2 100644 --- a/plugin/vector.toml +++ b/plugin/vector.toml @@ -29,24 +29,24 @@ source = ''' del(.grok_results) ''' -# Filter Solana logs for Clockwork logs +# Filter Solana logs for Sablier logs [transforms.filter_solana_logs] inputs = ["parse_solana_logs"] type = "filter" condition = ''' - .source == "clockwork_plugin::builders::thread_exec" || - .source == "clockwork_plugin::executors::tx" || + .source == "sablier_plugin::builders::thread_exec" || + .source == "sablier_plugin::executors::tx" || .source == "solana_validator" || .source == "solana_core::validator" || .source == "solana_metrics::metrics" ''' # Parse program logs into JSON -[transforms.parse_clockwork_logs] +[transforms.parse_sablier_logs] type = "remap" inputs = ["filter_solana_logs"] source = ''' - if .source == "clockwork_plugin::builders::thread_exec" { + if .source == "sablier_plugin::builders::thread_exec" { .grok_results = parse_groks!( .message, patterns: ["slot:%{SPACE}%{_slot} thread: %{_thread} simulation_error: %{_error} logs: %{_logs}"], @@ -65,19 +65,19 @@ source = ''' } ''' -# Filter for only Clockwork simulation logs -[transforms.filter_clockwork_simulation_logs] +# Filter for only Sablier simulation logs +[transforms.filter_sablier_simulation_logs] type = "filter" -inputs = ["parse_clockwork_logs"] +inputs = ["parse_sablier_logs"] condition = ''' - .source == "clockwork_plugin::builders::thread_exec" && + .source == "sablier_plugin::builders::thread_exec" && !is_null(.error_message) ''' -# Throttle Clockwork simulation logs -[transforms.throttle_clockwork_simulation_logs] +# Throttle Sablier simulation logs +[transforms.throttle_sablier_simulation_logs] type = "throttle" -inputs = ["filter_clockwork_simulation_logs"] +inputs = ["filter_sablier_simulation_logs"] key_field = "{{ thread }}" threshold = 1 window_secs = 30 @@ -120,22 +120,22 @@ source = ''' # InfluxDB Sink [sinks.influxdb] type = "influxdb_logs" -inputs = ["throttle_clockwork_simulation_logs"] -endpoint = "" # InfluxDB 2.0 endpoint -org = "" # InfluxDB organization name -bucket = "" # InfluxDB bucket name -measurement = "clockwork-logs" # InfluxDB table name -token = "" # InfluxDB token +inputs = ["throttle_sablier_simulation_logs"] +endpoint = "" # InfluxDB 2.0 endpoint +org = "" # InfluxDB organization name +bucket = "" # InfluxDB bucket name +measurement = "sablier-logs" # InfluxDB table name +token = "" # InfluxDB token # InfluxDB Sink [sinks.influxdb_machine] type = "influxdb_logs" inputs = ["rename_fields"] -endpoint = "" # InfluxDB 2.0 endpoint -org = "" # InfluxDB organization name -bucket = "" # InfluxDB bucket name +endpoint = "" # InfluxDB 2.0 endpoint +org = "" # InfluxDB organization name +bucket = "" # InfluxDB bucket name measurement = "machine-logs" # InfluxDB table name -token = "" # InfluxDB token +token = "" # InfluxDB token # Test Solana log parser [[tests]] @@ -178,24 +178,24 @@ source = ''' assert_eq!(.fields.cpu0_freq_mhz, "3717i") ''' -# Test Clockwork log parser +# Test Sablier log parser [[tests]] -name = "clockwork_simulation_test" +name = "sablier_simulation_test" [[tests.inputs]] insert_at = "parse_solana_logs" type = "raw" -value = '[2023-01-11T04:37:09.059509973Z INFO clockwork_plugin::builders::thread_exec] slot: 215344020 thread: 9K4g3LYdwKhTJVQv85EvsAn7uHo5pSyq7qNs2FqrsD1K simulation_error: "Transaction results in an account (1) without insufficient funds for rent" logs: ["Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv invoke [1]", "Program log: Instruction: ThreadKickoff", "Program 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv consumed 83495 of 1400000 compute units", "Program 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv success"]' +value = '[2023-01-11T04:37:09.059509973Z INFO sablier_plugin::builders::thread_exec] slot: 215344020 thread: 9K4g3LYdwKhTJVQv85EvsAn7uHo5pSyq7qNs2FqrsD1K simulation_error: "Transaction results in an account (1) without insufficient funds for rent" logs: ["Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv invoke [1]", "Program log: Instruction: ThreadKickoff", "Program 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv consumed 83495 of 1400000 compute units", "Program 3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv success"]' [[tests.outputs]] -extract_from = "parse_clockwork_logs" +extract_from = "parse_sablier_logs" [[tests.outputs.conditions]] type = "vrl" source = ''' assert_eq!(.slot, "215344020") assert_eq!(.level, "INFO") - assert_eq!(.source, "clockwork_plugin::builders::thread_exec") + assert_eq!(.source, "sablier_plugin::builders::thread_exec") assert_eq!(.thread, "9K4g3LYdwKhTJVQv85EvsAn7uHo5pSyq7qNs2FqrsD1K") assert_eq!(.error_message, "\"Transaction results in an account (1) without insufficient funds for rent\"") -''' \ No newline at end of file +''' diff --git a/programs/network/Cargo.toml b/programs/network/Cargo.toml index 2410dc7d..234609a2 100644 --- a/programs/network/Cargo.toml +++ b/programs/network/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "clockwork-network-program" +name = "sablier-network-program" version.workspace = true -description = "Clockwork networking protocol" +description = "Sablier networking protocol" edition.workspace = true license.workspace = true homepage.workspace = true @@ -12,7 +12,7 @@ keywords.workspace = true [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_network_program" +name = "sablier_network_program" [features] no-entrypoint = [] @@ -24,4 +24,4 @@ default = [] [dependencies] anchor-lang.workspace = true anchor-spl = { features = ["mint", "token"], workspace = true } -clockwork-utils.workspace = true +sablier-utils.workspace = true diff --git a/programs/network/README.md b/programs/network/README.md index 64432426..4b2b0d4d 100644 --- a/programs/network/README.md +++ b/programs/network/README.md @@ -1 +1 @@ -# Clockwork Network +# Sablier Network diff --git a/programs/network/src/errors.rs b/programs/network/src/errors.rs index d8b1df56..405e9078 100644 --- a/programs/network/src/errors.rs +++ b/programs/network/src/errors.rs @@ -1,7 +1,7 @@ use anchor_lang::prelude::*; #[error_code] -pub enum ClockworkError { +pub enum SablierError { #[msg("The worker is already in the pool")] AlreadyInPool, diff --git a/programs/network/src/instructions/fee_collect.rs b/programs/network/src/instructions/fee_collect.rs index 92e5f1a6..ced5dbdf 100644 --- a/programs/network/src/instructions/fee_collect.rs +++ b/programs/network/src/instructions/fee_collect.rs @@ -45,7 +45,7 @@ pub fn handler(ctx: Context, amount: u64, penalty: bool) -> Result<( require!( (fee.collected_balance + fee.penalty_balance + min_rent_balance) >= lamport_balance - ClockworkError::InsufficientFeeBalance + SablierError::InsufficientFeeBalance ); Ok(()) diff --git a/programs/network/src/instructions/penalty_claim.rs b/programs/network/src/instructions/penalty_claim.rs index 8fad79a9..9d740bb1 100644 --- a/programs/network/src/instructions/penalty_claim.rs +++ b/programs/network/src/instructions/penalty_claim.rs @@ -37,7 +37,7 @@ pub fn handler(ctx: Context) -> Result<()> { let claimable_balance = lamport_balance - min_rent_balance; require!( claimable_balance > 0, - ClockworkError::InsufficientPenaltyBalance + SablierError::InsufficientPenaltyBalance ); // Pay reimbursment for base transaction fee diff --git a/programs/network/src/instructions/pool_create.rs b/programs/network/src/instructions/pool_create.rs index 8e564835..746528e7 100644 --- a/programs/network/src/instructions/pool_create.rs +++ b/programs/network/src/instructions/pool_create.rs @@ -34,7 +34,7 @@ pub struct PoolCreate<'info> { mut, seeds = [SEED_REGISTRY], bump, - constraint = !registry.locked @ ClockworkError::RegistryLocked + constraint = !registry.locked @ SablierError::RegistryLocked )] pub registry: Box>, diff --git a/programs/network/src/instructions/pool_rotate.rs b/programs/network/src/instructions/pool_rotate.rs index 2b4dccbf..72543fd4 100644 --- a/programs/network/src/instructions/pool_rotate.rs +++ b/programs/network/src/instructions/pool_rotate.rs @@ -61,13 +61,13 @@ pub fn handler(ctx: Context) -> Result<()> { require!( pool.workers.len() < pool.size || is_rotation_window_open(registry, snapshot, snapshot_frame).unwrap(), - ClockworkError::PoolFull + SablierError::PoolFull ); // Verify the worker is not already in the pool. require!( !pool.workers.contains(&worker.key()), - ClockworkError::AlreadyInPool + SablierError::AlreadyInPool ); // Rotate the worker into the pool. diff --git a/programs/network/src/instructions/pool_update.rs b/programs/network/src/instructions/pool_update.rs index 7a8a132f..0c88e28a 100644 --- a/programs/network/src/instructions/pool_update.rs +++ b/programs/network/src/instructions/pool_update.rs @@ -4,7 +4,7 @@ use { prelude::*, system_program::{transfer, Transfer}, }, - clockwork_utils::account::AccountInfoExt, + sablier_utils::account::AccountInfoExt, std::mem::size_of, }; diff --git a/programs/network/src/instructions/registry_nonce_hash.rs b/programs/network/src/instructions/registry_nonce_hash.rs index 2bfdd289..db63557b 100644 --- a/programs/network/src/instructions/registry_nonce_hash.rs +++ b/programs/network/src/instructions/registry_nonce_hash.rs @@ -1,4 +1,4 @@ -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use { crate::{constants::*, state::*}, diff --git a/programs/network/src/instructions/unstake_create.rs b/programs/network/src/instructions/unstake_create.rs index ae51c8a9..e234cc6a 100644 --- a/programs/network/src/instructions/unstake_create.rs +++ b/programs/network/src/instructions/unstake_create.rs @@ -25,7 +25,7 @@ pub struct UnstakeCreate<'info> { mut, seeds = [SEED_REGISTRY], bump, - constraint = !registry.locked @ ClockworkError::RegistryLocked + constraint = !registry.locked @ SablierError::RegistryLocked )] pub registry: Account<'info, Registry>, @@ -58,7 +58,7 @@ pub fn handler(ctx: Context, amount: u64) -> Result<()> { // Validate the request is valid. require!( amount <= delegation.stake_amount, - ClockworkError::InvalidUnstakeAmount + SablierError::InvalidUnstakeAmount ); // Initialize the unstake account. diff --git a/programs/network/src/instructions/worker_create.rs b/programs/network/src/instructions/worker_create.rs index 7630ed13..cea378b0 100644 --- a/programs/network/src/instructions/worker_create.rs +++ b/programs/network/src/instructions/worker_create.rs @@ -48,11 +48,11 @@ pub struct WorkerCreate<'info> { mut, seeds = [SEED_REGISTRY], bump, - constraint = !registry.locked @ ClockworkError::RegistryLocked + constraint = !registry.locked @ SablierError::RegistryLocked )] pub registry: Account<'info, Registry>, - #[account(constraint = signatory.key() != authority.key() @ ClockworkError::InvalidSignatory)] + #[account(constraint = signatory.key() != authority.key() @ SablierError::InvalidSignatory)] pub signatory: Signer<'info>, pub system_program: Program<'info, System>, diff --git a/programs/network/src/jobs/delete_snapshot/job.rs b/programs/network/src/jobs/delete_snapshot/job.rs index 64bd6612..d67c0ad7 100644 --- a/programs/network/src/jobs/delete_snapshot/job.rs +++ b/programs/network/src/jobs/delete_snapshot/job.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/delete_snapshot/process_entry.rs b/programs/network/src/jobs/delete_snapshot/process_entry.rs index 87d02094..120248b1 100644 --- a/programs/network/src/jobs/delete_snapshot/process_entry.rs +++ b/programs/network/src/jobs/delete_snapshot/process_entry.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/delete_snapshot/process_frame.rs b/programs/network/src/jobs/delete_snapshot/process_frame.rs index 5ba5138a..165d09f1 100644 --- a/programs/network/src/jobs/delete_snapshot/process_frame.rs +++ b/programs/network/src/jobs/delete_snapshot/process_frame.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/delete_snapshot/process_snapshot.rs b/programs/network/src/jobs/delete_snapshot/process_snapshot.rs index b1b73564..718e7fce 100644 --- a/programs/network/src/jobs/delete_snapshot/process_snapshot.rs +++ b/programs/network/src/jobs/delete_snapshot/process_snapshot.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/distribute_fees/job.rs b/programs/network/src/jobs/distribute_fees/job.rs index ce52b1ae..6844aa88 100644 --- a/programs/network/src/jobs/distribute_fees/job.rs +++ b/programs/network/src/jobs/distribute_fees/job.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/distribute_fees/process_entry.rs b/programs/network/src/jobs/distribute_fees/process_entry.rs index cd05507b..4863b3ac 100644 --- a/programs/network/src/jobs/distribute_fees/process_entry.rs +++ b/programs/network/src/jobs/distribute_fees/process_entry.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/distribute_fees/process_frame.rs b/programs/network/src/jobs/distribute_fees/process_frame.rs index d791e2cb..803074d4 100644 --- a/programs/network/src/jobs/distribute_fees/process_frame.rs +++ b/programs/network/src/jobs/distribute_fees/process_frame.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/distribute_fees/process_snapshot.rs b/programs/network/src/jobs/distribute_fees/process_snapshot.rs index 3ce04846..274b1da7 100644 --- a/programs/network/src/jobs/distribute_fees/process_snapshot.rs +++ b/programs/network/src/jobs/distribute_fees/process_snapshot.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/increment_epoch/job.rs b/programs/network/src/jobs/increment_epoch/job.rs index 135161cf..034103ec 100644 --- a/programs/network/src/jobs/increment_epoch/job.rs +++ b/programs/network/src/jobs/increment_epoch/job.rs @@ -1,5 +1,5 @@ use anchor_lang::prelude::*; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/process_unstakes/job.rs b/programs/network/src/jobs/process_unstakes/job.rs index 52e82ebd..85c67dfa 100644 --- a/programs/network/src/jobs/process_unstakes/job.rs +++ b/programs/network/src/jobs/process_unstakes/job.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/process_unstakes/unstake_preprocess.rs b/programs/network/src/jobs/process_unstakes/unstake_preprocess.rs index 08e20d34..e7f7d93b 100644 --- a/programs/network/src/jobs/process_unstakes/unstake_preprocess.rs +++ b/programs/network/src/jobs/process_unstakes/unstake_preprocess.rs @@ -1,6 +1,6 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; use anchor_spl::associated_token::get_associated_token_address; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/process_unstakes/unstake_process.rs b/programs/network/src/jobs/process_unstakes/unstake_process.rs index 8c9d790f..486a6d7e 100644 --- a/programs/network/src/jobs/process_unstakes/unstake_process.rs +++ b/programs/network/src/jobs/process_unstakes/unstake_process.rs @@ -1,6 +1,6 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; use anchor_spl::token::{transfer, Token, TokenAccount, Transfer}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, errors::*, state::*}; @@ -82,7 +82,7 @@ pub fn handler(ctx: Context) -> Result { // Verify the unstake amount is valid. require!( unstake.amount <= delegation.stake_amount, - ClockworkError::InvalidUnstakeAmount + SablierError::InvalidUnstakeAmount ); // Transfer tokens from the worker to the authority. diff --git a/programs/network/src/jobs/stake_delegations/job.rs b/programs/network/src/jobs/stake_delegations/job.rs index 484f841d..8af630d0 100644 --- a/programs/network/src/jobs/stake_delegations/job.rs +++ b/programs/network/src/jobs/stake_delegations/job.rs @@ -1,5 +1,5 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/stake_delegations/process_delegation.rs b/programs/network/src/jobs/stake_delegations/process_delegation.rs index 4846eba9..1535645e 100644 --- a/programs/network/src/jobs/stake_delegations/process_delegation.rs +++ b/programs/network/src/jobs/stake_delegations/process_delegation.rs @@ -3,7 +3,7 @@ use anchor_spl::{ associated_token::get_associated_token_address, token::{transfer, Token, TokenAccount, Transfer}, }; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/stake_delegations/process_worker.rs b/programs/network/src/jobs/stake_delegations/process_worker.rs index b7e7f967..f32cdf04 100644 --- a/programs/network/src/jobs/stake_delegations/process_worker.rs +++ b/programs/network/src/jobs/stake_delegations/process_worker.rs @@ -1,6 +1,6 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; use anchor_spl::associated_token::get_associated_token_address; -use clockwork_utils::thread::ThreadResponse; +use sablier_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/take_snapshot/create_entry.rs b/programs/network/src/jobs/take_snapshot/create_entry.rs index 1e2abf9d..35191f79 100644 --- a/programs/network/src/jobs/take_snapshot/create_entry.rs +++ b/programs/network/src/jobs/take_snapshot/create_entry.rs @@ -1,6 +1,6 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; use anchor_spl::associated_token::get_associated_token_address; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use sablier_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/take_snapshot/create_frame.rs b/programs/network/src/jobs/take_snapshot/create_frame.rs index ef4046b2..1f1079df 100644 --- a/programs/network/src/jobs/take_snapshot/create_frame.rs +++ b/programs/network/src/jobs/take_snapshot/create_frame.rs @@ -1,6 +1,6 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; use anchor_spl::{associated_token::get_associated_token_address, token::TokenAccount}; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use sablier_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/take_snapshot/create_snapshot.rs b/programs/network/src/jobs/take_snapshot/create_snapshot.rs index ab89be83..cff275f4 100644 --- a/programs/network/src/jobs/take_snapshot/create_snapshot.rs +++ b/programs/network/src/jobs/take_snapshot/create_snapshot.rs @@ -1,6 +1,6 @@ use anchor_lang::{prelude::*, solana_program::instruction::Instruction, InstructionData}; use anchor_spl::associated_token::get_associated_token_address; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use sablier_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::{constants::*, state::*}; diff --git a/programs/network/src/jobs/take_snapshot/job.rs b/programs/network/src/jobs/take_snapshot/job.rs index d5cf21c4..8144df86 100644 --- a/programs/network/src/jobs/take_snapshot/job.rs +++ b/programs/network/src/jobs/take_snapshot/job.rs @@ -3,7 +3,7 @@ use anchor_lang::{ solana_program::{instruction::Instruction, system_program}, InstructionData, }; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use sablier_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::state::*; diff --git a/programs/network/src/lib.rs b/programs/network/src/lib.rs index 4869edc0..0a2c69c0 100644 --- a/programs/network/src/lib.rs +++ b/programs/network/src/lib.rs @@ -1,4 +1,4 @@ -//! This program orchestrates a Clockwork worker network deployed across a Solana cluster. +//! This program orchestrates a Sablier worker network deployed across a Solana cluster. //! It implements a PoS protocol that allows workers to rotate into "pools" proportionately to //! the amount of stake delgated to them. It also provides accounts for workers to collect fees //! and distribute those fees to delegators. @@ -11,9 +11,9 @@ mod instructions; mod jobs; use anchor_lang::prelude::*; -use clockwork_utils::thread::*; use instructions::*; use jobs::*; +use sablier_utils::thread::*; use state::*; declare_id!("F8dKseqmBoAkHx3c58Lmb9TgJv5qeTf3BbtZZSEzYvUa"); diff --git a/programs/network/src/state/worker.rs b/programs/network/src/state/worker.rs index 69f6183c..25aa4818 100644 --- a/programs/network/src/state/worker.rs +++ b/programs/network/src/state/worker.rs @@ -60,13 +60,13 @@ impl WorkerAccount for Account<'_, Worker> { fn update(&mut self, settings: WorkerSettings) -> Result<()> { require!( settings.commission_rate > 0 && settings.commission_rate <= 100, - ClockworkError::InvalidCommissionRate + SablierError::InvalidCommissionRate ); self.commission_rate = settings.commission_rate; require!( settings.signatory.ne(&self.authority), - ClockworkError::InvalidSignatory + SablierError::InvalidSignatory ); self.signatory = settings.signatory; Ok(()) diff --git a/programs/thread/Cargo.toml b/programs/thread/Cargo.toml index 1080e830..9676bedc 100644 --- a/programs/thread/Cargo.toml +++ b/programs/thread/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "clockwork-thread-program" +name = "sablier-thread-program" version.workspace = true -description = "Clockwork thread program" +description = "Sablier thread program" edition.workspace = true license.workspace = true homepage.workspace = true @@ -12,7 +12,7 @@ keywords.workspace = true [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_thread_program" +name = "sablier_thread_program" [features] no-entrypoint = [] @@ -24,8 +24,8 @@ default = [] [dependencies] anchor-lang.workspace = true chrono = { workspace = true, features = ["alloc"] } -clockwork-cron.workspace = true -clockwork-network-program = { features = ["cpi"], workspace = true } -clockwork-utils.workspace = true +sablier-cron.workspace = true +sablier-network-program = { features = ["cpi"], workspace = true } +sablier-utils.workspace = true pyth-sdk-solana.workspace = true version.workspace = true diff --git a/programs/thread/README.md b/programs/thread/README.md index 60ed1e50..dd534f13 100644 --- a/programs/thread/README.md +++ b/programs/thread/README.md @@ -1 +1 @@ -# Clockwork Thread Program v2 +# Sablier Thread Program v2 diff --git a/programs/thread/src/errors.rs b/programs/thread/src/errors.rs index 3bd0aee7..81386970 100644 --- a/programs/thread/src/errors.rs +++ b/programs/thread/src/errors.rs @@ -2,9 +2,9 @@ use anchor_lang::prelude::*; -/// Errors for the the Clockwork thread program. +/// Errors for the the Sablier thread program. #[error_code] -pub enum ClockworkError { +pub enum SablierError { /// Thrown if a exec response has an invalid program ID or cannot be parsed. #[msg("The exec response could not be parsed")] InvalidThreadResponse, diff --git a/programs/thread/src/instructions/get_crate_info.rs b/programs/thread/src/instructions/get_crate_info.rs index 73f0c6e2..488cf5e3 100644 --- a/programs/thread/src/instructions/get_crate_info.rs +++ b/programs/thread/src/instructions/get_crate_info.rs @@ -1,4 +1,4 @@ -use {anchor_lang::prelude::*, clockwork_utils::CrateInfo}; +use {anchor_lang::prelude::*, sablier_utils::CrateInfo}; /// Accounts required for the `get_crate_info` instruction. /// We are not using system program actually @@ -10,7 +10,7 @@ pub struct GetCrateInfo<'info> { pub fn handler(_ctx: Context) -> Result { let spec = format!( - "https://github.com/clockwork-xyz/clockwork/blob/v{}/programs/thread/Cargo.toml", + "https://github.com/sablier-xyz/sablier/blob/v{}/programs/thread/Cargo.toml", version!() ); let blob = ""; diff --git a/programs/thread/src/instructions/thread_create.rs b/programs/thread/src/instructions/thread_create.rs index b0a1d377..5b8b78a7 100644 --- a/programs/thread/src/instructions/thread_create.rs +++ b/programs/thread/src/instructions/thread_create.rs @@ -4,7 +4,7 @@ use anchor_lang::{ prelude::*, system_program::{transfer, Transfer}, }; -use clockwork_utils::thread::{SerializableInstruction, Trigger}; +use sablier_utils::thread::{SerializableInstruction, Trigger}; use crate::{constants::*, state::*}; diff --git a/programs/thread/src/instructions/thread_exec.rs b/programs/thread/src/instructions/thread_exec.rs index bc29b4e6..82192dc8 100644 --- a/programs/thread/src/instructions/thread_exec.rs +++ b/programs/thread/src/instructions/thread_exec.rs @@ -6,10 +6,10 @@ use anchor_lang::{ }, AnchorDeserialize, InstructionData, }; -use clockwork_network_program::state::{Fee, Pool, Worker, WorkerAccount}; -use clockwork_utils::thread::{SerializableInstruction, ThreadResponse, PAYER_PUBKEY}; +use sablier_network_program::state::{Fee, Pool, Worker, WorkerAccount}; +use sablier_utils::thread::{SerializableInstruction, ThreadResponse, PAYER_PUBKEY}; -use crate::{constants::*, errors::ClockworkError, state::*}; +use crate::{constants::*, errors::SablierError, state::*}; /// Accounts required by the `thread_exec` instruction. #[derive(Accounts)] @@ -18,11 +18,11 @@ pub struct ThreadExec<'info> { #[account( mut, seeds = [ - clockwork_network_program::constants::SEED_FEE, + sablier_network_program::constants::SEED_FEE, worker.key().as_ref(), ], bump, - seeds::program = clockwork_network_program::ID, + seeds::program = sablier_network_program::ID, has_one = worker, )] pub fee: Account<'info, Fee>, @@ -44,7 +44,7 @@ pub struct ThreadExec<'info> { thread.id.as_slice(), ], bump = thread.bump, - constraint = !thread.paused @ ClockworkError::ThreadPaused, + constraint = !thread.paused @ SablierError::ThreadPaused, constraint = thread.next_instruction.is_some(), constraint = thread.exec_context.is_some() )] @@ -68,7 +68,7 @@ pub fn handler(ctx: Context) -> Result<()> { if thread.exec_context.unwrap().last_exec_at == clock.slot && thread.exec_context.unwrap().execs_since_slot >= thread.rate_limit { - return Err(ClockworkError::RateLimitExeceeded.into()); + return Err(SablierError::RateLimitExeceeded.into()); } // Record the worker's lamports before invoking inner ixs. @@ -78,7 +78,7 @@ pub fn handler(ctx: Context) -> Result<()> { // We have already verified that it is not null during account validation. let instruction: &mut SerializableInstruction = &mut thread.next_instruction.clone().unwrap(); - // Inject the signatory's pubkey for the Clockwork payer ID. + // Inject the signatory's pubkey for the Sablier payer ID. for acc in instruction.accounts.iter_mut() { if acc.pubkey.eq(&PAYER_PUBKEY) { acc.pubkey = signatory.key(); @@ -98,7 +98,7 @@ pub fn handler(ctx: Context) -> Result<()> { )?; // Verify the inner instruction did not write data to the signatory address. - require!(signatory.data_is_empty(), ClockworkError::UnauthorizedWrite); + require!(signatory.data_is_empty(), SablierError::UnauthorizedWrite); // Parse the thread response let thread_response: Option = match get_return_data() { @@ -106,7 +106,7 @@ pub fn handler(ctx: Context) -> Result<()> { Some((program_id, return_data)) => { require!( program_id.eq(&instruction.program_id), - ClockworkError::InvalidThreadResponse + SablierError::InvalidThreadResponse ); ThreadResponse::try_from_slice(return_data.as_slice()).ok() } @@ -123,7 +123,7 @@ pub fn handler(ctx: Context) -> Result<()> { if let Some(trigger) = thread_response.trigger { require!( std::mem::discriminant(&thread.trigger) == std::mem::discriminant(&trigger), - ClockworkError::InvalidTriggerVariant + SablierError::InvalidTriggerVariant ); thread.trigger = trigger.clone(); diff --git a/programs/thread/src/instructions/thread_instruction_add.rs b/programs/thread/src/instructions/thread_instruction_add.rs index 7280b44d..6f204d3d 100644 --- a/programs/thread/src/instructions/thread_instruction_add.rs +++ b/programs/thread/src/instructions/thread_instruction_add.rs @@ -2,7 +2,7 @@ use anchor_lang::{ prelude::*, system_program::{transfer, Transfer}, }; -use clockwork_utils::account::AccountInfoExt; +use sablier_utils::account::AccountInfoExt; use crate::{constants::*, state::*}; diff --git a/programs/thread/src/instructions/thread_kickoff.rs b/programs/thread/src/instructions/thread_kickoff.rs index f6132b73..81c8c497 100644 --- a/programs/thread/src/instructions/thread_kickoff.rs +++ b/programs/thread/src/instructions/thread_kickoff.rs @@ -6,10 +6,10 @@ use std::{ use anchor_lang::prelude::*; use chrono::{DateTime, NaiveDateTime, Utc}; -use clockwork_cron::Schedule; -use clockwork_network_program::state::{Worker, WorkerAccount}; -use clockwork_utils::thread::Trigger; use pyth_sdk_solana::load_price_feed_from_account_info; +use sablier_cron::Schedule; +use sablier_network_program::state::{Worker, WorkerAccount}; +use sablier_utils::thread::Trigger; use crate::{constants::*, errors::*, state::*}; @@ -29,8 +29,8 @@ pub struct ThreadKickoff<'info> { thread.id.as_slice(), ], bump = thread.bump, - constraint = !thread.paused @ ClockworkError::ThreadPaused, - constraint = thread.next_instruction.is_none() @ ClockworkError::ThreadBusy, + constraint = !thread.paused @ SablierError::ThreadPaused, + constraint = thread.next_instruction.is_none() @ SablierError::ThreadBusy, )] pub thread: Box>, @@ -54,13 +54,13 @@ pub fn handler(ctx: Context) -> Result<()> { // Verify proof that account data has been updated. match ctx.remaining_accounts.first() { None => { - return Err(ClockworkError::TriggerConditionFailed.into()); + return Err(SablierError::TriggerConditionFailed.into()); } Some(account_info) => { // Verify the remaining account is the account this thread is listening for. require!( address.eq(account_info.key), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ); // Begin computing the data hash of this account. @@ -83,10 +83,10 @@ pub fn handler(ctx: Context) -> Result<()> { } => { require!( data_hash.ne(&prior_data_hash), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ) } - _ => return Err(ClockworkError::InvalidThreadState.into()), + _ => return Err(SablierError::InvalidThreadState.into()), } } @@ -110,16 +110,16 @@ pub fn handler(ctx: Context) -> Result<()> { None => thread.created_at.unix_timestamp, Some(exec_context) => match exec_context.trigger_context { TriggerContext::Cron { started_at } => started_at, - _ => return Err(ClockworkError::InvalidThreadState.into()), + _ => return Err(SablierError::InvalidThreadState.into()), }, }; // Verify the current timestamp is greater than or equal to the threshold timestamp. let threshold_timestamp = next_timestamp(reference_timestamp, schedule.clone()) - .ok_or(ClockworkError::TriggerConditionFailed)?; + .ok_or(SablierError::TriggerConditionFailed)?; require!( clock.unix_timestamp.ge(&threshold_timestamp), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ); // If the schedule is marked as skippable, set the started_at of the exec context to be the current timestamp. @@ -143,7 +143,7 @@ pub fn handler(ctx: Context) -> Result<()> { // Set the exec context. require!( thread.exec_context.is_none(), - ClockworkError::InvalidThreadState + SablierError::InvalidThreadState ); thread.exec_context = Some(ExecContext { exec_index: 0, @@ -154,7 +154,7 @@ pub fn handler(ctx: Context) -> Result<()> { }); } Trigger::Slot { slot } => { - require!(clock.slot.ge(&slot), ClockworkError::TriggerConditionFailed); + require!(clock.slot.ge(&slot), SablierError::TriggerConditionFailed); thread.exec_context = Some(ExecContext { exec_index: 0, execs_since_reimbursement: 0, @@ -164,10 +164,7 @@ pub fn handler(ctx: Context) -> Result<()> { }); } Trigger::Epoch { epoch } => { - require!( - clock.epoch.ge(&epoch), - ClockworkError::TriggerConditionFailed - ); + require!(clock.epoch.ge(&epoch), SablierError::TriggerConditionFailed); thread.exec_context = Some(ExecContext { exec_index: 0, execs_since_reimbursement: 0, @@ -179,7 +176,7 @@ pub fn handler(ctx: Context) -> Result<()> { Trigger::Timestamp { unix_ts } => { require!( clock.unix_timestamp.ge(&unix_ts), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ); thread.exec_context = Some(ExecContext { exec_index: 0, @@ -199,12 +196,12 @@ pub fn handler(ctx: Context) -> Result<()> { // Verify price limit has been reached. match ctx.remaining_accounts.first() { None => { - return Err(ClockworkError::TriggerConditionFailed.into()); + return Err(SablierError::TriggerConditionFailed.into()); } Some(account_info) => { require!( price_feed_pubkey.eq(account_info.key), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ); const STALENESS_THRESHOLD: u64 = 60; // staleness threshold in seconds let price_feed = load_price_feed_from_account_info(account_info).unwrap(); @@ -216,7 +213,7 @@ pub fn handler(ctx: Context) -> Result<()> { Equality::GreaterThanOrEqual => { require!( current_price.price.ge(&limit), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ); thread.exec_context = Some(ExecContext { exec_index: 0, @@ -231,7 +228,7 @@ pub fn handler(ctx: Context) -> Result<()> { Equality::LessThanOrEqual => { require!( current_price.price.le(&limit), - ClockworkError::TriggerConditionFailed + SablierError::TriggerConditionFailed ); thread.exec_context = Some(ExecContext { exec_index: 0, diff --git a/programs/thread/src/instructions/thread_update.rs b/programs/thread/src/instructions/thread_update.rs index 5a8b26e3..1b40c7df 100644 --- a/programs/thread/src/instructions/thread_update.rs +++ b/programs/thread/src/instructions/thread_update.rs @@ -1,10 +1,10 @@ -use crate::{constants::*, errors::ClockworkError, state::*}; +use crate::{constants::*, errors::SablierError, state::*}; use anchor_lang::{ prelude::*, system_program::{transfer, Transfer}, }; -use clockwork_utils::account::AccountInfoExt; +use sablier_utils::account::AccountInfoExt; /// Accounts required by the `thread_update` instruction. #[derive(Accounts)] @@ -57,7 +57,7 @@ pub fn handler(ctx: Context, settings: ThreadSettings) -> Result<( // Require the thread is not in the middle of processing. require!( std::mem::discriminant(&thread.trigger) == std::mem::discriminant(&trigger), - ClockworkError::InvalidTriggerVariant + SablierError::InvalidTriggerVariant ); thread.trigger = trigger.clone(); diff --git a/programs/thread/src/instructions/thread_withdraw.rs b/programs/thread/src/instructions/thread_withdraw.rs index 283313b8..1c58562c 100644 --- a/programs/thread/src/instructions/thread_withdraw.rs +++ b/programs/thread/src/instructions/thread_withdraw.rs @@ -40,7 +40,7 @@ pub fn handler(ctx: Context, amount: u64) -> Result<()> { require!( post_balance > minimum_rent, - ClockworkError::WithdrawalTooLarge + SablierError::WithdrawalTooLarge ); // Withdraw balance from thread to the pay_to account diff --git a/programs/thread/src/lib.rs b/programs/thread/src/lib.rs index 74c02f9b..19fb5f9d 100644 --- a/programs/thread/src/lib.rs +++ b/programs/thread/src/lib.rs @@ -11,11 +11,11 @@ pub mod state; mod instructions; use anchor_lang::prelude::*; -use clockwork_utils::{ +use instructions::*; +use sablier_utils::{ thread::{SerializableInstruction, Trigger}, CrateInfo, }; -use instructions::*; use state::*; declare_id!("CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh"); diff --git a/programs/thread/src/state/mod.rs b/programs/thread/src/state/mod.rs index 368b9b32..08f91e34 100644 --- a/programs/thread/src/state/mod.rs +++ b/programs/thread/src/state/mod.rs @@ -3,6 +3,6 @@ mod thread; mod versioned_thread; -pub use clockwork_utils::thread::*; +pub use sablier_utils::thread::*; pub use thread::*; pub use versioned_thread::*; diff --git a/programs/thread/src/state/thread.rs b/programs/thread/src/state/thread.rs index b4075ee1..0e128692 100644 --- a/programs/thread/src/state/thread.rs +++ b/programs/thread/src/state/thread.rs @@ -1,12 +1,12 @@ use std::mem::size_of; use anchor_lang::{prelude::*, AnchorDeserialize, AnchorSerialize}; -use clockwork_utils::{ +use sablier_utils::{ account::AccountInfoExt, thread::{ClockData, SerializableInstruction, Trigger}, }; -pub use clockwork_utils::thread::Equality; +pub use sablier_utils::thread::Equality; use crate::constants::{NEXT_INSTRUCTION_SIZE, SEED_THREAD}; diff --git a/programs/webhook/Cargo.toml b/programs/webhook/Cargo.toml index fdb7f398..5199b2ac 100644 --- a/programs/webhook/Cargo.toml +++ b/programs/webhook/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "clockwork-webhook-program" +name = "sablier-webhook-program" version.workspace = true -description = "Clockwork webhook program" +description = "Sablier webhook program" edition.workspace = true license.workspace = true homepage.workspace = true @@ -12,7 +12,7 @@ keywords.workspace = true [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_webhook_program" +name = "sablier_webhook_program" [features] no-entrypoint = [] diff --git a/programs/webhook/README.md b/programs/webhook/README.md index 1300bc25..931ee1dd 100644 --- a/programs/webhook/README.md +++ b/programs/webhook/README.md @@ -1 +1 @@ -# Clockwork Http +# Sablier Http diff --git a/programs/webhook/src/errors.rs b/programs/webhook/src/errors.rs index 4536471f..217e576e 100644 --- a/programs/webhook/src/errors.rs +++ b/programs/webhook/src/errors.rs @@ -1,7 +1,7 @@ use anchor_lang::prelude::*; #[error_code] -pub enum ClockworkError { +pub enum SablierError { #[msg("This instruction requires admin authority")] AdminAuthorityInvalid, diff --git a/programs/webhook/src/instructions/webhook_create.rs b/programs/webhook/src/instructions/webhook_create.rs index d3fe714f..eae01e32 100644 --- a/programs/webhook/src/instructions/webhook_create.rs +++ b/programs/webhook/src/instructions/webhook_create.rs @@ -62,7 +62,7 @@ pub fn handler( webhook.headers = headers; webhook.id = id; webhook.method = method; - webhook.relayer = Relayer::Clockwork; + webhook.relayer = Relayer::Sablier; webhook.url = url; // Transfer fees into webhook account to hold in escrow. diff --git a/programs/webhook/src/state/webhook.rs b/programs/webhook/src/state/webhook.rs index cea8b966..89a1a4c6 100644 --- a/programs/webhook/src/state/webhook.rs +++ b/programs/webhook/src/state/webhook.rs @@ -7,7 +7,7 @@ use std::{ use anchor_lang::{prelude::*, AnchorDeserialize}; use serde::{Deserialize, Serialize}; -use crate::{constants::SEED_WEBHOOK, errors::ClockworkError}; +use crate::{constants::SEED_WEBHOOK, errors::SablierError}; #[account] #[derive(Debug, Deserialize, Serialize)] @@ -69,13 +69,13 @@ impl FromStr for HttpMethod { match input.to_uppercase().as_str() { "GET" => Ok(HttpMethod::Get), "POST" => Ok(HttpMethod::Post), - _ => Err(ClockworkError::InvalidHttpMethod.into()), + _ => Err(SablierError::InvalidHttpMethod.into()), } } } #[derive(AnchorDeserialize, AnchorSerialize, Deserialize, Serialize, Debug, Clone, PartialEq)] pub enum Relayer { - Clockwork, + Sablier, Custom(String), } diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 1cb07e4a..51f8705a 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "clockwork-relayer" +name = "sablier-relayer" version.workspace = true -description = "Clockwork relayer for webhook requests" +description = "Sablier relayer for webhook requests" edition.workspace = true license.workspace = true homepage.workspace = true @@ -17,8 +17,8 @@ publish = false actix-cors.workspace = true actix-web.workspace = true anchor-lang.workspace = true -clockwork-webhook-program.workspace = true -clockwork-relayer-api.workspace = true +sablier-webhook-program.workspace = true +sablier-relayer-api.workspace = true reqwest.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/relayer/api/Cargo.toml b/relayer/api/Cargo.toml index 3747b957..b45329cb 100644 --- a/relayer/api/Cargo.toml +++ b/relayer/api/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "clockwork-relayer-api" +name = "sablier-relayer-api" version.workspace = true -description = "Clockwork relayer for webhook requests" +description = "Sablier relayer for webhook requests" edition.workspace = true license.workspace = true homepage.workspace = true @@ -12,7 +12,7 @@ keywords.workspace = true [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_relayer_api" +name = "sablier_relayer_api" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/relayer/src/main.rs b/relayer/src/main.rs index 9dd1ebcd..22e7e4b1 100644 --- a/relayer/src/main.rs +++ b/relayer/src/main.rs @@ -3,13 +3,13 @@ use std::{fs, path::Path, str::FromStr}; use actix_cors::Cors; use actix_web::{get, post, web, App, HttpServer, Responder}; use anchor_lang::{prelude::Pubkey, AccountDeserialize}; -use clockwork_relayer_api::{ +use rayon::prelude::*; +use regex::Regex; +use sablier_relayer_api::{ Relay, SecretApprove, SecretCreate, SecretGet, SecretList, SecretListResponse, SecretRevoke, SignedRequest, }; -use clockwork_webhook_program::state::{HttpMethod, Webhook}; -use rayon::prelude::*; -use regex::Regex; +use sablier_webhook_program::state::{HttpMethod, Webhook}; use serde::{Deserialize, Serialize}; use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::commitment_config::CommitmentConfig; diff --git a/scripts/build-all.sh b/scripts/build-all.sh index 8b7506f6..9693f075 100755 --- a/scripts/build-all.sh +++ b/scripts/build-all.sh @@ -85,7 +85,7 @@ SECONDS=0 # Enumerate the bins BINS=( - clockwork + sablier ) # Create bin args @@ -103,10 +103,10 @@ done # Define lib extension case $targetTriple in *darwin*) - pluginFilename=libclockwork_plugin.dylib + pluginFilename=libsablier_plugin.dylib ;; *) - pluginFilename=libclockwork_plugin.so + pluginFilename=libsablier_plugin.so ;; esac @@ -117,12 +117,12 @@ esac # Copy binaries case $targetTriple in *darwin*) - pluginFilename=libclockwork_plugin.dylib + pluginFilename=libsablier_plugin.dylib cp -fv "target/$targetTriple/$buildVariant/$pluginFilename" "$installDir"/lib - mv "$installDir"/lib/libclockwork_plugin.dylib "$installDir"/lib/libclockwork_plugin.so + mv "$installDir"/lib/libsablier_plugin.dylib "$installDir"/lib/libsablier_plugin.so ;; *) - pluginFilename=libclockwork_plugin.so + pluginFilename=libsablier_plugin.so cp -fv "target/$targetTriple/$buildVariant/$pluginFilename" "$installDir"/lib ;; esac @@ -132,9 +132,9 @@ esac cp -fv "target/$targetTriple/$buildVariant/$bin" "$installDir/bin" done - cp -fv "target/deploy/clockwork_network_program.so" "$installDir/lib" - cp -fv "target/deploy/clockwork_thread_program.so" "$installDir/lib" - cp -fv "target/deploy/clockwork_webhook_program.so" "$installDir/lib" + cp -fv "target/deploy/sablier_network_program.so" "$installDir/lib" + cp -fv "target/deploy/sablier_thread_program.so" "$installDir/lib" + cp -fv "target/deploy/sablier_webhook_program.so" "$installDir/lib" ) # Success message diff --git a/scripts/cargo-publish.sh b/scripts/cargo-publish.sh index 5642e762..c12fdc0b 100755 --- a/scripts/cargo-publish.sh +++ b/scripts/cargo-publish.sh @@ -1,27 +1,27 @@ #!/bin/bash # Publish shared libs -cargo publish -p clockwork-cron +cargo publish -p sablier-cron sleep 25 -cargo publish -p clockwork-macros +cargo publish -p sablier-macros sleep 25 -cargo publish -p clockwork-utils +cargo publish -p sablier-utils sleep 25 # Publish programs -cargo publish -p clockwork-network-program +cargo publish -p sablier-network-program sleep 25 -cargo publish -p clockwork-thread-program +cargo publish -p sablier-thread-program sleep 25 -cargo publish -p clockwork-webhook-program +cargo publish -p sablier-webhook-program sleep 25 # Publish SDK -cargo publish -p clockwork-sdk +cargo publish -p sablier-sdk sleep 25 # Publish downstream bins and libs # These are most likely to fail due to Anchor dependency issues. -cargo publish -p clockwork-client +cargo publish -p sablier-client sleep 25 -cargo publish -p clockwork-cli +cargo publish -p sablier-cli diff --git a/scripts/ci/bump-version.sh b/scripts/ci/bump-version.sh index 93ea1419..97d2afc6 100755 --- a/scripts/ci/bump-version.sh +++ b/scripts/ci/bump-version.sh @@ -34,7 +34,7 @@ if [ -n "$dry_run" ]; then fi # We need to retrieve the actual semver version from the Cargo.toml files -actual_version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "clockwork-sdk") | .version') +actual_version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "sablier-sdk") | .version') echo $actual_version >VERSION echo "New version: $actual_version" diff --git a/scripts/ci/create-tarball.sh b/scripts/ci/create-tarball.sh index 0c87c15c..fbd49a89 100755 --- a/scripts/ci/create-tarball.sh +++ b/scripts/ci/create-tarball.sh @@ -19,7 +19,7 @@ while [[ $# -gt 0 ]]; do esac done -RELEASE_BASENAME="${RELEASE_BASENAME:=clockwork-geyser-plugin-release}" +RELEASE_BASENAME="${RELEASE_BASENAME:=sablier-geyser-plugin-release}" TARBALL_BASENAME="${TARBALL_BASENAME:="$RELEASE_BASENAME"}" echo --- Creating release tarball diff --git a/scripts/debug_plugin.sh b/scripts/debug_plugin.sh index bf948a25..9ea862e5 100755 --- a/scripts/debug_plugin.sh +++ b/scripts/debug_plugin.sh @@ -3,17 +3,17 @@ set -e # Rebuid programs -rm -rf lib/clockwork_thread_program.so +rm -rf lib/sablier_thread_program.so cd programs/thread && anchor build; cd -; -cp -fv target/deploy/clockwork_thread_program.so lib/ +cp -fv target/deploy/sablier_thread_program.so lib/ # Rebuild plugin -rm -rf lib/libclockwork_plugin.dylib +rm -rf lib/libsablier_plugin.dylib cargo build --manifest-path plugin/Cargo.toml -cp -fv target/debug/libclockwork_plugin.dylib lib/ +cp -fv target/debug/libsablier_plugin.dylib lib/ # bpf-program -crate_name="hello_clockwork" +crate_name="hello_sablier" cd ~/examples/$crate_name anchor build cd - @@ -21,7 +21,7 @@ cd - # Clean ledger rm -rf test-ledger -RUST_LOG=clockwork_plugin clockwork localnet \ +RUST_LOG=sablier_plugin sablier localnet \ --bpf-program ~/examples/$crate_name/target/deploy/$crate_name-keypair.json \ --bpf-program ~/examples/$crate_name/target/deploy/$crate_name.so diff --git a/scripts/refresh-program-ids.sh b/scripts/refresh-program-ids.sh index a32269e9..53ef1567 100755 --- a/scripts/refresh-program-ids.sh +++ b/scripts/refresh-program-ids.sh @@ -7,9 +7,9 @@ cargo clean anchor build # Get pubkey addresses -program_id_network=$(solana address -k target/deploy/clockwork_network_program-keypair.json) -program_id_thread=$(solana address -k target/deploy/clockwork_thread_program-keypair.json) -program_id_webhook=$(solana address -k target/deploy/clockwork_webhook_program-keypair.json) +program_id_network=$(solana address -k target/deploy/sablier_network_program-keypair.json) +program_id_thread=$(solana address -k target/deploy/sablier_thread_program-keypair.json) +program_id_webhook=$(solana address -k target/deploy/sablier_webhook_program-keypair.json) # Update declared program IDs sed -i '' -e 's/^declare_id!(".*");/declare_id!("'${program_id_network}'");/g' programs/network/src/lib.rs @@ -17,9 +17,9 @@ sed -i '' -e 's/^declare_id!(".*");/declare_id!("'${program_id_thread}'");/g' pr sed -i '' -e 's/^declare_id!(".*");/declare_id!("'${program_id_webhook}'");/g' programs/webhook/src/lib.rs # Update Anchor config -sed -i '' -e 's/^clockwork_network_program = ".*"/clockwork_network_program = "'${program_id_network}'"/g' Anchor.toml -sed -i '' -e 's/^clockwork_thread_program = ".*"/clockwork_thread_program = "'${program_id_thread}'"/g' Anchor.toml -sed -i '' -e 's/^clockwork_webhook_program = ".*"/clockwork_webhook_program = "'${program_id_webhook}'"/g' Anchor.toml +sed -i '' -e 's/^sablier_network_program = ".*"/sablier_network_program = "'${program_id_network}'"/g' Anchor.toml +sed -i '' -e 's/^sablier_thread_program = ".*"/sablier_thread_program = "'${program_id_thread}'"/g' Anchor.toml +sed -i '' -e 's/^sablier_webhook_program = ".*"/sablier_webhook_program = "'${program_id_webhook}'"/g' Anchor.toml # Rebuild anchor build diff --git a/scripts/stake-localnet.sh b/scripts/stake-localnet.sh index e4824fb9..3370f605 100755 --- a/scripts/stake-localnet.sh +++ b/scripts/stake-localnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Stake local node with the Clockwork network +# Stake local node with the Sablier network cd cli cargo run -- node register ../test-ledger/validator-keypair.json sleep 2 diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index a2c1e85b..86a43864 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "clockwork-sdk" +name = "sablier-sdk" version.workspace = true description = "An SDK for building automated programs on Solana" edition.workspace = true @@ -11,11 +11,11 @@ readme.workspace = true keywords.workspace = true [lib] -name = "clockwork_sdk" +name = "sablier_sdk" [dependencies] anchor-lang.workspace = true -clockwork-thread-program = { workspace = true, features = ["cpi"] } +sablier-thread-program = { workspace = true, features = ["cpi"] } [features] default = [] diff --git a/sdk/README.md b/sdk/README.md index 3ec4ba41..37416f41 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1 +1 @@ -# Clockwork SDK +# Sablier SDK diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 73b9d0df..78c85243 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -1,23 +1,23 @@ -pub use clockwork_thread_program::errors; -pub use clockwork_thread_program::program::ThreadProgram; -pub use clockwork_thread_program::ID; +pub use sablier_thread_program::errors; +pub use sablier_thread_program::program::ThreadProgram; +pub use sablier_thread_program::ID; pub mod state { - pub use clockwork_thread_program::state::{ + pub use sablier_thread_program::state::{ ClockData, ExecContext, SerializableAccount, SerializableInstruction, Thread, ThreadAccount, ThreadResponse, ThreadSettings, Trigger, TriggerContext, }; } pub mod utils { - pub use clockwork_thread_program::state::Equality; - pub use clockwork_thread_program::state::PAYER_PUBKEY; + pub use sablier_thread_program::state::Equality; + pub use sablier_thread_program::state::PAYER_PUBKEY; } pub mod cpi { use anchor_lang::prelude::{CpiContext, Result}; - pub use clockwork_thread_program::cpi::accounts::{ + pub use sablier_thread_program::cpi::accounts::{ ThreadCreate, ThreadDelete, ThreadPause, ThreadReset, ThreadResume, ThreadUpdate, ThreadWithdraw, }; @@ -29,44 +29,44 @@ pub mod cpi { instructions: Vec, trigger: crate::state::Trigger, ) -> Result<()> { - clockwork_thread_program::cpi::thread_create(ctx, amount, id, instructions, trigger) + sablier_thread_program::cpi::thread_create(ctx, amount, id, instructions, trigger) } pub fn thread_delete<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadDelete<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_delete(ctx) + sablier_thread_program::cpi::thread_delete(ctx) } pub fn thread_pause<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadPause<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_pause(ctx) + sablier_thread_program::cpi::thread_pause(ctx) } pub fn thread_resume<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadResume<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_resume(ctx) + sablier_thread_program::cpi::thread_resume(ctx) } pub fn thread_reset<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadReset<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_reset(ctx) + sablier_thread_program::cpi::thread_reset(ctx) } pub fn thread_update<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadUpdate<'info>>, settings: crate::state::ThreadSettings, ) -> Result<()> { - clockwork_thread_program::cpi::thread_update(ctx, settings) + sablier_thread_program::cpi::thread_update(ctx, settings) } pub fn thread_withdraw<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadWithdraw<'info>>, amount: u64, ) -> Result<()> { - clockwork_thread_program::cpi::thread_withdraw(ctx, amount) + sablier_thread_program::cpi::thread_withdraw(ctx, amount) } } diff --git a/utils/Cargo.toml b/utils/Cargo.toml index a933dc03..fe2574f7 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "clockwork-utils" +name = "sablier-utils" version.workspace = true description = "Tools for building blocks on Solana" edition.workspace = true @@ -11,7 +11,7 @@ readme.workspace = true keywords.workspace = true [lib] -name = "clockwork_utils" +name = "sablier_utils" [dependencies] anchor-lang.workspace = true diff --git a/utils/README.md b/utils/README.md index 179ac8a7..ec0c905a 100644 --- a/utils/README.md +++ b/utils/README.md @@ -1 +1 @@ -Clockwork utils \ No newline at end of file +Sablier utils diff --git a/utils/src/explorer.rs b/utils/src/explorer.rs index 6c25f155..5b493f03 100644 --- a/utils/src/explorer.rs +++ b/utils/src/explorer.rs @@ -1,5 +1,5 @@ const EXPLORER_URL: &str = "https://explorer.solana.com"; -const CK_EXPLORER_URL: &str = "https://explorer.clockwork.xyz"; +const CK_EXPLORER_URL: &str = "https://explorer.sablier.dev"; #[derive(Default)] pub struct Explorer { @@ -59,7 +59,7 @@ impl Explorer { } } - /// Ex: https://explorer.clockwork.xyz/thread/{thread} + /// Ex: https://explorer.sablier.dev/thread/{thread} /// ?network=custom /// &customRPC=http://localhost:8899 pub fn thread_url( diff --git a/utils/src/thread.rs b/utils/src/thread.rs index 0726228a..ee2e8f0c 100644 --- a/utils/src/thread.rs +++ b/utils/src/thread.rs @@ -59,7 +59,7 @@ pub enum Trigger { /// Allows a thread to be kicked off according to a one-time or recurring schedule. Cron { - /// The schedule in cron syntax. Value must be parsable by the `clockwork_cron` package. + /// The schedule in cron syntax. Value must be parsable by the `sablier_cron` package. schedule: String, /// Boolean value indicating whether triggering moments may be skipped if they are missed (e.g. due to network downtime).