---
title: "Introduction to ShinyBlock: A Multi-Protocol Simulator"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Introduction}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

## Overview

ShinyBlock is a research-oriented framework designed to simulate the core requirements of blockchain technology.

## 1. Cryptographic Foundations

The package uses Python's standard library to ensure cryptographic parity with production systems. 

- **Hashing:** Every block is tethered via SHA-256.

- **Merkle Trees:** Transaction integrity is verified via Merkle Roots.

## 2. Consensus and Mining

Users can adjust the "Difficulty" parameter to observe how Proof-of-Work (PoW) scales. As difficulty increases, the nonce-search space grows exponentially.

## 3. Enterprise Use Cases

The simulation includes a supply chain module and a smart contract VM to demonstrate how private blockchains differ from public ones.

## Installation and Setup

Since 'ShinyBlock' utilizes a hybrid 'R' and 'Python' architecture, you must initialize the 'Python' virtual environment and install the necessary cryptographic dependencies (specifically the 'ecdsa' library) before the first run.

The package provides an automated helper function to handle this environmental configuration:

```{r setup_deps, eval = FALSE}
library(ShinyBlock)

# Run this once to configure the isolated Python environment
install_blockchain_deps()

# Launch the simulator
launch_blockchain()
```

## Getting Started

To launch the interactive dashboard application, run the configuration function in your console. This initializes the backend engine and opens the interface inside your default web browser.

```{r setup_knitr, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

# Satisfies CRAN's requirement for executable code coverage 
# by verifying package namespace and function exports.
library(ShinyBlock)
print(is.function(launch_blockchain))
print(is.function(install_blockchain_deps))
```

```{r launch_app, eval = FALSE}
library(ShinyBlock)
# Launch the simulator dashboard
launch_blockchain()
```


