Skip to content

Commit

Permalink
Merge pull request #812 from plebhash/rename-lib-crates
Browse files Browse the repository at this point in the history
rename some lib crates
  • Loading branch information
plebhash authored Mar 27, 2024
2 parents 2322781 + 70c1016 commit 603bf70
Show file tree
Hide file tree
Showing 41 changed files with 70 additions and 53 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/release-libs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,15 @@ jobs:
run: |
cd utils/key-utils
cargo publish
- name: Publish crate network-helpers
- name: Publish crate network_helpers_sv2
continue-on-error: true
run: |
cd utils/network-helpers
cd roles/roles-utils/network-helpers
cargo publish
- name: Publish crate rpc_sv2
continue-on-error: true
run: |
cd roles/roles-utils/rpc
cargo publish
- name: Publish crate jd_client
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions benches/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 benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ num-traits = "0.2.15"
bitcoin="0.28.1"
codec_sv2 = { path = "../protocols/v2/codec-sv2", features=["noise_sv2"] }
binary_sv2 = { path = "../protocols/v2/binary-sv2/binary-sv2" }
network_helpers = { path = "../utils/network-helpers", features=["async_std"] }
network_helpers_sv2 = { path = "../roles/roles-utils/network-helpers", features=["async_std"] }
rand = "0.8.4"

[[bench]]
Expand Down
4 changes: 2 additions & 2 deletions examples/ping-pong-with-noise/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ async-std="1.8.0"
bytes = "1.0.1"
binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" }
codec_sv2 = { version = "^1.0.0", path = "../../protocols/v2/codec-sv2", features=["noise_sv2"] }
network_helpers = { version = "^1.0.0", path = "../../utils/network-helpers", features=["async_std"] }
network_helpers_sv2 = { version = "^1.0.0", path = "../../roles/roles-utils/network-helpers", features=["async_std"] }
key-utils = { version = "^1.0.0", path = "../../utils/key-utils" }

[features]
with_serde = ["binary_sv2/with_serde", "serde", "codec_sv2/with_serde", "network_helpers/with_serde"]
with_serde = ["binary_sv2/with_serde", "serde", "codec_sv2/with_serde", "network_helpers_sv2/with_serde"]
2 changes: 1 addition & 1 deletion examples/ping-pong-with-noise/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use codec_sv2::{Frame, HandshakeRole, StandardEitherFrame, StandardSv2Frame};

use std::time;

use network_helpers::Connection;
use network_helpers_sv2::Connection;

#[derive(Debug)]
enum Expected {
Expand Down
2 changes: 1 addition & 1 deletion examples/template-provider-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ publish = false
[dependencies]
codec_sv2 = { version = "1.0", path = "../../protocols/v2/codec-sv2", features=["noise_sv2"] }
roles_logic_sv2 = { version = "^0.1.0", path = "../../protocols/v2/roles-logic-sv2" }
network_helpers = { version = "^0.1.0", path = "../../utils/network-helpers", features=["async_std"] }
network_helpers_sv2 = { version = "^0.1.0", path = "../../roles/roles-utils/network-helpers", features=["async_std"] }
async-channel = "1.5.1"
async-std={version = "1.8.0", features = ["attributes"]}
32 changes: 23 additions & 9 deletions roles/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 roles/jd-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-
buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" }
codec_sv2 = { version = "1.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] }
framing_sv2 = { version = "^1.0.0", path = "../../protocols/v2/framing-sv2" }
network_helpers = { version = "1.0.0", path = "../../utils/network-helpers", features=["with_tokio", "with_buffer_pool"] }
network_helpers_sv2 = { version = "1.0.0", path = "../roles-utils/network-helpers", features=["with_tokio", "with_buffer_pool"] }
roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" }
serde = { version = "1.0.89", default-features = false, features = ["derive", "alloc"] }
futures = "0.3.25"
Expand Down
2 changes: 1 addition & 1 deletion roles/jd-client/src/lib/downstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ impl ParseDownstreamCommonMessages<roles_logic_sv2::routing_logic::NoRouting>
}
}

use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use std::net::SocketAddr;
use tokio::{net::TcpListener, task::AbortHandle};

