Skip to content

Commit

Permalink
Add option to generate bootstrap weight files
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Aug 15, 2024
1 parent 5e719cb commit 372c53c
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 20 deletions.
1 change: 1 addition & 0 deletions nano/node/bootstrap_weights_beta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace nano
{
// Bootstrap weights for beta generated 15-08-2024
std::vector<std::pair<std::string, std::string>> preconfigured_weights_beta = {
{ "nano_3faucet4t1nnru6yra9iioia76jddur6zqg6d3fp7h1soyyd8qhgx6tizrsy", "37999200000000000000000000000000000000" },
{ "nano_1betazh7m3c9gwcsy7w3rzynbqr9gomjwn3cp59xqky48we46eaqptbdskh4", "36981063781291209870813128842298384384" },
Expand Down
72 changes: 52 additions & 20 deletions nano/node/bootstrap_weights_live.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,43 @@
#include <vector>
namespace nano
{
// Bootstrap weights for live generated 15-08-2024
std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {
{ "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt", "14441223284294418236591434141515181479" },
{ "nano_1b9wguhh39at8qtm93oghd6r4f4ubk7zmqc9oi5ape6yyz4s1gamuwn3jjit", "9164256996340665278764360818310019225" },
{ "nano_1b9wguhh39at8qtm93oghd6r4f4ubk7zmqc9oi5ape6yyz4s1gamuwn3jjit", "9164256995915665278764360818310019225" },
{ "nano_19qo4gtzpoyqf6zzezbcuazcsxtqtdin5qbtk8jkoz4fdmq4ssagn3u1odhz", "8739841068913099957481638583625439629" },
{ "nano_1natrium1o3z5519ifou7xii8crpxpk8y65qmkih8e8bpsjri651oza8imdd", "6780224011421099830810285556657998767" },
{ "nano_3jwrszth46rk1mu7rmb4rhm54us8yg1gw3ipodftqtikf5yqdyr7471nsg1k", "5662079096432755509398928938623088811" },
{ "nano_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4", "4993126070115996620078611581031864023" },
{ "nano_1natrium1o3z5519ifou7xii8crpxpk8y65qmkih8e8bpsjri651oza8imdd", "6785403294311847903741385556657998767" },
{ "nano_3jwrszth46rk1mu7rmb4rhm54us8yg1gw3ipodftqtikf5yqdyr7471nsg1k", "5656956927850685509398958938623088811" },
{ "nano_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4", "4993126022259574411594171581031864023" },
{ "nano_3oxhohaxp9ceobppkhp7wahauxd4zgyz4fhxfniyp4mb9opq4upfnaccswo7", "4201556265655356535934809611421529209" },
{ "nano_1ninja7rh37ehfp9utkor5ixmxyg8kme8fnzc4zty145ibch8kf5jwpnzr3r", "4033874811764346039727452285983103780" },
{ "nano_3pczxuorp48td8645bs3m6c3xotxd3idskrenmi65rbrga5zmkemzhwkaznh", "2888504432361968035619004734197699504" },
{ "nano_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs", "2466763590550441545066351589180088895" },
{ "nano_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou", "2379384379919297479995508063670173630" },
{ "nano_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou", "2379327677108444407064408063670173630" },
{ "nano_1wcxcjbwnnsdpee3d9i365e8bcj1uuyoqg9he5zjpt3r57dnjqe3gdc184ck", "2296732241081539971350375906110845836" },
{ "nano_1rs5rtyeo1owjt6cz9ypdkqyydq656kai8t35haiioapts39x96br5u4mbdw", "2257139514323759810052534483561497850" },
{ "nano_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs", "2116831436986119999446203648031562073" },
{ "nano_3chartsi6ja8ay1qq9xg3xegqnbg1qx76nouw6jedyb8wx3r4wu94rxap7hg", "1983140512838377503983013263190117930" },
{ "nano_3kqdiqmqiojr1aqqj51aq8bzz5jtwnkmhb38qwf3ppngo8uhhzkdkn7up7rp", "1909295600775688390388887043428305162" },
{ "nano_3ktybzzy14zxgb6osbhcc155pwk7osbmf5gbh5fo73bsfu9wuiz54t1uozi1", "1908899498841795535603352188022910123" },
{ "nano_3rw4un6ys57hrb39sy1qx8qy5wukst1iiponztrz9qiz6qqa55kxzx4491or", "1863031576604966975461090035197524726" },
{ "nano_1tk8h3yzkibbsti8upkfa69wqafz6mzfzgu8bu5edaay9k7hidqdunpr4tb6", "1495556305441835451206722862467541927" },
{ "nano_3msc38fyn67pgio16dj586pdrceahtn75qgnx7fy19wscixrc8dbb3abhbw6", "1369097552301421936429309829029487670" },
{ "nano_3pg8khw8gs94c1qeq9741n99ubrut8sj3n9kpntim1rm35h4wdzirofazmwt", "1294793822448432483117302455452640419" },
{ "nano_3patrick68y5btibaujyu7zokw7ctu4onikarddphra6qt688xzrszcg4yuo", "1285294198442744186220127633648039667" },
{ "nano_1tk8h3yzkibbsti8upkfa69wqafz6mzfzgu8bu5edaay9k7hidqdunpr4tb6", "1495548475002195451206720462467541927" },
{ "nano_3msc38fyn67pgio16dj586pdrceahtn75qgnx7fy19wscixrc8dbb3abhbw6", "1369097551901421936429309829029487670" },
{ "nano_3pg8khw8gs94c1qeq9741n99ubrut8sj3n9kpntim1rm35h4wdzirofazmwt", "1294793822427432483117302455452640419" },
{ "nano_3patrick68y5btibaujyu7zokw7ctu4onikarddphra6qt688xzrszcg4yuo", "1285294198073744186220127633648039667" },
{ "nano_1ec5optppmndqsb3rxu1qa4hpo39957s7mfqycpbd547jga4768o6xz8gfie", "1267922946065290858129580776994922737" },
{ "nano_1ookerz3adg5rxc4zwwoshim5yyyihf6dpogjihwwq6ksjpq7ea4fuam5mmc", "1246441661853501770123425832313198710" },
{ "nano_1ookerz3adg5rxc4zwwoshim5yyyihf6dpogjihwwq6ksjpq7ea4fuam5mmc", "1246441661580448238697463772313198710" },
{ "nano_1iuz18n4g4wfp9gf7p1s8qkygxw7wx9qfjq6a9aq68uyrdnningdcjontgar", "1229996651974365484217120964778999909" },
{ "nano_1zuksmn4e8tjw1ch8m8fbrwy5459bx8645o9euj699rs13qy6ysjhrewioey", "1136795847408970169039989251506412218" },
{ "nano_1zuksmn4e8tjw1ch8m8fbrwy5459bx8645o9euj699rs13qy6ysjhrewioey", "1136795368920530169039959251506412218" },
{ "nano_1wenanoqm7xbypou7x3nue1isaeddamjdnc3z99tekjbfezdbq8fmb659o7t", "1089310632396188185167628802505448830" },
{ "nano_35btiz1mgfwp95c3ckazmzbp5gepduxtijuijd9xebeau8u1gsbea41smjca", "978065622915930846318635609476848024" },
{ "nano_1jtx5p8141zjtukz4msp1x93st7nh475f74odj8673qqm96xczmtcnanos1o", "967473103484743176419697918383695678" },
{ "nano_3power3gwb43rs7u9ky3rsjp6fojftejceexfkf845sfczyue4q3r1hfpr3o", "894257234399529438815251872909868486" },
{ "nano_3power3gwb43rs7u9ky3rsjp6fojftejceexfkf845sfczyue4q3r1hfpr3o", "894257034399529438815251872909868486" },
{ "nano_35nu7hynfzecjtauskk6yb8pgfeifscqz4hmgtani15s8eiocgsz15axursj", "894001715198160000000000000000000000" },
{ "nano_1xckpezrhg56nuokqh6t1stjca67h37jmrp9qnejjkfgimx1msm9ehuaieuq", "891203290442064874273857334554978931" },
{ "nano_1aqkrayihxzdahoxpjrg8o6mxgxfzq46hhcdm1u48w3qexsakx7pzzhjn3fc", "868065235589764534853752690417963017" },
{ "nano_1etto78drszxhtb5jhswzzm5m98ffqxwjzwg3gr8ajt5sq4ahdj4bjhni9we", "785686980535259312178910879360696370" },
{ "nano_3dmtrrws3pocycmbqwawk6xs7446qxa36fcncush4s1pejk16ksbmakis78m", "732141727248886854747424357282826451" },
{ "nano_3dmtrrws3pocycmbqwawk6xs7446qxa36fcncush4s1pejk16ksbmakis78m", "732141727521940386173386417282826451" },
{ "nano_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p", "731226785880418697526350882585038015" },
{ "nano_3u7d5iohy14swyhxhgfm9iq4xa9yibhcgnyj697uwhicp14dhx4woik5e9ek", "730258259306382159219109519987726214" },
{ "nano_1my1snode8rwccjxkckjirj65zdxo6g5nhh16fh6sn7hwewxooyyesdsmii3", "706997982655906201416528503828324966" },
Expand All @@ -55,7 +56,7 @@ std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {
{ "nano_318uu1tsbios3kp4dts5b6zy1y49uyb88jajfjyxwmozht8unaxeb43keork", "575889192914150204620716257293397371" },
{ "nano_1kd4h9nqaxengni43xy9775gcag8ptw8ddjifnm77qes1efuoqikoqy5sjq3", "566515600941133913485065769258908520" },
{ "nano_3caprkc56ebsaakn4j4n7g9p8h358mycfjcyzkrfw1nai6prbyk8ihc5yjjk", "554451363061984706881214698066002129" },
{ "nano_38713x95zyjsqzx6nm1dsom1jmm668owkeb9913ax6nfgj15az3nu8xkx579", "542336063150381844098261920545003604" },
{ "nano_38713x95zyjsqzx6nm1dsom1jmm668owkeb9913ax6nfgj15az3nu8xkx579", "542334167092381844098261920545003604" },
{ "nano_396sch48s3jmzq1bk31pxxpz64rn7joj38emj4ueypkb9p9mzrym34obze6c", "532237374096018835801969941942976731" },
{ "nano_16d3mdshcfqayyx8rd9ioimjiicrma743qpd86ohfs9kdzgejmnba1zifo8m", "504998623975027407423632477732267880" },
{ "nano_1oenixj4qtpfcembga9kqwggkb87wooicfy5df8nhdywrjrrqxk7or4gz15b", "492820193888297460973780058677573526" },
Expand Down Expand Up @@ -101,13 +102,13 @@ std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {
{ "nano_16u1uufyoig8777y6r8iqjtrw8sg8maqrm36zzcm95jmbd9i9aj5i8abr8u5", "183992427543222752050703192409432781" },
{ "nano_1mime3jd7dbnshd6zw1gjqax5zit31h6y1x6pczfuz7au33ftacjib5cc1ez", "175987117607938016116141189473158949" },
{ "nano_1cafe95a81ko3mq3oin4wnubsbw9z3w3tw5a95u47897wxy96r1zj9hxu1wb", "159539529546064598080992917477201663" },
{ "nano_1just1zdsnke856mu5pmed1qdkzk6adh3d13iiqr3so66sr8pbcnh15bdjda", "152900242467352030545681996261039160" },
{ "nano_1just1zdsnke856mu5pmed1qdkzk6adh3d13iiqr3so66sr8pbcnh15bdjda", "152900242468352030545681996261039160" },
{ "nano_1nk9zdf1otddxhxfqimjdkmbtq17yzf3z6giz1as7x1huyug8er1ukeqpqpe", "150437463887016617576117342082053707" },
{ "nano_3kc9wsf9y4y9r3k9yj1d5da53ytjepcf993bcto17xh1s691wyc6im9xaodr", "149975051141067890000000102000000000" },
{ "nano_1n1hukyqred6yuch1xgtmdofe1bnc68eza733qmb6r19xo9us7qipbjujad1", "144548727886419830000000000000000000" },
{ "nano_1wxwqkagc6byutzhwqwxuaqofigbufkmqsgf9a9k5pqz3f7kr6mbgu9nror3", "140260148943145965568980211200950272" },
{ "nano_1ebq356ex7n5efth49o1p31r4fmuuoara5tmwduarg7b9jphyxsatr3ja6g8", "139021088150039579119746606534967146" },
{ "nano_3kc8wwut3u8g1kwa6x4drkzu346bdbyqzsn14tmabrpeobn8igksfqkzajbb", "137804281938882430464549691479270439" },
{ "nano_3kc8wwut3u8g1kwa6x4drkzu346bdbyqzsn14tmabrpeobn8igksfqkzajbb", "137804275938882430464549691479270439" },
{ "nano_14mp1ua4oi45rxosft3d8qe4g6a1u1srma59jg85ax6s8zuwhi4yzgdnqhz3", "136372177984670283994284930033678517" },
{ "nano_1k5fqb5q6t44tsd13ziny66w6mxbya6x397g7tkz7hnkcpppofuojzs7qmik", "134850575048708037899730669200010113" },
{ "nano_3g6ue89jij6bxaz3hodne1c7gzgw77xawpdz4p38siu145u3u17c46or4jeu", "130510802330635066524920487352576622" },
Expand All @@ -116,13 +117,13 @@ std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {
{ "nano_3fg3hi6b4ptj5y5ss4a3cwarbzahaeazzs6mjf18t1cqm3pmetgtgrtafafp", "121766786123567890000000000000000000" },
{ "nano_3o5dcp6kjish9xuu51akx1d8bp4pytk4diput3s8dkt7cktnmcg96aoi1cbw", "118915808597239091835392448488594815" },
{ "nano_3hrppx3sfxoiycjm9iaqsr3odecgarcxxxhsm41s9pbs75ykambxqhu9ys58", "107476325363030087806917544668625310" },
{ "nano_3bsnis6ha3m9cepuaywskn9jykdggxcu8mxsp76yc3oinrt3n7gi77xiggtm", "106632277132178104005827172462148557" },
{ "nano_3bsnis6ha3m9cepuaywskn9jykdggxcu8mxsp76yc3oinrt3n7gi77xiggtm", "106632275546678104005827172462148557" },
{ "nano_1chbdd5pkj545neroitwc6bpsps7mohgb8kstwnhxrh3dkkqimjytmp3k3uy", "100000004736000000000000000000000000" },
{ "nano_1f1aman8jkw8fom6fmjgddhiym784mzsspg39xwmt6wmh9pa8awhw39qgaie", "100000000000000000000000000000000000" },
{ "nano_1ba7uuq9kt68jzzw51a5kt577xtzaq37cnj8otqbhhnkgjyhwu91wtsjacez", "90773815118340101111368136856240823" },
{ "nano_3o5oeefdnrha7x7styp1tnmefen7fnrooy4jgnfb1otws54yf7uqfuxmojoy", "86404037925590940516372151734933060" },
{ "nano_37331hiaumyscgh5c5woq8u4ow13bwdtwie94pdz3a6wmkny4bgsnknp3td4", "75789789428000547000000000000018711" },
{ "nano_1niabkx3gbxit5j5yyqcpas71dkffggbr6zpd3heui8rpoocm5xqbdwq44oh", "69747517680211830964688338806699327" },
{ "nano_1niabkx3gbxit5j5yyqcpas71dkffggbr6zpd3heui8rpoocm5xqbdwq44oh", "69747517679211830964688338806699327" },
{ "nano_1asau6gr8ft5ykynpkauctrq1w37sdasdymuigtxotim6kxoa3rgn3dpenis", "69358291013031760634890287427733619" },
{ "nano_16f43w3bzsws3joz3xtffe5jzgwcijaty9affr718ithrcy64bkgtjag394y", "64747247521135780000000000000000000" },
{ "nano_1ssx76ua5rtp7awrr4td5eecqq9es697i9gnujhqxd19qgzet56of8qrh7ee", "62825092568000000000000000000000000" },
Expand Down Expand Up @@ -150,7 +151,7 @@ std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {
{ "nano_17wmwpg65neuh8u84f99e6nxcf48znusb437efwaafta7rtpy4n9h6io79xj", "28727776761383350049915331487592707" },
{ "nano_37tuecwghy64eyqcgxmq3fsb9d55frw3yyo8ksubf66b73hz877nmaa5f3mr", "26422477633581838048301884333353650" },
{ "nano_3rpixaxmgdws7nk7sx6owp8d8becj9ei5nef6qiwokgycsy9ufytjwgj6eg9", "24403531565869782580217949690581836" },
{ "nano_1tipnanogsu7q59pnie3qfc4w378wm43fg4ksqc8wmnnfnizrq1xrpt5geho", "24376534356049323107933067454328851" },
{ "nano_1tipnanogsu7q59pnie3qfc4w378wm43fg4ksqc8wmnnfnizrq1xrpt5geho", "24375199793049323107933067454328851" },
{ "nano_3wyw9zthfxqs1siz4kpgtkpmaf8zgdr1bi57nsrsg6zj6ab8ybojj9ctq1un", "24342328730645920968836662000367010" },
{ "nano_1ac8snzjkwniynpe3nsshf34iwe46rpjo3tjqtdntktjhqsp5sdndqworgwe", "23675428374520118273789170879842789" },
{ "nano_15wb9jfh65n3a7cmec7kfn9ns116myz9q7p1ii6gannq8sxzfbdjjfxegttq", "22800090798003672900000000000001306" },
Expand All @@ -174,6 +175,37 @@ std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {
{ "nano_13q3fmh7gxy3a3poj63846fzwbjfnq8pbpciymscb4c4dhth5hiu5zhqpts6", "10116445864820197678953168861948202" },
{ "nano_1zo54ia1363ikd4nb9ikamux3fnsnr7jurzs45xhda78o9piowa44o5zzaws", "10064342317609992817311795252917319" },
{ "nano_1xj15k5naemt7rno1udawcazo5esjsuajosziopeayk93o8t71hwecfsux4p", "10049524920882731218540321640583469" },
{ "nano_1f35t1od6k6h8ja7akk75bnw9k8ucgt5gnczhkusdzn8zh65bksg6ut5refj", "9800000000000000000000000000000000" },
{ "nano_1on6578kfe6t9kxtuecyy7rpi1e19nctgy3ahfbwimuh9q4y43m67qtayd16", "9700409497000000000000000000000000" },
{ "nano_1i9ugg14c5sph67z4st9xk8xatz59xntofqpbagaihctg6ngog1f45mwoa54", "9664440665099357075451315014082826" },
{ "nano_1maffswnif9r35yy6btgo7qukpnpzhpndegi7895fobfjffgfr9pjdy9f66w", "9492805658461778040738974122648333" },
{ "nano_3x4ui45q1cw8hydmfdn4ec5ijsdqi4ryp14g4ayh71jcdkwmddrq7ca9xzn9", "9237281023857890000000000000000000" },
{ "nano_1eezw1x7yyic1sf3hmfpuah63yu887cpfuycbxwwzs6cp958oeou33sertup", "8999645584670000000000000000000000" },
{ "nano_385dyw65hwqtp7pm5igh9ekmaai7qg61tp4mcdine7su3jt69uypa7o9umm8", "8904792557844433368685796168078236" },
{ "nano_1bbpmnm69yireu5ehmkt1mi43dnkcfhaam6jsbmwqmgqh1q1mftpdd6c68ew", "8802714398352114754910010285300864" },
{ "nano_1bko7zpcow7w6e11az8tnxdnyszgkt61miwuo9i9pom3czdzxqknpiuc7tdb", "8779930597924343338935314880604594" },
{ "nano_1ganknor1pihxiu9xh8gjf1ogopi8knq43byquhguyn6n4p3zihka4j6zss3", "8412267005125000680406933566499260" },
{ "nano_1gaysex8yymd5ef88hjqxt8xbjt63qz43cujrrzy4df9xb6zhf315csi35ww", "8265761820603059591611149128261137" },
{ "nano_1eeiwmnsq6fdhy1m35og1dzt7kdnci8wny3kn771638dfrrgg49so7k1mg7i", "7794119505196869704136597425563571" },
{ "nano_1hfwy8j3pxennexq1aqmwfcx5e7jmwi5ifu6z9iyn7t196fqicoojyt7hyun", "7492480000000000000000000000000000" },
{ "nano_1y64ynwctoedxfnwaq8b6ji1jr5zad33fsuncj95afm59oga3r3zbr1hokog", "7076429977939300000000000000000000" },
{ "nano_38hkh5ony8o1m61qzntuxf46twisj4m13yw91wy7xm7md3gpcgggn8jhqdk1", "6628016951428700218506642656978632" },
{ "nano_3zk8p6cs13cpeokxo8zeanf55oow6idq3j4we5xnw96j6o8bk9htaqwjb8me", "6618328268409826976733034707600083" },
{ "nano_35aanb19mke5igkskydh6gfd8za1ywyn7qf4xrkgyibfhantywtpqm5i67f4", "6349611664021094582296546004434944" },
{ "nano_3f8ccaz96okoi4ymekgb5achc18s55cn9yxdz7pph5sdzg9bqq8rzs43fc3x", "6123537122437960796388976976741352" },
{ "nano_3euz6o7tr77zmzefmgdrpbktjid4iz9gy1torpw3udy74i6z3kttpqc1i487", "6034012497078450899377263085617152" },
{ "nano_1qb4edx4ey4nuhzb4wyjcshuxecxhir9bz9ofr8moekg5z8q3p1it58p9gze", "5965768079913000000000000000000000" },
{ "nano_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy", "5496466576451178538100019205400347" },
{ "nano_1ohnu4opa3z8yy69e74fcwth1n7ifhfa8in3dh4fp1mw4yyjbdh9s3s1y99p", "5166821137037890000000000000000000" },
{ "nano_31a51k53fdzam7bhrgi4b67py9o7wp33rec1hi7k6z1wsgh8oagqs7bui9p1", "5161412193205274236870819522960384" },
{ "nano_1o5p4ukj17133nmc8xfzup3cy33x9ipfrsj469t5ri6rt14n7tsz7ebytnu9", "5078983754000000000000000000000000" },
{ "nano_35jdmecuxmxbu13wjappphrsjqbuny9isjubniqegto5gf1p67i7tm78bfyd", "5002110666850081632450831568997888" },
{ "nano_1g8tys1i4kpci148ee9w7tnzmw1cmxk6p9r4th8rjrrm5sxbbsqin775q8on", "5001000000000000000000000000000000" },
{ "nano_1dcnin3j6cnp6orr8ii13fbs6mruq4ywocz47rgpbw7i4j4e1dm6bkdd5pea", "5000959661787890000000000000000000" },
{ "nano_1ey5ktcc1k14ohoi67yzxiertxbts3ay575b1sgkdjdxyb1xphhe43zp4m7b", "4510819000000000000000000000000000" },
{ "nano_3ciiorjr88nd9xdperhj6u4bmxqxgkariohi1inuqad4b8urr9bgpirgbmqy", "4477336442774266798459137118407208" },
{ "nano_1n4dtjocgft8aexcr5ftiibu9f47g3j13ay8yzx35qk3qe6sfdq16nsnu5h3", "4260594537829325899904188547439928" },
{ "nano_1au971hmpwws39utkskwfs4a8t9ed3kio9cehk1c8fr7jsx9gpwniqtz5sz4", "4005133650459206096223484698431443" },
};
uint64_t max_blocks_live = 201334006;
uint64_t max_blocks_live = 201358632;
}
49 changes: 49 additions & 0 deletions nano/node/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void nano::add_node_options (boost::program_options::options_description & descr
("diagnostics", "Run internal diagnostics")
("generate_config", boost::program_options::value<std::string> (), "Write configuration to stdout, populated with defaults suitable for this system. Pass the configuration type node, rpc or log. See also use_defaults.")
("update_config", "Reads the current node configuration and updates it with missing keys and values and delete keys that are no longer used. Updated configuration is written to stdout.")
("create_weights_file", "Generates data for bootstrap_weights_live.hpp or bootstrap_weights_beta.hpp file. Run on a fully bootstrapped ledger")
("key_create", "Generates a adhoc random keypair and prints it to stdout")
("key_expand", "Derive public key and account number from <key>")
("wallet_add_adhoc", "Insert <key> in to <wallet>")
Expand Down Expand Up @@ -752,6 +753,54 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map
std::cout << output;
}
}
else if (vm.count ("create_weights_file"))
{
auto inactive_node = nano::default_inactive_node (data_path, vm);
auto is_live = inactive_node->node->network_params.network.is_live_network ();
auto is_beta = inactive_node->node->network_params.network.is_beta_network ();
auto block_count = inactive_node->node->ledger.block_count ();
auto rep_amounts = inactive_node->node->ledger.cache.rep_weights.get_rep_amounts ();
std::vector<std::pair<nano::uint128_t, std::string>> representation;

for (auto & rep_amount : rep_amounts)
{
auto const & account (rep_amount.first);
auto const & amount (rep_amount.second);
representation.emplace_back (amount, account.to_account ());
}
std::sort (representation.begin (), representation.end ());
std::reverse (representation.begin (), representation.end ());
auto now = std::chrono::system_clock::now ();
auto in_time_t = std::chrono::system_clock::to_time_t (now);

if (is_live)
{
std::cout << "// Bootstrap weights for live generated " << std::put_time (std::localtime (&in_time_t), "%d-%m-%Y") << std::endl;
std::cout << "std::vector<std::pair<std::string, std::string>> preconfigured_weights_live = {" << std::endl;
}
else if (is_beta)
{
std::cout << "// Bootstrap weights for beta generated " << std::put_time (std::localtime (&in_time_t), "%d-%m-%Y") << std::endl;
std::cout << "std::vector<std::pair<std::string, std::string>> preconfigured_weights_beta = {" << std::endl;
}
int count = 0;
for (const auto & [key, value] : representation)
{
if (count >= 200)
break;
std::cout << "\t{ \"" << value << "\", \"" << key << "\" }," << std::endl;
++count;
}
std::cout << "};" << std::endl;
if (is_live)
{
std::cout << "uint64_t max_blocks_live = " << block_count << ";" << std::endl;
}
else if (is_beta)
{
std::cout << "uint64_t max_blocks_beta = " << block_count << ";" << std::endl;
}
}
else if (vm.count ("diagnostics"))
{
auto inactive_node = nano::default_inactive_node (data_path, vm);
Expand Down

0 comments on commit 372c53c

Please sign in to comment.