Skip to content
Open
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
50 changes: 25 additions & 25 deletions 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_urls | []string | yes | The urls of the substrate rpc nodes which you can use to filter logs by environment |

#### Event-specific fields:

Expand Down Expand Up @@ -956,7 +956,7 @@ the filtered result would be similar to the one below:
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "16d8b06b59aaa5514c645260263e5477bb8aad211502c56cb8849ed5b423d354",
"event_action": "payment_received",
Expand All @@ -978,7 +978,7 @@ the filtered result would be similar to the one below:
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "16d8b06b59aaa5514c645260263e5477bb8aad211502c56cb8849ed5b423d354",
"event_action": "transfer_initiated",
Expand All @@ -997,7 +997,7 @@ the filtered result would be similar to the one below:
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "16d8b06b59aaa5514c645260263e5477bb8aad211502c56cb8849ed5b423d354",
"event_action": "mint_proposed",
Expand All @@ -1018,7 +1018,7 @@ the filtered result would be similar to the one below:
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "16d8b06b59aaa5514c645260263e5477bb8aad211502c56cb8849ed5b423d354",
"event_action": "mint_completed",
Expand All @@ -1034,7 +1034,7 @@ the filtered result would be similar to the one below:
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "16d8b06b59aaa5514c645260263e5477bb8aad211502c56cb8849ed5b423d354",
"event_action": "transfer_completed",
Expand Down Expand Up @@ -1073,7 +1073,7 @@ This time, the transfer was not completed on the other network and was instead r
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "10",
"event_action": "event_burn_tx_created_received",
Expand All @@ -1089,7 +1089,7 @@ This time, the transfer was not completed on the other network and was instead r
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "10",
"event_action": "transfer_initiated",
Expand All @@ -1108,7 +1108,7 @@ This time, the transfer was not completed on the other network and was instead r
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "10",
"event_action": "mint_proposed",
Expand All @@ -1129,7 +1129,7 @@ This time, the transfer was not completed on the other network and was instead r
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "10",
"event_action": "mint_completed",
Expand All @@ -1145,7 +1145,7 @@ This time, the transfer was not completed on the other network and was instead r
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "10",
"event_action": "transfer_completed",
Expand Down Expand Up @@ -1181,7 +1181,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "event_burn_tx_created_received",
Expand All @@ -1197,7 +1197,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "transfer_initiated",
Expand All @@ -1216,7 +1216,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "withdraw_proposed",
Expand All @@ -1237,7 +1237,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "event_burn_tx_ready_received",
Expand All @@ -1253,7 +1253,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "stellar_transaction_submitted",
Expand All @@ -1272,7 +1272,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "withdraw_completed",
Expand All @@ -1288,7 +1288,7 @@ For a more simplified view, you can filter events by the transfer category to di
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "13",
"event_action": "transfer_completed",
Expand Down Expand Up @@ -1322,7 +1322,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "payment_received",
Expand All @@ -1344,7 +1344,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "transfer_initiated",
Expand All @@ -1363,7 +1363,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "refund_proposed",
Expand All @@ -1382,7 +1382,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "event_refund_tx_ready_received",
Expand All @@ -1398,7 +1398,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "stellar_transaction_submitted",
Expand All @@ -1417,7 +1417,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "refund_completed",
Expand All @@ -1433,7 +1433,7 @@ Also Upon reviewing the `refund_proposed` event, we found that the `reason` fiel
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
"Tfchain_urls": ["ws://localhost:9944"]
},
"trace_id": "7f0406ad7b8d4f0de6dade19eb3979ef93857a56c6daa4bf9f2b0bb22a21d84f",
"event_action": "transfer_completed",
Expand Down
4 changes: 2 additions & 2 deletions 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.TfchainURLs, "tfchainurl", []string{}, "Tfchain websocket urls")
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 Expand Up @@ -51,7 +51,7 @@ func main() {
Instance_public_key: address,
Bridge_wallet_address: bridgeCfg.StellarBridgeAccount,
Stellar_network: bridgeCfg.StellarNetwork,
Tfchain_url: bridgeCfg.TfchainURL,
Tfchain_urls: bridgeCfg.TfchainURLs,
}

log.Logger = log.Logger.With().Interface("source", sourceLogEntry).Logger()
Expand Down
2 changes: 1 addition & 1 deletion bridge/tfchain_bridge/pkg/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Bridge struct {
}

func NewBridge(ctx context.Context, cfg pkg.BridgeConfig) (*Bridge, string, error) {
subClient, err := subpkg.NewSubstrateClient(cfg.TfchainURL, cfg.TfchainSeed)
subClient, err := subpkg.NewSubstrateClient(cfg.TfchainURLs, cfg.TfchainSeed)
if err != nil {
return nil, "", err
}
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
TfchainURLs []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_urls []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(urls []string, seed string) (*SubstrateClient, error) {
mngr := substrate.NewManager(urls...)
cl, err := mngr.Substrate()
if err != nil {
return nil, err
Expand Down
Loading