• R/O
  • HTTP
  • SSH
  • HTTPS

bytom: Commit

Official Go implementation of the Bytom protocol


Commit MetaInfo

Révisiona4e1e96ee2b2e308f98b6d15a4651aae9c339d57 (tree)
l'heure2021-07-15 15:02:53
Auteurhauson <875095736@qq.c...>
Commiterhauson

Message de Log

feat(add genesis tx btm issue amount): add genesis tx btm issue amount

Change Summary

Modification

--- a/config/genesis.go
+++ b/config/genesis.go
@@ -1,8 +1,6 @@
11 package config
22
33 import (
4- "encoding/hex"
5-
64 log "github.com/sirupsen/logrus"
75
86 "github.com/bytom/bytom/consensus"
@@ -10,24 +8,6 @@ import (
108 "github.com/bytom/bytom/protocol/bc/types"
119 )
1210
13-func GenesisTx() *types.Tx {
14- contract, err := hex.DecodeString("00148c9d063ff74ee6d9ffa88d83aeb038068366c4c4")
15- if err != nil {
16- log.Panicf("fail on decode genesis tx output control program")
17- }
18-
19- txData := types.TxData{
20- Version: 1,
21- Inputs: []*types.TxInput{
22- types.NewCoinbaseInput([]byte("Information is power. -- Jan/11/2013. Computing is power. -- Apr/24/2018.")),
23- },
24- Outputs: []*types.TxOutput{
25- types.NewOriginalTxOutput(*consensus.BTMAssetID, 0, contract, nil),
26- },
27- }
28- return types.NewTx(txData)
29-}
30-
3111 func mainNetGenesisBlock() *types.Block {
3212 tx := GenesisTx()
3313 merkleRoot, err := types.TxMerkleRoot([]*bc.Tx{tx.Tx})
--- /dev/null
+++ b/config/genesis_tx.go
@@ -0,0 +1,29 @@
1+package config
2+
3+import (
4+ "encoding/hex"
5+
6+ log "github.com/sirupsen/logrus"
7+
8+ "github.com/bytom/bytom/consensus"
9+ "github.com/bytom/bytom/protocol/bc/types"
10+)
11+
12+// GenesisTx make genesis block txs
13+func GenesisTx() *types.Tx {
14+ contract, err := hex.DecodeString("00148c9d063ff74ee6d9ffa88d83aeb038068366c4c4")
15+ if err != nil {
16+ log.Panicf("fail on decode genesis tx output control program")
17+ }
18+
19+ txData := types.TxData{
20+ Version: 1,
21+ Inputs: []*types.TxInput{
22+ types.NewCoinbaseInput([]byte("Information is power. -- Jan/11/2013. Computing is power. -- Apr/24/2018.")),
23+ },
24+ Outputs: []*types.TxOutput{
25+ types.NewOriginalTxOutput(*consensus.BTMAssetID, 167959666678580395, contract, nil),
26+ },
27+ }
28+ return types.NewTx(txData)
29+}
Afficher sur ancien navigateur de dépôt.