MCPcopy Create free account
hub / github.com/Sifchain/sifnode / CreateValidator

Method CreateValidator

tools/sifgen/utils/cli.go:196–216  ·  view source on GitHub ↗
(moniker, validatorPublicKey, keyPassword, bondAmount string)

Source from the content-addressed store, hash-verified

194}
195
196func (c CLI) CreateValidator(moniker, validatorPublicKey, keyPassword, bondAmount string) (*string, error) {
197 var input [][]byte
198 if c.keyringBackend == keyring.BackendFile {
199 input = c.formatInputs([]string{keyPassword, keyPassword})
200 }
201
202 return c.shellExecInput("sifnoded", input,
203 "tx", "staking", "create-validator",
204 "--commission-max-change-rate", "0.1",
205 "--commission-max-rate", "0.1",
206 "--commission-rate", "0.1",
207 "--amount", bondAmount,
208 "--pubkey", validatorPublicKey,
209 "--moniker", moniker,
210 "--chain-id", c.chainID,
211 "--min-self-delegation", "1",
212 "--gas", "auto",
213 "--from", moniker,
214 "--keyring-backend", c.keyringBackend,
215 "-y")
216}
217
218func (c CLI) formatInputs(inputs []string) [][]byte {
219 formatted := make([][]byte, 0)

Callers

nothing calls this directly

Calls 2

formatInputsMethod · 0.95
shellExecInputMethod · 0.95

Tested by

no test coverage detected