Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/addressbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
Run: func(_ *cobra.Command, _ []string) {
cfg := config.Global()
table := table.New()
table.SetHeader([]string{"Name", "Address"})
table.Header("Name", "Address")

var output [][]string
for name, acc := range cfg.AddressBook.All {
Expand All @@ -44,8 +44,8 @@ var (
return output[i][0] < output[j][0]
})

table.AppendBulk(output)
table.Render()
cobra.CheckErr(table.Bulk(output))
cobra.CheckErr(table.Render())
},
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/network/governance/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var govListCmd = &cobra.Command{
cobra.CheckErr(err)

table := table.New()
table.SetHeader([]string{"ID", "Kind", "Submitter", "Created At", "Closes At", "State"})
table.Header("ID", "Kind", "Submitter", "Created At", "Closes At", "State")

proposals, err := conn.Consensus().Governance().Proposals(ctx, common.GetHeight())
if err != nil {
Expand Down Expand Up @@ -59,8 +59,8 @@ var govListCmd = &cobra.Command{
})
}

table.AppendBulk(output)
table.Render()
cobra.CheckErr(table.Bulk(output))
cobra.CheckErr(table.Render())
},
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/network/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var listCmd = &cobra.Command{
Run: func(_ *cobra.Command, _ []string) {
cfg := cliConfig.Global()
table := table.New()
table.SetHeader([]string{"Name", "Chain Context", "RPC"})
table.Header("Name", "Chain Context", "RPC")

var output [][]string
for name, net := range cfg.Networks.All {
Expand All @@ -39,7 +39,7 @@ var listCmd = &cobra.Command{
return output[i][0] < output[j][0]
})

table.AppendBulk(output)
table.Render()
cobra.CheckErr(table.Bulk(output))
cobra.CheckErr(table.Render())
},
}
6 changes: 3 additions & 3 deletions cmd/network/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ var showCmd = &cobra.Command{
continue
}
table := table.New()
table.SetHeader([]string{"Entity ID", "Node ID", "Role"})
table.Header("Entity ID", "Node ID", "Role")

runtimeID := runtime.ID
paratimeName := getParatimeName(cfg, runtimeID.String())
Expand Down Expand Up @@ -344,8 +344,8 @@ var showCmd = &cobra.Command{
})
}

table.AppendBulk(output)
table.Render()
cobra.CheckErr(table.Bulk(output))
cobra.CheckErr(table.Render())
fmt.Println()
}
return
Expand Down
6 changes: 3 additions & 3 deletions cmd/paratime/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var listCmd = &cobra.Command{
Run: func(_ *cobra.Command, _ []string) {
cfg := cliConfig.Global()
table := table.New()
table.SetHeader([]string{"Network", "Paratime", "ID", "Denomination(s)"})
table.Header("Network", "Paratime", "ID", "Denominations")

var output [][]string
for netName, net := range cfg.Networks.All {
Expand All @@ -50,8 +50,8 @@ var listCmd = &cobra.Command{
return output[i][1] < output[j][1]
})

table.AppendBulk(output)
table.Render()
cobra.CheckErr(table.Bulk(output))
cobra.CheckErr(table.Render())
},
}

Expand Down
44 changes: 38 additions & 6 deletions cmd/paratime/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"strconv"

"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/renderer"
"github.com/olekukonko/tablewriter/tw"
"github.com/spf13/cobra"

