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

Filter by
Sorted by
Tagged with
0 votes
1 answer
16 views

How do I register a custom extension for offchain workers?

I have the following code. #[cfg(feature = "std")] use sp_externalities::ExternalitiesExt; #[cfg(feature = "std")] sp_externalities::decl_extension! { pub struct CustomExt(u32)...
Sachin's user avatar
  • 101
-1 votes
0 answers
51 views

Charge fuel for executing host functions

Our rust code(substrate executor in this case) currently calls into wasmtime::TypedFunc::call to execute some WASM code. And the WASM code calls back (via the host function/ABI) to access storage. I ...
rusty's user avatar
  • 1,007
0 votes
0 answers
38 views

How to submit multiple extrinsics in the same block in substrate? (RpcError: 1014: Priority is too low:)

I created a simple pallet using substrate. I am able to submit extrinsic using the RPC using the substrate-front-end-template. After submitting the extrinsic, I can see the transaction status as shown ...
akhil nichenametla's user avatar
0 votes
0 answers
40 views

Decoding problems in polkadot-js after updating of substrate version

Recently I updated substrate version in our project from monthly-2022-09 to monthly-2022-12. After that in out webapp that uses polkadot-js/api I got a decoding error on attempt to query fee details ...
foo's user avatar
  • 1
-1 votes
1 answer
19 views

I am attempting the quick start tutorial and I am at this command "cargo build --release --package node-template-runtime" on this page

https://docs.substrate.io/quick-start/modify-the-runtime/ and I get this error after it completes a bunch of the build. the current crate is indistinguishable from one of its dependencies: it has the ...
user3705775's user avatar
0 votes
1 answer
75 views

"cargo check -p node-template-runtime --release" error: failed to select a version for `signature`

I'm working through how to authorize specific nodes with substrate but I get this error that I can't seem to fix so now I'm stuck. Had no problems building substrate-node-template but could there be ...
DeviousxDeveloper's user avatar
-1 votes
2 answers
76 views

Substrate: How to perform Parachain Runtime Upgrade via Democracy using Chopsticks

I am trying to perform a runtime upgrade using Acala's Chopsticks. I followed the authorize > enact an upgrade flow for my parachain, and it works. To produce blocks in local Polkadot, i connected ...
Jitterbug's user avatar
  • 302
0 votes
0 answers
36 views

rococo parachain stop generate blocks

I have encountered a problem. I recently tried to upgrade the rococo parachain. After calling the enactAuthorizedUpgrade method, it stopped generating blocks and restarting the node did not work. This ...
hqwangningbo's user avatar
0 votes
1 answer
145 views

How can I calculate a percentage of a number using Parity Ink?

So my problem is, that I am trying to calculate a percentage for a share, but ink! doesn't support floating points and I have no clue on how I can get a non-floating value that UI will denominate for ...
Onlyonweekends's user avatar
1 vote
0 answers
320 views

While creating build of open-brush psp34 contacts I am getting " Unknown opcode 192 error " [closed]

I am trying to copy contract from official openbrush contract and build it. I am getting following error ERROR: Loading of original wasm failed Caused by: 0: Loading of wasm module at '/data/ink new/...
UPENDRA SINGH's user avatar
7 votes
2 answers
1k views

Substrate node template Cannot create a runtime error=Other("cannot deserialize module: UnknownOpcode(192)")

I'm trying to follow this procedure https://docs.substrate.io/tutorials/build-a-blockchain/build-local-blockchain/#start-the-local-node to start the local node. But it always gives me the error: ➜ ...
dragonsunrise's user avatar
0 votes
0 answers
75 views

Substrate: frame_system::Config

I started investigation on substrate_node_template frame_system::config and found some types in it like 1. type RuntimeEvent = RuntimeEvent; 2. type RuntimeOrigin = RuntimeOrigin; 3. type RuntimeCall ...
Andrew Antanovich's user avatar
0 votes
0 answers
64 views

Substrate Error: Protoc can't be accessed when running cargo build --release and --locked and is necesaary to compile node completely

