|
1 | 1 | # Installation
|
2 | 2 |
|
3 |
| -There are three main ways to install `medusa` at the moment. The first is using Homebrew, |
4 |
| -building from source, or installing a precompiled binary. |
| 3 | +There are six main ways to install `medusa`: |
| 4 | + |
| 5 | +1. [Using Go Install](#installing-with-go-install) |
| 6 | +2. [Using Homebrew](#installing-with-homebrew) |
| 7 | +3. [Using Nix](#installing-with-nix) |
| 8 | +4. [Using Docker](#installing-with-docker) |
| 9 | +5. [Building from source](#building-from-source) |
| 10 | +6. [Using Precompiled binaries](#precompiled-binaries) |
5 | 11 |
|
6 | 12 | If you have any difficulty with installing `medusa`, please [open an issue](https://github.com/crytic/medusa/issues) on GitHub.
|
7 | 13 |
|
| 14 | +## Installing with Go Install |
| 15 | + |
| 16 | +### Prerequisites |
| 17 | + |
| 18 | +You need to have Go installed (version 1.20 or later). Installation instructions for Go can be found [here](https://go.dev/doc/install). |
| 19 | + |
| 20 | +### Install `medusa` |
| 21 | + |
| 22 | +Run the following command to install the latest version of `medusa`: |
| 23 | + |
| 24 | +```shell |
| 25 | +go install github.com/crytic/medusa@latest |
| 26 | +``` |
| 27 | + |
| 28 | +This will download, compile, and install the `medusa` binary to your `$GOPATH/bin` directory. Make sure this directory is in your `PATH` environment variable. |
| 29 | + |
8 | 30 | ## Installing with Homebrew
|
9 | 31 |
|
10 | 32 | Note that using Homebrew is only viable (and recommended) for macOS and Linux users. For Windows users, you must
|
11 |
| -[build from source](#building-from-source) or [install a precompiled binary](#precompiled-binaries). |
| 33 | +use one of the other installation methods. |
12 | 34 |
|
13 | 35 | ### Prerequisites
|
14 | 36 |
|
15 | 37 | Installation instructions for Homebrew can be found [here](https://brew.sh/).
|
16 | 38 |
|
17 | 39 | ### Install `medusa`
|
18 | 40 |
|
19 |
| -Run the following command to install `medusa`: |
| 41 | +Run the following command to install the latest stable release of `medusa`: |
20 | 42 |
|
21 | 43 | ```shell
|
22 | 44 | brew install medusa
|
23 | 45 | ```
|
24 | 46 |
|
| 47 | +To install the latest development version: |
| 48 | + |
| 49 | +```shell |
| 50 | +brew install --HEAD medusa |
| 51 | +``` |
| 52 | + |
25 | 53 | ## Installing with Nix
|
26 | 54 |
|
27 | 55 | ### Prerequisites
|
28 | 56 |
|
29 |
| -Make sure nix is installed and that `nix-command` and `flake` features are enabled. The [Determinate Systems nix-installer](https://determinate.systems/nix-installer/) will automatically enable these features and is the recommended approach. If nix is already installed without these features enabled, run the following commands. |
| 57 | +Make sure nix is installed and that `nix-command` and `flake` features are enabled. The [Determinate Systems nix-installer](https://determinate.systems/nix-installer/) will automatically enable these features and is the recommended approach. If nix is already installed without these features enabled, run the following commands: |
30 | 58 |
|
31 |
| -``` |
| 59 | +```shell |
32 | 60 | mkdir -p ~/.config/nix
|
33 | 61 | echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
|
34 | 62 | ```
|
35 | 63 |
|
36 | 64 | ### Build `medusa`
|
37 | 65 |
|
38 |
| -`nix build` will build medusa and wire up independent copies of required dependencies. The resulting binary can be found at `./result/bin/medusa` |
| 66 | +To build medusa with nix: |
| 67 | + |
| 68 | +```shell |
| 69 | +# Clone the repository if you haven't already |
| 70 | +git clone https://github.com/crytic/medusa |
| 71 | +cd medusa |
| 72 | + |
| 73 | +# Build medusa |
| 74 | +nix build |
| 75 | +``` |
| 76 | + |
| 77 | +The resulting binary can be found at `./result/bin/medusa`. |
39 | 78 |
|
40 | 79 | ### Install `medusa`
|
41 | 80 |
|
42 | 81 | After building, you can add the build result to your PATH using nix profiles by running the following command:
|
43 | 82 |
|
44 |
| -`nix profile install ./result` |
| 83 | +```shell |
| 84 | +nix profile install ./result |
| 85 | +``` |
| 86 | + |
| 87 | +## Installing with Docker |
| 88 | + |
| 89 | +### Prerequisites |
| 90 | + |
| 91 | +You need to have Docker installed. Installation instructions for Docker can be found [here](https://docs.docker.com/get-docker/). |
| 92 | + |
| 93 | +### Using the Docker image |
| 94 | + |
| 95 | +Pull the latest Docker image: |
| 96 | + |
| 97 | +```shell |
| 98 | +docker pull crytic/medusa |
| 99 | +``` |
| 100 | + |
| 101 | +Run medusa in a container: |
| 102 | + |
| 103 | +```shell |
| 104 | +docker run -it --rm -v $(pwd):/src crytic/medusa <command> |
| 105 | +``` |
| 106 | + |
| 107 | +This will mount your current directory to `/src` in the container and run the specified medusa command. |
45 | 108 |
|
46 | 109 | ## Building from source
|
47 | 110 |
|
48 | 111 | ### Prerequisites
|
49 | 112 |
|
50 |
| -Before downloading `medusa`, you will need to download Golang and `crytic-compile`. |
| 113 | +Before building `medusa` from source, you will need: |
51 | 114 |
|
52 |
| -- Installation instructions for Golang can be found [here](https://go.dev/doc/install) |
53 |
| -- Installation instructions for `crytic-compile` can be found [here](https://github.com/crytic/crytic-compile#installation) |
54 |
| - - Note that `crytic-compile` requires a Python environment. Installation instructions for Python can be found |
55 |
| - [here](https://www.python.org/downloads/). |
| 115 | +- Go (version 1.20 or later) - [Installation instructions](https://go.dev/doc/install) |
| 116 | +- `crytic-compile` - [Installation instructions](https://github.com/crytic/crytic-compile#installation) |
| 117 | + - Note that `crytic-compile` requires a Python environment - [Python installation instructions](https://www.python.org/downloads/) |
| 118 | +- `slither` (Optional) - For improved valuegeneration we recommend also [installing Slither](https://github.com/crytic/slither?tab=readme-ov-file#how-to-install) |
56 | 119 |
|
57 | 120 | ### Build `medusa`
|
58 | 121 |
|
@@ -80,6 +143,6 @@ The precompiled binaries can be downloaded on `medusa`'s [GitHub releases page](
|
80 | 143 | > on the downloaded zip file. To remove this attribute, run the following command:
|
81 | 144 | > `sudo xattr -rd com.apple.quarantine <my_file.tar.gz>`.
|
82 | 145 |
|
83 |
| -Once installed, you will need to unzip the file and move the binary to somewhere in your `$PATH`. Please review the instructions |
| 146 | +Once downloaded, you will need to unzip the file and move the binary to somewhere in your `$PATH`. Please review the instructions |
84 | 147 | [here](https://zwbetz.com/how-to-add-a-binary-to-your-path-on-macos-linux-windows/) (if you are a Windows user, we
|
85 | 148 | recommend using the Windows GUI).
|
0 commit comments