question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Latest Front End with the latest node-template extrinsic transactions not working

See original GitHub issue

I have a node based on the latest substrate-node-template and I am trying to get this working with it. On the node template the main thing I have changed is the ss58 address prefix.

I launched the template and noticed first of all that this does not seem to change the address prefix used based on the metadata sent out by the node like the apps gui does. However secondly, and more importantly, when I try to submit an extrinsic for the template-pallet I get the following vague error:

Unhandled Rejection (Error): createType(ExtrinsicV4):: Struct: failed on signature: Type:: Enum(Index):: AccountIndex: Input too large. Found input with 33 bits, expected 32

I have been trying to wrap my head around why this could possibly be happening. Why on earth is it sending 33 bits instead of 32? Is it using the wrong Account type? is it because of the ss58 prefix?

I have gone in and tried messing with the following in the types file: “Address”: “MultiAddress”, “LookupSource”: “MultiAddress”, “Signature”: “MultiSignature”, to no avail.

and I went into SubstrateContext.js to force it onto the correct address prefix:

const ss58Format = 0xCE;
keyring.setSS58Format(ss58Format);
///
// Loading accounts from dev and polkadot-js extension

let loadAccts = false;
const loadAccounts = (state, dispatch) => {
  const asyncLoadAccounts = async () => {
    dispatch({ type: 'LOAD_KEYRING' });
    try {
      await web3Enable(config.APP_NAME);
      let allAccounts = await web3Accounts();
      allAccounts = allAccounts.map(({ address, meta }) =>
        ({ address, meta: { ...meta, name: `${meta.name} (${meta.source})` } }));
      keyring.loadAll({ isDevelopment: config.DEVELOPMENT_KEYRING, ss58Format: ss58Format }, allAccounts);
      dispatch({ type: 'SET_KEYRING', payload: keyring });
    } catch (e) {
      console.error(e);
      dispatch({ type: 'KEYRING_ERROR' });
    }
  };

But still no dice.

If anyone knows why this is happening, I would love to know.

And in terms of issues to be fixed, if the current front end template and node-templates are not compatible that should be addressed. This could possibly be an issue with the substrate js-api itself though i’m not sure.

And additionally this really should be reading the meta data sent from the node as to what ss58 prefix to use just like on apps https://polkadot.js.org/docs/substrate/constants#ss58prefix-u8 https://github.com/polkadot-js/apps/pull/3879/files

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jimmychu0807commented, Mar 8, 2021

Thanks for reporting @ConnorBP. Will take a look in this issue.

0reactions
jimmychu0807commented, Oct 2, 2021

This should work now. Let me know if you still have any issue. If yes, please reopen this. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot send Sudo transactions on modern node template
I've built a Substrate node template based on Substrate commit ... Please open a new issue if you think you have a related...
Read more >
Newest 'extrinsic' Questions - Substrate Stack Exchange
I have a call to an extrinsic (in a Typescript/RxJS client) that is failing but I want to be able to catch the...
Read more >
rust - Extrinsic verification error:... FailedToConvertParameter ...
My plan is to deploy the flippers contract to substrate-node-template ((https://github.com/substrate-developer-hub/substrate-node-template); ...
Read more >
Build a PoE Decentralized App - Figment Learn
Modify a front-end template to interact with your brand new blockchain. ... The Substrate Developer Hub Node Template comes with a template pallet...
Read more >
Interacting with Your Node · Substrate Developer Hub
target/release/node-template --dev --tmp ... at 127.0.0.1:9615 Sep 23 15:23:22.940 INFO Listening for new connections on 127.0.0.1:9944.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found