Skip to content

Add build configuration and environment settings to book.toml for mdbook #72

Add build configuration and environment settings to book.toml for mdbook

Add build configuration and environment settings to book.toml for mdbook #72

name: Run Kari Node
on:
push:
branches: [ "main" ]
tags: "v*"
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
MNEMONIC_LENGTH: 24 # Set fixed mnemonic length
NETWORK_TYPE: devnet
RPC_PORT: 3031
NETWORK_DOMAIN: devnet.kari.network
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive' # Add this to fetch submodules
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build Release
run: cargo build --release
- name: Generate Wallet
run: |
echo "24" | cargo run --release --bin kari keytool generate
- name: Run Kari Node
timeout-minutes: 15 # Prevent infinite running
continue-on-error: true # Allow workflow to continue even if node exits
run: |
# Start Kari node with input parameters
# 1: Node type
# 3031: Port number
# devnet.kanari.network: Network address
(echo "1" && echo "3031" && echo "devnet.kanari.network") | cargo run --release --bin kari start &
# Store process ID
KARI_PID=$!
# Wait for node to initialize (30 seconds)
sleep 30
# Kill the process
kill $KARI_PID || true