I'm having this Error Failed to invoke Protoc when I try to run the build command for the substrate node. Error message on console I have installed protoc from the official github repository and have ...
Joshua Okoro's user avatar
3 votes
0 answers
124 views

running substrate benchmaks errors at setjmp file not found

Working on substare node-template , When I run benchmark I get the below error. It says 'setjmp.h' file not found. I am working on Macbook pro $cargo build --release --features runtime-benchmarks ...
Neo's user avatar
  • 757
2 votes
2 answers
6k views

How to fix this error: RPC failed; curl 56 Recv failure: Connection was reset

I ran the following command, but this message has displayed. How can I fix it? E:\Workspace\Blockchain>git clone https://github.com/substrate-developer-hub/substrate-node-template Cloning into '...
Bryan Smith's user avatar
0 votes
1 answer
338 views

How do the $labels.instance get resolved in Prometheus Alets rules?

Here is a sample "rules.yml" file used to monitor a node (Substrate node on Ubuntu 22.04) using Prometheus: groups: - name: alert_rules rules: - alert: InstanceDown expr: ...
user15492347's user avatar
1 vote
0 answers
785 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 ...
Tomasz Waszczyk's user avatar
0 votes
0 answers
54 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 ...
Bonismo's user avatar
0 votes
0 answers
57 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 ...
David Salami's user avatar
0 votes
1 answer
51 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://...
Vinay Nagpal's user avatar
0 votes
1 answer
98 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 ...
Ju Piece's user avatar
  • 249
0 votes
2 answers
98 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<...
Kianoush Dortaj's user avatar
0 votes
1 answer
148 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 ...
s.Takahashi's user avatar
1 vote
0 answers
84 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&...
s.Takahashi's user avatar
0 votes
2 answers
151 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....
s.Takahashi's user avatar
0 votes
1 answer
94 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 ...
Amrith's user avatar
  • 9
0 votes
1 answer
356 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: ...
s.Takahashi's user avatar
0 votes
1 answer
56 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 ...
s.Takahashi's user avatar
0 votes
1 answer
89 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 ...
user avatar
0 votes
0 answers
94 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:...
Muhammad Zaryab Rafique's user avatar
0 votes
1 answer
286 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 \ --...
doordashcon's user avatar
0 votes
1 answer
293 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 ...
Muhammad Zaryab Rafique's user avatar
1 vote
0 answers
2k 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 `...
DuyTran's user avatar
  • 11
0 votes
1 answer
355 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:...
Thinh Phung's user avatar
2 votes
2 answers
401 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&...
ivanceras's user avatar
  • 1,415
1 vote
1 answer
116 views

ERROR: Your wasm-opt version is 91, but we require a version >= 99

The following error occurred while building the substrate smart contract:
songyu's user avatar
  • 21
1 vote
1 answer
166 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
Nathan's user avatar
  • 513
0 votes
0 answers
332 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 ...
Dutt's user avatar
  • 1
0 votes
1 answer
314 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 ...
Russo's user avatar
  • 2,354
0 votes
1 answer
143 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?
hgminerva's user avatar
  • 184
1 vote
0 answers
132 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 ...
hgminerva's user avatar
  • 184
1 vote
0 answers
557 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/...
Ayush Mishra's user avatar
-1 votes
1 answer
83 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 ...
Jin GuangHao's user avatar
0 votes
1 answer
110 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", ...
CChyuan's user avatar
  • 93
0 votes
1 answer
285 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 "...
s.Takahashi's user avatar
1 vote
0 answers
89 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.
Metallurgical's user avatar
2 votes
2 answers
778 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 ...
andresvsm's user avatar
  • 175
0 votes
1 answer
338 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 ...
Aaron O's user avatar
0 votes
1 answer
574 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 ...
not 0x12's user avatar
  • 19.6k
0 votes
0 answers
844 views

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

I run ibc-rs(https://github.com/octopus-network/ibc-rs/tree/feature/ics20), at branch feature/ics20. run this command : cargo build -p ibc. Get this below error. before this have this error, but now I ...
D.Davirain's user avatar

1
2 3 4 5
12