Skip to content
This repository has been archived by the owner on Oct 9, 2022. It is now read-only.

Commit

Permalink
rmv mmr (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 authored May 11, 2022
1 parent e6d34b0 commit 4c59aa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 48 deletions.
51 changes: 4 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LIBRARY_TYPE=static cargo build --release
## Usage

```sh
shadow 0.7.0
darwinia-shadow 0.7.0

USAGE:
shadow <SUBCOMMAND>
Expand All @@ -35,13 +35,9 @@ FLAGS:
-V, --version Prints version information

SUBCOMMANDS:
count Current block height in mmr store
epoch Generate epoch data for ethash
export Exports shadow's rocksdb
help Prints this message or the help of the given subcommand(s)
import Imports mmr from shadow backup or geth
run Start shadow service
trim Trim mmr from target leaf
epoch Generate epoch data for ethash
help Prints this message or the help of the given subcommand(s)
run Start shadow service
```

## Download
Expand All @@ -63,51 +59,12 @@ $ cargo install darwinia-shadow

Example: `http://localhost:8545/`

- `MMR_LOG`
Optional. Define how frequently it outputs logs `Pushed mmr ... into database`
while generating MMR. Useful when you first time running shadow, since it
generates millon of MMR data at first launch. Default is `10000`.
Example: `"100000"`
## Trouble Shooting

Everytime you run `proof` in error, please delete `~/.ethashproof`
and `~/.ethash`
and retry.

## Sub commands
### import
#### rockdb
If `-u` not set, the default rocksdb dir is ~/.shadow/cache/mmr
example:
```
shadow import \
-p /data/geth/chaindata \
-u /path/to/rocksdb/dir \
-t 11357653
```
#### mysql
1. create database 'mmr_store'. Any database name can be used.
2. run sub command 'import'
example:
```
shadow import \
-p /data/geth/chaindata \
-u mysql://root:@localhost:3306/mmr_store \
-t 11357653
```
## Apis

### Get proofs
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum Opt {
/// Verbose mode
#[structopt(short, long)]
verbose: bool,
/// Run mode, all, mmr, api, epoch
/// Run mode, all, api, epoch
#[structopt(short, long, default_value = "all")]
mode: String,
},
Expand Down

0 comments on commit 4c59aa4

Please sign in to comment.