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

Fix/remove sleep #22

Draft
wants to merge 4 commits into
base: feat/logging
Choose a base branch
from
Draft
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
8 changes: 3 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use resources::{
StacksDevnetResource,
};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::thread::sleep;
use std::{collections::BTreeMap, str::FromStr, time::Duration};
use std::{collections::BTreeMap, str::FromStr};
use strum::IntoEnumIterator;
use tower::BoxError;

Expand Down Expand Up @@ -171,10 +170,8 @@ impl StacksDevnetApiK8sManager {
});
}
}
self.deploy_bitcoin_node_pod(&config).await?;

sleep(Duration::from_secs(5));

self.deploy_bitcoin_node_pod(&config).await?;
self.deploy_stacks_node_pod(&config).await?;

if !config.disable_stacks_api {
Expand Down Expand Up @@ -672,6 +669,7 @@ impl StacksDevnetApiK8sManager {
wait_time_for_blocks = 0
wait_time_for_microblocks = {}
microblock_frequency = 1000
fallback_to_follower = false

[connection_options]
# inv_sync_interval = 10
Expand Down
33 changes: 33 additions & 0 deletions templates/bitcoind-pod.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: Pod
metadata:
labels:
name: bitcoind
service: bitcoind-chain-coordinator
name: bitcoind
namespace: "{namespace}"
spec:
containers:
- command:
- /usr/local/bin/bitcoind
- -conf=/etc/bitcoin/bitcoin.conf
- -nodebuglogfile
- -pid=/run/bitcoind.pid
image: quay.io/hirosystems/bitcoind:devnet-v3
imagePullPolicy: IfNotPresent
name: bitcoind-container
ports:
- containerPort: 18444
name: p2p
protocol: TCP
- containerPort: 18443
name: rpc
protocol: TCP
volumeMounts:
- mountPath: /etc/bitcoin
name: bitcoind-conf-volume
readOnly: true
volumes:
- configMap:
name: bitcoind-conf
name: bitcoind-conf-volume
54 changes: 54 additions & 0 deletions templates/chain-coordinator-pod.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: v1
kind: Pod
metadata:
labels:
name: chain-coordinator
service: bitcoind-chain-coordinator
name: chain-coordinator
namespace: "{namespace}"
spec:
containers:
- command:
- ./stacks-network
- --namespace=$(NAMESPACE)
- --manifest-path=/etc/stacks-network/project/Clarinet.toml
- --deployment-plan-path=/etc/stacks-network/project/deployments/default.devnet-plan.yaml
- --project-root-path=/etc/stacks-network/project/
env:
- name: NAMESPACE
valueFrom:
configMapKeyRef:
name: namespace-conf
key: NAMESPACE
image: stacks-network-orchestrator
imagePullPolicy: Never
name: chain-coordinator-container
ports:
- containerPort: 20445
name: coordinator-in
protocol: TCP
- containerPort: 20446
name: coordinator-con
protocol: TCP
volumeMounts:
- mountPath: /etc/stacks-network/project
name: project-manifest-conf-volume
- mountPath: /etc/stacks-network/project/settings
name: devnet-conf-volume
- mountPath: /etc/stacks-network/project/deployments
name: deployment-plan-conf-volume
- mountPath: /etc/stacks-network/project/contracts
name: project-dir-conf-volume
volumes:
- configMap:
name: project-manifest-conf
name: project-manifest-conf-volume
- configMap:
name: devnet-conf
name: devnet-conf-volume
- configMap:
name: deployment-plan-conf
name: deployment-plan-conf-volume
- configMap:
name: project-dir-conf
name: project-dir-conf-volume
8 changes: 5 additions & 3 deletions templates/stacks-node-pod.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ spec:
- name: BLOCKSTACK_USE_TEST_GENESIS_CHAINSTATE
value: "1"
- name: STACKS_LOG_DEBUG
value: "0"
image: quay.io/hirosystems/stacks-node:devnet-v3
imagePullPolicy: IfNotPresent
value: "1"
image: stacks-node-mine
imagePullPolicy: Never
# image: quay.io/hirosystems/stacks-node:devnet-v3
# imagePullPolicy: IfNotPresent
name: stacks-node-container
ports:
- containerPort: 20444
Expand Down