Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions programs/eosio-launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ struct prodkey_def {
};

struct producer_set_def {
uint32_t version;
vector<prodkey_def> producers;
vector<prodkey_def> schedule;
};

struct server_name_def {
Expand Down Expand Up @@ -745,7 +744,6 @@ launcher_def::bind_nodes () {
int non_bios = prod_nodes - 1;
int per_node = producers / non_bios;
int extra = producers % non_bios;
producer_set.version = 1;
unsigned int i = 0;
for (auto &h : bindings) {
for (auto &inst : h.instances) {
Expand All @@ -761,7 +759,7 @@ launcher_def::bind_nodes () {
if (is_bios) {
string prodname = "eosio";
node.producers.push_back(prodname);
producer_set.producers.push_back({prodname,pubkey});
producer_set.schedule.push_back({prodname,pubkey});
}
else {
if (i < non_bios) {
Expand All @@ -775,7 +773,7 @@ launcher_def::bind_nodes () {
while (count--) {
string prodname = pname+ext;
node.producers.push_back(prodname);
producer_set.producers.push_back({prodname,pubkey});
producer_set.schedule.push_back({prodname,pubkey});
ext += non_bios;
}
}
Expand Down Expand Up @@ -1105,11 +1103,10 @@ launcher_def::write_setprods_file() {
exit (9);
}
producer_set_def no_bios;
for (auto &p : producer_set.producers) {
for (auto &p : producer_set.schedule) {
if (p.producer_name != "eosio")
no_bios.producers.push_back(p);
no_bios.schedule.push_back(p);
}
no_bios.version = 1;
auto str = fc::json::to_pretty_string( no_bios, fc::json::stringify_large_ints_and_doubles );
psfile.write( str.c_str(), str.size() );
psfile.close();
Expand Down Expand Up @@ -1147,7 +1144,7 @@ launcher_def::write_bios_boot () {
}
}
else if (key == "cacmd") {
for (auto &p : producer_set.producers) {
for (auto &p : producer_set.schedule) {
if (p.producer_name == "eosio") {
continue;
}
Expand Down Expand Up @@ -1295,12 +1292,11 @@ void
launcher_def::make_custom () {
bfs::path source = shape;
fc::json::from_file(source).as<testnet_def>(network);
producer_set.version = 1;
for (auto &h : bindings) {
for (auto &inst : h.instances) {
tn_node_def *node = &network.nodes[inst.name];
for (auto &p : node->producers) {
producer_set.producers.push_back({p,node->keys[0].get_public_key()});
producer_set.schedule.push_back({p,node->keys[0].get_public_key()});
}
node->instance = &inst;
inst.node = node;
Expand Down Expand Up @@ -1876,7 +1872,7 @@ FC_REFLECT( prodkey_def,
(producer_name)(block_signing_key))

FC_REFLECT( producer_set_def,
(version)(producers))
(schedule))

FC_REFLECT( host_def,
(genesis)(ssh_identity)(ssh_args)(eosio_home)
Expand Down