-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bitcoin] UTXO genesis import tool (#1632)
* implements utxo genesis import cli * fixup child object store as parent object field * finish statedb genesis-utxo tool * remove unused code
- Loading branch information
Showing
23 changed files
with
965 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ pub mod rpc; | |
pub mod server; | ||
pub mod session_key; | ||
pub mod state; | ||
pub mod statedb; | ||
pub mod transaction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## Rooch Statedb tool | ||
|
||
A tool to export and import rooch statedb. | ||
|
||
### Usage | ||
|
||
1. rooch statedb genesis-utxo | ||
```shell | ||
rooch statedb genesis-utxo --input ~/utxo.txt -d ~/.rooch -n local | ||
``` | ||
|
||
Step 1, cleanup database files | ||
```shell | ||
rooch server clean -n local | ||
``` | ||
|
||
Step 2, start server to initialization genesis | ||
```shell | ||
rooch server start -n local | ||
``` | ||
|
||
Step 3, stop server | ||
```shell | ||
kill {server pid} or Ctrl-C | ||
``` | ||
|
||
Step 4 run statedb genesis-utxo command | ||
```shell | ||
rooch statedb genesis-utxo --input {utxo.file} -d {rooch.database.file} -n {rooch.network} | ||
``` | ||
|
||
2. rooch statedb export | ||
```shell | ||
todo! | ||
``` | ||
|
||
3. rooch statedb import | ||
```shell | ||
todo! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) RoochNetwork | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::cli_types::WalletContextOptions; | ||
use clap::Parser; | ||
use rooch_types::error::RoochResult; | ||
use std::path::PathBuf; | ||
|
||
/// Export statedb | ||
#[derive(Debug, Parser)] | ||
pub struct ExportCommand { | ||
#[clap(long, short = 'o')] | ||
/// export output file. like ~/.rooch/local/utxo.csv or utxo.csv | ||
pub output: PathBuf, | ||
|
||
#[clap(flatten)] | ||
pub context_options: WalletContextOptions, | ||
} | ||
|
||
impl ExportCommand { | ||
pub async fn execute(self) -> RoochResult<()> { | ||
let mut _context = self.context_options.build()?; | ||
|
||
todo!() | ||
} | ||
} |
Oops, something went wrong.