package
4.1.0+incompatible
Repository: https://github.com/my-cloud/ruthenium.git
Documentation: pkg.go.dev

# 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

POST /transaction

Description: Add a transaction to the transactions pool.

  • parameters: none

  • request body: TransactionRequest

  • responses:

    CodeDescription
    201Transaction added
    400Bad request, if any request argument is invalid
    500Internal server error, if an unexpected condition occurred
Get transaction info

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

GET /transactions

Description: Get all the transactions of the current transactions pool.

  • parameters: none

  • request body: none

  • responses:

    CodeDescription
    200Array of transactions
    500Internal server error, if an unexpected condition occurred

Wallet

Get wallet address

GET /wallet/address

Description: Get the wallet address depending on the given public key.

  • parameters: none

    NameDescriptionExample
    publicKey132 characters hexadecimal public key0x046bd857ce80ff5238d6561f3a775802453c570b6ea2cbf93a35a8a6542b2edbe5f625f9e3fbd2a5df62adebc27391332a265fb94340fb11b69cf569605a5df782
  • request body: none

  • responses:

    CodeDescription
    20042 characters hexadecimal wallet address
    500Internal server error, if an unexpected condition occurred
Get wallet amount

GET /wallet/amount

Description: Get the amount for the given wallet address.

  • parameters:

    NameDescriptionExample
    address42 characters hexadecimal wallet address0xf14DB86A3292ABaB1D4B912dbF55e8abc112593a
  • request body: none

  • responses:

    CodeDescription
    20064 bits floating-point number amount
    400Bad request, if any request argument is invalid
    500Internal server error, if an unexpected condition occurred

Schemas

Input

Schema Description Example
{
  "output_index":   uint16
  "transaction_id": string
  "public_key":     string
  "signature":      string
}

The output index
The ID of the transaction holding the output
The output recipient public key
The output signature

{
  "output_index": 0
  "transaction_id": "8ae72a72c0c99dc9d41c2b7d8ea67b5a2de25ff4463b1a53816ba179947ce77d"
  "public_key": "0x046bd857ce80ff5238d6561f3a775802453c570b6ea2cbf93a35a8a6542b2edbe5f625f9e3fbd2a5df62adebc27391332a265fb94340fb11b69cf569605a5df782"
  "signature": "4f3b24cbb4d2c13aaf60518fce70409fd29e1668db1c2109c0eac58427c203df59788bade6d5f3eb9df161b4ed3de451bac64f4c54e74578d69caf8cd401a38f"
}

InputInfo

Schema Description Example
{
  "output_index":   uint16
  "transaction_id": string
}

The output index
The ID of the transaction holding the output

{
  "output_index": 0
  "transaction_id": "8ae72a72c0c99dc9d41c2b7d8ea67b5a2de25ff4463b1a53816ba179947ce77d"
}

Output

Schema Description Example
{
  "address":     string
  "is_yielding": bool
  "value":       uint64
}

The address of this output recipient
Whether this output should be used for income calculation
The value at the transaction timestamp

{
  "address": "0xf14DB86A3292ABaB1D4B912dbF55e8abc112593a"
  "is_yielding": true
  "value": 0
}

Transaction

Schema Description Example
{
  "id":        string
  "inputs":    []Input
  "outputs":   []Output
  "timestamp": int64
}

The ID
The inputs
The outputs
The timestamp

{
  "id": "30148389df42b7cd0cb0d3ce951133da3f36ff4e1581d108da1ee05bacad64b7"
  "inputs": []
  "outputs": []
  "timestamp": 1667768884780639700
}

TransactionInfo

Schema Description Example
{
  "inputs":    []InputInfo
  "rest":      uint64
  "timestamp": int64
}

The remaining amount to be used as a value for the output with the sender address
The utxos to be used as inputs of the transaction

{
  "inputs": []
  "rest": 0
  "timestamp": 1667768884780639700
}

TransactionRequest

Schema Description Example
{
  "transaction":                    Transaction
  "transaction_broadcaster_target": string
}

The transaction
The transaction broadcaster target

{
  "transaction": {}
  "transaction_broadcaster_target": "0.0.0.0:0000"
}

# Packages

No description provided by the author