A smart contract payment system built for automated service management
See the blog post to learn more about ApePay!
Coming soon!
ApePay is open source and we welcome all contributors! Check out the following to get started.
TODOs:
- Initial implementation
 - Documentation
 - Live testing on Sepolia
 - Production deployment on Arbitrum
 - Frontend management console, for managing subscriptions
 
First, install Ape.
Second, make sure to install the plugins:
$ ape plugins install . --upgradeNext, prior to installing the SDK package, you need to compile the project:
$ ape compileThe SDK package relies on a soft link in [`./sdk/py/apepay/manifest.json`](./sdk/py/apepay/manifest.json)
Lastly, install the SDK package via:
$ pip install .or for interactive installation do:
$ pip install -e .Then you are ready to contribute!
In order to contribute to the JS packages, you need to first follow the Python Setup instructions to compile the smart contract package.
Next, you need install the node packages for development:
$ npm installIn order to work on the React component library, you need to compile the JS SDK:
$ npm run build --workspace=sdk/jsIn order to work on the Demo app, you need to compile the JS SDK (like above) as well as compile the React component library:
$ npm run build --workspace=ui/libThen you are ready to contribute!
To run the demo app in development mode, do the following:
$ npm run dev --workspace=ui/appTo build the demo app for production, do the following:
$ npm run build --workspace=ui/appTo run tests, just use Ape:
$ ape testTo see gas usage, add the --gas flag:
$ ape test --gasTo deploy a StreamManager (for testing purposes), run:
$ 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:
$ ape run deploy factoryTo deploy a Token (for testing use only), run:
$ ape run deploy tokenThis 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:
$ anvil --block-time 1 --prune-historyThen run the example Silverback app:
$ silverback run bots.example:appAfter 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:
$ ape run demoGiven the monorepo structure, it's a bit more challenging to distribute all the packages in this repo.
TBD
To publish the Python package, there are 4 steps.
# 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 publishTo publish the JS SDK, do the following:
# 1. Install everything
$ npm install --all-workspaces
# 2. Build SDK
$ npm run build --workspace=sdk/js
# 3. Publish SDK
$ npm publish --workspace=sdk/jsNOTE: 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.
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)
$ heroku buildpacks:clear
$ heroku buildpacks:add heroku/python
$ heroku buildpacks:add heroku/nodejsThen just run:
$ git push heroku mainApePay is licensed Apache 2.0