Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #243 from subspace/update-docs-pulsar
Browse files Browse the repository at this point in the history
change subspace-cli to pulsar in docs
  • Loading branch information
jfrank-summit committed Aug 15, 2023
2 parents b386d61 + f0acd9b commit a36f703
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/subspace/subspace-cli/blob/main/CODE_OF_CONDUCT.md) # TODO: fix this link
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/subspace/pulsar/blob/main/CODE_OF_CONDUCT.md) # TODO: fix this link
options:
- label: I agree to follow this project's Code of Conduct
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/subspace/subspace-cli/blob/main/CODE_OF_CONDUCT.md) # TODO: fix this link
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/subspace/pulsar/blob/main/CODE_OF_CONDUCT.md) # TODO: fix this link
options:
- label: I agree to follow this project's Code of Conduct
required: true
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ jobs:
if: matrix.build.target != 'aarch64-unknown-linux-gnu'
with:
command: build
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-cli
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin pulsar

# TODO: get rid of this when we have bigger RAM for aarch64 linux
- name: Build the executable for aarch64 linux separately
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
if: matrix.build.target == 'aarch64-unknown-linux-gnu'
with:
command: build
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile aarch64linux --bin subspace-cli
args: --locked -Z build-std --target ${{ matrix.build.target }} --profile aarch64linux --bin pulsar

- name: Sign and Notarize Application (macOS)
run: |
Expand All @@ -111,10 +111,10 @@ jobs:
security import certificate.p12 -k build.keychain -P "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" build.keychain
echo "Signing farmer"
codesign --force --options=runtime --entitlements .github/workflows/Entitlements.plist -s "${{ secrets.MACOS_IDENTITY }}" --timestamp ${{ matrix.build.production_target }}/subspace-cli
codesign --force --options=runtime --entitlements .github/workflows/Entitlements.plist -s "${{ secrets.MACOS_IDENTITY }}" --timestamp ${{ matrix.build.production_target }}/pulsar
echo "Creating an archive"
mkdir ${{ matrix.build.production_target }}/macos-binaries
cp ${{ matrix.build.production_target }}/subspace-cli ${{ matrix.build.production_target }}/macos-binaries
cp ${{ matrix.build.production_target }}/pulsar ${{ matrix.build.production_target }}/macos-binaries
ditto -c -k --rsrc ${{ matrix.build.production_target }}/macos-binaries subspace-binaries.zip
echo "Notarizing"
brew update
Expand Down Expand Up @@ -158,22 +158,22 @@ jobs:
- name: Prepare executables for uploading (Ubuntu)
run: |
mkdir executables
mv ${{ matrix.build.production_target }}/subspace-cli executables/subspace-cli-${{ matrix.build.suffix }}
mv ${{ matrix.build.production_target }}/pulsar executables/pulsar-${{ matrix.build.suffix }}
if: runner.os == 'Linux'

- name: Prepare executables for uploading (macOS)
run: |
mkdir executables
mv ${{ matrix.build.production_target }}/subspace-cli executables/subspace-cli-${{ matrix.build.suffix }}
mv ${{ matrix.build.production_target }}/pulsar executables/pulsar-${{ matrix.build.suffix }}
# Zip it so that signature is not lost
ditto -c -k --rsrc executables/subspace-cli-${{ matrix.build.suffix }} executables/subspace-cli-${{ matrix.build.suffix }}.zip
rm executables/subspace-cli-${{ matrix.build.suffix }}
ditto -c -k --rsrc executables/pulsar-${{ matrix.build.suffix }} executables/pulsar-${{ matrix.build.suffix }}.zip
rm executables/pulsar-${{ matrix.build.suffix }}
if: runner.os == 'macOS'

- name: Prepare executables for uploading (Windows)
run: |
mkdir executables
move ${{ matrix.build.production_target }}/subspace-cli.exe executables/subspace-cli-${{ matrix.build.suffix }}.exe
move ${{ matrix.build.production_target }}/pulsar.exe executables/pulsar-${{ matrix.build.suffix }}.exe
if: runner.os == 'Windows'

- name: Upload executable to artifacts
Expand Down
88 changes: 44 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "subspace-cli"
name = "pulsar"
version = "0.5.4"
edition = "2021"

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div align="center">

# Subspace CLI
# Pulsar

Subspace CLI simplifies the farming process on Subspace Network.
Pulsar simplifies the farming process on Subspace Network.

