# i2pd-launch
[](https://crates.io/crates/i2pd-launch)
[](https://unlicense.org)
[](https://blog.rust-lang.org/2022/05/19/Rust-1.61.0.html)
[](https://deps.rs/repo/gitlab/hsn10/i2pd-launch)
[](https://crates.io/crates/i2pd-launch/versions)
[](https://github.com/XAMPPRocky/tokei)
## About
*i2pd-launch* overwrites with zeros, syncs changes to disk
and then deletes current [i2pd router](https://i2pd.website)
state files containing sensitive information: routerid,
proxy local destinations, interfaces id and default log file.
After that *i2pd* is launched with a clean, pristine state.
Using the command line switch *-z* it is possible to wipe sensitive
information *without launching i2pd*. This is useful
action after you stop *i2pd*. This ensures that if your
computer falls into enemy hands it can't be linked to your
*previous* i2p router identity.
Command line switch *-w* automates that. It clears files, launches
*i2pd* and waits for *i2pd* to finish. After that files are cleared again.
### Security warning
Cleaning i2p router state before launch is *especially critical*
if you travel and change locations.
## Platforms
*i2pd-launch* works *only* on [Scoop](https://scoop.sh) based [i2pd](https://i2pd.website) installations.
Installation can be global or user. If *both* scoop global and user installations are
detected, *user i2pd* is used.
### Retry strategy
If a state file to be cleared and deleted exists but cannot be overwritten and deleted,
operation will be retried several times.
This happens due to antivirus or search indexer interference.
*i2pd-launch* will do several more attempts and then launch *i2pd* even if some state files
could not be overwritten and deleted.
This ensures that after executing *i2pd-launch* your [i2p network](https://i2p.net/) will be always running.
## Binary installation
1. Install [Scoop](https://scoop.sh) - A command-line installer for Windows.
2. `scoop install i2pd`
3. `scoop install cargo-binstall`
4. `cargo-binstall i2pd-launch`
## Compilation from source code
1. Install [Scoop](https://scoop.sh) - A command-line installer for Windows.
2. Install dependencies:
`scoop install i2pd msys2 gcc`
3. Install Rust toolchain with GNU/GCC backend:
```
scoop install rustup
rustup-init.exe --default-host x86_64-pc-windows-gnu --default-toolchain stable -y
```
4. Compile i2pd-launch and install:
`cargo install i2pd-launch`
## Command line arguments
3. -z only wipe state files, do not launch i2pd
4. -w wipe state files, launch i2pd, wait for i2pd to exit and then wipe state files again
5. -d do not spawn into background while waiting for i2pd to exit
## Return codes
- 0 Success
- 1 No scoop i2pd installation detected
- 2 i2pd executable not found
- 3 This program supported only on Windows
- 4 Not all state files were succesfully wiped and deleted
- 5 i2pd launch failed
- 6 Can not change directory to i2pd
- 7 Can not open semaphore
- 8 Can not acquire semaphore
## License
This is free and unencumbered software released into the public domain.
This code can be used under terms of [CC0](https://creativecommons.org/publicdomain/zero/1.0/) or
the [Unlicense](https://unlicense.org).
