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
2 answers
247 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 ...
Russo's user avatar
  • 1,193
4 votes
2 answers
879 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 ...
Vjendra Gaorh's user avatar
4 votes
2 answers
642 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 don't know the exact way to specify a certain version for all ...
Monty Jack's user avatar
1 vote
0 answers
48 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 ...
CREESTL's user avatar
  • 474
0 votes
1 answer
135 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 ...
John Stephan's user avatar
4 votes
2 answers
369 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 ...
eclesiomelo's user avatar
0 votes
2 answers
63 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 ...
Antonio's user avatar
1 vote
2 answers
427 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 ...
user2556's user avatar
2 votes
1 answer
60 views

How to resolve 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`. ... ...
Naveen Devinda's user avatar
1 vote
2 answers
125 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 ...
Petar Ivanov's user avatar
1 vote
0 answers
88 views

Getting error in rust while compiling substrate node-template [closed]

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...
Amit Kumar Yadav's user avatar
1 vote
2 answers
157 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 = "...
Asmita's user avatar
  • 195
4 votes
1 answer
335 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-...
Asmita's user avatar
  • 195
1 vote
1 answer
101 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 ...
Jin GuangHao's user avatar
1 vote
1 answer
48 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 ...
Immanuel John's user avatar
1 vote
2 answers
276 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 ...
John Hilkinson's user avatar
3 votes
1 answer
80 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/...
Asmita's user avatar
  • 195
1 vote
0 answers
235 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 ...
Lucian Enache's user avatar
1 vote
1 answer
687 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.
Mrisho Lukamba's user avatar
2 votes
1 answer
142 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 ...
edmassarani's user avatar
2 votes
1 answer
122 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=...
CREESTL's user avatar
  • 474
1 vote
1 answer
240 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 ...
Balthazar Wazowski's user avatar
0 votes
2 answers
99 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: ...
Alexander Sinchenko's user avatar
6 votes
1 answer
258 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?
Yatusabes's user avatar
  • 766
0 votes
1 answer
70 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. ...
Asmita's user avatar
  • 195
7 votes
2 answers
109 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-...
shibshib's user avatar
  • 127
0 votes
1 answer
52 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-...
Vjendra Gaorh's user avatar
0 votes
2 answers
136 views

about ensure_signed

pub fn ensure_signed<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<AccountId, BadOrigin> where OuterOrigin: Into<Result<RawOrigin<AccountId>,...
coco_yoon's user avatar
  • 119
2 votes
2 answers
425 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 (...
CREESTL's user avatar
  • 474
3 votes
1 answer
100 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 ...
coco_yoon's user avatar
  • 119
-1 votes
5 answers
179 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 ...
not 0x12's user avatar
  • 343
0 votes
0 answers
51 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' ...
rarara's user avatar
  • 141
1 vote
1 answer
106 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 ...
Amiya Behera's user avatar
2 votes
1 answer
111 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 ...
Amiya Behera's user avatar
7 votes
2 answers
86 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 ...
andresvsm's user avatar
  • 1,104
9 votes
3 answers
189 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 ...
andresvsm's user avatar
  • 1,104
6 votes
1 answer
181 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/....
Rtsne42's user avatar
  • 379
7 votes
1 answer
141 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. ...
Kapil Yadav's user avatar
4 votes
2 answers
209 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 ...
Rong Nguyen's user avatar
5 votes
1 answer
118 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 ...
Kapil Yadav's user avatar
1 vote
1 answer
61 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 `...
Tejas's user avatar
  • 11
1 vote
0 answers
47 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/...
George's user avatar
  • 21
4 votes
1 answer
87 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 ...
islami00's user avatar
  • 561
5 votes
1 answer
39 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) ...
Arjun's user avatar
  • 317
1 vote
1 answer
36 views

Query on polkadot-apps chain-state cuts of string. Text-overflow?

Im trying to store a public key in a StorageValue, but when i try to consult it on polkadot-js chain-state, the string gets cut off in the following manner: KeyStart...KeyEnd The value being put in ...
Alexandre Silva's user avatar
5 votes
1 answer
369 views

How do the Staking Rewards payouts work?

I've added Staking to substrate-node-template and just explored the feature. I've managed to add validators and nominators and it looks like everything is working well. One thing I'm not able to ...
Kanishka's user avatar
  • 465
10 votes
1 answer
233 views

How to change the era period?

I believe the default era period in substrate-node-template is 24 hours. Is there a way for me to change that period?
Kanishka's user avatar
  • 465
3 votes
2 answers
41 views

How can I have some of the functions in separate file?

I want to keep some helper functions in a separate file. How can I do that? impl<T: Config> Pallet<T> { fn get_citizen_accountid(citizenid: u128) -> fn get_citizen_id(...
Amiya Behera's user avatar
7 votes
1 answer
242 views

pallet loose-coupling+tight-coupling, and missing traits

The question is about both types of pallets-coupling. let's say we have 3 pallets A,B, and C. C is tightly coupled to B (C Config is added in B Config), and we want to do a loose Coupling of A and B ...
Kazunobu Ndong's user avatar
5 votes
1 answer
70 views

Substrate dependency management

My team is looking to implement a project in Substrate, and after some studying it seems like a dependency management nightmare. Many of the 'sp' libraries call specific required functions within our ...
Greg Perrin's user avatar

1
7 8 9
10
11