# README
UI server
The user interface (UI) server lets to have a graphical user interface to easily communicate with a Ruthenium host node.
Any other implementation of this UI server can communicate with a node using its API.
In this repository, the UI is described in a simple index.html
. Any other implementation of this UI can communicate with the UI server using its API.
Prerequisites
A Ruthenium node must be running.
Launch
At root level (ruthenium folder), run the ui using the command go run src/ui/main.go
with the add of some program arguments. For example:
go run src/ui/main.go -host-ip=0.0.0.0
Program arguments:
-port: The TCP port number for the UI server (default: "8080")
-host-ip: The node host IP or DNS address (default: "127.0.0.1")
-host-port: The TCP port number of the host node (accepted values: "10600" for mainnet, "10601" to "10699" for testnet, default: "10600")
-templates-path: The UI templates path (default: "templates")
-log-level: The log level (accepted values: "debug", "info", "warn", "error", "fatal", default: "info")
Using a web browser, go to http://localhost:8080
(If needed, replace localhost
by the UI server IP address and 8080
by the TCP port number for the UI server)
API
Base URL: <UI server IP>:<UI server port>
(example: localhost:8080
)
Transactions pool
Add transaction
Description: Add a transaction to the transactions pool.
-
parameters: none
-
request body: TransactionRequest
-
responses:
Code Description 201 Transaction added 400 Bad request, if any request argument is invalid 500 Internal server error, if an unexpected condition occurred
Get transaction info
Description: Get the transaction data needed for a transaction request.
-
parameters:
|Name|Description|Example| |---|---|---| |
address
|42 characters hexadecimal sender wallet address|0xf14DB86A3292ABaB1D4B912dbF55e8abc112593a
| |value
|64 bits floating-point number value of the transaction|0
| -
request body: none
-
responses:
|Code|Description| |---|---| |200|TransactionInfo| |400|Bad request, if any request argument is invalid| |405|Method not allowed, if the value exceeds the wallet amount for the given address| |500|Internal server error, if an unexpected condition occurred|
Get transactions
Description: Get all the transactions of the current transactions pool.
-
parameters: none
-
request body: none
-
responses:
Code Description 200 Array of transactions 500 Internal server error, if an unexpected condition occurred
Wallet
Get wallet address
Description: Get the wallet address depending on the given public key.
-
parameters: none
Name Description Example publicKey
132 characters hexadecimal public key 0x046bd857ce80ff5238d6561f3a775802453c570b6ea2cbf93a35a8a6542b2edbe5f625f9e3fbd2a5df62adebc27391332a265fb94340fb11b69cf569605a5df782
-
request body: none
-
responses:
Code Description 200 42 characters hexadecimal wallet address 500 Internal server error, if an unexpected condition occurred
Get wallet amount
Description: Get the amount for the given wallet address.
-
parameters:
Name Description Example address
42 characters hexadecimal wallet address 0xf14DB86A3292ABaB1D4B912dbF55e8abc112593a
-
request body: none
-
responses:
Code Description 200 64 bits floating-point number amount 400 Bad request, if any request argument is invalid 500 Internal server error, if an unexpected condition occurred
Schemas
Input
Schema | Description | Example |
---|---|---|
|
|
|
InputInfo
Schema | Description | Example |
---|---|---|
|
|
|
Output
Schema | Description | Example |
---|---|---|
|
|
|
Transaction
Schema | Description | Example |
---|---|---|
|
|
|
TransactionInfo
Schema | Description | Example |
---|---|---|
|
|
|
TransactionRequest
Schema | Description | Example |
---|---|---|
|
|
|