Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove chain specific macros and one metadata file for all chains #387

Merged
merged 20 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 219 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ tokio = { version = "1.21", features = ["macros", "rt-multi-thread", "sync", "si
pin-project-lite = "0.2"

# subxt
subxt = { git = "https://github.com/paritytech/subxt" }
subxt = "0.24.0"
scale-value = "0.6.0"

# substrate
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,32 @@
WARNING this library is under active development DO NOT USE IN PRODUCTION.

The library is a re-write of [polkadot staking miner](https://github.com/paritytech/polkadot/tree/master/utils/staking-miner) using [subxt](https://github.com/paritytech/subxt)
to avoid hard dependency to each runtime version.
to avoid hard dependency to each runtime version. It's using a static metadata (metadata.scale) file to generate rust types, instructions how to update metadata can be found [here](#update-metadata)

The intention is that this library will "only break" once the [pallet-election-provider-multi-phase](https://crates.parity.io/pallet_election_provider_multi_phase/index.html) breaks i.e, not on every runtime upgrade.



You can check the help with:
```
staking-miner --help
```

## Update metadata

The static metadata file is stored at [`artifacts/metadata.scale`]
To update the metadata you need to connect to a polkadot, kusama or westend node

```bash
# Install subxt-cli
$ cargo install --locked subxt-cli
# Download metadata from local node and replace the current metadata
# See `https://github.com/paritytech/subxt/tree/master/cli` for further documentation of the `subxt-cli` tool.
$ subxt metadata -f bytes > artifacts/metadata.scale
# Inspect the generated code
$ subxt codegen --file artifacts/metadata.scale | rustfmt +nightly > code.rs
```


## Building

Expand Down
Binary file removed artifacts/kusama.scale
Binary file not shown.
File renamed without changes.
Binary file removed artifacts/westend.scale
Binary file not shown.
Loading