File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,12 @@ var genesisNewCmd = &cli.Command{
90
90
var genesisAddMinerCmd = & cli.Command {
91
91
Name : "add-miner" ,
92
92
Description : "add genesis miner" ,
93
- Flags : []cli.Flag {},
93
+ Flags : []cli.Flag {
94
+ & cli.Int64Flag {
95
+ Name : "balance" ,
96
+ Value : 50_000_000 ,
97
+ },
98
+ },
94
99
Action : func (cctx * cli.Context ) error {
95
100
if cctx .NArg () != 2 {
96
101
return xerrors .New ("seed genesis add-miner [genesis.json] [preseal.json]" )
@@ -124,6 +129,7 @@ var genesisAddMinerCmd = &cli.Command{
124
129
return xerrors .Errorf ("unmarshal miner info: %w" , err )
125
130
}
126
131
132
+ balance := cctx .Int64 ("balance" )
127
133
for mn , miner := range miners {
128
134
log .Infof ("Adding miner %s to genesis template" , mn )
129
135
{
@@ -145,7 +151,7 @@ var genesisAddMinerCmd = &cli.Command{
145
151
log .Infof ("Giving %s some initial balance" , miner .Owner )
146
152
template .Accounts = append (template .Accounts , genesis.Actor {
147
153
Type : genesis .TAccount ,
148
- Balance : big .Mul (big .NewInt (50_000_000 ), big .NewInt (int64 (buildconstants .FilecoinPrecision ))),
154
+ Balance : big .Mul (big .NewInt (balance ), big .NewInt (int64 (buildconstants .FilecoinPrecision ))),
149
155
Meta : (& genesis.AccountMeta {Owner : miner .Owner }).ActorMeta (),
150
156
})
151
157
}
You can’t perform that action at this time.
0 commit comments