forked from wormhole-foundation/wormhole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WH-1903: snapshot of btc node work @ Closes wormhole-foundation#1903
- Loading branch information
1 parent
b0a9218
commit 2fab13e
Showing
7 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 @@ | ||
FROM --platform=linux/amd64 docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9ff8d251691b810d95ea6023a03cdca139df58bca599 AS bitcoin-build | ||
|
||
ARG ARCH=amd64 | ||
|
||
ENV GO111MODULE=on | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install git netcat | ||
|
||
RUN git clone https://github.com/btcsuite/btcd.git | ||
|
||
WORKDIR /app/btcd | ||
|
||
RUN go install -v . ./cmd/... | ||
|
||
WORKDIR /app | ||
|
||
RUN git clone https://github.com/btcsuite/btcwallet.git | ||
WORKDIR /app/btcwallet | ||
|
||
RUN go install -v . ./cmd/... | ||
|
||
WORKDIR /root | ||
COPY scripts/.btcwallet .btcwallet | ||
COPY scripts/start_node.sh . | ||
|
This file contains 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,8 @@ | ||
|
||
use this node https://github.com/btcsuite/btcd and run with the --addrindex option | ||
https://gist.github.com/davecgh/2992ed85d41307e794f6 | ||
|
||
# DOCKER_BUILDKIT=1 docker build --progress plain -f Dockerfile -t foo . | ||
% docker run -it -v `pwd`:`pwd` -w `pwd` foo bash | ||
|
||
kubectl exec -it btc-0 -c btc-node -- /bin/bash |
Empty file.
Binary file not shown.
This file contains 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,18 @@ | ||
#!/bin/bash -f | ||
|
||
# 18554 --wallet | ||
# 18555 --btc server | ||
# 18556 --RPC server | ||
|
||
set -x | ||
|
||
/go/bin/btcd --addrindex --simnet --rpcuser=wormhole --rpcpass=w0rmh013 --miningaddr=ShadQfLbaRSnU5c1XrLknkLyWCkVV8rGMy --rpclisten 0.0.0.0:18556 & | ||
sleep 1 | ||
/go/bin/btcwallet --simnet --username wormhole --password=w0rmh013 --rpclisten 0.0.0.0:18554 & | ||
sleep 1 | ||
/go/bin/btcctl --simnet --wallet --rpcuser=wormhole --rpcpass=w0rmh013 walletpassphrase foo 9999 | ||
/go/bin/btcctl --simnet --wallet --rpcuser=wormhole --rpcpass=w0rmh013 importprivkey Frd9p1JbyHgmcRrEzixN4LAAhK7forzdw65A9j6CTXRGiwawqKkg | ||
/go/bin/btcctl --simnet --rpcuser=wormhole --rpcpass=w0rmh013 generate 100 | ||
jobs | ||
#sleep infinity | ||
nc -lk 0.0.0.0 18557 |
This file contains 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,45 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: btc | ||
name: btc | ||
spec: | ||
ports: | ||
- name: node | ||
port: 18556 | ||
targetPort: 18556 | ||
selector: | ||
app: btc | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
labels: | ||
app: btc | ||
name: btc | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: btc | ||
serviceName: btc | ||
template: | ||
metadata: | ||
labels: | ||
app: btc | ||
spec: | ||
containers: | ||
- name: btc-node | ||
image: btc-node | ||
command: | ||
- /bin/sh | ||
- -c | ||
- /root/start_node.sh | ||
ports: | ||
- containerPort: 18556 | ||
name: node | ||
protocol: TCP | ||
readinessProbe: | ||
tcpSocket: | ||
port: 18557 |