Skip to content

Commit

Permalink
Add new version command (#48)
Browse files Browse the repository at this point in the history
* Add new version command

* Cleanup

* Version bump and doc
  • Loading branch information
chevdor authored Jul 4, 2022
1 parent ce5b695 commit f0ebe6d
Show file tree
Hide file tree
Showing 32 changed files with 867 additions and 761 deletions.
72 changes: 43 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ MacOS Homebrew users can use:

### Command: --help

subwasm 0.17.1
subwasm 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
`subwasm` allows fetching, parsing and calling some methods on WASM runtimes of Substrate based
chains
Expand All @@ -89,10 +89,12 @@ MacOS Homebrew users can use:
help Print this message or the help of the given subcommand(s)
info The `info` command returns summarized information about a runtime
metadata Returns the metadata as a json object. You may also use the "meta" alias
version The `version` command returns summarized information about the versions of a
runtime

### Command: get

subwasm-get 0.17.1
subwasm-get 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
Get/Download the runtime wasm from a running node through rpc

Expand Down Expand Up @@ -122,7 +124,7 @@ MacOS Homebrew users can use:

### Command: info

subwasm-info 0.17.1
subwasm-info 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
The `info` command returns summarized information about a runtime

Expand All @@ -148,9 +150,34 @@ MacOS Homebrew users can use:
By default, the ID for the Parachain pallet is expected to be `0x01` and the call ID for `authorize_upgrade` is expected to be `0x03`.
This default behavior can be overriden by setting the `PARACHAIN_PALLET_ID` to the ID of your parachain pallet and the `AUTHORIZE_UPGRADE_PREFIX` to the ID of your choice.

### Command: version

subwasm-version 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
The `version` command returns summarized information about the versions of a runtime

USAGE:
subwasm version [OPTIONS] [SOURCE]

ARGS:
<SOURCE> The wasm file to load. It can be a path on your local filesystem such as
/tmp/runtime.wasm or a node url such as http://localhost:9933 or
ws://localhost:9944 [default: runtime_000.wasm]

OPTIONS:
-b, --block <BLOCK> The optional block where to fetch the runtime. That allows fetching older
runtimes but you will need to connect to archive nodes. Currently, you
must pass a block hash. Passing the block numbers is not supported
--chain <CHAIN> Provide the name of a chain and a random url amongst a list of known
nodes will be used. If you pass a valid --chain, --url will be ignored
--chain local = http://localhost:9933
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information

### Command: meta

subwasm-metadata 0.17.1
subwasm-metadata 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
Returns the metadata as a json object. You may also use the "meta" alias

Expand Down Expand Up @@ -179,7 +206,7 @@ This default behavior can be overriden by setting the `PARACHAIN_PALLET_ID` to t

### Command: diff

subwasm-diff 0.17.1
subwasm-diff 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
Compare 2 runtimes

Expand All @@ -203,7 +230,7 @@ This default behavior can be overriden by setting the `PARACHAIN_PALLET_ID` to t

### Command: compress

subwasm-compress 0.17.1
subwasm-compress 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
Compress a given runtime wasm file. You will get an error if you try compressing a runtime that is
already compressed
Expand All @@ -222,7 +249,7 @@ This default behavior can be overriden by setting the `PARACHAIN_PALLET_ID` to t

### Command: decompress

subwasm-decompress 0.17.1
subwasm-decompress 0.18.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]
Decompress a given runtime wasm file. You may pass a runtime that is uncompressed already. In that
case, you will get the same content as output. This is useful if you want to decompress "no matter
Expand Down
5 changes: 5 additions & 0 deletions README_src.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ include::doc/usage_info.adoc[]
NOTE: By default, the ID for the Parachain pallet is expected to be `0x01` and the call ID for `authorize_upgrade` is expected to be `0x03`.
This default behavior can be overriden by setting the `PARACHAIN_PALLET_ID` to the ID of your parachain pallet and the `AUTHORIZE_UPGRADE_PREFIX` to the ID of your choice.

=== Command: version
----
include::doc/usage_version.adoc[]
----

=== Command: meta
----
include::doc/usage_meta.adoc[]
Expand Down
10 changes: 5 additions & 5 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ license = "MIT"
name = "subwasm"
readme = "README.md"
repository = "https://github.com/chevdor/subwasm"
version = "0.17.1"
version = "0.18.0"

[dependencies]
clap = {version = "3.0", features = ["derive", "env", "unicode", "cargo"]}
color-eyre = "0.6"
env_logger = "0.9"
log = "0.4"
substrate-runtime-proposal-hash = {version = "0.17.0", path = "../libs/substrate-runtime-proposal-hash", optional = true}
subwasmlib = {version = "0.17.0", path = "../lib"}
wasm-loader = {version = "0.17.0", path = "../libs/wasm-loader"}
wasm-testbed = {version = "0.17.0", path = "../libs/wasm-testbed"}
substrate-runtime-proposal-hash = {version = "0.18.0", path = "../libs/substrate-runtime-proposal-hash", optional = true}
subwasmlib = {version = "0.18.0", path = "../lib"}
wasm-loader = {version = "0.18.0", path = "../libs/wasm-loader"}
wasm-testbed = {version = "0.18.0", path = "../libs/wasm-testbed"}

[dev-dependencies]
assert_cmd = "2.0"
Expand Down
Loading

0 comments on commit f0ebe6d

Please sign in to comment.