-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathset_bp_json.js
61 lines (55 loc) · 1.31 KB
/
set_bp_json.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// 设置 producerjson
// 在 key.json 文件里替换成你的公钥和私钥
// 私钥:5JYXp9cSWQizUXLw5K2sGGD8Mr6pHAjpcRk7xrHkY5zaPwXRppP
// 公钥:FO7sGkRxL2AFnqBdUHXKC2LziYeRTzsxYF7FjzFNGe14hV8U5Pi2
// Fibos密钥对生成工具地址:https://fibos.xyz/
var FIBOS = require('./initClient.js');
var client = FIBOS();
var json = JSON.stringify({
"producer_account_name": "",
"org": {
"candidate_name": "",
"website": "",
"email": "",
},
"nodes": [
{
"location": {
"name": "",
"country": "",
"latitude": 1,
"longitude": 1
},
"node_type": "producer",
"p2p_endpoint": "",
"api_endpoint": "",
"ssl_endpoint": ""
},
{
"location": {
"name": "",
"country": "",
"latitude": 1,
"longitude": 1
},
"node_type": "full",
"api_endpoint": "",
"ssl_endpoint": ""
},
{
"location": {
"name": "",
"country": "",
"latitude": 1,
"longitude": 1
},
"node_type": "seed",
"p2p_endpoint": "",
"bnet_endpoint": ""
}
]
});
var producerName = "fibosamerica"; //producer name
var ctx = client.contractSync("producerjson");
var result = ctx.setSync(producerName, json, {"authorization": producerName});
console.log(result);