git.delta.rocks / unique-network / refs/commits / 9debc9c2ee14

difftreelog

Update runtime types

Greg Zaitsev2021-06-18parent: #3bcc5aa.patch.diff
in: master

2 files changed

modifiedREADME.mddiffbeforeafterboth
133133
134Additional CLI usage options are available and may be shown by running `cargo run -- --help`.134Additional CLI usage options are available and may be shown by running `cargo run -- --help`.
135135
136## Building and Running as Parachain locally
137
138Rust toolchain: nightly-2021-04-23
139Note: checkout this project and polkadot project (see below) in the sibling folders (both under the same folder)
140
141### Parachain Code and Other Configurations
142
143Some changes need to be made in the parachain code depending on the relay chain it connects to
144
1451. Chain Spec (incl. chain_spec.rs)
146```
147Extensions {
148 relay_chain: "rococo".into(),
149 para_id: PARA_ID,
150}
151```
152
1532. All collators need to have at least existential balance
154
155
156
157
158### Build relay
159
160```
161git clone https://github.com/paritytech/polkadot.git
162cd polkadot
163git checkout aa386760
164cargo build --release
165```
166
167### Build parachain
168
169Run in the root of this project:
170```
171cargo --build
172```
173
174### Run 4-node Relay
175
1761. Download `rococo-custom-4.json` chain spec here: https://substrate.dev/cumulus-workshop/shared/chainspecs/rococo-custom-4.json
1772. Use these instructions to launch 4 nodes: https://substrate.dev/cumulus-workshop/#/en/2-relay-chain/1-launch
178
179Example (Run in polkadot folder. Replace `12D3KooWNLAmKcyee3oqSgTMthaQVXaAcXeo8RrGCzMfMVA3B5on` with output from Alice node):
180```
181./target/release/polkadot --alice --validator --base-path ./cumulus_relay0 --chain rococo-custom-4.json --port 50555 --ws-port 9944
182./target/release/polkadot --bob --validator --base-path ./cumulus_relay1 --chain rococo-custom-4.json --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWNLAmKcyee3oqSgTMthaQVXaAcXeo8RrGCzMfMVA3B5on --port 50556 --ws-port 9945
183./target/release/polkadot --charlie --validator --base-path ./cumulus_relay1 --chain rococo-custom-4.json --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWNLAmKcyee3oqSgTMthaQVXaAcXeo8RrGCzMfMVA3B5on --port 50557 --ws-port 9946
184./target/release/polkadot --dave --validator --base-path ./cumulus_relay1 --chain rococo-custom-4.json --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWNLAmKcyee3oqSgTMthaQVXaAcXeo8RrGCzMfMVA3B5on --port 50558 --ws-port 9947
185
186```
187
1883. Export genesis state and runtime wasm from NFT parachain:
189
190Run from this project root:
191```
192./target/release/nft export-genesis-state --parachain-id 2000 > ./resources/para-2000-genesis
193./target/release/nft export-genesis-wasm > ./resources/para-2000-wasm
194```
195
1964. Run two parachain nodes:
197
198Replace `12D3KooWN1ah2bFQSysEFnwZqcmcVpDDR8UedXyo6xfzV1zDNMNg` with Alice or Bob relay ID
199
200Run from this project root:
201```
202./target/release/nft --alice --collator --force-authoring --base-path ./tmp/parachain-alice --parachain-id 2000 --port 40333 --ws-port 9844 -- --execution wasm --chain ../polkadot/rococo-custom-4.json --port 30343 --ws-port 9977
203./target/release/nft --bob --collator --force-authoring --parachain-id 2000 --base-path ./tmp/parachain/bob --port 40334 --ws-port 9845 -- --execution wasm --chain ../polkadot/rococo-custom-4.json --port 30344 --ws-port 9978 --bootnodes /ip4/127.0.0.1/tcp/50556/p2p/12D3KooWN1ah2bFQSysEFnwZqcmcVpDDR8UedXyo6xfzV1zDNMNg
204```
205
2064. Reserve parachain ID as described here: https://substrate.dev/cumulus-workshop/#/en/2-relay-chain/2-reserve
207
2085. Register parachain in relay as described here: https://substrate.dev/cumulus-workshop/#/en/3-parachains/2-register
209
210
136## Run Integration Tests211## Run Integration Tests
modifiedruntime_types.jsondiffbeforeafterboth
--- a/runtime_types.json
+++ b/runtime_types.json
@@ -1,109 +1,103 @@
 {
-    "AccessMode": {
-      "_enum": [
-        "Normal",
-        "WhiteList"
-      ]
-    },
-    "DecimalPoints": "u8",
-    "CollectionMode": {
-      "_enum": {
-        "Invalid": null,
-        "NFT": null,
-        "Fungible": "DecimalPoints",
-        "ReFungible": null
-      }
-    },
-    "Ownership": {
-      "Owner": "AccountId",
-      "Fraction": "u128"
-    },
-    "FungibleItemType": {
-      "Value": "u128"
-    },
-    "NftItemType": {
-      "Owner": "AccountId",
-      "ConstData": "Vec<u8>",
-      "VariableData": "Vec<u8>"
-    },
-    "ReFungibleItemType": {
-      "Owner": "Vec<Ownership<AccountId>>",
-      "ConstData": "Vec<u8>",
-      "VariableData": "Vec<u8>"
-    },
-    "SponsorshipState": {
-      "_enum": {
-        "Disabled": null,
-        "Unconfirmed": "AccountId",
-        "Confirmed": "AccountId"
-      }
-    },
-    "Collection": {
-      "Owner": "AccountId",
-      "Mode": "CollectionMode",
-      "Access": "AccessMode",
-      "DecimalPoints": "DecimalPoints",
-      "Name": "Vec<u16>",
-      "Description": "Vec<u16>",
-      "TokenPrefix": "Vec<u8>",
-      "MintMode": "bool",
-      "OffchainSchema": "Vec<u8>",
-      "SchemaVersion": "SchemaVersion",
-      "Sponsorship": "SponsorshipState",
-      "Limits": "CollectionLimits",
-      "VariableOnChainSchema": "Vec<u8>",
-      "ConstOnChainSchema": "Vec<u8>"
-    },
-    "RawData": "Vec<u8>",
-    "Address": "AccountId",
-    "LookupSource": "AccountId",
-    "Weight": "u64",
-    "CreateNftData": {
-      "const_data": "Vec<u8>",
-      "variable_data": "Vec<u8>" 
-    },
-    "CreateFungibleData": {
-      "value": "u128"
-    },
-    "CreateReFungibleData": {
-      "const_data": "Vec<u8>",
-      "variable_data": "Vec<u8>",
-      "pieces": "u128"
-    },
-    "CreateItemData": {
-      "_enum": {
-        "NFT": "CreateNftData",
-        "Fungible": "CreateFungibleData",
-        "ReFungible": "CreateReFungibleData"
-      }
-    },
-    "SchemaVersion": {
-      "_enum": [
-        "ImageURL",
-        "Unique"
-      ]
-    },
-    "CollectionId": "u32",
-    "TokenId": "u32",
-    "ChainLimits": {
-      "CollectionNumbersLimit": "u32",
-      "AccountTokenOwnershipLimit": "u32",
-      "CollectionAdminsLimit": "u64",
-      "CustomDataLimit": "u32",
-      "NftSponsorTimeout": "u32",
-      "FungibleSponsorTimeout": "u32",
-      "RefungibleSponsorTimeout": "u32",
-      "OffchainSchemaLimit": "u32",
-      "VariableOnChainSchemaLimit": "u32",
-      "ConstOnChainSchemaLimit": "u32"
-    },
-    "CollectionLimits": {
-      "AccountTokenOwnershipLimit": "u32",
-      "SponsoredDataSize": "u32",
-      "SponsoredDataRateLimit": "Option<BlockNumber>",
-      "TokenLimit": "u32",
-      "SponsorTimeout": "u32",
-      "OwnerCanTransfer": "bool",
-      "OwnerCanDestroy": "bool"
+  "AccessMode": {
+    "_enum": [
+      "Normal",
+      "WhiteList"
+    ]
+  },
+  "DecimalPoints": "u8",
+  "CollectionMode": {
+    "_enum": {
+      "Invalid": null,
+      "NFT": null,
+      "Fungible": "DecimalPoints",
+      "ReFungible": null
+    }
+  },
+  "Ownership": {
+    "Owner": "AccountId",
+    "Fraction": "u128"
+  },
+  "FungibleItemType": {
+    "Value": "u128"
+  },
+  "NftItemType": {
+    "Owner": "AccountId",
+    "ConstData": "Vec<u8>",
+    "VariableData": "Vec<u8>"
+  },
+  "ReFungibleItemType": {
+    "Owner": "Vec<Ownership<AccountId>>",
+    "ConstData": "Vec<u8>",
+    "VariableData": "Vec<u8>"
+  },
+  "Collection": {
+    "Owner": "AccountId",
+    "Mode": "CollectionMode",
+    "Access": "AccessMode",
+    "DecimalPoints": "DecimalPoints",
+    "Name": "Vec<u16>",
+    "Description": "Vec<u16>",
+    "TokenPrefix": "Vec<u8>",
+    "MintMode": "bool",
+    "OffchainSchema": "Vec<u8>",
+    "SchemaVersion": "SchemaVersion",
+    "Sponsor": "AccountId",
+    "SponsorConfirmed": "bool",
+    "Limits": "CollectionLimits",
+    "VariableOnChainSchema": "Vec<u8>",
+    "ConstOnChainSchema": "Vec<u8>"
+  },
+  "RawData": "Vec<u8>",
+  "Address": "AccountId",
+  "LookupSource": "AccountId",
+  "Weight": "u64",
+  "CreateNftData": {
+    "const_data": "Vec<u8>",
+    "variable_data": "Vec<u8>" 
+  },
+  "CreateFungibleData": {
+    "value": "u128"
+  },
+  "CreateReFungibleData": {
+    "const_data": "Vec<u8>",
+    "variable_data": "Vec<u8>",
+    "pieces": "u128"
+  },
+  "CreateItemData": {
+    "_enum": {
+      "NFT": "CreateNftData",
+      "Fungible": "CreateFungibleData",
+      "ReFungible": "CreateReFungibleData"
     }
-}
\ No newline at end of file
+  },
+  "SchemaVersion": {
+    "_enum": [
+      "ImageURL",
+      "Unique"
+    ]
+  },
+  "CollectionId": "u32",
+  "TokenId": "u32",
+  "ChainLimits": {
+    "CollectionNumbersLimit": "u32",
+    "AccountTokenOwnershipLimit": "u32",
+    "CollectionAdminsLimit": "u64",
+    "CustomDataLimit": "u32",
+    "NftSponsorTimeout": "u32",
+    "FungibleSponsorTimeout": "u32",
+    "RefungibleSponsorTimeout": "u32",
+    "OffchainSchemaLimit": "u32",
+    "VariableOnChainSchemaLimit": "u32",
+    "ConstOnChainSchemaLimit": "u32"
+  },
+  "CollectionLimits": {
+    "AccountTokenOwnershipLimit": "u32",
+    "SponsoredMintSize": "u32",
+    "TokenLimit": "u32",
+    "SponsorTimeout": "u32",
+    "OwnerCanTransfer": "bool",
+    "OwnerCanDestroy": "bool"
+  },
+  "AccountInfo": "AccountInfoWithDualRefCount"
+}