feat: update readme to doc online mode
This commit is contained in:
parent
10d5e4e4ef
commit
20316cf023
1 changed files with 69 additions and 12 deletions
81
README.md
81
README.md
|
@ -14,22 +14,79 @@
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### Modes:
|
||||||
|
|
||||||
|
1. Offline: Computes PoW over given CAPTCHA parameters
|
||||||
|
2. Online: CLI alternative for people using browsers without JavaScript
|
||||||
|
support
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mCaptcha PoW CLI 0.1.0
|
CLI tool to solve mCaptcha
|
||||||
Aravinth Manivannan <realaravinth@batsense.net>
|
|
||||||
Generates PoW for mCaptcha
|
|
||||||
|
|
||||||
USAGE:
|
Usage: mcaptcha-cli <COMMAND>
|
||||||
mcaptcha-cli [OPTIONS]
|
|
||||||
|
|
||||||
FLAGS:
|
Commands:
|
||||||
-h, --help Prints help information
|
offline Compute PoW with offline parameters
|
||||||
-V, --version Prints version information
|
online Compute PoW by fetching parameters from CAPTCHA URL
|
||||||
|
help Print this message or the help of the given subcommand(s)
|
||||||
|
|
||||||
OPTIONS:
|
Options:
|
||||||
-d, --difficulty <INTEGER> Difficulty factor
|
-h, --help Print help
|
||||||
-p, --phrase <STRING> Phrase over which PoW should be computed
|
-V, --version Print version
|
||||||
-s, --salt <STRING> Salt with which PoW should be computed
|
```
|
||||||
|
|
||||||
|
#### Offline
|
||||||
|
|
||||||
|
Help menu:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
Compute PoW with offline parameters
|
||||||
|
|
||||||
|
Usage: mcaptcha-cli offline --salt <SALT> --phrase <PHRASE> --difficulty-factor <DIFFICULTY_FACTOR>
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-s, --salt <SALT> Salt with which PoW should be computed
|
||||||
|
-p, --phrase <PHRASE> Phrase over which PoW should be computed
|
||||||
|
-d, --difficulty-factor <DIFFICULTY_FACTOR> Difficulty Factor
|
||||||
|
-h, --help Print help
|
||||||
|
```
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
13:28 atm@lab cli ±|online|→ mcaptcha-cli offline -s $(rand 32) -p $(rand 32) -d 50000
|
||||||
|
difficulty: 50000
|
||||||
|
nonce: 90507
|
||||||
|
original phrase: f351f333d44b2c6b5bf7f033b065bbb8fb5e9dd153bd402e43ed04425f5a3859
|
||||||
|
result: 340276562956196291522979356090220150471
|
||||||
|
```
|
||||||
|
|
||||||
|
(where rand is
|
||||||
|
[this](https://github.com/realaravinth/dotfiles/blob/6fc6c87cc912e17488a35c0d3327ecf393221270/scripts/rand#L20)
|
||||||
|
script)
|
||||||
|
|
||||||
|
#### Online
|
||||||
|
|
||||||
|
Fetches CAPTCHA parameters from CAPTCHA URL, computes PoW, validates
|
||||||
|
against given mCaptcha server and returns authorization token
|
||||||
|
|
||||||
|
Help menu:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
Compute PoW by fetching parameters from CAPTCHA URL
|
||||||
|
|
||||||
|
Usage: mcaptcha-cli online --url <URL>
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-u, --url <URL> URL of the CAPTCHA. Example: https://example.org/widget?sitekey=foo
|
||||||
|
-h, --help Print help
|
||||||
|
```
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
13:32 atm@lab cli ±|online ✗|→ mcaptcha-cli online -u https://demo.mcaptcha.org/widget?sitekey=pHy0AktWyOKuxZDzFfoaewncWecCHo23
|
||||||
|
Authorization token: 3xleN26OctBuVu3X4t6CYyUjErhaxQvz
|
||||||
```
|
```
|
||||||
|
|
||||||
## Funding
|
## Funding
|
||||||
|
|
Loading…
Add table
Reference in a new issue