Use this tag for questions about the Polkadot blockchain network platform. General questions about Polkadot should be asked at https://substrate.stackexchange.com
Questions tagged [polkadot]
203 questions
43
votes
5 answers
Unable to specify `edition2021` in order to use unstable packages in Rust
I want to run an example via Cargo but I am facing an error:
error: failed to parse manifest at `/Users/aviralsrivastava/dev/subxt/Cargo.toml`
The full stacktrace is:
error: failed to parse manifest at…

Aviral Srivastava
- 4,058
- 8
- 29
- 81
7
votes
2 answers
Error encountered could not complete yarn install of substrate front end template
Followed the installation steps provided here
https://docs.substrate.io/tutorials/v3/create-your-first-substrate-chain/
Steps taken with node version v16.14.0
git clone https://github.com/substrate-developer-hub/substrate-front-end-template
yarn…

John
- 401
- 3
- 8
5
votes
1 answer
The relation between using `std` and `no_std` attributes and including WASM
I've just started to study substrate, and the Add a Pallet tutorial already has me seriously confused:
It is important to note that the Substrate runtime compiles to both a native Rust std binary and a WebAssembly (Wasm) binary. For more…

mkl
- 635
- 1
- 6
- 16
5
votes
1 answer
How do I update my token's name in Substrate?
I have set up a custom Substrate chain, and I want to modify the display name of my token.
What do I need to modify such that Polkadot JS and other APIs can discover my token name?
By default it is "Unit".

Shawn Tabrizi
- 12,206
- 1
- 38
- 69
5
votes
1 answer
How to encode the hex string representation of an account id in Substrate using Rust?
Given a hex representation: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d, we can get the AccountId it represents using keyring.encodeAddress() using JavaScript. However, what is the corresponding function in Rust?
AccountId is…

Aviral Srivastava
- 4,058
- 8
- 29
- 81
4
votes
1 answer
Why does "code" in spec not start with magic number and version number?
I am creating spec using ./polkadot build-spec --disable-default-bootnode --dev (I am running version 0.9.8-3a10ee63c-x86_64-linux-gnu)
spec generated using above command contains code field. My understanding is that this field contains wasm bytes.…

kishan sagathiya
- 43
- 4
4
votes
0 answers
How can I subscribe to a single event using Polkadot.js API?
I want to subscribe to a single event (or a list of events) using the Polkadot.js API. However, I have only found information on how to traverse events and then filter the results. In addition, the documentation about events lists all the events…

Daniel Bastos
- 59
- 4
4
votes
1 answer
How do you write a system test for your runtime?
Hi I am developing a runtime using Substrate-FRAME and I would like to know how can I write a system test for my runtime?
The main purpose of writing a system test is to ensure that the final build is fulfilling all of the required specifications…

Jdawg287
- 117
- 5
4
votes
0 answers
Public key / Private key encryption using polkadot lib?
I'm building a substrate blockchain backed by polkadot js. While working on a task I have a requirement of public/private key encryption and decryption. for ex: Bob wants to send Alice an encrypted email. To do this, Bob takes Alice's public key and…

sachin murali
- 469
- 2
- 7
- 22
4
votes
1 answer
How to find all the polkadot accounts with index or identity attached
I want to find all the polkadot accounts which either have an index or have registered their identity; similar to https://polkascan.io/polkadot/account/identities and https://polkascan.io/polkadot/indices/account.

Suryansh Singh
- 67
- 5
4
votes
2 answers
Use custom types (Substrate FRAME pallet + Polkadot/Substrate frontend)
Scenario: You are developing a FRAME pallet for a custom Substrate node that uses custom types within Storage or Events. To interact with your custom Substrate node, you use the Polkadot/Substrate frontend
Problem:
When you query the storage that…

sea212
- 299
- 2
- 12
4
votes
1 answer
Connect via WSS to Polkadot Full Noder running on local network failed
I have setup a Full Node running at a local server at 192.168.2.254. I'm just trying to make a simple script which is basically subscribe to new heads on the blockchain.
const { ApiPromise, WsProvider } = require('@polkadot/api');
async function…

Minh Tran Duc
- 227
- 3
- 13
4
votes
1 answer
Converting between AccountId32 and AccountId in Substrate
I have a requirement where i get passed in some bytes and i need to create an accountId from it in Substrate 2.0.
Is there a way to convert between AccountId32 and ::AccountId in the runtime (FRAME) ? Or to create an…

Nahu
- 143
- 10
3
votes
2 answers
Attempted import error: 'TextDecoder' is not exported from '@polkadot/x-textdecoder'
I installed following polkadot packages.
"@polkadot/api": "6.10.1",
"@polkadot/extension-dapp": "0.41.1",
"@polkadot/hw-ledger": "8.2.2",
"@polkadot/util-crypto": "8.0.2",
When run the "yarn start", I got this…

hobbydev
- 1,513
- 19
- 31
3
votes
1 answer
How to generate the public key from Polkadot Address from Substrate Side
I'm generating a Public key from PolkadotJS as follows
const keyring = new Keyring({ type: "sr25519" });
const account = keyring.addFromUri("//Bob", { name: "Bob default" });
// encoded public key
let public_key =…

not 0x12
- 19,360
- 22
- 67
- 133