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

Update for StartOS 0.3.6 #149

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
manager/target/
**/*.rs.bk
*.s9pk
startos/*.js
node_modules/
.DS_Store
.vscode/
scripts/embassy.js
docker-images/
docker-images
javascript
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "bitcoin"]
path = bitcoin
url = https://github.com/bitcoin/bitcoin
url = https://github.com/bitcoin/bitcoin/
82 changes: 24 additions & 58 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,67 +1,33 @@
PKG_VERSION := $(shell yq e ".version" manifest.yaml)
PKG_ID := $(shell yq e ".id" manifest.yaml)
MANAGER_SRC := $(shell find ./manager -name '*.rs') manager/Cargo.toml manager/Cargo.lock
VERSION_CORE := $(shell (cd bitcoin && git describe) | sed 's/^v//')
PACKAGE_ID := bitcoind

.DELETE_ON_ERROR:
# Phony targets
.PHONY: all clean install

all: verify
# Default target
all: ${PACKAGE_ID}.s9pk

clean:
rm -f $(PKG_ID).s9pk
rm -f docker-images/*.tar
rm -f scripts/*.js
# Build targets
${PACKAGE_ID}.s9pk: $(shell start-cli s9pk list-ingredients)
start-cli s9pk pack

verify: $(PKG_ID).s9pk
@start-sdk verify s9pk $(PKG_ID).s9pk
@echo " Done!"
@echo " Filesize: $(shell du -h $(PKG_ID).s9pk) is ready"
javascript/index.js: $(shell git ls-files startos) tsconfig.json node_modules package.json
npm run build

# for rebuilding just the arm image.
arm:
@rm -f docker-images/x86_64.tar
@ARCH=aarch64 $(MAKE) -s
node_modules: package.json package-lock.json
npm ci

# for rebuilding just the x86 image.
x86:
@rm -f docker-images/aarch64.tar
@ARCH=x86_64 $(MAKE) -s
package-lock.json: package.json
npm i

$(PKG_ID).s9pk: manifest.yaml assets/compat/* docker-images/aarch64.tar docker-images/x86_64.tar instructions.md scripts/embassy.js
ifeq ($(ARCH),aarch64)
@echo "start-sdk: Preparing aarch64 package ..."
else ifeq ($(ARCH),x86_64)
@echo "start-sdk: Preparing x86_64 package ..."
else
@echo "start-sdk: Preparing Universal Package ..."
endif
@start-sdk pack
# Clean target
clean:
rm -rf ${PACKAGE_ID}.s9pk
rm -rf javascript
rm -rf node_modules

# Install target
install:
@if [ ! -f ~/.embassy/config.yaml ]; then echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first."; exit 1; fi
@echo "\nInstalling to $$(grep -v '^#' ~/.embassy/config.yaml | cut -d'/' -f3) ...\n"
@[ -f $(PKG_ID).s9pk ] || ( $(MAKE) && echo "\nInstalling to $$(grep -v '^#' ~/.embassy/config.yaml | cut -d'/' -f3) ...\n" )
@start-cli package install $(PKG_ID).s9pk

docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh manager/target/aarch64-unknown-linux-musl/release/bitcoind-manager manifest.yaml check-rpc.sh check-synced.sh actions/*
ifeq ($(ARCH),x86_64)
else
mkdir -p docker-images
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) --build-arg ARCH=aarch64 --build-arg PLATFORM=arm64 --platform=linux/arm64 -o type=docker,dest=docker-images/aarch64.tar .
endif

docker-images/x86_64.tar: Dockerfile docker_entrypoint.sh manager/target/x86_64-unknown-linux-musl/release/bitcoind-manager manifest.yaml check-rpc.sh check-synced.sh actions/*
ifeq ($(ARCH),aarch64)
else
mkdir -p docker-images
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) --build-arg ARCH=x86_64 --build-arg PLATFORM=amd64 --platform=linux/amd64 -o type=docker,dest=docker-images/x86_64.tar .
endif

manager/target/aarch64-unknown-linux-musl/release/bitcoind-manager: $(MANAGER_SRC)
docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/manager:/home/rust/src messense/rust-musl-cross:aarch64-musl cargo build --release

manager/target/x86_64-unknown-linux-musl/release/bitcoind-manager: $(MANAGER_SRC)
docker run --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/manager:/home/rust/src messense/rust-musl-cross:x86_64-musl cargo build --release

scripts/embassy.js: scripts/**/*.ts
deno bundle scripts/embassy.ts scripts/embassy.js
@if [ ! -f ~/.startos/config.yaml ]; then echo "You must define \"host: http://server-name.local\" in ~/.startos/config.yaml config file first."; exit 1; fi
@echo "\nInstalling to $$(grep -v '^#' ~/.startos/config.yaml | cut -d'/' -f3) ...\n"
@[ -f $(PACKAGE_ID).s9pk ] || ( $(MAKE) && echo "\nInstalling to $$(grep -v '^#' ~/.startos/config.yaml | cut -d'/' -f3) ...\n" )
@start-cli package install -s $(PACKAGE_ID).s9pk
7 changes: 7 additions & 0 deletions Old/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
manager/target/
**/*.rs.bk
*.s9pk
.DS_Store
.vscode/
scripts/embassy.js
docker-images/
3 changes: 3 additions & 0 deletions Old/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bitcoin"]
path = bitcoin
url = https://github.com/bitcoin/bitcoin
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ export const getConfig: T.ExpectedExports.getConfig = async (effects) => {
"zmq-enabled": {
type: "boolean",
name: "ZeroMQ Enabled",
description: "The ZeroMQ interface is useful for some applications which might require data related to block and transaction events from Bitcoin Core. For example, LND requires ZeroMQ be enabled for LND to get the latest block data",
description: "The ZeroMQ interface is useful for some applications which might require data related to block and transaction events from Bitcoin. For example, LND requires ZeroMQ be enabled for LND to get the latest block data",
default: true,
},
txindex: {
type: "boolean",
name: "Transaction Index",
description: "By enabling Transaction Index (txindex) Bitcoin Core will build a complete transaction index. This allows Bitcoin Core to access any transaction with commands like `gettransaction`.",
description: "By enabling Transaction Index (txindex) Bitcoin will build a complete transaction index. This allows Bitcoin to access any transaction with commands like `gettransaction`.",
default: allowUnpruned,
},
coinstatsindex: {
Expand Down Expand Up @@ -302,7 +302,7 @@ export const getConfig: T.ExpectedExports.getConfig = async (effects) => {
},
},
},
pruning: {
prune: {
type: "union",
name: "Pruning Settings",
description:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading