Coreum processing is an open-source project to show how Coreum blockchain can be used in business to process payments. It is a part of a solution developed by BirdHouse Technology for small and medium businesses that would like to use digital assets in their business processes. It contains the following modules:
- ory/kratos - authentication and user management
- coreum_processor - an example of crypto processing on the base of Coreum blockchain
- coreum_multisign_service - an example of the services to implement multi-signature from merchant infrastructure
- To build coreum processor you should run the following docker command:
docker build . -t birdhousedockers/coreum_processor:latest -f ./Dockerfile
- To build coreum multi-sign service you should run the following docker command
docker build . -t birdhousedockers/coreum_multisign_service:latest -f ./Dockerfile-MS
- Go to folder ./ory where located files to run docker compose
- if you would like to run Coreum processing on you local computer, run the following command:
docker compose -f docker-compose.yml up -d
- If you would like to run Coreum from IDE you should specify requried env variable to run coreum_processor and coreum_multisign_service and use the following docker compose command:
docker compose -f docker-compose-local.yml up -d
Provided docker compose files are responsible for starting and running required infrastructure components(such as
postgres, ory/kratos, etc.), as well as for runnning required migration scripts for database
if docker-compose.yml was started successfully the coreum_processor component
will respond on address http://127.0.0.1:9090 and coreum_multisign_service on address http://127.0.0.1:9095
The following env variables should be provided to run coreum processing
name | example | description |
---|---|---|
PORT | 9090 | port that used coreum processing to recive requests |
TOKEN_TIME_TO_LIVE | 300 | time to live in seconds for JWT token |
PRIVATE_KEY | ./cmd/cryptoProcessorKey | path to a file with private key to generate JWT |
PUBLIC_KEY | ./cmd/cryptoProcessorKey.key.pub | path to a file with public key to verify JWT |
KRATOS_URL | http://127.0.0.1:4433 | url where kratos is hosting for user authentications |
LISTEN_AND_SERVE_INTERVAL | 5 | interval to listen and serve deposits |
DATABASE_HOST | localhost | postgres host address |
DATABASE_PORT | 5438 | postgres port |
DATABASE_NAME | coreum_processor | database name |
DATABASE_USER | postgres | database user name |
DATABASE_PASS | local-postgres0! | database password |
WALLET_RECEIVER_ADDRESS | testcore13f97kxrrq82982rsy2paqf9tx8e2jw5g2ufdfu | receiver wallet address of the processing |
WALLET_RECEIVER_SEED | then donate similar only tiny voyage tribe derive spare snap wet chase divide buzz play avoid captain wonder chair announce embody primary weapon breeze | mnemonic for receiver wallet |
WALLET_SENDER_ADDRESS | testcore1w2x4hwhasqfvg8cm6kyduzgwngvp0wf46eshmc | sending wallet address of the processing |
WALLET_SENDER_SEED | tube pledge side laundry volume actress route pink ring galaxy vendor obscure detect patient early memory reflect glue salon valid summer scatter damp total | mnemonic for sending wallet |
The following env variables should be provided to run coreum multi-signature service
name | example | description |
---|---|---|
PORT | 9095 | port that used coreum processing to recive requests |
PUBLIC_KEY | ./cmd/cryptoProcessorKey.key.pub | path to a file with public key to verify JWT |
MNEMONICS | innocent beyond seed awful program shiver link flat february claw focus glimpse canvas slush forest code rough emotion juice another satisfy boil dutch unknown | mnemonic for multisignature operation |
NETWORK_TYPE | Testnet | type of Coreum network |
-
Open landing by address http://127.0.0.1:9090
-
After "Sign up" open a page with MailSlurper that deployed by docker compose at address http://127.0.0.1:4436
-
Push "Continue" and fill personal information in registration wizard
-
On next registration wizard page put the following merchant id
aaef4567-b438-48a4-9a3a-f3a730b0e1ec
to link new registered client with default merchant created by migration scripts
-
On dashboard page push 'Create' button to activate the first merchant
-
Login to postgres container to update the register user access rights by using the following command:
docker exec -it ory-db-psql-1 psql -d coreum_processor -U postgres
- find user id database
select * from users;
- update user access in database
update users set access = 4099 where identity = '<put_your_user_identity>';
-
Do steps 1 - 5 from Registration of first user as admin with default merchant
-
on step 6 push option use option "I would like to make new merchant"
-
Do logout by using the following link http://127.0.0.1:9090/logout
-
Login as administrator and approve merchant on the page http://127.0.0.1:9090/ui/admin/merchant-requests
-
Do logout from administrator
-
Login under newly approved merchant and switch to settings page
-
In setting page put callback url for multi-signature service (if docker-compose.yaml was user the correct address should be `http://host.docker.internal:9095')
-
After successful activation the multi-sign service should have a record in logs:
2023-11-02T14:17:06.300072200Z 2023/11/02 14:17:06.299951 /go/src/app/cmd/multisign-service/service/multisign-service.go:133: On blockchain: coreum
2023-11-02T14:17:06.300112200Z for external id: 3b23b632-1b9a-4882-8713-271552c0515e-R
2023-11-02T14:17:06.300115400Z Given the following addresses:
2023-11-02T14:17:06.300117300Z testcore1jug4e9pw92zc8vhcewdtnj3v0zp6r2c0e2hc3e
2023-11-02T14:17:06.300119300Z
2023-11-02T14:17:10.324532500Z 2023/11/02 14:17:10.324398 /go/src/app/cmd/multisign-service/handler/handler.go:60: On blockchain: coreum
2023-11-02T14:17:10.324567500Z for external id: 3b23b632-1b9a-4882-8713-271552c0515e-R
2023-11-02T14:17:10.324570700Z Sign the following transaction: activate-ms-testcore1l9fp9j8sfzv88cwuuzd62ek8ed59l742c04ge4
2023-11-02T14:17:13.173877800Z 2023/11/02 14:17:13.173762 /go/src/app/cmd/multisign-service/service/multisign-service.go:133: On blockchain: coreum
2023-11-02T14:17:13.173909400Z for external id: 3b23b632-1b9a-4882-8713-271552c0515e-S
2023-11-02T14:17:13.173913700Z Given the following addresses:
2023-11-02T14:17:13.173916500Z testcore1jug4e9pw92zc8vhcewdtnj3v0zp6r2c0e2hc3e
2023-11-02T14:17:13.173919200Z
2023-11-02T14:17:16.347297500Z 2023/11/02 14:17:16.347139 /go/src/app/cmd/multisign-service/handler/handler.go:60: On blockchain: coreum
2023-11-02T14:17:16.347329300Z for external id: 3b23b632-1b9a-4882-8713-271552c0515e-S
2023-11-02T14:17:16.347333000Z Sign the following transaction: activate-ms-testcore1fecutgj7t0vvtll4psv0965z2j30s6k4h2vgzf
2023-11-02T14:17:34.774034800Z 2023/11/02 14:17:34.773910 /go/src/app/cmd/multisign-service/service/multisign-service.go:133: On blockchain:
2023-11-02T14:17:34.774079300Z for external id:
2023-11-02T14:17:34.774083100Z Given the following addresses:
2023-11-02T14:17:34.774085900Z testcore1jug4e9pw92zc8vhcewdtnj3v0zp6r2c0e2hc3e
2023-11-02T14:17:34.774088400Z