opengradient 0.3.28__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opengradient/cli.py +2 -5
- opengradient/client.py +4 -2
- opengradient/defaults.py +7 -7
- {opengradient-0.3.28.dist-info → opengradient-0.4.0.dist-info}/METADATA +1 -1
- {opengradient-0.3.28.dist-info → opengradient-0.4.0.dist-info}/RECORD +9 -9
- {opengradient-0.3.28.dist-info → opengradient-0.4.0.dist-info}/LICENSE +0 -0
- {opengradient-0.3.28.dist-info → opengradient-0.4.0.dist-info}/WHEEL +0 -0
- {opengradient-0.3.28.dist-info → opengradient-0.4.0.dist-info}/entry_points.txt +0 -0
- {opengradient-0.3.28.dist-info → opengradient-0.4.0.dist-info}/top_level.txt +0 -0
opengradient/cli.py
CHANGED
|
@@ -101,9 +101,6 @@ def initialize_config(ctx):
|
|
|
101
101
|
)
|
|
102
102
|
ctx.obj["password"] = password if password else None
|
|
103
103
|
|
|
104
|
-
ctx.obj["rpc_url"] = DEFAULT_RPC_URL
|
|
105
|
-
ctx.obj["contract_address"] = DEFAULT_INFERENCE_CONTRACT_ADDRESS
|
|
106
|
-
|
|
107
104
|
save_og_config(ctx)
|
|
108
105
|
click.echo("Config has been saved.")
|
|
109
106
|
click.secho("You can run 'opengradient config show' to see configs.", fg="green")
|
|
@@ -128,11 +125,11 @@ def cli(ctx):
|
|
|
128
125
|
if ctx.invoked_subcommand in no_client_commands:
|
|
129
126
|
return
|
|
130
127
|
|
|
131
|
-
if all(key in ctx.obj for key in ["private_key"
|
|
128
|
+
if all(key in ctx.obj for key in ["private_key"]):
|
|
132
129
|
try:
|
|
133
130
|
ctx.obj["client"] = Client(
|
|
134
131
|
private_key=ctx.obj["private_key"],
|
|
135
|
-
rpc_url=
|
|
132
|
+
rpc_url=DEFAULT_RPC_URL,
|
|
136
133
|
contract_address=DEFAULT_INFERENCE_CONTRACT_ADDRESS,
|
|
137
134
|
email=ctx.obj.get("email"),
|
|
138
135
|
password=ctx.obj.get("password"),
|
opengradient/client.py
CHANGED
|
@@ -918,8 +918,10 @@ def run_with_retry(txn_function, max_retries=DEFAULT_MAX_RETRY, retry_delay=DEFA
|
|
|
918
918
|
"""
|
|
919
919
|
NONCE_TOO_LOW = 'nonce too low'
|
|
920
920
|
NONCE_TOO_HIGH = 'nonce too high'
|
|
921
|
+
|
|
922
|
+
effective_retries = max_retries if max_retries is not None else DEFAULT_MAX_RETRY
|
|
921
923
|
|
|
922
|
-
for attempt in range(
|
|
924
|
+
for attempt in range(effective_retries):
|
|
923
925
|
try:
|
|
924
926
|
return txn_function()
|
|
925
927
|
except Exception as e:
|
|
@@ -927,7 +929,7 @@ def run_with_retry(txn_function, max_retries=DEFAULT_MAX_RETRY, retry_delay=DEFA
|
|
|
927
929
|
|
|
928
930
|
if NONCE_TOO_LOW in error_msg or NONCE_TOO_HIGH in error_msg:
|
|
929
931
|
if attempt == max_retries - 1:
|
|
930
|
-
raise OpenGradientError(f"Transaction failed after {
|
|
932
|
+
raise OpenGradientError(f"Transaction failed after {effective_retries} attempts: {e}")
|
|
931
933
|
time.sleep(retry_delay)
|
|
932
934
|
continue
|
|
933
935
|
|
opengradient/defaults.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Default variables
|
|
2
|
-
DEFAULT_RPC_URL
|
|
3
|
-
DEFAULT_OG_FAUCET_URL
|
|
4
|
-
DEFAULT_HUB_SIGNUP_URL
|
|
5
|
-
DEFAULT_INFERENCE_CONTRACT_ADDRESS
|
|
6
|
-
DEFAULT_BLOCKCHAIN_EXPLORER
|
|
7
|
-
DEFAULT_IMAGE_GEN_HOST
|
|
8
|
-
DEFAULT_IMAGE_GEN_PORT
|
|
2
|
+
DEFAULT_RPC_URL="http://18.188.176.119:8545"
|
|
3
|
+
DEFAULT_OG_FAUCET_URL="https://faucet.opengradient.ai/?address="
|
|
4
|
+
DEFAULT_HUB_SIGNUP_URL="https://hub.opengradient.ai/signup"
|
|
5
|
+
DEFAULT_INFERENCE_CONTRACT_ADDRESS="0x8383C9bD7462F12Eb996DD02F78234C0421A6FaE"
|
|
6
|
+
DEFAULT_BLOCKCHAIN_EXPLORER="https://explorer.opengradient.ai/tx/"
|
|
7
|
+
DEFAULT_IMAGE_GEN_HOST="18.217.25.69"
|
|
8
|
+
DEFAULT_IMAGE_GEN_PORT=5125
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
opengradient/__init__.py,sha256=j52gE9yLsig3og9_EKhV12K-VzFpZLORmM0msm2zJB0,12858
|
|
2
2
|
opengradient/account.py,sha256=5wrYpws_1lozjOFjLCTHtxgoxK-LmObDAaVy9eDcJY4,1145
|
|
3
|
-
opengradient/cli.py,sha256=
|
|
4
|
-
opengradient/client.py,sha256=
|
|
5
|
-
opengradient/defaults.py,sha256=
|
|
3
|
+
opengradient/cli.py,sha256=5PNwcVwmkJb8A8Apj_JjkG9vDDyNEq0j51omzzQWHIo,25237
|
|
4
|
+
opengradient/client.py,sha256=juJKCudEqhtBOY_eZJozuWwuqtw5uOJNG3Asc-IUBEE,41763
|
|
5
|
+
opengradient/defaults.py,sha256=XQ9q-zC-QYaa1ONhGhniK1ZCO_ryiTjAWbYO3QCvXZ8,403
|
|
6
6
|
opengradient/exceptions.py,sha256=88tfegboGtlehQcwhxsl6ZzhLJWZWlkf_bkHTiCtXpo,3391
|
|
7
7
|
opengradient/types.py,sha256=-wBElVWswETdjM6Afmtnhqz4OYkSYfnN3e1UdDjYz0I,4032
|
|
8
8
|
opengradient/utils.py,sha256=hf1dQvOHdCFthrAr_Wif_PNn6-C3zZaa3QCZX1HMWoA,6911
|
|
@@ -18,9 +18,9 @@ opengradient/proto/__init__.py,sha256=AhaSmrqV0TXGzCKaoPV8-XUvqs2fGAJBM2aOmDpkNb
|
|
|
18
18
|
opengradient/proto/infer.proto,sha256=13eaEMcppxkBF8yChptsX9HooWFwJKze7oLZNl-LEb8,1217
|
|
19
19
|
opengradient/proto/infer_pb2.py,sha256=sGWDDVumYhXoCJTG9rLyvKu4XyaEjPE_b038kbNlj7w,3484
|
|
20
20
|
opengradient/proto/infer_pb2_grpc.py,sha256=q42_eZ7OZCMTXdWocYA4Ka3B0c3B74dOhfqdaIOO5AU,6700
|
|
21
|
-
opengradient-0.
|
|
22
|
-
opengradient-0.
|
|
23
|
-
opengradient-0.
|
|
24
|
-
opengradient-0.
|
|
25
|
-
opengradient-0.
|
|
26
|
-
opengradient-0.
|
|
21
|
+
opengradient-0.4.0.dist-info/LICENSE,sha256=xEcvQ3AxZOtDkrqkys2Mm6Y9diEnaSeQRKvxi-JGnNA,1069
|
|
22
|
+
opengradient-0.4.0.dist-info/METADATA,sha256=18S7MbzBEqKIK4QucDgcgv9oF9mAsnvhXYv_smL1GG0,5832
|
|
23
|
+
opengradient-0.4.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
24
|
+
opengradient-0.4.0.dist-info/entry_points.txt,sha256=yUKTaJx8RXnybkob0J62wVBiCp_1agVbgw9uzsmaeJc,54
|
|
25
|
+
opengradient-0.4.0.dist-info/top_level.txt,sha256=oC1zimVLa2Yi1LQz8c7x-0IQm92milb5ax8gHBHwDqU,13
|
|
26
|
+
opengradient-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|