Polkadot-Blockchain-Academy / Academy-PoW

PoW blockchain node to gain hands-on experience starting a real network together
The Unlicense
21 stars 42 forks source link

Restore Raw Chain Spec #42

Closed JoshOrndorff closed 11 months ago

JoshOrndorff commented 11 months ago

Very concretely, this PR solves the bug that the node could not be run without any arguments without crashing. The problem was that the chain spec in spec.json had, at some point been changed from a raw spec to a plain one.

$ ./target/release/academy-pow 

Error: Service(Client(Storage("Error parsing embedded file: invalid length 48, expected a (both 0x-prefixed or not) hex string with length of 40 at line 22 column 62")))

The point of raw chain specs is to make sure that all nodes trying to join a network have the exact same spec. They cannot each generate them because there is some non-determinism in the process. Further, the point of "baking" a spec into the node binary (with include_bytes!) is so that users can easily access popular public networks. We currently do this with one spec that will allow students to easily connect to our class-wide network.

We don't want to ever check in plain (non-raw) specs.

One casualty in the current setup is custom BuildSpecCmd. @fbielejec I have some questions about your intention with that command. See below for details in context.

JoshOrndorff commented 11 months ago

I'm merging this so we can test the bootnode with the campus vpn, but please do review the part about the CLI flags.