Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom Polkadot JS types on the parachain side #97

Open
JoshOrndorff opened this issue May 11, 2021 · 5 comments
Open

Support custom Polkadot JS types on the parachain side #97

JoshOrndorff opened this issue May 11, 2021 · 5 comments

Comments

@JoshOrndorff
Copy link
Contributor

Currently the launch config has a key called types. This allows the user to insert custom types that are needed on the relay chain side. This is useful and necessary because if launch can't communicate with the relay chain, it can't submit transactions.

There is currently no corresponding support for the Parachains. I recommend we move the current types field into the relaychain section, and add a similar types field to each parachain.

It's actually not clear to me when or why launch needs to communicate with the parachains, but I think it must because I'm getting an error about how Polkadot JS can't construct the RoundIndex type, and indeed that is a custom type on Monbeam.

2021-05-11 13:20:31        API/INIT: Error: createType(RoundIndex):: Cannot construct unknown type RoundIndex
    at createTypeUnsafe (/home/joshy/polkadot-launch/node_modules/@polkadot/types/create/createType.cjs:66:11)
    at createType (/home/joshy/polkadot-launch/node_modules/@polkadot/types/create/createType.cjs:78:10)
    at TypeRegistry.createType (/home/joshy/polkadot-launch/node_modules/@polkadot/types/create/registry.cjs:306:39)
    at extendHeadMeta (/home/joshy/polkadot-launch/node_modules/@polkadot/metadata/decorate/storage/createFunction.cjs:144:53)
    at extendPrefixedMap (/home/joshy/polkadot-launch/node_modules/@polkadot/metadata/decorate/storage/createFunction.cjs:169:23)
    at createFunction (/home/joshy/polkadot-launch/node_modules/@polkadot/metadata/decorate/storage/createFunction.cjs:192:5)
    at /home/joshy/polkadot-launch/node_modules/@polkadot/metadata/decorate/storage/index.cjs:40:91
    at Array.reduce (<anonymous>)
    at /home/joshy/polkadot-launch/node_modules/@polkadot/metadata/decorate/storage/index.cjs:38:39
    at Array.reduce (<anonymous>)
@ArseniiPetrovich
Copy link

Workaround:
Open Polkadot.JS app. Navigate to "Settings" => "Developer" and paste the following snippet there:

{
  "RoundIndex": "u32"
}

@ArseniiPetrovich
Copy link

@JoshOrndorff May I ask you why if I run the local node of Moonbeam and point PolkadotJS to it - it works awesome, and if I run a custom network using PolkadotLaunch - it doesn't work at all. And what is more interesting - how do I make it work properly? Any ideas on when do I get these custom types Polkadot.JS needs?

@JoshOrndorff
Copy link
Contributor Author

I haven't had this problem in a while. I guess it either it got fixed or was caused by a mistake I was making locally. If you are trying to launch a local moonbeam network, you could get support in our discord.

@ArseniiPetrovich
Copy link

@JoshOrndorff tried to reach you via the Element chat, but sure, let me try discord instead :)

@ArseniiPetrovich
Copy link

Just got an update from the team via discord. There is a method now that will let you export the required custom types: moonbeam-foundation/moonbeam#838

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants