aboutsummaryrefslogtreecommitdiffstats
path: root/genesis.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2013-12-30 06:54:50 +0800
committerobscuren <obscuren@obscura.com>2013-12-30 06:54:50 +0800
commita926686445929d091c2d9e019b017600168e9e47 (patch)
treea328e4f79148461c076b0bd122c591f0bfd213c2 /genesis.go
parentad048e9f445ff96b7bfd75c104ab923e1e06754b (diff)
downloadgo-tangerine-a926686445929d091c2d9e019b017600168e9e47.tar.gz
go-tangerine-a926686445929d091c2d9e019b017600168e9e47.tar.zst
go-tangerine-a926686445929d091c2d9e019b017600168e9e47.zip
Added sample server, genesis block, and database interface
Diffstat (limited to 'genesis.go')
-rw-r--r--genesis.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/genesis.go b/genesis.go
new file mode 100644
index 000000000..aae9cd1cf
--- /dev/null
+++ b/genesis.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "math"
+)
+
+/*
+ * This is the special genesis block.
+ */
+
+var GenisisHeader = []interface{}{
+ // Block number
+ uint32(0),
+ // Previous hash (none)
+ "",
+ // Sha of uncles
+ string(Sha256Bin(Encode([]interface{}{}))),
+ // Coinbase
+ "",
+ // Root state
+ "",
+ // Sha of transactions
+ string(Sha256Bin(Encode([]interface{}{}))),
+ // Difficulty
+ uint32(math.Pow(2, 36)),
+ // Time
+ uint64(1),
+ // Nonce
+ uint32(0),
+ // Extra
+ "",
+}
+
+var Genesis = []interface{}{ GenisisHeader, []interface{}{}, []interface{}{} }
+
+var GenisisBlock = NewBlock( Encode(Genesis) )