Merge branch 'main' into collinjackson/remove-beta-link

This commit is contained in:
Collin Jackson 2024-10-27 11:10:08 -07:00 committed by GitHub
commit 71bc58e3dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 54 additions and 17 deletions

View File

@ -39,9 +39,8 @@ If you believe that you have uncovered a bug, please describe it to the best of
As a starting point, in a bug report we will pretty much always want:
- the Nexus network version/revision you are using;
- the platform you are on, ideally both the operating system (Windows, macOS, or Linux) and the machine architecture (_e.g.,_ if you're using an M-series Mac) if you know them;
- console logs from the CLI or web application showing errors ands status messages;
- console logs from the CLI or web application showing errors and status messages;
- concrete and comprehensive steps to reproduce the bug.
Code snippets should be as minimal as possible. It is always better if you can reproduce the bug with a small snippet that focuses on your Nexus zkVM usage rather than on the surrounding code in your project. This will help collaborators verify, reproduce, and zero in on a fix.

View File

@ -1,6 +1,33 @@
# network-cli
# Network CLI
Command line interface (CLI) for accessing the Nexus Network. Highest-performance option for proving.
The command line interface (CLI) lets you run a Nexus prover node.
It is the highest-performance option for proving.
## Prerequisites
If you don't have these dependencies already, install them first.
### Linux
```
sudo apt update
sudo apt upgrade
sudo apt install build-essential pkg-config libssl-dev git-all
```
### macOS
If you have [installed Homebrew](https://brew.sh/) to manage packages on OS X,
run this command to install Git.
```
brew install git
```
### Windows
[Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install),
then see Linux instructions above.
## Quick start
@ -12,12 +39,20 @@ If you do not already have Rust, you will be prompted to install it.
## Terms of Use
Use of the CLI is subject to the [Terms of Use](https://nexus.xyz/terms_of_use).
Use of the CLI is subject to the [Terms of Use](https://nexus.xyz/terms-of-use).
The first time you run it, it prompts you to accept the terms. To accept the terms
noninteractively (for example, in a continuous integration environment),
add `NONINTERACTIVE=1` before `sh`.
## Known issues
Currently only proving is supported. Submitting programs to the network is in private beta.
* Only the latest version of the CLI is currently supported.
* Prebuilt binaries are not yet available.
* Counting cycles proved is not yet available in the CLI.
* Only proving is supported. Submitting programs to the network is in private beta.
To request an API key, contact us at growth@nexus.xyz.
## Resources
* [Network FAQ](https://nexus.xyz/network#network-faqs)
* [Discord channel](https://discord.gg/nexus-xyz)

View File

@ -1,3 +1,10 @@
#[cfg(debug_assertions)]
pub fn analytics_token(_ws_addr_string: &str) -> String {
// Use one of the tokens in the release version if debugging analytics
return "".into();
}
#[cfg(not(debug_assertions))]
pub fn analytics_token(ws_addr_string: &str) -> String {
if ws_addr_string.starts_with("wss://dev.orchestrator.nexus.xyz:443/") {
return "504d4d443854f2cd10e2e385aca81aa4".into();

View File

@ -222,8 +222,8 @@ async fn main() {
track(
"progress".into(),
format!(
"Program trace is {} steps. Proving from {} to {}...",
total_steps, start, end
"Program trace is {} steps. Proving {} steps starting at {}...",
total_steps, steps_to_prove, start
),
&ws_addr_string,
json!({
@ -252,11 +252,10 @@ async fn main() {
};
let progress_duration = SystemTime::now().duration_since(progress_time).unwrap();
let cycles_proven = steps_proven * 4;
let proof_cycles_hertz = k * 1000 / progress_duration.as_millis();
let proof_cycles_per_minute = k * 60 * 1000 / progress_duration.as_millis();
let proof_cycles_hertz = k as f64 * 1000.0 / progress_duration.as_millis() as f64;
track(
"progress".into(),
format!("Proved step {} at {} Hz.", step, proof_cycles_hertz),
format!("Proved step {} at {:.2} proof cycles/sec.", step, proof_cycles_hertz),
&ws_addr_string,
json!({
"completed_fraction": completed_fraction,
@ -267,7 +266,6 @@ async fn main() {
"k": k,
"progress_duration_millis": progress_duration.as_millis(),
"proof_cycles_hertz": proof_cycles_hertz,
"proof_cycles_per_minute": proof_cycles_per_minute,
"prover_id": prover_id,
}),
);
@ -307,21 +305,19 @@ async fn main() {
})),
};
let duration = SystemTime::now().duration_since(start_time).unwrap();
let proof_cycles_hertz = cycles_proven * 1000 / duration.as_millis();
let proof_cycles_per_minute = cycles_proven * 60 * 1000 / duration.as_millis();
let proof_cycles_hertz = cycles_proven as f64 * 1000.0 / duration.as_millis() as f64;
client
.send(Message::Binary(response.encode_to_vec()))
.await
.unwrap();
track(
"proof".into(),
format!("Proof sent! You proved at {} Hz.", proof_cycles_hertz),
format!("Proof sent! Overall speed was {:.2} proof cycles/sec.", proof_cycles_hertz),
&ws_addr_string,
json!({
"proof_duration_sec": duration.as_secs(),
"proof_duration_millis": duration.as_millis(),
"proof_cycles_hertz": proof_cycles_hertz,
"proof_cycles_per_minute": proof_cycles_per_minute,
"prover_id": prover_id,
}),
);
@ -350,4 +346,4 @@ async fn main() {
&ws_addr_string,
json!({ "prover_id": prover_id }),
);
}
}