-
Notifications
You must be signed in to change notification settings - Fork 1
Home
The Frequency Metadata Portal is a website that shows users the latest metadata for the Frequency blockchain for use with the Parity Vault mobile app. It utilizes static and video QR bar codes.
The URL for accessing the portal is:
https://metadata.frequency.xyz
The portal is intended for use by:
- Frequency developers (to validate and sign metadata)
- Council members, Sudo key holders and Frequency users (to sign transactions with the Parity Vault app)
Parity Vault mobile app (air-gapped wallet) https://signer.parity.io
Usage: metadata-cli [OPTIONS] <COMMAND>
Commands:
clean Remove unused QR codes
collect Generate json data file for frontend
sign Sign unsigned QR codes
auto-sign Update and autosign QR codes
update Check updates
verify Verify signed QR codes
check-deployment Check if deployment is up to date
help Print this message or the help of the given subcommand(s)
Options:
-c, --config <CONFIG> Path to config file [default: config.toml]
-h, --help Print help
- This subcommand can update and automatically sign the QR bar codes from either a live node or from the GitHub release assets. By default, it updates from a node.
- To update from a node:
metadata-cli auto-sign -s node
- To update from GitHub:
metadata-cli auto-sign -s github
- To update from a node:
- Iterates through each chain in
config.toml
- Fetches chain specs and metadata for each chain
- Generates a signed QR code for each chain spec
- If the metadata version is not equal to the current version
- Generates a new video QR code
- Inserts source info (type and block hash) into QR code
This compares the a freshly generated data.json
against the same file fetched from the live portal to see if it is up-to-date or needs to be redeployed.
- Generates the contents of a
data.json
and compares the generated file with the hosteddata.json
stored at the root of the homepage specified inpackage.json
; for example: https://metadata.frequency.xyz/data.json - If generated vs hosted
data.json
mismatch,exit(12)
- Obtains a list of:
- All QR image files in
public/qr
- Each metadata QR image file
- Each chainspec QR image file
- All QR image files in
- Fetches the chain specs
- Instantiates a HashSet to store files to keep
- Iterates through each chain in
config.toml
- Determines the current metadata version from the chain specs
- Determines which metadata QR files are versioned equal to or greater than the current metadata version; these files are kept in the HashSet
- Stores chainspec QR files are kept in the HashSet
- Determines the difference of all files and kept files, these are the files to be removed
- Iterates through each file to be removed and delete it
Exports specifications and metadata for multiple chains defined in config.toml
to the data.json
file used by the web UI
- Retrieves the specifications and metadata for each chain
- Collects associated QR code images from the
public/qr
folder. - Constructs an
ExportChainSpec
object for each chain. - Serializes each object in the file,
public/data.json
- Obtains a list of unsigned QR image files in
public/qr
- Iterates through the list of unsigned QR image files
- Prompts user to select an unsigned QR image file to sign
- Displays preview of the selected file to scan with Parity Vault mobile app
- On macOS, the Preview app can display the
.png
QR image file but not the.apng
QR video file for the metadata. The.apng
can be opened with a browser (e.g. Google Chrome)
- On macOS, the Preview app can display the
- Opens the computer's camera to scan the signed chain spec or metadata produced by Parity Vault mobile app
- Deposits the signed chain spec or metadata as a QR image file in
public/qr
- This subcommand can update (for later manual signing) from either a live node or from the GitHub release assets. By default, it updates from a node.
- To update from a node:
metadata-cli update -s node
- To update from GitHub:
metadata-cli update -s github
- To update from a node:
- Iterates through each chain in
config.toml
- Fetches chain specs and metadata for each chain
- Generates a QR code for each chain spec
- If the metadata version is not equal to the current version
- Generates a new video QR code
- Inserts metadata into QR code
- Obtains a list of all QR barcode image files in
public/qr
- Iterates through the files
- Returns an error and exit if the QR image file is unsigned
- Iterates through the list of all QR image files (second round)
- Determines if the QR image file is of content type metadata
- Determines if the signature of the metadata QR image file was produced by the private key holder of the public key provided in
config.toml
- Returns an error and exits if the signature doesn't match
- Determines if the signature of the metadata QR image file was produced by the private key holder of the public key provided in
- Determines if the QR image file is of content type metadata
.github/workflows/auto-sign.yml
Runs daily at 00:00:00 UTC.
This job uses a branch of the format: auto-signed-<year>-<month>-<day>
. The branch places signed metadata QR barcode image files into the its public/qr
directory.
- Determines if there is an updated runtime metadata from:
- The RPC node (current version)
- GitHub latest WASM release assets (next version)
- If metadata has been updated:
- Commits signed QR barcode image files to the branch
- Creates a draft pull request
- A maintainer of the Frequency Metadata Portal must then review the branch and merge it
- Upon merging, the Deploy Main workflow should kick off, resulting in an update push to the Frequency Metadata Portal
-
NOTE The
auto-signed-<year>-<month>-<day>
branch must be deleted on merge. If a dangling auto-sign branch exists, it will be checked out by the Auto Sign workflow and may cause confusion as auto-signing will not run againstmain
.
The purpose of check-deployment
is to keep the data.json
up to date
- Compares GitHub pages hosted https://metadata.frequency.xyz/data.json vs RPC fetched specs from the node
- If the hosted vs fetched specs differ
- Runs the collector to build a new
data.json
- Initiates the
deploy
workflow (.github/workflows/deploy/action.yml
) to redeploy the GitHub pages hosted site with the updateddata.json
- Runs the collector to build a new
.github/workflows/deploy.yml
Triggered by changes to *.yml
files or the config.toml
in the main
branch.
The purpose of deploy
is to:
- Run the
verifier
to make sure all QR image files are signed by Frequency - Run the
collector
to build a newdata.json
- Redeploy the GitHub pages site with the updated
data.json
(by use of the deploy action)
.github/workflows/cli-test.yml
Runs on pull requests targeting the main
branch with file changes in cli/**
.
The purpose of test
is to make sure that formatting, linting and tests pass.
- Runs
cargo fmt --all -- --check
- This currently fails on the stable channel of the Rust toolkit
- Runs
cargo clippy
- Runs
cargo test
- Runs
cargo check
.github/workflows/frontend-test.yml
Runs on pull requests targeting the main
branch.
The purpose of frontend-test
is to run linting and React tests
.github/workflows/verify.yml
Runs on pull requests targeting the main
branch with file changes in public/qr/**
or config.toml
.
The purpose of verify
is to ensure that all QR image files are signed by Frequency
.github/workflows/verify-skip.yml
Runs on pull requests targeting the main
branch with file changes excluding public/qr/**
or config.toml
.
The purpose of verify-skip
is to serve as a negation of the verify workflow and job
- Displays "No verification required" to signify that the file changes did NOT require re-verification