{"id":4539,"date":"2020-09-29T22:06:56","date_gmt":"2020-09-29T22:06:56","guid":{"rendered":"https:\/\/stag.bitcoinsv.io\/?post_type=miner_document&p=4539"},"modified":"2020-10-05T14:47:16","modified_gmt":"2020-10-05T13:47:16","slug":"mapi","status":"publish","type":"miner_document","link":"https:\/\/bitcoinsv.io\/zh\/documentation\/miners\/installation\/mapi\/","title":{"rendered":"mAPI"},"content":{"rendered":"\n
\u4ee5\u4e0b\u7684\u6307\u5f15\u662f\u4ecb\u7ecd\u5728\u4e3b\u6d41\u7684Linux\u7cfb\u7edf\u4e0b\u5b89\u88c5mAPI\u53ef\u4f7f\u7528\u7684\u5de5\u5177\uff0c\u524d\u63d0\u5047\u8bbe\u662f\u4f60\u4f7f\u7528\u7740\u7c7b\u4f3cBourne shell\u7684shell\uff0c\u6bd4\u5982 \u5728\u6b64\u4e86\u89e3mAPI\u7684BRFC<\/a>\uff08\u6bd4\u7279\u5e01\u6ce8\u91ca\u8bf7\u6c42\uff09\u3002<\/p>\n\n\n\n \u5728\u6b64\u4e86\u89e3mAPI\u53c2\u8003\u5b9e\u73b0\u7684\u5f00\u6e90\u4ee3\u7801<\/a>\u3002<\/p>\n\n\n\n \u6280\u672f\u652f\u6301<\/p>\n\n\n\n \u6b32\u83b7\u5f97\u6280\u672f\u652f\u6301\u3001\u53c2\u4e0e\u8ba8\u8bba\u6280\u672f\u6807\u51c6\u548c\u53c2\u8003\u5b9e\u73b0\u7684\uff0c\u8bf7\u52a0\u5165\u4ee5\u4e0btelegram\u7fa4\u7ec4<\/a>\u3002<\/p>\n\n\n\n \u914d\u7f6e<\/p>\n\n\n\n mAPI\u914d\u7f6e\u4f9d\u8d56\u4e8e\u7528\u4e8e\u4e3b\u8981\u670d\u52a1\u914d\u7f6e\u7684settings.conf<\/a>\u6587\u4ef6\u4ee5\u53ca\u4e00\u4e2a\u6216\u591a\u4e2afee * .json\u6587\u4ef6\uff0c\u7528\u4e8e\u89c4\u5b9a\u8981\u6536\u53d6\u7684\u8d39\u7528\uff08\u4f8b\u5982\uff0cfees.json<\/a>\u7528\u4e8e\u5b9a\u4e49\u9ed8\u8ba4\u8d39\u7528\uff0cfees_low.json<\/a>\u7528\u4e8e\u5b9a\u4e49\u964d\u4f4e\u8d39\u7528\uff0cfees_user1.json\u7528\u4e8e\u5b9a\u4e49\u7528\u62371\u7684\u8d39\u7528\u7b49\uff09\u3002<\/p>\n\n\n\n \u4e3a\u4e86\u5bf9\u54cd\u5e94\u8fdb\u884c\u7b7e\u540d\uff0c\u8fd8\u9700\u8981\u8fd0\u884cMiner ID<\/a>\u5e76\u5728\u8bbe\u7f6e\u914d\u7f6e\u4e2d\u4e3amAPI\u63d0\u4f9b\u7aef\u70b9\u3002<\/p>\n\n\n\n \u6240\u6709\u8bbe\u7f6e\u90fd\u53ef\u4ee5\u88ab\u73af\u5883\u53d8\u91cf\u8986\u76d6<\/p>\n\n\n\n \u6253\u5f00settings.conf<\/a>\u6587\u4ef6\u5f00\u59cb\u7f16\u8f91\u4f60\u7684\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n \u8d39\u7387\u7684JSON\u683c\u5f0f\u8bf7\u53c2\u8003Fee Spec BRFC<\/a>\u3002<\/p>\n\n\n\n \u4ece\u6e90\u4ee3\u7801\u5f00\u59cb\u6784\u5efa<\/p>\n\n\n\n \u9996\u5148\u786e\u4fdd\u4f60\u5df2\u7ecf\u5728\u672c\u5730\u673a\u5668\u4e0a\u5b89\u88c5\u4e86Golang<\/a>\u5e76\u590d\u5236\u4e86\u5e93\u3002<\/p>\n\n\n\n \u8fd0\u884c\u5355\u9879\u6d4b\u8bd5\u6216\u8fd0\u884c\u5168\u90e8\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n \u4f60\u53ef\u4ee5\u4f7f\u7528\u81ea\u5df1\u7684\u66f4\u6539\u914d\u7f6e\u6765\u81ea\u884cbuild image\u3002<\/p>\n\n\n\nbash<\/code>\u3002<\/p>\n\n\n\n
settings.conf\u6587\u4ef6<\/h3>\n\n\n\n
httpAddress<\/code>\u6216
httpsAddress<\/code>\u4ee5\u7ed1\u5b9a\u5230\u7279\u5b9a\u63a5\u53e3<\/li>
jwtKey<\/code>\u4f7ftoken\u751f\u6210\u65b0\u7684JWT\u5bc6\u94a5\uff1a<\/li><\/ul>\n\n\n\n
console $ node -e \"console.log(require('crypto').randomBytes(32).toString('hex'));\"<\/code><\/p>\n\n\n\n
quoteExpiryMinutes<\/code>\u4ee5\u8bbe\u7f6e\u8d39\u7528\u62a5\u4ef7\u7684\u5230\u671f\u65f6\u95f4<\/li>
bitcoin_count<\/code><\/li>
bitcoin_1_host<\/code><\/li>
bitcoin_1_port<\/code><\/li>
bitcoin_1_username<\/code><\/li>
bitcoin_1_password<\/code><\/li>
minerId_URL<\/code>\u548c
minerId_alias<\/code>\u6765\u8bbe\u7f6eMiner ID\u7684URL\u522b\u540d<\/li><\/ul>\n\n\n\n
fees*.json\u6587\u4ef6<\/h3>\n\n\n\n
git clone git@github.com:bitcoin-sv\/merchantapi-reference.git<\/pre>\n\n\n\n
\u8fd0\u884c<\/h3>\n\n\n\n
$ .\/run.sh<\/pre>\n\n\n\n
\u6784\u5efa<\/h3>\n\n\n\n
$ .\/build.sh<\/pre>\n\n\n\n
\u6d4b\u8bd5<\/h3>\n\n\n\n
$ go test .\/...<\/pre>\n\n\n\n
Docker<\/h2>\n\n\n\n
Build Image<\/h3>\n\n\n\n
$ docker build . -t mapi_reference:1.1.0<\/pre>\n\n\n\n
Pull Image<\/h3>\n\n\n\n