From 56d0ce5a725484251122fb485c79983d7dc0b93e Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Tue, 25 Oct 2022 18:23:43 -0400 Subject: [PATCH] refactor: rename to helios #70) --- .github/workflows/release.yml | 16 ++++----- Cargo.lock | 34 +++++++++---------- cli/Cargo.toml | 2 +- cli/src/main.rs | 4 +-- config/src/lib.rs | 6 +++- config/src/networks.rs | 2 +- .../lightclientup => heliosup/heliosup | 4 +-- {lightclientup => heliosup}/install | 4 +-- 8 files changed, 38 insertions(+), 34 deletions(-) rename lightclientup/lightclientup => heliosup/heliosup (96%) rename {lightclientup => heliosup}/install (97%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f744b4..0f16438 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: run: cargo build --all --release --target aarch64-apple-darwin - name: archive - run: gtar -czvf "lightclient_darwin_arm64.tar.gz" -C ./target/aarch64-apple-darwin/release lightclient + run: gtar -czvf "helios_darwin_arm64.tar.gz" -C ./target/aarch64-apple-darwin/release lightclient - name: generate tag name id: tag @@ -37,7 +37,7 @@ jobs: tag_name: ${{ steps.tag.outputs.release_tag }} prerelease: true files: | - lightclient_darwin_arm64.tar.gz + helios_darwin_arm64.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -61,7 +61,7 @@ jobs: run: cargo build --all --release --target x86_64-apple-darwin - name: archive - run: gtar -czvf "lightclient_darwin_amd64.tar.gz" -C ./target/x86_64-apple-darwin/release lightclient + run: gtar -czvf "helios_darwin_amd64.tar.gz" -C ./target/x86_64-apple-darwin/release lightclient - name: generate tag name id: tag @@ -74,7 +74,7 @@ jobs: tag_name: ${{ steps.tag.outputs.release_tag }} prerelease: true files: | - lightclient_darwin_amd64.tar.gz + helios_darwin_amd64.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -104,7 +104,7 @@ jobs: run: cargo build --all --release --target aarch64-unknown-linux-gnu - name: archive - run: tar -czvf "lightclient_linux_arm64.tar.gz" -C ./target/aarch64-unknown-linux-gnu/release lightclient + run: tar -czvf "helios_linux_arm64.tar.gz" -C ./target/aarch64-unknown-linux-gnu/release lightclient - name: generate tag name id: tag @@ -117,7 +117,7 @@ jobs: tag_name: ${{ steps.tag.outputs.release_tag }} prerelease: true files: | - lightclient_linux_arm64.tar.gz + helios_linux_arm64.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -141,7 +141,7 @@ jobs: run: cargo build --all --release --target x86_64-unknown-linux-gnu - name: archive - run: tar -czvf "lightclient_linux_amd64.tar.gz" -C ./target/x86_64-unknown-linux-gnu/release lightclient + run: tar -czvf "helios_linux_amd64.tar.gz" -C ./target/x86_64-unknown-linux-gnu/release lightclient - name: generate tag name id: tag @@ -154,6 +154,6 @@ jobs: tag_name: ${{ steps.tag.outputs.release_tag }} prerelease: true files: | - lightclient_linux_amd64.tar.gz + helios_linux_amd64.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 8545aed..ec28a5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1479,6 +1479,23 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +[[package]] +name = "helios" +version = "0.1.0" +dependencies = [ + "clap", + "client", + "common", + "config", + "ctrlc", + "dirs", + "env_logger", + "eyre", + "futures", + "log", + "tokio", +] + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1978,23 +1995,6 @@ version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" -[[package]] -name = "lightclient" -version = "0.1.0" -dependencies = [ - "clap", - "client", - "common", - "config", - "ctrlc", - "dirs", - "env_logger", - "eyre", - "futures", - "log", - "tokio", -] - [[package]] name = "lock_api" version = "0.4.8" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 405f640..5e9167b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "lightclient" +name = "helios" version = "0.1.0" edition = "2021" diff --git a/cli/src/main.rs b/cli/src/main.rs index dc8094f..34301b1 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -63,7 +63,7 @@ fn register_shutdown_handler(client: Client) { fn get_config() -> Config { let cli = Cli::parse(); - let config_path = home_dir().unwrap().join(".lightclient/lightclient.toml"); + let config_path = home_dir().unwrap().join(".helios/helios.toml"); let cli_config = cli.as_cli_config(); @@ -118,6 +118,6 @@ impl Cli { fn get_data_dir(&self) -> PathBuf { home_dir() .unwrap() - .join(format!(".lightclient/data/{}", self.network)) + .join(format!(".helios/data/{}", self.network)) } } diff --git a/config/src/lib.rs b/config/src/lib.rs index 111fa2d..945eec5 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -52,15 +52,19 @@ impl Config { Err(err) => { match err.kind { figment::error::Kind::MissingField(field) => { + let field = field.replace("_", "-"); + println!( "\x1b[91merror\x1b[0m: missing configuration field: {}", field ); + println!( "\n\ttry supplying the propoper command line argument: --{}", field ); - println!("\talternatively, you can add the field to your lightclient.toml file or as an environment variable"); + + println!("\talternatively, you can add the field to your helios.toml file or as an environment variable"); println!("\nfor more information, check the github README"); } _ => println!("cannot parse configuration: {}", err), diff --git a/config/src/networks.rs b/config/src/networks.rs index 2c8a022..57033c0 100644 --- a/config/src/networks.rs +++ b/config/src/networks.rs @@ -18,7 +18,7 @@ pub struct BaseConfig { pub fn mainnet() -> BaseConfig { BaseConfig { checkpoint: hex_str_to_bytes( - "0xb0fe0394e2ed1a96b758b67fad1942371db5f7070502d10937fa65dacfc2ea4b", + "0x6d41048663adafa064bae3b3768a8448fa1f1b003118fa5887d06da266530cff", ) .unwrap(), rpc_port: 8545, diff --git a/lightclientup/lightclientup b/heliosup/heliosup similarity index 96% rename from lightclientup/lightclientup rename to heliosup/heliosup index 3b8aebd..8b1364e 100644 --- a/lightclientup/lightclientup +++ b/heliosup/heliosup @@ -3,8 +3,8 @@ set -e # modified from https://github.com/foundry-rs/foundry/blob/master/foundryup/foundryup -REPO="a16z/lightclient" -NAME=lightclient +REPO="a16z/helios" +NAME=helios DIR=$HOME/.$NAME BIN_DIR=$DIR/bin diff --git a/lightclientup/install b/heliosup/install similarity index 97% rename from lightclientup/install rename to heliosup/install index 9eb9882..ac08d4e 100644 --- a/lightclientup/install +++ b/heliosup/install @@ -3,8 +3,8 @@ set -e # modified from https://github.com/foundry-rs/foundry/blob/master/foundryup/install -REPO="a16z/lightclient" -NAME=lightclient +REPO="a16z/helios" +NAME=helios INSTALLER_NAME=${NAME}up