forked from hyperledger-iroha/iroha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] hyperledger-iroha#2003: Introduce Parity Scale Decoder tool (…
…hyperledger-iroha#2080) Signed-off-by: Daniil Polyakov <[email protected]>
- Loading branch information
Showing
11 changed files
with
846 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "parity_scale_decoder" | ||
version = "2.0.0-pre-rc.3" | ||
authors = ["Iroha 2 team <https://github.com/orgs/soramitsu/teams/iroha2>"] | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
no-color = ["colored/no-color"] | ||
|
||
[dependencies] | ||
iroha_data_model = { version = "=2.0.0-pre-rc.3", path = "../../data_model", features = ["warp"]} | ||
iroha_schema = { version = "=2.0.0-pre-rc.3", path = "../../schema"} | ||
iroha_core = { version = "=2.0.0-pre-rc.3", path = "../../core", features = ["roles"] } | ||
iroha_crypto = { version = "=2.0.0-pre-rc.3", path = "../../crypto", default-features = false } | ||
iroha_version = { version = "=2.0.0-pre-rc.3", path = "../../version", default-features = false } | ||
clap = { version = "3.1.8", features = ["derive", "cargo"] } | ||
eyre = "0.6.8" | ||
parity-scale-codec = { version = "2.3.1", default-features = false } | ||
colored = "2.0.0" | ||
|
||
[dev-dependencies] | ||
iroha_schema_bin = { version = "=2.0.0-pre-rc.3", path = "../../schema/bin"} |
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,72 @@ | ||
# Parity Scale Decoder Tool | ||
|
||
## Description | ||
|
||
This tool will help you to decode **Iroha 2** types from binaries using [Parity Scale Codec](https://github.com/paritytech/parity-scale-codec) | ||
|
||
## Usage | ||
|
||
Building: | ||
|
||
```bash | ||
cargo build --bin parity_scale_decoder | ||
``` | ||
|
||
If your terminal does not support colors: | ||
|
||
```bash | ||
cargo build --features no-color --bin parity_scale_decoder | ||
``` | ||
|
||
From the main project directory: | ||
|
||
* List all supported types: | ||
|
||
```bash | ||
./target/debug/parity_scale_decoder list-type | ||
``` | ||
|
||
* Decode type from binary: | ||
|
||
```bash | ||
./target/debug/parity_scale_decoder decode <path_to_binary> --type <type> | ||
``` | ||
|
||
As an example you can use provided samples: | ||
|
||
```bash | ||
./target/debug/parity_scale_decoder decode tools/parity_scale_decoder/samples/account.bin --type Account | ||
``` | ||
|
||
* Decode any type from binary: | ||
|
||
If you are not sure about type you can simply omit `--type` option: | ||
|
||
```bash | ||
./target/debug/parity_scale_decoder decode <path_to_binary> | ||
``` | ||
|
||
* To see all available options run: | ||
|
||
```bash | ||
./target/debug/parity_scale_decoder --help | ||
``` | ||
|
||
## Contributing | ||
|
||
Check out [this document](https://github.com/hyperledger/iroha/blob/iroha2-dev/CONTRIBUTING.md) | ||
|
||
## [Need help?](https://github.com/hyperledger/iroha/blob/iroha2-dev/CONTRIBUTING.md#contact) | ||
|
||
## License | ||
|
||
Iroha codebase is licensed under the Apache License, | ||
Version 2.0 (the "License"); you may not use this file except | ||
in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.