A match engine built on top of Raft, designed for exchange transactions.
To build the project, run the following command:
go build -o ./out/mind ./app/main.goTo initialize a single node:
./out/mind server init --home ./private/node1To initialize a cluster with two nodes:
./out/mind server init --home ./private/node1./out/mind server init --home ./private/node2./private/node1/app_config.json
{
"api_port": 3000,
"node_id": 1,
"node_url": "http://127.0.0.1:8081",
"peers": {
"1": "http://127.0.0.1:8081",
},
"join": false,
"data_dir": "",
"etcd_endpoints": []
}./private/node1/app_config.json
{
"api_port": 3000,
"node_id": 1,
"node_url": "http://127.0.0.1:8081",
"peers": {
"1": "http://127.0.0.1:8081",
"2": "http://127.0.0.1:8082"
},
"join": false,
"data_dir": "",
"etcd_endpoints": []
}./private/node2/app_config.json
{
"api_port": 3001,
"node_id": 2,
"node_url": "http://127.0.0.1:8082",
"peers": {
"1": "http://127.0.0.1:8081",
"2": "http://127.0.0.1:8082"
},
"join": false,
"data_dir": "",
"etcd_endpoints": []
}To run a single node:
./out/mind server run --home ./private/node1To run a cluster with two nodes:
./out/mind server run --home ./private/node1./out/mind server run --home ./private/node2docker-compose -f ./deploy/etcd-docker-compose.yml up -dnote: should choose proper "platform"
platform: linux/arm64curl -X POST http://127.0.0.1:3000/api/v1/helloworld/message -H "Content-Type: application/json" -d '{"message":"version3"}'curl -X GET http://127.0.0.1:3000/api/v1/helloworld/messagescurl -X GET http://127.0.0.1:3000/api/v1/explorer/leader