Closed zzz6519003 closed 1 month ago
it should be added the Cargo.toml of your crate.
what is the question?
Thx for reply, can’t find the url.
install fail cuz link broken, no branch name called this
1.0 was still released before we had the mono-repo in the old substrate repo.
Adding these crates with a specific branch is very old school, i will try to update that tutorial. Nowadays we have the polkadot-sdk
, docs (umbrella) crate, that bundles all other crates with compatible versions.
Is there a walk around of this? Thx!
The work-around is to either use the new versions from crates-io
, or use the polkadot-sdk-frame
crate to simplify the process.
Either way, some more up-to-date docs are here https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html. It also mentions some templates that you can use to get started.
If you still want to use this older tutorial, try:
frame-support = { version = "36.0.0", default-features = false }
frame-system = { version = "36.0.0", default-features = false }
The guide is awesome, but it’s not like a step-by-step tut.
thx for saving my day!
after I change it to
frame-support = { version = "36.0.0", default-features = false }
frame-system = { version = "36.0.0", default-features = false }
the code in tut is like
[features]
default = ["std"]
std = [
"frame-support/std",
"frame-system/std",
"codec/std",
"scale-info/std",
]
#![cfg_attr(not(feature = "std"), no_std)]
pub use pallet::*;
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);
#[pallet::config]
pub trait Config: frame_system::Config {
}
}
it get
unresolved import pallet
rustcClick for full compiler diagnostic
it can't find pallet::generate_store & pallet::pallet
We have a minimal example pallet here: https://github.com/paritytech/polkadot-sdk/blob/02e50adf7ba6cc65a9ef5c332b3e2974c8d23f48/templates/minimal/pallets/template/src/lib.rs#L14
It does use the frame
crate though, but maybe it helps. The line with the generate_store
should be removed.
sweet as Jesus, btw what is shell pallet
A "shell" like nothing inside. Just a blank pallet.
Happy that it worked 😄
as the tut, https://docs.substrate.io/tutorials/collectibles-workshop/03-create-pallet/
what should I do if I want to use