platon-env


Nameplaton-env JSON
Version 1.3.5 PyPI version JSON
download
home_pagehttps://github.com/shinnng/platon-env
SummaryCommon library to deployment platon chain
upload_time2023-01-11 04:16:51
maintainer
docs_urlNone
authorShinnng
requires_python
licenseMIT
keywords platon
VCS
bugtrack_url
requirements dacite fabric loguru paramiko platon_aide platon_keys platon_utils ruamel.base rwlock
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # platon-env
PlatON区块链部署工具,能够帮你自由的部链、加入、管理PlatON区块链


## 安装方法
```shell
pip install platon_env
```


## 使用方法
```python
from platon_env.chain import Chain

# 按照配置文件内容,部署区块链
chain_file = 'env-files/chain_file.yml'
chain = Chain.from_file(chain_file)
chain.install()
```


## 配置文件

```yml
chain:
  platon: env-files/bin/platon  # platon二进制
  network: private  # 网络形式,支持private、public,为private时必须指定genesis
  genesis: env-files/genesis.json  # 创世文件
  keystore: env-files/keystore  # 要上传到节点的钱包文件,支持文件或目录形式(每个节点都会上传)
  ssl: false  # 使用基于https、wss使用rlp
  deploy_dir: chain  # 节点要部署到远程主机的哪个路径
  init:
    # 节点公共信息,每个节点可以单独指定
    username: platon
    password: Platon123!
    ssh_port: 22
    p2p_port: 16789
    options: '--graphql --http --http.addr 0.0.0.0 --http.port 6789 --http.api web3,platon,txpool,net,admin,personal,debug --http.ethcompatible --ws --ws.addr 0.0.0.0 --ws.port 6790 --wsapi web3,platon,txpool,net,admin,personal,debug --ws.origins "*" --allow-insecure-unlock --txpool.nolocals --nodiscover --db.nogc --debug --verbosity 5'
    nodes:
      - host: 192.168.120.121
        node_id: 18e5d83b36e1959206b5e582053ae994a00731ccbd7d7ddb6ac7d07eab6ee1d859af91784da6d05336ae04cd96bfc0ae7732818fb2c7ac10e4986a591258239d
        node_key: 193181eeed7d209726f4f2302957b1d1f4f358f563a466a25aa44653bc2a3f2e
        bls_pubkey: d2c26ea474e89da808adc9cc3b8c857c1c5457e607b6f138dbe2f4f180613bcdcb533301e3de497a92f922ae99cd390f23e2872c95319a8d7ff40dc1b72cb568774df227a6543e9fec37c77d9032e9206f3ac8e219f5a71779a1d54779f85393
        bls_prikey: b5791a67118556a322c3609ea0cc21b9d1d51d1755104c130ab9a4d0c6b6b336
      - host: 192.168.120.122
        node_id: 94098f49eb8a8e4b2d37e693677c0777ee2b0bad072e46cc506f51c058f3737ea8d41e723ff9c34d9677c1abdde1dbb30780fa69b752148165228ef2f82194c2
        node_key: 936309fded6a2fff7401905eb09eece224a23dc944191f981f9d608961f367da
        bls_pubkey: e6e593cfa009a85ab91683a26e701f1c68e460ce0e25284d5e22949f39800d1bd5e21c8604c538f0db0bd3bc79d22d0a25bcc3ba8927a8a3cd05ba045fc3e52bb061b53ac45968830e248d7fa18ca3d9b452bf0c1690411a0304aa55fe139d89
        bls_prikey: b728d85bdf2c935b5718f42cf7492aef98098476b6dc796da082ab73969ccf05
      - host: 192.168.120.123
        node_id: 3e85fbbc561d91ddb7a8b263a65508040a1c5d6e79f2fb823a32dfb011b578e913522587be2a1f8ac2a86900daa6b0ce3aac43a388d1a900118a68047eedb8ba
        node_key: 4bb99dd4b3d64cd1719c30cda95a4ff3b07503bbbf0c7d83f3dda10f1e589356
        bls_pubkey: e00fba1c3388382505753ab53a37efa411877fabdd7a33481f9c9edce033c67d5f5487a637499c90ba147f95d51266003409b14ed4dbf07f923c093f60ae9f5c02447c136e47290ffbf9490f3a2e06f354d3f0ee88719773ed97b857032f9905
        bls_prikey: 0df00258db84cdac012a6e2b2d70c96c78474c3b4c8558eedd87f03b08fbd462
      - host: 192.168.120.124
        node_id: 4b9015c94a2fea0c1f9472a6925a3ea2f951a606222ab231a31310e15d8c272545ee06e6895fc5ad384fc2cacde359ab452069643ef1fb7a4e87539a1a2283de
        node_key: 6d8cd70325e43ea12bf47fca53b4f4aaee9f36519bf1919c39e0deaa8d5713e7
        bls_pubkey: c2c67121901f37be5c56ed6e303a0ee11070b1447cfd09dcff283a5dc30dda729dcc4d96d26b49b8bd71de733db3440fc9cf9253bdc67ea8c8ed204d6d0784e60a38e416b3c5b56cf1e895dfff2fa07f98f1d0bc12f8186f68af9ee53c636d0b
        bls_prikey: 1ce1918e8561bae51d2cfd3edb03612f504461884e3253ee9bd4f684b1791e4b
  normal:
    # 节点公共信息,每个节点可以单独指定
    username: platon
    password: Platon123!
    ssh_port: 22
    p2p_port: 17789
    options: '--graphql --http --http.addr 0.0.0.0 --http.port 7789 --http.api web3,platon,txpool,net,admin,personal,debug --http.ethcompatible --ws --ws.addr 0.0.0.0 --ws.port 7790 --wsapi web3,platon,txpool,net,admin,personal,debug --ws.origins "*" --allow-insecure-unlock --txpool.nolocals --nodiscover --db.nogc --debug --verbosity 5'
    nodes:
      - host: 192.168.120.121
        node_id: d5cce29d07a066eae8fe4a34049cbd2d68d92bf02bc618ae2d43f0b355ad1678c2e447ae3fcf18296f8c4434d83de3546854b166f379c250a6cb10702383407e
        node_key: a0f2d594e24be366889207a9379d46a0080fde197f2211b71bfcee8883a1daff
        bls_pubkey: 3b73fdfa4af6fb84873c06ad89eda5de72d3b8f0f8572d2a85479afcf4d6889e9da127dc6dea597ad83abf8ed61484097496cdf1cd6712e453caef2c6ceb06654b894e986f7d0bfd8ecda12f9345264f750f73d621d916becb5aaec1fbf78e0d
        bls_prikey: d168ab9a60dd97781d3ffd8e47cf897124d5b2a8c6d5d1f9c9859b8a646cb935
      - host: 192.168.120.122
        node_id: a5880c17478c173f407e38c997c4defe290779d15dda19a1e1bd5ca66429006cd7007fd8e1590df120f6f590c3aa054bbb29d0ab01b48a52ede6e4bd53c82c12
        node_key: d82486ddb342f3568d08644b23a85d5e83d72f76417a423e229a65e7828e10d2
        bls_pubkey: 64dec26c755c0b08f7e7e80b0e299cf273e2a8ee26540fa16ca9287c2d9a7076f6d9971bf5974b2b8e9e86858a27130f570a682dcd12074a35051d8a1ab86934efbddffa1e9c110851447c0ea849d90bd808d9f683786fbbfb184fc7dba4aa13
        bls_prikey: 5928f389e6f102719b69c5dae5573eb20bd3abdfa9e347a9e4382f8f3cbd2839
      - host: 192.168.120.123
        node_id: 230d7bf50fdfb4009b51fe31c1387a74d6df7caabcd4b64aa609e9071292a5cce0bfbe9e9ff33bdd7da5d05604d395ecf5046425d2eb20cca880eaae3359e224
        node_key: 8ed2bdfb2c6766db4b5505c54b7b56c862408cb86bc876ab89c826f825c60b15
        bls_pubkey: 34f14b10ae3d107678d118a4a6370efde95d7162ed07f0538e6442d6b82921bba5513b37952525aad86b97604be15e0d5cf6d35ea9b09843e441f011f7852de244e20017a64db4e8b4e0afa18add690fed09cba5e8fa4b928a22d90c1cd15597
        bls_prikey: 1c8545964a63699267dd8c76e7f8e7134dd18db7ee8ed830a359a584cbb3bb35
      - host: 192.168.120.124
        node_id: 94be7422fec178f07cc1071d2de8b856dbb082518143b91b7a22467944a2d9ef78fd3559fb73437069a908a0042f7613fe73bb4fc80c11a76c35b43eed2079c2
        node_key: 2d4472a210ce437181b0332cf25863cea597348ec4170d91978b7ddcbc185085
        bls_pubkey: ab0f251830934d41eff50b811c8c056c0ff5ae60d4e1f12a76a0c429c50d76ca7c26ca698fec5eab3706cd5998b78d0d2c4cf45cb4ea9255229951fc8ea442d815c916c403ba877f396c2579d80812eb5f074d62d6bf749070ade651fc51db05
        bls_prikey: d5e8a21ad50d87284a3001747b093f768d4b6d3696418a5268288be221262420
  ```




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shinnng/platon-env",
    "name": "platon-env",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "platon",
    "author": "Shinnng",
    "author_email": "shinnng@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/fd/bb/70c3082a73c22a67459711c854cbe706abd6337cdc60a43fcb3a56d5673d/platon-env-1.3.5.tar.gz",
    "platform": null,
    "description": "# platon-env\nPlatON\u533a\u5757\u94fe\u90e8\u7f72\u5de5\u5177\uff0c\u80fd\u591f\u5e2e\u4f60\u81ea\u7531\u7684\u90e8\u94fe\u3001\u52a0\u5165\u3001\u7ba1\u7406PlatON\u533a\u5757\u94fe\n\n\n## \u5b89\u88c5\u65b9\u6cd5\n```shell\npip install platon_env\n```\n\n\n## \u4f7f\u7528\u65b9\u6cd5\n```python\nfrom platon_env.chain import Chain\n\n# \u6309\u7167\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\uff0c\u90e8\u7f72\u533a\u5757\u94fe\nchain_file = 'env-files/chain_file.yml'\nchain = Chain.from_file(chain_file)\nchain.install()\n```\n\n\n## \u914d\u7f6e\u6587\u4ef6\n\n```yml\nchain:\n  platon: env-files/bin/platon  # platon\u4e8c\u8fdb\u5236\n  network: private  # \u7f51\u7edc\u5f62\u5f0f\uff0c\u652f\u6301private\u3001public\uff0c\u4e3aprivate\u65f6\u5fc5\u987b\u6307\u5b9agenesis\n  genesis: env-files/genesis.json  # \u521b\u4e16\u6587\u4ef6\n  keystore: env-files/keystore  # \u8981\u4e0a\u4f20\u5230\u8282\u70b9\u7684\u94b1\u5305\u6587\u4ef6\uff0c\u652f\u6301\u6587\u4ef6\u6216\u76ee\u5f55\u5f62\u5f0f\uff08\u6bcf\u4e2a\u8282\u70b9\u90fd\u4f1a\u4e0a\u4f20\uff09\n  ssl: false  # \u4f7f\u7528\u57fa\u4e8ehttps\u3001wss\u4f7f\u7528rlp\n  deploy_dir: chain  # \u8282\u70b9\u8981\u90e8\u7f72\u5230\u8fdc\u7a0b\u4e3b\u673a\u7684\u54ea\u4e2a\u8def\u5f84\n  init:\n    # \u8282\u70b9\u516c\u5171\u4fe1\u606f\uff0c\u6bcf\u4e2a\u8282\u70b9\u53ef\u4ee5\u5355\u72ec\u6307\u5b9a\n    username: platon\n    password: Platon123!\n    ssh_port: 22\n    p2p_port: 16789\n    options: '--graphql --http --http.addr 0.0.0.0 --http.port 6789 --http.api web3,platon,txpool,net,admin,personal,debug --http.ethcompatible --ws --ws.addr 0.0.0.0 --ws.port 6790 --wsapi web3,platon,txpool,net,admin,personal,debug --ws.origins \"*\" --allow-insecure-unlock --txpool.nolocals --nodiscover --db.nogc --debug --verbosity 5'\n    nodes:\n      - host: 192.168.120.121\n        node_id: 18e5d83b36e1959206b5e582053ae994a00731ccbd7d7ddb6ac7d07eab6ee1d859af91784da6d05336ae04cd96bfc0ae7732818fb2c7ac10e4986a591258239d\n        node_key: 193181eeed7d209726f4f2302957b1d1f4f358f563a466a25aa44653bc2a3f2e\n        bls_pubkey: d2c26ea474e89da808adc9cc3b8c857c1c5457e607b6f138dbe2f4f180613bcdcb533301e3de497a92f922ae99cd390f23e2872c95319a8d7ff40dc1b72cb568774df227a6543e9fec37c77d9032e9206f3ac8e219f5a71779a1d54779f85393\n        bls_prikey: b5791a67118556a322c3609ea0cc21b9d1d51d1755104c130ab9a4d0c6b6b336\n      - host: 192.168.120.122\n        node_id: 94098f49eb8a8e4b2d37e693677c0777ee2b0bad072e46cc506f51c058f3737ea8d41e723ff9c34d9677c1abdde1dbb30780fa69b752148165228ef2f82194c2\n        node_key: 936309fded6a2fff7401905eb09eece224a23dc944191f981f9d608961f367da\n        bls_pubkey: e6e593cfa009a85ab91683a26e701f1c68e460ce0e25284d5e22949f39800d1bd5e21c8604c538f0db0bd3bc79d22d0a25bcc3ba8927a8a3cd05ba045fc3e52bb061b53ac45968830e248d7fa18ca3d9b452bf0c1690411a0304aa55fe139d89\n        bls_prikey: b728d85bdf2c935b5718f42cf7492aef98098476b6dc796da082ab73969ccf05\n      - host: 192.168.120.123\n        node_id: 3e85fbbc561d91ddb7a8b263a65508040a1c5d6e79f2fb823a32dfb011b578e913522587be2a1f8ac2a86900daa6b0ce3aac43a388d1a900118a68047eedb8ba\n        node_key: 4bb99dd4b3d64cd1719c30cda95a4ff3b07503bbbf0c7d83f3dda10f1e589356\n        bls_pubkey: e00fba1c3388382505753ab53a37efa411877fabdd7a33481f9c9edce033c67d5f5487a637499c90ba147f95d51266003409b14ed4dbf07f923c093f60ae9f5c02447c136e47290ffbf9490f3a2e06f354d3f0ee88719773ed97b857032f9905\n        bls_prikey: 0df00258db84cdac012a6e2b2d70c96c78474c3b4c8558eedd87f03b08fbd462\n      - host: 192.168.120.124\n        node_id: 4b9015c94a2fea0c1f9472a6925a3ea2f951a606222ab231a31310e15d8c272545ee06e6895fc5ad384fc2cacde359ab452069643ef1fb7a4e87539a1a2283de\n        node_key: 6d8cd70325e43ea12bf47fca53b4f4aaee9f36519bf1919c39e0deaa8d5713e7\n        bls_pubkey: c2c67121901f37be5c56ed6e303a0ee11070b1447cfd09dcff283a5dc30dda729dcc4d96d26b49b8bd71de733db3440fc9cf9253bdc67ea8c8ed204d6d0784e60a38e416b3c5b56cf1e895dfff2fa07f98f1d0bc12f8186f68af9ee53c636d0b\n        bls_prikey: 1ce1918e8561bae51d2cfd3edb03612f504461884e3253ee9bd4f684b1791e4b\n  normal:\n    # \u8282\u70b9\u516c\u5171\u4fe1\u606f\uff0c\u6bcf\u4e2a\u8282\u70b9\u53ef\u4ee5\u5355\u72ec\u6307\u5b9a\n    username: platon\n    password: Platon123!\n    ssh_port: 22\n    p2p_port: 17789\n    options: '--graphql --http --http.addr 0.0.0.0 --http.port 7789 --http.api web3,platon,txpool,net,admin,personal,debug --http.ethcompatible --ws --ws.addr 0.0.0.0 --ws.port 7790 --wsapi web3,platon,txpool,net,admin,personal,debug --ws.origins \"*\" --allow-insecure-unlock --txpool.nolocals --nodiscover --db.nogc --debug --verbosity 5'\n    nodes:\n      - host: 192.168.120.121\n        node_id: d5cce29d07a066eae8fe4a34049cbd2d68d92bf02bc618ae2d43f0b355ad1678c2e447ae3fcf18296f8c4434d83de3546854b166f379c250a6cb10702383407e\n        node_key: a0f2d594e24be366889207a9379d46a0080fde197f2211b71bfcee8883a1daff\n        bls_pubkey: 3b73fdfa4af6fb84873c06ad89eda5de72d3b8f0f8572d2a85479afcf4d6889e9da127dc6dea597ad83abf8ed61484097496cdf1cd6712e453caef2c6ceb06654b894e986f7d0bfd8ecda12f9345264f750f73d621d916becb5aaec1fbf78e0d\n        bls_prikey: d168ab9a60dd97781d3ffd8e47cf897124d5b2a8c6d5d1f9c9859b8a646cb935\n      - host: 192.168.120.122\n        node_id: a5880c17478c173f407e38c997c4defe290779d15dda19a1e1bd5ca66429006cd7007fd8e1590df120f6f590c3aa054bbb29d0ab01b48a52ede6e4bd53c82c12\n        node_key: d82486ddb342f3568d08644b23a85d5e83d72f76417a423e229a65e7828e10d2\n        bls_pubkey: 64dec26c755c0b08f7e7e80b0e299cf273e2a8ee26540fa16ca9287c2d9a7076f6d9971bf5974b2b8e9e86858a27130f570a682dcd12074a35051d8a1ab86934efbddffa1e9c110851447c0ea849d90bd808d9f683786fbbfb184fc7dba4aa13\n        bls_prikey: 5928f389e6f102719b69c5dae5573eb20bd3abdfa9e347a9e4382f8f3cbd2839\n      - host: 192.168.120.123\n        node_id: 230d7bf50fdfb4009b51fe31c1387a74d6df7caabcd4b64aa609e9071292a5cce0bfbe9e9ff33bdd7da5d05604d395ecf5046425d2eb20cca880eaae3359e224\n        node_key: 8ed2bdfb2c6766db4b5505c54b7b56c862408cb86bc876ab89c826f825c60b15\n        bls_pubkey: 34f14b10ae3d107678d118a4a6370efde95d7162ed07f0538e6442d6b82921bba5513b37952525aad86b97604be15e0d5cf6d35ea9b09843e441f011f7852de244e20017a64db4e8b4e0afa18add690fed09cba5e8fa4b928a22d90c1cd15597\n        bls_prikey: 1c8545964a63699267dd8c76e7f8e7134dd18db7ee8ed830a359a584cbb3bb35\n      - host: 192.168.120.124\n        node_id: 94be7422fec178f07cc1071d2de8b856dbb082518143b91b7a22467944a2d9ef78fd3559fb73437069a908a0042f7613fe73bb4fc80c11a76c35b43eed2079c2\n        node_key: 2d4472a210ce437181b0332cf25863cea597348ec4170d91978b7ddcbc185085\n        bls_pubkey: ab0f251830934d41eff50b811c8c056c0ff5ae60d4e1f12a76a0c429c50d76ca7c26ca698fec5eab3706cd5998b78d0d2c4cf45cb4ea9255229951fc8ea442d815c916c403ba877f396c2579d80812eb5f074d62d6bf749070ade651fc51db05\n        bls_prikey: d5e8a21ad50d87284a3001747b093f768d4b6d3696418a5268288be221262420\n  ```\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Common library to deployment platon chain",
    "version": "1.3.5",
    "split_keywords": [
        "platon"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87309d77bb66ec7ebe2198195618f2bfddeca7e7dd0e42ba547f97974bea97cc",
                "md5": "71097ed04b73421475bb5c86f7220486",
                "sha256": "cf454a6b79af55eee2eea14abe7503c7434d2b7e322b43e3611a665a09455b02"
            },
            "downloads": -1,
            "filename": "platon_env-1.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "71097ed04b73421475bb5c86f7220486",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 26283351,
            "upload_time": "2023-01-11T04:16:30",
            "upload_time_iso_8601": "2023-01-11T04:16:30.731470Z",
            "url": "https://files.pythonhosted.org/packages/87/30/9d77bb66ec7ebe2198195618f2bfddeca7e7dd0e42ba547f97974bea97cc/platon_env-1.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdbb70c3082a73c22a67459711c854cbe706abd6337cdc60a43fcb3a56d5673d",
                "md5": "3acae7c0e0552f824a6cd7f8cb352700",
                "sha256": "50af3e9f0b69ec017af143e84b81bce25a8776747214f56065167d526710e282"
            },
            "downloads": -1,
            "filename": "platon-env-1.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "3acae7c0e0552f824a6cd7f8cb352700",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26091707,
            "upload_time": "2023-01-11T04:16:51",
            "upload_time_iso_8601": "2023-01-11T04:16:51.944333Z",
            "url": "https://files.pythonhosted.org/packages/fd/bb/70c3082a73c22a67459711c854cbe706abd6337cdc60a43fcb3a56d5673d/platon-env-1.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-11 04:16:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "shinnng",
    "github_project": "platon-env",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "dacite",
            "specs": [
                [
                    "==",
                    "1.6.0"
                ]
            ]
        },
        {
            "name": "fabric",
            "specs": [
                [
                    "==",
                    "2.7.0"
                ]
            ]
        },
        {
            "name": "loguru",
            "specs": [
                [
                    "==",
                    "0.5.3"
                ]
            ]
        },
        {
            "name": "paramiko",
            "specs": [
                [
                    "==",
                    "2.8.0"
                ]
            ]
        },
        {
            "name": "platon_aide",
            "specs": [
                [
                    ">=",
                    "1.2.5"
                ]
            ]
        },
        {
            "name": "platon_keys",
            "specs": [
                [
                    ">=",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "platon_utils",
            "specs": [
                [
                    ">=",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "ruamel.base",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "rwlock",
            "specs": [
                [
                    "==",
                    "0.0.7"
                ]
            ]
        }
    ],
    "lcname": "platon-env"
}
        
Elapsed time: 0.05536s