Skip to content

Commit

Permalink
add instructions for installationa and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokita-J committed Sep 17, 2024
1 parent 9c4cc35 commit adeb1e2
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,62 @@ Analyzing the smart contract supply chain.

## Prerequisites

TODO
- Python 3.7 or higher
- An Ethereum node (e.g., Geth, Parity) running and accessible via HTTP

## Installation

### 1. Clone the Repository

First, clone the repository to your local machine:

```bash
git clone https://github.com/chains-project/scsc.git
cd scsc
```

### 2. Set Up a Virtual Environment (Optional but Recommended)

It's recommended to use a virtual environment to manage dependencies:
```bash
python -m venv venv
source venv/bin/activate
```

### 3. Install Dependencies

Install the required Python packages using pip:
```bash
pip install -r requirements.txt
```


### 4. Configure the Project

Edit the config.py file to set your Ethereum node URL:
```bash
# config.py

ETHEREUM_NODE_URL = 'http://localhost:8545'
```
## Usage

### Single contract supply chain

Computes the supply chain of a smart-contract at a given block (or over a block period TODO)

./scsc --block 1234 --address 0xabcdef012345678
```bash
python scsc.py [--block <block_number>] [--offset <blocks_offset>] --address <contract_address> [--calls]
```

`<block_number>`: Block number that is analyzed. When not provided, assumes the `latest` block number of Ethereum Mainnet.

`<blocks_offset>`: The number of blocks before `<block_number>` that are also analyzed. When not provided, assume the value `0`.

`--calls`: flag that outputs the call trees of each transaction that was analyzed

#### Future feature - Export to machine readable format:

./scsc --json --block 1234 --address 0xabcdef012345678 (TODO)

### Contract graph
Expand Down

0 comments on commit adeb1e2

Please sign in to comment.