diff --git a/Cargo.lock b/Cargo.lock index 720a3f57..7bf01855 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1278,204 +1278,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "clockwork-cli" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "anchor-spl", - "anyhow", - "bincode", - "bzip2", - "cargo_metadata", - "chrono", - "clap 3.2.23", - "clockwork-cron", - "clockwork-network-program", - "clockwork-plugin-utils", - "clockwork-relayer-api", - "clockwork-thread-program", - "clockwork-utils", - "clockwork-webhook-program", - "dirs-next", - "indicatif 0.16.2", - "reqwest", - "serde", - "serde_json", - "serde_yaml", - "solana-account-decoder", - "solana-clap-utils", - "solana-cli-config", - "solana-client", - "solana-sdk", - "spl-associated-token-account", - "spl-memo 4.0.0", - "spl-token 4.0.0", - "tar", - "termcolor", - "thiserror", -] - -[[package]] -name = "clockwork-cron" -version = "2.0.19" -dependencies = [ - "chrono", - "nom", - "once_cell", -] - -[[package]] -name = "clockwork-network-program" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "anchor-spl", - "clockwork-utils", - "toml_datetime", - "winnow", -] - -[[package]] -name = "clockwork-plugin-utils" -version = "2.0.19" -dependencies = [ - "serde", - "serde_json", - "solana-geyser-plugin-interface", -] - -[[package]] -name = "clockwork-relayer" -version = "2.0.19" -dependencies = [ - "actix-cors", - "actix-web", - "anchor-lang", - "bincode", - "byte-unit", - "clockwork-relayer-api", - "clockwork-webhook-program", - "curve25519-dalek", - "lazy_static", - "rayon", - "regex", - "reqwest", - "serde", - "serde_json", - "solana-client", - "solana-sdk", - "solana-zk-token-sdk", - "tokio", -] - -[[package]] -name = "clockwork-relayer-api" -version = "2.0.19" -dependencies = [ - "bincode", - "serde", - "solana-sdk", -] - -[[package]] -name = "clockwork-sdk" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "chrono", - "clockwork-thread-program", - "nom", - "once_cell", -] - -[[package]] -name = "clockwork-thread-program" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "chrono", - "clockwork-cron", - "clockwork-network-program", - "clockwork-thread-program-v1", - "clockwork-utils", - "pyth-sdk-solana", - "static-pubkey", - "version", -] - -[[package]] -name = "clockwork-thread-program-v1" -version = "1.4.4" -dependencies = [ - "anchor-lang", - "clockwork-anchor-gen", -] - -[[package]] -name = "clockwork-utils" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "base64 0.13.1", - "serde", - "serde_json", - "static-pubkey", -] - -[[package]] -name = "clockwork-webhook-program" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "clockwork-network-program", - "clockwork-utils", - "serde", -] - -[[package]] -name = "clockwork_plugin" -version = "2.0.19" -dependencies = [ - "anchor-lang", - "async-trait", - "async_once", - "bincode", - "bs58 0.4.0", - "bugsnag", - "cargo_metadata", - "chrono", - "clockwork-cron", - "clockwork-network-program", - "clockwork-plugin-utils", - "clockwork-relayer-api", - "clockwork-thread-program", - "clockwork-thread-program-v1", - "clockwork-utils", - "clockwork-webhook-program", - "futures", - "lazy_static", - "log 0.4.17", - "prost", - "pyth-sdk-solana", - "reqwest", - "rustc_version", - "serde", - "serde_json", - "simple-error", - "solana-account-decoder", - "solana-client", - "solana-geyser-plugin-interface", - "solana-logger", - "solana-program", - "solana-quic-client", - "solana-sdk", - "solana-transaction-status", - "static-pubkey", - "thiserror", - "tokio", -] - [[package]] name = "codespan-reporting" version = "0.11.1" @@ -3207,6 +3009,204 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "open-clockwork-cli" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "anyhow", + "bincode", + "bzip2", + "cargo_metadata", + "chrono", + "clap 3.2.23", + "dirs-next", + "indicatif 0.16.2", + "open-clockwork-cron", + "open-clockwork-network-program", + "open-clockwork-plugin-utils", + "open-clockwork-relayer-api", + "open-clockwork-thread-program", + "open-clockwork-utils", + "open-clockwork-webhook-program", + "reqwest", + "serde", + "serde_json", + "serde_yaml", + "solana-account-decoder", + "solana-clap-utils", + "solana-cli-config", + "solana-client", + "solana-sdk", + "spl-associated-token-account", + "spl-memo 4.0.0", + "spl-token 4.0.0", + "tar", + "termcolor", + "thiserror", +] + +[[package]] +name = "open-clockwork-cron" +version = "0.1.0" +dependencies = [ + "chrono", + "nom", + "once_cell", +] + +[[package]] +name = "open-clockwork-network-program" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-spl", + "open-clockwork-utils", + "toml_datetime", + "winnow", +] + +[[package]] +name = "open-clockwork-plugin-utils" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "solana-geyser-plugin-interface", +] + +[[package]] +name = "open-clockwork-relayer" +version = "0.1.0" +dependencies = [ + "actix-cors", + "actix-web", + "anchor-lang", + "bincode", + "byte-unit", + "curve25519-dalek", + "lazy_static", + "open-clockwork-relayer-api", + "open-clockwork-webhook-program", + "rayon", + "regex", + "reqwest", + "serde", + "serde_json", + "solana-client", + "solana-sdk", + "solana-zk-token-sdk", + "tokio", +] + +[[package]] +name = "open-clockwork-relayer-api" +version = "0.1.0" +dependencies = [ + "bincode", + "serde", + "solana-sdk", +] + +[[package]] +name = "open-clockwork-sdk" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "chrono", + "nom", + "once_cell", + "open-clockwork-thread-program", +] + +[[package]] +name = "open-clockwork-thread-program" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "chrono", + "open-clockwork-cron", + "open-clockwork-network-program", + "open-clockwork-thread-program-v1", + "open-clockwork-utils", + "pyth-sdk-solana", + "static-pubkey", + "version", +] + +[[package]] +name = "open-clockwork-thread-program-v1" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "clockwork-anchor-gen", +] + +[[package]] +name = "open-clockwork-utils" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "base64 0.13.1", + "serde", + "serde_json", + "static-pubkey", +] + +[[package]] +name = "open-clockwork-webhook-program" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "open-clockwork-network-program", + "open-clockwork-utils", + "serde", +] + +[[package]] +name = "open_clockwork_plugin" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "async-trait", + "async_once", + "bincode", + "bs58 0.4.0", + "bugsnag", + "cargo_metadata", + "chrono", + "futures", + "lazy_static", + "log 0.4.17", + "open-clockwork-cron", + "open-clockwork-network-program", + "open-clockwork-plugin-utils", + "open-clockwork-relayer-api", + "open-clockwork-thread-program", + "open-clockwork-thread-program-v1", + "open-clockwork-utils", + "open-clockwork-webhook-program", + "prost", + "pyth-sdk-solana", + "reqwest", + "rustc_version", + "serde", + "serde_json", + "simple-error", + "solana-account-decoder", + "solana-client", + "solana-geyser-plugin-interface", + "solana-logger", + "solana-program", + "solana-quic-client", + "solana-sdk", + "solana-transaction-status", + "static-pubkey", + "thiserror", + "tokio", +] + [[package]] name = "openssl" version = "0.10.50" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c13e30a9..f68e9e5a 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "clockwork-cli" -version = "2.0.19" +name = "open-clockwork-cli" +version = "0.1.0" description = "Command line interface for Clockwork" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/cli" +repository = "https://github.com/open-clockwork/clockwork/cli" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] @@ -18,13 +18,13 @@ anyhow = "1.0.61" bincode = "1.3.3" bzip2 = "0.4" clap = { version = "3.1.2", features = ["derive"] } -clockwork-cron = { path = "../cron", version = "=2.0.19" } -clockwork-network-program = { path = "../programs/network", version = "=2.0.19", features = ["no-entrypoint"] } -clockwork-relayer-api = { path = "../relayer/api", version = "=2.0.19" } -clockwork-plugin-utils= { path = "../plugin/utils", version = "=2.0.19" } -clockwork-thread-program = { path = "../programs/thread", version = "=2.0.19", features = ["no-entrypoint"] } -clockwork-utils = { path = "../utils", version = "=2.0.19" } -clockwork-webhook-program = { path = "../programs/webhook", version = "=2.0.19", features = ["no-entrypoint"] } +open-clockwork-cron = { path = "../cron", version = "=0.1.0" } +open-clockwork-network-program = { path = "../programs/network", version = "=0.1.0", features = ["no-entrypoint"] } +open-clockwork-relayer-api = { path = "../relayer/api", version = "=0.1.0" } +open-clockwork-plugin-utils= { path = "../plugin/utils", version = "=0.1.0" } +open-clockwork-thread-program = { path = "../programs/thread", version = "=0.1.0", features = ["no-entrypoint"] } +open-clockwork-utils = { path = "../utils", version = "=0.1.0" } +open-clockwork-webhook-program = { path = "../programs/webhook", version = "=0.1.0", features = ["no-entrypoint"] } chrono = { version = "0.4.19", default-features = false, features = ["alloc"] } dirs-next = "2.0.0" indicatif = "0.16" diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 09e7e722..bb3fd664 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 open_clockwork_thread_program::state::{SerializableInstruction, Trigger}; +use open_clockwork_webhook_program::state::HttpMethod; use solana_sdk::{pubkey::Pubkey, signature::Keypair}; use crate::parser::ProgramInfo; diff --git a/cli/src/client.rs b/cli/src/client.rs index 6075781a..301ff89f 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 open_clockwork_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 2480e357..c0d95197 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -17,9 +17,9 @@ pub const CLOCKWORK_RELEASE_BASE_URL: &str = "https://github.com/clockwork-xyz/clockwork/releases/download"; pub const CLOCKWORK_BIN_LOCAL: &str = "/bin/clockwork"; pub const CLOCKWORK_DEPS: &[&str] = &[ - "clockwork_network_program.so", - "clockwork_thread_program.so", - "clockwork_webhook_program.so", + "open_clockwork_network_program.so", + "open_clockwork_thread_program.so", + "open_clockwork_webhook_program.so", "libclockwork_plugin.so", ]; pub const SOLANA_RELEASE_BASE_URL: &str = "https://github.com/solana-labs/solana/releases/download"; diff --git a/cli/src/parser.rs b/cli/src/parser.rs index 4fed558a..65821313 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 open_clockwork_thread_program::state::{SerializableAccount, SerializableInstruction, Trigger}; +use open_clockwork_webhook_program::state::HttpMethod; use serde::{Deserialize as JsonDeserialize, Serialize as JsonSerialize}; use solana_sdk::{ pubkey::Pubkey, diff --git a/cli/src/processor/config.rs b/cli/src/processor/config.rs index 6e983ef7..9ceb6c53 100644 --- a/cli/src/processor/config.rs +++ b/cli/src/processor/config.rs @@ -4,7 +4,7 @@ use anchor_lang::{ }, InstructionData, ToAccountMetas }; -use clockwork_network_program::state::{Config, ConfigSettings}; +use open_clockwork_network_program::state::{Config, ConfigSettings}; use crate::{client::Client, errors::CliError}; @@ -37,12 +37,12 @@ pub fn set( // Submit tx let ix = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::ConfigUpdate { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_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 c9e2888b..409f380c 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 open_clockwork_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 a2c80359..4a528ceb 100644 --- a/cli/src/processor/delegation.rs +++ b/cli/src/processor/delegation.rs @@ -4,7 +4,7 @@ use anchor_lang::{ }, InstructionData, AccountDeserialize, ToAccountMetas }; -use clockwork_network_program::state::{Config, Delegation, Worker}; +use open_clockwork_network_program::state::{Config, Delegation, Worker}; use spl_associated_token_account::get_associated_token_address; use crate::{client::Client, errors::CliError}; @@ -29,8 +29,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: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::DelegationCreate { associated_token_program: anchor_spl::associated_token::ID, authority: client.payer_pubkey(), config: Config::pubkey(), @@ -42,7 +42,7 @@ pub fn create(client: &Client, worker_id: u64) -> Result<(), CliError> { token_program: anchor_spl::token::ID, worker: worker_pubkey, }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DelegationCreate {}.data(), + data: open_clockwork_network_program::instruction::DelegationCreate {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); @@ -69,8 +69,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: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::DelegationDeposit { authority: client.payer_pubkey(), authority_tokens: get_associated_token_address(&client.payer_pubkey(), &config.mint), config: Config::pubkey(), @@ -78,7 +78,7 @@ pub fn deposit( delegation_tokens: get_associated_token_address(&delegation_pubkey, &config.mint), token_program: anchor_spl::token::ID, }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DelegationDeposit { amount }.data(), + data: open_clockwork_network_program::instruction::DelegationDeposit { amount }.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); @@ -105,8 +105,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: open_clockwork_network_program::ID, + accounts: open_clockwork_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( delegation_tokens: get_associated_token_address(&delegation_pubkey, &config.mint), token_program: anchor_spl::token::ID, }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::DelegationWithdraw { amount }.data(), + data: open_clockwork_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 213320c9..53de066b 100644 --- a/cli/src/processor/explorer.rs +++ b/cli/src/processor/explorer.rs @@ -1,12 +1,12 @@ use { crate::errors::CliError, crate::config::CliConfig, - clockwork_utils::explorer::Explorer, + open_clockwork_utils::explorer::Explorer, }; pub fn thread_url(thread: T, config: CliConfig) -> Result<(), CliError> { - println!("thread: {}", explorer(config).thread_url(thread, clockwork_thread_program::ID)); + println!("thread: {}", explorer(config).thread_url(thread, open_clockwork_thread_program::ID)); Ok(()) } diff --git a/cli/src/processor/initialize.rs b/cli/src/processor/initialize.rs index db30c0ec..018f3313 100644 --- a/cli/src/processor/initialize.rs +++ b/cli/src/processor/initialize.rs @@ -6,7 +6,7 @@ use anchor_lang::{ }, InstructionData, ToAccountMetas, }; -use clockwork_network_program::state::{Config, Pool, Registry, Snapshot}; +use open_clockwork_network_program::state::{Config, Pool, Registry, Snapshot}; use crate::{client::Client, errors::CliError}; @@ -14,8 +14,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: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::Initialize { admin, config: Config::pubkey(), mint, @@ -23,11 +23,11 @@ pub fn initialize(client: &Client, mint: Pubkey) -> Result<(), CliError> { snapshot: Snapshot::pubkey(0), system_program: system_program::ID, }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::Initialize {}.data(), + data: open_clockwork_network_program::instruction::Initialize {}.data(), }; let ix_b = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::PoolCreate { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::PoolCreate { admin, config: Config::pubkey(), payer: admin, @@ -35,7 +35,7 @@ pub fn initialize(client: &Client, mint: Pubkey) -> Result<(), CliError> { registry: Registry::pubkey(), system_program: system_program::ID, }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::PoolCreate {}.data(), + data: open_clockwork_network_program::instruction::PoolCreate {}.data(), }; // Submit tx diff --git a/cli/src/processor/localnet.rs b/cli/src/processor/localnet.rs index cf28bfe0..6dcecd8a 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}, + open_clockwork_network_program::state::{Config, ConfigSettings, Registry}, + open_clockwork_thread_program::state::{Thread, Trigger}, solana_sdk::{ native_token::LAMPORTS_PER_SOL, program_pack::Pack, @@ -152,75 +152,75 @@ fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> { let epoch_thread_id = "clockwork.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: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::DistributeFeesJob {}.data(), }; let ix_a2 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::ProcessUnstakesJob { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::ProcessUnstakesJob {}.data(), }; let ix_a3 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::StakeDelegationsJob { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::StakeDelegationsJob {}.data(), }; let ix_a4 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::TakeSnapshotJob { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::TakeSnapshotJob {}.data(), }; let ix_a5 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::EpochCutover { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::IncrementEpoch {}.data(), }; let ix_a6 = Instruction { - program_id: clockwork_network_program::ID, - accounts: clockwork_network_program::accounts::DeleteSnapshotJob { + program_id: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::DeleteSnapshotJob {}.data(), }; let ix_a = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadCreate { + program_id: open_clockwork_thread_program::ID, + accounts: open_clockwork_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: open_clockwork_thread_program::instruction::ThreadCreate { amount: LAMPORTS_PER_SOL, id: epoch_thread_id.into(), instructions: vec![ @@ -243,25 +243,25 @@ fn create_threads(client: &Client, mint_pubkey: Pubkey) -> Result<()> { let hasher_thread_id = "clockwork.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: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_network_program::instruction::RegistryNonceHash {}.data(), }; let ix_b = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadCreate { + program_id: open_clockwork_thread_program::ID, + accounts: open_clockwork_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: open_clockwork_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: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_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 = open_clockwork_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, open_clockwork_network_program::ID, "network") + .bpf_program(config, open_clockwork_thread_program::ID, "thread") + .bpf_program(config, open_clockwork_webhook_program::ID, "webhook") .network_url(network_url) .clone_addresses(clone_addresses) .add_programs_with_path(program_infos) @@ -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!("open_clockwork_{}_program.so", program_name); self.arg("--bpf-program") .arg(program_id.to_string()) .arg(config.active_runtime(filename.as_str()).to_owned()) diff --git a/cli/src/processor/pool.rs b/cli/src/processor/pool.rs index 8da7c4a0..696babf2 100644 --- a/cli/src/processor/pool.rs +++ b/cli/src/processor/pool.rs @@ -4,7 +4,7 @@ use anchor_lang::{ }, InstructionData, ToAccountMetas }; -use clockwork_network_program::state::{Config, Pool, Registry, PoolSettings}; +use open_clockwork_network_program::state::{Config, Pool, Registry, PoolSettings}; use crate::{client::Client, errors::CliError}; @@ -38,15 +38,15 @@ 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: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::PoolUpdate { admin: client.payer_pubkey(), config: Config::pubkey(), payer: client.payer_pubkey(), pool: pool_pubkey, system_program: system_program::ID, }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::PoolUpdate { settings }.data(), + data: open_clockwork_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 bf6a99e4..fc6f9444 100644 --- a/cli/src/processor/registry.rs +++ b/cli/src/processor/registry.rs @@ -2,12 +2,12 @@ use anchor_lang::{ solana_program::instruction::Instruction, InstructionData, ToAccountMetas }; -use clockwork_network_program::state::{Config, Registry, Snapshot}; +use open_clockwork_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 = open_clockwork_network_program::state::Registry::pubkey(); let registry = client .get::(®istry_pubkey) .map_err(|_err| CliError::AccountDataNotParsable(registry_pubkey.to_string()))?; @@ -24,13 +24,13 @@ 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: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_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..1130e3e8 100644 --- a/cli/src/processor/secret.rs +++ b/cli/src/processor/secret.rs @@ -1,5 +1,5 @@ use anchor_lang::prelude::Pubkey; -use clockwork_relayer_api::{ +use open_clockwork_relayer_api::{ SecretApprove, SecretCreate, SecretGet, SecretList, SecretRevoke, SignedRequest, }; use reqwest::header::CONTENT_TYPE; diff --git a/cli/src/processor/snapshot.rs b/cli/src/processor/snapshot.rs index 1c7a502f..ac76fc02 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 open_clockwork_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 = open_clockwork_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); + open_clockwork_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); + open_clockwork_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 d7aca69e..31ddab8f 100644 --- a/cli/src/processor/thread.rs +++ b/cli/src/processor/thread.rs @@ -2,19 +2,19 @@ use anchor_lang::{ solana_program::{instruction::Instruction, system_program}, InstructionData, AccountDeserialize, ToAccountMetas }; -use clockwork_thread_program::state::{SerializableInstruction, Thread, ThreadSettings, Trigger, VersionedThread}; -use clockwork_utils::CrateInfo; +use open_clockwork_thread_program::state::{SerializableInstruction, Thread, ThreadSettings, Trigger, VersionedThread}; +use open_clockwork_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: open_clockwork_thread_program::ID, + accounts: open_clockwork_thread_program::accounts::GetCrateInfo { system_program: system_program::ID, }.to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::GetCrateInfo {}.data(), + data: open_clockwork_thread_program::instruction::GetCrateInfo {}.data(), }; let crate_info: CrateInfo = client.get_return_data(ix).unwrap(); println!("{:#?}", crate_info); @@ -29,14 +29,14 @@ 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: open_clockwork_thread_program::ID, + accounts: open_clockwork_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: open_clockwork_thread_program::instruction::ThreadCreate { amount: 0, id: id.into_bytes(), instructions, @@ -52,13 +52,13 @@ 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: open_clockwork_thread_program::ID, + accounts: open_clockwork_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: open_clockwork_thread_program::instruction::ThreadDelete {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); Ok(()) @@ -74,12 +74,12 @@ 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: open_clockwork_thread_program::ID, + accounts: open_clockwork_thread_program::accounts::ThreadPause { authority: client.payer_pubkey(), thread: thread_pubkey, }.to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadPause {}.data(), + data: open_clockwork_thread_program::instruction::ThreadPause {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; @@ -89,12 +89,12 @@ 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: open_clockwork_thread_program::ID, + accounts: open_clockwork_thread_program::accounts::ThreadResume { authority: client.payer_pubkey(), thread: thread_pubkey }.to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadResume {}.data(), + data: open_clockwork_thread_program::instruction::ThreadResume {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; @@ -104,12 +104,12 @@ 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: open_clockwork_thread_program::ID, + accounts: open_clockwork_thread_program::accounts::ThreadReset { authority: client.payer_pubkey(), thread: thread_pubkey }.to_account_metas(Some(false)), - data: clockwork_thread_program::instruction::ThreadReset {}.data(), + data: open_clockwork_thread_program::instruction::ThreadReset {}.data(), }; client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); get(client, thread_pubkey)?; @@ -139,13 +139,13 @@ pub fn update( trigger, }; let ix = Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadUpdate { + program_id: open_clockwork_thread_program::ID, + accounts: open_clockwork_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: open_clockwork_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..75b26a63 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 open_clockwork_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: open_clockwork_webhook_program::ID, + accounts: open_clockwork_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: open_clockwork_webhook_program::instruction::WebhookCreate { body, headers, id: id.clone(), diff --git a/cli/src/processor/worker.rs b/cli/src/processor/worker.rs index 3b2db1e9..1e86538e 100644 --- a/cli/src/processor/worker.rs +++ b/cli/src/processor/worker.rs @@ -6,7 +6,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 open_clockwork_network_program::state::{ Config, Fee, Penalty, Registry, Snapshot, SnapshotFrame, Worker, WorkerSettings, }; use solana_sdk::signature::{Keypair, Signer}; @@ -92,8 +92,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: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::WorkerCreate { associated_token_program: associated_token::ID, authority: client.payer_pubkey(), config: Config::pubkey(), @@ -108,7 +108,7 @@ pub fn create(client: &Client, signatory: Keypair, silent: bool) -> Result<(), C worker: worker_pubkey, worker_tokens: get_associated_token_address(&worker_pubkey, &config.mint), }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::WorkerCreate {}.data(), + data: open_clockwork_network_program::instruction::WorkerCreate {}.data(), }; client .send_and_confirm(&[ix], &[client.payer(), &signatory]) @@ -132,13 +132,13 @@ 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: open_clockwork_network_program::ID, + accounts: open_clockwork_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: open_clockwork_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 cb7188a4..1f9aab68 100644 --- a/cron/Cargo.toml +++ b/cron/Cargo.toml @@ -1,17 +1,17 @@ [package] -name = "clockwork-cron" -version = "2.0.19" +name = "open-clockwork-cron" +version = "0.1.0" description = "A cron expression parser that's safe to use in the Solana runtime" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" +repository = "https://github.com/open-clockwork/clockwork" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] -name = "clockwork_cron" +name = "open_clockwork_cron" [dependencies] chrono = { version = "0.4.19", default-features = false, features = ["alloc"] } diff --git a/cron/tests/lib.rs b/cron/tests/lib.rs index c37f3ce6..8465171b 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 open_clockwork_cron::{Schedule, TimeUnitSpec}; use std::str::FromStr; #[test] diff --git a/plugin/Cargo.toml b/plugin/Cargo.toml index 6e3fef8f..5158bb3d 100644 --- a/plugin/Cargo.toml +++ b/plugin/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "clockwork_plugin" -version = "2.0.19" +name = "open_clockwork_plugin" +version = "0.1.0" # this needs to match whatever solana uses! rust-version = "1.72.0" edition = "2021" description = "Clockwork plugin for Solana validators" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/plugin" +repository = "https://github.com/open-clockwork/clockwork/plugin" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] @@ -16,7 +16,7 @@ publish = false [lib] crate-type = ["cdylib", "rlib"] -name = "clockwork_plugin" +name = "open_clockwork_plugin" [dependencies] anchor-lang = "0.28.0" @@ -26,14 +26,14 @@ bincode = "1.3.3" bs58 = "0.4.0" bugsnag = "0.2.1" chrono = { version = "0.4.19", default-features = false, features = ["alloc"] } -clockwork-cron = { path = "../cron", version = "=2.0.19" } -clockwork-network-program = { path = "../programs/network", version = "=2.0.19" } -clockwork-plugin-utils = { path = "utils", version = "=2.0.19" } -clockwork-relayer-api = { path = "../relayer/api", version = "=2.0.19" } -clockwork-thread-program = { package = "clockwork-thread-program", path = "../programs/thread", version = "=2.0.19" } -clockwork-thread-program-v1 = { package = "clockwork-thread-program-v1", path = "../programs/thread/v1", version = "=1.4.4" } -clockwork-webhook-program = { path = "../programs/webhook", version = "=2.0.19" } -clockwork-utils = { path = "../utils", version = "=2.0.19" } +open-clockwork-cron = { path = "../cron", version = "=0.1.0" } +open-clockwork-network-program = { path = "../programs/network", version = "=0.1.0" } +open-clockwork-plugin-utils = { path = "utils", version = "=0.1.0" } +open-clockwork-relayer-api = { path = "../relayer/api", version = "=0.1.0" } +open-clockwork-thread-program = { package = "open-clockwork-thread-program", path = "../programs/thread", version = "=0.1.0" } +open-clockwork-thread-program-v1 = { package = "open-clockwork-thread-program-v1", path = "../programs/thread/v1", version = "=0.1.0" } +open-clockwork-webhook-program = { path = "../programs/webhook", version = "=0.1.0" } +open-clockwork-utils = { path = "../utils", version = "=0.1.0" } lazy_static = "1.4.0" log = "0.4" prost = "0.10.0" diff --git a/plugin/src/builders/pool_rotation.rs b/plugin/src/builders/pool_rotation.rs index 85c2f504..832c68a0 100644 --- a/plugin/src/builders/pool_rotation.rs +++ b/plugin/src/builders/pool_rotation.rs @@ -4,7 +4,7 @@ use anchor_lang::{ solana_program::instruction::Instruction, InstructionData, ToAccountMetas }; -use clockwork_network_program::state::{Config, Pool, Registry, Snapshot, SnapshotFrame, Worker}; +use open_clockwork_network_program::state::{Config, Pool, Registry, Snapshot, SnapshotFrame, Worker}; use log::info; use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::{signature::Keypair, signer::Signer, transaction::Transaction}; @@ -67,8 +67,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: open_clockwork_network_program::ID, + accounts: open_clockwork_network_program::accounts::PoolRotate { config: Config::pubkey(), pool: Pool::pubkey(0), registry: Registry::pubkey(), @@ -77,7 +77,7 @@ pub async fn build_pool_rotation_tx<'a>( snapshot_frame: SnapshotFrame::pubkey(snapshot_pubkey, worker_id), worker: Worker::pubkey(worker_id), }.to_account_metas(Some(false)), - data: clockwork_network_program::instruction::PoolRotate {}.data(), + data: open_clockwork_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 e0ac02df..a790a2ad 100644 --- a/plugin/src/builders/thread_exec.rs +++ b/plugin/src/builders/thread_exec.rs @@ -1,9 +1,9 @@ use std::sync::Arc; use anchor_lang::{InstructionData, ToAccountMetas}; -use clockwork_thread_program::state::{VersionedThread, Trigger}; -use clockwork_network_program::state::Worker; -use clockwork_utils::thread::PAYER_PUBKEY; +use open_clockwork_thread_program::state::{VersionedThread, Trigger}; +use open_clockwork_network_program::state::Worker; +use open_clockwork_utils::thread::PAYER_PUBKEY; use log::info; use solana_account_decoder::UiAccountEncoding; use solana_client::{ @@ -222,24 +222,24 @@ fn build_kickoff_ix( // Build the instruction. let mut kickoff_ix = match thread { VersionedThread::V1(_) => Instruction { - program_id: clockwork_thread_program_v1::ID, - accounts: clockwork_thread_program_v1::accounts::ThreadKickoff { + program_id: open_clockwork_thread_program_v1::ID, + accounts: open_clockwork_thread_program_v1::accounts::ThreadKickoff { signatory: signatory_pubkey, thread: thread_pubkey, worker: worker_pubkey, } .to_account_metas(Some(false)), - data: clockwork_thread_program_v1::instruction::ThreadKickoff {}.data(), + data: open_clockwork_thread_program_v1::instruction::ThreadKickoff {}.data(), }, VersionedThread::V2(_) => Instruction { - program_id: clockwork_thread_program::ID, - accounts: clockwork_thread_program::accounts::ThreadKickoff { + program_id: open_clockwork_thread_program::ID, + accounts: open_clockwork_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: open_clockwork_thread_program::instruction::ThreadKickoff {}.data(), }, }; @@ -278,29 +278,29 @@ fn build_exec_ix( // Build the instruction. let mut exec_ix = match thread { VersionedThread::V1(_) => Instruction { - program_id: clockwork_thread_program_v1::ID, - accounts: clockwork_thread_program_v1::accounts::ThreadExec { - fee: clockwork_network_program::state::Fee::pubkey(worker_pubkey), - penalty: clockwork_network_program::state::Penalty::pubkey(worker_pubkey), - pool: clockwork_network_program::state::Pool::pubkey(0), + program_id: open_clockwork_thread_program_v1::ID, + accounts: open_clockwork_thread_program_v1::accounts::ThreadExec { + fee: open_clockwork_network_program::state::Fee::pubkey(worker_pubkey), + penalty: open_clockwork_network_program::state::Penalty::pubkey(worker_pubkey), + pool: open_clockwork_network_program::state::Pool::pubkey(0), signatory: signatory_pubkey, thread: thread_pubkey, worker: worker_pubkey, } .to_account_metas(Some(true)), - data: clockwork_thread_program_v1::instruction::ThreadExec {}.data(), + data: open_clockwork_thread_program_v1::instruction::ThreadExec {}.data(), }, VersionedThread::V2(_) => 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: open_clockwork_thread_program::ID, + accounts: open_clockwork_thread_program::accounts::ThreadExec { + fee: open_clockwork_network_program::state::Fee::pubkey(worker_pubkey), + pool: open_clockwork_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: open_clockwork_thread_program::instruction::ThreadExec {}.data(), }, }; diff --git a/plugin/src/events.rs b/plugin/src/events.rs index 7c8278fe..e2f64e1b 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 as ThreadV2, VersionedThread}; -use clockwork_thread_program_v1::state::Thread as ThreadV1; -use clockwork_webhook_program::state::Webhook; +use open_clockwork_thread_program::state::{Thread as ThreadV2, VersionedThread}; +use open_clockwork_thread_program_v1::state::Thread as ThreadV1; +use open_clockwork_webhook_program::state::Webhook; use pyth_sdk_solana::{load_price_feed_from_account_info, PriceFeed}; use solana_geyser_plugin_interface::geyser_plugin_interface::{ GeyserPluginError, ReplicaAccountInfo, @@ -42,7 +42,7 @@ impl TryFrom<&mut ReplicaAccountInfo<'_>> for AccountUpdateEvent { } // If the account belongs to the thread v1 program, parse it. - if owner_pubkey.eq(&clockwork_thread_program_v1::ID) && account_info.data.len() > 8 { + if owner_pubkey.eq(&open_clockwork_thread_program_v1::ID) && account_info.data.len() > 8 { let d = &account_info.data[..8]; if d.eq(&ThreadV1::discriminator()) { return Ok(AccountUpdateEvent::Thread { @@ -58,7 +58,7 @@ 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(&open_clockwork_thread_program::ID) && account_info.data.len() > 8 { let d = &account_info.data[..8]; if d.eq(&ThreadV2::discriminator()) { return Ok(AccountUpdateEvent::Thread { @@ -97,7 +97,7 @@ 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(&open_clockwork_webhook_program::ID) && account_info.data.len() > 8 { return Ok(AccountUpdateEvent::Webhook { webhook: Webhook::try_deserialize(&mut account_info.data).map_err(|_| { GeyserPluginError::AccountsUpdateError { diff --git a/plugin/src/executors/tx.rs b/plugin/src/executors/tx.rs index a33828f5..c842d9c7 100644 --- a/plugin/src/executors/tx.rs +++ b/plugin/src/executors/tx.rs @@ -9,8 +9,8 @@ use std::{ }; use bincode::serialize; -use clockwork_network_program::state::{Pool, Registry, Snapshot, SnapshotFrame, Worker}; -use clockwork_thread_program::state::VersionedThread; +use open_clockwork_network_program::state::{Pool, Registry, Snapshot, SnapshotFrame, Worker}; +use open_clockwork_thread_program::state::VersionedThread; use log::info; use solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}; use solana_client::{ diff --git a/plugin/src/executors/webhook.rs b/plugin/src/executors/webhook.rs index ea459487..b6cd552b 100644 --- a/plugin/src/executors/webhook.rs +++ b/plugin/src/executors/webhook.rs @@ -1,8 +1,8 @@ use std::{fmt::Debug, sync::Arc}; use anchor_lang::prelude::Pubkey; -use clockwork_webhook_program::state::Webhook; -use clockwork_relayer_api::Relay; +use open_clockwork_webhook_program::state::Webhook; +use open_clockwork_relayer_api::Relay; use log::info; use reqwest::header::CONTENT_TYPE; use solana_client::nonblocking::rpc_client::RpcClient; diff --git a/plugin/src/lib.rs b/plugin/src/lib.rs index 98954f33..df1847ec 100644 --- a/plugin/src/lib.rs +++ b/plugin/src/lib.rs @@ -1,5 +1,5 @@ pub mod config { - pub use clockwork_plugin_utils::PluginConfig; + pub use open_clockwork_plugin_utils::PluginConfig; } use solana_geyser_plugin_interface::geyser_plugin_interface::GeyserPlugin; diff --git a/plugin/src/observers/thread.rs b/plugin/src/observers/thread.rs index be8114c1..f5d202df 100644 --- a/plugin/src/observers/thread.rs +++ b/plugin/src/observers/thread.rs @@ -6,8 +6,8 @@ use std::{ }; use chrono::{DateTime, NaiveDateTime, Utc}; -use clockwork_cron::Schedule; -use clockwork_thread_program::state::{Trigger, TriggerContext, Equality, VersionedThread}; +use open_clockwork_cron::Schedule; +use open_clockwork_thread_program::state::{Trigger, TriggerContext, Equality, VersionedThread}; use log::info; use pyth_sdk_solana::PriceFeed; use solana_geyser_plugin_interface::geyser_plugin_interface::{ diff --git a/plugin/src/observers/webhook.rs b/plugin/src/observers/webhook.rs index e9a5bb04..371691c6 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 open_clockwork_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/utils/Cargo.toml b/plugin/utils/Cargo.toml index 17a85271..d96d46b3 100644 --- a/plugin/utils/Cargo.toml +++ b/plugin/utils/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "clockwork-plugin-utils" -version = "2.0.19" +name = "open-clockwork-plugin-utils" +version = "0.1.0" edition = "2021" description = "Clockwork Plugin Utils" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/plugin/utils" +repository = "https://github.com/open-clockwork/clockwork/plugin/utils" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_plugin_utils" +name = "open_clockwork_plugin_utils" [dependencies] serde = { version = "1.0", features = ["derive"] } diff --git a/programs/network/Cargo.toml b/programs/network/Cargo.toml index 751a527e..d8e64a2d 100644 --- a/programs/network/Cargo.toml +++ b/programs/network/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "clockwork-network-program" -version = "2.0.19" +name = "open-clockwork-network-program" +version = "0.1.0" description = "Clockwork networking protocol" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" +repository = "https://github.com/open-clockwork/clockwork" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_network_program" +name = "open_clockwork_network_program" [features] no-entrypoint = [] @@ -24,6 +24,6 @@ default = [] [dependencies] anchor-lang = "0.28.0" anchor-spl = { features = ["mint", "token"], version = "0.28.0" } -clockwork-utils = { path = "../../utils", version = "=2.0.19" } +open-clockwork-utils = { path = "../../utils", version = "=0.1.0" } winnow = "=0.4.1" toml_datetime = "=0.6.1" diff --git a/programs/network/src/instructions/registry_nonce_hash.rs b/programs/network/src/instructions/registry_nonce_hash.rs index c29224bb..6d8dc6e6 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 open_clockwork_utils::thread::ThreadResponse; use {crate::state::*, anchor_lang::prelude::*}; diff --git a/programs/network/src/jobs/delete_snapshot/job.rs b/programs/network/src/jobs/delete_snapshot/job.rs index 3374a4da..7d043735 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 open_clockwork_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 dd8f2abe..cce8f9bf 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::*, InstructionData, solana_program::instruction::Instruction}; -use clockwork_utils::thread::ThreadResponse; +use open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/delete_snapshot/process_frame.rs b/programs/network/src/jobs/delete_snapshot/process_frame.rs index 9fa1fe50..78b623bd 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::*, InstructionData, solana_program::instruction::Instruction}; -use clockwork_utils::thread::ThreadResponse; +use open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/delete_snapshot/process_snapshot.rs b/programs/network/src/jobs/delete_snapshot/process_snapshot.rs index d3560e21..ad2643e5 100644 --- a/programs/network/src/jobs/delete_snapshot/process_snapshot.rs +++ b/programs/network/src/jobs/delete_snapshot/process_snapshot.rs @@ -1,4 +1,4 @@ -use clockwork_utils::thread::ThreadResponse; +use open_clockwork_utils::thread::ThreadResponse; use anchor_lang::{prelude::*, InstructionData, solana_program::instruction::Instruction}; use crate::state::*; diff --git a/programs/network/src/jobs/distribute_fees/job.rs b/programs/network/src/jobs/distribute_fees/job.rs index 3723bc93..f7d957bd 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 open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/distribute_fees/process_entry.rs b/programs/network/src/jobs/distribute_fees/process_entry.rs index a5e50b4d..5550d745 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 open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/distribute_fees/process_frame.rs b/programs/network/src/jobs/distribute_fees/process_frame.rs index 1f7a3ef4..cc191055 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 open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/distribute_fees/process_snapshot.rs b/programs/network/src/jobs/distribute_fees/process_snapshot.rs index 86b7fbd4..b6cec8f6 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 open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/increment_epoch/job.rs b/programs/network/src/jobs/increment_epoch/job.rs index 782af661..200680ed 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 open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/process_unstakes/job.rs b/programs/network/src/jobs/process_unstakes/job.rs index 00d9ca51..67bf0192 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 open_clockwork_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 c418f2d2..ce4ccfec 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 open_clockwork_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 fc28be27..b660a8d0 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 open_clockwork_utils::thread::ThreadResponse; use crate::{errors::*, state::*}; diff --git a/programs/network/src/jobs/stake_delegations/job.rs b/programs/network/src/jobs/stake_delegations/job.rs index 2c9ea585..9a3c334d 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 open_clockwork_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 32f19b65..65125d99 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 open_clockwork_utils::thread::ThreadResponse; use crate::state::*; diff --git a/programs/network/src/jobs/stake_delegations/process_worker.rs b/programs/network/src/jobs/stake_delegations/process_worker.rs index 8f6fb900..a48d4f40 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 open_clockwork_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 8c06e94d..dc11e1c4 100644 --- a/programs/network/src/jobs/take_snapshot/create_entry.rs +++ b/programs/network/src/jobs/take_snapshot/create_entry.rs @@ -6,7 +6,7 @@ use anchor_lang::{ InstructionData, }; use anchor_spl::associated_token::get_associated_token_address; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use open_clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::state::*; diff --git a/programs/network/src/jobs/take_snapshot/create_frame.rs b/programs/network/src/jobs/take_snapshot/create_frame.rs index 7e95bbb6..269a04e8 100644 --- a/programs/network/src/jobs/take_snapshot/create_frame.rs +++ b/programs/network/src/jobs/take_snapshot/create_frame.rs @@ -4,7 +4,7 @@ use anchor_lang::{ InstructionData, }; use anchor_spl::{associated_token::get_associated_token_address, token::TokenAccount}; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use open_clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use std::mem::size_of; use crate::state::*; diff --git a/programs/network/src/jobs/take_snapshot/create_snapshot.rs b/programs/network/src/jobs/take_snapshot/create_snapshot.rs index a98cacdc..8d9eb07b 100644 --- a/programs/network/src/jobs/take_snapshot/create_snapshot.rs +++ b/programs/network/src/jobs/take_snapshot/create_snapshot.rs @@ -6,7 +6,7 @@ use anchor_lang::{ InstructionData, }; use anchor_spl::associated_token::get_associated_token_address; -use clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; +use open_clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::state::*; diff --git a/programs/network/src/jobs/take_snapshot/job.rs b/programs/network/src/jobs/take_snapshot/job.rs index faaebbaa..2a068182 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 open_clockwork_utils::thread::{ThreadResponse, PAYER_PUBKEY}; use crate::state::*; diff --git a/programs/network/src/lib.rs b/programs/network/src/lib.rs index 4a58af68..0501a7ad 100644 --- a/programs/network/src/lib.rs +++ b/programs/network/src/lib.rs @@ -10,7 +10,7 @@ mod instructions; mod jobs; use anchor_lang::prelude::*; -use clockwork_utils::thread::*; +use open_clockwork_utils::thread::*; use instructions::*; use jobs::*; use state::*; diff --git a/programs/thread/Cargo.toml b/programs/thread/Cargo.toml index 83b92d59..fd3e5699 100644 --- a/programs/thread/Cargo.toml +++ b/programs/thread/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "clockwork-thread-program" -version = "2.0.19" +name = "open-clockwork-thread-program" +version = "0.1.0" description = "Clockwork thread program" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" +repository = "https://github.com/open-clockwork/clockwork" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_thread_program" +name = "open_clockwork_thread_program" [features] no-entrypoint = [] @@ -24,10 +24,10 @@ default = [] [dependencies] anchor-lang = "0.28.0" chrono = { version = "0.4.19", default-features = false, features = ["alloc"] } -clockwork-cron = { path = "../../cron", version = "=2.0.19" } -clockwork-network-program = { path = "../network", features = ["cpi"], version = "=2.0.19" } -clockwork-thread-program-v1 = { path = "v1", version = "=1.4.4" } -clockwork-utils = { path = "../../utils", version = "=2.0.19" } +open-clockwork-cron = { path = "../../cron", version = "=0.1.0" } +open-clockwork-network-program = { path = "../network", features = ["cpi"], version = "=0.1.0" } +open-clockwork-thread-program-v1 = { path = "v1", version = "=0.1.0" } +open-clockwork-utils = { path = "../../utils", version = "=0.1.0" } pyth-sdk-solana = "0.8.0" static-pubkey = "1.0.3" version = "3.0.0" diff --git a/programs/thread/src/instructions/get_crate_info.rs b/programs/thread/src/instructions/get_crate_info.rs index d3b66abf..14ecc8a2 100644 --- a/programs/thread/src/instructions/get_crate_info.rs +++ b/programs/thread/src/instructions/get_crate_info.rs @@ -1,6 +1,6 @@ use { anchor_lang::{prelude::*, system_program}, - clockwork_utils::CrateInfo, + open_clockwork_utils::CrateInfo, }; /// Accounts required for the `get_crate_info` instruction. diff --git a/programs/thread/src/instructions/thread_create.rs b/programs/thread/src/instructions/thread_create.rs index 3fb9d1df..a7a11361 100644 --- a/programs/thread/src/instructions/thread_create.rs +++ b/programs/thread/src/instructions/thread_create.rs @@ -5,7 +5,7 @@ use anchor_lang::{ solana_program::system_program, system_program::{transfer, Transfer} }; -use clockwork_utils::thread::{Trigger, SerializableInstruction}; +use open_clockwork_utils::thread::{Trigger, SerializableInstruction}; use crate::state::*; diff --git a/programs/thread/src/instructions/thread_exec.rs b/programs/thread/src/instructions/thread_exec.rs index 8c1ee4db..73e6d57a 100644 --- a/programs/thread/src/instructions/thread_exec.rs +++ b/programs/thread/src/instructions/thread_exec.rs @@ -6,8 +6,8 @@ use anchor_lang::{ }, AnchorDeserialize, InstructionData, }; -use clockwork_network_program::state::{Fee, Pool, Worker, WorkerAccount}; -use clockwork_utils::thread::{SerializableInstruction, ThreadResponse, PAYER_PUBKEY}; +use open_clockwork_network_program::state::{Fee, Pool, Worker, WorkerAccount}; +use open_clockwork_utils::thread::{SerializableInstruction, ThreadResponse, PAYER_PUBKEY}; use crate::{errors::ClockworkError, state::*}; @@ -24,11 +24,11 @@ pub struct ThreadExec<'info> { #[account( mut, seeds = [ - clockwork_network_program::state::SEED_FEE, + open_clockwork_network_program::state::SEED_FEE, worker.key().as_ref(), ], bump, - seeds::program = clockwork_network_program::ID, + seeds::program = open_clockwork_network_program::ID, has_one = worker, )] pub fee: Account<'info, Fee>, diff --git a/programs/thread/src/instructions/thread_kickoff.rs b/programs/thread/src/instructions/thread_kickoff.rs index 2c94e0c3..e3f6f2b7 100644 --- a/programs/thread/src/instructions/thread_kickoff.rs +++ b/programs/thread/src/instructions/thread_kickoff.rs @@ -6,9 +6,9 @@ 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 open_clockwork_cron::Schedule; +use open_clockwork_network_program::state::{Worker, WorkerAccount}; +use open_clockwork_utils::thread::Trigger; use pyth_sdk_solana::load_price_feed_from_account_info; use crate::{errors::*, state::*}; diff --git a/programs/thread/src/lib.rs b/programs/thread/src/lib.rs index 3eb47de9..bd64ab3f 100644 --- a/programs/thread/src/lib.rs +++ b/programs/thread/src/lib.rs @@ -10,7 +10,7 @@ pub mod state; mod instructions; use anchor_lang::prelude::*; -use clockwork_utils::{ +use open_clockwork_utils::{ thread::{SerializableInstruction, Trigger}, CrateInfo, }; diff --git a/programs/thread/src/state/mod.rs b/programs/thread/src/state/mod.rs index 368b9b32..082c9eb6 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 open_clockwork_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 d01f7b12..1c205b10 100644 --- a/programs/thread/src/state/thread.rs +++ b/programs/thread/src/state/thread.rs @@ -1,9 +1,9 @@ use std::mem::size_of; use anchor_lang::{prelude::*, AnchorDeserialize, AnchorSerialize}; -use clockwork_utils::thread::{ClockData, SerializableInstruction, Trigger}; +use open_clockwork_utils::thread::{ClockData, SerializableInstruction, Trigger}; -pub use clockwork_utils::thread::Equality; +pub use open_clockwork_utils::thread::Equality; pub const SEED_THREAD: &[u8] = b"thread"; diff --git a/programs/thread/src/state/versioned_thread.rs b/programs/thread/src/state/versioned_thread.rs index 70419192..5fa9023b 100644 --- a/programs/thread/src/state/versioned_thread.rs +++ b/programs/thread/src/state/versioned_thread.rs @@ -1,9 +1,9 @@ use anchor_lang::{prelude::*, AccountDeserialize}; -use clockwork_thread_program_v1::{ +use open_clockwork_thread_program_v1::{ state::Thread as ThreadV1, typedefs::{Trigger as TriggerV1, TriggerContext as TriggerContextV1}, }; -use clockwork_utils::thread::SerializableAccount; +use open_clockwork_utils::thread::SerializableAccount; use crate::{ ClockData, ExecContext, SerializableInstruction, Thread as ThreadV2, Trigger, TriggerContext, @@ -67,7 +67,7 @@ impl VersionedThread { .iter() .map(|a| unsafe { std::mem::transmute_copy::< - clockwork_thread_program_v1::typedefs::AccountMetaData, + open_clockwork_thread_program_v1::typedefs::AccountMetaData, SerializableAccount, >(a) }) @@ -88,7 +88,7 @@ impl VersionedThread { pub fn program_id(&self) -> Pubkey { match self { - Self::V1(_) => clockwork_thread_program_v1::ID, + Self::V1(_) => open_clockwork_thread_program_v1::ID, Self::V2(_) => crate::ID, } } diff --git a/programs/thread/v1/Cargo.toml b/programs/thread/v1/Cargo.toml index ac57315e..969a577d 100644 --- a/programs/thread/v1/Cargo.toml +++ b/programs/thread/v1/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "clockwork-thread-program-v1" -version = "1.4.4" +name = "open-clockwork-thread-program-v1" +version = "0.1.0" edition = "2021" readme = "./README.md" description = "Clockwork thread program v1" @@ -8,7 +8,7 @@ license = "AGPL-3.0-or-later" [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_thread_program_v1" +name = "open_clockwork_thread_program_v1" [features] default = ["cpi"] diff --git a/programs/webhook/Cargo.toml b/programs/webhook/Cargo.toml index 0918c6a4..bea3a40d 100644 --- a/programs/webhook/Cargo.toml +++ b/programs/webhook/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "clockwork-webhook-program" -version = "2.0.19" +name = "open-clockwork-webhook-program" +version = "0.1.0" description = "Clockwork webhook program" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" +repository = "https://github.com/open-clockwork/clockwork" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_webhook_program" +name = "open_clockwork_webhook_program" [features] no-entrypoint = [] @@ -23,6 +23,6 @@ default = [] [dependencies] anchor-lang = { features = ["init-if-needed"], version = "0.28.0" } -clockwork-network-program = { path = "../network", features = ["cpi"], version = "=2.0.19" } -clockwork-utils = { path = "../../utils", version = "=2.0.19" } +open-clockwork-network-program = { path = "../network", features = ["cpi"], version = "=0.1.0" } +open-clockwork-utils = { path = "../../utils", version = "=0.1.0" } serde = "1.0.152" diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 16a58ac6..3fc86a70 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "clockwork-relayer" -version = "2.0.19" +name = "open-clockwork-relayer" +version = "0.1.0" edition = "2021" description = "Clockwork relayer for webhook requests" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/relayer" +repository = "https://github.com/open-clockwork/clockwork/relayer" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] @@ -18,8 +18,8 @@ actix-cors = "0.6.4" actix-web = "4.3.1" anchor-lang = "0.28.0" byte-unit = "4.0.18" -clockwork-webhook-program = { path = "../programs/webhook", version = "=2.0.19" } -clockwork-relayer-api = { path = "api", version = "=2.0.19" } +open-clockwork-webhook-program = { path = "../programs/webhook", version = "=0.1.0" } +open-clockwork-relayer-api = { path = "api", version = "=0.1.0" } curve25519-dalek = "3.2.1" lazy_static = "1.4.0" reqwest = "0.11.14" diff --git a/relayer/api/Cargo.toml b/relayer/api/Cargo.toml index 628399e3..717fc401 100644 --- a/relayer/api/Cargo.toml +++ b/relayer/api/Cargo.toml @@ -1,18 +1,18 @@ [package] -name = "clockwork-relayer-api" -version = "2.0.19" +name = "open-clockwork-relayer-api" +version = "0.1.0" edition = "2021" description = "Clockwork relayer for webhook requests" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/relayer" +repository = "https://github.com/open-clockwork/clockwork/relayer" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] crate-type = ["cdylib", "lib"] -name = "clockwork_relayer_api" +name = "open_clockwork_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 68729bdf..9b2570c2 100644 --- a/relayer/src/main.rs +++ b/relayer/src/main.rs @@ -3,11 +3,11 @@ 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 open_clockwork_relayer_api::{ Relay, SecretApprove, SecretCreate, SecretGet, SecretList, SecretListResponse, SecretRevoke, SignedRequest, }; -use clockwork_webhook_program::state::{HttpMethod, Webhook}; +use open_clockwork_webhook_program::state::{HttpMethod, Webhook}; use rayon::prelude::*; use regex::Regex; use serde::{Deserialize, Serialize}; diff --git a/scripts/build-all.sh b/scripts/build-all.sh index 95e3d496..d435bd84 100755 --- a/scripts/build-all.sh +++ b/scripts/build-all.sh @@ -138,13 +138,13 @@ esac cp -fv "target/$targetTriple/$buildVariant/$bin" "$installDir" 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/open_clockwork_network_program.so" "$installDir/lib" + cp -fv "target/deploy/open_clockwork_thread_program.so" "$installDir/lib" + cp -fv "target/deploy/open_clockwork_webhook_program.so" "$installDir/lib" - cp -fv "target/deploy/clockwork_network_program.so" "$installDir" - cp -fv "target/deploy/clockwork_thread_program.so" "$installDir" - cp -fv "target/deploy/clockwork_webhook_program.so" "$installDir" + cp -fv "target/deploy/open_clockwork_network_program.so" "$installDir" + cp -fv "target/deploy/open_clockwork_thread_program.so" "$installDir" + cp -fv "target/deploy/open_clockwork_webhook_program.so" "$installDir" ) # Success message diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index de74decc..97878147 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -1,22 +1,22 @@ [package] -name = "clockwork-sdk" -version = "2.0.19" +name = "open-clockwork-sdk" +version = "0.1.0" description = "An SDK for building automated programs on Solana" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" +repository = "https://github.com/open-clockwork/clockwork" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] -name = "clockwork_sdk" +name = "open_clockwork_sdk" [dependencies] anchor-lang = "0.28.0" chrono = { version = "0.4.19", default-features = false, features = ["alloc"] } -clockwork-thread-program = { path = "../programs/thread", features = ["cpi"], version = "=2.0.19" } +open-clockwork-thread-program = { path = "../programs/thread", features = ["cpi"], version = "=0.1.0" } nom = "~7" once_cell = "1.5.2" diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 74e0ae8d..ffd9315d 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 open_clockwork_thread_program::errors; +pub use open_clockwork_thread_program::program::ThreadProgram; +pub use open_clockwork_thread_program::ID; pub mod state { - pub use clockwork_thread_program::state::{ + pub use open_clockwork_thread_program::state::{ ClockData, ExecContext, SerializableAccount, SerializableInstruction, Thread, ThreadAccount, ThreadResponse, ThreadSettings, Trigger, TriggerContext, }; } pub mod utils { - pub use clockwork_thread_program::state::PAYER_PUBKEY; - pub use clockwork_thread_program::state::Equality; + pub use open_clockwork_thread_program::state::PAYER_PUBKEY; + pub use open_clockwork_thread_program::state::Equality; } pub mod cpi { use anchor_lang::prelude::{CpiContext, Result}; - pub use clockwork_thread_program::cpi::accounts::{ + pub use open_clockwork_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) + open_clockwork_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) + open_clockwork_thread_program::cpi::thread_delete(ctx) } pub fn thread_pause<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadPause<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_pause(ctx) + open_clockwork_thread_program::cpi::thread_pause(ctx) } pub fn thread_resume<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadResume<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_resume(ctx) + open_clockwork_thread_program::cpi::thread_resume(ctx) } pub fn thread_reset<'info>( ctx: CpiContext<'_, '_, '_, 'info, ThreadReset<'info>>, ) -> Result<()> { - clockwork_thread_program::cpi::thread_reset(ctx) + open_clockwork_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) + open_clockwork_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) + open_clockwork_thread_program::cpi::thread_withdraw(ctx, amount) } } diff --git a/utils/Cargo.toml b/utils/Cargo.toml index 2ea95d33..73c6eef2 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -1,17 +1,17 @@ [package] -name = "clockwork-utils" -version = "2.0.19" +name = "open-clockwork-utils" +version = "0.1.0" description = "Tools for building blocks on Solana" edition = "2021" license = "AGPL-3.0-or-later" homepage = "https://clockwork.xyz" -repository = "https://github.com/clockwork-xyz/clockwork" +repository = "https://github.com/open-clockwork/clockwork" documentation = "https://docs.clockwork.xyz" readme = "./README.md" keywords = ["solana"] [lib] -name = "clockwork_utils" +name = "open_clockwork_utils" [dependencies] anchor-lang = "0.28.0"