All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
2 views

Errors on generated code from Typegen

We are following the polkadot{.js} docs on TypeScript user generated for Chain modules. We are trying to get our custom chain module types into Typescript. We can generate fine however the generated ...
0 votes
1 answer
8 views

How to convert usize to u32 in ink!

How can I convert a usize to u32? For example I want to store the length of a Vector (usize) to a variable u32 I tried i32::from(v) // or v.into(). where v is the length of the vector but errored I ...
  • 135
0 votes
1 answer
8 views

What is the kusama block production reward distribution mechanism?

I am writing a custom pallet for distribution of rewards to different stake holders. The idea is to distribute block production reward in the stakeholders of my system and a portion it will go to the ...
0 votes
0 answers
9 views

Error: Service(Other("Scale codec deserialization error: Future version (expected 1, found 2)"))

We are trying to start our own node using the official polkashot for polkadot. When I start the node it hangs for a while then I get the following error message: Error: Service(Other("Scale codec ...
0 votes
1 answer
7 views

How to distribute a portion of block production reward to treasury? [closed]

What are some of the good ways to distribute some portion of the block production reward to treasury?
2 votes
1 answer
38 views

MultiLocation type polkadot js

I am trying to figure out correct way how to type MultiLocation type I thought that I would do import {MultiLocation} from "@polkadot/types/interfaces" const location: MultiLocation = { ...
0 votes
1 answer
20 views

What is the purpose of Sovereign account? How is the balance of Soverign for a Parachain decided or calculated?

I think that balance of Sovereign account on Relay chain should be total token supply for that parachain? Basically what's the relation between soverign account balance and parachain? How does it ...
0 votes
0 answers
7 views

`polkadot benchmark machine` does not pass (official documentation recommended configuration)

official configuration: https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot#requirements We opened the appropriate server on aws according to the requirements in the official ...
  • 603
0 votes
0 answers
12 views

Error running swanky suite contract query

I get this error running swanky contract tx flipper flip -a alice -g 1000000000. I have increased the gas, I have no clue what else to try. Also is there a place to check for { Err: { Module: { index: ...
0 votes
1 answer
14 views

Difference between {Contract}Ref and Hash?

while contract instantiation inside constructor new function parameter, we can find {Contract}Ref and Hash. If new function accepts {Contract}Ref as parameter, then type is AccountId and if new ...
  • 367
0 votes
1 answer
14 views

In the runtime chain extension, should we be charging weight if we are reading a `StorageMap`?

If we have the storage map DummyStorageMap in pallet-example And we read its value under the key key by calling DummyStorageMap::<T>::get(key) in the runtime chain extension (https://paritytech....
0 votes
1 answer
8 views

Remove --parachain-id flag from zombienet

I'm using zombienet v1.3.30. My config file is like this: [[parachains]] id = 100 cumulus = true [parachains.collator] name = "collator01" chain_spec_path = "./bin/chain/specs/...
0 votes
0 answers
17 views

fill assetId in local substrate into dex pallet

I am trying to create a decentralized exchange (dEX) in Substrate and I have a function called create_exchange that has two parameters: asset_id and liquidity_token_id. I am having trouble filling the ...
  • 199
0 votes
0 answers
15 views

Our on_initialize function takes approximately 5 seconds, this breaks the parachain eventually

We need to run an on-initialize function that runs for 5 to 6 seconds. The error we run into when we do this is "Block production took too long". We have tried to increase the ...
1 vote
1 answer
16 views

How to select n random keys from a `StorageMap`?

Assume I have the following storage map: ZAccounts: StorageMap(AccountId -> AccountInfoOf<T>) Is there a simple way to draw n AccountId's randomly. I assume that I already have a secure ...
  • 215
2 votes
0 answers
10 views

Supported interfaces for ink! contracts (like EIP-165)

Is there a way in ink! to check supported contract interfaces? EVM has EIP-165. I know we have very few PSPs but already the interface information could be useful for PSP34/37 or say RMRK. What would ...
  • 398
0 votes
0 answers
12 views

I'm getting this error Error: The transactionPaymentApi.queryInfo runtime call is not available in your environment [closed]

what I need to do in this situation code: const info = await api.tx.balances .transfer(addr, final) .paymentInfo(account);
1 vote
1 answer
17 views

Recommended way of local development flow for swanky-cli

Right now contract compilation and deployment results in bunch of artifacts and edits to swanky.config.json. I'm just curious what's recommended flow of dealing with those changes or developing smart ...
1 vote
0 answers
21 views

PoW custom consensus with remote calls

I'm trying to implement a new consensus in Substrate. The consensus is similar to PoW but requires querying other nodes to generate the work/proof. Would implementing the PowAlgorithm trait and ...
  • 11
0 votes
1 answer
12 views

Balance contents of PalletBalancesAccountData

I would like to know what is stored in the PalletBalancesAccountData in the free, reserved, miscFrozen and feeFrozen fields and whether it differs from chain to chain.
0 votes
4 answers
21 views

How can i connect the frontier template node to my Metamask on localhost?

I tried connecting the localhost node by adding the port number along with the ip in Metamask the problem is with the chainId it shows error if i put any chain id in there and even if i define a chain ...
  • 1
1 vote
1 answer
40 views

What does `no particular order` mean for storage iterations?

I am always curious what the documentation for the storage means when I see the following. Enumerate all elements in the map in no particular order. https://paritytech.github.io/substrate/master/...
  • 215
0 votes
0 answers
9 views

How we send the crowdloan reward to the parachain wallet?

As you know in crowdloan we the contributor contribute from the polkadot account(1D....). So according to that how send the reward to the contributors native chain account(XGT...). How we basically ...
  • 1,123
0 votes
0 answers
9 views

Can we use the partial amount of cap in crowdloan?

if we run a crowdloan and say hit the cap of 500k DOT are we then forced to use its entirety to bid for the slot or we can use a subset of it? In that maybe we could potentially exclude some people ...
  • 1,123
1 vote
1 answer
14 views

Invalid AccountId provided, expected 32 bytes, found 20

I've implemented an evm-based Substrate chain (i.e. it uses the H160 address format), but when I try to open Accounts page on Polkadot explorer, I get this error: Invalid AccountId provided, expected ...
1 vote
1 answer
13 views

How to implement a session progress bar for parachain?

Polkadot has this: And I hope I can have one for my parachain. There is a session pallet on my parachain. And the session period is readable from the constant. So, I think this is possible.
1 vote
1 answer
25 views

`MAXIMUM_BLOCK_WEIGHT` between solo chain and para chain

From Substrate: https://github.dev/paritytech/substrate/blob/68d00e2d5132ef32e564e0320e89dfac57e1c46e/bin/node/runtime/src/lib.rs#L179 /// We allow for 2 seconds of compute with a 6 second average ...
0 votes
0 answers
16 views

start parachain collator node encounter relay chain block sync problem

I make a parachain rococo test net practice following this tutorial. But I encounter issue after start collator node: [Relaychain] cannot query the runtime API version: UnknownBlock: State already ...
  • 1
0 votes
1 answer
17 views

Substrate-Connect Error on new ScProvider

I am using Substrate Connect in the browser following the docs for a custom chain spec. When I try to create a new ScProvider like the documentation suggests i get an error that I am missing a ...
1 vote
0 answers
16 views

Is it possible to override ink_env::test default block time?

Currently, in the ink test environment (ink_env::test), the default block time is 6 (see https://github.com/paritytech/ink/blame/50b32f4e49d4072f3d28009eb517475b68bec56b/crates/engine/src/ext.rs#L147) ...
  • 287
1 vote
1 answer
18 views

How to find the accounts used behind treasury pallet?

I have multiple question about treasury pallet. How to get the account that is behind the treasury? Can we transfer funds to treasury by transferring some token to that account? How to find the ...
0 votes
1 answer
23 views

Problem adding a smart contract into a Substrate node

I added these pallets into runtime Cargo.toml : pallet-contracts = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", " ...
  • 199
2 votes
1 answer
65 views

WEIGHT_PER_SECOND,^^^^^^^^^^^^^^^^^ no `WEIGHT_PER_SECOND` in `weights::constants

I want to use WEIGHT_PER_SECOND in this code : parameter_types! { pub const BlockHashCount: BlockNumber = 2400; pub const Version: RuntimeVersion = VERSION; /// We allow for 2 seconds of ...
  • 199
1 vote
1 answer
15 views

Do we have any example of crowdloan reward distribution implementation?

I need to implement the crowdloan reward distribution. Do we have have any reference/example for that? What are the options we have to distribute the rewards?
1 vote
0 answers
18 views

Using original origin's call filter for proxy pallet's proxy

In the proxy pallet's do_proxy function, a newly authenticated origin is constructed from the real account. This is explicitly done. Is there a particular reason for this? Can I just use the same ...
4 votes
0 answers
12 views

What is the ValidAtTimestamp error supposed to mean?

In pallet-timestamp, what is InherentError::ValidAtTimestamp supposed to mean exactly? let minimum = (Self::now() + T::MinimumPeriod::get()).saturated_into::<u64>(); if t > *(data + ...
  • 117
0 votes
0 answers
20 views

Custom RPC sized array parameters

I have custom RPC, which looks like so #[rpc(client, server)] pub trait SomeRpcApi { #[method(name = "some_submitData")] async fn submit_data( &self, id: u64, ...
4 votes
1 answer
28 views

How to verify that a signed payload of an unsigned extrinsic is signed by a local account?

I've been following the how-to guide to implementing unsigned extrinsic call with a signed payload. My pallet defines the following KeyTypeId: pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"ver!&...
2 votes
0 answers
32 views

How to migrate blockchain data from Moonbeam network to a custom Substrate-based chain?

I deployed an ERC-721(NFT) contract on Moonbeam some time ago. Now I have added the NFT pallet to our Substrate-based chain. How can I migrate the data from the Moonbeam network chain data to our ...
  • 1,123
2 votes
1 answer
18 views

Is possible to set the genesis block number to non-zero value?

As we are going to release a new chain base on the old state and we want to avoid the break changes as much as possible.
1 vote
1 answer
24 views

Number of staked tokens

I'm thinking which events/calls (or whatever) should I take into account to get a number of staked in the protocol? I did this exercise for Reef protocol (but this should be similar for all Substrate ...
1 vote
1 answer
16 views

How to debug error codes for ink contracts?

Ink contract Transaction emit errors with hex code. How to map that to the actual error and get a trace of error in the contract?
1 vote
1 answer
56 views

Is there a way to call a cryptographic library from inside the ink! contract?

This is one such link containing some examples of ink! contracts from parity's repo : https://github.com/paritytech/ink/blob/master/examples/rand-extension/lib.rs Is there a way to call a custom ...
1 vote
1 answer
27 views

PolkadotJs Api: queryMulti with different blockHashes

Is it possible to do a multiQuery querying multiple types and multiple blockhashes? Even same type and different block hashes would be helpful. Something along the lines of const multiQueryResult = ...
0 votes
2 answers
20 views

How to decode an error that happened in a proxy.proxy call

I'd like to show my users if an error occurred while doing a proxy.proxy call. While I know how to decode a system.ExtrinsicFailed, as this is well documented, I have difficulties finding the correct ...
  • 61
0 votes
0 answers
5 views

How to apply a custom transaction fee to specific accounts for a given number of blocks?

For example, if you have built a custom Substrate-based chain and added Substrate pallets to enable on-chain governance (i.e. pallet_democracy, pallet_referenda). How would you apply a custom ...
  • 1,394
0 votes
0 answers
4 views

How to split the overall transaction fees associated with an on-chain proposal that passes amongst its creator and voters?

If you have built a custom Substrate-based chain and added Substrate pallets to enable on-chain governance (i.e. pallet_democracy, pallet_referenda). How would you split the costs between participants ...
  • 1,394
3 votes
1 answer
23 views

what is the maximum size of a block?

Just for some analysis purpose i need to know what can be the maximum size limit of a block can have like 2MB or 5MB and is there any doc how we can customise it as per our need if its possible?
3 votes
1 answer
14 views

How we can assign any name to our collator?

Is it possible to give the name to the collator so that public can see that the particular collator is of which person or entity. if yes. How we can do it?
  • 1,123
2 votes
1 answer
36 views

State Pruning: Archive-Canonical vs Archive-Finalized

Currently in substrate there is a possibility to set state pruning to "archive-canonical" or "number". In docs it states, that these values will cause to: archive-canonical - Keep ...
  • 21

15 30 50 per page
1
2 3 4 5
62