mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-24 12:39:54 +00:00
cuprated: version constants
This commit is contained in:
parent
6dc38a401d
commit
b6e8b3a08e
6 changed files with 49 additions and 7 deletions
27
Cargo.lock
generated
27
Cargo.lock
generated
|
@ -386,6 +386,26 @@ version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
|
checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_format"
|
||||||
|
version = "0.2.33"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b"
|
||||||
|
dependencies = [
|
||||||
|
"const_format_proc_macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_format_proc_macros"
|
||||||
|
version = "0.2.33"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-xid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation"
|
name = "core-foundation"
|
||||||
version = "0.9.4"
|
version = "0.9.4"
|
||||||
|
@ -927,6 +947,7 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
|
"const_format",
|
||||||
"crossbeam",
|
"crossbeam",
|
||||||
"crypto-bigint",
|
"crypto-bigint",
|
||||||
"cuprate-address-book",
|
"cuprate-address-book",
|
||||||
|
@ -3044,6 +3065,12 @@ version = "1.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-xid"
|
||||||
|
version = "0.2.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "untrusted"
|
name = "untrusted"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
|
|
|
@ -59,6 +59,7 @@ clap = { version = "4.4.7", default-features = false }
|
||||||
chrono = { version = "0.4.31", default-features = false }
|
chrono = { version = "0.4.31", default-features = false }
|
||||||
crypto-bigint = { version = "0.5.5", default-features = false }
|
crypto-bigint = { version = "0.5.5", default-features = false }
|
||||||
crossbeam = { version = "0.8.4", default-features = false }
|
crossbeam = { version = "0.8.4", default-features = false }
|
||||||
|
const_format = { version = "0.2.33", default-features = false }
|
||||||
curve25519-dalek = { version = "4.1.3", default-features = false }
|
curve25519-dalek = { version = "4.1.3", default-features = false }
|
||||||
dashmap = { version = "5.5.3", default-features = false }
|
dashmap = { version = "5.5.3", default-features = false }
|
||||||
dirs = { version = "5.0.1", default-features = false }
|
dirs = { version = "5.0.1", default-features = false }
|
||||||
|
|
|
@ -42,10 +42,11 @@ borsh = { workspace = true }
|
||||||
bytemuck = { workspace = true }
|
bytemuck = { workspace = true }
|
||||||
bytes = { workspace = true }
|
bytes = { workspace = true }
|
||||||
cfg-if = { workspace = true }
|
cfg-if = { workspace = true }
|
||||||
clap = { workspace = true }
|
clap = { workspace = true, features = ["cargo"] }
|
||||||
chrono = { workspace = true }
|
chrono = { workspace = true }
|
||||||
crypto-bigint = { workspace = true }
|
crypto-bigint = { workspace = true }
|
||||||
crossbeam = { workspace = true }
|
crossbeam = { workspace = true }
|
||||||
|
const_format = { workspace = true }
|
||||||
curve25519-dalek = { workspace = true }
|
curve25519-dalek = { workspace = true }
|
||||||
dashmap = { workspace = true }
|
dashmap = { workspace = true }
|
||||||
dirs = { workspace = true }
|
dirs = { workspace = true }
|
||||||
|
|
|
@ -17,6 +17,7 @@ mod config;
|
||||||
mod p2p;
|
mod p2p;
|
||||||
mod rpc;
|
mod rpc;
|
||||||
mod txpool;
|
mod txpool;
|
||||||
|
mod version;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
todo!()
|
todo!()
|
||||||
|
|
|
@ -32,12 +32,16 @@ use cuprate_rpc_types::{
|
||||||
SyncInfoResponse,
|
SyncInfoResponse,
|
||||||
},
|
},
|
||||||
misc::{BlockHeader, Status},
|
misc::{BlockHeader, Status},
|
||||||
|
CORE_RPC_VERSION,
|
||||||
};
|
};
|
||||||
use cuprate_types::{blockchain::BlockchainReadRequest, Chain};
|
use cuprate_types::{blockchain::BlockchainReadRequest, Chain};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
rpc::{blockchain, helper},
|
rpc::{
|
||||||
rpc::{CupratedRpcHandlerState, RESTRICTED_BLOCK_COUNT, RESTRICTED_BLOCK_HEADER_RANGE},
|
blockchain, helper, CupratedRpcHandlerState, RESTRICTED_BLOCK_COUNT,
|
||||||
|
RESTRICTED_BLOCK_HEADER_RANGE,
|
||||||
|
},
|
||||||
|
version::CUPRATED_VERSION_IS_RELEASE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Map a [`JsonRpcRequest`] to the function that will lead to a [`JsonRpcResponse`].
|
/// Map a [`JsonRpcRequest`] to the function that will lead to a [`JsonRpcResponse`].
|
||||||
|
@ -440,14 +444,14 @@ async fn get_coinbase_tx_sum(
|
||||||
|
|
||||||
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2981-L2996>
|
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2981-L2996>
|
||||||
async fn get_version(
|
async fn get_version(
|
||||||
state: CupratedRpcHandlerState,
|
mut state: CupratedRpcHandlerState,
|
||||||
request: GetVersionRequest,
|
request: GetVersionRequest,
|
||||||
) -> Result<GetVersionResponse, Error> {
|
) -> Result<GetVersionResponse, Error> {
|
||||||
Ok(GetVersionResponse {
|
Ok(GetVersionResponse {
|
||||||
base: ResponseBase::ok(),
|
base: ResponseBase::ok(),
|
||||||
version: todo!(),
|
version: CORE_RPC_VERSION,
|
||||||
release: todo!(),
|
release: CUPRATED_VERSION_IS_RELEASE,
|
||||||
current_height: todo!(),
|
current_height: helper::top_height(&mut state).await?.0,
|
||||||
target_height: todo!(),
|
target_height: todo!(),
|
||||||
hard_forks: todo!(),
|
hard_forks: todo!(),
|
||||||
})
|
})
|
||||||
|
|
8
binaries/cuprated/src/version.rs
Normal file
8
binaries/cuprated/src/version.rs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
//! - <https://github.com/monero-project/monero/blob/a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623/src/version.h>
|
||||||
|
//! - <https://github.com/monero-project/monero/blob/a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623/src/version.cpp.in>
|
||||||
|
|
||||||
|
use const_format::formatcp;
|
||||||
|
|
||||||
|
pub const CUPRATED_VERSION: &str = formatcp!("{}", clap::crate_version!());
|
||||||
|
pub const CUPRATED_RELEASE_NAME: &str = "Fluorine Fermi";
|
||||||
|
pub const CUPRATED_VERSION_IS_RELEASE: bool = !cfg!(debug_assertions);
|
Loading…
Reference in a new issue