83 lines
3.1 KiB
Python
83 lines
3.1 KiB
Python
import threading
|
|
import time
|
|
import random
|
|
from loguru import logger
|
|
from peewee import fn
|
|
from tomorrow3 import threads
|
|
|
|
from evm助记词.tools import get_eth_balance, transfer_accounts
|
|
|
|
from models.nexus import Nexus
|
|
|
|
|
|
# @threads(200) # 指定线程数为4
|
|
def fen1(nexus_info):
|
|
for i in Nexus.select().where(Nexus.to_id == nexus_info.id).order_by(fn.RAND()):
|
|
if transfer_accounts(
|
|
conn_url="https://rpc.nexus.xyz/http",
|
|
from_private_key=nexus_info.private_key,
|
|
to_address=i.address,
|
|
value=(float(get_eth_balance(conn_url=conn_url, from_address=nexus_info.address)) - 0.000001) / 15,
|
|
):
|
|
logger.info(f"{nexus_info.address} ——————》 {i.address},成功!!!")
|
|
else:
|
|
logger.info(f"{nexus_info.address} ——————》 {i.address},失败!!!")
|
|
|
|
time.sleep(random.randint(3, 10) + random.random())
|
|
|
|
|
|
if __name__ == '__main__':
|
|
conn_url = "https://rpc.nexus.xyz/http"
|
|
|
|
for i in range(35):
|
|
for nexus_info in Nexus.select().where(Nexus.h == 1):
|
|
threading.Thread(target=fen1, args=(nexus_info,)).start()
|
|
# fen1(nexus_info=nexus_info)
|
|
|
|
time.sleep(random.randint(15, 85) + random.random())
|
|
|
|
for nexus_info in Nexus.select().where(Nexus.h == 2):
|
|
threading.Thread(target=fen1, args=(nexus_info,)).start()
|
|
# fen1(nexus_info=nexus_info)
|
|
|
|
time.sleep(random.randint(15, 85) + random.random())
|
|
|
|
for nexus_info in Nexus.select().where(
|
|
Nexus.h.is_null(),
|
|
Nexus.to_id.is_null(False)
|
|
):
|
|
nexus_info1 = Nexus.get_or_none(
|
|
Nexus.id == nexus_info.to_id,
|
|
)
|
|
|
|
if transfer_accounts(
|
|
conn_url="https://rpc.nexus.xyz/http",
|
|
from_private_key=nexus_info.private_key,
|
|
to_address=nexus_info1.address,
|
|
value=float(get_eth_balance(conn_url=conn_url, from_address=nexus_info1.address)) - 0.01,
|
|
):
|
|
logger.info(f"{nexus_info.address} ——————》 {nexus_info1.address},成功!!!")
|
|
else:
|
|
logger.info(f"{nexus_info.address} ——————》 {nexus_info1.address},失败!!!")
|
|
|
|
time.sleep(random.randint(15, 85) + random.random())
|
|
|
|
for nexus_info in Nexus.select().where(
|
|
Nexus.h == 1,
|
|
):
|
|
nexus_info1 = Nexus.get_or_none(
|
|
Nexus.id == nexus_info.to_id,
|
|
)
|
|
|
|
if transfer_accounts(
|
|
conn_url="https://rpc.nexus.xyz/http",
|
|
from_private_key=nexus_info.private_key,
|
|
to_address=nexus_info1.address,
|
|
value=float(get_eth_balance(conn_url=conn_url, from_address=nexus_info1.address)) - 0.01,
|
|
):
|
|
logger.info(f"{nexus_info.address} ——————》 {nexus_info1.address},成功!!!")
|
|
else:
|
|
logger.info(f"{nexus_info.address} ——————》 {nexus_info1.address},失败!!!")
|
|
|
|
time.sleep(random.randint(15, 85) + random.random())
|