- MariaDB/MySQL with InnoDB support
- RabbitMQ
- MONCoin®: Blockchain Data Collection Agent
- MONCoin®: Blockchain Relay Agent
- Node.js LTS
We know that this documentation needs cleaned up and made easier to read. We'll compile it as part of the full documentation as the project moves forward.
- Clone this repository to wherever you'd like the API to run:
git clone https://github.com/Kulteam/Blockchain-Cache-API.git
- Install the required Node.js modules
cd Blockchain-Cache-API && npm install
- Use your favorite text editor to change the values as necessary in
config.json
Note: Make sure you use a read-only database user for security reasons
{
"bindIp": "0.0.0.0",
"httpPort": 80,
"corsHeader": "*"
}
- Fire up the script
export RABBIT_PUBLIC_SERVER=127.0.0.1
export RABBIT_PUBLIC_USERNAME=yourrabbitmqusername
export RABBIT_PUBLIC_PASSWORD=yourrabbitmqpassword
export MYSQL_HOST=127.0.0.1
export MYSQL_PORT=3306
export MYSQL_USERNAME=yourdbusername
export MYSQL_PASSWORD=yourdbpassword
export MYSQL_DATABASE=yourdbname
node index.js
- Optionally, install PM2 or another process manager to keep the service running.
npm install -g pm2@latest
pm2 startup
pm2 start index.js --name Blockchain-Cache-API -i max
pm2 save
See https://docs.turtlepay.io/blockapi/ for the full REST API provided by this package.