Skip to content

Commit 967c7ab

Browse files
authored
update installation instructions and README (#604)
* update installation instructions and README * run prettier
1 parent fbf21b4 commit 967c7ab

File tree

2 files changed

+81
-23
lines changed

2 files changed

+81
-23
lines changed

Diff for: README.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,15 @@ mdbook serve
3131

3232
## Install
3333

34-
MacOS users can install the latest release of `medusa` using Homebrew:
34+
Run the following command to install the latest version of `medusa`:
3535

3636
```shell
3737

38-
brew install medusa
38+
go install github.com/crytic/medusa@latest
3939
```
4040

41-
The master branch can be installed using the following command:
42-
43-
```shell
44-
brew install --HEAD medusa
45-
```
46-
47-
For more information on building from source, using nix, or obtaining binaries for Windows and Linux, please refer to the [installation guide](./docs/src/getting_started/installation.md).
41+
For more information on building from source, using package managers, or obtaining binaries for Windows and Linux,
42+
please refer to the [installation guide](./docs/src/getting_started/installation.md).
4843

4944
## Contributing
5045

Diff for: docs/src/getting_started/installation.md

+77-14
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,121 @@
11
# Installation
22

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)
511

612
If you have any difficulty with installing `medusa`, please [open an issue](https://github.com/crytic/medusa/issues) on GitHub.
713

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+
830
## Installing with Homebrew
931

1032
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.
1234

1335
### Prerequisites
1436

1537
Installation instructions for Homebrew can be found [here](https://brew.sh/).
1638

1739
### Install `medusa`
1840

19-
Run the following command to install `medusa`:
41+
Run the following command to install the latest stable release of `medusa`:
2042

2143
```shell
2244
brew install medusa
2345
```
2446

47+
To install the latest development version:
48+
49+
```shell
50+
brew install --HEAD medusa
51+
```
52+
2553
## Installing with Nix
2654

2755
### Prerequisites
2856

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:
3058

31-
```
59+
```shell
3260
mkdir -p ~/.config/nix
3361
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
3462
```
3563

3664
### Build `medusa`
3765

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`.
3978

4079
### Install `medusa`
4180

4281
After building, you can add the build result to your PATH using nix profiles by running the following command:
4382

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.
45108

46109
## Building from source
47110

48111
### Prerequisites
49112

50-
Before downloading `medusa`, you will need to download Golang and `crytic-compile`.
113+
Before building `medusa` from source, you will need:
51114

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)
56119

57120
### Build `medusa`
58121

@@ -80,6 +143,6 @@ The precompiled binaries can be downloaded on `medusa`'s [GitHub releases page](
80143
> on the downloaded zip file. To remove this attribute, run the following command:
81144
> `sudo xattr -rd com.apple.quarantine <my_file.tar.gz>`.
82145
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
84147
[here](https://zwbetz.com/how-to-add-a-binary-to-your-path-on-macos-linux-windows/) (if you are a Windows user, we
85148
recommend using the Windows GUI).

0 commit comments

Comments
 (0)