DCPay is a decentralized cryptocurrency payment gateway that enables businesses to accept crypto payments securely and independently. Built on the OLAS stack, it leverages decentralization and consensus to ensure reliability and trust, with payment records stored on IPFS for long-term accessibility and security. more details.
- Decentralized Consensus based decision making
- API
- IPFS
- CollectInvoicesRound Read Invoices [API] For Demo, read invoices from a json file. If no Invoice exists, wait for 10s and try again.
- DecisionMakingRound Monitor Invoice Settlement On-Chain [API] Keep Settled Invoices Records on [IPFS]
- SelectKeeperRound Select a keepr to invoke the webhook
- ConfirmationRound Confirm Settlement via Webhook [API]
- Reset and Start Again
- Read Invoices from Remote API
- Select Keeper Randomly [DRAND]
- Setup local DB to facilitate Admin Dashboard
- Call Remote Webhook
- Python
>=3.10
- Tendermint
==0.34.19
- IPFS node
==0.6.0
- Pip
- Poetry
- Docker Engine
- Docker Compose
- Set Docker permissions so you can run containers as non-root user
-
Clone this repo:
git clone --depth 1 https://github.com/miladtsx/academy-learning-agent-service
-
Create the virtual environment:
cd academy-learning-service poetry shell poetry install
-
Sync packages:
autonomy packages sync --update-packages
-
Prepare a keys.json file containing wallet address and the private key for each of the four agents.
autonomy generate-key ethereum -n 4
-
Prepare a
ethereum_private_key.txt
file containing one of the private keys fromkeys.json
. Ensure that there is no newline at the end. -
Create a Tenderly account and from your dashboard create a fork of ETHEREUM chain (virtual testnet).
-
From Tenderly, fund your agents and Safe with some ETH and USDC (
0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
). -
Make a copy of the env file:
cp sample.env .env
-
Fill in the required environment variables in .env. These variables are:
ALL_PARTICIPANTS
: a list of your agent addresses. This will vary depending on whether you are running a single agent (run_agent.sh
script) or the whole 4-agent service (run_service.sh
)GNOSIS_LEDGER_RPC
: set it to your Tenderly fork Admin RPC.
-
Verify that
ALL_PARTICIPANTS
in.env
contains only 1 address. -
Run the agent:
bash run_agent.sh
-
Verify that
ALL_PARTICIPANTS
in.env
contains 4 address. -
Check that Docker is running:
docker
-
Run the service:
bash run_service.sh
-
Look at the service logs for one of the agents (on another terminal):
docker logs -f learningservice_abci_0