Skip to content

Commit ed7a786

Browse files
committed
temp/logging for tron iamge
1 parent b6935c5 commit ed7a786

File tree

1 file changed

+29
-0
lines changed
  • framework/components/blockchain

1 file changed

+29
-0
lines changed

framework/components/blockchain/tron.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,26 @@ func defaultTron(in *Input) {
5757

5858
func newTron(in *Input) (*Output, error) {
5959
defaultTron(in)
60+
framework.L.Debug().
61+
Str("image", in.Image).
62+
Str("type", in.Type).
63+
Str("port", in.Port).
64+
Bool("pull_image", in.PullImage).
65+
Msg("Starting TRON blockchain node setup")
66+
6067
ctx := context.Background()
6168

6269
containerName := framework.DefaultTCName("blockchain-node")
6370
// Tron container always listens on port 9090 internally
6471
containerPort := fmt.Sprintf("%s/tcp", DefaultTronPort)
6572

73+
framework.L.Debug().
74+
Str("container_name", containerName).
75+
Str("container_port", containerPort).
76+
Str("host_port", in.Port).
77+
Msg("TRON container configuration prepared")
78+
79+
framework.L.Debug().Msg("Creating temporary accounts.json file for TRON")
6680
accounts, err := os.CreateTemp("", "accounts.json")
6781
if err != nil {
6882
return nil, err
@@ -76,6 +90,10 @@ func newTron(in *Input) (*Output, error) {
7690
if err != nil {
7791
return nil, err
7892
}
93+
framework.L.Debug().
94+
Str("accounts_file", accounts.Name()).
95+
Int("private_keys_count", len(TRONAccounts.PrivateKeys)).
96+
Msg("TRON accounts file created successfully")
7997

8098
req := testcontainers.ContainerRequest{
8199
AlwaysPullImage: in.PullImage,
@@ -109,6 +127,11 @@ func newTron(in *Input) (*Output, error) {
109127
},
110128
}
111129

130+
framework.L.Debug().
131+
Str("image", in.Image).
132+
Str("network", framework.DefaultNetworkName).
133+
Msg("Starting TRON container")
134+
112135
c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
113136
ContainerRequest: req,
114137
Started: true,
@@ -121,6 +144,12 @@ func newTron(in *Input) (*Output, error) {
121144
if err != nil {
122145
return nil, err
123146
}
147+
148+
framework.L.Debug().
149+
Str("host", host).
150+
Str("external_url", fmt.Sprintf("http://%s:%s", host, in.Port)).
151+
Str("internal_url", fmt.Sprintf("http://%s:%s", containerName, DefaultTronPort)).
152+
Msg("TRON container started successfully")
124153

125154
return &Output{
126155
UseCache: true,

0 commit comments

Comments
 (0)