Skip to content

Api 💬

Daniel Gak Anagrov edited this page Jun 3, 2018 · 6 revisions

Server-Cli communication

In a same container, the user talks with the server through the cli commands. These commands are manly request to the addresses defined by the environments variables, except those commands (start and load) that are used to set up the server itself.

A normal API call will have the structure features bellow:

WALLET_HOST:WALLET_PORT/action?params

Action Params Response Info
transaction addressTo string, amount float64 hash Orders the server to make a tracscation tho a specified address with an amount
check-transaction hash json struct Check if a transaction have been completed successfully (it appears in the longest chain, verified with a Merkel tree)
balance address string amount float64 Gives a balance of an adreess. If an address it is not specified, will check the address of the wallet
chain nblocks int json struct Manly used for debugging, it returns the last nblocks of the longest chain

Server-Redis communication

The blockchain is stored in a Redis data base, typically in a Docker container. The Redis entry point its secified by the variables REDIS_PATH and REDIS_PORT. The communication happens as specified in the Redis Go documentation

Clone this wiki locally