Integrate PoE Into Your Runtime
The Proof of Existence pallet is done, but we still need to integrate it into your Runtime.
Let’s take a look at that process.
Integration Steps
-
The first place to start is adding the
proof_of_existencefield to yourstruct Runtime. -
Next you need to update your
fn new()to also initializeproof_of_existence. -
After, create a new concrete
type Contentwhich is aString. As mentioned, normally this would be a hash, but for simplicity we are once again using a simple string.If you want to use a hash now or in the future, it would be as simple as updating this one line to change all the types in your Runtime and Pallet. That is the kind of flexibility we have been working toward!
-
Then, implement
proof_of_existence::ConfigforRuntime, using yourtypes::Content. -
At this point, things should already compile successfully, so use this as a checkpoint.
-
Introduce a new variant
ProofOfExistencefor theRuntimeCall. -
Finally, update your
fn dispatchlogic to handle re-dispatchingProofOfExistencecalls to theproof_of_existence::Pallet.
Hopefully from this process, you can see how all of the abstractions we have introduced has made integrating new Pallets into your runtime quite easy.
We will make this process even easier in the near future using macros!
By the end of this step, everything should compile without warnings.