Skip to content

Commit

Permalink
Added the "Description" field to the genesis block & chainparams
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoras committed Feb 1, 2019
1 parent 44c94a1 commit ea3576e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var blockchainSubdirectory string
* CreatorPublicKey|1:a3c07ef6cbee246f231a61ff36bbcd8e8563723e3703eb345ecdd933d7709ae2
* Version|1
*
* Of these, only the Creator field is optional. By default, for new block, it is taken
* Of these, only the Creator field is optional. By default, for new blocks, it is taken
* from the "BlockCreator" field in the pubkey metadata (if it exists).
*/

Expand Down
5 changes: 3 additions & 2 deletions chainparams.example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"creator": "Ivan Voras <ivoras@gmail.com>",
"genesis_block_timestamp": "2018-08-16T12:49:32+02:00",
"bootstrap_peers": [ "cosmos.ivoras.net:2017" ]
}
"bootstrap_peers": [ "cosmos.ivoras.net:2017" ],
"description": "The Mighty Blockchain"
}
3 changes: 3 additions & 0 deletions chainparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ type ChainParams struct {

// List of host:port string specifying default peers for this blockchain. If empty, the defaults are used.
BootstrapPeers []string `json:"bootstrap_peers"`

// Description of the blockchain (e.g. its purpose)
Description string `json:"description"`
}
4 changes: 4 additions & 0 deletions cliactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ func actionNewChain(jsonFilename string) {
if err != nil {
log.Fatal(err)
}
err = dbSetMetaString(db, "Description", ncp.Description)
if err != nil {
log.Fatal(err)
}

if len(ncp.BootstrapPeers) > 0 {
// bootstrapPeers is required to be filled in before dbInit()
Expand Down

0 comments on commit ea3576e

Please sign in to comment.