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

feat: testable book-of-bdk #1

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
- package-ecosystem: "cargo"
directory: "/tests" # point this towards a Cargo.toml directory
schedule:
# Check for updates to Rust dependencies every week
interval: "weekly"
25 changes: 25 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Markdown Links Check
# runs every monday at 9 am
on:
schedule:
- cron: "0 9 * * 1"
workflow_dispatch: null

jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
# checks all markdown files from /book including all subfolders
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
folder-path: 'book/'
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
# checks all markdown files from root but ignores subfolders
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
max-depth: 0
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests
on:
push:
branches: [ master, '[0-9]+.[0-9]+.[0-9]+', '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' ]
pull_request:
branches: [ master, '[0-9]+.[0-9]+.[0-9]+', '[0-9]+.[0-9]+.[0-9]+-[A-Za-z0-9]+' ]
# runs every monday at 9 am
schedule:
- cron: "0 9 * * 1"
workflow_dispatch: null

jobs:
code-samples:
name: Test code samples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Generate harness
working-directory: ./tests
run: ./generate.sh
- name: Test code samples
working-directory: ./tests
run: cargo test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
node_modules/
cache/
dist/

# test stuff
tests/Cargo.lock
tests/target
tests/src
tests/config.txt
11 changes: 11 additions & 0 deletions book/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# Getting Started

### Install Rust

See the Rust ["Getting Started"] page to install the Rust development tools.

### Using BDK in a Rust project

Follow these steps to use BDK in your own rust project with the async `esplora` blockchain client.

:::tip
For now use the latest `master` branch versions of BDK crates.
As an example, for BDK:

```shell
cargo add bdk --git "https://github.com/notmandatory/bdk.git"
```
:::

1. Create a new Rust project:

```shell
cargo init my_bdk_app
cd my_bdk_app
```

2. Add `bdk` to your `Cargo.toml` file. Find the latest `bdk@1` release on [`crates.io`](https://crates.io/crates/bdk/versions), for example:

```shell
cargo add [email protected]
```

3. Add other required dependencies:

```shell
cargo add [email protected]
cargo add [email protected]
Expand Down
Loading
Loading