Skip to content

Commit

Permalink
support multiple substrate URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Jan 22, 2025
1 parent 77e684b commit a56bd8a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bridge/docs/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ the source field set contains all fields which are included in the source object
| Instance_public_key | string | yes | Instance public key which you can use to filter logs by instance |
| Bridge_wallet_address | string | yes | The bridge account address which you can use to filter logs by bridge |
| Stellar_network | string | yes | Stellar network name which you can use to filter logs by environment |
| Tfchain_url | string | yes | The url of the substrate rpc node which you can use to filter logs by environment |
| Tfchain_url | []string | yes | The urls of the substrate rpc node which you can use to filter logs by environment |

#### Event-specific fields:

Expand Down
2 changes: 1 addition & 1 deletion bridge/tfchain_bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
var bridgeCfg pkg.BridgeConfig

var debug bool
flag.StringVar(&bridgeCfg.TfchainURL, "tfchainurl", "", "Tfchain websocket url")
flag.StringArrayVar(&bridgeCfg.TfchainURL, "tfchainurl", []string{}, "Tfchain websocket url")
flag.StringVar(&bridgeCfg.TfchainSeed, "tfchainseed", "", "Tfchain secret seed")
flag.StringVar(&bridgeCfg.StellarBridgeAccount, "bridgewallet", "", "stellar bridge wallet")
flag.StringVar(&bridgeCfg.StellarSeed, "secret", "", "stellar secret")
Expand Down
2 changes: 1 addition & 1 deletion bridge/tfchain_bridge/pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pkg
import "errors"

type BridgeConfig struct {
TfchainURL string
TfchainURL []string
TfchainSeed string
RescanBridgeAccount bool
PersistencyFile string
Expand Down
2 changes: 1 addition & 1 deletion bridge/tfchain_bridge/pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type SourceCommonLogEntry struct {
Instance_public_key string
Bridge_wallet_address string
Stellar_network string
Tfchain_url string
Tfchain_url []string
}

type refundReasonKey struct{}
Expand Down
4 changes: 2 additions & 2 deletions bridge/tfchain_bridge/pkg/substrate/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ type SubstrateClient struct {
}

// NewSubstrate creates a substrate client
func NewSubstrateClient(url string, seed string) (*SubstrateClient, error) {
mngr := substrate.NewManager(url)
func NewSubstrateClient(url []string, seed string) (*SubstrateClient, error) {
mngr := substrate.NewManager(url...)
cl, err := mngr.Substrate()
if err != nil {
return nil, err
Expand Down

0 comments on commit a56bd8a

Please sign in to comment.