get seq num based on role, not based on group

This commit is contained in:
Anton Evangelatov 2020-06-29 18:38:28 +02:00
parent ea2935e4d7
commit 50b9a7f212
2 changed files with 191 additions and 17 deletions

View File

@ -15,8 +15,8 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 16,
"iteration": 1593204217741,
"id": 15,
"iteration": 1593447404131,
"links": [],
"panels": [
{
@ -111,7 +111,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
}
],
"timeFrom": null,
@ -216,7 +222,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
},
{
"alias": "all ($tag_run)",
@ -259,7 +271,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
}
],
"thresholds": [],
@ -406,7 +424,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
}
],
"thresholds": [],
@ -547,7 +571,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
},
{
"alias": "find-data.offer - $tag_miner ($tag_run)",
@ -596,7 +626,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
}
],
"thresholds": [],
@ -743,7 +779,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
}
],
"thresholds": [],
@ -876,7 +918,13 @@
}
]
],
"tags": []
"tags": [
{
"key": "run",
"operator": "=~",
"value": "/^$runid$/"
}
]
}
],
"thresholds": [],
@ -956,11 +1004,133 @@
"refresh": 2,
"skipUrlSync": false,
"type": "interval"
},
{
"allValue": null,
"current": {
"selected": true,
"text": "All",
"value": "$__all"
},
"datasource": "influxdb",
"definition": "SHOW TAG VALUES WITH KEY = run",
"hide": 0,
"includeAll": true,
"label": null,
"multi": false,
"name": "runid",
"options": [
{
"selected": true,
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "117f08933310",
"value": "117f08933310"
},
{
"selected": false,
"text": "17a227f7b637",
"value": "17a227f7b637"
},
{
"selected": false,
"text": "38d83e95c2b2",
"value": "38d83e95c2b2"
},
{
"selected": false,
"text": "4df9a41381ca",
"value": "4df9a41381ca"
},
{
"selected": false,
"text": "55bf4f1e53e0",
"value": "55bf4f1e53e0"
},
{
"selected": false,
"text": "5fc360f56297",
"value": "5fc360f56297"
},
{
"selected": false,
"text": "61c25df6a523",
"value": "61c25df6a523"
},
{
"selected": false,
"text": "81bdea781a27",
"value": "81bdea781a27"
},
{
"selected": false,
"text": "8bda77016642",
"value": "8bda77016642"
},
{
"selected": false,
"text": "8e5bdd96afd1",
"value": "8e5bdd96afd1"
},
{
"selected": false,
"text": "9047c7cc419a",
"value": "9047c7cc419a"
},
{
"selected": false,
"text": "b29b34b67c9f",
"value": "b29b34b67c9f"
},
{
"selected": false,
"text": "b81f58a9362d",
"value": "b81f58a9362d"
},
{
"selected": false,
"text": "c05206ad1ca7",
"value": "c05206ad1ca7"
},
{
"selected": false,
"text": "c99cadb9e63b",
"value": "c99cadb9e63b"
},
{
"selected": false,
"text": "dbc87837bf29",
"value": "dbc87837bf29"
},
{
"selected": false,
"text": "ddf546e35bdd",
"value": "ddf546e35bdd"
},
{
"selected": false,
"text": "e7c3c5a7806d",
"value": "e7c3c5a7806d"
}
],
"query": "SHOW TAG VALUES WITH KEY = run",
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-8m",
"from": "now-15m",
"to": "now"
},
"timepicker": {
@ -979,5 +1149,5 @@
"timezone": "",
"title": "Project Oni - Baseline test",
"uid": "8em8RXWMz",
"version": 8
"version": 2
}

View File

@ -75,9 +75,10 @@ var (
clientsAddrsTopic = sync.NewTopic("clientsAddrsTopic", &peer.AddrInfo{})
minersAddrsTopic = sync.NewTopic("minersAddrsTopic", &MinerAddresses{})
stateReady = sync.State("ready")
stateDone = sync.State("done")
stateStopMining = sync.State("stop-mining")
stateReady = sync.State("ready")
stateDone = sync.State("done")
stateStopMining = sync.State("stop-mining")
stateMinerPickSeqNum = sync.State("miner-pick-seq-num")
)
type TestEnvironment struct {
@ -289,7 +290,10 @@ func prepareMiner(t *TestEnvironment) (*Node, error) {
return nil, err
}
minerAddr, err := address.NewIDAddress(genesis_chain.MinerStart + uint64(t.GroupSeq-1))
// pick unique sequence number for each miner, no matter in which group they are
seq := t.SyncClient.MustSignalAndWait(ctx, stateMinerPickSeqNum, t.IntParam("miners"))
minerAddr, err := address.NewIDAddress(genesis_chain.MinerStart + uint64(seq-1))
if err != nil {
return nil, err
}
@ -308,7 +312,7 @@ func prepareMiner(t *TestEnvironment) (*Node, error) {
t.RecordMessage("Miner Info: Owner: %s Worker: %s", genMiner.Owner, genMiner.Worker)
presealMsg := &PresealMsg{Miner: *genMiner, Seqno: t.GroupSeq}
presealMsg := &PresealMsg{Miner: *genMiner, Seqno: seq}
t.SyncClient.Publish(ctx, presealTopic, presealMsg)
// then collect the genesis block and bootstrapper address