{"id":19478816,"url":"https://github.com/patara43/crust-interface-patara","last_synced_at":"2026-05-09T05:34:00.410Z","repository":{"id":48519201,"uuid":"516930253","full_name":"PaTara43/crust-interface-patara","owner":"PaTara43","description":"A simple tool to interact with Crust Shadow and Crust Mainnet. Under development","archived":false,"fork":false,"pushed_at":"2024-04-04T17:29:11.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T04:35:54.527Z","etag":null,"topics":["crust","ipfs","python","substrate","web3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaTara43.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-23T01:38:31.000Z","updated_at":"2023-02-07T11:39:00.000Z","dependencies_parsed_at":"2024-09-30T15:07:13.724Z","dependency_job_id":"c87a0ec7-a5cd-447e-9bdf-bfa4b0fc4d12","html_url":"https://github.com/PaTara43/crust-interface-patara","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"6bf2bbb13817566dc13a70d2e98abe99d7872c60"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaTara43%2Fcrust-interface-patara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaTara43%2Fcrust-interface-patara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaTara43%2Fcrust-interface-patara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaTara43%2Fcrust-interface-patara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaTara43","download_url":"https://codeload.github.com/PaTara43/crust-interface-patara/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240709753,"owners_count":19845039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crust","ipfs","python","substrate","web3"],"created_at":"2024-11-10T19:51:37.610Z","updated_at":"2025-09-19T10:41:37.437Z","avatar_url":"https://github.com/PaTara43.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crust-file-uploader\n\nhttps://crust.network/\nhttps://apps.crust.network/\nhttps://wiki.crust.network/en\nhttps://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-shadow.crust.network%2F#/explorer\n\nThis is a simple tool to pin your files sing Crust Network or Crust Shadow.\n\n## Setup\n### Installation:\n```bash\npip3 install crust-interface-patara\n```\n\n## Features\n\nThe module is divided into `Mainnet` and `Shadow`\n\n`Mainnet` provides Crust interaction functionality to check user balance, calculate file storage price, placing\nfile storage order, add tokens to renewal pool and checking replicas count.\n\n```python\nimport time\nfrom crustinterface import Mainnet\nfrom substrateinterface import KeypairType\n\nseed = \"seed\"\nmainnet = Mainnet(seed=seed, crypto_type=KeypairType.SR25519)\n\n# get any IPFS CID and size\ncid, size =  \"QmbJtyu82TQSHU52AzRMXBENZGQKYqPsmao9dPuTeorPui\", 18  # \u003cany way to get an IPFS CID and size. One may use ipfshttpclient2 from IPFS-Toolkit\u003e\n\n# Check balance\nbalance = mainnet.get_balance()\nprint(balance)\n\n# Check price in Main net. Price in pCRUs\nprice = mainnet.get_appx_store_price(int(size))\nprint(price)\n\n# Store file in Mainnet for CRUs\nfile_stored = mainnet.store_file(cid, size)\nprint(file_stored)\n\n# Add renewal pool\nfile_prepaid = mainnet.add_renewal_pool_balance(cid, price*2)\nprint(file_prepaid)\n\n\n# Get replicas\ntime.sleep(10)\nreplicas = mainnet.get_replicas(cid)\nprint(replicas)\n\n```\n\n`Shadow` allows you to perform `Xstorage` extrinsic in Crust Shadow network.\n```python\nfrom crustinterface import Shadow\nfrom substrateinterface import KeypairType\n\nseed = \"seed\"\nshadow = Shadow(seed=seed, crypto_type=KeypairType.SR25519)\n\n# get any IPFS CID and size\ncid, size =  \"QmbJtyu82TQSHU52AzRMXBENZGQKYqPsmao9dPuTeorPui\", 18  # \u003cany way to get an IPFS CID and size. One may use ipfshttpclient2 from IPFS-Toolkit\u003e\n\nprint(cid, size)\n\n# Check balance\nbalance = shadow.get_balance()\nprint(balance)\n\n# Store file in Shadow for CSMs\nfile_stored = shadow.store_file(cid, size)\nprint(file_stored)\n```\n\n`Parachain` allows you to perform `Xstorage` extrinsic in Crust Polkadot Parachain network.\n```python\nfrom crustinterface import Parachain\nfrom substrateinterface import KeypairType\n\nseed = \"seed\"\nparachain = Parachain(seed=seed, crypto_type=KeypairType.SR25519)\n\n# get any IPFS CID and size\ncid, size =  \"QmbJtyu82TQSHU52AzRMXBENZGQKYqPsmao9dPuTeorPui\", 18  # \u003cany way to get an IPFS CID and size. One may use ipfshttpclient2 from IPFS-Toolkit\u003e\n\nprint(cid, size)\n\n# Check balance\nbalance = parachain.get_balance()\nprint(balance)\n\n# Store file in Shadow for CSMs\nfile_stored = parachain.store_file(cid, size)\nprint(file_stored)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatara43%2Fcrust-interface-patara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatara43%2Fcrust-interface-patara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatara43%2Fcrust-interface-patara/lists"}