Block Metadata Exercise
Using the below example (from the last lesson), you will be writing your own metadata flakes.
Subject | Predicate | Object | Time | Operation |
---|---|---|---|---|
12345 | Hair Color | Red | -9 | true |
12345 | Birthday | 1/30/85 | -9 | true |
12345 | Fav Nums | 7 | -10 | true |
12345 | Full Name | Jane Doe | -10 | true |
12345 | Fav Nums | 28 | -10 | true |
-9 | sig | Signature of the original JSON command | -9 | true |
-9 | tx | [{ Original JSON transaction }] | -9 | true |
-9 | auth | 3425 (auth id that issued this transaction) | -9 | true |
-10 | sig | Signature of the original JSON command | -10 | true |
-10 | tx | [{ Original JSON transaction }] | -10 | true |
-10 | auth | 3425 (auth id that issued this transaction) | -10 | true |
-11 | number | 2 (this is the block number) | -11 | true |
-11 | hash | SHA-256 hash for block | -11 | true |
-11 | prevHash | Previous block's hash | -11 | true |
-11 | transactions | [ -9, -10 ] (reference to the transactions in this block) | -11 | true |
-11 | instant | Instant (time) when this block was created | -11 | true |
Your challenge is to use the above example to complete block 3 by determing how to replace the variables in brackets (i.e [Subject 1]).
Subject | Predicate | Object | Time | Operation |
---|---|---|---|---|
12345 | Hair Color | Red | -11 | false |
12345 | Hair Color | Brown | -11 | true |
12345 | Fav Nums | 101 | -11 | true |
[Subject 1] | sig | Signature of the original JSON command | [Subject 1] | true |
[Subject 1] | tx | [{ Original JSON transaction }] | [Subject 1] | true |
[Subject 1] | auth | 3425 (auth id that issued this transaction) | [Subject 1] | true |
[Subject 2] | number | [Object 1] | [Subject 2] | true |
[Subject 2] | hash | SHA-256 hash for block | [Subject 2] | true |
[Subject 2] | prevHash | Previous block's hash | [Subject 2] | true |
[Subject 2] | transactions | [Object 2] | [Subject 2] | true |
[Subject 2] | instant | Instant (time) when this block was created | [Subject 2] | true |
Note: when you're issuing a transaction, these metadata flakes are automatically generated, but it's helpful to write them yourself to understand the concept.