Questions tagged [substrate-node-template]

Posts that reference the Substrate node template, a basic Substrate node typically used for getting started with Substrate.

Filter by
Sorted by
Tagged with
1 vote
1 answer
11 views

Can I add pallet-contracts in substrate-node-template?

Is there a way to add a pallet-contracts to substrate-node-template?
user avatar
0 votes
0 answers
5 views

Zombienet: Substrate-Parachain-Template ... How to write the Dockerfile?

This question follows those questions below: Q1 Zombienet: how to test custom parachain collator - block height(producing blocks) test Q2 Zombienet: Substrate-Parachain-Template ... block height(block ...
user avatar
  • 461
0 votes
1 answer
16 views

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types

I am using the latest substrate-node-template few weeks back it was building fine. But the same project isn't building now, I did not do any changes. Error is occurring in runtime interface. I am ...
user avatar
0 votes
2 answers
18 views

"error: failed to select a version for `parity-util-mem`"

Currently dealing with an issue building my chain where parity-util-mem is conflicting with parity-util-mem-ban duplicates and I dont know the exact way to specify a certain version for all ...
user avatar
0 votes
0 answers
22 views

pool vs pallet validation for transactions

I was wondering when should I validate a transaction within a pallet or using the signedExtension trait. For example, if I want to ensure an user can execute a specific transaction (using roles), ...
user avatar
  • 542
-1 votes
0 answers
16 views

Adding babe pallet in node-template

I am trying to add babe pallet in node-template,as there is lots of dependency of other pallets in babe pallet like staking,authority-discovery etc.. so I added all those dependencies but i am facing ...
user avatar
1 vote
0 answers
14 views

Can I Delete AURA and GRANDPA?

In this tutorial it is explained how to create a PoW node. Neither AURA nor GRANDPA are used throughout the tutorial. Also here it's stated that such node will not finalize produced blocks. The ...
user avatar
  • 134
0 votes
1 answer
28 views

How can I read JSON files in substrate

I am trying to modify the kitties pallet(https://docs.substrate.io/tutorials/v3/kitties/pt1/) in order to read some json data from an already existing file. So, I need to read the contents of the file ...
user avatar
3 votes
1 answer
97 views

Local network does not change validator set

Currently, we have a local test net with 4 substrate nodes using this runtime which has the staking and session pallets. 2 nodes (Alice and Bob) are validators, placed in the chain spec json file and ...
user avatar
0 votes
2 answers
32 views

Confused by the "Setting up tests for your pallet" doc

I'm referring to this doc: https://docs.substrate.io/how-to-guides/v3/testing/basics/ Is it just me or are the steps incomplete? For instance, it expects an add_value extrinsic to be implemented ...
user avatar
0 votes
2 answers
23 views

Not able to build librocksdb-sys library for substrate-node-template

Getting this error while building substrate-node-template, Command uses: cargo build --release error: failed to run custom build command for librocksdb-sys v0.6.1+6.28.2 MacBook Air 2017, MacOS ...
user avatar
0 votes
0 answers
15 views

How to resovle the conflict in impl-trait-for-tuple version | nicks pallet tutorial

I am following the tutorial on substrate playground, and when I run the cargo check, I get the following compilation error: error: failed to select a version for `impl-trait-for-tuples`. ... ...
user avatar
1 vote
1 answer
39 views

How can I increase contract memory in pallet-contracts + chain-extension?

I am exposing some external functions to ink! contracts via a chain-extension in pallet-contracts. I am essentially passing a vector of bytes as a parameter to a contract method and directly ...
user avatar
1 vote
0 answers
31 views

Getting error in rust while compiling substrate node-template

I am trying to add the staking pallet with other dependencies in node-template and getting this error during compiling, I will be thankful if someone help me to resolve this issue
user avatar
0 votes
0 answers
5 views

Runtime upgrade error: host doesn't provide such function: env:ext_storage_root_version_2

Our goal is to migrate code to the newer substrate version and keep the block history. My old running node substrate version is tag = 'monthly-2021-09+1' -> New substrate version is branch = "...
user avatar
  • 121
0 votes
0 answers
10 views

Error from construct_runtime!() in mock.rs

For a pallet I am trying to write unit tests, the pallet config looks like below: #[pallet::config] pub trait Config: CreateSignedTransaction<Call<Self>> + frame_system::Config {} and for ...
user avatar
3 votes
1 answer
26 views

the trait `WrapperTypeEncode` is not implemented for `ethereum_types::H256` & `ethereum_types::U256`

I am using: ethereum-type version = "0.12", codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"]} scale-...
user avatar
  • 121
0 votes
0 answers
19 views

Building my substrate pallet - Rust errors

I am a beginner at learning Rust/substrate/Polkadot. I am trying to build my custom substrate pallet My goal is, Create a custom Substrate pallet that allows only the Root origin account to control ...
user avatar
1 vote
1 answer
15 views

Error facing while mocking runtime for unit testing

Here is the error I am seeing: type mismatch resolving <sp_core::sr25519::Public as IdentifyAccount>::AccountId == u64 --> pallets/src/mock.rs:76:2 | 76 | type Public = <Signature as ...
user avatar
1 vote
2 answers
39 views

How can I purging chain database between tests of a development testnet?

I am running a few tests using Jest and Polkadot.js, and I need to reset the state before each test. Should I do that or spawn a new node each time? And if so, what's the best way to do it? I am using ...
user avatar
1 vote
0 answers
16 views

type annotations needed in libp2p-noise

On cargo build --release in my substrate project I am getting error[E0282]: type annotations needed --> /home/asmita-mfs/.cargo/registry/src/github.com-1ecc6299db9ec823/libp2p-noise-0.32.0/src/...
user avatar
  • 121
0 votes
0 answers
17 views

offchain http issue

I have integrated offchain http cal to fetch ibfo from infura as below ''' fn fetch_block(block: &str) -> Result<BlockHeader, http::Error> { // debug::native::debug!("INFURA: ...
user avatar
  • 121
0 votes
0 answers
27 views

Error when building the substrate node on mac M1: incorrect value `...` for codegen option `split-debuginfo

While following the installation tutorial available at: https://docs.substrate.io/v3/getting-started/installation/ I ended up with cloning the node-template repository and running the build command as ...
user avatar
1 vote
1 answer
12 views

Problem compiling substrate node in WSL ( windows )

Getting error: failed to run custom build command for jemalloc-sys v0.3.2 error` when compiling substrate-node-template in wsl environment.
user avatar
0 votes
0 answers
24 views

How to connect two nodes running on different computers?

I'm currently trying to deploy a private blockchain and I'm having problems trying to have nodes running on different machines but still communicating with each other. I've created a docker image ...
user avatar
1 vote
1 answer
45 views

Pallet Fails to Build Because of `std` Macros

I am currently facing this Error: Using rustc version: rustc 1.62.0-nightly (e85edd9a8 2022-04-28) Compiling frame-support v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=...
user avatar
  • 134
1 vote
1 answer
42 views

Question: Substrate vs Cosmos SDK [closed]

I need to gain some developer perspective on this if possible. Essentially I'm trying to understand the following: Are there any barriers to entry to use either of these? Or can any developer ...
user avatar
0 votes
2 answers
24 views

Substrate Pallet::Call, unpack the Pallet:Call's content

In default Substrate-Node-Template I want to make some actions inside validate_transaction function which is located in runtime/src/lib.rs: fn validate_transaction( source: ...
user avatar
0 votes
0 answers
4 views

To run subprocess from substrate-node ocw-context

I am trying to execute shell script which will check for some custom required process if it is not running then it will restart the process. For that I have below snippet code(Inside fn ...
user avatar
  • 121
4 votes
1 answer
103 views

How does Substrate detect the signing scheme when verifying signatures?

Substrate supports multiple signature schemes: ecdsa, sr2551, ed25519. When sending a signed transaction how does substrate know what scheme to use for signature verification?
user avatar
  • 207
0 votes
1 answer
24 views

How Can I send custom logs to telemetry data

I want to maintain log manager, especially for the custom logs. I tried to integrate graylog server but available supporting crate for graylog does not have support for non-std so I am facing issue. ...
user avatar
  • 121
4 votes
2 answers
46 views

How to change the number of heap pages

We are running into an allocator memory error where the number of heap pages appears to be insufficient to run a transaction on our validator (substrate-node). This is the error in question: 2022-04-...
user avatar
0 votes
1 answer
19 views

failed to select a version for the requirement `sp-core = "^4.0.0-dev"` candidate versions found which didn't match: 5.0.0

While I am trying to write code for implementing pow algorithm in Substrate I have been getting some version issue with sp-core. The error says "failed to select a version for the requirement sp-...
user avatar
0 votes
2 answers
37 views

about ensure_signed

pub fn ensure_signed<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<AccountId, BadOrigin> where OuterOrigin: Into<Result<RawOrigin<AccountId>,...
user avatar
2 votes
2 answers
67 views

How to enable `std` features in pallets?

I'm trying to implement simple PoW for my node. After debugging all other stuff I've encountered the problem where finality-grandpa and storage do not get compiled because standard library macros are (...
user avatar
  • 134
2 votes
1 answer
37 views

Event type & Call type

I am doing Substrate-tutorial and I just have a question about template-node. Inside impl 'frame_system::Config for Runtime {} code, there are type Event = Event and type Call = Call, but I don't see ...
user avatar
-1 votes
5 answers
92 views

Cannot import any pallets to the run time of node template

I have configured the staking pallet in the Substrate node template and tried to add it to the Cargo.toml in Run time Then it ended up in the following error when building This happens if I add any ...
user avatar
  • 105
0 votes
0 answers
35 views

Substrate-node-template build fail for Ubuntu 20.04 on Windows 10 [duplicate]

I was following the beginner's tutorial here: https://docs.substrate.io/tutorials/v3/create-your-first-substrate-chain/ When I get to cargo build --release I get the following error: thread 'main' ...
user avatar
  • 111
1 vote
0 answers
33 views

Custom query for storage

I want to write custom query based on this answer: impl<T: Config> Pallet<T> { pub fn hello_world() -> u128 { 10 } } But the problem is, it is not exposed in query of ...
user avatar
2 votes
1 answer
29 views

How to write a custom query for storage?

When you declare a storage say pub type Something<T> = StorageValue<_, u32>; We get query function "something". But I want to write some specific functions that reads storage ...
user avatar
7 votes
2 answers
64 views

What are the differences between using declarative and attribute macros in FRAME?

What's the main difference (besides the code) between using the decl_storage! macro rule and using the [pallet::storage] macro? I've seen pretty much everyone using macro rules, but on the latest ...
user avatar
  • 542
8 votes
3 answers
90 views

Error adding Custom RPCs for pallet

I've been trying to add some rpc calls available for my node, but an error related to the 'getrandom' module appears (even tho I'm not even using it). I have a very simple pallet that creates and ...
user avatar
  • 542
5 votes
1 answer
43 views

Building a substrate node template with a global cargo `target` directory

I'm trying to build a substrate-node-template with the following command: cargo build I have my cargo target-dir set inside a global ~/.cargo/config.toml file: [build] target-dir = "/home/foo/....
user avatar
  • 319
6 votes
1 answer
46 views

How to perform arithmetic operation on Option<BalanceOf<T>>?

Hello all developers and community members, I am very new to Substrate and Rust. I am creating a pallet for NFT marketplace. for storing out the NFT details I've created a struct as mentioned below. ...
user avatar
4 votes
2 answers
81 views

How to increase performance of building Substrate by "cargo build --release" command

I using Substrate-template-node to build pallet and my laptop have Core-i7 chip, but the time to build is range from 9-12 minutes. So, when I change code and have to wait to build and run. So, my ...
user avatar
4 votes
1 answer
44 views

How to convert substrate Specific Types(Option<BalanceOf<T>> ) to Rust Primitive types (U64)?

I don't know how can I convert Option<BalanceOf> (subtrate specific type)to u64 (rust primitive types)? I followed this article( How do you convert between Substrate specific types and Rust ...
user avatar
1 vote
1 answer
31 views

Error with substrate-api-client on local node

I am trying to run the substrate-api-client as a dependency for making RPC calls to the local substrate node. But i am getting this error: thread 'main' panicked at 'called `Result::unwrap()` on an `...
user avatar
  • 11
1 vote
0 answers
24 views

Why system pallet compiled failed caused by benchamrking part [closed]

just now, I modify the deps in cargo.toml, degrade from master to polkadot-v0.9.17 branch the compiler throw an error about this Compiling sp-consensus-aura v0.10.0-dev (https://github.com/...
user avatar
  • 21
4 votes
1 answer
46 views

How do I include a new rpc that uses a NetworkWorker in the node-template?

The node-template says its service.rs is a specialisation of that on the substrate master branch. Hence, it's sort of hard to relate the two. Nonetheless, I'd like to expose an RPC endpoint that's ...
user avatar
  • 423
4 votes
1 answer
24 views

Hot Reloading of changes in Pallet in substrate

While developing with substrate when we make changes in pallets and want to quickly test the changes have explicitly stop existing running node and build the node template (which obviously takes time) ...
user avatar
  • 237