-
Notifications
You must be signed in to change notification settings - Fork 35
Add local Bitcoin network simulation #690
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
Open
pyramation
wants to merge
1
commit into
main
Choose a base branch
from
codex/add-local-bitcoin-network-simulation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Bitcoin Chain Configuration in Starship | ||
|
||
Starship now supports running a local Bitcoin network alongside Cosmos and Ethereum chains. | ||
The configuration mirrors other chains and can be added in the `chains` section of your | ||
Starship config file. | ||
|
||
## Example Configuration | ||
```yaml | ||
chains: | ||
- id: bitcoin-local | ||
name: bitcoin | ||
numValidators: 1 | ||
ports: | ||
rpc: 18443 | ||
p2p: 18444 | ||
``` | ||
|
||
This will start a single `bitcoind` node in regtest mode exposing RPC on `18443` and | ||
P2P on `18444` which you can port-forward to localhost. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
starship/charts/devnet/templates/chains/bitcoin/service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{- range $chain := .Values.chains }} | ||
{{- if hasPrefix "bitcoin" $chain.name }} | ||
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} | ||
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ $chain.name }}-{{ $chain.id }} | ||
labels: | ||
app.kubernetes.io/name: {{ $chain.name }}-{{ $chain.id }} | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: rpc | ||
port: {{ $chain.ports.rpc | default 18443 }} | ||
protocol: TCP | ||
targetPort: {{ $chain.ports.rpc | default 18443 }} | ||
- name: p2p | ||
port: {{ $chain.ports.p2p | default 18444 }} | ||
protocol: TCP | ||
targetPort: {{ $chain.ports.p2p | default 18444 }} | ||
selector: | ||
app.kubernetes.io/name: {{ $chain.name }}-{{ $chain.id }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
39 changes: 39 additions & 0 deletions
39
starship/charts/devnet/templates/chains/bitcoin/statefulset.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{{- range $chain := .Values.chains }} | ||
{{- if hasPrefix "bitcoin" $chain.name }} | ||
{{ $defaultFile := $.Files.Get "defaults.yaml" | fromYaml }} | ||
{{ $chain := include "devnet.fullchain" (dict "name" $chain.id "file" $defaultFile "context" $) | fromJson }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ $chain.name }}-{{ $chain.id }} | ||
spec: | ||
serviceName: {{ $chain.name }}-{{ $chain.id }} | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ $chain.name }}-{{ $chain.id }} | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ $chain.name }}-{{ $chain.id }} | ||
app.kubernetes.io/type: {{ $chain.id }} | ||
spec: | ||
containers: | ||
- name: bitcoind | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also need some init containers so that the btc nodes are more configureable. |
||
image: {{ $chain.image }} | ||
args: | ||
- "-regtest" | ||
- "-server" | ||
- "-txindex" | ||
- "-rpcallowip=0.0.0.0/0" | ||
- "-rpcbind=0.0.0.0" | ||
- "-port={{ $chain.ports.p2p | default 18444 }}" | ||
- "-rpcport={{ $chain.ports.rpc | default 18443 }}" | ||
ports: | ||
- containerPort: {{ $chain.ports.rpc | default 18443 }} | ||
name: rpc | ||
- containerPort: {{ $chain.ports.p2p | default 18444 }} | ||
name: p2p | ||
{{- end }} | ||
{{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,8 @@ | |
"hyperweb", | ||
"noble", | ||
"xpla", | ||
"ethereum" | ||
"ethereum", | ||
"bitcoin" | ||
] | ||
}, | ||
"numValidators": { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be just a random docker image, and seems to be outdated.