p8e-cee-api
stands for the Provenance Contract Execution Environment API.
p8e-cee-api
allows for operations against BlockVault (formerly nicknamed "p8e"), with included support for replication across multiple object stores along with other miscellaneous utilities to facilitate creating and broadcasting scoped transmissions to the Provenance Blockchain.
The BlockVault integration guide provides contextual support for the varied use cases supported by this API. Having a fundamental understanding of the Provenance Blockchain & BlockVault is recommended.
Instructions for how to deploy the service
To run this service locally, be sure to have Docker installed:
brew install docker
You can also install Vault if you wish to use a local installation over the provided Docker container:
brew tap hashicorp/tap
brew install hashicorp/tap/vault
If you plan on running smart contracts for asset classification, you may need the following packages:
brew install rust
brew install jq
You'll additionally need CoreUtils
if your system is missing it:
brew install coreutils
Note: it's possible to install all dependencies with the following command:
./dc.sh setup
The default configuration assumes that the following ports are available:
Container | Port(s) |
---|---|
PostgreSQL | 5432 |
Object Store 1 | 5001 |
Object Store 2 | 5002 |
Vault | 8200 |
Provenance | 1317, 9090, 26657 |
If any are taken on your local machine, feel free to update the default values in the /service/local-docker/dependencies.yaml
file and associated /service/local-docker/*.env
files.
Once ready, all you need to do is run the included docker setup script from the root directory:
./dc.sh up
Then, run the service - either via an Intellij run configuration or via the command line with the following command:
./gradlew bootRun
once the service is running, try out some local calls using Swagger!
http://localhost:8080/p8e-cee-api/secure/docs/api.html
As a convenience, you can publish contracts from another repository without leaving this project in the command line.
./dc.sh -p <path to contracts repository> -v <version to publish> publish
For example:
./dc.sh -p ../../provenance-io/loan-package-contracts -v 0.3.2 publish
Note: This convenience method uses preset environment variables found in /service/local-docker/bootstrap.env
and assumes the address used to sign the transactions associated with publishing the contracts is listed in the genesis block (/service/local-docker/prov-init/config/genesis.json
).