Skip to content

Commit

Permalink
handle fids table conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
haardikk21 committed Feb 12, 2024
1 parent db8ccd1 commit c0458f0
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FARCASTER_PRIV_KEY=0xYourPrivateKey
OPTIMISM_L2_RPC_URL=Your Op-mainnet RPC URL
OPTIMISM_L2_RPC_URL="Optimism RPC URL"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
db_path = "sqlite:./farcaster.db"
db_migrations_path = "./lib/storage/migrations"
farcaster_priv_key = ""
optimism_l2_rpc_url = ""
optimism_l2_rpc_url = "https://mainnet.optimism.io"
chain_id = 10
id_registry_address = "0x00000000Fc6c5F01Fc30151999387Bb99A9f489b"
key_registry_address = "0x00000000Fc1237824fb747aBDE0FF18990E59b7e"
storage_registry_address = "0x00000000fcce7f938e7ae6d3c335bd6a1a7c593d"
abi_dir = "./lib/eth/abis"
indexer_interval = "60" # This value is in seconds
indexer_interval = 60 # This value is in seconds
11 changes: 11 additions & 0 deletions lib/eth/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,20 +305,31 @@ impl<T: JsonRpcClient + Clone> Indexer<T> {

// id registry logs
self.sync_register_logs(start, end).await?;
log::info!("synced register logs");
self.sync_transfer_logs(start, end).await?;
log::info!("synced transfer logs");
self.sync_recovery_logs(start, end).await?;
log::info!("synced recovery logs");
self.sync_change_recovery_address_logs(start, end).await?;
log::info!("synced change recovery address logs");

// key registry logs
self.sync_add_logs(start, end).await?;
log::info!("synced add logs");
self.sync_remove_logs(start, end).await?;
log::info!("synced remove logs");
self.sync_admin_reset_logs(start, end).await?;
log::info!("synced admin reset logs");
self.sync_migrated_logs(start, end).await?;
log::info!("synced migrated logs");

// storage registry logs
self.sync_rent_logs(start, end).await?;
log::info!("synced rent logs");
self.sync_set_max_units_logs(start, end).await?;
log::info!("synced set max units logs");
self.sync_deprecation_timestamp_logs(start, end).await?;
log::info!("synced deprecation timestamp logs");

current_block = end + 1;
}
Expand Down
6 changes: 0 additions & 6 deletions lib/eth/src/key_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ impl<T: JsonRpcClient + Clone> Contract<T> {
let key_type = U256::from_big_endian(log.topics[2].as_bytes()).as_u32();
let key_hash = H256::from_slice(&log.topics[3].as_bytes());

log::info!(
"got Add log for key hash: {:?} in tx: {:?}",
key_hash,
log.transaction_hash
);

let key = H256::from_slice(&log.data[128..160]); // 160
let key_bytes = key.as_bytes();

Expand Down
2 changes: 0 additions & 2 deletions lib/hub/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ async fn main() {
fn start(args: teleport_cli::start::StartCommand) {
log::info!("Teleport Starting...");

// TODO: Handle reading a TOML config file

let peer_id: PeerId;

// TODO: Read peerid from files
Expand Down
3 changes: 2 additions & 1 deletion lib/storage/src/queries/insert_fid.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ INSERT INTO fids (
custody_address,
recovery_address
)
VALUES (?, ?, ?, ?, ?);
VALUES (?, ?, ?, ?, ?)
ON CONFLICT (fid) DO NOTHING;

0 comments on commit c0458f0

Please sign in to comment.