This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relayer worker pool re-architecture (paritytech#354)
* Worker interface + WorkerPool run logic * Comment out beefy stuff in listener for now * Create Eth relayer using worker interface * Update Worker interface, simplify ethrelayer * Use factories in WorkerPool, better interface * Add back deadlock detection * Allow v1 or v2 relay to be run * Fix conn bug * Remove unused keypair
- Loading branch information
Showing
9 changed files
with
288 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2021 Snowfork | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
package core | ||
|
||
import ( | ||
"github.com/sirupsen/logrus" | ||
|
||
"github.com/snowfork/polkadot-ethereum/relayer/workers" | ||
"github.com/snowfork/polkadot-ethereum/relayer/workers/ethrelayer" | ||
) | ||
|
||
type RelayV2 struct{} | ||
|
||
func (re *RelayV2) Run() error { | ||
config, err := LoadConfig() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ethrelayerFactory := func() (workers.Worker, error) { | ||
return ethrelayer.NewWorker( | ||
&config.Eth, | ||
&config.Parachain, | ||
logrus.WithField("worker", ethrelayer.Name), | ||
), nil | ||
} | ||
|
||
// TODO: add all workers | ||
pool := workers.WorkerPool{ | ||
ethrelayerFactory, | ||
} | ||
|
||
return pool.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.