Load Snapshot from RPC request
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import os
|
||||
import signal
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
import requests
|
||||
import subprocess
|
||||
import os
|
||||
import psycopg2
|
||||
from psycopg2 import sql
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import psycopg2
|
||||
import requests
|
||||
from psycopg2 import sql
|
||||
|
||||
binary_path = Path(__file__).parent / "tycho-indexer"
|
||||
|
||||
|
||||
@@ -148,6 +148,16 @@ class TychoRunner:
|
||||
response = requests.post(url, headers=headers, json=data)
|
||||
return response.json()
|
||||
|
||||
@staticmethod
|
||||
def get_contract_state() -> dict:
|
||||
"""Retrieve contract state from the RPC server."""
|
||||
url = "http://0.0.0.0:4242/v1/ethereum/contract_state"
|
||||
headers = {"accept": "application/json", "Content-Type": "application/json"}
|
||||
data = {}
|
||||
|
||||
response = requests.post(url, headers=headers, json=data)
|
||||
return response.json()
|
||||
|
||||
@staticmethod
|
||||
def empty_database(db_url: str) -> None:
|
||||
"""Drop and recreate the Tycho indexer database."""
|
||||
|
||||
Reference in New Issue
Block a user