Conversation
|
Hey would it be possible think about aligning the requirements here with our needs to Starfish for launch? Some description of the idea of Starfish. https://gist.github.com/zmanian/88fdd41421d363d11adbcf98d3367a4c |
Codecov Report
@@ Coverage Diff @@
## develop #2422 +/- ##
===========================================
+ Coverage 57.87% 61.25% +3.38%
===========================================
Files 140 122 -18
Lines 8119 7519 -600
===========================================
- Hits 4699 4606 -93
+ Misses 3123 2594 -529
- Partials 297 319 +22 |
|
@zaki What will be the process for collecting genesis accounts for the Hub? Will the ICF issue a "suggested" allocation list, which node operators can then combine with their list of genesis transactions locally - or will the ICF collate genesis transactions itself and provide a full genesis file? |
|
Let's include this in 0.25. |
|
It's gonna be more the like here are allocations + genesis txs + tools for reading eth and Bitcoin blockchains. |
|
Lets make sure we at least have an eye toward starfish requirements while implementing this. Lets sync on this @alessio |
|
I feel like we can implement Starfish as wrapper around this functionality. |
|
Reviewing... |
Finalize gaiacli tx create-validator --genesis-format
| Power: 1, | ||
| Name: fmt.Sprintf("validator-%d", i+1), | ||
| }, | ||
| for i:=0 ; i<nValidators; i++ { |
| // SignStdTx appends a signature to a StdTx and returns a copy of a it. If appendSig | ||
| // is false, it replaces the signatures already attached with the new signature. | ||
| func SignStdTx(txBldr authtxb.TxBuilder, cliCtx context.CLIContext, name string, stdTx auth.StdTx, appendSig bool) (auth.StdTx, error) { | ||
| func SignStdTx(txBldr authtxb.TxBuilder, cliCtx context.CLIContext, name string, stdTx auth.StdTx, appendSig bool, offline bool) (auth.StdTx, error) { |
There was a problem hiding this comment.
ideally is maybe SignStdTxOptions struct/ptr? But this is maybe fine for now w/ comment & TODO in comments in code... (for me anyways)
| if len(req.Validators) > 0 { | ||
| if len(req.Validators) != len(validators) { | ||
| panic(fmt.Errorf("len(RequestInitChain.Validators) != len(validators) (%d != %d) ", len(req.Validators), len(validators))) | ||
| } |
There was a problem hiding this comment.
TODO sort and equality check...
| // State to Unmarshal | ||
| type GenesisState struct { | ||
| Accounts []GenesisAccount `json:"accounts"` | ||
| Txs []json.RawMessage `json:"txs"` |
There was a problem hiding this comment.
Yeah that was the original implementation. I could roll it back, though this is not blocking now
|
|
||
| if initConfig.GenTxs { | ||
| validators, appGenTxs, persistentPeers, err = processGenTxs(initConfig.GenTxsDir, cdc) | ||
| if withGenTxs { |
There was a problem hiding this comment.
block comment here on what withGenTxs does, namely aggregates gentxs.
| } | ||
| var genTx server.GenesisTx | ||
| err = cdc.UnmarshalJSON(bz, &genTx) | ||
| } else { |
There was a problem hiding this comment.
block comment on the alternative logic, which just creates a simple genesis file with no gentxs
|
|
||
| func initWithConfig(cdc *codec.Codec, appInit server.AppInit, config *cfg.Config, initConfig server.InitConfig) ( | ||
| chainID string, nodeID string, appMessage json.RawMessage, err error) { | ||
| func initWithConfig(cdc *codec.Codec, appInit server.AppInit, config *cfg.Config, chainID, moniker, genTxsDir string, withGenTxs, overwriteGenesis bool) ( |
There was a problem hiding this comment.
TODO document what this function does, including side effects like possibly creating priv validator file... etc
| } | ||
|
|
||
|
|
||
| // ProcessStdTxs processes and validates application's genesis StdTxs and returns the list of validators, |
There was a problem hiding this comment.
s/ProcessStdTxs/CollectGenTxs/g
| } | ||
| msg := msgs[0].(stake.MsgCreateValidator) | ||
|
|
||
| // create the genesis account, give'm few steaks and a buncha token with there name |
There was a problem hiding this comment.
"their name" not "there name"... some elses typo
| stakeData := stake.DefaultGenesisState() | ||
| validator := stake.NewValidator(sdk.ValAddress(acc.Address), pubKey, stake.NewDescription(moniker, "", "", "")) | ||
| stakeData = addValidatorToStakeData(validator, stakeData) | ||
| stakeData.Pool.LooseTokens = stakeData.Pool.LooseTokens.Add(sdk.NewDecFromInt(freeFermionsAcc)) |
There was a problem hiding this comment.
just reading the code, it looks like it's being done twice here? once in the function addValdiatorToStakeData above.
TODO: Find out how to get past genesis when using MockApp
7360d59 to
4c85964
Compare
|
Superseded, see #2524 |
Ref #1890
docs/)PENDING.mdwith issue #Files changedin the github PR explorerFor Admin Use: