Get coin prices from CoinSpot. THIS IS A TEMP REPOSITORY. WILL BE DELETED IN FUTURE.
-
Install a MySQL instance according to https://dev.mysql.com/doc/refman/8.0/en/installing.html on your local machine
-
Create a MySQL user, database and grant required permissions:
CREATE USER trader@localhost IDENTIFIED WITH mysql_native_password BY 'TRADER_PASSWORD';
CREATE DATABASE trader CHARACTER SET = utf8;
GRANT ALL ON trader.* TO trader@localhost;
CREATE TABLE `price` (
`id` bigint NOT NULL AUTO_INCREMENT,
`coin` varchar(8) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`bid` double NOT NULL,
`ask` double NOT NULL,
`last` double NOT NULL,
PRIMARY KEY (`id`),
KEY `index_timestamp` (`timestamp`),
KEY `index_coin` (`coin`)
);
Install Node.js according to https://nodejs.org/en/download
git clone https://github.com/kyle-chine-leismore/coin-prices.git
npm install
Modify the configuration file config.json
according to your environment.
node index.js