# README
Host node
In this repository, the host node is an implementation following the Ruthenium protocol. Any other implementation can contribute to run the network if it exposes the same API and follows the protocol described in the Ruthenium whitepaper.
Prerequisites
- A firewall port must be open. The port number will be the value of the
port
program argument. - In order to validate blocks or get an income, the node wallet address must be registered in the Proof of Humanity registry.
Launch
At root level (ruthenium folder), run the node using the command go run src/node/main.go
with the add of some program argument. For example:
go run src/node/main.go -private-key=0x48913790c2bebc48417491f96a7e07ec94c76ccd0fe1562dc1749479d9715afd
Program arguments:
-mnemonic: The mnemonic (required if the private key is not provided)
-derivation-path: The derivation path (unused if the mnemonic is omitted, default: "m/44'/60'/0'/0/0")
-password: The mnemonic password (unused if the mnemonic is omitted)
-private-key: The private key (required if the mnemonic is not provided, unused if the mnemonic is provided)
-infura-key: The infura key (required to check the proof of humanity)
-ip: The node IP or DNS address (detected if not provided)
-port: The TCP port number of the host node (accepted values: "10600" for mainnet, "10601" to "10699" for testnet, default: "10600")
-settings-path: The settings file path (default: "config/settings.json")
-seeds-path: The seeds file path (default: "config/seeds.json")
-log-level: The log level (accepted values: "debug", "info", "warn", "error", "fatal", default: "info")
API
Base URL: <node IP>:<node port>
(example: seed-styx.ruthenium.my-cloud.me:10600)
Each request value or response value shall be marshaled to bytes or un-marshaled from bytes. All fields are required.
Blockchain
Get blocks
Description: Get the blocks starting from the given height (returned blocks array size is limited).
- request value: 64 bits unsigned integer block height
- response value: Array of blocks
Get first block timestamp
Description: Get the first block timestamp.
- request value: none
- response value: 64 bits integer timestamp in nanoseconds
Network
Share targets
Description: Share known validator node targets.
- request value: Array of target strings (IP and port, e.g. ["0.0.0.0:0000", "1.1.1.1:1111"])
- response value: none
Node
Transactions pool
Add transaction
Description: Add a transaction to the transactions pool.
- request value: TransactionRequest
- response value: none
Get transactions
Description: Get all the transactions of the current transactions pool.
- request value: none
- response value: Array of transactions
Wallet
Get UTXOs
Description: Get all the UTXOs for the given wallet address.
- request value: wallet address string
- response value: Array of UTXOs
Schemas
Block
Schema | Description | Example |
---|---|---|
|
|
|
Input
Schema | Description | Example |
---|---|---|
|
|
|
Output
Schema | Description | Example |
---|---|---|
|
|
|
Settings
Schema | Description | Example |
---|---|---|
|
|
|
Transaction
Schema | Description | Example |
---|---|---|
|
|
|
TransactionRequest
Schema | Description | Example |
---|---|---|
|
|
|
UTXO
Schema | Description | Example |
---|---|---|
|
|
|