-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
233 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Welcome fellow Parachain developer 🧙♂️ | ||
|
||
Following section will guide you through implementation of the xcNFT cross-chain pallet for non-fungible assets. | ||
|
||
## Before your journey begins 🧳 | ||
|
||
Before you begin with implementing this magical ✨ pallet into your Parachain, you must ensure, that you meet following pre-requirements: | ||
|
||
### Your Parachain should implement following pallets: | ||
|
||
**Substrate:** | ||
- `frame-benchmarking` | ||
- `frame-support` | ||
- `frame-system` | ||
|
||
**Cumulus:** | ||
- `cumulus-primitives-core` | ||
- `cumulus-pallet-xcm` | ||
|
||
**XCMP:** | ||
- `xcm` | ||
|
||
**SP:** | ||
- `sp-runtime` | ||
- `sp-std` | ||
- `sp-core` | ||
- `sp-io` | ||
|
||
**Substrate Pallets:** | ||
- Either `pallet-nfts` or `pallet-uniques` depending on which pallet your Parachain uses | ||
- `pallet-balances` | ||
- `parachain-info` | ||
|
||
**Other pallets (Only needed for pallet_uniques xcnft version):** | ||
- `enumflags2` | ||
|
||
|
||
### You should also make choice of xcnft version: | ||
- If your Parachain uses **pallet_nfts** head over to [xcnft for pallet_nfts]() section. | ||
- If your Parachain uses **pallet_uniques** head over to [xcnft for pallet_uniques]() section. | ||
|
||
## Testing pallet functionality 🔎 | ||
|
||
Don't know whether this pallet is useful for your Parachain? | ||
|
||
No worries! | ||
|
||
**Try it out before you implement it!** | ||
|
||
### Follow these steps to create local testnet that implements xcNFT: | ||
|
||
1. Fork or clone [following repository](https://github.com/paraspell-research/polkadot-sdk) | ||
|
||
2. Download [Zombienet binary for your system](https://github.com/paritytech/zombienet/releases) | ||
|
||
3. Copy zombienet binary into binaries folder of the repository you just forked | ||
|
||
4. Compile Relay chain by: | ||
- `cd polkadot` | ||
- `cargo build --release` | ||
|
||
5. Compile first Parachain by: | ||
- `cargo b -r -p parachain-template-node` | ||
|
||
6. Compile second Parachain by: | ||
- `cargo b -r -p parachain-template-node-two` | ||
|
||
7. Launch zombienet localhost network by: | ||
- `cd binaries` | ||
- Choose config that you wish to test: | ||
- `./zombienet-macos-arm64 -p native -c 1 spawn config-both.toml` launches network with 1 Relay chain, 1 Parachain with *pallet_nfts* and 1 Parachain with *pallet_uniques* (Best for testing pallet agnosticity) | ||
- `./zombienet-macos-arm64 -p native -c 1 spawn config-nfts.toml` launches network with 1 Relay chain and 2 Parachains with *pallet_nfts* | ||
- `./zombienet-macos-arm64 -p native -c 1 spawn config-uniques.toml` launches network with 1 Relay chain and 2 Parachains with *pallet_uniques* | ||
|
||
8. Once the network is launched, connect to one of the Relay chain nodes: | ||
|
||
![zombienet](https://github.com/user-attachments/assets/06f1d41e-55a7-4d7b-b7f3-f3e6fa276132) | ||
|
||
9. Open HRMP channels for both chains (Needed for allowing cross-chain communication): | ||
- Navigate to `Extrinsics` tab select `Alice` account and go to `Decode` | ||
- Paste following hash to Decode section: `0xff00fa05e8030000e90300000800000000040000` (This hash opens channel from chain 1000 to 1001) | ||
- Move back to Submission and sign the call with Alice | ||
- Paste following hash to Decode section `0xff00fa05e9030000e80300000800000000040000` (This hash opens channel from chain 1001 to 1000) | ||
- Move back to Submission and sign the call with Alice | ||
|
||
10. Start interacting with chains by connecting to their WS endpoints from Zombienet console and try xcNFT out. | ||
|
||
Don't know which function does what? Unsure what storage stores what? | ||
|
||
Head over to [User guide](https://paraspell-research.github.io/xcnft-docs/user-guide/intro.html) section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Welcome to the future of cross-chain NFTs on Polkadot 🪐 | ||
|
||
Your choice to implement xcNFT into your Parachain means a lot to us! Feel free to provide feedback or suggestions in form of issue in this [GitHub repository](https://github.com/paraspell-research/xcnft-pallet)! | ||
|
||
Don't yet know what xcNFT has to offer? Head to [User guide](https://paraspell-research.github.io/xcnft-docs/user-guide/intro.html) section for overview. | ||
|
||
**Let's get you started.** | ||
|
||
## Implementing xcNFT 👨💻 | ||
Following subsection guides you through the implementation phase of xcNFT | ||
|
||
Here are the steps that you should follow: | ||
|
||
1. Copy code from the [following folder](https://github.com/paraspell-research/xcnft-pallet/tree/main/xcnft-pallet_nfts) into your Parachain's pallets folder. | ||
|
||
2. Setup dependencies in xcNFT's `cargo.toml` to latest versions and try to compile your Parachain's code. | ||
|
||
## Runtime setup ⚙️ | ||
|
||
xcNFT requires minimal runtime config: | ||
``` | ||
impl pallet_parachain_xcnft::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type WeightInfo = pallet_parachain_xcnft::weights::SubstrateWeight<Runtime>;; | ||
type XcmSender = xcm_config::XcmRouter; | ||
type RuntimeCall = RuntimeCall; | ||
type ProposalTimeInBlocks = proposal_time_in_blocks_parameter; //How long should proposals for moving collections with different owners last? 100800 for approximately 2 weeks. | ||
type MaxOwners = max_owners_parameter; //How many owners can be in the collection? Should be limited to pallet_nfts configuration. | ||
} | ||
``` | ||
|
||
**IMPORTANT!** | ||
|
||
For your chain to be compatible with xcNFT of other chains, make sure to name module in same exact way as provided below: | ||
``` | ||
#[runtime::pallet_index(INSERT_INDEX_HERE)] | ||
pub type XcnftPallet = pallet_parachain_xcnft; | ||
``` | ||
|
||
Also do not forget to add xcNFT pallet to `cargo.toml`: | ||
``` | ||
pallet-parachain-xcnft = { VERSION HERE } | ||
//Also include it into STD | ||
"pallet-parachain-xcnft/std", | ||
//Also into runtime benchmarks | ||
pallet-parachain-xcnft/runtime-benchmarks, | ||
//And try-runtime | ||
pallet-parachain-xcnft/try-runtime, | ||
``` | ||
|
||
|
||
## XCM Setup 🔬 | ||
|
||
The only tweak, that you should do to your XCM config is, to **enable aliasers**: | ||
``` | ||
type Aliasers = Everything; //Only enable to Everything in testnet enviroment! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Stand out in a world of replicas - be unique 👨🎨 | ||
|
||
Your choice to implement xcNFT into your Parachain means a lot to us! Feel free to provide feedback or suggestions in form of issue in this [GitHub repository](https://github.com/paraspell-research/xcnft-pallet)! | ||
|
||
Don't yet know what xcNFT has to offer? Head to [User guide](https://paraspell-research.github.io/xcnft-docs/user-guide/intro.html) section for overview. | ||
|
||
**Let's get you started.** | ||
|
||
## Implementing xcNFT 👨💻 | ||
Following subsection guides you through the implementation phase of xcNFT | ||
|
||
Here are the steps that you should follow: | ||
|
||
1. Copy code from the [following folder](https://github.com/paraspell-research/xcnft-pallet/tree/main/xcnft-pallet_uniques) into your Parachain's pallets folder. | ||
|
||
2. Setup dependencies in xcNFT's `cargo.toml` to latest versions and try to compile your Parachain's code. | ||
|
||
## Runtime setup ⚙️ | ||
|
||
xcNFT requires minimal runtime config: | ||
``` | ||
impl pallet_parachain_xcnft::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type WeightInfo = pallet_parachain_xcnft::weights::SubstrateWeight<Runtime>;; | ||
type XcmSender = xcm_config::XcmRouter; | ||
type RuntimeCall = RuntimeCall; | ||
type ProposalTimeInBlocks = proposal_time_in_blocks_parameter; //How long should proposals for moving collections with different owners last? 100800 for approximately 2 weeks. | ||
type MaxOwners = max_owners_parameter; //How many owners can be in the collection? Should be limited to pallet_nfts configuration. | ||
} | ||
``` | ||
|
||
**IMPORTANT!** | ||
|
||
For your chain to be compatible with xcNFT of other chains, make sure to name module in same exact way as provided below: | ||
``` | ||
#[runtime::pallet_index(INSERT_INDEX_HERE)] | ||
pub type XcnftPallet = pallet_parachain_xcnft; | ||
``` | ||
|
||
Also do not forget to add xcNFT pallet to `cargo.toml`: | ||
``` | ||
pallet-parachain-xcnft = { VERSION HERE } | ||
//Also include it into STD | ||
"pallet-parachain-xcnft/std", | ||
//Also into runtime benchmarks | ||
pallet-parachain-xcnft/runtime-benchmarks, | ||
//And try-runtime | ||
pallet-parachain-xcnft/try-runtime, | ||
``` | ||
|
||
|
||
## XCM Setup 🔬 | ||
|
||
The only tweak, that you should do to your XCM config is, to **enable aliasers**: | ||
``` | ||
type Aliasers = Everything; //Only enable to Everything in testnet enviroment! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.