Merge pull request #67 from propeller-heads/zz/sdk/improve-onboarding-process

refactor: make onboarding easier
This commit is contained in:
Zizou
2024-08-20 11:33:20 +02:00
committed by GitHub
16 changed files with 363 additions and 102 deletions

View File

@@ -8,10 +8,13 @@ def main() -> None:
)
parser.add_argument("--package", type=str, help="Name of the package to test.")
parser.add_argument(
"--tycho-logs", action="store_true", help="Flag to activate logs from Tycho."
"--tycho-logs", action="store_true", help="Enable Tycho logs."
)
parser.add_argument(
"--db-url", type=str, help="Postgres database URL for the Tycho indexer."
"--db-url",
default="postgres://postgres:mypassword@localhost:5431/tycho_indexer_0",
type=str,
help="Postgres database URL for the Tycho indexer. Default: postgres://postgres:mypassword@localhost:5431/tycho_indexer_0",
)
parser.add_argument(
"--vm-traces", action="store_true", help="Enable tracing during vm simulations."

View File

@@ -4,8 +4,6 @@ from hexbytes import HexBytes
from pydantic import BaseModel, Field, validator
from typing import List, Dict, Optional
from tycho_client.dto import ProtocolComponent
class ProtocolComponentExpectation(BaseModel):
"""Represents a ProtocolComponent with its main attributes."""

View File

@@ -14,7 +14,7 @@ from protosim_py.evm.decoders import ThirdPartyPoolTychoDecoder
from protosim_py.evm.storage import TychoDBSingleton
from protosim_py.models import EVMBlock
from pydantic import BaseModel
from tycho_client.dto import (
from tycho_indexer_client.dto import (
Chain,
ProtocolComponentsParams,
ProtocolStateParams,
@@ -26,7 +26,7 @@ from tycho_client.dto import (
Snapshot,
ContractId,
)
from tycho_client.rpc_client import TychoRPCClient
from tycho_indexer_client.rpc_client import TychoRPCClient
from models import (
IntegrationTestsConfig,

View File

@@ -27,12 +27,15 @@ def find_binary_file(file_name):
# Check each location
for location in locations:
potential_path = location + "/" + file_name
potential_path = os.path.join(location, file_name)
if os.path.exists(potential_path):
return potential_path
# If binary is not found in the usual locations, return None
raise RuntimeError("Unable to locate tycho-indexer binary")
searched_paths = "\n".join(locations)
raise RuntimeError(
f"Unable to locate {file_name} binary. Searched paths:\n{searched_paths}"
)
binary_path = find_binary_file("tycho-indexer")

View File

@@ -3,7 +3,7 @@ from typing import Union
from eth_utils import to_checksum_address
from protosim_py.models import EthereumToken
from tycho_client.dto import (
from tycho_indexer_client.dto import (
ResponseProtocolState,
ProtocolComponent,
ResponseAccount,
@@ -13,7 +13,7 @@ from tycho_client.dto import (
TokensParams,
PaginationParams,
)
from tycho_client.rpc_client import TychoRPCClient
from tycho_indexer_client.rpc_client import TychoRPCClient
log = getLogger(__name__)