Skip to content

Commit

Permalink
add demo tx gen tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-L2L committed Jul 16, 2024
1 parent 2ed6059 commit 7f1b7f5
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/check_lint_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ jobs:
APP_VERSION=$(cargo metadata --format-version 1 | \
jq -er '.packages | map(select(.name == "bip347-enforcer") | .version) | .[0]')
APP_FILENAME="bip347-enforcer-${APP_VERSION}-x86_64-unknown-linux-gnu"
DEMO_FILENAME="gen-demo-tx-${APP_VERSION}-x86_64-unknown-linux-gnu"
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_ENV"
echo "APP_FILENAME=$APP_FILENAME" >> "$GITHUB_ENV"
echo "DEMO_FILENAME=$DEMO_FILENAME" >> "$GITHUB_ENV"
- name: 'Set filenames for release binaries'
run: |
pushd "target/release"
ln -fs "bip347-enforcer" "${APP_FILENAME}"
ln -fs "gen-demo-tx" "${DEMO_FILENAME}"
popd
- name: 'Upload Artifacts'
Expand All @@ -70,13 +73,15 @@ jobs:
if-no-files-found: error
path: |
target/release/${{ env.APP_FILENAME }}
target/release/${{ env.DEMO_FILENAME }}
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/${{ env.APP_FILENAME }}
target/release/${{ env.DEMO_FILENAME }}
fail_on_unmatched_files: true

build-macos:
Expand Down Expand Up @@ -110,13 +115,16 @@ jobs:
APP_VERSION=$(cargo metadata --format-version 1 | \
jq -er '.packages | map(select(.name == "bip347-enforcer") | .version) | .[0]')
APP_FILENAME="bip347-enforcer-${APP_VERSION}-x86_64-apple-darwin"
DEMO_FILENAME="gen-demo-tx-${APP_VERSION}-x86_64-apple-darwin"
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_ENV"
echo "APP_FILENAME=$APP_FILENAME" >> "$GITHUB_ENV"
echo "DEMO_FILENAME=$DEMO_FILENAME" >> "$GITHUB_ENV"
- name: 'Set filenames for release binaries'
run: |
pushd "target/release"
ln -fs "bip347-enforcer" "${APP_FILENAME}"
ln -fs "gen-demo-tx" "${DEMO_FILENAME}"
popd
- name: 'Upload Artifacts'
Expand All @@ -126,13 +134,15 @@ jobs:
if-no-files-found: error
path: |
target/release/${{ env.APP_FILENAME }}
target/release/${{ env.DEMO_FILENAME }}
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/${{ env.APP_FILENAME }}
target/release/${{ env.DEMO_FILENAME }}
fail_on_unmatched_files: true

build-windows:
Expand Down Expand Up @@ -178,13 +188,16 @@ jobs:
APP_VERSION=$(cargo metadata --format-version 1 | \
jq -er '.packages | map(select(.name == "bip347-enforcer") | .version) | .[0]')
APP_FILENAME="bip347-enforcer-${APP_VERSION}-x86_64-pc-windows-gnu.exe"
DEMO_FILENAME="gen-demo-tx-${APP_VERSION}-x86_64-pc-windows-gnu.exe"
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_ENV"
echo "APP_FILENAME=$APP_FILENAME" >> "$GITHUB_ENV"
echo "DEMO_FILENAME=$DEMO_FILENAME" >> "$GITHUB_ENV"
- name: 'Set filenames for release binaries'
run: |
pushd "target/x86_64-pc-windows-gnu/release"
ln -fs "bip347-enforcer.exe" "${APP_FILENAME}"
ln -fs "gen-demo-tx.exe" "${DEMO_FILENAME}"
popd
- name: 'Upload Artifacts'
Expand All @@ -194,11 +207,13 @@ jobs:
if-no-files-found: error
path: |
target/x86_64-pc-windows-gnu/release/${{ env.APP_FILENAME }}
target/x86_64-pc-windows-gnu/release/${{ env.DEMO_FILENAME }}
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/x86_64-pc-windows-gnu/release/${{ env.APP_FILENAME }}
target/x86_64-pc-windows-gnu/release/${{ env.DEMO_FILENAME }}
fail_on_unmatched_files: true
12 changes: 10 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ cc = "1.0.101"

[dependencies]
anyhow = "1.0.86"
bitcoin = "0.32.2"
bitcoin = { version = "0.32.2", features = ["rand", "serde"] }
bitcoin_0_31 = { package = "bitcoin", version = "0.31.1" }
bitcoincore-zmq = { version = "1.5.0", features = ["async"] }
clap = { version = "4.5.7", features = ["derive"] }
futures = "0.3.30"
jsonrpsee = "0.23.2"
libc = "0.2.155"
serde_json = "1.0.120"
thiserror = "1.0.61"
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
tracing = "0.1.40"
Expand All @@ -26,4 +27,8 @@ rev = "8ce8316c6bf58b54b95c36b439402f2bb5f2a8dd"
features = ["tracing"]

[dev-dependencies]
bitcoin = { version = "0.32.2", features = ["bitcoinconsensus", "rand"] }
bitcoin = { version = "0.32.2", features = ["bitcoinconsensus"] }

[[bin]]
name = "gen-demo-tx"
path = "src/gen_tx.rs"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Install dependencies (rustup)
* Clone this repository
* Init submodules `git submodule update --init --recursive`
* Build with `cargo build`
* Build with `cargo build` or `cargo build --release`

## Configure Bitcoin node
* Must use a version of Bitcoin Core more recent than `75118a608fc22a57567743000d636bc1f969f748`.
Expand All @@ -24,4 +24,4 @@ bip347-enforcer \
--rpc-pass "pass" \
--zmq-addr-rawblock "tcp://127.0.0.1:28332" \
--log-level DEBUG
```
```
Loading

0 comments on commit 7f1b7f5

Please sign in to comment.