Skip to content

Commit e2c0099

Browse files
committed
feat: skipcheck
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 22faf4e commit e2c0099

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Cardano node configuration:
6767
- `CARDANO_NETWORK` - Use a named Cardano network (default: mainnet)
6868
- `CARDANO_NODE_NETWORK_MAGIC` - Cardano network magic (default: automatically
6969
determined from named network)
70+
- `CARDANO_NODE_SKIP_CHECK` - Skip the connection test to Cardano Node on start
71+
(default: false)
7072
- `CARDANO_NODE_SOCKET_PATH` - Socket path to Cardano node NtC via UNIX socket
7173
(default: /node-ipc/node.socket)
7274
- `CARDANO_NODE_SOCKET_TCP_HOST` - Address to Cardano node NtC via TCP

config.yaml.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ node:
8181
address:
8282
port:
8383

84+
# Skip checking connection to cardano-node
85+
#
86+
# On startup, we connect to the configured cardano-node and exit on failure.
87+
#
88+
# Setting this to true will skip this check.
89+
skipCheck:
90+
8491
# Timeout for connections to cardano-node
8592
#
8693
# This can also be set via the CARDANO_NODE_SOCKET_TIMEOUT environment

internal/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type NodeConfig struct {
5555
NetworkMagic uint32 `yaml:"networkMagic" envconfig:"CARDANO_NODE_NETWORK_MAGIC"`
5656
Address string `yaml:"address" envconfig:"CARDANO_NODE_SOCKET_TCP_HOST"`
5757
Port uint `yaml:"port" envconfig:"CARDANO_NODE_SOCKET_TCP_PORT"`
58+
SkipCheck bool `yaml:"skipCheck" envconfig:"CARDANO_NODE_SKIP_CHECK"`
5859
SocketPath string `yaml:"socketPath" envconfig:"CARDANO_NODE_SOCKET_PATH"`
5960
Timeout uint `yaml:"timeout" envconfig:"CARDANO_NODE_SOCKET_TIMEOUT"`
6061
}
@@ -132,6 +133,9 @@ func (c *Config) populateNetworkMagic() error {
132133
}
133134

134135
func (c *Config) checkNode() error {
136+
if c.Node.SkipCheck {
137+
return nil
138+
}
135139
// Connect to cardano-node
136140
oConn, err := ouroboros.NewConnection(
137141
ouroboros.WithNetworkMagic(uint32(c.Node.NetworkMagic)),

0 commit comments

Comments
 (0)