mirror of
https://github.com/vacp2p/status-rln-prover.git
synced 2026-01-07 20:54:07 -05:00
Add app argument for RLN Smart contract address
This commit is contained in:
@@ -17,11 +17,13 @@ pub struct AppArgs {
|
||||
)]
|
||||
pub(crate) port: u16,
|
||||
#[arg(
|
||||
short = 'r',
|
||||
short = 'u',
|
||||
long = "ws_rpc_url",
|
||||
help = "Websocket rpc url (e.g. wss://eth-mainnet.g.alchemy.com/v2/your-api-key)"
|
||||
)]
|
||||
pub(crate) ws_rpc_url: Url,
|
||||
#[arg(short = 'k', long = "ksc", help = "Karma smart contract address")]
|
||||
pub(crate) ksc_address: Address,
|
||||
#[arg(short = 'r', long = "rlnsc", help = "RLN smart contract address")]
|
||||
pub(crate) rlnsc_address: Address,
|
||||
}
|
||||
|
||||
@@ -292,6 +292,7 @@ pub(crate) struct GrpcProverService {
|
||||
pub rln_identifier: RlnIdentifier,
|
||||
pub user_db: UserDb,
|
||||
pub karma_sc_info: (Url, Address),
|
||||
pub rln_sc_info: (Url, Address),
|
||||
}
|
||||
|
||||
impl GrpcProverService {
|
||||
@@ -299,7 +300,7 @@ impl GrpcProverService {
|
||||
let karma_sc =
|
||||
KarmaSCInstance::try_new(self.karma_sc_info.0.clone(), self.karma_sc_info.1).await?;
|
||||
let karma_rln_sc =
|
||||
KarmaRLNSCInstance::try_new(self.karma_sc_info.0.clone(), self.karma_sc_info.1).await?;
|
||||
KarmaRLNSCInstance::try_new(self.rln_sc_info.0.clone(), self.rln_sc_info.1).await?;
|
||||
|
||||
let prover_service = ProverService {
|
||||
proof_sender: self.proof_sender.clone(),
|
||||
|
||||
@@ -68,7 +68,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
);
|
||||
|
||||
// Smart contract
|
||||
|
||||
// let karma_sc_address = address!("1f9840a85d5aF5bf1D1762F925BDADdC4201F984");
|
||||
let registry_listener = RegistryListener::new(
|
||||
app_args.ws_rpc_url.as_str(),
|
||||
@@ -95,7 +94,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
addr,
|
||||
rln_identifier,
|
||||
user_db: user_db_service.get_user_db(),
|
||||
karma_sc_info: (app_args.ws_rpc_url, app_args.ksc_address),
|
||||
karma_sc_info: (app_args.ws_rpc_url.clone(), app_args.ksc_address),
|
||||
rln_sc_info: (app_args.ws_rpc_url, app_args.rlnsc_address),
|
||||
};
|
||||
|
||||
let mut set = JoinSet::new();
|
||||
|
||||
Reference in New Issue
Block a user