Skip to content

KineticXYZ/Python-Interview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview

The objective is to develop a Python program to get the timestamp when a Solana program was first deployed.

You can refer to Solana's RPC doc.

Technical Requirements

Programming Language: Python (3.10+)

Package Manager: Use uv for dependency management.

Version Control: Use git as often as you can to save your changes.

Access on-chain data: Use Solana RPC endpoints or Solana official libraries (e.g., solders).

Performance: Optimize the tool for computational efficiency.

No third-party APIs: Access on-chain data directly.

Getting Started

Installation

Install dependencies using UV:

uv sync

Running the Program

uv run python src/main.py

Or using the configured script:

uv run start

Development Tools

The project includes:

  • Ruff: Fast Python linter and formatter
  • Pyright: Static type checker

Run formatting:

uv run ruff format .

Run linting:

uv run ruff check .

Run type checking:

uv run pyright

Bonus Points

Error Handling: Handle connection issues with access endpoints.

Robustness: Use multiple endpoints to ensure tool robustness.

Implementation Notes

Your task is to implement the search_for_program() function in src/main.py to efficiently find the deployment slot of a Solana program. Consider:

  • How to efficiently search through historical slots
  • The trade-offs between different search strategies
  • How to verify when a program account was created
  • Handling edge cases (program doesn't exist, RPC failures, etc.)

The current implementation is a stub that returns -1. Replace this with your solution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages