Questions tagged [substrate]
Substrate is a framework for blockchain prototyping and development written in Rust. General questions about Substrate should be asked on https://substrate.stackexchange.com
594
questions
0
votes
0
answers
38
views
Failed to run custom build command for `librocksdb-sys
Does anybody know what should I install to fulfill librocksdb-sys dependency? I was trying to solve it with apt install clang but does not solve the issue. My best guess is that it is some error ...
0
votes
0
answers
22
views
Unable to open messaging channel in Substrate Tutorial
Replace chain-spec.rs
In Open Message Passing Channels guide, use the parachain-template.js parachain_id of 1000, 1001 respectively.
Add sudo pallet to runtime/lib.js.
impl pallet_sudo::Config for ...
0
votes
0
answers
13
views
A review of the validation criteria in `ed25519-dalek` when compared with `ed25519-consensus` in some edge cases?
I am working with informal systems on a tendermint light client to be used in the ibc protocol in parachains, we need use the polkadot host function for ed25519 signature verification for performance ...
0
votes
0
answers
14
views
First Substrate Chain
When i run this command according to the documentation.
**cargo build**
I recived this error.
enter image description here
I didn`t find any solution for this.
This is the tutorial link.
https://...
0
votes
1
answer
31
views
how to register a keystore extension in substrate benchmarking?
I'm writing benchmark for a pallet, in which I need to generate key pairs as input. However with --features runtime-benchmarking, I seems not able to use full-crypto and sp_core::Pair.
So the only way ...
0
votes
0
answers
8
views
Block Sync and manual import of blocks
I need to manually import some blocks into substrate, i.e. I am downloading some blocks using some external tool and want to make them pass whole verification pipeline and be included in substrate's ...
0
votes
2
answers
64
views
calculate total price in rust
I have list of struct for store basket of online store :
pub struct UserTransationHistory<T: Config> {
transactionId: <T as frame_system::Config>::Hash,
items: Vec<...
0
votes
1
answer
33
views
How to call Openbrush contract from Front-end app
I implement smart contracts with ink!, substrate's WASM smart contract implementation language.
At that time, I decided to use the openbrush library. openbrush is like openzeppelin in EVM.
The smart ...
1
vote
0
answers
39
views
"contract" can be obtained as a result of "signAndSend", but the compilation error is not resolved
I implemented the sample code according to the polkadot.js official site in the link below.
Running and testing with "yarn dev" command works as expected.
But when I run "yarn build&...
0
votes
0
answers
37
views
How to get unique smart contract errors in a frontend app using polkadot.js
I am implementing a smart contract with ink!
I have defined my own errors in the smart contract like the example below.
I don't know how to get the error information in my frontend app using polkadot....
0
votes
0
answers
48
views
Polkadot block-chain basic concepts
I am new to block chain,how to understand polka dot block chain ...,please anyone explain me with some example in real time.....
what is substrate
what is dot,why do we use it
how to relate to any use ...
0
votes
1
answer
129
views
How to deploy contract with polkadot.js
I implement a front end app with polkadot.js.
I want to deploy contract from front end app.
I implemented the code as following, but it's does not work and I got an Error.
Please help me.
code is:
...
0
votes
0
answers
42
views
Does storing Vec as a value of StorageMap work fine?
We have a storage var declared like this:
#[pallet::storage]
pub(super) type SomeMap<T: Config> = StorageMap<_, Blake2_128Concat, DataId, Vec<MyData<T>>, ValueQuery>;
and ...
0
votes
0
answers
99
views
How to get the AccountId of the contract instantiated in the contract in Substrate ink
I want to instantiate another contract inside a contract and get the AccountId of that contract.
Can anyone tell me how to do that?
Instantiate SampleContract2 in the add_contract function of ...
0
votes
1
answer
26
views
How to get the value corresponding to solidity "tx.origin" in substrate ink?
I'm implementing a contract that calls contract B from contract A.
Now alice called contract B through contract A. I would like to know that it was alice who called this contract B. Can I get it?
let ...
0
votes
0
answers
13
views
Getting conflicting implementation error while adding custom pallet
We had changed the code in pallet template and was trying to add it in substrate node-template runtime.
Link to [github code]1
Got the following error.
0
votes
0
answers
45
views
Best Decentralised Storage for parachain
Can anyone please explain what is the best decentralized storage protocol for storing agreements on Polkadot parachain?
Actually, I gone through filecoin, Crust and Cess. Now I'm little confused about ...
0
votes
1
answer
45
views
1002: Verification Error: Execution: Could not convert parameter `tx` between node and runtime: No such variant in enum MultiAddress
1002: Verification Error: Execution: Could not convert parameter `tx` between node and runtime: No such variant in enum MultiAddress: RuntimeApi, Execution: Could not convert parameter `tx` between ...
0
votes
0
answers
49
views
convert ValidatorId to AccountId in Substrate
Facing an issue in sending the fee to Validators, the validators vector provides the ValidatorID but the pallet_balance's function resolve_creating requires the AccountID
let validators = Validators::&...
0
votes
0
answers
40
views
GenesisConfig { | missing `template_module`
I Need to create a pallet in substrate and i changed genesis build in substrate in my pallet.
when i run this command it show me this error :
GenesisConfig { ^^^^^^^^^^^^^ missing template_module
I ...
0
votes
0
answers
48
views
how to get the validators vec in runtime in substrate
I'm facing an issue to get the validators in runtime, basically want to distribute the fee to validators. but giving an error at validators fetching.
pub struct DealWithFees<R>(sp_std::marker:...
0
votes
1
answer
125
views
Can't see the Local Node Identity when I start my node
For some weird reason when I start my node
./target/release/node-template \
--base-path /tmp/node01 \
--chain ./customSpecRaw.json \
--port 30333 \
--ws-port 9945 \
--rpc-port 9933 \
--...
0
votes
0
answers
60
views
Error in substrates' "use macros in a custom pallet" tutorial
I'm currently trying substrate tutorial, but it got stack. Please give me an advice.
Following the "use macros in a custom pallet" tutorial, I coded lib.rs file like this.
#![cfg_attr(not(...
0
votes
1
answer
175
views
Unable to get the RPC URL to connect MetaMask, When running multiple nodes on single machine in substrate
When running the multiple nodes on the substrate, unable to get the correct RPC URL to connect to MetaMask Wallet
ChainId: 421 at runtime
Output:
Node 1:
2022-07-27 14:32:35 〽️ Prometheus exporter ...
0
votes
0
answers
903
views
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Vec<u8>` in the current scope
I'm a newbie in Rust and Substrate. Currently, I'm building a basic chain with Substrate and I have faced with this problem. It says that:
error[E0599]: no function or associated item named `...
0
votes
1
answer
151
views
GDB set break at incorrect line number when debugging rust (gnu with wasm)
When debugging my big rust project, I face a problem that gdb set break point at incorrect line number.
When I type command to set break point at line 406
break <absolute-path-of-my-file>/lib.rs:...
1
vote
2
answers
177
views
How to query the Account Balance of Alice in a substrate node?
Using the polkadot UI, I can see the account Balances of Alice, Bob, displayed in the Accounts tab.
Using Developer> ChainState, I can query the storage on ("Balances" "TotalIssuance&...
1
vote
1
answer
74
views
ERROR: Your wasm-opt version is 91, but we require a version >= 99
The following error occurred while building the substrate smart contract:
1
vote
1
answer
86
views
Get relay chain blocknumber from parachain in substrate pallet
The title is quite self-explanatory, how can i get the blocknumber of the relay chain I'm connected to (Kusama) instead of my local blocknumber ?
All of this in a substrate/cumulus environment
0
votes
0
answers
63
views
Polkadot-JS API not reflecting changes on explorer or chain in local development
yh so I created a simple pallet with a function. I called this function from the explorer and everything worked and events were generated. But calling it from the Polkadot-JS API has not made any ...
0
votes
0
answers
120
views
Issue building rust docs in GitHub Actions workflow
Overview
I am having an issue building rust documentation with GitHub Actions for a particular repo. The repo is open-source and you can view it here and the erroring GitHub Action here. The linked ...
0
votes
1
answer
124
views
How to share a file in test files? [duplicate]
I have this hierarchy in my substrate pallet:
src/
├── lib.rs
├── mock.rs
├── tests.rs
└── common.rs
Cargo.toml
My mock.rs and tests.rs need to share some constants and types, so I put those into ...
0
votes
0
answers
15
views
no `AuthorityDiscoveryConfig` in the root, Substrate
Everyone.
How are you?
I am converting the consensus engine from poa to pos on substrate node template project.
For it, I am referencing this github, https://github.com/ltfschoen/substrate-node-...
-1
votes
1
answer
42
views
How could I configure the reward for a substrate Aura validator?
Now that the PoA is running with multiple Aura validators in my substrate-node-template. How could I configure that reward amount or value for my Aura validators?
1
vote
0
answers
23
views
How can I fix the problem which My substrate node server is been stopped after few hours automatically?
Everyone.
Please help me.
When I run my substrate node server by running this command "./target/release/node-template --dev --ws-external --rpc-external", server works well and start ...
1
vote
0
answers
83
views
Where could I find a simple sample chain spec for substrate-node-template that is fit for production?
Ok now that you've done all tutorials in Substrate and run your dev blockchain. Where could you find sa sample chain spec and genesis settings so that you can run your substrate-node-template in ...
0
votes
0
answers
111
views
Validator can't connect to private network
I am following the tutorial on running a basic 2 node private network in substrate. I used 2 virtual Ubuntu 20.04.4, both nodes writes 0 peers, but they have same block hash. I does all instructions ...
3
votes
1
answer
769
views
How to ignore generic argument for `#[derive(Debug)]`?
Here's a minimal example representing the type of problem I'm running into.
use core::fmt::Debug;
pub trait Config {
type A: Debug;
}
#[derive(Debug)]
pub struct Info<T: Config> {
pub ...
0
votes
0
answers
42
views
problem with upload ink! smart contract in local node
i create a smaple smart contract with this command cargo contract new flipper
now i need upload that in the substrate smart contract ui
I was build smart contract with this command : cargo +nightly ...
0
votes
0
answers
19
views
How do I generate an extrinsic proof that encodes the actual extrinsic for which the proof was generated
I am trying to generate an extrinsic proof that can in turn be used to generate a partial trie and then extract the actual extrinsic for which the proof was generated from the trie, but I've not been ...
1
vote
0
answers
372
views
Getting `error: could not compile `libp2p-noise` due to previous error` while compiling a Substrate project
I have been trying to compile a Substarte project but getting this weird error.
error[E0282]: type annotations needed
--> /Users/ayushkumarmishra/.cargo/registry/src/github.com-1ecc6299db9ec823/...
-1
votes
1
answer
43
views
Start Relay Chain error "substrate : command no found"
I am trying to do a substrate tutorial, "Start your relay chain".
(https://docs.substrate.io/tutorials/v3/cumulus/start-relay/)
Here, I copied the code and run it to start the alice ...
0
votes
1
answer
70
views
substrate forkless upgrade tutorial, pallet_scheduler has breaking changes
I am following https://docs.substrate.io/tutorials/v3/forkless-upgrades/ and have added
pallet-scheduler = { default-features = false, git = "https://github.com/paritytech/substrate.git", ...
0
votes
1
answer
208
views
metis example has an error [Mismatching versions of `parity-scale-codec` were found!]
I want to try compiling smart contract with "patractlabs/metis".
First of all,I downloaded example project and tried to compile.
But I got an error as following.
I downloaded from "...
0
votes
0
answers
63
views
I am having trouble sending a evm call while working with Substrate Frontier
I am just trying to follow the steps mentioned in the README.md file to send a simple call (link). I get the following error while trying to send the call using python substrate interface.
...
1
vote
0
answers
54
views
For a substrate node, how would you access the information around currently connected/known peer nodes in the network?
Looking to access the information within a substrate node around it's current and known peers from within the node itself.
Examples will be appreciated.
0
votes
0
answers
91
views
Getting Cannot sign with a locked key pair Error on Token Transfer
I create my signer wallet as follows:
const seed = bip39.mnemonicToSeedSync(WALLET_MNEMONIC, WALLET_PASSWORD);
const privateKeyBuffer = bip32
.fromSeed(seed)
.derivePath(`m/44'/434'/0'/0/0`)....
1
vote
2
answers
547
views
Error adding Custom RPCs for custom pallet Substrate
I've been working with parity's contracts node (latest version) and the substrate template node (tag polkadot-v0.9.18), both present the same issue when compiling.
I have a very simple pallet that ...
0
votes
1
answer
155
views
Substr() function within the apply() function in R
I have a data frame with 25 million rows and I need to run a substring function to all 25 million rows of data. Because of the size of the data frame I thought apply would be the most efficient way of ...
0
votes
1
answer
383
views
Substrate mock error the trait bound `Test: frame_system::pallet::Config` is not satisfied
I have created a pallet in Substrate node template and trying to create mocks
Already created the implementation for Config as follows
impl frame_system::pallet::Config for Test {
type ...