The following diagram shows Trustlevel main infrastructure components:
<img src="docs/Trustlevel.drawio.png" alt="Trustlevel components" style="margin: 1rem;" />
The api project contains trustlevel components linked together using yarn workspaces.
# install and link all dependencies
yarn install
# prettify/lint all projects
yarn run fix
Find deployment instructions here: Cdk deployment
If you want to use 1Password to securely use AWS Credentials on your local machine, follow the instructions here.
# add to ~/.aws/config to please AWS_PROFILE settings
[profile trustlevel]
region = eu-west-1
# For temporary terminal sessions - add to ~/.zsrhc
alias trustlevel="source ~/.config/op/plugins.sh" # activate 1Password aws plugin for current terminal session
# For global terminal session add to ~/.zsrhc
source ~/.config/op/plugins.sh
Once the stack is deployt, you can call the trustlevel api as follows:
trustlevel
forCall the trustlevel api (curl example):
curl --location 'https://<stage-url>/v1/trustlevels/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <stage-api-key>' \
--data '{
"text": "<your-escaped-text>"
}'
# create your identiy (e.g. using goerli testnet; you can also select mainnet, but it would involve real tokens)
snet identity create <name-of-your-identity> key --private-key <metamask-private-key> --network goerli
# switch to the identity you want to use
snet identity <name-of-identity>
# Create a deposit for service executions
# Note setting --gas-price may help you to overcome execution errors
snet account deposit 10.0
# Create a channel for service executions (example org-id = trustlevel-aws-test)
snet channel open-init <org-id> default_groups 10.0 +2days
# Execute the example service
# (example org-id = trustlevel-aws-test)
# (example service-id = trustlevel-aws-service-test-4)
snet client call <org-id> <service-id> default_groups determineTrustLevel '{"input_string":"Witnesses and some local journalists say that at least four Israeli missiles struck three buildings inside the Jabalia refugee camp last night. The Hamas-run health ministry in Gaza says 110 people were killed"}'