Expand Down
2 changes: 1 addition & 1 deletion roles/jd-client/src/lib/job_declarator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub mod message_handler;
use async_channel::{Receiver, Sender};
use binary_sv2::{Seq0255, Seq064K, B016M, B064K, U256};
use codec_sv2::{HandshakeRole, Initiator, StandardEitherFrame, StandardSv2Frame};
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use roles_logic_sv2::{
handlers::SendTo_,
job_declaration_sv2::{AllocateMiningJobTokenSuccess, SubmitSolutionJd},
Expand Down
2 changes: 1 addition & 1 deletion roles/jd-client/src/lib/template_receiver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use async_channel::{Receiver, Sender};
use codec_sv2::{Frame, HandshakeRole, Initiator, StandardEitherFrame, StandardSv2Frame};
use error_handling::handle_result;
use key_utils::Secp256k1PublicKey;
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use roles_logic_sv2::{
handlers::{template_distribution::ParseServerTemplateDistributionMessages, SendTo_},
job_declaration_sv2::AllocateMiningJobTokenSuccess,
Expand Down
2 changes: 1 addition & 1 deletion roles/jd-client/src/lib/upstream_sv2/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use binary_sv2::{Seq0255, U256};
use codec_sv2::{Frame, HandshakeRole, Initiator};
use error_handling::handle_result;
use key_utils::Secp256k1PublicKey;
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use roles_logic_sv2::{
channel_logic::channel_factory::PoolChannelFactory,
common_messages_sv2::{Protocol, SetupConnection},
Expand Down
6 changes: 3 additions & 3 deletions roles/jd-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-
buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" }
codec_sv2 = { version = "1.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2"] }
const_sv2 = { version = "^1.0.0", path = "../../protocols/v2/const-sv2" }
network_helpers = { version = "1.0.0", path = "../../utils/network-helpers", features = ["with_tokio"] }
noise_sv2 = { version = "1.0.0", path = "../../protocols/v2/noise-sv2" }
network_helpers_sv2 = { version = "1.0.0", path = "../roles-utils/network-helpers", features = ["with_tokio"] }
noise_sv2 = { version = "1.1.0", path = "../../protocols/v2/noise-sv2" }
rand = "0.8.4"
roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" }
tokio = { version = "1", features = ["full"] }
Expand All @@ -31,5 +31,5 @@ serde = { version = "1.0.89", features = ["derive", "alloc"], default-features =
hashbrown = { version = "0.11", default-features = false, features = ["ahash", "serde"] }
key-utils = { version = "^1.0.0", path = "../../utils/key-utils" }
secp256k1 = { version = "0.28.2", default-features = false, features =["alloc","rand","rand-std"] }
rpc = { version = "1.0.0", path = "../../utils/rpc"}
rpc_sv2 = { version = "1.0.0", path = "../roles-utils/rpc" }
hex = "0.4.3"
2 changes: 1 addition & 1 deletion roles/jd-server/src/lib/job_declarator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use binary_sv2::{B0255, U256};
use codec_sv2::{Frame, HandshakeRole, Responder};
use error_handling::handle_result;
use key_utils::{Secp256k1PublicKey, Secp256k1SecretKey};
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use nohash_hasher::BuildNoHashHasher;
use roles_logic_sv2::{
common_messages_sv2::SetupConnectionSuccess,
Expand Down
2 changes: 1 addition & 1 deletion roles/jd-server/src/lib/mempool/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rpc::mini_rpc_client::RpcError;
use rpc_sv2::mini_rpc_client::RpcError;
use tokio::task::JoinError;
use tracing::{error, warn};

Expand Down
2 changes: 1 addition & 1 deletion roles/jd-server/src/lib/mempool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use async_channel::Receiver;
use bitcoin::blockdata::transaction::Transaction;
use hashbrown::HashMap;
use roles_logic_sv2::utils::Mutex;
use rpc::mini_rpc_client;
use rpc_sv2::mini_rpc_client;
use std::{convert::TryInto, str::FromStr, sync::Arc};
use stratum_common::{bitcoin, bitcoin::hash_types::Txid};

Expand Down
2 changes: 1 addition & 1 deletion roles/mining-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" }
codec_sv2 = { version = "1.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] }
const_sv2 = { version = "^1.0.0", path = "../../protocols/v2/const-sv2" }
futures = "0.3.19"
network_helpers = {version = "1.0.0", path = "../../utils/network-helpers", features = ["with_tokio","with_buffer_pool"] }
network_helpers_sv2 = {version = "1.0.0", path = "../roles-utils/network-helpers", features = ["with_tokio","with_buffer_pool"] }
once_cell = "1.12.0"
roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" }
serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion roles/mining-proxy/src/lib/downstream_mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ impl
}
}

use network_helpers::plain_connection_tokio::PlainConnection;
use network_helpers_sv2::plain_connection_tokio::PlainConnection;
use std::net::SocketAddr;
use tokio::net::TcpListener;

Expand Down
2 changes: 1 addition & 1 deletion roles/mining-proxy/src/lib/upstream_mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::downstream_mining::{Channel, DownstreamMiningNode, StdFrame as Downst
use async_channel::{Receiver, SendError, Sender};
use async_recursion::async_recursion;
use codec_sv2::{Frame, HandshakeRole, Initiator, StandardEitherFrame, StandardSv2Frame};
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use nohash_hasher::BuildNoHashHasher;
use roles_logic_sv2::{
channel_logic::{
Expand Down
2 changes: 1 addition & 1 deletion roles/pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-
buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" }
codec_sv2 = { version = "1.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2"] }
const_sv2 = { version = "^1.0.0", path = "../../protocols/v2/const-sv2" }
network_helpers = { version = "1.0.0", path = "../../utils/network-helpers", features =["with_tokio","with_buffer_pool"] }
network_helpers_sv2 = { version = "1.0.0", path = "../roles-utils/network-helpers", features =["with_tokio","with_buffer_pool"] }
noise_sv2 = { version = "1.0.0", path = "../../protocols/v2/noise-sv2" }
rand = "0.8.4"
roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" }
Expand Down
2 changes: 1 addition & 1 deletion roles/pool/src/lib/mining_pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use binary_sv2::U256;
use codec_sv2::{Frame, HandshakeRole, Responder, StandardEitherFrame, StandardSv2Frame};
use error_handling::handle_result;
use key_utils::{Secp256k1PublicKey, Secp256k1SecretKey};
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use nohash_hasher::BuildNoHashHasher;
use roles_logic_sv2::{
channel_logic::channel_factory::PoolChannelFactory,
Expand Down
2 changes: 1 addition & 1 deletion roles/pool/src/lib/template_receiver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use async_channel::{Receiver, Sender};
use codec_sv2::{Frame, HandshakeRole, Initiator};
use error_handling::handle_result;
use key_utils::Secp256k1PublicKey;
use network_helpers::noise_connection_tokio::Connection;
use network_helpers_sv2::noise_connection_tokio::Connection;
use roles_logic_sv2::{
handlers::template_distribution::ParseServerTemplateDistributionMessages,
parsers::{PoolMessages, TemplateDistribution},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "network_helpers"
name = "network_helpers_sv2"
version = "1.0.0"
authors = ["fi3 <[email protected]>"]
edition = "2018"
Expand All @@ -13,9 +13,9 @@ repository = "https://github.com/stratum-mining/stratum"
async-std = { version = "1.8.0", optional = true }
async-channel = { version = "1.8.0", optional = true }
tokio = { version = "1", features = ["full"], optional = true }
binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2", optional = true }
codec_sv2 = { version = "1.0.0", path = "../../protocols/v2/codec-sv2", features=["noise_sv2"], optional = true }
const_sv2 = {version = "1.0.0", path = "../../protocols/v2/const-sv2"}
binary_sv2 = { version = "^1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2", optional = true }
codec_sv2 = { version = "1.0.0", path = "../../../protocols/v2/codec-sv2", features=["noise_sv2"], optional = true }
const_sv2 = {version = "1.0.0", path = "../../../protocols/v2/const-sv2"}
serde = { version = "1.0.89", features = ["derive"], default-features = false, optional = true }
tracing = { version = "0.1" }
futures = "0.3.28"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions utils/rpc/Cargo.toml → roles/roles-utils/rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "rpc"
name = "rpc_sv2"
version = "1.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
stratum-common = { path = "../../common" }
stratum-common = { path = "../../../common" }
serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["alloc","raw_value"] }
hex = "0.4.3"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion roles/tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[default]
features = "default"
features = "with_buffer_pool async_std tokio with_tokio default"
run-types = [ "Lib" ]
timeout = "120s"
fail-under = 20
Expand Down
2 changes: 1 addition & 1 deletion roles/test-utils/mining-device/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const_sv2 = { version = "1.0.0", path = "../../../protocols/v2/const-sv2" }
async-channel = "1.5.1"
async-std={version = "1.8.0", features = ["attributes"]}
binary_sv2 = { version = "1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2" }
network_helpers = { version = "1.0.0", path = "../../../utils/network-helpers", features=["async_std"] }
network_helpers_sv2 = { version = "1.0.0", path = "../../roles-utils/network-helpers", features=["async_std"] }
buffer_sv2 = { version = "1.0.0", path = "../../../utils/buffer"}
async-recursion = "0.3.2"
rand = "0.8.4"
Expand Down
Loading

0 comments on commit 603bf70

Please sign in to comment.