olas-operate-middleware 0.1.0rc59__py3-none-any.whl → 0.13.2__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.
- olas_operate_middleware-0.13.2.dist-info/METADATA +75 -0
- olas_operate_middleware-0.13.2.dist-info/RECORD +101 -0
- {olas_operate_middleware-0.1.0rc59.dist-info → olas_operate_middleware-0.13.2.dist-info}/WHEEL +1 -1
- operate/__init__.py +17 -0
- operate/account/user.py +35 -9
- operate/bridge/bridge_manager.py +470 -0
- operate/bridge/providers/lifi_provider.py +377 -0
- operate/bridge/providers/native_bridge_provider.py +677 -0
- operate/bridge/providers/provider.py +469 -0
- operate/bridge/providers/relay_provider.py +457 -0
- operate/cli.py +1565 -417
- operate/constants.py +60 -12
- operate/data/README.md +19 -0
- operate/data/contracts/{service_staking_token → dual_staking_token}/__init__.py +2 -2
- operate/data/contracts/dual_staking_token/build/DualStakingToken.json +443 -0
- operate/data/contracts/dual_staking_token/contract.py +132 -0
- operate/data/contracts/dual_staking_token/contract.yaml +23 -0
- operate/{ledger/base.py → data/contracts/foreign_omnibridge/__init__.py} +2 -19
- operate/data/contracts/foreign_omnibridge/build/ForeignOmnibridge.json +1372 -0
- operate/data/contracts/foreign_omnibridge/contract.py +130 -0
- operate/data/contracts/foreign_omnibridge/contract.yaml +23 -0
- operate/{ledger/solana.py → data/contracts/home_omnibridge/__init__.py} +2 -20
- operate/data/contracts/home_omnibridge/build/HomeOmnibridge.json +1421 -0
- operate/data/contracts/home_omnibridge/contract.py +80 -0
- operate/data/contracts/home_omnibridge/contract.yaml +23 -0
- operate/data/contracts/l1_standard_bridge/__init__.py +20 -0
- operate/data/contracts/l1_standard_bridge/build/L1StandardBridge.json +831 -0
- operate/data/contracts/l1_standard_bridge/contract.py +158 -0
- operate/data/contracts/l1_standard_bridge/contract.yaml +23 -0
- operate/data/contracts/l2_standard_bridge/__init__.py +20 -0
- operate/data/contracts/l2_standard_bridge/build/L2StandardBridge.json +626 -0
- operate/data/contracts/l2_standard_bridge/contract.py +130 -0
- operate/data/contracts/l2_standard_bridge/contract.yaml +23 -0
- operate/data/contracts/mech_activity/__init__.py +20 -0
- operate/data/contracts/mech_activity/build/MechActivity.json +111 -0
- operate/data/contracts/mech_activity/contract.py +44 -0
- operate/data/contracts/mech_activity/contract.yaml +23 -0
- operate/data/contracts/optimism_mintable_erc20/__init__.py +20 -0
- operate/data/contracts/optimism_mintable_erc20/build/OptimismMintableERC20.json +491 -0
- operate/data/contracts/optimism_mintable_erc20/contract.py +45 -0
- operate/data/contracts/optimism_mintable_erc20/contract.yaml +23 -0
- operate/data/contracts/recovery_module/__init__.py +20 -0
- operate/data/contracts/recovery_module/build/RecoveryModule.json +811 -0
- operate/data/contracts/recovery_module/contract.py +61 -0
- operate/data/contracts/recovery_module/contract.yaml +23 -0
- operate/data/contracts/requester_activity_checker/__init__.py +20 -0
- operate/data/contracts/requester_activity_checker/build/RequesterActivityChecker.json +111 -0
- operate/data/contracts/requester_activity_checker/contract.py +33 -0
- operate/data/contracts/requester_activity_checker/contract.yaml +23 -0
- operate/data/contracts/staking_token/__init__.py +20 -0
- operate/data/contracts/staking_token/build/StakingToken.json +1336 -0
- operate/data/contracts/{service_staking_token → staking_token}/contract.py +27 -13
- operate/data/contracts/staking_token/contract.yaml +23 -0
- operate/data/contracts/uniswap_v2_erc20/contract.yaml +3 -1
- operate/data/contracts/uniswap_v2_erc20/tests/__init__.py +20 -0
- operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py +363 -0
- operate/keys.py +118 -33
- operate/ledger/__init__.py +159 -56
- operate/ledger/profiles.py +321 -18
- operate/migration.py +555 -0
- operate/{http → operate_http}/__init__.py +3 -2
- operate/{http → operate_http}/exceptions.py +6 -4
- operate/operate_types.py +544 -0
- operate/pearl.py +13 -1
- operate/quickstart/analyse_logs.py +118 -0
- operate/quickstart/claim_staking_rewards.py +104 -0
- operate/quickstart/reset_configs.py +106 -0
- operate/quickstart/reset_password.py +70 -0
- operate/quickstart/reset_staking.py +145 -0
- operate/quickstart/run_service.py +726 -0
- operate/quickstart/stop_service.py +72 -0
- operate/quickstart/terminate_on_chain_service.py +83 -0
- operate/quickstart/utils.py +298 -0
- operate/resource.py +62 -3
- operate/services/agent_runner.py +202 -0
- operate/services/deployment_runner.py +868 -0
- operate/services/funding_manager.py +929 -0
- operate/services/health_checker.py +280 -0
- operate/services/manage.py +2356 -620
- operate/services/protocol.py +1246 -340
- operate/services/service.py +756 -391
- operate/services/utils/mech.py +103 -0
- operate/services/utils/tendermint.py +86 -12
- operate/settings.py +70 -0
- operate/utils/__init__.py +135 -0
- operate/utils/gnosis.py +407 -80
- operate/utils/single_instance.py +226 -0
- operate/utils/ssl.py +133 -0
- operate/wallet/master.py +708 -123
- operate/wallet/wallet_recovery_manager.py +507 -0
- olas_operate_middleware-0.1.0rc59.dist-info/METADATA +0 -304
- olas_operate_middleware-0.1.0rc59.dist-info/RECORD +0 -41
- operate/data/contracts/service_staking_token/build/ServiceStakingToken.json +0 -1273
- operate/data/contracts/service_staking_token/contract.yaml +0 -23
- operate/ledger/ethereum.py +0 -48
- operate/types.py +0 -260
- {olas_operate_middleware-0.1.0rc59.dist-info → olas_operate_middleware-0.13.2.dist-info}/entry_points.txt +0 -0
- {olas_operate_middleware-0.1.0rc59.dist-info → olas_operate_middleware-0.13.2.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: olas-operate-middleware
|
|
3
|
+
Version: 0.13.2
|
|
4
|
+
Summary:
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: David Vilela
|
|
7
|
+
Author-email: dvilelaf@gmail.com
|
|
8
|
+
Requires-Python: >=3.9,<3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Requires-Dist: aiohttp (==3.9.5)
|
|
14
|
+
Requires-Dist: argon2-cffi (==23.1.0)
|
|
15
|
+
Requires-Dist: clea (==0.1.0rc4)
|
|
16
|
+
Requires-Dist: cytoolz (==0.12.3)
|
|
17
|
+
Requires-Dist: deepdiff (>=8.6.1,<9.0.0)
|
|
18
|
+
Requires-Dist: docker (==6.1.2)
|
|
19
|
+
Requires-Dist: eth-abi (==4.0.0)
|
|
20
|
+
Requires-Dist: eth-account (==0.8.0)
|
|
21
|
+
Requires-Dist: eth-hash (==0.7.0)
|
|
22
|
+
Requires-Dist: eth-keyfile (==0.6.1)
|
|
23
|
+
Requires-Dist: eth-keys (==0.4.0)
|
|
24
|
+
Requires-Dist: eth-rlp (==0.3.0)
|
|
25
|
+
Requires-Dist: eth-typing (==3.5.2)
|
|
26
|
+
Requires-Dist: eth-utils (==2.2.0)
|
|
27
|
+
Requires-Dist: fastapi (==0.110.3)
|
|
28
|
+
Requires-Dist: frozenlist (==1.4.1)
|
|
29
|
+
Requires-Dist: halo (==0.0.31)
|
|
30
|
+
Requires-Dist: hexbytes (==0.3.1)
|
|
31
|
+
Requires-Dist: ipfshttpclient (==0.8.0a2)
|
|
32
|
+
Requires-Dist: jsonschema (==4.3.3)
|
|
33
|
+
Requires-Dist: multiaddr (==0.0.9)
|
|
34
|
+
Requires-Dist: multidict (==6.0.5)
|
|
35
|
+
Requires-Dist: open-aea-cli-ipfs (==1.65.0)
|
|
36
|
+
Requires-Dist: open-aea-ledger-cosmos (==1.65.0)
|
|
37
|
+
Requires-Dist: open-aea-ledger-ethereum (==1.65.0)
|
|
38
|
+
Requires-Dist: open-aea-ledger-ethereum-flashbots (==1.65.0)
|
|
39
|
+
Requires-Dist: open-autonomy (>=0.20.2,<0.21.0)
|
|
40
|
+
Requires-Dist: psutil (>=5.9.8,<6.0.0)
|
|
41
|
+
Requires-Dist: pyinstaller (>=6.8.0,<7.0.0)
|
|
42
|
+
Requires-Dist: requests-mock (>=1.12.1,<2.0.0)
|
|
43
|
+
Requires-Dist: requests-toolbelt (==1.0.0)
|
|
44
|
+
Requires-Dist: starlette (==0.37.2)
|
|
45
|
+
Requires-Dist: twikit (==2.2.0)
|
|
46
|
+
Requires-Dist: uvicorn (==0.27.0)
|
|
47
|
+
Requires-Dist: web3 (==6.20.4)
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
|
|
50
|
+
<h1 align="center">
|
|
51
|
+
<b>Olas Operate Middleware</b>
|
|
52
|
+
</h1>
|
|
53
|
+
|
|
54
|
+
A cross-platform python package used to run autonomous agents powered by the OLAS Network.
|
|
55
|
+
|
|
56
|
+
## Getting Started
|
|
57
|
+
|
|
58
|
+
Install using
|
|
59
|
+
```
|
|
60
|
+
pip install olas-operate-middleware
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Start the daemon service using
|
|
64
|
+
```
|
|
65
|
+
python -m operate.cli daemon
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
- [Apache 2.0](LICENSE)
|
|
71
|
+
|
|
72
|
+
## Security
|
|
73
|
+
|
|
74
|
+
- [Security Policy](SECURITY.md)
|
|
75
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
operate/__init__.py,sha256=PY5BUTF5cmNI-7UwAj2jJlPl6KJ44LoY5e16p7IrE3g,1335
|
|
2
|
+
operate/account/__init__.py,sha256=suJ_vBMO7hLCvLYe3MVDtLXTNDd6P03og7bvUN7fZsE,804
|
|
3
|
+
operate/account/user.py,sha256=y7DqqDpqgHjbVmnfL_cN0Me_JWl3Dh6GSVt2-9FdRVw,3044
|
|
4
|
+
operate/bridge/bridge_manager.py,sha256=K5DMYGqgX0xw3pxzZXrwnCQ8ZKpy-HVsfNRM185xb5g,17445
|
|
5
|
+
operate/bridge/providers/lifi_provider.py,sha256=UzAeEnX9FGpnCYYml5lcICeEZeHHqNRCHkGZ-npgteo,14208
|
|
6
|
+
operate/bridge/providers/native_bridge_provider.py,sha256=vAx0MtVPIAxIdQ5OKSUDhnGurYVkC8tKVJRFK9NkIdk,25088
|
|
7
|
+
operate/bridge/providers/provider.py,sha256=KXp5CITCQ-fSOv2iFMOt8Wer1QGhBvJG0HN5Tnh5Qns,17287
|
|
8
|
+
operate/bridge/providers/relay_provider.py,sha256=4D2U8jrugh2DJZeSoxLCTVSZe8xMEwdCimqFDtfwWwc,17422
|
|
9
|
+
operate/cli.py,sha256=omQOAFjlPG4HAP7AISW5WtPyM4YX2VNh6ADYIYUppqA,70147
|
|
10
|
+
operate/constants.py,sha256=FxQL9MmGHD-nNr7UBPb6ItltWtrCLB2fnT6fb4XNlKg,3849
|
|
11
|
+
operate/data/README.md,sha256=jGPyZTvg2LCGdllvmYxmFMkkkiXb6YWatbqIkcX3kv4,879
|
|
12
|
+
operate/data/__init__.py,sha256=ttC51Yqk9c4ehpIgs1Qbe7aJvzkrbbdZ1ClaCxJYByE,864
|
|
13
|
+
operate/data/contracts/__init__.py,sha256=_th54_WvL0ibGy-b6St0Ne9DX-fyjsh-tNOKDn-cWrg,809
|
|
14
|
+
operate/data/contracts/dual_staking_token/__init__.py,sha256=YYKRGg8_J6W2dQMZ75Il_UObydgk42bis1GavBm7xD4,864
|
|
15
|
+
operate/data/contracts/dual_staking_token/build/DualStakingToken.json,sha256=vGfSr37sNXtQ79FfOeqe7CXXzz2AqxVAgyRApTHyaC4,39379
|
|
16
|
+
operate/data/contracts/dual_staking_token/contract.py,sha256=3DYrEgyMNx_jLJriXhwufO9JO8mzlKE-DXvkStrnHXc,4429
|
|
17
|
+
operate/data/contracts/dual_staking_token/contract.yaml,sha256=G4qk7CgG8yT0fttpHyc30m75scsY0t5cFnL9wrx9RIE,722
|
|
18
|
+
operate/data/contracts/foreign_omnibridge/__init__.py,sha256=9eiHXGxm3pz3DZPEo1Wy5HgUsdUdy0CMU9ClQGFcznI,871
|
|
19
|
+
operate/data/contracts/foreign_omnibridge/build/ForeignOmnibridge.json,sha256=VnxMqVe6QsI4zdZZzsV7qONXd2RDHqVuNz_fJjGUa-Q,76259
|
|
20
|
+
operate/data/contracts/foreign_omnibridge/contract.py,sha256=t7n84tz0Jx0jKoxod-wZxlFyjdOIoxt8x2pTWt-RUwk,4157
|
|
21
|
+
operate/data/contracts/foreign_omnibridge/contract.yaml,sha256=Pv3Ts985PZVJnJYbtAgqQlIRqSu8I0Uc7BGS0qwFFRQ,694
|
|
22
|
+
operate/data/contracts/home_omnibridge/__init__.py,sha256=jyPO8Sw9wCrcqHBPv37nJNkwPa3IfN_w6jImRsouG1Q,868
|
|
23
|
+
operate/data/contracts/home_omnibridge/build/HomeOmnibridge.json,sha256=YtRpoNcKlUtkNyZvQ420k_oPaIEaOmTJngHoa3lU6_0,78799
|
|
24
|
+
operate/data/contracts/home_omnibridge/contract.py,sha256=9kXhoZPVq-RSHCXb8jgFft_RK_pE-2iX4aD_CnpD-FE,2786
|
|
25
|
+
operate/data/contracts/home_omnibridge/contract.yaml,sha256=woRJPDWzpS26wjB2BcIv19lzS5TUVjJjd9CGiMv_q94,679
|
|
26
|
+
operate/data/contracts/l1_standard_bridge/__init__.py,sha256=u6pmgRIDXK0E1yCcNQNJXwfXLgc2hO-I1D3_eFCDQJQ,870
|
|
27
|
+
operate/data/contracts/l1_standard_bridge/build/L1StandardBridge.json,sha256=obGPvvhL3gwhyl-wE-U8tuDO6udMrcfycUjfwT5zzgo,41243
|
|
28
|
+
operate/data/contracts/l1_standard_bridge/contract.py,sha256=irwic3jXTNwPh1eBhANswzoPJlWWQEIJez3Alhyx3Kg,5128
|
|
29
|
+
operate/data/contracts/l1_standard_bridge/contract.yaml,sha256=PEGqG1z33Z6Bfi2o0RAGtB_UPseUYXThl5qmLeqOkCE,701
|
|
30
|
+
operate/data/contracts/l2_standard_bridge/__init__.py,sha256=DLSOdkVp7qYDtNkxK8R6rz8CkFNKHoEoW_uM1r1nL5I,870
|
|
31
|
+
operate/data/contracts/l2_standard_bridge/build/L2StandardBridge.json,sha256=Hr6X_oSP6_N7Txh4QJ9hf7Upb7WYk7fxooGlI0qV_8I,35581
|
|
32
|
+
operate/data/contracts/l2_standard_bridge/contract.py,sha256=GOzNkXxBRKLa6eDgNz6NN2MUWs8FFy58Io5GIdSp4MI,4498
|
|
33
|
+
operate/data/contracts/l2_standard_bridge/contract.yaml,sha256=LwEzktlZtHZ5Vv-dpOMlGj9OxYatcdYZZv-qbtnr8c8,701
|
|
34
|
+
operate/data/contracts/mech_activity/__init__.py,sha256=DKz-W2SBPIKCrgd4kWvy8B7jVDq2CTo94xcbfCBzkTk,873
|
|
35
|
+
operate/data/contracts/mech_activity/build/MechActivity.json,sha256=lx5_e-lzBUzYG5GbfBbwP9g66eFAIbLcmPu4ivfw4AA,56225
|
|
36
|
+
operate/data/contracts/mech_activity/contract.py,sha256=-MhQOV6iawyzqnAdKL272vlsUTTCtLse_h8bNR1D37Y,1551
|
|
37
|
+
operate/data/contracts/mech_activity/contract.yaml,sha256=E5p2LkFTle0FwefJmLx5GLEP1x5bc0p-A_qvEEDxaxU,695
|
|
38
|
+
operate/data/contracts/optimism_mintable_erc20/__init__.py,sha256=7MXE2uJ_XdnpaBeonWGJotUXd5X5Yg-lHi6g0EodLb0,875
|
|
39
|
+
operate/data/contracts/optimism_mintable_erc20/build/OptimismMintableERC20.json,sha256=77YyAhmsobhckux59r0JWgPd9fgmlSnEAJ_Wef-WwKI,9974
|
|
40
|
+
operate/data/contracts/optimism_mintable_erc20/contract.py,sha256=WDaHgB5iugnpkDF_QRKoIPGhJmk___9y97S7nkbpInY,1566
|
|
41
|
+
operate/data/contracts/optimism_mintable_erc20/contract.yaml,sha256=7bde2FbMEmFBae0wdvhpPrxWwm2GeVRb0jobFUJ-8dI,717
|
|
42
|
+
operate/data/contracts/recovery_module/__init__.py,sha256=mkoUIiE0NPmybypzUQbYGHOvU5-PSRH5YP2urAS07hE,868
|
|
43
|
+
operate/data/contracts/recovery_module/build/RecoveryModule.json,sha256=QRfZH_dAjXEhCRZMv3VOyEmSn6vy3ggDgXePLYhv6as,60660
|
|
44
|
+
operate/data/contracts/recovery_module/contract.py,sha256=-9eaMdUBXRN-0GCw3hozbc_ZyvrTAi_R0VGnAcDfiI0,1907
|
|
45
|
+
operate/data/contracts/recovery_module/contract.yaml,sha256=Df170LXxKjty2iqaoueLT_YIaxXJLoo8dAp-pHkjhM4,680
|
|
46
|
+
operate/data/contracts/requester_activity_checker/__init__.py,sha256=BrOe5cib0jItJCsygrAYejy0v16xayRUoJUWubyw1yA,878
|
|
47
|
+
operate/data/contracts/requester_activity_checker/build/RequesterActivityChecker.json,sha256=KbZbZDEred3LvxIY30igz5w9ubaD0-PvDbFdlg7F-y4,9748
|
|
48
|
+
operate/data/contracts/requester_activity_checker/contract.py,sha256=preNvyk8kmtUE0LgEIZMLorYevgCmoxBqI-1STrX0_4,1252
|
|
49
|
+
operate/data/contracts/requester_activity_checker/contract.yaml,sha256=IGMpY4UJ8VEPW9DFwKtL83fM4F0xbgN5HEYh6KMFBg4,749
|
|
50
|
+
operate/data/contracts/staking_token/__init__.py,sha256=9GisClTvLBaDB3MPIYReUCsncyE16_mRA3ZPdPRobmY,859
|
|
51
|
+
operate/data/contracts/staking_token/build/StakingToken.json,sha256=BMaZE6WuyuO9Wd2PBTAMyCD3RyBCDMKBIarXtrFpViE,56490
|
|
52
|
+
operate/data/contracts/staking_token/contract.py,sha256=LDpp-a2quo-rELg_t3Np6nTFdlqrDstJOeok5hr03nE,6366
|
|
53
|
+
operate/data/contracts/staking_token/contract.yaml,sha256=6WJN1cICuj9NydPL3wdy81GtVfpR_9cg_z-Qzr6w1tA,708
|
|
54
|
+
operate/data/contracts/uniswap_v2_erc20/__init__.py,sha256=zrX0ZiB1EjaN5j6fwVMmsrShkGAuAl2xXre65jHCFhk,868
|
|
55
|
+
operate/data/contracts/uniswap_v2_erc20/build/IUniswapV2ERC20.json,sha256=VQE1d4scixqZDRixk21VJnTJtZS8l7mH9ylm0JetILY,14169
|
|
56
|
+
operate/data/contracts/uniswap_v2_erc20/contract.py,sha256=MwBks4QmZ3XouMT_TqWLn7KFpgwyl1x2EphNEiJEHs0,6985
|
|
57
|
+
operate/data/contracts/uniswap_v2_erc20/contract.yaml,sha256=XUdz-XtKtmZgLfItbO8usP-QPbtUkAxKGn0hL7OftAg,741
|
|
58
|
+
operate/data/contracts/uniswap_v2_erc20/tests/__init__.py,sha256=3Arw8dsCsJz6hVOl0t9UjFASHXbV9yp3hw6x4HqgXpU,847
|
|
59
|
+
operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py,sha256=FzZbw9OTcr_yvjOXpk9YcO-K40eyDARyybcfSHDg2Ps,13392
|
|
60
|
+
operate/keys.py,sha256=DqwEnHwGx6XfQKRS86znJ_-Q63AbIYyAx5AT2pSieUk,6139
|
|
61
|
+
operate/ledger/__init__.py,sha256=G0iWcA0Rc-Um8NwpwPJWsQNUQb2tWKyDjzirxPhGc98,6517
|
|
62
|
+
operate/ledger/profiles.py,sha256=ldmpzmvhic6MOvDqslbqbNnLqct-P4EGhym7vbGCvU4,14761
|
|
63
|
+
operate/migration.py,sha256=hdZlhhdkoPPzkOD0CFyNYAp-eqUrVu_PJnw8_PoxpWk,21015
|
|
64
|
+
operate/operate_http/__init__.py,sha256=dxCIVSUos23M4R-PFZZG6k5QrOlEiK0SxhCYSFNxh7U,4711
|
|
65
|
+
operate/operate_http/exceptions.py,sha256=4UFzrn-GyDD71RhkaOyFPBynL6TrrtP3eywaaU3o4fc,1339
|
|
66
|
+
operate/operate_types.py,sha256=lO9mOT76CHIxt9UjcMq-wd2ZMCVtPxSLOAWMWSF1QZU,15843
|
|
67
|
+
operate/pearl.py,sha256=yrTpSXLu_ML3qT-uNxq3kScOyo31JyxBujiSMfMUbcg,1690
|
|
68
|
+
operate/quickstart/analyse_logs.py,sha256=cAeAL2iUy0Po8Eor70tq54-Ibg-Dn8rkuaS167yjE_I,4198
|
|
69
|
+
operate/quickstart/claim_staking_rewards.py,sha256=K7X1Yq0mxe3qWmFLb1Xu9-Jghhml95lS_LpM_BXii0o,3533
|
|
70
|
+
operate/quickstart/reset_configs.py,sha256=DVPM4mh6Djunwq16hf8lD9-nGkkm7wVtwr2JUXr1if8,3380
|
|
71
|
+
operate/quickstart/reset_password.py,sha256=jEBk2ROR1q8PkTIHlqum7E8PRQtXHwrauiy0_bik3RQ,2394
|
|
72
|
+
operate/quickstart/reset_staking.py,sha256=SB5LZq9EctG4SYn2M6oPZ7R7ARHSFLRGzAqfKkpRcy0,5111
|
|
73
|
+
operate/quickstart/run_service.py,sha256=eyMrUK5pL1uPilRHE_IfK6Uhrx1qNyslU2ubDAErpL0,28123
|
|
74
|
+
operate/quickstart/stop_service.py,sha256=a3-1vVyZma2UtFUPKMvVrOso1Iwpz5Rzpus9VAI4qOc,2169
|
|
75
|
+
operate/quickstart/terminate_on_chain_service.py,sha256=5ENU8_mkj06i80lKUX-v1QbLU0YzKeOZDUL1e_jzySE,2914
|
|
76
|
+
operate/quickstart/utils.py,sha256=jvi7IgPtJEWf7-ciZFyEh_jgNthhv3Pus4VZa_Ha_ms,9221
|
|
77
|
+
operate/resource.py,sha256=MnLdoEV68vQkaoClMFEJqkuxvqBQSIySuKym6h61Pk4,5741
|
|
78
|
+
operate/services/__init__.py,sha256=isrThS-Ccu5Sc15JZgkN4uTAVaSg-NwUUSDeTyJEqLk,855
|
|
79
|
+
operate/services/agent_runner.py,sha256=IQ9DAirYZAqWIk30CdU9mO0tVMymdj5LW5O3l8Uhj2w,7433
|
|
80
|
+
operate/services/deployment_runner.py,sha256=7A94QpZu100BwIk1Q9Cr0SVK5Sj7nTWx2GRCwr0gvaM,30772
|
|
81
|
+
operate/services/funding_manager.py,sha256=S9jYnRQe2m6QDVrkvGS11KFYkbTPrZc0zNygahukHVs,38621
|
|
82
|
+
operate/services/health_checker.py,sha256=dARikrgzU1jEuK4NUqlZ7N0DQq4Ah1ZiRKHmrlh8v-A,11472
|
|
83
|
+
operate/services/manage.py,sha256=EFZn_sUGn_WMvDecT6VW7yl-N-Q3nLooWXAaldipEfg,113703
|
|
84
|
+
operate/services/protocol.py,sha256=DHu3TzaDuwTtidoEp7kGlbTAWw8pPbLjbyvanuyyjJs,72285
|
|
85
|
+
operate/services/service.py,sha256=GqeS8Fm-iA8UPb4QdDWSHa5uZ-Or0G7po7qT0WfUJWI,45348
|
|
86
|
+
operate/services/utils/__init__.py,sha256=TvioaZ1mfTRUSCtrQoLNAp4WMVXyqEJqFJM4PxSQCRU,24
|
|
87
|
+
operate/services/utils/mech.py,sha256=W2x4dqodivNKXjWU-Brp40QhoUHsIMyNAO7-caMoR0Q,3821
|
|
88
|
+
operate/services/utils/tendermint.py,sha256=3h9nDb2Z89T0RwUr_AaVjqtymQmsu3u6DAVCfL_k1U0,25591
|
|
89
|
+
operate/settings.py,sha256=0J2E69-Oplo-Ijy-7rzYHc2Q9Xvct-EUMiEdmKKaYOQ,2353
|
|
90
|
+
operate/utils/__init__.py,sha256=EXZ5SQFszLr4qr5oq9bCJ7L4zdjqP6tSCaoOudHyLBQ,5110
|
|
91
|
+
operate/utils/gnosis.py,sha256=iyaFw3ZMlNnd1lDulhXfcYxQunPL4Zfhnk1fy20ga7g,19843
|
|
92
|
+
operate/utils/single_instance.py,sha256=pmtumg0fFDWWcGzXFXQdLXSW54Zq9qBKgJTEPF6pVW8,9092
|
|
93
|
+
operate/utils/ssl.py,sha256=O5DrDoZD4T4qQuHP8GLwWUVxQ-1qXeefGp6uDJiF2lM,4308
|
|
94
|
+
operate/wallet/__init__.py,sha256=NGiozD3XhvkBi7_FaOWQ8x1thZPK4uGpokJaeDY_o2w,813
|
|
95
|
+
operate/wallet/master.py,sha256=ehXfxQXKRheFFisIQNpntdfYf3DPt9yYJHzkzksuRZI,33897
|
|
96
|
+
operate/wallet/wallet_recovery_manager.py,sha256=DJR4bjC3zZv8pNaLbhfYaunsTGqyeM7hK0aI9c8RqvY,19720
|
|
97
|
+
olas_operate_middleware-0.13.2.dist-info/METADATA,sha256=MU6ckfci69OtXJueVskXCf1Sg8jW5KzZp3UqZoQqMQY,2139
|
|
98
|
+
olas_operate_middleware-0.13.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
99
|
+
olas_operate_middleware-0.13.2.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
|
|
100
|
+
olas_operate_middleware-0.13.2.dist-info/licenses/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
|
|
101
|
+
olas_operate_middleware-0.13.2.dist-info/RECORD,,
|
operate/__init__.py
CHANGED
|
@@ -18,3 +18,20 @@
|
|
|
18
18
|
# ------------------------------------------------------------------------------
|
|
19
19
|
|
|
20
20
|
"""Operate app."""
|
|
21
|
+
|
|
22
|
+
import logging
|
|
23
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
# Prefer the distribution name if installed; fall back to the module name
|
|
28
|
+
__version__ = version("olas-operate-middleware")
|
|
29
|
+
except PackageNotFoundError:
|
|
30
|
+
try:
|
|
31
|
+
__version__ = version("operate")
|
|
32
|
+
except PackageNotFoundError:
|
|
33
|
+
logger = logging.getLogger("operate")
|
|
34
|
+
logger.warning("Could not determine version, using 0.0.0+local")
|
|
35
|
+
__version__ = "0.0.0+local"
|
|
36
|
+
|
|
37
|
+
logging.getLogger("aea").setLevel(logging.ERROR)
|
operate/account/user.py
CHANGED
|
@@ -23,21 +23,22 @@ import hashlib
|
|
|
23
23
|
from dataclasses import dataclass
|
|
24
24
|
from pathlib import Path
|
|
25
25
|
|
|
26
|
+
import argon2
|
|
27
|
+
|
|
26
28
|
from operate.resource import LocalResource
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
def
|
|
30
|
-
"""Get
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return sh256.hexdigest()
|
|
31
|
+
def argon2id(password: str) -> str:
|
|
32
|
+
"""Get Argon2id digest of a password."""
|
|
33
|
+
ph = argon2.PasswordHasher() # Defaults to Argon2id
|
|
34
|
+
return ph.hash(password)
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
@dataclass
|
|
37
38
|
class UserAccount(LocalResource):
|
|
38
39
|
"""User account."""
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
password_hash: str
|
|
41
42
|
path: Path
|
|
42
43
|
|
|
43
44
|
@classmethod
|
|
@@ -49,7 +50,7 @@ class UserAccount(LocalResource):
|
|
|
49
50
|
def new(cls, password: str, path: Path) -> "UserAccount":
|
|
50
51
|
"""Create a new user."""
|
|
51
52
|
user = UserAccount(
|
|
52
|
-
|
|
53
|
+
password_hash=argon2id(password=password),
|
|
53
54
|
path=path,
|
|
54
55
|
)
|
|
55
56
|
user.store()
|
|
@@ -57,11 +58,36 @@ class UserAccount(LocalResource):
|
|
|
57
58
|
|
|
58
59
|
def is_valid(self, password: str) -> bool:
|
|
59
60
|
"""Check if a password string is valid."""
|
|
60
|
-
|
|
61
|
+
try:
|
|
62
|
+
ph = argon2.PasswordHasher()
|
|
63
|
+
valid = ph.verify(self.password_hash, password)
|
|
64
|
+
|
|
65
|
+
if valid and ph.check_needs_rehash(self.password_hash):
|
|
66
|
+
self.password_hash = argon2id(password)
|
|
67
|
+
self.store()
|
|
68
|
+
|
|
69
|
+
return valid
|
|
70
|
+
except argon2.exceptions.VerificationError:
|
|
71
|
+
return False
|
|
72
|
+
except argon2.exceptions.InvalidHashError:
|
|
73
|
+
# Verify legacy password hash and update it to Argon2id if valid
|
|
74
|
+
sha256 = hashlib.sha256()
|
|
75
|
+
sha256.update(password.encode())
|
|
76
|
+
if sha256.hexdigest() == self.password_hash:
|
|
77
|
+
self.password_hash = argon2id(password=password)
|
|
78
|
+
self.store()
|
|
79
|
+
return True
|
|
80
|
+
|
|
81
|
+
return False
|
|
61
82
|
|
|
62
83
|
def update(self, old_password: str, new_password: str) -> None:
|
|
63
84
|
"""Update current password."""
|
|
64
85
|
if not self.is_valid(password=old_password):
|
|
65
86
|
raise ValueError("Old password is not valid")
|
|
66
|
-
self.
|
|
87
|
+
self.password_hash = argon2id(password=new_password)
|
|
88
|
+
self.store()
|
|
89
|
+
|
|
90
|
+
def force_update(self, new_password: str) -> None:
|
|
91
|
+
"""Force update current password."""
|
|
92
|
+
self.password_hash = argon2id(password=new_password)
|
|
67
93
|
self.store()
|