apepay


Nameapepay JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryPython SDK for ApePay
upload_time2024-10-26 14:58:23
maintainerNone
docs_urlNone
authorNone
requires_python<4,>=3.10
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ApePay

[![Ape Framework](https://img.shields.io/badge/Built%20with-Ape%20Framework-brightgreen.svg)](https://apeworx.io)

A smart contract payment system built for automated service management

## About

See the [blog post](https://mirror.xyz/apeworx.eth/XPAko-Ez-BqHJF5zaB9sG8kfuDutNn1TqPg4827C7fw) to learn more about ApePay!

## Documentation

Coming soon!

## Contributing

ApePay is open source and we welcome all contributors! Check out the following to get started.

TODOs:

- [x] Initial implementation
- [x] Documentation
- [x] Live testing on Sepolia
- [x] Production deployment on Arbitrum
- [ ] Frontend management console, for managing subscriptions

### Setup (Python)

First, [install Ape](https://docs.apeworx.io/ape/stable/userguides/quickstart.html#installation).

Second, make sure to install the plugins:

```sh
$ ape plugins install . --upgrade
```

Next, prior to installing the SDK package, you need to compile the project:

```sh
$ ape compile
```

```{note}
The SDK package relies on a soft link in [`./sdk/py/apepay/manifest.json`](./sdk/py/apepay/manifest.json)
```

Lastly, install the SDK package via:

```sh
$ pip install .
```

or for interactive installation do:

```sh
$ pip install -e .
```

Then you are ready to contribute!

### Setup (JS)

In order to contribute to the JS packages, you need to first follow the [Python Setup instructions](#setup-python) to compile the smart contract package.

Next, you need install the node packages for development:

```sh
$ npm install
```

In order to work on the React component library, you need to compile the JS SDK:

```sh
$ npm run build --workspace=sdk/js
```

In order to work on the Demo app, you need to compile the JS SDK (like above) as well as compile the React component library:

```sh
$ npm run build --workspace=ui/lib
```

Then you are ready to contribute!

To run the demo app in development mode, do the following:

```sh
$ npm run dev --workspace=ui/app
```

To build the demo app for production, do the following:

```sh
$ npm run build --workspace=ui/app
```

### Testing

To run tests, just use Ape:

```sh
$ ape test
```

To see gas usage, add the `--gas` flag:

```sh
$ ape test --gas
```

### Scripts

To deploy a StreamManager (for testing purposes), run:

```sh
$ ape run deploy manager [TOKEN_ADDRESS [...]]
# Or if `ape tokens` is installed (with a valid tokenlist)
$ ape run deploy manager [TOKEN_SYMBOL [...]]
```

To deploy the StreamFactory (for production use), run:

```sh
$ ape run deploy factory
```

To deploy a Token (for testing use only), run:

```sh
$ ape run deploy token
```

```{warning}
This test token has an unauthenticated mint, please do not use in production!
```

To run the demo ApePay cluster daemon, first run a node like `anvil`:

```sh
$ anvil --block-time 1 --prune-history
```

Then run the example Silverback app:

```sh
$ silverback run bots.example:app
```

After that, it's suggested to start `ape console` and create a stream to watch the daemon react.

We also provide a simulation you can run instead using:

```sh
$ ape run demo
```

### Publishing

Given the monorepo structure, it's a bit more challenging to distribute all the packages in this repo.

#### Contracts

TBD

#### Python SDK

To publish the Python package, there are 4 steps.

```sh
# 1. Install everything
$ pip install .[dev]
# 2. Compile the package manifest
$ ape compile -f
# 3. Build the Python SDK with twine
$ twine build
# 4. Publish the package
$ twine publish
```

#### JavaScript SDK and React component library

To publish the JS SDK, do the following:

```sh
# 1. Install everything
$ npm install --all-workspaces
# 2. Build SDK
$ npm run build --workspace=sdk/js
# 3. Publish SDK
$ npm publish --workspace=sdk/js
```

**NOTE**: make sure to revision the package before publishing, or it will fail.

To publish the React Component library, do the same thing as the SDK exepct use the `ui/lib` workspace.

#### Demo App and Management Console

If you need to deploy the demo app to prod from scratch, just create a new heroku project and add these buildpacks from the Heroku CLI (or directly in your Heroku dashboard)

```sh
$ heroku buildpacks:clear
$ heroku buildpacks:add heroku/python
$ heroku buildpacks:add heroku/nodejs
```

Then just run:

```sh
$ git push heroku main
```

## License

ApePay is licensed [Apache 2.0](./LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "apepay",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "ApeWorX LTD <admin@apeworx.io>",
    "download_url": "https://files.pythonhosted.org/packages/65/91/16f457b8c5189fdbef4b5808d75c7927cd9b29f1caf2fd8471458a450b60/apepay-0.3.2.tar.gz",
    "platform": null,
    "description": "# ApePay\n\n[![Ape Framework](https://img.shields.io/badge/Built%20with-Ape%20Framework-brightgreen.svg)](https://apeworx.io)\n\nA smart contract payment system built for automated service management\n\n## About\n\nSee the [blog post](https://mirror.xyz/apeworx.eth/XPAko-Ez-BqHJF5zaB9sG8kfuDutNn1TqPg4827C7fw) to learn more about ApePay!\n\n## Documentation\n\nComing soon!\n\n## Contributing\n\nApePay is open source and we welcome all contributors! Check out the following to get started.\n\nTODOs:\n\n- [x] Initial implementation\n- [x] Documentation\n- [x] Live testing on Sepolia\n- [x] Production deployment on Arbitrum\n- [ ] Frontend management console, for managing subscriptions\n\n### Setup (Python)\n\nFirst, [install Ape](https://docs.apeworx.io/ape/stable/userguides/quickstart.html#installation).\n\nSecond, make sure to install the plugins:\n\n```sh\n$ ape plugins install . --upgrade\n```\n\nNext, prior to installing the SDK package, you need to compile the project:\n\n```sh\n$ ape compile\n```\n\n```{note}\nThe SDK package relies on a soft link in [`./sdk/py/apepay/manifest.json`](./sdk/py/apepay/manifest.json)\n```\n\nLastly, install the SDK package via:\n\n```sh\n$ pip install .\n```\n\nor for interactive installation do:\n\n```sh\n$ pip install -e .\n```\n\nThen you are ready to contribute!\n\n### Setup (JS)\n\nIn order to contribute to the JS packages, you need to first follow the [Python Setup instructions](#setup-python) to compile the smart contract package.\n\nNext, you need install the node packages for development:\n\n```sh\n$ npm install\n```\n\nIn order to work on the React component library, you need to compile the JS SDK:\n\n```sh\n$ npm run build --workspace=sdk/js\n```\n\nIn order to work on the Demo app, you need to compile the JS SDK (like above) as well as compile the React component library:\n\n```sh\n$ npm run build --workspace=ui/lib\n```\n\nThen you are ready to contribute!\n\nTo run the demo app in development mode, do the following:\n\n```sh\n$ npm run dev --workspace=ui/app\n```\n\nTo build the demo app for production, do the following:\n\n```sh\n$ npm run build --workspace=ui/app\n```\n\n### Testing\n\nTo run tests, just use Ape:\n\n```sh\n$ ape test\n```\n\nTo see gas usage, add the `--gas` flag:\n\n```sh\n$ ape test --gas\n```\n\n### Scripts\n\nTo deploy a StreamManager (for testing purposes), run:\n\n```sh\n$ ape run deploy manager [TOKEN_ADDRESS [...]]\n# Or if `ape tokens` is installed (with a valid tokenlist)\n$ ape run deploy manager [TOKEN_SYMBOL [...]]\n```\n\nTo deploy the StreamFactory (for production use), run:\n\n```sh\n$ ape run deploy factory\n```\n\nTo deploy a Token (for testing use only), run:\n\n```sh\n$ ape run deploy token\n```\n\n```{warning}\nThis test token has an unauthenticated mint, please do not use in production!\n```\n\nTo run the demo ApePay cluster daemon, first run a node like `anvil`:\n\n```sh\n$ anvil --block-time 1 --prune-history\n```\n\nThen run the example Silverback app:\n\n```sh\n$ silverback run bots.example:app\n```\n\nAfter that, it's suggested to start `ape console` and create a stream to watch the daemon react.\n\nWe also provide a simulation you can run instead using:\n\n```sh\n$ ape run demo\n```\n\n### Publishing\n\nGiven the monorepo structure, it's a bit more challenging to distribute all the packages in this repo.\n\n#### Contracts\n\nTBD\n\n#### Python SDK\n\nTo publish the Python package, there are 4 steps.\n\n```sh\n# 1. Install everything\n$ pip install .[dev]\n# 2. Compile the package manifest\n$ ape compile -f\n# 3. Build the Python SDK with twine\n$ twine build\n# 4. Publish the package\n$ twine publish\n```\n\n#### JavaScript SDK and React component library\n\nTo publish the JS SDK, do the following:\n\n```sh\n# 1. Install everything\n$ npm install --all-workspaces\n# 2. Build SDK\n$ npm run build --workspace=sdk/js\n# 3. Publish SDK\n$ npm publish --workspace=sdk/js\n```\n\n**NOTE**: make sure to revision the package before publishing, or it will fail.\n\nTo publish the React Component library, do the same thing as the SDK exepct use the `ui/lib` workspace.\n\n#### Demo App and Management Console\n\nIf you need to deploy the demo app to prod from scratch, just create a new heroku project and add these buildpacks from the Heroku CLI (or directly in your Heroku dashboard)\n\n```sh\n$ heroku buildpacks:clear\n$ heroku buildpacks:add heroku/python\n$ heroku buildpacks:add heroku/nodejs\n```\n\nThen just run:\n\n```sh\n$ git push heroku main\n```\n\n## License\n\nApePay is licensed [Apache 2.0](./LICENSE)\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Python SDK for ApePay",
    "version": "0.3.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "659116f457b8c5189fdbef4b5808d75c7927cd9b29f1caf2fd8471458a450b60",
                "md5": "ceaeb9f0755f0e3c71055b83ffa4f553",
                "sha256": "5a65ba3aee7f1280a7c15c7f495f1e82cff745ccdb01d6d665b9cf6a72cde587"
            },
            "downloads": -1,
            "filename": "apepay-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ceaeb9f0755f0e3c71055b83ffa4f553",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 333939,
            "upload_time": "2024-10-26T14:58:23",
            "upload_time_iso_8601": "2024-10-26T14:58:23.107576Z",
            "url": "https://files.pythonhosted.org/packages/65/91/16f457b8c5189fdbef4b5808d75c7927cd9b29f1caf2fd8471458a450b60/apepay-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 14:58:23",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "apepay"
}
        
Elapsed time: 0.93074s