From 4d81d790b6bc8926ecb38223d17636ee8546e102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Fri, 15 Nov 2024 12:36:32 +0100 Subject: [PATCH] feat: oasis paratime show parameters Similar to oasis network show parameters. Prints ROFL staking thresholds for now. --- cmd/common/json.go | 37 ++ cmd/network/show.go | 26 +- cmd/paratime/show.go | 452 ++++++++++++--------- docs/paratime.md | 18 +- examples/paratime-show/config/cli.toml | 119 ++++++ examples/paratime-show/show-parameters.in | 1 + examples/paratime-show/show-parameters.out | 7 + 7 files changed, 450 insertions(+), 210 deletions(-) create mode 100644 examples/paratime-show/config/cli.toml create mode 100644 examples/paratime-show/show-parameters.in create mode 100644 examples/paratime-show/show-parameters.out diff --git a/cmd/common/json.go b/cmd/common/json.go index afe25c03..9aa14ef9 100644 --- a/cmd/common/json.go +++ b/cmd/common/json.go @@ -98,3 +98,40 @@ func JSONMarshalUniversalValue(v interface{}) []byte { cobra.CheckErr(err) return vJSON } + +// PrettifyFromJSON takes a JSON-compatible interface and returns a simplified string representation +// by removing JSON syntax elements (braces, brackets, quotes, commas) and cleaning up whitespace. +// The output is a clean, line-by-line representation of the data where each non-empty line is +// trimmed of trailing whitespace. +// +// Example: +// +// input := map[string]interface{}{"name": "Alice", "data": {"age": 30}} +// output := PrettifyFromJSON(input) +// // Output will be: +// // name: Alice +// // data: +// // age: 30 +func PrettifyFromJSON(blob interface{}) string { + pp, err := json.MarshalIndent(blob, "", " ") + cobra.CheckErr(err) + + out := string(pp) + out = strings.ReplaceAll(out, "{", "") + out = strings.ReplaceAll(out, "}", "") + out = strings.ReplaceAll(out, "[", "") + out = strings.ReplaceAll(out, "]", "") + out = strings.ReplaceAll(out, ",", "") + out = strings.ReplaceAll(out, "\"", "") + + ret := "" + for _, line := range strings.Split(out, "\n") { + line = strings.TrimRight(line, " \n") + if len(line) == 0 { + continue + } + ret += line + "\n" + } + + return ret +} diff --git a/cmd/network/show.go b/cmd/network/show.go index eb8dad15..544b26a2 100644 --- a/cmd/network/show.go +++ b/cmd/network/show.go @@ -390,30 +390,6 @@ func showNativeToken(ctx context.Context, height int64, npa *common.NPASelection } } -func PrettifyFromJSON(blob interface{}) string { - pp, err := json.MarshalIndent(blob, "", " ") - cobra.CheckErr(err) - - out := string(pp) - out = strings.ReplaceAll(out, "{", "") - out = strings.ReplaceAll(out, "}", "") - out = strings.ReplaceAll(out, "[", "") - out = strings.ReplaceAll(out, "]", "") - out = strings.ReplaceAll(out, ",", "") - out = strings.ReplaceAll(out, "\"", "") - - ret := "" - for _, line := range strings.Split(out, "\n") { - line = strings.TrimRight(line, " \n") - if len(line) == 0 { - continue - } - ret += line + "\n" - } - - return ret -} - func showParameters(ctx context.Context, height int64, cons consensus.ClientBackend) { checkErr := func(what string, err error) { if err != nil { @@ -456,7 +432,7 @@ func showParameters(ctx context.Context, height int64, cons consensus.ClientBack doc[name] = params } else { fmt.Printf("=== %s PARAMETERS ===\n", strings.ToUpper(name)) - out := PrettifyFromJSON(params) + out := common.PrettifyFromJSON(params) fmt.Printf("%s\n", out) } } diff --git a/cmd/paratime/show.go b/cmd/paratime/show.go index 5bc07c70..73f88aa0 100644 --- a/cmd/paratime/show.go +++ b/cmd/paratime/show.go @@ -11,6 +11,7 @@ import ( ethTypes "github.com/ethereum/go-ethereum/core/types" "github.com/spf13/cobra" + flag "github.com/spf13/pflag" "github.com/oasisprotocol/oasis-core/go/common/cbor" "github.com/oasisprotocol/oasis-core/go/common/crypto/hash" @@ -23,229 +24,275 @@ import ( cliConfig "github.com/oasisprotocol/cli/config" ) +type propertySelector int + const ( - blockLatest = "latest" + selRoundLatest = "latest" + formatText = "text" + formatJSON = "json" ) -var showCmd = &cobra.Command{ - Use: "show [ | ]", - Short: "Show information about a block and its transactions", - Long: "Show information about a given block number and (optionally) its transactions. Use \"latest\" to use the last block.", - Aliases: []string{"s"}, - Args: cobra.RangeArgs(1, 2), - Run: func(cmd *cobra.Command, args []string) { - cfg := cliConfig.Global() - npa := common.GetNPASelection(cfg) - - var ( - err error - blkNum uint64 - txIndex int - txHash hash.Hash - ) - switch blkNumRaw := args[0]; blkNumRaw { - case blockLatest: - // The latest block. - blkNum = client.RoundLatest // TODO: Support consensus. - default: - // A specific block. - blkNum, err = strconv.ParseUint(blkNumRaw, 10, 64) - if err != nil { - cobra.CheckErr(fmt.Errorf("malformed block number: %w", err)) - } - } - - if len(args) >= 2 { - txIndexOrHash := args[1] +const ( + selInvalid propertySelector = iota + selParameters +) - txIndex, err = strconv.Atoi(txIndexOrHash) - if err != nil { - txIndex = -1 - if err = txHash.UnmarshalHex(txIndexOrHash); err != nil { - cobra.CheckErr(fmt.Errorf("malformed tx hash: %w", err)) - } +var ( + outputFormat string + selectedRound uint64 + + showCmd = &cobra.Command{ + Use: "show { [ | ] | parameters }", + Short: "Show information about a ParaTime block, its transactions or other parameters", + Long: "Show ParaTime-specific information about a given block round, (optionally) its transactions or other information. Use \"latest\" to use the last round.", + Aliases: []string{"s"}, + Args: cobra.RangeArgs(1, 2), + Run: func(cmd *cobra.Command, args []string) { + cfg := cliConfig.Global() + npa := common.GetNPASelection(cfg) + + if npa.ParaTime == nil { + cobra.CheckErr("no ParaTimes to investigate") } - } - // Establish connection with the target network. - ctx := context.Background() - conn, err := connection.Connect(ctx, npa.Network) - cobra.CheckErr(err) + p, err := parseBlockNum(npa, args[0]) + cobra.CheckErr(err) - fmt.Printf("Network: %s", npa.NetworkName) - if len(npa.Network.Description) > 0 { - fmt.Printf(" (%s)", npa.Network.Description) - } - fmt.Println() + var ( + // err error + // blkNum uint64 + txIndex int + txHash hash.Hash + ) - switch npa.ParaTime { - case nil: - // Consensus layer. - cobra.CheckErr("inspecting consensus layer blocks not yet supported") // TODO - default: - // Runtime layer. - rt := conn.Runtime(npa.ParaTime) + if len(args) >= 2 { + txIndexOrHash := args[1] - evDecoders := []client.EventDecoder{ - rt.Accounts, - rt.ConsensusAccounts, - rt.Contracts, - rt.Evm, + txIndex, err = strconv.Atoi(txIndexOrHash) + if err != nil { + txIndex = -1 + if err = txHash.UnmarshalHex(txIndexOrHash); err != nil { + cobra.CheckErr(fmt.Errorf("malformed tx hash: %w", err)) + } + } } - blk, err := rt.GetBlock(ctx, blkNum) + // Establish connection with the target network. + ctx := context.Background() + conn, err := connection.Connect(ctx, npa.Network) cobra.CheckErr(err) - fmt.Printf("ParaTime: %s", npa.ParaTimeName) - if len(npa.ParaTime.Description) > 0 { - fmt.Printf(" (%s)", npa.ParaTime.Description) + if outputFormat == formatText { + fmt.Printf("Network: %s", npa.NetworkName) + if len(npa.Network.Description) > 0 { + fmt.Printf(" (%s)", npa.Network.Description) + } + fmt.Println() + fmt.Printf("ParaTime: %s", npa.ParaTimeName) + if len(npa.ParaTime.Description) > 0 { + fmt.Printf(" (%s)", npa.ParaTime.Description) + } + fmt.Println() } - fmt.Println() - fmt.Printf("Round: %d\n", blk.Header.Round) - fmt.Printf("Version: %d\n", blk.Header.Version) - fmt.Printf("Namespace: %s\n", blk.Header.Namespace) - - // TODO: Fix when timestamp has a String method. - ts, _ := blk.Header.Timestamp.MarshalText() - fmt.Printf("Timestamp: %s\n", string(ts)) - - // TODO: Fix when type has a String method. - fmt.Printf("Type: %d\n", blk.Header.HeaderType) - fmt.Printf("Previous: %s\n", blk.Header.PreviousHash) - fmt.Printf("I/O root: %s\n", blk.Header.IORoot) - fmt.Printf("State root: %s\n", blk.Header.StateRoot) - fmt.Printf("Messages (out): %s\n", blk.Header.MessagesHash) - fmt.Printf("Messages (in): %s\n", blk.Header.InMessagesHash) - - txs, err := rt.GetTransactionsWithResults(ctx, blk.Header.Round) - cobra.CheckErr(err) - fmt.Printf("Transactions: %d\n", len(txs)) + // Runtime layer. + rt := conn.Runtime(npa.ParaTime) - evs, err := rt.GetEventsRaw(ctx, blkNum) - cobra.CheckErr(err) - if len(evs) > 0 { - // Check if there were any block events emitted. - var blockEvs []*types.Event - for _, ev := range evs { - if ev.TxHash.Equal(&runtimeTx.TagBlockTxHash) { - blockEvs = append(blockEvs, ev) - } + switch v := p.(type) { + case uint64: + blkNum := v + evDecoders := []client.EventDecoder{ + rt.Accounts, + rt.ConsensusAccounts, + rt.Contracts, + rt.Evm, } - if numEvents := len(blockEvs); numEvents > 0 { - fmt.Printf("=== Block events ===\n") - fmt.Printf("Events: %d\n", numEvents) - fmt.Println() - - for evIndex, ev := range blockEvs { - prettyPrintEvent(" ", evIndex, ev, evDecoders) - fmt.Println() + blk, err := rt.GetBlock(ctx, blkNum) + cobra.CheckErr(err) + + fmt.Printf("Round: %d\n", blk.Header.Round) + fmt.Printf("Version: %d\n", blk.Header.Version) + fmt.Printf("Namespace: %s\n", blk.Header.Namespace) + + // TODO: Fix when timestamp has a String method. + ts, _ := blk.Header.Timestamp.MarshalText() + fmt.Printf("Timestamp: %s\n", string(ts)) + + // TODO: Fix when type has a String method. + fmt.Printf("Type: %d\n", blk.Header.HeaderType) + fmt.Printf("Previous: %s\n", blk.Header.PreviousHash) + fmt.Printf("I/O root: %s\n", blk.Header.IORoot) + fmt.Printf("State root: %s\n", blk.Header.StateRoot) + fmt.Printf("Messages (out): %s\n", blk.Header.MessagesHash) + fmt.Printf("Messages (in): %s\n", blk.Header.InMessagesHash) + + txs, err := rt.GetTransactionsWithResults(ctx, blk.Header.Round) + cobra.CheckErr(err) + + fmt.Printf("Transactions: %d\n", len(txs)) + + evs, err := rt.GetEventsRaw(ctx, blkNum) + cobra.CheckErr(err) + if len(evs) > 0 { + // Check if there were any block events emitted. + var blockEvs []*types.Event + for _, ev := range evs { + if ev.TxHash.Equal(&runtimeTx.TagBlockTxHash) { + blockEvs = append(blockEvs, ev) + } } - } - } - if len(args) >= 2 { - fmt.Println() + if numEvents := len(blockEvs); numEvents > 0 { + fmt.Printf("=== Block events ===\n") + fmt.Printf("Events: %d\n", numEvents) + fmt.Println() - // Resolve transaction index if needed. - if txIndex == -1 { - for i, tx := range txs { - if h := tx.Tx.Hash(); h.Equal(&txHash) { - txIndex = i - break + for evIndex, ev := range blockEvs { + prettyPrintEvent(" ", evIndex, ev, evDecoders) + fmt.Println() } } - - if txIndex == -1 { - cobra.CheckErr(fmt.Errorf("failed to find transaction with hash %s", txHash)) - } } - if txIndex >= len(txs) { - cobra.CheckErr(fmt.Errorf("transaction index %d is out of range", txIndex)) - } - tx := txs[txIndex] - - fmt.Printf("=== Transaction %d ===\n", txIndex) - - if len(tx.Tx.AuthProofs) == 1 && tx.Tx.AuthProofs[0].Module != "" { - // Module-specific transaction encoding scheme. - scheme := tx.Tx.AuthProofs[0].Module + if len(args) >= 2 { + fmt.Println() - switch scheme { - case "evm.ethereum.v0": - // Ethereum transaction encoding. - var ethTx ethTypes.Transaction - if err := ethTx.UnmarshalBinary(tx.Tx.Body); err != nil { - fmt.Printf("[malformed 'evm.ethereum.v0' transaction: %s]\n", err) - break + // Resolve transaction index if needed. + if txIndex == -1 { + for i, tx := range txs { + if h := tx.Tx.Hash(); h.Equal(&txHash) { + txIndex = i + break + } } - fmt.Printf("Kind: evm.ethereum.v0\n") - fmt.Printf("Hash: %s\n", tx.Tx.Hash()) - fmt.Printf("Eth hash: %s\n", ethTx.Hash()) - fmt.Printf("Chain ID: %s\n", ethTx.ChainId()) - fmt.Printf("Nonce: %d\n", ethTx.Nonce()) - fmt.Printf("Type: %d\n", ethTx.Type()) - fmt.Printf("To: %s\n", ethTx.To()) - fmt.Printf("Value: %s\n", ethTx.Value()) - fmt.Printf("Gas limit: %d\n", ethTx.Gas()) - fmt.Printf("Gas price: %s\n", ethTx.GasPrice()) - fmt.Printf("Data:\n") - if len(ethTx.Data()) > 0 { - fmt.Printf(" %s\n", hex.EncodeToString(ethTx.Data())) - } else { - fmt.Printf(" (none)\n") + if txIndex == -1 { + cobra.CheckErr(fmt.Errorf("failed to find transaction with hash %s", txHash)) } - default: - fmt.Printf("[module-specific transaction encoding scheme: %s]\n", scheme) } - } else { - // Regular SDK transaction. - fmt.Printf("Kind: oasis\n") - common.PrintTransactionRaw(npa, &tx.Tx) - } - fmt.Println() + if txIndex >= len(txs) { + cobra.CheckErr(fmt.Errorf("transaction index %d is out of range", txIndex)) + } + tx := txs[txIndex] + + fmt.Printf("=== Transaction %d ===\n", txIndex) + + if len(tx.Tx.AuthProofs) == 1 && tx.Tx.AuthProofs[0].Module != "" { + // Module-specific transaction encoding scheme. + scheme := tx.Tx.AuthProofs[0].Module + + switch scheme { + case "evm.ethereum.v0": + // Ethereum transaction encoding. + var ethTx ethTypes.Transaction + if err := ethTx.UnmarshalBinary(tx.Tx.Body); err != nil { + fmt.Printf("[malformed 'evm.ethereum.v0' transaction: %s]\n", err) + break + } + + fmt.Printf("Kind: evm.ethereum.v0\n") + fmt.Printf("Hash: %s\n", tx.Tx.Hash()) + fmt.Printf("Eth hash: %s\n", ethTx.Hash()) + fmt.Printf("Chain ID: %s\n", ethTx.ChainId()) + fmt.Printf("Nonce: %d\n", ethTx.Nonce()) + fmt.Printf("Type: %d\n", ethTx.Type()) + fmt.Printf("To: %s\n", ethTx.To()) + fmt.Printf("Value: %s\n", ethTx.Value()) + fmt.Printf("Gas limit: %d\n", ethTx.Gas()) + fmt.Printf("Gas price: %s\n", ethTx.GasPrice()) + fmt.Printf("Data:\n") + if len(ethTx.Data()) > 0 { + fmt.Printf(" %s\n", hex.EncodeToString(ethTx.Data())) + } else { + fmt.Printf(" (none)\n") + } + default: + fmt.Printf("[module-specific transaction encoding scheme: %s]\n", scheme) + } + } else { + // Regular SDK transaction. + fmt.Printf("Kind: oasis\n") - // Show result. - fmt.Printf("=== Result of transaction %d ===\n", txIndex) - switch res := tx.Result; { - case res.Failed != nil: - fmt.Printf("Status: failed\n") - fmt.Printf("Module: %s\n", res.Failed.Module) - fmt.Printf("Code: %d\n", res.Failed.Code) - fmt.Printf("Message: %s\n", res.Failed.Message) - case res.Ok != nil: - fmt.Printf("Status: ok\n") - fmt.Printf("Data:\n") - prettyPrintCBOR(" ", "result", res.Ok) - case res.Unknown != nil: - fmt.Printf("Status: unknown\n") - fmt.Printf("Data:\n") - prettyPrintCBOR(" ", "result", res.Unknown) - default: - fmt.Printf("[unsupported result kind]\n") - } - fmt.Println() + common.PrintTransactionRaw(npa, &tx.Tx) + } + fmt.Println() - // Show events. - fmt.Printf("=== Events emitted by transaction %d ===\n", txIndex) - if numEvents := len(tx.Events); numEvents > 0 { - fmt.Printf("Events: %d\n", numEvents) + // Show result. + fmt.Printf("=== Result of transaction %d ===\n", txIndex) + switch res := tx.Result; { + case res.Failed != nil: + fmt.Printf("Status: failed\n") + fmt.Printf("Module: %s\n", res.Failed.Module) + fmt.Printf("Code: %d\n", res.Failed.Code) + fmt.Printf("Message: %s\n", res.Failed.Message) + case res.Ok != nil: + fmt.Printf("Status: ok\n") + fmt.Printf("Data:\n") + prettyPrintCBOR(" ", "result", res.Ok) + case res.Unknown != nil: + fmt.Printf("Status: unknown\n") + fmt.Printf("Data:\n") + prettyPrintCBOR(" ", "result", res.Unknown) + default: + fmt.Printf("[unsupported result kind]\n") + } fmt.Println() - for evIndex, ev := range tx.Events { - prettyPrintEvent(" ", evIndex, ev, evDecoders) + // Show events. + fmt.Printf("=== Events emitted by transaction %d ===\n", txIndex) + if numEvents := len(tx.Events); numEvents > 0 { + fmt.Printf("Events: %d\n", numEvents) fmt.Println() + + for evIndex, ev := range tx.Events { + prettyPrintEvent(" ", evIndex, ev, evDecoders) + fmt.Println() + } + } else { + fmt.Println("No events emitted by this transaction.") } - } else { - fmt.Println("No events emitted by this transaction.") + } + case propertySelector: + switch v { + case selParameters: + showParameters(ctx, selectedRound, rt) + return } } + }, + } +) + +func parseBlockNum( + npa *common.NPASelection, + s string, +) (interface{}, error) { // TODO: Use `any` + if sel := selectorFromString(s); sel != selInvalid { + return sel, nil + } + + switch blkNumRaw := s; blkNumRaw { + case selRoundLatest: + // The latest block. + return client.RoundLatest, nil // TODO: Support consensus. + default: + // A specific block. + blkNum, err := strconv.ParseUint(blkNumRaw, 10, 64) + if err != nil { + return nil, fmt.Errorf("malformed block number: %w", err) } - }, + return blkNum, nil + } +} + +func selectorFromString(s string) propertySelector { + switch strings.ToLower(strings.TrimSpace(s)) { + case "parameters": + return selParameters + } + return selInvalid } func prettyPrintCBOR(indent string, kind string, data []byte) { @@ -385,6 +432,45 @@ func prettyPrintEvent(indent string, evIndex int, ev *types.Event, decoders []cl prettyPrintCBOR(indent+" ", "event", ev.Value) } +func showParameters(ctx context.Context, round uint64, rt connection.RuntimeClient) { + checkErr := func(what string, err error) { + if err != nil { + cobra.CheckErr(fmt.Errorf("%s: %w", what, err)) + } + } + + stakeThresholds, err := rt.ROFL.StakeThresholds(ctx, round) + checkErr("ROFL StakeThresholds", err) + + doc := make(map[string]interface{}) + + doSection := func(name string, params interface{}) { + if outputFormat == formatJSON { + doc[name] = params + } else { + fmt.Printf("=== %s PARAMETERS ===\n", strings.ToUpper(name)) + out := common.PrettifyFromJSON(params) + fmt.Printf("%s\n", out) + } + } + + doSection("rofl_stakethresholds", stakeThresholds) + + if outputFormat == formatJSON { + pp, err := json.MarshalIndent(doc, "", " ") + cobra.CheckErr(err) + fmt.Printf("%s\n", pp) + } +} + func init() { + formatFlag := flag.NewFlagSet("", flag.ContinueOnError) + formatFlag.StringVar(&outputFormat, "format", formatText, "output format ["+strings.Join([]string{formatText, formatJSON}, ",")+"]") + + roundFlag := flag.NewFlagSet("", flag.ContinueOnError) + roundFlag.Uint64Var(&selectedRound, "round", client.RoundLatest, "explicitly set block round to use") + showCmd.Flags().AddFlagSet(common.SelectorNPFlags) + showCmd.Flags().AddFlagSet(roundFlag) + showCmd.Flags().AddFlagSet(formatFlag) } diff --git a/docs/paratime.md b/docs/paratime.md index a7aca4bc..955a0359 100644 --- a/docs/paratime.md +++ b/docs/paratime.md @@ -125,8 +125,13 @@ For example, to set the Cipher ParaTime default on the Testnet, run: ## Show {#show} -Use `paratime show ` providing the block round to print its header and -other information. +Use `paratime show` to investigate a specific ParaTime block or other +parameters. + +### ` [ | ]` + +Providing the block round or `latest` literal will print its header and other +information. ![code shell](../examples/paratime-show/show.in.static) @@ -147,6 +152,15 @@ encrypted: ![code](../examples/paratime-show/show-tx-encrypted.out.static) +### `parameters` + +This will print various ParaTime-specific parameters such as the ROFL stake +thresholds. + +![code shell](../examples/paratime-show/show-parameters.in) + +![code](../examples/paratime-show/show-parameters.out) + ## Set information about a denomination {#denom-set} To set information about a denomination on the specific network and paratime use diff --git a/examples/paratime-show/config/cli.toml b/examples/paratime-show/config/cli.toml new file mode 100644 index 00000000..5c7f6efe --- /dev/null +++ b/examples/paratime-show/config/cli.toml @@ -0,0 +1,119 @@ +last_migration = 1 + +[networks] +default = 'testnet' + +[networks.mainnet] +chain_context = 'bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55' +description = '' +rpc = 'grpc.oasis.io:443' + +[networks.mainnet.denomination] +decimals = 9 +symbol = 'ROSE' + +[networks.mainnet.paratimes] +default = 'sapphire' + +[networks.mainnet.paratimes.cipher] +consensus_denomination = '_' +description = '' +id = '000000000000000000000000000000000000000000000000e199119c992377cb' + +[networks.mainnet.paratimes.cipher.denominations] +[networks.mainnet.paratimes.cipher.denominations._] +decimals = 9 +symbol = 'ROSE' + +[networks.mainnet.paratimes.emerald] +consensus_denomination = '_' +description = '' +id = '000000000000000000000000000000000000000000000000e2eaa99fc008f87f' + +[networks.mainnet.paratimes.emerald.denominations] +[networks.mainnet.paratimes.emerald.denominations._] +decimals = 18 +symbol = 'ROSE' + +[networks.mainnet.paratimes.sapphire] +consensus_denomination = '_' +description = '' +id = '000000000000000000000000000000000000000000000000f80306c9858e7279' + +[networks.mainnet.paratimes.sapphire.denominations] +[networks.mainnet.paratimes.sapphire.denominations._] +decimals = 18 +symbol = 'ROSE' + +[networks.testnet] +chain_context = '0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76' +description = '' +rpc = 'testnet.grpc.oasis.io:443' + +[networks.testnet.denomination] +decimals = 9 +symbol = 'TEST' + +[networks.testnet.paratimes] +default = 'sapphire' + +[networks.testnet.paratimes.cipher] +consensus_denomination = '_' +description = '' +id = '0000000000000000000000000000000000000000000000000000000000000000' + +[networks.testnet.paratimes.cipher.denominations] +[networks.testnet.paratimes.cipher.denominations._] +decimals = 9 +symbol = 'TEST' + +[networks.testnet.paratimes.emerald] +consensus_denomination = '_' +description = '' +id = '00000000000000000000000000000000000000000000000072c8215e60d5bca7' + +[networks.testnet.paratimes.emerald.denominations] +[networks.testnet.paratimes.emerald.denominations._] +decimals = 18 +symbol = 'TEST' + +[networks.testnet.paratimes.pontusx_dev] +consensus_denomination = 'TEST' +description = 'Pontus-X Devnet' +id = '0000000000000000000000000000000000000000000000004febe52eb412b421' + +[networks.testnet.paratimes.pontusx_dev.denominations] +[networks.testnet.paratimes.pontusx_dev.denominations._] +decimals = 18 +symbol = 'EUROe' + +[networks.testnet.paratimes.pontusx_dev.denominations.test] +decimals = 18 +symbol = 'TEST' + +[networks.testnet.paratimes.pontusx_test] +consensus_denomination = 'TEST' +description = 'Pontus-X Testnet' +id = '00000000000000000000000000000000000000000000000004a6f9071c007069' + +[networks.testnet.paratimes.pontusx_test.denominations] +[networks.testnet.paratimes.pontusx_test.denominations._] +decimals = 18 +symbol = 'EUROe' + +[networks.testnet.paratimes.pontusx_test.denominations.test] +decimals = 18 +symbol = 'TEST' + +[networks.testnet.paratimes.sapphire] +consensus_denomination = '_' +description = '' +id = '000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c' + +[networks.testnet.paratimes.sapphire.denominations] +[networks.testnet.paratimes.sapphire.denominations._] +decimals = 18 +symbol = 'TEST' + +[wallets] +default = '' diff --git a/examples/paratime-show/show-parameters.in b/examples/paratime-show/show-parameters.in new file mode 100644 index 00000000..dbb190bb --- /dev/null +++ b/examples/paratime-show/show-parameters.in @@ -0,0 +1 @@ +oasis paratime show parameters diff --git a/examples/paratime-show/show-parameters.out b/examples/paratime-show/show-parameters.out new file mode 100644 index 00000000..9ad5a7e2 --- /dev/null +++ b/examples/paratime-show/show-parameters.out @@ -0,0 +1,7 @@ +Network: testnet +ParaTime: sapphire +=== ROFL_STAKETHRESHOLDS PARAMETERS === + app_create: + Amount: 10000000000000000000000 + Denomination: +