dark-gateway


Namedark-gateway JSON
Version 1.5 PyPI version JSON
download
home_pagehttps://github.com/dark-pid/dark-web3-lib
SummarydARK Gateway libs
upload_time2023-12-05 14:20:37
maintainer
docs_urlNone
authorThiago Nóbrega
requires_python
license
keywords ark dark pid web3
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# dark-gateway

dARK Web3 Core Lib

## How to use

We created a [notebook](./docs/example_notebooks/basic_dark_usage.ipynb) to ilustrate how to use the dark-gateway lib


## Main components

### DarkGateway

The DarkGateway class is a Python class that provides a simple interface to interact with the dARK blockchain. The class is initialized with the name of the blockchain network and the configuration file. The configuration file specifies the URL of the blockchain node, the chain ID, and the minimum gas price.

Once the class is initialized, you can use it to send transactions, query the blockchain state, and interact with smart contracts. To send a transaction, you need to specify the smart contract, the method to call, and the arguments to pass to the method. The class will then sign the transaction and send it to the blockchain.

To query the blockchain state, you can use the get_balance method to get the balance of an address, or the get_transaction_receipt method to get the receipt of a transaction.

To interact with smart contracts, you can use the call method to call a function on a smart contract, or the transact method to send a transaction to a smart contract.

The DarkGateway class is a powerful tool that can be used to interact with the Darkweb blockchain. It provides a simple and easy-to-use interface that makes it easy to send transactions, query the blockchain state, and interact with smart contracts.

Here are some of the specific things that the DarkGateway class can do:

- Send transactions
- Query the blockchain state
- Interact with smart contracts
- Get the balance of an address
- Get the receipt of a transaction
- Call a function on a smart contract
- Send a transaction to a smart contract


### DarkMap
A Python class that provides a simple interface to interact with the Darkweb blockchain. It inherits from the `DarkGateway` class and adds some additional methods for interacting with the blockchain.

#### Methods

The `DarkMap` class has two main types of methods:

* **Sync methods:** These methods block until the operation is complete.
* **Async methods:** These methods return a future object that can be used to get the result of the operation.

The `DarkMap` class also has some utility methods for converting between different types of identifiers, such as the hash value of a PID and its ARK identifier.

### Examples

```python
>>> from darkmap import DarkMap
>>> darkmap = DarkMap(dark_gateway)
>>> darkmap.request_pid_hash()
'0x1234567890abcdef'
>>> darkmap.get_pid_by_hash('0x1234567890abcdef')
```


### Differences from DarkGateway

The main difference between the `DarkMap` class and the `DarkGateway` class is that the `DarkMap` class provides some additional methods for interacting with the blockchain, such as the ability to request a PID and convert between different types of identifiers.

Here is a table that summarizes the differences between the two classes:

