diff --git a/Cargo.toml b/Cargo.toml index 89f4796b7..c380d7e96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ members = [ "cli/polka-storage-provider/client", "cli/polka-storage-provider/common", "cli/polka-storage-provider/server", - "cli/polka-storage/storagext", - "cli/polka-storage/storagext-cli", "lib/polka-storage-proofs", "maat", + "mater/cli", + "mater/lib", "node", "pallets/faucet", "pallets/market", @@ -23,9 +23,9 @@ members = [ "primitives/commitment", "primitives/proofs", "runtime", - "storage/mater", - "storage/mater-cli", "storage/polka-index", + "storagext/cli", + "storagext/lib", ] resolver = "2" @@ -130,8 +130,7 @@ zombienet-sdk = "0.2.15" zombienet-support = "0.2.15" # Local -cli-primitives = { path = "primitives/cli" } -mater = { path = "storage/mater" } +mater = { path = "mater/lib" } pallet-faucet = { path = "pallets/faucet", default-features = false } pallet-market = { path = "pallets/market", default-features = false } pallet-proofs = { path = "pallets/proofs", default-features = false } @@ -142,7 +141,7 @@ polka-storage-provider-common = { path = "cli/polka-storage-provider/common" } polka-storage-runtime = { path = "runtime" } primitives-commitment = { path = "primitives/commitment" } primitives-proofs = { path = "primitives/proofs", default-features = false } -storagext = { path = "cli/polka-storage/storagext" } +storagext = { path = "storagext/lib" } # FileCoin proofs bellpepper-core = "0.2" diff --git a/Justfile b/Justfile index f0d3bac9a..528ae69d9 100644 --- a/Justfile +++ b/Justfile @@ -5,7 +5,7 @@ alias f := fmt # Generate the `metadata.scale` file, requires the node to be up and running at `127.0.0.1:42069` generate-scale: - subxt metadata -a --url http://127.0.0.1:42069 > cli/artifacts/metadata.scale + subxt metadata -a --url http://127.0.0.1:42069 > storagext/lib/artifacts/metadata.scale # Lint the project lint: diff --git a/api/.gitkeep b/api/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cli/polka-storage/.gitkeep b/cli/polka-storage/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cli/polka-storage/storagext-cli/README.md b/cli/polka-storage/storagext-cli/README.md deleted file mode 100644 index f108f4ccd..000000000 --- a/cli/polka-storage/storagext-cli/README.md +++ /dev/null @@ -1,307 +0,0 @@ -# storagext-cli - -CLI wrapper around `storagext`, it aims to provide an ergonomic way to execute the extrinsics made available by the Polka Storage Parachain. - -The CLI commands are namespaced according to the pallet you will be interacting with, -as such, if you want to interact with the `market` pallet, you can find it's functions under `storagext-cli market`. - -## Global Flags - -> [!NOTE] -> Commands that take in JSON objects as input, are also able to read in files with the provided content. -> -> Instead of passing the JSON object as a parameter, pass the JSON filename prefixed with an `@`. -> For example: -> ``` -> storagext-cli --sr25519-key storage-provider pre-commit @pre-commit-sector.json -> ``` - -### Keypair — `--X-key` - -Extrinsics are *required* to be signed, as such you need to pass your key. - -You can pass it as an hex encoded string, seed key (BIP-39) or use the dev phrases available -(e.g. `//Alice` — remember that these are configured as Sr25519 keypairs by default). - -Depending on the type of key you use, you should use a different flag as well: - -* `--sr25519-key` for Sr25519 keypairs -* `--ecdsa-key` for ECDSA keypairs -* `--ed25519-key` for Ed25519 keypairs - -Example: - -```bash -storagext-cli --sr25519-key "//Alice" ... -``` - -### RPC Address — `--node-rpc` - -If you so wish, you can also change the node RPC address, this is achieved through the `--node-rpc` flag. The address can be secure or not (i.e. use TLS). - -Secure if, for example, you are running the node behind a reverse proxy (like Nginx) which enables TLS for your connections: - -```bash -storagext-cli --node-rpc wss://172.16.10.10:9944 ... -``` - -Or insecure if, for example, you are running the node locally, using just the standard setup. - -```bash -storagext-cli --node-rpc ws://127.0.0.1:7331 ... -``` - -## `market` - -The `market` subcommand enables you to interact with the `market` pallet, -this is one of the entrypoints for the parachain as you need to add some balance before you can make use of the parachain features. - -### `add-balance` - -Add a given amount of [Plancks](https://wiki.polkadot.network/docs/learn-DOT#the-planck-unit) to your free balance, -this will enable you to store your files in providers or provide space to others. - -```bash -storagext-cli --sr25519-key market add-balance -``` - -### `withdraw-balance` - -The dual to `add-balance`, `withdraw-balance` allows you to reclaim back DOT from your free balance. -You cannot reclaim DOT from the locked balance, as it is necessary to pay out for faults, etc. - -```bash -storagext-cli --sr25519-key market withdraw-balance -``` - -### `publish-storage-deals` - -As a storage provider, you are able to publish storage deals you have done off-chain. -As this is an experimental CLI, you must provide Client's private key to sign a deal. -Normally, you'd just publish a signed message which you received from a client. - -```bash -storagext-cli \ - --sr25519-key \ - market publish-storage-deals \ - --client-sr25519-key \ - -``` - -The command takes `deals` as a JSON array, containing one or more storage deals. - -
-Example Storage Deals JSON -

- -```json -[ - { - "piece_cid": "bafkreibme22gw2h7y2h7tg2fhqotaqjucnbc24deqo72b6mkl2egezxhvy", - "piece_size": 47000000000, - "client": "5GvHnpY1433RytXW66r77iL4CyewAAErDU6fAouoaPKvcvLU", - "provider": "5DJiX75PZjvntUMeq7XP8qqJ3Tdg6F2Nybk9So1Z5mWArnG2", - "label": "737-800 schematics", - "start_block": 1580889600, - "end_block": 1721747575, - "storage_price_per_block": 17144352, - "provider_collateral": 3735928559, - "state": "Published" - }, - { - "piece_cid": "bafybeih5zgcgqor3dv6kfdtv3lshv3yfkfewtx73lhedgihlmvpcmywmua", - "piece_size": 269490583, - "client": "5GvHnpY1433RytXW66r77iL4CyewAAErDU6fAouoaPKvcvLU", - "provider": "5DJiX75PZjvntUMeq7XP8qqJ3Tdg6F2Nybk9So1Z5mWArnG2", - "label": "Falcon C-00000291", - "start_block": 1721410062, - "end_block": 1721747843, - "storage_price_per_block": 46349, - "provider_collateral": 3735928559, - "state": "Published" - } -] -``` - -

-
- - -### `settle-deal-payments` - -As a storage provider, you are entitled to your payment (when you are well behaved), -you can claim your payment by calling`settle-deal-payments`. The command takes a -list of IDs for the deals to be processed. - -> [!NOTE] -> The deal ID list is separated by spaces, for example: -> ``` -> settle_deal_payments 1203 1243 1254 -> ``` - -```bash -storagext-cli --sr25519-key market settle-deal-payments -``` - - -## `storage-provider` - -The `storage-provider` subcommand enables you to interact with the `storage-provider` pallet. - -### `register` - -You need to register as a `Storage Provider` to be able to deal with the clients and perform any storage provider duties. - -```bash -storagext-cli --sr25519-key storage-provider register -``` - -### `pre-commit` - -Storage Provider must pre-commit a sector with deals that have been published by `market publish-storage-deals`, so it can later be proven. -If the deals are not pre-commited in any sector and then proven, they'll be slashed. -Deals in the sector are validated, so without calling `publish-storage-deals` it's not possible to execute this function. -`seal-proof` must match the `post-proof` used in `register`. - -```bash -storagext-cli --sr25519-key storage-provider pre-commit -``` - -This command takes `pre-commit-sector` as JSON Object. - -
-Example Pre-commit Sector JSON -

- -```json -{ - "sector_number": 1, - "sealed_cid": "bafk2bzaceajreoxfdcpdvitpvxm7vkpvcimlob5ejebqgqidjkz4qoug4q6zu", - "deal_ids": [0], - "expiration": 100, - "unsealed_cid": "bafkreibme22gw2h7y2h7tg2fhqotaqjucnbc24deqo72b6mkl2egezxhvy", - "seal_proof": "StackedDRG2KiBV1P1" -} -``` - -

-
- -### `prove-commit` - -Storage Provider must prove commit a sector which has been pre-commited. -If the sector is not proven, deal won't become `Active` and will be **slashed**. - -```bash -storagext-cli --sr25519-key storage-provider prove-commit -``` - -This command takes a `prove-commit-sector` JSON object, the `proof` must be a valid hex-string. -Proof is accepted if it is any valid hex string of length >= 1. - -
-Example Prove Commit Sector JSON -

- -```json -{ - "sector_number": 1, - "proof": "1230deadbeef" -} -``` - -

-
- -### `submit-windowed-post` - -Submit a window [Proof-of-Spacetime](https://spec.filecoin.io/#section-algorithms.pos.post) -to prove the storage provider is still storing the client data. - -```bash -storagext-cli --sr25519-key storage-provider submit-windowed-post -``` - -The command takes a JSON object with four fields — `deadline` a number, `partition` a number, -`chain_commit_block` a block number and `proof` which is another JSON object with fields — -`post_proof` which can either be `2KiB` or `StackedDRGWindow2KiBV1P1` (both amounting to the same value) -and `proof_bytes` which expectes a valid hex string. - -
-Example Submit Windowed Proof-of-Spacetime JSON -

- -```json -{ - "deadline": 10, - "partitions": [10], - "chain_commit_block": 1, - "proof": { - "post_proof": "2KiB", - "proof_bytes": "07482439" - } -} -``` - -

-
- -### `declare-faults` - -Declare [faulty sectors](https://spec.filecoin.io/#section-systems.filecoin_mining.sector.lifecycle) to avoid penalties for not submitting [Window PoSt](../../../docs/glossary.md#post) at the required time. - -```bash -storagext-cli --sr25519-key storage-provider declare-faults -``` - -The command takes a list of JSON objects with the fields — `deadline` a number, `partition` a number and `sectors` an array of numbers. -The `deadline` parameter specificies the deadline where to find the respective `partition` and `sectors`. - -
-Example Declaration of Faults JSON -

- -```json -[ - { - "deadline": 0, - "partition": 0, - "sectors": [ - 0 - ] - } -] -``` - -

-
- -### `declare-faults-recovered` - -Declare [recovered faulty sectors](https://spec.filecoin.io/#section-systems.filecoin_mining.sector.lifecycle) to avoid penalties over sectors that have been recovered. Note that a sector is only considered to be "fully-healed" (i.e. not suffer any penalties) after a new proof has been submitted. - -```bash -storagext-cli --sr25519-key storage-provider declare-faults-recovered -``` - -The command takes a list of JSON objects with the fields — `deadline` a number, `partition` a number and `sectors` an array of numbers. -The `deadline` parameter specificies the deadline where to find the respective `partition` and `sectors`. - -
-Example Declaration of Recovered Faults JSON -

- -```json -[ - { - "deadline": 0, - "partition": 0, - "sectors": [ - 0 - ] - } -] -``` - -

-
diff --git a/market-protocols/.gitkeep b/market-protocols/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/storage/mater-cli/Cargo.toml b/mater/cli/Cargo.toml similarity index 100% rename from storage/mater-cli/Cargo.toml rename to mater/cli/Cargo.toml diff --git a/storage/mater-cli/README.md b/mater/cli/README.md similarity index 100% rename from storage/mater-cli/README.md rename to mater/cli/README.md diff --git a/storage/mater-cli/src/convert.rs b/mater/cli/src/convert.rs similarity index 100% rename from storage/mater-cli/src/convert.rs rename to mater/cli/src/convert.rs diff --git a/storage/mater-cli/src/error.rs b/mater/cli/src/error.rs similarity index 100% rename from storage/mater-cli/src/error.rs rename to mater/cli/src/error.rs diff --git a/storage/mater-cli/src/extract.rs b/mater/cli/src/extract.rs similarity index 93% rename from storage/mater-cli/src/extract.rs rename to mater/cli/src/extract.rs index 399e34fa3..bef6a2ff2 100644 --- a/storage/mater-cli/src/extract.rs +++ b/mater/cli/src/extract.rs @@ -50,7 +50,7 @@ mod tests { async fn extract_file_success() -> Result<()> { // Setup input and output paths let temp_dir = tempdir()?; - let input_path = PathBuf::from("../mater/tests/fixtures/car_v2/lorem.car"); + let input_path = PathBuf::from("../lib/tests/fixtures/car_v2/lorem.car"); let output_path = temp_dir.path().join("output_file"); // Call the function under test @@ -59,7 +59,7 @@ mod tests { assert!(result.is_ok()); // extract original contents - let mut original = File::open("../mater/tests/fixtures/original/lorem.txt").await?; + let mut original = File::open("../lib/tests/fixtures/original/lorem.txt").await?; let mut original_contents = vec![]; original.read_to_end(&mut original_contents).await?; @@ -82,7 +82,7 @@ mod tests { async fn extract_file_success_empty_file() -> Result<()> { // Setup input and output paths let temp_dir = tempdir()?; - let input_path = PathBuf::from("../mater/tests/fixtures/car_v2/empty.car"); + let input_path = PathBuf::from("../lib/tests/fixtures/car_v2/empty.car"); let output_path = temp_dir.path().join("output_file"); // Call the function under test @@ -127,7 +127,7 @@ mod tests { #[tokio::test] async fn io_error_extract_output_path_exists() -> Result<()> { // Setup input and output paths - let input_path = PathBuf::from("../mater/tests/fixtures/car_v2/lorem.car"); + let input_path = PathBuf::from("../lib/tests/fixtures/car_v2/lorem.car"); let output_path = PathBuf::from("output_file"); // Create a file at ouput path diff --git a/storage/mater-cli/src/main.rs b/mater/cli/src/main.rs similarity index 100% rename from storage/mater-cli/src/main.rs rename to mater/cli/src/main.rs diff --git a/storage/mater/BENCHMARK.md b/mater/lib/BENCHMARK.md similarity index 100% rename from storage/mater/BENCHMARK.md rename to mater/lib/BENCHMARK.md diff --git a/storage/mater/Cargo.toml b/mater/lib/Cargo.toml similarity index 100% rename from storage/mater/Cargo.toml rename to mater/lib/Cargo.toml diff --git a/storage/mater/README.md b/mater/lib/README.md similarity index 100% rename from storage/mater/README.md rename to mater/lib/README.md diff --git a/storage/mater/benches/benchmark.rs b/mater/lib/benches/benchmark.rs similarity index 100% rename from storage/mater/benches/benchmark.rs rename to mater/lib/benches/benchmark.rs diff --git a/storage/mater/src/async_varint.rs b/mater/lib/src/async_varint.rs similarity index 100% rename from storage/mater/src/async_varint.rs rename to mater/lib/src/async_varint.rs diff --git a/storage/mater/src/lib.rs b/mater/lib/src/lib.rs similarity index 100% rename from storage/mater/src/lib.rs rename to mater/lib/src/lib.rs diff --git a/storage/mater/src/multicodec.rs b/mater/lib/src/multicodec.rs similarity index 100% rename from storage/mater/src/multicodec.rs rename to mater/lib/src/multicodec.rs diff --git a/storage/mater/src/stores/blockstore.rs b/mater/lib/src/stores/blockstore.rs similarity index 100% rename from storage/mater/src/stores/blockstore.rs rename to mater/lib/src/stores/blockstore.rs diff --git a/storage/mater/src/stores/filestore.rs b/mater/lib/src/stores/filestore.rs similarity index 100% rename from storage/mater/src/stores/filestore.rs rename to mater/lib/src/stores/filestore.rs diff --git a/storage/mater/src/stores/mod.rs b/mater/lib/src/stores/mod.rs similarity index 100% rename from storage/mater/src/stores/mod.rs rename to mater/lib/src/stores/mod.rs diff --git a/storage/mater/src/unixfs/mod.rs b/mater/lib/src/unixfs/mod.rs similarity index 100% rename from storage/mater/src/unixfs/mod.rs rename to mater/lib/src/unixfs/mod.rs diff --git a/storage/mater/src/unixfs/unixfs.proto b/mater/lib/src/unixfs/unixfs.proto similarity index 100% rename from storage/mater/src/unixfs/unixfs.proto rename to mater/lib/src/unixfs/unixfs.proto diff --git a/storage/mater/src/unixfs/unixfs_pb.rs b/mater/lib/src/unixfs/unixfs_pb.rs similarity index 100% rename from storage/mater/src/unixfs/unixfs_pb.rs rename to mater/lib/src/unixfs/unixfs_pb.rs diff --git a/storage/mater/src/v1/mod.rs b/mater/lib/src/v1/mod.rs similarity index 100% rename from storage/mater/src/v1/mod.rs rename to mater/lib/src/v1/mod.rs diff --git a/storage/mater/src/v1/reader.rs b/mater/lib/src/v1/reader.rs similarity index 100% rename from storage/mater/src/v1/reader.rs rename to mater/lib/src/v1/reader.rs diff --git a/storage/mater/src/v1/writer.rs b/mater/lib/src/v1/writer.rs similarity index 100% rename from storage/mater/src/v1/writer.rs rename to mater/lib/src/v1/writer.rs diff --git a/storage/mater/src/v2/index.rs b/mater/lib/src/v2/index.rs similarity index 100% rename from storage/mater/src/v2/index.rs rename to mater/lib/src/v2/index.rs diff --git a/storage/mater/src/v2/mod.rs b/mater/lib/src/v2/mod.rs similarity index 100% rename from storage/mater/src/v2/mod.rs rename to mater/lib/src/v2/mod.rs diff --git a/storage/mater/src/v2/reader.rs b/mater/lib/src/v2/reader.rs similarity index 100% rename from storage/mater/src/v2/reader.rs rename to mater/lib/src/v2/reader.rs diff --git a/storage/mater/src/v2/writer.rs b/mater/lib/src/v2/writer.rs similarity index 100% rename from storage/mater/src/v2/writer.rs rename to mater/lib/src/v2/writer.rs diff --git a/storage/mater/tests/fixtures/car_v1/lorem.car b/mater/lib/tests/fixtures/car_v1/lorem.car similarity index 100% rename from storage/mater/tests/fixtures/car_v1/lorem.car rename to mater/lib/tests/fixtures/car_v1/lorem.car diff --git a/storage/mater/tests/fixtures/car_v1/lorem_header.car b/mater/lib/tests/fixtures/car_v1/lorem_header.car similarity index 100% rename from storage/mater/tests/fixtures/car_v1/lorem_header.car rename to mater/lib/tests/fixtures/car_v1/lorem_header.car diff --git a/storage/mater/tests/fixtures/car_v1/spaceglenda.car b/mater/lib/tests/fixtures/car_v1/spaceglenda.car similarity index 100% rename from storage/mater/tests/fixtures/car_v1/spaceglenda.car rename to mater/lib/tests/fixtures/car_v1/spaceglenda.car diff --git a/storage/mater/tests/fixtures/car_v2/empty.car b/mater/lib/tests/fixtures/car_v2/empty.car similarity index 100% rename from storage/mater/tests/fixtures/car_v2/empty.car rename to mater/lib/tests/fixtures/car_v2/empty.car diff --git a/storage/mater/tests/fixtures/car_v2/lorem.car b/mater/lib/tests/fixtures/car_v2/lorem.car similarity index 100% rename from storage/mater/tests/fixtures/car_v2/lorem.car rename to mater/lib/tests/fixtures/car_v2/lorem.car diff --git a/storage/mater/tests/fixtures/car_v2/spaceglenda.car b/mater/lib/tests/fixtures/car_v2/spaceglenda.car similarity index 100% rename from storage/mater/tests/fixtures/car_v2/spaceglenda.car rename to mater/lib/tests/fixtures/car_v2/spaceglenda.car diff --git a/storage/mater/tests/fixtures/original/lorem.txt b/mater/lib/tests/fixtures/original/lorem.txt similarity index 100% rename from storage/mater/tests/fixtures/original/lorem.txt rename to mater/lib/tests/fixtures/original/lorem.txt diff --git a/storage/mater/tests/fixtures/original/lorem_1024.txt b/mater/lib/tests/fixtures/original/lorem_1024.txt similarity index 100% rename from storage/mater/tests/fixtures/original/lorem_1024.txt rename to mater/lib/tests/fixtures/original/lorem_1024.txt diff --git a/storage/mater/tests/fixtures/original/lorem_4096_dup.txt b/mater/lib/tests/fixtures/original/lorem_4096_dup.txt similarity index 100% rename from storage/mater/tests/fixtures/original/lorem_4096_dup.txt rename to mater/lib/tests/fixtures/original/lorem_4096_dup.txt diff --git a/storage/mater/tests/fixtures/original/spaceglenda.jpg b/mater/lib/tests/fixtures/original/spaceglenda.jpg similarity index 100% rename from storage/mater/tests/fixtures/original/spaceglenda.jpg rename to mater/lib/tests/fixtures/original/spaceglenda.jpg diff --git a/network/.gitkeep b/network/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pallets/collator-power/.gitkeep b/pallets/collator-power/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pallets/collator-reward/.gitkeep b/pallets/collator-reward/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pallets/collator-selection/.gitkeep b/pallets/collator-selection/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pallets/payment-channel/.gitkeep b/pallets/payment-channel/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pallets/xcm-dispatcher/.gitkeep b/pallets/xcm-dispatcher/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/storage/file-storage/.gitkeep b/storage/file-storage/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/cli/polka-storage/storagext-cli/Cargo.toml b/storagext/cli/Cargo.toml similarity index 100% rename from cli/polka-storage/storagext-cli/Cargo.toml rename to storagext/cli/Cargo.toml diff --git a/storagext/cli/README.md b/storagext/cli/README.md new file mode 100644 index 000000000..311abe2b0 --- /dev/null +++ b/storagext/cli/README.md @@ -0,0 +1,3 @@ +# storagext CLI + +Docs for the storagext CLI can be found in [the book](../../docs/src/storagext-cli/index.md) diff --git a/cli/polka-storage/storagext-cli/src/cmd/faucet.rs b/storagext/cli/src/cmd/faucet.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/faucet.rs rename to storagext/cli/src/cmd/faucet.rs diff --git a/cli/polka-storage/storagext-cli/src/cmd/market.rs b/storagext/cli/src/cmd/market.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/market.rs rename to storagext/cli/src/cmd/market.rs diff --git a/cli/polka-storage/storagext-cli/src/cmd/mod.rs b/storagext/cli/src/cmd/mod.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/mod.rs rename to storagext/cli/src/cmd/mod.rs diff --git a/cli/polka-storage/storagext-cli/src/cmd/proofs.rs b/storagext/cli/src/cmd/proofs.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/proofs.rs rename to storagext/cli/src/cmd/proofs.rs diff --git a/cli/polka-storage/storagext-cli/src/cmd/randomness.rs b/storagext/cli/src/cmd/randomness.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/randomness.rs rename to storagext/cli/src/cmd/randomness.rs diff --git a/cli/polka-storage/storagext-cli/src/cmd/storage_provider.rs b/storagext/cli/src/cmd/storage_provider.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/storage_provider.rs rename to storagext/cli/src/cmd/storage_provider.rs diff --git a/cli/polka-storage/storagext-cli/src/cmd/system.rs b/storagext/cli/src/cmd/system.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/cmd/system.rs rename to storagext/cli/src/cmd/system.rs diff --git a/cli/polka-storage/storagext-cli/src/main.rs b/storagext/cli/src/main.rs similarity index 100% rename from cli/polka-storage/storagext-cli/src/main.rs rename to storagext/cli/src/main.rs diff --git a/cli/polka-storage/storagext/Cargo.toml b/storagext/lib/Cargo.toml similarity index 100% rename from cli/polka-storage/storagext/Cargo.toml rename to storagext/lib/Cargo.toml diff --git a/cli/polka-storage/storagext/README.md b/storagext/lib/README.md similarity index 99% rename from cli/polka-storage/storagext/README.md rename to storagext/lib/README.md index 77ae6f769..ed1bb5972 100644 --- a/cli/polka-storage/storagext/README.md +++ b/storagext/lib/README.md @@ -2,7 +2,6 @@ Extrinsics library for the Polka Storage Parachain. - ## Development note: `subxt` and `frame_support` don't play nice with eachother! diff --git a/cli/artifacts/metadata.scale b/storagext/lib/artifacts/metadata.scale similarity index 100% rename from cli/artifacts/metadata.scale rename to storagext/lib/artifacts/metadata.scale diff --git a/cli/polka-storage/storagext/build.rs b/storagext/lib/build.rs similarity index 72% rename from cli/polka-storage/storagext/build.rs rename to storagext/lib/build.rs index f8d3bf5c3..61c1ce1ce 100644 --- a/cli/polka-storage/storagext/build.rs +++ b/storagext/lib/build.rs @@ -1,5 +1,5 @@ fn main() { // This ensures that the library recompiles when the SCALE file suffers changes // To generate a new scale file use `just generate-scale` after running the parachain. - println!("cargo::rerun-if-changed=../../artifacts/metadata.scale") + println!("cargo::rerun-if-changed=./artifacts/metadata.scale") } diff --git a/cli/polka-storage/storagext/src/clients/faucet.rs b/storagext/lib/src/clients/faucet.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/faucet.rs rename to storagext/lib/src/clients/faucet.rs diff --git a/cli/polka-storage/storagext/src/clients/market.rs b/storagext/lib/src/clients/market.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/market.rs rename to storagext/lib/src/clients/market.rs diff --git a/cli/polka-storage/storagext/src/clients/mod.rs b/storagext/lib/src/clients/mod.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/mod.rs rename to storagext/lib/src/clients/mod.rs diff --git a/cli/polka-storage/storagext/src/clients/proofs.rs b/storagext/lib/src/clients/proofs.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/proofs.rs rename to storagext/lib/src/clients/proofs.rs diff --git a/cli/polka-storage/storagext/src/clients/randomness.rs b/storagext/lib/src/clients/randomness.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/randomness.rs rename to storagext/lib/src/clients/randomness.rs diff --git a/cli/polka-storage/storagext/src/clients/storage_provider.rs b/storagext/lib/src/clients/storage_provider.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/storage_provider.rs rename to storagext/lib/src/clients/storage_provider.rs diff --git a/cli/polka-storage/storagext/src/clients/system.rs b/storagext/lib/src/clients/system.rs similarity index 100% rename from cli/polka-storage/storagext/src/clients/system.rs rename to storagext/lib/src/clients/system.rs diff --git a/cli/polka-storage/storagext/src/deser.rs b/storagext/lib/src/deser.rs similarity index 100% rename from cli/polka-storage/storagext/src/deser.rs rename to storagext/lib/src/deser.rs diff --git a/cli/polka-storage/storagext/src/lib.rs b/storagext/lib/src/lib.rs similarity index 100% rename from cli/polka-storage/storagext/src/lib.rs rename to storagext/lib/src/lib.rs diff --git a/cli/polka-storage/storagext/src/multipair.rs b/storagext/lib/src/multipair.rs similarity index 100% rename from cli/polka-storage/storagext/src/multipair.rs rename to storagext/lib/src/multipair.rs diff --git a/cli/polka-storage/storagext/src/runtime/bounded_vec.rs b/storagext/lib/src/runtime/bounded_vec.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/bounded_vec.rs rename to storagext/lib/src/runtime/bounded_vec.rs diff --git a/cli/polka-storage/storagext/src/runtime/client.rs b/storagext/lib/src/runtime/client.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/client.rs rename to storagext/lib/src/runtime/client.rs diff --git a/cli/polka-storage/storagext/src/runtime/display/faucet.rs b/storagext/lib/src/runtime/display/faucet.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/display/faucet.rs rename to storagext/lib/src/runtime/display/faucet.rs diff --git a/cli/polka-storage/storagext/src/runtime/display/market.rs b/storagext/lib/src/runtime/display/market.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/display/market.rs rename to storagext/lib/src/runtime/display/market.rs diff --git a/cli/polka-storage/storagext/src/runtime/display/mod.rs b/storagext/lib/src/runtime/display/mod.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/display/mod.rs rename to storagext/lib/src/runtime/display/mod.rs diff --git a/cli/polka-storage/storagext/src/runtime/display/proofs.rs b/storagext/lib/src/runtime/display/proofs.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/display/proofs.rs rename to storagext/lib/src/runtime/display/proofs.rs diff --git a/cli/polka-storage/storagext/src/runtime/display/storage_provider.rs b/storagext/lib/src/runtime/display/storage_provider.rs similarity index 100% rename from cli/polka-storage/storagext/src/runtime/display/storage_provider.rs rename to storagext/lib/src/runtime/display/storage_provider.rs diff --git a/cli/polka-storage/storagext/src/runtime/mod.rs b/storagext/lib/src/runtime/mod.rs similarity index 98% rename from cli/polka-storage/storagext/src/runtime/mod.rs rename to storagext/lib/src/runtime/mod.rs index d759fc651..936791f10 100644 --- a/cli/polka-storage/storagext/src/runtime/mod.rs +++ b/storagext/lib/src/runtime/mod.rs @@ -10,7 +10,7 @@ pub mod display; // NOTE: you'll need to reload the window if the underlying SCALE file changes // https://github.com/rust-lang/rust-analyzer/issues/10719 #[subxt::subxt( - runtime_metadata_path = "../../artifacts/metadata.scale", + runtime_metadata_path = "./artifacts/metadata.scale", derive_for_all_types = "Clone, PartialEq, Eq", substitute_type( path = "sp_runtime::MultiSignature", diff --git a/cli/polka-storage/storagext/src/types/market.rs b/storagext/lib/src/types/market.rs similarity index 100% rename from cli/polka-storage/storagext/src/types/market.rs rename to storagext/lib/src/types/market.rs diff --git a/cli/polka-storage/storagext/src/types/mod.rs b/storagext/lib/src/types/mod.rs similarity index 100% rename from cli/polka-storage/storagext/src/types/mod.rs rename to storagext/lib/src/types/mod.rs diff --git a/cli/polka-storage/storagext/src/types/proofs.rs b/storagext/lib/src/types/proofs.rs similarity index 100% rename from cli/polka-storage/storagext/src/types/proofs.rs rename to storagext/lib/src/types/proofs.rs diff --git a/cli/polka-storage/storagext/src/types/storage_provider.rs b/storagext/lib/src/types/storage_provider.rs similarity index 100% rename from cli/polka-storage/storagext/src/types/storage_provider.rs rename to storagext/lib/src/types/storage_provider.rs