Skip to content
Draft
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: 4 additions & 2 deletions core/cmd/jobs_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"strings"
"time"

"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/tw"
"github.com/pkg/errors"
"github.com/urfave/cli"

Expand Down Expand Up @@ -192,7 +194,7 @@ func (p JobPresenter) FriendlyCreatedAt() string {
// RenderTable implements TableRenderer
func (p *JobPresenter) RenderTable(rt RendererTable) error {
table := rt.newTable([]string{"ID", "Name", "Type", "Tasks", "Created At"})
table.SetAutoMergeCells(true)
table.Options(tablewriter.WithRowMergeMode(tw.MergeHorizontal))
for _, r := range p.ToRows() {
table.Append(r)
}
Expand All @@ -206,7 +208,7 @@ type JobPresenters []JobPresenter
// RenderTable implements TableRenderer
func (ps JobPresenters) RenderTable(rt RendererTable) error {
table := rt.newTable([]string{"ID", "Name", "Type", "Tasks", "Created At"})
table.SetAutoMergeCells(true)
table.Options(tablewriter.WithRowMergeMode(tw.MergeHorizontal))
for _, p := range ps {
for _, r := range p.ToRows() {
table.Append(r)
Expand Down
19 changes: 12 additions & 7 deletions core/cmd/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/tw"

"github.com/smartcontractkit/chainlink/v2/core/utils"
webpresenters "github.com/smartcontractkit/chainlink/v2/core/web/presenters"
Expand Down Expand Up @@ -99,13 +100,17 @@ func (rt RendererTable) renderVRFKeys(keys []VRFKeyPresenter) error {
}

func render(name string, table *tablewriter.Table) {
table.SetRowLine(true)
table.SetColumnSeparator("║")
table.SetRowSeparator("═")
table.SetCenterSeparator("╬")
table.Options(tablewriter.WithRendition(tw.Rendition{
Symbols: tw.NewSymbolCustom("custom").WithColumn("║").WithRow("═").WithCenter("╬"),
Settings: tw.Settings{
Separators: tw.Separators{BetweenRows: tw.On},
},
}))

fmt.Println("╔ " + name)
table.Render()
if err := table.Render(); err != nil {
fmt.Println(err)
}
}

func renderList(fields []string, items [][]string, writer io.Writer) {
Expand Down Expand Up @@ -156,8 +161,8 @@ func (rt RendererTable) renderExternalInitiatorAuthentication(eia webpresenters.
}

func (rt RendererTable) newTable(headers []string) *tablewriter.Table {
table := tablewriter.NewWriter(rt)
table.SetHeader(headers)
table := tablewriter.NewTable(rt)
table.Header(headers)
return table
}

Expand Down
17 changes: 11 additions & 6 deletions core/scripts/chaincli/handler/ocr2_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/tw"

"github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper"

Expand Down Expand Up @@ -126,10 +127,14 @@ func printConfigValues(config *confighelper.PublicConfig) {
data = append(data, []string{"TargetInRounds", strconv.Itoa(offConf.TargetInRounds)})
}

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Field", "Value"})
// table.SetFooter([]string{"", "", "Total", "$146.93"}) // Add Footer
table.SetBorder(false) // Set Border to false
table.AppendBulk(data) // Add Bulk Data
table.Render()
table := tablewriter.NewTable(os.Stdout, tablewriter.WithRendition(tw.Rendition{
Borders: tw.BorderNone,
}))
table.Header([]string{"Field", "Value"})
if err := table.Bulk(data); err != nil {
log.Printf("failed to add table rows: %s", err)
}
if err := table.Render(); err != nil {
log.Printf("failed to render table: %s", err)
}
}
17 changes: 11 additions & 6 deletions core/scripts/chaincli/handler/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
"github.com/olekukonko/tablewriter"
"github.com/olekukonko/tablewriter/tw"

ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

Expand Down Expand Up @@ -127,12 +128,16 @@ func OCR2AutomationReports(hdlr *baseHandler, txs []string) error {
return data[i][2] > data[j][2]
})

table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Hash", "ChainID", "Block", "Error", "From", "To", "Keys", "CheckBlocks"})
// table.SetFooter([]string{"", "", "Total", "$146.93"}) // Add Footer
table.SetBorder(false) // Set Border to false
table.AppendBulk(data) // Add Bulk Data
table.Render()
table := tablewriter.NewTable(os.Stdout, tablewriter.WithRendition(tw.Rendition{
Borders: tw.BorderNone,
}))
table.Header([]string{"Hash", "ChainID", "Block", "Error", "From", "To", "Keys", "CheckBlocks"})
if err := table.Bulk(data); err != nil {
return fmt.Errorf("failed to add table rows: %w", err)
}
if err := table.Render(); err != nil {
return fmt.Errorf("failed to render table: %w", err)
}

return nil
}
Expand Down
51 changes: 26 additions & 25 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ require (
github.com/moby/moby/client v0.4.1
github.com/montanaflynn/stats v0.7.1
github.com/olekukonko/tablewriter v1.0.9
github.com/pelletier/go-toml/v2 v2.3.1
github.com/pelletier/go-toml/v2 v2.4.3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.23.2
github.com/rs/zerolog v1.35.1
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.106
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260624154507-ea7ff77a0ddb
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260715230542-c08e039d74ca
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260715145851-8219609496a4
github.com/smartcontractkit/chainlink-common/keystore v1.2.1-0.20260623104656-f39eba3e2bc6
github.com/smartcontractkit/chainlink-data-streams v0.1.15-0.20260707105132-2da5d31f22fc
github.com/smartcontractkit/chainlink-deployments-framework v0.111.1-0.20260612191326-e31c0ae4cd54
github.com/smartcontractkit/chainlink-deployments-framework v0.116.1
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260715161014-611d8ac32364
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260713161920-de075095648b
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260623200841-e0322b819f62
Expand Down Expand Up @@ -80,7 +80,7 @@ require (
)

require (
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.31 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 // indirect
github.com/quic-go/qpack v0.6.0 // indirect
Expand Down Expand Up @@ -132,23 +132,24 @@ require (
github.com/avast/retry-go/v5 v5.0.0 // indirect
github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect
github.com/aws/aws-sdk-go v1.55.8 // indirect
github.com/aws/aws-sdk-go-v2 v1.42.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.24 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.23 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.29 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.29 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.29 // indirect
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.61.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.29 // indirect
github.com/aws/aws-sdk-go-v2 v1.42.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.28 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.27 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.30 // indirect
github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.62.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.30 // indirect
github.com/aws/aws-sdk-go-v2/service/kms v1.54.0 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.2 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.1.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.31.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.43.3 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.3.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.32.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.37.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.44.0 // indirect
github.com/aws/constructs-go/constructs/v10 v10.4.2 // indirect
github.com/aws/jsii-runtime-go v1.112.0 // indirect
github.com/aws/smithy-go v1.27.2 // indirect
github.com/aws/smithy-go v1.27.3 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/beevik/ntp v1.5.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
Expand Down Expand Up @@ -438,6 +439,8 @@ require (
github.com/oapi-codegen/runtime v1.4.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/oklog/run v1.2.0 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
Expand All @@ -462,6 +465,7 @@ require (
github.com/prometheus/common v1.20.99 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/prometheus/prometheus v0.311.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/cors v1.11.1 // indirect
Expand All @@ -480,7 +484,7 @@ require (
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/shirou/gopsutil/v4 v4.26.3 // indirect
github.com/shirou/gopsutil/v4 v4.26.5 // indirect
github.com/sigstore/sigstore v1.10.8 // indirect
github.com/sigstore/sigstore-go v1.2.0 // indirect
github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 // indirect
Expand All @@ -489,7 +493,7 @@ require (
github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260708114855-e953eeb028a7 // indirect
github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260714122420-7b2200a59a79 // indirect
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260625091148-e5618f5682ee // indirect
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260715230542-c08e039d74ca // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260624154507-ea7ff77a0ddb // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260624154507-ea7ff77a0ddb // indirect
github.com/smartcontractkit/chainlink-ccv v0.1.1-0.20260715132147-59df1b138100 // indirect
Expand All @@ -511,7 +515,6 @@ require (
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260709145319-7782fb89eb16 // indirect
github.com/smartcontractkit/chainlink-protos/orchestrator v0.11.0 // indirect
github.com/smartcontractkit/chainlink-protos/ring/go v0.0.0-20260331131315-f08a616d8dcd // indirect
github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect
github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 // indirect
github.com/smartcontractkit/chainlink-protos/svr v1.2.0 // indirect
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260630073003-fb8da7229930 // indirect
Expand All @@ -527,7 +530,7 @@ require (
github.com/smartcontractkit/cld-changesets v0.5.0 // indirect
github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad // indirect
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
github.com/smartcontractkit/mcms v0.47.2-0.20260611004209-3f43937dcffd // indirect
github.com/smartcontractkit/mcms v0.51.0 // indirect
github.com/smartcontractkit/smdkg v0.0.0-20251029093710-c38905e58aeb // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20260626090144-2343efd61516 // indirect
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20251120172354-e8ec0386b06c // indirect
Expand All @@ -544,7 +547,7 @@ require (
github.com/supranational/blst v0.3.16 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/testcontainers/testcontainers-go v0.42.0 // indirect
github.com/testcontainers/testcontainers-go v0.43.0 // indirect
github.com/testcontainers/testcontainers-go/modules/compose v0.42.0 // indirect
github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a // indirect
github.com/tidwall/match v1.2.0 // indirect
Expand Down Expand Up @@ -661,5 +664,3 @@ replace github.com/fbsobreira/gotron-sdk => github.com/smartcontractkit/chainlin
// docker/cli@v28.5.x still uses. docker/compose has not migrated to docker/cli v29
// yet, so we pin to v0.1.0 which has both the old aliases and the new compression API.
replace github.com/moby/go-archive v0.2.0 => github.com/moby/go-archive v0.1.0

replace github.com/olekukonko/tablewriter => github.com/olekukonko/tablewriter v0.0.5
Loading
Loading