Iframe Service
The iframe service is a crucial element in ensuring the security and privacy of a user's private keys. The isolated iframe operates as a secure environment, managing the private key and executing wallet operations. This setup is pivotal because it keeps the private key confined to an in-memory state within the iframe, never storing it in a database or allowing it to persist beyond the session. This isolation also means the private key is protected from potential exposure or theft, as it's inaccessible to both the app's code and the Openfort SDK.
This guide provides a step-by-step approach to downloading and running the openfort/iframe Docker image, which is hosted on Docker Hub. By following these instructions, you will be able to set up and host the image on your local machine or server environment.
Hosting the iframe
Prerequisites
Before you begin, make sure you have the following installed:
- Docker: Ensure you have Docker installed on your machine. If not, download and install Docker from the official website.
Step 1: Pulling the Docker Image
To start, you'll need to pull the openfort/iframe image from Docker Hub. Open a terminal and run the following command:
docker pull openfort/iframe
This command downloads the latest version of the openfort/iframe image to your local machine. If you need a specific version, you can tag it like this: openfort/iframe:tagname
.
You can also find the Docker image on Docker Hub.
Step 2: Running the Docker Image
Once the image is pulled, you can run it as a container. To do this, execute the following command in your terminal:
docker run -d -p 8080:80 openfort/iframe
Here, -d
runs the container in detached mode (in the background), and -p 8080:80
maps port 80 of the container to port 8080 on your host machine. Adjust the port settings as needed for your environment.
Step 3: Accessing the Application
After the container starts, you can access the application by opening a web browser and navigating to http://localhost:8080
. You should see the Openfort iframe service running and ready for use.
Interacting with the iframe
The iframe service provides a set of APIs that allow you to interact with the embedded wallet. These APIs enable you to create, sign, and broadcast transactions, as well as manage accounts and keys.
Communicating with the iframe
We have created a client-side library to help you interact with the iframe service. You can find the library on GitHub.