generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some information about actors and their intent (#13)
* Add some information about actors and their intent * Add comment
- Loading branch information
Showing
7 changed files
with
74 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
use actix::{Actor, Context}; | ||
|
||
/// Manage an internal web3 instance and express protocol specific behaviour through the events it | ||
/// accepts and emits to the EventBus | ||
/// Monitor contract events using `contract.events().create_filter()` and rebroadcast to eventbus by | ||
/// creating `EnclaveEvent` events | ||
/// Delegate signing to a separate actor responsible for managing Eth keys | ||
/// Accept eventbus events and forward as appropriate contract calls as required | ||
pub struct EnclaveContract; | ||
|
||
impl Actor for EnclaveContract{ | ||
type Context = Context<Self>; | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,11 +1,24 @@ | ||
/// Actor for connecting to an libp2p client via it's mpsc channel interface | ||
/// This Actor should be responsible for | ||
/// 1. Sending and Recieving Vec<u8> messages with libp2p | ||
/// 2. Converting between Vec<u8> and EnclaveEvents::Xxxxxxxxx() | ||
/// 3. Broadcasting over the local eventbus | ||
/// 4. Listening to the local eventbus for messages to be published to libp2p | ||
use actix::{Actor, Context}; | ||
|
||
use tokio::sync::mpsc::{Receiver, Sender}; | ||
use p2p::EnclaveRouter; | ||
pub struct P2pActor; | ||
|
||
pub struct P2p; | ||
|
||
impl Actor for P2pActor{ | ||
impl Actor for P2p{ | ||
type Context = Context<Self>; | ||
} | ||
|
||
|
||
impl P2p { | ||
pub fn new() { | ||
// Construct owning Libp2p module | ||
} | ||
pub fn from_channel(tx:Sender<Vec<u8>>, rx:Receiver<Vec<u8>>){ | ||
// Construct from tx/rx | ||
} | ||
} |