Coder Social home page Coder Social logo

Initial collator set-up about moonbeam HOT 5 CLOSED

purestake avatar purestake commented on June 24, 2024
Initial collator set-up

from moonbeam.

Comments (5)

JoshOrndorff avatar JoshOrndorff commented on June 24, 2024 1

Hi there. it sounds like you're trying to start your own local Moonbeam network using your own generated keys rather than Alice, Bob, etc, right? You're definitely on the right track. I'll give an overview here and feel free to ask further questions.

  1. Generate an account ID for your colaltor account. You can use metamask, or polkadot js or whatever for this.
  2. Use subkey or any other tool to generate an SR25519 session key
subkey generate
Secret phrase `learn possible obey useful ill venue wine ivory divide secret gallery fortune` is account:
  Secret seed:       0xa5621d70ee2834728867a6d221ed01ce23edea9a6e43b0e50b9d52a65c46cf93
  Public key (hex):  0x7c3174f25a5d6fa706948a31614c6a8e82a6f3337b29274855ffb1461a4b994b
  Public key (SS58): 5EsYVBCuVTWKX4NUeDmQePHvGiy8Jeg56ySpqtpe4Tp88xek
  Account ID:        0x7c3174f25a5d6fa706948a31614c6a8e82a6f3337b29274855ffb1461a4b994b
  SS58 Address:      5EsYVBCuVTWKX4NUeDmQePHvGiy8Jeg56ySpqtpe4Tp88xek
  1. Export our local chain spec into a json file that you can edit moonbeam build-spec --chain moonbase-local > moonbase-custom.json. (If you want to use the development service without a relay chain, start with moonbase-dev instead.)
  2. Edit that spec to contain your account information. Here are some considerations:
    • Give your account some tokens
    • List your account as sudo (not necessary, but possibly useful)
    • List your account as a collator candidate
    • Enter your author mapping in the genesis config.
  3. make your spec raw `moonbeam build-spec --chain moonbase-custom.json --raw > moonbase-custom-raw.json (Not necessary if you're doing everything locally, but necessary for production)
  4. Start your node moonbeam --collator --chain moonbase-custom-raw.json
  5. Insert your key via RPC. You can use curl or Apps. The keytype is nmbs.

from moonbeam.

JoshOrndorff avatar JoshOrndorff commented on June 24, 2024 1

I don't understand what the first block of code you wrote means. The author mapping genesis config has just two fields. There is no amount there.

The --session-key flag idea would work but is not secure. It requires you putting the key on the cli. The RPC call is the standard way to do it. If you don't like that you could also try moonbeam key insert but I'd recommend against that until you have it working with the RPC call.

unsuccessfully tried to call author_insertKey

What was unsucessful about it. Did you get an error message?

rotateKeys

This is not useful for starting a network. This is useful for adding new collators or rotating the keys of existing collators after genesis. If you are trying to launch a new network, don't waste time with this rpc call.

from moonbeam.

c410-f3r avatar c410-f3r commented on June 24, 2024 1

My apologies @JoshOrndorff, everything is now working as expected. Previous attempts weren't successful because of my lack of attention.
In any case, I really appreciate your help and patience. Not everybody is keen to help so thank you very much!

from moonbeam.

JoshOrndorff avatar JoshOrndorff commented on June 24, 2024

cc @albertov19 @themacexpert @eshaben this might be a good thing to have in the docs eventually.

from moonbeam.

c410-f3r avatar c410-f3r commented on June 24, 2024

@JoshOrndorff Thanks for the detailed information and congratulations for all the hard work in regards to Cumulus.

As lucky as lucky can be, the above steps were already tried without success on my side. Quoting your example, there is an account ID and a session key (Author ID) so the genesis mapping should be:

(
    hex::hex!["SOME_RANDOM_ACCOUNT_ID_HEX"].into(),
    hex::hex!["0x7c3174f25a5d6fa706948a31614c6a8e82a6f3337b29274855ffb1461a4b994b"].unchecked_into(),
    SOME_STAKING_AMOUNT
)

But the collator session key is different than 0x7c3174f25a5d6fa706948a31614c6a8e82a6f3337b29274855ffb1461a4b994b causing an address mismatch, therefore, no block will be produced. This situation could be solved with an hypothetical way to enforce session keys at application start-up. For example:

moonbeam --collator --chain moonbase-custom-raw.json --session-key 0x7c3174f25a5d6fa706948a31614c6a8e82a6f3337b29274855ffb1461a4b994b

Also unsuccessfully tried to call author_insertKey providing the manually generated session key public key and/or the collator session key (rotateKeys) along side the account seed and/or the manually generated session key seed. Every possible combination, variant and alternative didn't change anything.

Maybe I am doing something wrong but this relationship between Author ID/Session key and a genesis collator that produces initial blocks is not clear to me. Could you provide more insight?

from moonbeam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.