"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
Expand Down Expand Up @@ -489,12 +491,42 @@ func (s *runtimeStats) printStats() {

func (s *runtimeStats) printEntityStats() {
fmt.Println("\n=== ENTITY STATISTICS ===")
table := tablewriter.NewWriter(os.Stdout)
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
table.SetCenterSeparator("|")
table.SetHeader(s.entitiesHeader)
table.AppendBulk(s.entitiesOutput)
table.Render()

// Configure table with left/right borders, no top/bottom borders, and pipe separators.
rendition := tw.Rendition{
Borders: tw.Border{
Left: tw.On,
Right: tw.On,
Top: tw.Off,
Bottom: tw.Off,
},
Symbols: tw.NewSymbols(tw.StyleASCII),
Settings: tw.Settings{
Separators: tw.Separators{
BetweenColumns: tw.On,
},
},
}

table := tablewriter.NewTable(
os.Stdout,
tablewriter.WithRenderer(renderer.NewBlueprint(rendition)),
tablewriter.WithConfig(tablewriter.Config{
Row: tw.CellConfig{
Formatting: tw.CellFormatting{
AutoWrap: tw.WrapNormal,
},
},
}),
)
// Convert []string to []any for Header.
headerAny := make([]any, len(s.entitiesHeader))
for i, v := range s.entitiesHeader {
headerAny[i] = v
}
table.Header(headerAny...)
cobra.CheckErr(table.Bulk(s.entitiesOutput))
cobra.CheckErr(table.Render())
}

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/rofl/provider/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func outputJSON(ctx context.Context, npa *common.NPASelection, conn connection.C
// outputText returns providers in human-readable table format.
func outputText(ctx context.Context, npa *common.NPASelection, conn connection.Connection, providers []*roflmarket.Provider) {
table := table.New()
table.SetHeader([]string{"Provider Address", "Scheduler App", "Nodes", "Offers", "Instances"})
table.Header("Provider Address", "Scheduler App", "Nodes", "Offers", "Instances")

rows := make([][]string, 0, len(providers))
for _, provider := range providers {
Expand All @@ -120,8 +120,8 @@ func outputText(ctx context.Context, npa *common.NPASelection, conn connection.C
})
}

table.AppendBulk(rows)
table.Render()
cobra.CheckErr(table.Bulk(rows))
cobra.CheckErr(table.Render())

// If --show-offers is enabled, display offers for each provider.
if roflCommon.ShowOffers {
Expand Down
6 changes: 3 additions & 3 deletions cmd/wallet/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var listCmd = &cobra.Command{
Run: func(_ *cobra.Command, _ []string) {
cfg := config.Global()
table := table.New()
table.SetHeader([]string{"Account", "Kind", "Address"})
table.Header("Account", "Kind", "Address")

var output [][]string
for name, acc := range cfg.Wallet.All {
Expand All @@ -37,7 +37,7 @@ var listCmd = &cobra.Command{
return output[i][0] < output[j][0]
})

table.AppendBulk(output)
table.Render()
cobra.CheckErr(table.Bulk(output))
cobra.CheckErr(table.Render())
},
}
6 changes: 3 additions & 3 deletions examples/addressbook/03-list.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME ADDRESS
meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1
mike oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw
NAME ADDRESS
meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1
mike oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw
6 changes: 3 additions & 3 deletions examples/addressbook/07-list.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME ADDRESS
mark oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw
meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1
NAME ADDRESS
mark oasis1qrtrpg56l6y2cfudwtgfuxmq5e5cyhffcsfpdqvw
meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1
4 changes: 2 additions & 2 deletions examples/addressbook/10-list.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NAME ADDRESS
meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1
NAME ADDRESS
meghan 0xBe8B38ED9b0794e7ab9EbEfC1e710b4F4EC6F6C1
6 changes: 3 additions & 3 deletions examples/migration/network-chaincontext-and-rpcs.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME CHAIN CONTEXT RPC
mainnet bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
testnet (*) 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
testnet (*) 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
24 changes: 12 additions & 12 deletions examples/network-governance/list.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ID KIND SUBMITTER CREATED AT CLOSES AT STATE
1 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 5633 5645 passed
2 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 7525 7537 passed
3 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 8817 8829 passed
4 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14183 14195 passed
5 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14869 14881 passed
6 cancel upgrade 5 oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14895 14907 passed
7 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14982 14994 passed
8 upgrade oasis1qpwaggvmhwq5uk40clase3knt655nn2tdy39nz2f 29493 29505 passed
9 change parameters (governance) oasis1qrx85mv85k708ylww597rd42enlzhdmeu56wqj72 30693 30705 passed
10 change parameters (staking) oasis1qqxxut9x74dutu587f9nj8787qz4dm0ueu05l88c 33059 33071 passed
11 upgrade oasis1qqxxut9x74dutu587f9nj8787qz4dm0ueu05l88c 35915 35927 passed
ID KIND SUBMITTER CREATED AT CLOSES AT STATE
1 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 5633 5645 passed
2 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 7525 7537 passed
3 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 8817 8829 passed
4 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14183 14195 passed
5 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14869 14881 passed
6 cancel upgrade 5 oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14895 14907 passed
7 upgrade oasis1qrs2dl6nz6fcxxr3tq37laxlz6hxk6kuscnr6rxj 14982 14994 passed
8 upgrade oasis1qpwaggvmhwq5uk40clase3knt655nn2tdy39nz2f 29493 29505 passed
9 change parameters (governance) oasis1qrx85mv85k708ylww597rd42enlzhdmeu56wqj72 30693 30705 passed
10 change parameters (staking) oasis1qqxxut9x74dutu587f9nj8787qz4dm0ueu05l88c 33059 33071 passed
11 upgrade oasis1qqxxut9x74dutu587f9nj8787qz4dm0ueu05l88c 35915 35927 passed
10 changes: 5 additions & 5 deletions examples/network-set-rpc/00-list.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
testnet_alt 50304f98ddb656620ea817cc1446c401752a05a249b36c9b90dba4616829977a testnet2.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
testnet_alt 50304f98ddb656620ea817cc1446c401752a05a249b36c9b90dba4616829977a testnet2.grpc.oasis.io:443
10 changes: 5 additions & 5 deletions examples/network-set-rpc/02-list.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
testnet_alt 50304f98ddb656620ea817cc1446c401752a05a249b36c9b90dba4616829977a testnet3.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
testnet_alt 50304f98ddb656620ea817cc1446c401752a05a249b36c9b90dba4616829977a testnet3.grpc.oasis.io:443
10 changes: 5 additions & 5 deletions examples/network/00-list.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
testnet_alt 50304f98ddb656620ea817cc1446c401752a05a249b36c9b90dba4616829977a testnet2.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
testnet_alt 50304f98ddb656620ea817cc1446c401752a05a249b36c9b90dba4616829977a testnet2.grpc.oasis.io:443
8 changes: 4 additions & 4 deletions examples/network/02-list.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet (*) bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
8 changes: 4 additions & 4 deletions examples/network/04-list.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME CHAIN CONTEXT RPC
mainnet bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local (*) b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local (*) b11b369e0da5bb230b220127f5e7b242d385ef8c6f54906243f30af63c815535 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
8 changes: 4 additions & 4 deletions examples/network/06-list.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME CHAIN CONTEXT RPC
mainnet bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local (*) 01234513331133a715c7a150313877dF1d33e77a715c7a150313877dF1d33e77 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
NAME CHAIN CONTEXT RPC
mainnet bb3d748def55bdfb797a2ac53ee6ee141e54cd2ab2dc2375f4a0703a178e6e55 grpc.oasis.io:443
mainnet_local (*) 01234513331133a715c7a150313877dF1d33e77a715c7a150313877dF1d33e77 unix:/node/data/internal.sock
testnet 0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76 testnet.grpc.oasis.io:443
24 changes: 12 additions & 12 deletions examples/paratime-remove/00-list.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
NETWORK PARATIME ID DENOMINATION(S)
mainnet cipher 000000000000000000000000000000000000000000000000e199119c992377cb ROSE[9] (*)
mainnet emerald (*) 000000000000000000000000000000000000000000000000e2eaa99fc008f87f ROSE[18] (*)
mainnet sapphire 000000000000000000000000000000000000000000000000f80306c9858e7279 ROSE[18] (*)
testnet cipher 0000000000000000000000000000000000000000000000000000000000000000 TEST[9] (*)
testnet emerald (*) 00000000000000000000000000000000000000000000000072c8215e60d5bca7 TEST[18] (*)
testnet pontusx_dev 0000000000000000000000000000000000000000000000004febe52eb412b421 EUROe[18] (*)
TEST[18]
testnet pontusx_test 00000000000000000000000000000000000000000000000004a6f9071c007069 EUROe[18] (*)
TEST[18]
testnet sapphire 000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c TEST[18] (*)
testnet sapphire2 000000000000000000000000000000000000000000000000a6d1e3ebf60dff6d TEST[18] (*)
NETWORK PARATIME ID DENOMINATIONS
mainnet cipher 000000000000000000000000000000000000000000000000e199119c992377cb ROSE[9] (*)
mainnet emerald (*) 000000000000000000000000000000000000000000000000e2eaa99fc008f87f ROSE[18] (*)
mainnet sapphire 000000000000000000000000000000000000000000000000f80306c9858e7279 ROSE[18] (*)
testnet cipher 0000000000000000000000000000000000000000000000000000000000000000 TEST[9] (*)
testnet emerald (*) 00000000000000000000000000000000000000000000000072c8215e60d5bca7 TEST[18] (*)
testnet pontusx_dev 0000000000000000000000000000000000000000000000004febe52eb412b421 EUROe[18] (*)
TEST[18]
testnet pontusx_test 00000000000000000000000000000000000000000000000004a6f9071c007069 EUROe[18] (*)
TEST[18]
testnet sapphire 000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c TEST[18] (*)
testnet sapphire2 000000000000000000000000000000000000000000000000a6d1e3ebf60dff6d TEST[18] (*)
Loading
Loading