[![ci-tests](https://img.shields.io/github/actions/workflow/status/subspace/subspace-cli/ci-tests.yml?branch=main&label=CI&logo=github&style=for-the-badge)](https://github.com/subspace/subspace-cli/actions/workflows/ci-tests.yml)
[![Rust Docs](https://img.shields.io/github/actions/workflow/status/subspace/subspace-cli/rustdoc.yml?branch=main&label=RUST-DOCS&logo=github&style=for-the-badge)](https://github.com/subspace/subspace-cli/actions/workflows/rustdoc.yml)
[![Latest Release](https://img.shields.io/github/v/release/subspace/subspace-cli?include_prereleases&logo=github&style=for-the-badge)](https://github.com/subspace/subspace-cli/releases)
[![ci-tests](https://img.shields.io/github/actions/workflow/status/subspace/pulsar/ci-tests.yml?branch=main&label=CI&logo=github&style=for-the-badge)](https://github.com/subspace/pulsar/actions/workflows/ci-tests.yml)
[![Rust Docs](https://img.shields.io/github/actions/workflow/status/subspace/pulsar/rustdoc.yml?branch=main&label=RUST-DOCS&logo=github&style=for-the-badge)](https://github.com/subspace/pulsar/actions/workflows/rustdoc.yml)
[![Latest Release](https://img.shields.io/github/v/release/subspace/pulsar?include_prereleases&logo=github&style=for-the-badge)](https://github.com/subspace/pulsar/releases)

![prompt](images/subspace-cli-prompt.png)
![prompt](images/pulsar-prompt.png)

</div>

Expand All @@ -18,11 +18,11 @@ Instead of running a terminal instance for the farmer, and running another termi

## How to Use (commands)

1. download the executable from [releases](https://github.com/subspace/subspace-cli/releases)
1. download the executable from [releases](https://github.com/subspace/pulsar/releases)
2. in your terminal, change your directory to where you download the file for example: if you downloaded your file to your `Downloads` folder, `cd Downloads`)
3. we will address your executable name as `subspace-cli`, change the below commands accordingly to your full executable name.
3. run `./subspace-cli init` -> this will initialize your config file, which will store the necessary information for you to farm.
4. run `./subspace-cli farm` -> this will start farming. Yes, it is that simple! Enjoy!
3. we will address your executable name as `pulsar`, change the below commands accordingly to your full executable name.
3. run `./pulsar init` -> this will initialize your config file, which will store the necessary information for you to farm.
4. run `./pulsar farm` -> this will start farming. Yes, it is that simple! Enjoy!

## Other commands

Expand All @@ -46,7 +46,7 @@ This will create a new `tmux` session using a socket file named `farming`.
Once the tmux session is created, you can go ahead and run the farming process.

```sh
$ ./subspace-cli farm
$ ./pulsar farm
```

Once it's running, you can detach the process by pressing `CTRL+b d` (read more about [detaching a sessions](https://linuxhint.com/detach-session-tmux/))
Expand Down Expand Up @@ -75,7 +75,7 @@ screen -S farming
This will create a new `screen` session.

```sh
./subspace-cli farm
./pulsar farm
```

Once it's running, you can detach the process by pressing `CTRL+d a`.
Expand Down
File renamed without changes
15 changes: 7 additions & 8 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,15 @@ impl std::str::FromStr for ChainConfig {
}

/// Creates a config file at the location
/// - **Linux:** `$HOME/.config/subspace-cli/settings.toml`.
/// - **macOS:** `$HOME/Library/Application Support/subspace-cli/settings.toml`.
/// - **Windows:** `{FOLDERID_RoamingAppData}/subspace-cli/settings.toml`.
/// - **Linux:** `$HOME/.config/pulsar/settings.toml`.
/// - **macOS:** `$HOME/Library/Application Support/pulsar/settings.toml`.
/// - **Windows:** `{FOLDERID_RoamingAppData}/pulsar/settings.toml`.
pub(crate) fn create_config() -> Result<(File, PathBuf)> {
let config_path = dirs::config_dir()
.expect("couldn't get the default config directory!")
.join("subspace-cli");
let config_path =
dirs::config_dir().expect("couldn't get the default config directory!").join("pulsar");

if let Err(err) = create_dir_all(&config_path) {
let config_path = config_path.to_str().expect("couldn't get subspace-cli config path!");
let config_path = config_path.to_str().expect("couldn't get pulsar config path!");
return Err(err).wrap_err(format!("could not create the directory: `{config_path}`"));
}

Expand All @@ -169,7 +168,7 @@ pub(crate) fn create_config() -> Result<(File, PathBuf)> {
#[instrument]
pub(crate) fn parse_config() -> Result<Config> {
let config_path = dirs::config_dir().expect("couldn't get the default config directory!");
let config_path = config_path.join("subspace-cli").join("settings.toml");
let config_path = config_path.join("pulsar").join("settings.toml");

let config: Config = toml::from_str(&std::fs::read_to_string(config_path)?)?;
Ok(config)
Expand Down
2 changes: 1 addition & 1 deletion src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,5 @@ pub(crate) fn summary_path() -> PathBuf {

#[instrument]
fn summary_dir() -> PathBuf {
dirs::cache_dir().expect("couldn't get the directory!").join("subspace-cli")
dirs::cache_dir().expect("couldn't get the directory!").join("pulsar")
}
24 changes: 12 additions & 12 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,53 +144,53 @@ fn plot_directory_tester() {
let plot_path = plot_directory_getter();

#[cfg(target_os = "macos")]
assert!(plot_path.ends_with("Library/Application Support/subspace-cli/plots"));
assert!(plot_path.ends_with("Library/Application Support/pulsar/plots"));

#[cfg(target_os = "linux")]
assert!(plot_path.ends_with(".local/share/subspace-cli/plots"));
assert!(plot_path.ends_with(".local/share/pulsar/plots"));

#[cfg(target_os = "windows")]
assert!(plot_path.ends_with("AppData/Roaming/subspace-cli/plots"));
assert!(plot_path.ends_with("AppData/Roaming/pulsar/plots"));
}

#[test]
fn cache_directory_tester() {
let cache_path = cache_directory_getter();

#[cfg(target_os = "macos")]
assert!(cache_path.ends_with("Library/Application Support/subspace-cli/cache"));
assert!(cache_path.ends_with("Library/Application Support/pulsar/cache"));

#[cfg(target_os = "linux")]
assert!(cache_path.ends_with(".local/share/subspace-cli/cache"));
assert!(cache_path.ends_with(".local/share/pulsar/cache"));

#[cfg(target_os = "windows")]
assert!(cache_path.ends_with("AppData/Roaming/subspace-cli/cache"));
assert!(cache_path.ends_with("AppData/Roaming/pulsar/cache"));
}

#[test]
fn node_directory_tester() {
let node_path = node_directory_getter();

#[cfg(target_os = "macos")]
assert!(node_path.ends_with("Library/Application Support/subspace-cli/node"));
assert!(node_path.ends_with("Library/Application Support/pulsar/node"));

#[cfg(target_os = "linux")]
assert!(node_path.ends_with(".local/share/subspace-cli/node"));
assert!(node_path.ends_with(".local/share/pulsar/node"));

#[cfg(target_os = "windows")]
assert!(node_path.ends_with("AppData/Roaming/subspace-cli/node"));
assert!(node_path.ends_with("AppData/Roaming/pulsar/node"));
}

#[test]
fn custom_log_dir_test() {
let log_path = custom_log_dir();

#[cfg(target_os = "macos")]
assert!(log_path.ends_with("Library/Logs/subspace-cli"));
assert!(log_path.ends_with("Library/Logs/pulsar"));

#[cfg(target_os = "linux")]
assert!(log_path.ends_with(".local/share/subspace-cli/logs"));
assert!(log_path.ends_with(".local/share/pulsar/logs"));

#[cfg(target_os = "windows")]
assert!(log_path.ends_with("AppData/Local/subspace-cli/logs"));
assert!(log_path.ends_with("AppData/Local/pulsar/logs"));
}
8 changes: 4 additions & 4 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ pub(crate) fn provider_storage_dir_getter() -> PathBuf {
}

fn data_dir_getter() -> PathBuf {
dirs::data_dir().expect("data folder must be present in every major OS").join("subspace-cli")
dirs::data_dir().expect("data folder must be present in every major OS").join("pulsar")
}

/// returns OS specific log directory
pub(crate) fn custom_log_dir() -> PathBuf {
let id = "subspace-cli";
let id = "pulsar";

#[cfg(target_os = "macos")]
let path = dirs::home_dir().map(|dir| dir.join("Library/Logs").join(id));
Expand Down Expand Up @@ -227,7 +227,7 @@ pub(crate) fn install_tracing(is_verbose: bool, no_rotation: bool) {
} else {
RollingFileAppender::builder().max_log_files(KEEP_LAST_N_FILE).rotation(Rotation::HOURLY)
}
.filename_prefix("subspace-cli.log")
.filename_prefix("pulsar.log")
.build(log_dir)
.expect("building should always succeed");

Expand All @@ -248,7 +248,7 @@ pub(crate) fn install_tracing(is_verbose: bool, no_rotation: bool) {

let tracing_layer = tracing_layer
.with(
BunyanFormattingLayer::new("subspace-cli".to_owned(), file_appender)
BunyanFormattingLayer::new("pulsar".to_owned(), file_appender)
.and_then(JsonStorageLayer)
.with_filter(filter()),
)
Expand Down

0 comments on commit a36f703

Please sign in to comment.