Skip to content

Commit

Permalink
feat: remove ipfs service (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 authored Oct 1, 2024
1 parent 6c2a08d commit a308dcc
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 1,423 deletions.
23 changes: 0 additions & 23 deletions cmd/cas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,6 @@ func main() {
logger.Fatalf("error creating status queue: %v", err)
}

// ipfs queue
ipfsQueue, err := queue.NewPublisher(
serverCtx,
sqsClient,
queue.PublisherOpts{
QueueType: queue.QueueType_IPFS,
VisibilityTimeout: visibilityTimeout,
RedrivePolicy: redrivePolicy,
},
)
if err != nil {
logger.Fatalf("error creating ipfs queue: %v", err)
}

// Create utilization gauges for all the queues
if err = metricService.QueueGauge(serverCtx, deadLetterQueue.GetName(), queue.NewMonitor(deadLetterQueue.GetUrl(), sqsClient)); err != nil {
logger.Fatalf("error creating gauge for dead-letter queue: %v", err)
Expand All @@ -227,9 +213,6 @@ func main() {
if err = metricService.QueueGauge(serverCtx, statusQueue.GetName(), queue.NewMonitor(statusQueue.GetUrl(), sqsClient)); err != nil {
logger.Fatalf("error creating gauge for status queue: %v", err)
}
if err = metricService.QueueGauge(serverCtx, ipfsQueue.GetName(), queue.NewMonitor(ipfsQueue.GetUrl(), sqsClient)); err != nil {
logger.Fatalf("error creating gauge for ipfs queue: %v", err)
}

// Create the queue consumers. These consumers will be responsible for scaling event processing up based on load and
// also maintaining backpressure on the queues.
Expand All @@ -243,10 +226,6 @@ func main() {
statusService := services.NewStatusService(anchorDb, metricService, logger)
statusConsumer := queue.NewConsumer(logger, statusQueue, statusService.Status, nil)

// The IPFS service reads from the IPFS queue and puts or publishes
ipfsService := services.NewIpfsService(logger, metricService)
ipfsConsumer := queue.NewConsumer(logger, ipfsQueue, ipfsService.Run, nil)

// The Batching service reads from the Ready queue and posts to the Batch queue
anchorBatchSize := models.DefaultAnchorBatchSize
if configAnchorBatchSize, found := os.LookupEnv(models.Env_AnchorBatchSize); found {
Expand Down Expand Up @@ -307,7 +286,6 @@ func main() {
batchWg.Wait()

statusConsumer.Shutdown()
ipfsConsumer.Shutdown()
failureConsumer.Shutdown()
dlqConsumer.Shutdown()

Expand All @@ -330,7 +308,6 @@ func main() {
dlqConsumer.Start()
failureConsumer.Start()
statusConsumer.Start()
ipfsConsumer.Start()
batchingConsumer.Start()
validationConsumer.Start()

Expand Down
1 change: 0 additions & 1 deletion common/aws/queue/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const (
QueueType_Status QueueType = "status"
QueueType_Failure QueueType = "failure"
QueueType_DLQ QueueType = "dlq"
QueueType_IPFS QueueType = "ipfs"
)

const defaultVisibilityTimeout = 5 * time.Minute
Expand Down
117 changes: 0 additions & 117 deletions common/ipfs/api.go

This file was deleted.

Loading

0 comments on commit a308dcc

Please sign in to comment.