Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sekulicd committed Nov 5, 2024
1 parent 0465e91 commit 1d3fef4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
9 changes: 5 additions & 4 deletions simulation/remote/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ func (c *Client) setupArkClient(aspUrl string) error {

ctx := context.Background()
if err := client.Init(ctx, arksdk.InitArgs{
WalletType: arksdk.SingleKeyWallet,
ClientType: arksdk.GrpcClient,
AspUrl: aspUrl,
Password: "password",
WalletType: arksdk.SingleKeyWallet,
ClientType: arksdk.GrpcClient,
AspUrl: aspUrl,
Password: "password",
ExplorerURL: fmt.Sprintf("http://%s/%s", orchestratorUrl, "3000"),
}); err != nil {
return fmt.Errorf("failed to initialize wallet: %s", err)
}
Expand Down
4 changes: 4 additions & 0 deletions simulation/remote/infra/cloudformation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ Resources:
FromPort: !Ref AspPort
ToPort: !Ref AspPort
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 3000
ToPort: 3000
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 22
ToPort: 22
Expand Down
13 changes: 9 additions & 4 deletions simulation/remote/orchestrator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"flag"
"fmt"
"github.com/xeipuuv/gojsonschema"
"io/ioutil"
"io"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -300,7 +300,7 @@ func sendRequest(url string, payload interface{}) error {
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
return fmt.Errorf("request failed with status %d: %s", resp.StatusCode, string(body))
}

Expand All @@ -310,7 +310,8 @@ func sendRequest(url string, payload interface{}) error {
// startClients launches each client as an AWS Fargate task.
func startClients(subnetIDsEnv, securityGroupIDsEnv string, clientConfigs []ClientConfig) error {
awsRegion := "eu-central-1"
cfg, err := config.LoadDefaultConfig(context.TODO(),
cfg, err := config.LoadDefaultConfig(
context.TODO(),
config.WithRegion(awsRegion),
)
if err != nil {
Expand Down Expand Up @@ -617,7 +618,11 @@ func waitForClientsToSendAddresses(clientIDs []string) {
}

func stopClients() {
cfg, err := config.LoadDefaultConfig(context.TODO())
awsRegion := "eu-central-1"
cfg, err := config.LoadDefaultConfig(
context.TODO(),
config.WithRegion(awsRegion),
)
if err != nil {
log.Errorf("Unable to load AWS SDK config: %v", err)
return
Expand Down

0 comments on commit 1d3fef4

Please sign in to comment.