| Feature | DarkGateway | DarkMap |
|---|---|---|
| Can send transactions | Yes | Yes |
| Can query the blockchain state | Yes | Yes |
| Can interact with smart contracts | Yes | Yes |
| Can request a PID | No | Yes |
| Can convert between different types of identifiers | No | Yes |

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dark-pid/dark-web3-lib",
    "name": "dark-gateway",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ARK,dARK,PID,web3",
    "author": "Thiago N\u00f3brega",
    "author_email": "thiagonobrega@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9a/0f/702c5275a42da9672e654303a3296c75b0568a536927b479058137d61138/dark-gateway-1.5.tar.gz",
    "platform": null,
    "description": "\n# dark-gateway\n\ndARK Web3 Core Lib\n\n## How to use\n\nWe created a [notebook](./docs/example_notebooks/basic_dark_usage.ipynb) to ilustrate how to use the dark-gateway lib\n\n\n## Main components\n\n### DarkGateway\n\nThe DarkGateway class is a Python class that provides a simple interface to interact with the dARK blockchain. The class is initialized with the name of the blockchain network and the configuration file. The configuration file specifies the URL of the blockchain node, the chain ID, and the minimum gas price.\n\nOnce the class is initialized, you can use it to send transactions, query the blockchain state, and interact with smart contracts. To send a transaction, you need to specify the smart contract, the method to call, and the arguments to pass to the method. The class will then sign the transaction and send it to the blockchain.\n\nTo query the blockchain state, you can use the get_balance method to get the balance of an address, or the get_transaction_receipt method to get the receipt of a transaction.\n\nTo interact with smart contracts, you can use the call method to call a function on a smart contract, or the transact method to send a transaction to a smart contract.\n\nThe DarkGateway class is a powerful tool that can be used to interact with the Darkweb blockchain. It provides a simple and easy-to-use interface that makes it easy to send transactions, query the blockchain state, and interact with smart contracts.\n\nHere are some of the specific things that the DarkGateway class can do:\n\n- Send transactions\n- Query the blockchain state\n- Interact with smart contracts\n- Get the balance of an address\n- Get the receipt of a transaction\n- Call a function on a smart contract\n- Send a transaction to a smart contract\n\n\n### DarkMap\nA Python class that provides a simple interface to interact with the Darkweb blockchain. It inherits from the `DarkGateway` class and adds some additional methods for interacting with the blockchain.\n\n#### Methods\n\nThe `DarkMap` class has two main types of methods:\n\n* **Sync methods:** These methods block until the operation is complete.\n* **Async methods:** These methods return a future object that can be used to get the result of the operation.\n\nThe `DarkMap` class also has some utility methods for converting between different types of identifiers, such as the hash value of a PID and its ARK identifier.\n\n### Examples\n\n```python\n>>> from darkmap import DarkMap\n>>> darkmap = DarkMap(dark_gateway)\n>>> darkmap.request_pid_hash()\n'0x1234567890abcdef'\n>>> darkmap.get_pid_by_hash('0x1234567890abcdef')\n```\n\n\n### Differences from DarkGateway\n\nThe main difference between the `DarkMap` class and the `DarkGateway` class is that the `DarkMap` class provides some additional methods for interacting with the blockchain, such as the ability to request a PID and convert between different types of identifiers.\n\nHere is a table that summarizes the differences between the two classes:\n\n| Feature | DarkGateway | DarkMap |\n|---|---|---|\n| Can send transactions | Yes | Yes |\n| Can query the blockchain state | Yes | Yes |\n| Can interact with smart contracts | Yes | Yes |\n| Can request a PID | No | Yes |\n| Can convert between different types of identifiers | No | Yes |\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "dARK Gateway libs",
    "version": "1.5",
    "project_urls": {
        "Homepage": "https://github.com/dark-pid/dark-web3-lib"
    },
    "split_keywords": [
        "ark",
        "dark",
        "pid",
        "web3"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ec8c285c60f1c8a36d3999e35caca1a1172125e15482f2d444e10afb4e8a961a",
                "md5": "bdc414e369b9e7cf50452308ffd1a9f1",
                "sha256": "5a8352083cd50a8fb6d9c608a8ee815ddd5e6e28403bc9f1efc8c143f5d5c8c3"
            },
            "downloads": -1,
            "filename": "dark_gateway-1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bdc414e369b9e7cf50452308ffd1a9f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 28376,
            "upload_time": "2023-12-05T14:20:36",
            "upload_time_iso_8601": "2023-12-05T14:20:36.690345Z",
            "url": "https://files.pythonhosted.org/packages/ec/8c/285c60f1c8a36d3999e35caca1a1172125e15482f2d444e10afb4e8a961a/dark_gateway-1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a0f702c5275a42da9672e654303a3296c75b0568a536927b479058137d61138",
                "md5": "9c00c5ed6fba9acf8138eec5a0a42bd7",
                "sha256": "50acc7575b936a634f1a8530b9ca2365cb7789805cbe6daef6b73e4cb67d0f4c"
            },
            "downloads": -1,
            "filename": "dark-gateway-1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "9c00c5ed6fba9acf8138eec5a0a42bd7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26848,
            "upload_time": "2023-12-05T14:20:37",
            "upload_time_iso_8601": "2023-12-05T14:20:37.794484Z",
            "url": "https://files.pythonhosted.org/packages/9a/0f/702c5275a42da9672e654303a3296c75b0568a536927b479058137d61138/dark-gateway-1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-05 14:20:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dark-pid",
    "github_project": "dark-web3-lib",
    "github_not_found": true,
    "lcname": "dark-gateway"
}
        
Elapsed time: 0.15123s