Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Mar 30, 2022
1 parent 772dd2f commit 568f765
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 56 deletions.
93 changes: 37 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

![Logo 1024](resources/logos/Logo_1024.png)

Unfortunately, the crate of the project and its dependencies are squatted on crates.io. The squatter remains unresponsive and the crates.io team does not care. I strongly recommend NOT to install the old version from crates.io. Check the [Install](#_install) chapter below to see how to install from this repo or use the official binary packages.

## Introduction

The metadata of a given runtime is a critical piece of information as it describes how one can interact with the runtime, what operations are possible and what are the signatures of the calls. It contains the exhaustive list of all the features publicly exposed by the runtime.
Expand Down Expand Up @@ -61,28 +63,27 @@ MacOS Homebrew users can use:

### Command: --help

subwasm 0.16.1

subwasm 0.17.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]

You can find all available commands below
`subwasm` allows fetching, parsing and calling some methods on WASM runtimes of Substrate based
chains

USAGE:
subwasm [FLAGS] <SUBCOMMAND>
subwasm [OPTIONS] <SUBCOMMAND>

FLAGS:
OPTIONS:
-h, --help Print help information
-j, --json Output as json
-q, --quiet Less output
-V, --version Print version information

SUBCOMMANDS:
compress Compress a given runtime wasm file. You will get an error if you try
compressing a runtime that is already compressed
compressing a runtime that is already compressed
decompress 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 what" and don't really
know whether the input will be compressed or not
uncompressed already. In that case, you will get the same content as output.
This is useful if you want to decompress "no matter what" and don't really
know whether the input will be compressed or not
diff Compare 2 runtimes
get Get/Download the runtime wasm from a running node through rpc
help Print this message or the help of the given subcommand(s)
Expand All @@ -91,24 +92,17 @@ MacOS Homebrew users can use:

### Command: get

subwasm-get 0.16.1

subwasm-get 0.17.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]

Get/Download the runtime wasm from a running node through rpc

USAGE:
subwasm get [FLAGS] [OPTIONS] [URL]
subwasm get [OPTIONS] [URL]

ARGS:
<URL> The node url including (mandatory) the port number. Example: ws://localhost:9944 or
http://localhost:9933 [default: http://localhost:9933]

FLAGS:
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information

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.
Expand All @@ -117,62 +111,54 @@ MacOS Homebrew users can use:
--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
-o, --output <OUTPUT> You may specifiy the output filename where the runtime will be saved.
If not provided, we will figure out an appropriate default name based
on a counter: runtime_NNN.wasm where NNN is incrementing to make sure
you do not override previous runtime. If you specify an existing file
as output, it will be overwritten
-V, --version Print version information

### Command: info

subwasm-info 0.16.1

subwasm-info 0.17.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]

The `info` command returns summarized information about a runtime

USAGE:
subwasm info [FLAGS] [OPTIONS] [SOURCE]
subwasm info [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]

FLAGS:
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information

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.16.1

subwasm-metadata 0.17.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]

Returns the metadata as a json object. You may also use the "meta" alias

USAGE:
subwasm metadata [FLAGS] [OPTIONS] [SOURCE]
subwasm metadata [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]

FLAGS:
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information

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.
Expand All @@ -181,77 +167,72 @@ MacOS Homebrew users can use:
--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
-m, --module <MODULE> Without this flag, the metadata command display the list of all
modules. Using this flag, you will only see the module of your choice
and a few details about it
-V, --version Print version information

### Command: diff

subwasm-diff 0.16.1

subwasm-diff 0.17.0
chevdor <[email protected]>:Wilfried Kopp <[email protected]

Compare 2 runtimes

USAGE:
subwasm diff [FLAGS] [OPTIONS] [ARGS]
subwasm diff [OPTIONS] [ARGS]

ARGS:
<SRC_A> The first source [default: runtime_000.wasm]
<SRC_B> The second source [default: runtime_001.wasm]

FLAGS:
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information

OPTIONS:
-a, --chain-a <CHAIN_A> 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
-b, --chain-b <CHAIN_B> 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: compress

subwasm-compress 0.16.1

subwasm-compress 0.17.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

USAGE:
subwasm compress [FLAGS] <INPUT> <OUTPUT>
subwasm compress [OPTIONS] <INPUT> <OUTPUT>

ARGS:
<INPUT> The path of uncompressed wasm file to load
<OUTPUT> The path of the file where the compressed runtime will be stored

FLAGS:
OPTIONS:
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information

### Command: decompress

subwasm-decompress 0.16.1

subwasm-decompress 0.17.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
what" and don't really know whether the input will be compressed or not

USAGE:
subwasm decompress [FLAGS] <INPUT> <OUTPUT>
subwasm decompress [OPTIONS] <INPUT> <OUTPUT>

ARGS:
<INPUT> The path of the compressed or uncompressed wasm file to load
<OUTPUT> The path of the file where the uncompressed runtime will be stored

FLAGS:
OPTIONS:
-h, --help Print help information
-j, --json Output as json
-V, --version Print version information
Expand Down
2 changes: 2 additions & 0 deletions README_src.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ image::https://github.com/chevdor/subwasm/actions/workflows/quick-check.yml/badg

image::resources/logos/Logo_1024.png[align="center", width="50%"]

WARNING: Unfortunately, the crate of the project and its dependencies are squatted on crates.io. The squatter remains unresponsive and the crates.io team does not care. I strongly recommend NOT to install the old version from crates.io. Check the <<Install>> chapter below to see how to install from this repo or use the official binary packages.

== Introduction

The metadata of a given runtime is a critical piece of information as it describes how one can interact with the runtime, what operations are possible and what are the signatures of the calls. It contains the exhaustive list of all the features publicly exposed by the runtime.
Expand Down

0 comments on commit 568f765

Please sign in to comment.