Skip to content

Commit

Permalink
Merge pull request #1 from qenta-cee/feature/DAE-1478/-re-organize-do…
Browse files Browse the repository at this point in the history
…cumentation

Feature/dae 1478/ re organize documentation
  • Loading branch information
juan-crisanto-qenta authored Mar 11, 2024
2 parents 450fe45 + 61bcf6b commit 175753d
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 307 deletions.
4 changes: 2 additions & 2 deletions Writerside/p.tree
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<instance-profile id="p"
name="ProWallet"
start-page="AboutProWallet.md">
start-page="Starting-Page.topic">

<toc-element topic="Starting-Page.topic"/>
<toc-element topic="AboutProWallet.md"/>
Expand All @@ -15,6 +15,6 @@
</toc-element>
<toc-element topic="SDK-and-tools.md">
<toc-element topic="Java-SDK.md"/>
<toc-element topic="Proxy-Server.md"/>
<toc-element topic="Docker-Support.md"/>
</toc-element>
</instance-profile>
3 changes: 2 additions & 1 deletion Writerside/topics/AboutProWallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Most of the features from Qenta can be performed through our comprehensive RESTf
Utilizing standard HTTP protocols, our RESTful API empowers developers to effortlessly access and leverage Qenta's functionality, facilitating smooth communication and streamlined workflows for your applications. <a href="REST-APIs.md">See more</a>
</tab>
<tab title="SDK and Tools">
The Qenta SDK for Java enhances the integration of Qenta Services by offering a comprehensive suite of libraries specifically designed to be intuitive and user-friendly for developers. <br/> For non-Java based application, it possible to run a lightweight proxy server that exposes all SDK methods as a RESTful API. <a href="SDK-and-tools.md">See more</a>
Effortlessly integrate %product_name% services into your projects with our SDK and Tools. <br/>
Our toolkit enhances the integration of %product_name% by offering a comprehensive suite of libraries specifically designed to be intuitive and user-friendly for developers.<a href="SDK-and-tools.md">See more</a>
</tab>
<tab title="Events notifications">
Stay seamlessly informed about updates on your transactions through our notification tools. Our WebHooks empowers you to effortlessly integrate and leverage real-time transaction updates, ensuring you are always in the know. <a href="Webhook-management.md">See more</a>
Expand Down
94 changes: 94 additions & 0 deletions Writerside/topics/Docker-Support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Docker support

**%product_name%** for non-Java based application, it possible to run a lightweight server that exposes all SDK methods as
a RESTful API with JSON payloads to use SDK methods using a standard HTTP connection.

```plantuml
@startuml
scale max 800 width
package "External System"{
node "VPC" {
node "Non-Java based" {
OutPort -left- [Backend]
}
node "Docker-based environment" {
RestAPI -down- [ProxyServer]
component ProxyServer {
[SDK] #orange
}
}
OutPort .down.> RestAPI : POST \n http://localhost:8080
}
}
package "Qenta" {
HTTP - [Qenta Rest APIs]
[API Gateway] .right.> HTTP
}
SDK .right.> [API Gateway]
@enduml
```

## Running the docker image


<procedure title="Running server image" type="steps">
<tip>
<b>Before to start</b>
<p>Make sure you have a <code>docker</code> based runtime installed in your environment.</p>
</tip>
<step>
Pull the docker image from the Qenta repository.
<code-block ignore-vars="false" lang="shell">
docker pull %sdk_docker_image_uri%:%sdk_docker_image_tag%
</code-block>
</step>
<step>
<b>Optional: </b> If you want to use a shorter name for the image, you can tag it with a different name.
<code-block ignore-vars="false" lang="shell">
docker tag %sdk_docker_image_uri%:%sdk_docker_image_tag% qenta-sdk-server:latest
</code-block>
</step>
<step>
Once you have the image, you can run the server with the following command.
<code-block lang="shell" ignore-vars="false">
docker run -d -p 8080:8081 -e SDK_CONFIGURATION_SOURCE_TYPE=ENVIRONMENT_VARIABLE \
-e ENVIRONMENT_CONFIG_URL=https://hxklzo87t9.execute-api.us-east2.amazonaws.com/config/development \
-e QENTA_ACCESS_TOKEN= your_access_token\
-e QENTA_ENVIRONMENT=SANDBOX \
-e QENTA_ORGANIZATION_ID= your_organization_id\
-e QENTA_PRIVATE_KEY= your_private_key\
-e QENTA_USER_ID= your_user_id\
qenta-sdk-server:latest
</code-block>
</step>
<note>
You can consult the <a href="SDK-and-tools.md">SDK and Tools topic</a> to get the configuration values from the %prowallet_name%.
</note>
</procedure>

## Using the server

To verify the server is running, you can perform a `GET` request to the server at port `8080` or the port you have configured set in the running command.

```shell
curl --location --request GET "http://localhost:8080/v3/api-docs"
```

Once you verified the server is running, you can use the SDK methods using a standard HTTP connection.

Following is an example of how to create an order using the server.

```shell
curl --location --request POST "http://localhost:8080/qenta-sdk/orders" ^
--header "Content-Type: application/json" ^
--header "Accept: */*" ^
--header "Host: localhost:8080" ^
--header "Connection: keep-alive" ^
--data-raw "{ \"currency\" : \"EUR\", \"fiatAmount\" : 120.0, \"accountId\" : \"3213\"}"
```
Loading

0 comments on commit 175753d

Please sign in to comment.