diff --git a/src/lib.rs b/src/lib.rs index 529c5b1..d8e9d4e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; @@ -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 { @@ -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 diff --git a/templates/bitcoind-pod.template.yaml b/templates/bitcoind-pod.template.yaml new file mode 100644 index 0000000..7ab10c3 --- /dev/null +++ b/templates/bitcoind-pod.template.yaml @@ -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 \ No newline at end of file diff --git a/templates/chain-coordinator-pod.template.yaml b/templates/chain-coordinator-pod.template.yaml new file mode 100644 index 0000000..79f7838 --- /dev/null +++ b/templates/chain-coordinator-pod.template.yaml @@ -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 \ No newline at end of file diff --git a/templates/stacks-node-pod.template.yaml b/templates/stacks-node-pod.template.yaml index e49706f..253ed7c 100644 --- a/templates/stacks-node-pod.template.yaml +++ b/templates/stacks-node-pod.template.yaml @@ -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