Skip to main content

3. Run a sample application

You can interact with Pangea services with either the Java, Python, Node.js, or Golang SDK or directly using the REST APIs. Select a language to learn how to use the SDK from a basic 'Hello, World' example.

Set Environment Variables


Pangea tutorials and samples read each service domain endpoint and access token created in Step 2: Configure Services from an environment variable. Before running this sample, set the environment variables PANGEA_DOMAIN and PANGEA_AUDIT_TOKEN to the values copied from the Pangea Console in the previous step.

To set each variable in bash:

export PANGEA_DOMAIN="yourServiceDomain"
export PANGEA_AUDIT_TOKEN="yourAccessToken"

NOTE: Refer to the Pangea Console dashboard and copy each value using the Screenshot shortcuts.

Build and Execute the "Hello, World!" App


Step 1: Clone the Pangea Builders sample repo from GitHub, and navigate to the 'examples' directory.

git clone https://github.com/pangeacyber/pangea-python.git &&
cd pangea-python/examples/audit

Step 2: Create virtual environment using virtualenv

python3 -m venv .env &&
source .env/bin/activate

Step 3: Install the Pangea Python SDK from a package installer

pip3 install pangea-sdk

Step 4: Run the audit app

python3 log.py

You should see output that is similar to the output below:

Logging: Hello, World!
Response: envelope=None hash='99f1d02bfbadfbee6ae2b927de54f3095f1e14715a1b8a182c336723b247a8b2' unpublished_root=None membership_proof=None consistency_proof=None consistency_verification=none membership_verification=none signature_verification=none

Verify the Request


Step 3: Navigate back to the Pangea Console Audit dashboard and confirm that the event was recorded.

Screenshot

Step 4: Then, from the left hand menu, select View Logs to view the specific entries.

Screenshot

Resources