Skip to content

Commit 17cc7a4

Browse files
authored
Merge pull request #341 from blockfrost/blockfrost-base-url
Add --blockfrost-base-url for cardano
2 parents 0b16ee5 + ad2c4b6 commit 17cc7a4

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

cmd/init_cardano.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func init() {
6464
initCardanoCmd.Flags().StringVar(&initOptions.Network, "network", "mainnet", "The name of the network to connect to")
6565
initCardanoCmd.Flags().StringVar(&initOptions.Socket, "socket", "", "Socket to mount for the cardano node to connect to")
6666
initCardanoCmd.Flags().StringVar(&initOptions.BlockfrostKey, "blockfrost-key", "", "Blockfrost key")
67+
initCardanoCmd.Flags().StringVar(&initOptions.BlockfrostBaseURL, "blockfrost-base-url", "", "Blockfrost base URL (for run-your-own blockfrost setups)")
6768

6869
initCmd.AddCommand(initCardanoCmd)
6970
}

internal/blockchain/cardano/connector/cardanoconnect/config.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ type ConnectorConfig struct {
5050
}
5151

5252
type BlockchainConfig struct {
53-
BlockfrostKey string `yaml:"blockfrostKey,omitempty"`
54-
Socket string `yaml:"socket,omitempty"`
55-
Network string `yaml:"network,omitempty"`
53+
BlockfrostKey string `yaml:"blockfrostKey,omitempty"`
54+
BlockfrostBaseURL string `yaml:"blockfrostBaseUrl,omitempty"`
55+
Socket string `yaml:"socket,omitempty"`
56+
Network string `yaml:"network,omitempty"`
5657
}
5758

5859
type ContractsConfig struct {
@@ -137,9 +138,10 @@ func (c *Cardanoconnect) GenerateConfig(stack *types.Stack, org *types.Organizat
137138
},
138139
Connector: &ConnectorConfig{
139140
Blockchain: &BlockchainConfig{
140-
BlockfrostKey: stack.BlockfrostKey,
141-
Network: stack.Network,
142-
Socket: socket,
141+
BlockfrostKey: stack.BlockfrostKey,
142+
BlockfrostBaseURL: stack.BlockfrostBaseURL,
143+
Network: stack.Network,
144+
Socket: socket,
143145
},
144146
Contracts: &ContractsConfig{
145147
ComponentsPath: "/cardanoconnect/contracts/components",

internal/stacks/stack_manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func (s *StackManager) InitStack(options *types.InitOptions) (err error) {
124124
ChainIDPtr: &options.ChainID,
125125
Network: options.Network,
126126
BlockfrostKey: options.BlockfrostKey,
127+
BlockfrostBaseURL: options.BlockfrostBaseURL,
127128
Socket: options.Socket,
128129
RemoteNodeURL: options.RemoteNodeURL,
129130
RequestTimeout: options.RequestTimeout,

pkg/types/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type InitOptions struct {
6060
Network string
6161
Socket string
6262
BlockfrostKey string
63+
BlockfrostBaseURL string
6364
DisableTokenFactories bool
6465
RequestTimeout int
6566
ReleaseChannel string

pkg/types/stack.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type Stack struct {
4747
Network string `json:"network,omitempty"`
4848
Socket string `json:"socket,omitempty"`
4949
BlockfrostKey string `json:"blockfrostKey,omitempty"`
50+
BlockfrostBaseURL string `json:"blockfrostBaseURL,omitempty"`
5051
RemoteNodeURL string `json:"remoteNodeURL,omitempty"`
5152
DisableTokenFactories bool `json:"disableTokenFactories,omitempty"`
5253
RequestTimeout int `json:"requestTimeout,omitempty"`

0 commit comments

Comments
 (0)