chore: update SWQoSClientConfig
This commit is contained in:
@@ -43,8 +43,8 @@ func main() {
|
||||
|
||||
blockrazorClient, err := swqos.NewSWQoSClient(
|
||||
context.Background(),
|
||||
enum.SWQoSAgentBlockRazor,
|
||||
&swqos.SWQoSClientConfig{
|
||||
Name: enum.SWQoSAgentBlockRazor,
|
||||
SendTxUrl: "frankfurt.solana-grpc.blockrazor.xyz:80",
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"github.com/samlior/libsam/pkg/swqos/clients"
|
||||
)
|
||||
|
||||
func NewSWQoSClient(ctx context.Context, agent string, config *SWQoSClientConfig) (SWQoSClient, error) {
|
||||
func NewSWQoSClient(ctx context.Context, config *SWQoSClientConfig) (SWQoSClient, error) {
|
||||
var err error
|
||||
var client SWQoSClient
|
||||
switch agent {
|
||||
switch config.Name {
|
||||
case enum.SWQoSAgentBlockRazor:
|
||||
client, err = clients.NewBlockRazorClient(ctx, config.SendTxUrl)
|
||||
case enum.SWQoSAgentNextBlock:
|
||||
@@ -27,7 +27,7 @@ func NewSWQoSClient(ctx context.Context, agent string, config *SWQoSClientConfig
|
||||
case enum.SWQoSAgent0slot, enum.SWQoSAgentJito, enum.SWQoSAgentHelius, enum.SWQoSAgentNozomi, enum.SWQoSAgentStellium:
|
||||
client = clients.NewHttpClient(config.SendTxUrl, config.SendBundleUrl)
|
||||
default:
|
||||
return nil, fmt.Errorf("invalid agent: %s", agent)
|
||||
return nil, fmt.Errorf("invalid agent: %s", config.Name)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type SWQoSClientConfig struct {
|
||||
Name string `json:"name"`
|
||||
SendTxUrl string `json:"sendTxUrl"`
|
||||
SendBundleUrl string `json:"sendBundleUrl"`
|
||||
KeepAliveUrl string `json:"keepAliveUrl"`
|
||||
|
||||
Reference in New Issue
Block a user