Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean and update-dependencies #106

Merged
merged 8 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,191 changes: 94 additions & 1,097 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 10 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,21 @@ repository = "https://github.com/hirosystems/stacks-devnet-api"
[dependencies]
kube = { version="0.82.2", features = ["client", "runtime"] }
k8s-openapi = { version = "0.18.0", features = ["v1_25"] }
futures = "0.3.28"
futures = "0.3.31"
tokio = { version = "1.35.1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.114"
serde_json = "1.0.132"
serde_yaml = "0.8.23"
hyper = { version = "0.14", features = ["full"] }
tower = "0.4.13"
http-body = "0.4.5"
hiro-system-kit = {version = "0.1.0", features = ["log"]}
hiro-system-kit = { version = "0.1.0", features = ["log"] }
strum_macros = "0.24.3"
strum = "0.24.1"
# clarity-repl = "1.8.0"
# clarity-repl = {version = "2.2.0", path = "../clarinet/components/clarity-repl" }
clarity-repl = {version = "2.9.0", git = "https://github.com/hirosystems/clarinet.git", rev="7085b877cdb9d533ccbf24cd947c5b4ee04bcc5b" }
# clarinet-files = {version = "1.0.3" }
# clarinet-files = {version = "2.2.0", path = "../clarinet/components/clarinet-files" }
clarinet-files = {version = "2.9.0", git = "https://github.com/hirosystems/clarinet.git", rev="7085b877cdb9d533ccbf24cd947c5b4ee04bcc5b" }
# clarinet-deployments = {version = "1.0.3" }
# clarinet-deployments = {version = "2.2.0", path = "../clarinet/components/clarinet-deployments" }
clarinet-deployments = {version = "2.9.0", git = "https://github.com/hirosystems/clarinet.git", rev="7085b877cdb9d533ccbf24cd947c5b4ee04bcc5b" }
# chainhook-types = "1.0"
chainhook-types = { version = "1.3" }
toml = "0.5.9"

clarinet-files = "2"
clarinet-deployments = "2"

[dev-dependencies]
tower-test = "0.4.0"
test-case = "3.1.0"
Expand All @@ -46,3 +37,7 @@ serial_test = "2.0.0"

[features]
k8s_tests = []

[patch.crates-io]
clarinet-files = { version = "2",git = "https://github.com/hirosystems/clarinet.git", rev = "ad72f15a418b7da3c5b4e39c373f69003abb0b49" }
clarinet-deployments = { version = "2",git = "https://github.com/hirosystems/clarinet.git", rev = "ad72f15a418b7da3c5b4e39c373f69003abb0b49" }
4 changes: 2 additions & 2 deletions examples/new-network.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
"stacks_node_rpc_port": 20443,
"stacks_node_wait_time_for_microblocks": 50,
"stacks_node_first_attempt_time_ms": 500,
"stacks_node_subsequent_attempt_time_ms": 1000,
"stacks_node_events_observers": [],
"stacks_node_env_vars": [],
"stacks_api_port": 3999,
Expand Down Expand Up @@ -292,7 +291,8 @@
],
"execute_script": [],
"bitcoin_node_image_url": "quay.io/hirosystems/bitcoind:devnet-v3",
"stacks_node_image_url": "quay.io/hirosystems/stacks-node:devnet-2.4.0.0.0",
"stacks_node_image_url": "quay.io/hirosystems/stacks-node:devnet-3.0",
"stacks_signer_image_url": "quay.io/hirosystems/stacks-signer:devnet-3.0",
"stacks_api_image_url": "hirosystems/stacks-blockchain-api:latest",
"stacks_explorer_image_url": "hirosystems/explorer:latest",
"postgres_image_url": "postgres:14",
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ mod tests {
file_buffer
}

