Adjustment of RPC

To process requests like:

  • Sending Solana

  • Sending SPL tokens

  • Loading trasactions history

user need to find appropriate RPC. In fact, Solana offers public RPC point ("https://api.mainnet-beta.solana.com"), but it causes a lot of troubles, especially when Solana network is overloaded.

To avoid unpleasure expiriences, we strongly recomend to using private endpoint and inject it into Terminal. It costs nothing (if you are a single users), because free plans are more than enough for casual needs. Recommended providers, according to us, are:

Honesty, there isn't big difference in matter reliability and speed, and each of those 3 providers should process at least 10.000 transfers per month.

Loading endpoints from config.json:

def load_config():
    directory = create_wallet_directory()
    config_path = os.path.join(directory, "config.json")
    if os.path.exists(config_path):
        try:
            with open(config_path, 'r') as config_file:
                config = json.load(config_file)
                return config
        except Exception as e:
            print(f"Error loading config: {e}")
            return {}
    else:
        return {}

def save_config(config):
    directory = create_wallet_directory()
    config_path = os.path.join(directory, "config.json")
    try:
        with open(config_path, 'w') as config_file:
            json.dump(config, config_file, indent=4)
    except Exception as e:
        print(f"Error saving config: {e}")

Initialization:

class App(customtkinter.CTk):
    def __init__(self):
        super().__init__()

        (...)

        self.config_data = load_config()
        self.endpoints = {
            'send_solana': self.config_data.get('send_solana', "https://api.mainnet-beta.solana.com"),
            'send_token': self.config_data.get('send_token', "https://api.mainnet-beta.solana.com"),
            'fetch_transaction_history': self.config_data.get('fetch_transaction_history', "https://api.mainnet-beta.solana.com")
        }

        (...)

Last updated