#[track_caller]
fn get_template_config(file_path: &str) -> StacksDevnetConfig {
let file_buffer = read_file(file_path);

Expand Down
26 changes: 9 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use chainhook_types::StacksNetwork;
use clarinet_files::compute_addresses;
use clarinet_files::{compute_addresses, StacksNetwork};
use futures::future::try_join3;
use hiro_system_kit::{slog, Logger};
use hyper::{body::Bytes, Body, Client as HttpClient, Request, Response, Uri};
use hyper::{
body::{Bytes, HttpBody},
Body, Client as HttpClient, Request, Response, Uri,
};
use k8s_openapi::{
api::{
apps::v1::{Deployment, StatefulSet},
Expand Down Expand Up @@ -165,7 +167,7 @@ impl StacksDevnetApiK8sManager {
S: tower::Service<Request<Body>, Response = Response<B>> + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<BoxError>,
B: http_body::Body<Data = Bytes> + Send + 'static,
B: HttpBody<Data = Bytes> + Send + 'static,
B::Error: Into<BoxError>,
T: Into<String>,
{
Expand Down Expand Up @@ -1170,7 +1172,7 @@ impl StacksDevnetApiK8sManager {
rpcserialversion=1
disablewallet=0
fallbackfee=0.00001

[regtest]
bind=0.0.0.0:{}
rpcbind=0.0.0.0:{}
Expand Down Expand Up @@ -1281,14 +1283,11 @@ impl StacksDevnetApiK8sManager {
disable_inbound_handshakes = true
disable_inbound_walks = true
public_ip_address = "1.1.1.1:1234"
block_proposal_token = "12345"
auth_token = "12345"

[miner]
min_tx_fee = 1
first_attempt_time_ms = {}
second_attempt_time_ms = {}
block_reward_recipient = "{}"
wait_for_block_download = false
microblock_attempt_time_ms = 10
mining_key = "19ec1c3e31d139c989a23a27eac60d1abfad5277d3ae9604242514c738258efa01"
"#,
Expand All @@ -1299,7 +1298,6 @@ impl StacksDevnetApiK8sManager {
stacks_miner_secret_key_hex,
stacks_miner_secret_key_hex,
devnet_config.stacks_node_first_attempt_time_ms,
devnet_config.stacks_node_subsequent_attempt_time_ms,
miner_coinbase_recipient
);

Expand Down Expand Up @@ -1332,8 +1330,6 @@ impl StacksDevnetApiK8sManager {
# Add orchestrator (docker-host) as an event observer
[[events_observer]]
endpoint = "{}:{}"
retry_count = 255
include_data_events = true
events_keys = ["*"]
"#,
bitcoind_chain_coordinator_host, chain_coordinator_ingestion_port
Expand All @@ -1344,8 +1340,6 @@ impl StacksDevnetApiK8sManager {
# Add stacks-blockchain-api as an event observer
[[events_observer]]
endpoint = "{}:{}"
retry_count = 255
include_data_events = false
events_keys = ["*"]
"#,
get_service_url(&namespace, StacksDevnetService::StacksBlockchainApi),
Expand All @@ -1372,8 +1366,6 @@ impl StacksDevnetApiK8sManager {
# Add stacks-signer-{} as an event observer
[[events_observer]]
endpoint = "{}:{}"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
"#,
signer_idx.to_string(),
Expand All @@ -1394,7 +1386,7 @@ impl StacksDevnetApiK8sManager {
burn_fee_cap = 20_000
poll_time_secs = 1
timeout = 30
peer_host = "{}"
peer_host = "{}"
rpc_ssl = false
wallet_name = "{}"
username = "{}"
Expand Down
5 changes: 2 additions & 3 deletions src/tests/fixtures/network-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ devnet_settings:
stacks_node_rpc_port: 20443
stacks_node_wait_time_for_microblocks: 50
stacks_node_first_attempt_time_ms: 500
stacks_node_subsequent_attempt_time_ms: 1000
stacks_node_events_observers:
- "host.docker.internal:20455"
stacks_node_env_vars: []
Expand Down Expand Up @@ -148,8 +147,8 @@ devnet_settings:
auto_extend: ~
execute_script: []
bitcoin_node_image_url: "quay.io/hirosystems/bitcoind:devnet-v3"
stacks_node_image_url: "quay.io/hirosystems/stacks-node:devnet-2.4.0.0.0"
stacks_signers_image_url: "quay.io/hirosystems/stacks-node:devnet-2.4.0.0.0"
stacks_node_image_url: "quay.io/hirosystems/stacks-node:devnet-3.0"
stacks_signer_image_url: "quay.io/hirosystems/stacks-node:devnet-3.0"
stacks_api_image_url: "hirosystems/stacks-blockchain-api:latest"
stacks_explorer_image_url: "hirosystems/explorer:latest"
postgres_image_url: "postgres:14"
Expand Down
5 changes: 2 additions & 3 deletions src/tests/fixtures/stacks-devnet-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@
"stacks_node_rpc_port": 20443,
"stacks_node_wait_time_for_microblocks": 50,
"stacks_node_first_attempt_time_ms": 500,
"stacks_node_subsequent_attempt_time_ms": 1000,
"stacks_node_events_observers": ["host.docker.internal:20455"],
"stacks_node_env_vars": [],
"stacks_node_next_initiative_delay": 4000,
Expand Down Expand Up @@ -308,8 +307,8 @@
],
"execute_script": [],
"bitcoin_node_image_url": "quay.io/hirosystems/bitcoind:devnet-v3",
"stacks_node_image_url": "quay.io/hirosystems/stacks-node:devnet-2.4.0.0.0",
"stacks_signers_image_url": "quay.io/hirosystems/stacks-node:devnet-2.4.0.0.0",
"stacks_node_image_url": "quay.io/hirosystems/stacks-node:devnet-3.0",
"stacks_signer_image_url": "quay.io/hirosystems/stacks-node:devnet-3.0",
"stacks_api_image_url": "hirosystems/stacks-blockchain-api:latest",
"stacks_explorer_image_url": "hirosystems/explorer:latest",
"postgres_image_url": "postgres:14",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
image: hirosystems/stacks-network-orchestrator:clarinet-2.9.0
image: hirosystems/stacks-network-orchestrator:clarinet-2.11.0
imagePullPolicy: IfNotPresent
name: chain-coordinator
ports:
Expand Down
4 changes: 2 additions & 2 deletions templates/deployments/stacks-blockchain.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
value: "1"
- name: BLOCKSTACK_USE_TEST_GENESIS_CHAINSTATE
value: "1"
image: quay.io/hirosystems/stacks-node:devnet-2.5
image: quay.io/hirosystems/stacks-node:devnet-3.0
imagePullPolicy: IfNotPresent
name: stacks-blockchain
ports:
Expand All @@ -66,4 +66,4 @@ spec:
volumes:
- configMap:
name: stacks-blockchain
name: stacks-blockchain
name: stacks-blockchain
6 changes: 3 additions & 3 deletions templates/stateful-sets/stacks-signer-0.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
- stacks-signer
- run
- --config=/src/stacks-signer-0/Signer.toml
image: quay.io/hirosystems/stacks-signer:devnet-2.5
image: quay.io/hirosystems/stacks-signer:devnet-3.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 30001
Expand All @@ -62,7 +62,7 @@ spec:
cpu: 250m
memory: 750Mi # todo: revisit allocation
limits:
memory: 750Mi # todo: revisit allocation
memory: 750Mi # todo: revisit allocation
volumes:
- configMap:
name: stacks-signer-0
Expand All @@ -76,4 +76,4 @@ spec:
storageClassName: premium-rwo
resources:
requests:
storage: 1Gi
storage: 1Gi
8 changes: 4 additions & 4 deletions templates/stateful-sets/stacks-signer-1.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ spec:
- stacks-signer
- run
- --config=/src/stacks-signer-1/Signer.toml
image: quay.io/hirosystems/stacks-signer:devnet-2.5
image: quay.io/hirosystems/stacks-signer:devnet-3.0
imagePullPolicy: IfNotPresent
ports:
ports:
- containerPort: 30001
name: signer-event
protocol: TCP
Expand All @@ -62,7 +62,7 @@ spec:
cpu: 250m
memory: 750Mi # todo: revisit allocation
limits:
memory: 750Mi # todo: revisit allocation
memory: 750Mi # todo: revisit allocation
volumes:
- configMap:
name: stacks-signer-1
Expand All @@ -76,4 +76,4 @@ spec:
storageClassName: premium-rwo
resources:
requests:
storage: 1Gi
storage: 1Gi
Loading