├── .gitignore
├── LICENSE
├── README.md
├── deferredwatcher
├── deferred_watcher.js
├── package-lock.json
├── start.sh
└── stop.sh
├── dfuse-tools
├── README.md
├── cache
│ ├── _table_data_candidates_daccustodian_daccustodian_0_.json
│ ├── _table_data_candidates_daccustodian_eos.dac_0_.json
│ ├── _table_data_candidates_dacelections_dacelections_0_.json
│ ├── _table_data_candidates_dacelections_eos.dac_0_.json
│ ├── _table_data_custodians_daccustodian_daccustodian_0_.json
│ ├── _table_data_custodians_daccustodian_eos.dac_0_.json
│ ├── _table_data_custodians_dacelections_dacelections_0_.json
│ ├── _table_data_custodians_dacelections_eos.dac_0_.json
│ ├── _table_data_members_eosdactokens_eos.dac_0_.json
│ ├── _table_data_members_eosdactokens_eosdactokens_0_.json
│ ├── _table_data_members_kasdactokens_eos.dac_0_.json
│ ├── _table_data_members_kasdactokens_kasdactokens_0_.json
│ ├── _table_data_memberterms_eosdactokens_eos.dac_0_.json
│ ├── _table_data_memberterms_eosdactokens_eosdactokens_0_.json
│ ├── _table_data_memberterms_kasdactokens_eos.dac_0_.json
│ ├── _table_data_memberterms_kasdactokens_kasdactokens_0_.json
│ ├── _table_data_state_daccustodian_daccustodian_0_.json
│ ├── _table_data_state_daccustodian_eos.dac_0_.json
│ ├── _table_data_state_dacelections_dacelections_0_.json
│ ├── _table_data_state_dacelections_eos.dac_0_.json
│ ├── _table_data_votes_daccustodian_daccustodian_0_.json
│ ├── _table_data_votes_daccustodian_eos.dac_0_.json
│ ├── _table_data_votes_dacelections_dacelections_0_.json
│ ├── _table_data_votes_dacelections_eos.dac_0_.json
│ └── last_cache_update.txt
├── includes
│ └── functions.php
└── index.php
├── drop tool
├── .gitignore
├── README.md
├── dropper.js
├── package-lock.json
└── package.json
├── eosdac-testnet
├── README.md
├── boot.sh
├── build.sh
├── change_config.sh
├── conf.example.sh
├── conf_dac.example.sh
├── conf_private.example.sh
├── dac_config.json
├── dac_config2.json
├── fire.sh
├── functions.sh
├── msig
│ └── gen_requested_permissions.py
├── newperiod.sh
├── permissions.sh
├── perms
│ ├── dacauthority_active.json
│ ├── daccustodian_transfer.json
│ ├── daccustodian_updateauth.json
│ └── resign.json
├── populate.sh
├── resign.sh
├── terms.json
├── transfer_raw.sh
└── update_contract.sh
├── getvotes
├── README.md
├── index.js
├── output
│ ├── accounts.csv
│ └── proxies.csv
├── package-lock.json
├── package.json
└── top500.csv
├── memberstats
├── .gitignore
├── README.md
├── api
│ ├── .gitignore
│ ├── api_server.js
│ ├── config.json
│ ├── package-lock.json
│ ├── package.json
│ ├── routes
│ │ └── routes.js
│ └── yarn.lock
├── balance_member_update.sql
├── balance_voter_update.sql
├── export_members_and_voters.js
├── index.js
├── members.csv
├── package-lock.json
├── package.json
├── voters.csv
├── www
│ ├── index.html
│ └── style.css
└── yarn.lock
├── nodeselector
├── .gitignore
├── README.md
├── nodeselector.js
├── package-lock.json
├── package.json
└── test.js
└── utilities
└── bpinfo.php
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | dfuse-tools/.api_credentials.json
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 eosDAC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DACtools
2 |
3 | ## Purpose
4 | Smart contracts, user interface tools, and scripts to facilitate the DAC deployment.
5 |
6 | ## Technical Details
7 |
8 | The different tools include:
9 | - *drop tool* - A tool to assist in airdropping tokens on to EOSIO accounts.
10 | - *eosdac-testnet* - A set of scripts to install and configure eosDAC contracts on a freshly started chain.
11 | - *getvotes* - A tool to gather voting statistics on the top 500 EOSIO accounts.
12 | - *memberstats* - A tool to gather DAC statistics on voting
13 | - *nodeselector* - A tool to select the fastest responding bp node
14 | - *profile_watcher* - An express.js tool to watch a profile
15 |
16 | ## Author
17 | eosDAC team members. Contact the team for questions on our Discord channel: https://discord.io/eosdac
18 |
--------------------------------------------------------------------------------
/deferredwatcher/deferred_watcher.js:
--------------------------------------------------------------------------------
1 | const fetch = require('node-fetch');
2 | const mongoose = require('mongoose');
3 | const eosjs = require('eosjs');
4 | const {TextEncoder,TextDecoder} = require('util');
5 |
6 | const rpc_endpoint = 'https://eu.eosdac.io';
7 | const url = rpc_endpoint + '/v1/chain/get_scheduled_transactions';
8 | const mongo_uri = 'mongodb://localhost:27017/eos_deferred';
9 |
10 | const defaultPrivateKey = "5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr"; // useraaaaaaaa
11 | const signatureProvider = new eosjs.JsSignatureProvider([defaultPrivateKey]);
12 | const rpc = new eosjs.JsonRpc(rpc_endpoint, { fetch });
13 |
14 |
15 | var api = new eosjs.Api({rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });
16 |
17 |
18 |
19 | let tx_history = {};
20 | mongoose.connect(mongo_uri);
21 |
22 | var Schema = mongoose.Schema;
23 | var deferredSchema = new Schema({
24 | trx_id: { type: String, required:true, index: {unique:true} },
25 | sender: { type: String, index:true },
26 | sender_id: String,
27 | payer: String,
28 | delay_until: { type:Date, index:-1 },
29 | expiration: { type:Date, index:-1 },
30 | published: { type: Date, index:-1 },
31 | transaction: String,
32 | transaction_obj: {}
33 | });
34 |
35 |
36 | async function preSave(next){
37 | try {
38 | this.transaction_obj = await api.deserializeTransactionWithActions(this.transaction);
39 | }
40 | catch (e){}
41 |
42 | next();
43 | }
44 | deferredSchema.pre("save", preSave);
45 |
46 |
47 | var Deferred = mongoose.model('Deferred', deferredSchema);
48 |
49 |
50 |
51 |
52 | const processTransactions = async transactions => {
53 | transactions.forEach((tx) => {
54 | var eq = Deferred.where({trx_id:tx.trx_id});
55 | var tx_obj = new Deferred(tx);
56 |
57 | eq.findOne((err, existing) => {
58 | if (err || !existing){
59 | console.log('Adding new transaction ' + tx.trx_id);
60 | tx_obj.save(function (err, saved) {
61 | if (err) {return console.error(err);}
62 | });
63 | }
64 | });
65 |
66 | });
67 | };
68 |
69 | const process = async lower => {
70 | try {
71 | lower = lower || '';
72 | const body = '{"lower_bound":"'+lower+'", "limit":100}';
73 | try {
74 | const response = await fetch(url, { method: 'POST', body: body });
75 | const json = await response.json();
76 |
77 | processTransactions(json.transactions);
78 |
79 | if (json.more){
80 | process(json.more);
81 | }
82 | else {
83 | setTimeout(() => {process()}, 5000);
84 | console.log("Restarting");
85 | //process();
86 | }
87 | }
88 | catch (e){
89 | console.error(e);
90 | setTimeout(() => {process(lower)}, 5000);
91 | return;
92 | }
93 |
94 | //console.log(json);
95 | } catch (error) {
96 | console.error(error);
97 | }
98 | };
99 |
100 |
101 | process();
102 |
--------------------------------------------------------------------------------
/deferredwatcher/start.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | DATADIR="./"
3 |
4 | ./stop.sh
5 | nodejs deferred_watcher.js > $DATADIR/deferred-out.log 2> $DATADIR/deferred-err.log & echo $! > $DATADIR/deferred.pid
6 |
--------------------------------------------------------------------------------
/deferredwatcher/stop.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ################################################################################
3 | #
4 | # Scrip Created by http://CryptoLions.io
5 | #
6 | ###############################################################################
7 |
8 | DIR="./"
9 |
10 |
11 | if [ -f $DIR"/deferred.pid" ]; then
12 | pid=`cat $DIR"/deferred.pid"`
13 | echo $pid
14 | kill $pid
15 | rm -r $DIR"/deferred.pid"
16 |
17 | echo -ne "Stoping Daemon"
18 |
19 | while true; do
20 | [ ! -d "/proc/$pid/fd" ] && break
21 | echo -ne "."
22 | sleep 1
23 | done
24 | echo -ne "\rDaemon Stopped. \n"
25 | fi
26 |
--------------------------------------------------------------------------------
/dfuse-tools/README.md:
--------------------------------------------------------------------------------
1 | README.md
2 |
3 | Some code pulled from https://github.com/lukestokes/prospectorsdac/blob/master/includes/functions.php to use defuse to collect data and work with it as cached files.
4 |
5 | Steps to run this yourself:
6 |
7 | 1) Add a .api_credentials.json file in the same folder as index.php the following format:
8 |
9 | ```
10 | {"api_key":"server_38abe.....","token":"eyJhbGci......","expires_at":1565463026}
11 | ```
12 |
13 | 2) Run a local php webserver via: `php -S localhost:8000`
14 |
15 | 3) Pass in old_block_num and new_block_num as url GET parameters to compare data across specific blocks such as `http://localhost:8000/?old_block_num=37640280&new_block_num=41640280`
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_candidates_daccustodian_daccustodian_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90ae681b19a511ff2af2daccf9755a06b28e21843abd6a56fe30d5564d61","up_to_block_num":73175214,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[{"key":"13vk5eosdac1","payer":"13vk5eosdac1","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"13vk5eosdac1"}},{"key":"1lukestokes1","payer":"1lukestokes1","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"1.0000 EOS","candidate_name":"1lukestokes1"}},{"key":"afurmanczyk1","payer":"afurmanczyk1","json":{"custodian_end_time_stamp":"2019-06-09T19:03:17","is_active":0,"total_votes":"45365080209","locked_tokens":"50000.0000 EOSDAC","requestedpay":"10.0000 EOS","candidate_name":"afurmanczyk1"}},{"key":"alcrypto1522","payer":"alcrypto1522","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":1525710681,"locked_tokens":"35000.0000 EOSDAC","requestedpay":"15.0000 EOS","candidate_name":"alcrypto1522"}},{"key":"angeljeffrey","payer":"angeljeffrey","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"526440467285","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"angeljeffrey"}},{"key":"brockpierce1","payer":"brockpierce1","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"447268324552","locked_tokens":"108000.0000 EOSDAC","requestedpay":"0.0000 EOS","candidate_name":"brockpierce1"}},{"key":"cream5eosdac","payer":"cream5eosdac","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"396680851742","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"cream5eosdac"}},{"key":"criseosdacio","payer":"criseosdacio","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"440387879703","locked_tokens":"50000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"criseosdacio"}},{"key":"cryptdfwplay","payer":"cryptdfwplay","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"6535917553","locked_tokens":"35000.0000 EOSDAC","requestedpay":"40.0000 EOS","candidate_name":"cryptdfwplay"}},{"key":"daclivingeos","payer":"daclivingeos","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":957039893,"locked_tokens":"0.0000 EOSDAC","requestedpay":"10.0000 EOS","candidate_name":"daclivingeos"}},{"key":"dallasjohnso","payer":"dallasjohnso","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"344890699374","locked_tokens":"35000.0000 EOSDAC","requestedpay":"10.0000 EOS","candidate_name":"dallasjohnso"}},{"key":"dougweisberg","payer":"dougweisberg","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2000000,"locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"dougweisberg"}},{"key":"eosblocktree","payer":"eosblocktree","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":1000000000,"locked_tokens":"0.0000 EOSDAC","requestedpay":"25.0000 EOS","candidate_name":"eosblocktree"}},{"key":"eosdaciloveu","payer":"eosdaciloveu","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"77981708746","locked_tokens":"35678.0000 EOSDAC","requestedpay":"5.0000 EOS","candidate_name":"eosdaciloveu"}},{"key":"eosdackorean","payer":"eosdackorean","json":{"custodian_end_time_stamp":"2019-10-27T19:10:44","is_active":1,"total_votes":"304200738371","locked_tokens":"35000.0000 EOSDAC","requestedpay":"45.0000 EOS","candidate_name":"eosdackorean"}},{"key":"eosificantbe","payer":"eosificantbe","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":"11735360374","locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"eosificantbe"}},{"key":"eosverycool1","payer":"eosverycool1","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":"27075327654","locked_tokens":"0.0000 EOSDAC","requestedpay":"40.0000 EOS","candidate_name":"eosverycool1"}},{"key":"g44dqnzygege","payer":"g44dqnzygege","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":797431038,"locked_tokens":"50300.0000 EOSDAC","requestedpay":"49.0000 EOS","candidate_name":"g44dqnzygege"}},{"key":"ge4tonzxgege","payer":"ge4tonzxgege","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":1806255660,"locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"ge4tonzxgege"}},{"key":"gi4tomjygege","payer":"gi4tomjygege","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":36367801,"locked_tokens":"35000.0000 EOSDAC","requestedpay":"10.0000 EOS","candidate_name":"gi4tomjygege"}},{"key":"giztmmzygqge","payer":"giztmmzygqge","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":26191109,"locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"giztmmzygqge"}},{"key":"gqytqmbxgyge","payer":"gqytqmbxgyge","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"5.0000 EOS","candidate_name":"gqytqmbxgyge"}},{"key":"greentreesom","payer":"greentreesom","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"391479490399","locked_tokens":"35000.0000 EOSDAC","requestedpay":"10.0000 EOS","candidate_name":"greentreesom"}},{"key":"guydkmzqgyge","payer":"guydkmzqgyge","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"40.0000 EOS","candidate_name":"guydkmzqgyge"}},{"key":"gy3dqmbzg4ge","payer":"gy3dqmbzg4ge","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"10.0000 EOS","candidate_name":"gy3dqmbzg4ge"}},{"key":"gyytqmjwgege","payer":"gyytqmjwgege","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"gyytqmjwgege"}},{"key":"gyzdmmbtgyge","payer":"gyzdmmbtgyge","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"20105608633","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"gyzdmmbtgyge"}},{"key":"ha3dqnbwgege","payer":"ha3dqnbwgege","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"30097679392","locked_tokens":"35000.0000 EOSDAC","requestedpay":"40.0000 EOS","candidate_name":"ha3dqnbwgege"}},{"key":"iloveyujeong","payer":"iloveyujeong","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":1024503723,"locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"iloveyujeong"}},{"key":"investingwad","payer":"investingwad","json":{"custodian_end_time_stamp":"2019-08-11T19:07:24","is_active":0,"total_votes":"33970855691","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"investingwad"}},{"key":"jakedappcast","payer":"jakedappcast","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"jakedappcast"}},{"key":"jbucksteiner","payer":"jbucksteiner","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"356379047239","locked_tokens":"82500.0000 EOSDAC","requestedpay":"1.0000 EOS","candidate_name":"jbucksteiner"}},{"key":"jeoswallet13","payer":"jeoswallet13","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":119562520,"locked_tokens":"0.0000 EOSDAC","requestedpay":"35.0000 EOS","candidate_name":"jeoswallet13"}},{"key":"khaleesiwang","payer":"khaleesiwang","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"378179737452","locked_tokens":"35000.0000 EOSDAC","requestedpay":"45.0000 EOS","candidate_name":"khaleesiwang"}},{"key":"kwonwoosang1","payer":"kwonwoosang1","json":{"custodian_end_time_stamp":"2019-09-15T19:08:51","is_active":0,"total_votes":"179044098206","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"kwonwoosang1"}},{"key":"lcheosdackor","payer":"lcheosdackor","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"62096959811","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"lcheosdackor"}},{"key":"lukeeosproxy","payer":"lukeeosproxy","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"416299717297","locked_tokens":"100000.0000 EOSDAC","requestedpay":"1.0000 EOS","candidate_name":"lukeeosproxy"}},{"key":"lvalentinevv","payer":"lvalentinevv","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"49.0000 EOS","candidate_name":"lvalentinevv"}},{"key":"marcomooneos","payer":"marcomooneos","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"1.0000 EOS","candidate_name":"marcomooneos"}},{"key":"mentormarket","payer":"mentormarket","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":1000000,"locked_tokens":"50000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"mentormarket"}},{"key":"mryeateshere","payer":"mryeateshere","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"418861541633","locked_tokens":"35000.0000 EOSDAC","requestedpay":"0.0001 EOS","candidate_name":"mryeateshere"}},{"key":"polonius1111","payer":"polonius1111","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"0.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"polonius1111"}},{"key":"soyoungkimsk","payer":"soyoungkimsk","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"371798291884","locked_tokens":"35000.0000 EOSDAC","requestedpay":"35.0000 EOS","candidate_name":"soyoungkimsk"}},{"key":"spaceinvader","payer":"spaceinvader","json":{"custodian_end_time_stamp":"2019-11-03T19:11:02","is_active":1,"total_votes":"359083708428","locked_tokens":"35000.0000 EOSDAC","requestedpay":"1.0000 EOS","candidate_name":"spaceinvader"}},{"key":"sstarcitizen","payer":"sstarcitizen","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":853549374,"locked_tokens":"60000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"sstarcitizen"}},{"key":"taoteching11","payer":"taoteching11","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"38333.3333 EOSDAC","requestedpay":"33.3333 EOS","candidate_name":"taoteching11"}},{"key":"yangjeeho123","payer":"yangjeeho123","json":{"custodian_end_time_stamp":"2019-09-08T19:08:33","is_active":0,"total_votes":"132589546498","locked_tokens":"35000.0000 EOSDAC","requestedpay":"50.0000 EOS","candidate_name":"yangjeeho123"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_candidates_daccustodian_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90af9aadb8994d82aa9d7b584c8071f2d97f95526152655b4b7a8783054e","up_to_block_num":73175215,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_candidates_dacelections_dacelections_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e3a4d0983060a11811e08354faa66ecb87747e227d2bd0a057b411aa63","up_to_block_num":43512803,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"boiboiboiboi","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"638788280000","locked_tokens":"20000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"boiboiboiboi"}},{"key":"eosdaccustaa","payer":"eosdaccustaa","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaa"}},{"key":"eosdaccustab","payer":"eosdaccustab","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":1650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustab"}},{"key":"eosdaccustac","payer":"eosdaccustac","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustac"}},{"key":"eosdaccustad","payer":"eosdaccustad","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustad"}},{"key":"eosdaccustae","payer":"eosdaccustae","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustae"}},{"key":"eosdaccustaf","payer":"eosdaccustaf","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaf"}},{"key":"eosdaccustag","payer":"eosdaccustag","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustag"}},{"key":"eosdaccustah","payer":"eosdaccustah","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustah"}},{"key":"eosdaccustai","payer":"eosdaccustai","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustai"}},{"key":"eosdaccustaj","payer":"eosdaccustaj","json":{"custodian_end_time_stamp":"2019-05-04T22:52:08","is_active":1,"total_votes":2300000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaj"}},{"key":"eosdaccustak","payer":"eosdaccustak","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustak"}},{"key":"eosdaccustal","payer":"eosdaccustal","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustal"}},{"key":"eosdaccustam","payer":"eosdaccustam","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustam"}},{"key":"eosdaccustan","payer":"eosdaccustan","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":1650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustan"}},{"key":"eosdaccustao","payer":"eosdaccustao","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"31300000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustao"}},{"key":"eosdaccustap","payer":"eosdaccustap","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustap"}},{"key":"eosdaccustaq","payer":"eosdaccustaq","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaq"}},{"key":"eosdaccustar","payer":"eosdaccustar","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustar"}},{"key":"eosdaccustas","payer":"eosdaccustas","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustas"}},{"key":"eosdaccustat","payer":"eosdaccustat","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustat"}},{"key":"eosdaccustav","payer":"eosdaccustav","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustav"}},{"key":"eosdaccustaw","payer":"eosdaccustaw","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaw"}},{"key":"eosdaccustax","payer":"eosdaccustax","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustax"}},{"key":"eosdaccustay","payer":"eosdaccustay","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustay"}},{"key":"eosdaccustaz","payer":"eosdaccustaz","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"4300000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaz"}},{"key":"evilmikeher1","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-09-05T14:17:45","is_active":1,"total_votes":0,"locked_tokens":"35009.9999 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher1"}},{"key":"evilmikeher2","payer":"evilmikeher2","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"8136857099996","locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher2"}},{"key":"evilmikeher3","payer":"evilmikeher3","json":{"custodian_end_time_stamp":"2019-09-21T20:51:08","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher3"}},{"key":"evilmikeher4","payer":"evilmikeher4","json":{"custodian_end_time_stamp":"2019-09-05T14:17:45","is_active":0,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher4"}},{"key":"evilmikeher5","payer":"evilmikeher5","json":{"custodian_end_time_stamp":"2019-09-05T14:17:45","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher5"}},{"key":"evilmikehere","payer":"evilmikehere","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"5505935299979","locked_tokens":"2000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikehere"}},{"key":"gqytqmbxgyge","payer":"gqytqmbxgyge","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"10.0000 KASDAC","requestedpay":"48.0000 EOS","candidate_name":"gqytqmbxgyge"}},{"key":"greenturtle1","payer":"greenturtle1","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"637998280000","locked_tokens":"10.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"greenturtle1"}},{"key":"kas","payer":"kas","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"10.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"kas"}},{"key":"kasdactokens","payer":"kasdactokens","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"62.0000 KASDAC","requestedpay":"0.0000 EOS","candidate_name":"kasdactokens"}},{"key":"lukedactest1","payer":"lukedactest1","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"4867938009979","locked_tokens":"10.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"lukedactest1"}},{"key":"piecesnbits2","payer":"piecesnbits2","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":"9999980001","locked_tokens":"10.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"piecesnbits2"}},{"key":"piecesnbitss","payer":"piecesnbitss","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"5505936289979","locked_tokens":"227.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"piecesnbitss"}},{"key":"sdsdsdtptptp","payer":"sdsdsdtptptp","json":{"custodian_end_time_stamp":"2019-08-29T21:20:34","is_active":1,"total_votes":0,"locked_tokens":"10.0000 KASDAC","requestedpay":"0.1000 EOS","candidate_name":"sdsdsdtptptp"}},{"key":"testdaccus11","payer":"testdaccus11","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"810249860000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus11"}},{"key":"testdaccus12","payer":"testdaccus12","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"5527936289979","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus12"}},{"key":"testdaccus13","payer":"testdaccus13","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"22000000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus13"}},{"key":"testdaccus14","payer":"testdaccus14","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"22000000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus14"}},{"key":"testdaccus15","payer":"testdaccus15","json":{"custodian_end_time_stamp":"2019-09-26T12:44:37","is_active":1,"total_votes":"22000000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus15"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_candidates_dacelections_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e4893d9cc4b5d8c24dd5f0a9dbe87427a19d5dc8e96c33dec81f30bff6","up_to_block_num":43512804,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"638788280000","locked_tokens":"20000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"boiboiboiboi"}},{"key":"eosdaccustaa","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaa"}},{"key":"eosdaccustab","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":1650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustab"}},{"key":"eosdaccustac","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustac"}},{"key":"eosdaccustad","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustad"}},{"key":"eosdaccustae","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustae"}},{"key":"eosdaccustaf","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaf"}},{"key":"eosdaccustag","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-08T21:27:49","is_active":1,"total_votes":650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustag"}},{"key":"eosdaccustah","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustah"}},{"key":"eosdaccustai","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-09T19:17:10","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustai"}},{"key":"eosdaccustaj","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-05-04T22:52:08","is_active":1,"total_votes":2300000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaj"}},{"key":"eosdaccustak","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustak"}},{"key":"eosdaccustal","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustal"}},{"key":"eosdaccustam","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustam"}},{"key":"eosdaccustan","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":1650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustan"}},{"key":"eosdaccustao","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"31300000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustao"}},{"key":"eosdaccustap","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustap"}},{"key":"eosdaccustaq","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaq"}},{"key":"eosdaccustar","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":2650000000,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustar"}},{"key":"eosdaccustas","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustas"}},{"key":"eosdaccustat","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustat"}},{"key":"eosdaccustav","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustav"}},{"key":"eosdaccustaw","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaw"}},{"key":"eosdaccustax","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustax"}},{"key":"eosdaccustay","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustay"}},{"key":"eosdaccustaz","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"4300000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"eosdaccustaz"}},{"key":"evilmikeher1","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-09-05T14:17:45","is_active":1,"total_votes":0,"locked_tokens":"35009.9999 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher1"}},{"key":"evilmikeher2","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"8126847079996","locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher2"}},{"key":"evilmikeher3","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-09-21T20:51:08","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher3"}},{"key":"evilmikeher4","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-09-05T14:17:45","is_active":0,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher4"}},{"key":"evilmikeher5","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-09-05T14:17:45","is_active":1,"total_votes":0,"locked_tokens":"35000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"evilmikeher5"}},{"key":"evilmikehere","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"1417027130000","locked_tokens":"2123.0002 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"evilmikehere"}},{"key":"gqytqmbxgyge","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"10.0000 KASDAC","requestedpay":"48.0000 EOS","candidate_name":"gqytqmbxgyge"}},{"key":"greenturtle1","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-05T20:00:14","is_active":0,"total_votes":"637998280000","locked_tokens":"10.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"greenturtle1"}},{"key":"kas","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"10.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"kas"}},{"key":"kasdactokens","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":0,"total_votes":0,"locked_tokens":"62.0000 KASDAC","requestedpay":"0.0000 EOS","candidate_name":"kasdactokens"}},{"key":"lukedactest1","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-04T15:22:52","is_active":0,"total_votes":"789039860000","locked_tokens":"10.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"lukedactest1"}},{"key":"piecesnbits2","payer":"piecesnbits2","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"9999980001","locked_tokens":"11.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"piecesnbits2"}},{"key":"piecesnbitss","payer":"piecesnbitss","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"5505936289979","locked_tokens":"241.0000 KASDAC","requestedpay":"20.0000 EOS","candidate_name":"piecesnbitss"}},{"key":"sdsdsdtptptp","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-08-29T21:20:34","is_active":1,"total_votes":0,"locked_tokens":"10.0000 KASDAC","requestedpay":"0.1000 EOS","candidate_name":"sdsdsdtptptp"}},{"key":"testdaccus11","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"810249860000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus11"}},{"key":"testdaccus12","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"5527936289979","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus12"}},{"key":"testdaccus13","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"22000000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus13"}},{"key":"testdaccus14","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"22000000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus14"}},{"key":"testdaccus15","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"22000000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccus15"}},{"key":"testdaccust1","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"21650000000","locked_tokens":"70000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccust1"}},{"key":"testdaccust2","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-10-15T21:22:47","is_active":1,"total_votes":"21650000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccust2"}},{"key":"testdaccust3","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-06-01T13:54:33","is_active":1,"total_votes":"21650000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccust3"}},{"key":"testdaccust4","payer":"dacelections","json":{"custodian_end_time_stamp":"2019-07-04T10:43:42","is_active":1,"total_votes":"21650000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccust4"}},{"key":"testdaccust5","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":"21650000000","locked_tokens":"35000.0000 KASDAC","requestedpay":"1.0000 EOS","candidate_name":"testdaccust5"}},{"key":"tiktiktiktik","payer":"dacelections","json":{"custodian_end_time_stamp":"1970-01-01T00:00:00","is_active":1,"total_votes":0,"locked_tokens":"10000.0000 KASDAC","requestedpay":"10.0000 EOS","candidate_name":"tiktiktiktik"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_custodians_daccustodian_daccustodian_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90af9aadb8994d82aa9d7b584c8071f2d97f95526152655b4b7a8783054e","up_to_block_num":73175215,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[{"key":"angeljeffrey","payer":"daccustodian","json":{"total_votes":"525842667285","requestedpay":"50.0000 EOS","cust_name":"angeljeffrey"}},{"key":"brockpierce1","payer":"daccustodian","json":{"total_votes":"447235180420","requestedpay":"0.0000 EOS","cust_name":"brockpierce1"}},{"key":"cream5eosdac","payer":"daccustodian","json":{"total_votes":"390110948548","requestedpay":"50.0000 EOS","cust_name":"cream5eosdac"}},{"key":"criseosdacio","payer":"daccustodian","json":{"total_votes":"433817176509","requestedpay":"50.0000 EOS","cust_name":"criseosdacio"}},{"key":"dallasjohnso","payer":"daccustodian","json":{"total_votes":"344817046918","requestedpay":"10.0000 EOS","cust_name":"dallasjohnso"}},{"key":"greentreesom","payer":"daccustodian","json":{"total_votes":"391453570854","requestedpay":"10.0000 EOS","cust_name":"greentreesom"}},{"key":"jbucksteiner","payer":"daccustodian","json":{"total_votes":"356368137694","requestedpay":"1.0000 EOS","cust_name":"jbucksteiner"}},{"key":"khaleesiwang","payer":"daccustodian","json":{"total_votes":"378172783144","requestedpay":"45.0000 EOS","cust_name":"khaleesiwang"}},{"key":"lukeeosproxy","payer":"daccustodian","json":{"total_votes":"415621310533","requestedpay":"1.0000 EOS","cust_name":"lukeeosproxy"}},{"key":"mryeateshere","payer":"daccustodian","json":{"total_votes":"418787089177","requestedpay":"0.0001 EOS","cust_name":"mryeateshere"}},{"key":"soyoungkimsk","payer":"daccustodian","json":{"total_votes":"364624434382","requestedpay":"35.0000 EOS","cust_name":"soyoungkimsk"}},{"key":"spaceinvader","payer":"daccustodian","json":{"total_votes":"359083708428","requestedpay":"1.0000 EOS","cust_name":"spaceinvader"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_custodians_daccustodian_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90b047062a4fd284bd1f465568a677412f69427abb9a854ffa09cbd0c678","up_to_block_num":73175216,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_custodians_dacelections_dacelections_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e4893d9cc4b5d8c24dd5f0a9dbe87427a19d5dc8e96c33dec81f30bff6","up_to_block_num":43512804,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"dacelections","json":{"total_votes":"638788280000","requestedpay":"1.0000 EOS","cust_name":"boiboiboiboi"}},{"key":"eosdaccustao","payer":"dacelections","json":{"total_votes":"31300000000","requestedpay":"10.0000 EOS","cust_name":"eosdaccustao"}},{"key":"evilmikeher2","payer":"dacelections","json":{"total_votes":"4057959940017","requestedpay":"10.0000 EOS","cust_name":"evilmikeher2"}},{"key":"evilmikehere","payer":"dacelections","json":{"total_votes":"5505935299984","requestedpay":"10.0000 EOS","cust_name":"evilmikehere"}},{"key":"greenturtle1","payer":"dacelections","json":{"total_votes":"637998280000","requestedpay":"10.0000 EOS","cust_name":"greenturtle1"}},{"key":"lukedactest1","payer":"dacelections","json":{"total_votes":"4867937019984","requestedpay":"10.0000 EOS","cust_name":"lukedactest1"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_custodians_dacelections_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e53476ddea2b236d8dac1f30d6cea8f9ece632fd563d95b4046dceb698","up_to_block_num":43512805,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"dacauthority","json":{"total_votes":"638788280000","requestedpay":"1.0000 EOS","cust_name":"boiboiboiboi"}},{"key":"eosdaccustao","payer":"dacauthority","json":{"total_votes":"31300000000","requestedpay":"10.0000 EOS","cust_name":"eosdaccustao"}},{"key":"evilmikeher2","payer":"dacauthority","json":{"total_votes":"8136857099996","requestedpay":"10.0000 EOS","cust_name":"evilmikeher2"}},{"key":"evilmikehere","payer":"dacauthority","json":{"total_votes":"1427037150000","requestedpay":"1.0000 EOS","cust_name":"evilmikehere"}},{"key":"piecesnbitss","payer":"dacauthority","json":{"total_votes":"5505936289979","requestedpay":"10.0000 EOS","cust_name":"piecesnbitss"}},{"key":"testdaccus11","payer":"dacauthority","json":{"total_votes":"810249860000","requestedpay":"1.0000 EOS","cust_name":"testdaccus11"}},{"key":"testdaccus12","payer":"dacauthority","json":{"total_votes":"5527936289979","requestedpay":"1.0000 EOS","cust_name":"testdaccus12"}},{"key":"testdaccus13","payer":"dacauthority","json":{"total_votes":"22000000000","requestedpay":"1.0000 EOS","cust_name":"testdaccus13"}},{"key":"testdaccus14","payer":"dacauthority","json":{"total_votes":"22000000000","requestedpay":"1.0000 EOS","cust_name":"testdaccus14"}},{"key":"testdaccus15","payer":"dacauthority","json":{"total_votes":"22000000000","requestedpay":"1.0000 EOS","cust_name":"testdaccus15"}},{"key":"testdaccust1","payer":"dacauthority","json":{"total_votes":"21650000000","requestedpay":"1.0000 EOS","cust_name":"testdaccust1"}},{"key":"testdaccust2","payer":"dacauthority","json":{"total_votes":"21650000000","requestedpay":"1.0000 EOS","cust_name":"testdaccust2"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_members_eosdactokens_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90acfd9919bed5d85e3d140e9821b373fd11a2c73e8041f0e42d17a2fe78","up_to_block_num":73175212,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_members_kasdactokens_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e1872db0f11dc873bffaa7833a1f1e04848585d0a7be7a25f4c21223de","up_to_block_num":43512801,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"boiboiboiboi"}},{"key":"dacadmin1111","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"dacadmin1111"}},{"key":"dallasjohnso","payer":"dallasjohnso","json":{"agreedtermsversion":2,"sender":"dallasjohnso"}},{"key":"eosdaccustaa","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustaa"}},{"key":"eosdaccustab","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustab"}},{"key":"eosdaccustac","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustac"}},{"key":"eosdaccustad","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustad"}},{"key":"eosdaccustae","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustae"}},{"key":"eosdaccustaf","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustaf"}},{"key":"eosdaccustag","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustag"}},{"key":"eosdaccustah","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustah"}},{"key":"eosdaccustai","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustai"}},{"key":"eosdaccustaj","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustaj"}},{"key":"eosdaccustak","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustak"}},{"key":"eosdaccustal","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustal"}},{"key":"eosdaccustam","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustam"}},{"key":"eosdaccustan","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustan"}},{"key":"eosdaccustao","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustao"}},{"key":"eosdaccustap","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustap"}},{"key":"eosdaccustaq","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustaq"}},{"key":"eosdaccustar","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustar"}},{"key":"eosdaccustas","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustas"}},{"key":"eosdaccustat","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustat"}},{"key":"eosdaccustau","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustau"}},{"key":"eosdaccustav","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustav"}},{"key":"eosdaccustaw","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustaw"}},{"key":"eosdaccustax","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustax"}},{"key":"eosdaccustay","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustay"}},{"key":"eosdaccustaz","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"eosdaccustaz"}},{"key":"eosdacthebot","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"eosdacthebot"}},{"key":"evilmikeher1","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"evilmikeher1"}},{"key":"evilmikeher2","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"evilmikeher2"}},{"key":"evilmikeher3","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"evilmikeher3"}},{"key":"evilmikeher4","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"evilmikeher4"}},{"key":"evilmikeher5","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"evilmikeher5"}},{"key":"evilmikehere","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"evilmikehere"}},{"key":"gamblrtestee","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"gamblrtestee"}},{"key":"gqytqmbxgyge","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"gqytqmbxgyge"}},{"key":"greenturtle1","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"greenturtle1"}},{"key":"gu2tgmztgmge","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"gu2tgmztgmge"}},{"key":"gyftieuser11","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"gyftieuser11"}},{"key":"johndoe12311","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"johndoe12311"}},{"key":"kas","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"kas"}},{"key":"kasdactokens","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"kasdactokens"}},{"key":"lukedactest1","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"lukedactest1"}},{"key":"michaelfuck4","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"michaelfuck4"}},{"key":"michaelzhang","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"michaelzhang"}},{"key":"mustafabw123","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"mustafabw123"}},{"key":"piecesnbits2","payer":"piecesnbits2","json":{"agreedtermsversion":2,"sender":"piecesnbits2"}},{"key":"piecesnbits4","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"piecesnbits4"}},{"key":"piecesnbitss","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"piecesnbitss"}},{"key":"sdsdsdtptptp","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"sdsdsdtptptp"}},{"key":"soleoneoneos","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"soleoneoneos"}},{"key":"testdaccus11","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccus11"}},{"key":"testdaccus12","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccus12"}},{"key":"testdaccus13","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccus13"}},{"key":"testdaccus14","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccus14"}},{"key":"testdaccus15","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccus15"}},{"key":"testdaccust1","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccust1"}},{"key":"testdaccust2","payer":"kasdactokens","json":{"agreedtermsversion":2,"sender":"testdaccust2"}},{"key":"testdaccust3","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"testdaccust3"}},{"key":"testdaccust4","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"testdaccust4"}},{"key":"testdaccust5","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"testdaccust5"}},{"key":"tiktiktiktik","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"tiktiktiktik"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_members_kasdactokens_kasdactokens_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e1872db0f11dc873bffaa7833a1f1e04848585d0a7be7a25f4c21223de","up_to_block_num":43512801,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"boiboiboiboi","json":{"agreedtermsversion":2,"sender":"boiboiboiboi"}},{"key":"dacadmin1111","payer":"dacadmin1111","json":{"agreedtermsversion":1,"sender":"dacadmin1111"}},{"key":"dallasjohnso","payer":"dallasjohnso","json":{"agreedtermsversion":2,"sender":"dallasjohnso"}},{"key":"eosdaccustaa","payer":"eosdaccustaa","json":{"agreedtermsversion":1,"sender":"eosdaccustaa"}},{"key":"eosdaccustab","payer":"eosdaccustab","json":{"agreedtermsversion":1,"sender":"eosdaccustab"}},{"key":"eosdaccustac","payer":"eosdaccustac","json":{"agreedtermsversion":1,"sender":"eosdaccustac"}},{"key":"eosdaccustad","payer":"eosdaccustad","json":{"agreedtermsversion":1,"sender":"eosdaccustad"}},{"key":"eosdaccustae","payer":"eosdaccustae","json":{"agreedtermsversion":1,"sender":"eosdaccustae"}},{"key":"eosdaccustaf","payer":"eosdaccustaf","json":{"agreedtermsversion":1,"sender":"eosdaccustaf"}},{"key":"eosdaccustag","payer":"eosdaccustag","json":{"agreedtermsversion":1,"sender":"eosdaccustag"}},{"key":"eosdaccustah","payer":"eosdaccustah","json":{"agreedtermsversion":1,"sender":"eosdaccustah"}},{"key":"eosdaccustai","payer":"eosdaccustai","json":{"agreedtermsversion":1,"sender":"eosdaccustai"}},{"key":"eosdaccustaj","payer":"eosdaccustaj","json":{"agreedtermsversion":1,"sender":"eosdaccustaj"}},{"key":"eosdaccustak","payer":"eosdaccustak","json":{"agreedtermsversion":1,"sender":"eosdaccustak"}},{"key":"eosdaccustal","payer":"eosdaccustal","json":{"agreedtermsversion":1,"sender":"eosdaccustal"}},{"key":"eosdaccustam","payer":"eosdaccustam","json":{"agreedtermsversion":1,"sender":"eosdaccustam"}},{"key":"eosdaccustan","payer":"eosdaccustan","json":{"agreedtermsversion":1,"sender":"eosdaccustan"}},{"key":"eosdaccustao","payer":"eosdaccustao","json":{"agreedtermsversion":1,"sender":"eosdaccustao"}},{"key":"eosdaccustap","payer":"eosdaccustap","json":{"agreedtermsversion":1,"sender":"eosdaccustap"}},{"key":"eosdaccustaq","payer":"eosdaccustaq","json":{"agreedtermsversion":1,"sender":"eosdaccustaq"}},{"key":"eosdaccustar","payer":"eosdaccustar","json":{"agreedtermsversion":1,"sender":"eosdaccustar"}},{"key":"eosdaccustas","payer":"eosdaccustas","json":{"agreedtermsversion":1,"sender":"eosdaccustas"}},{"key":"eosdaccustat","payer":"eosdaccustat","json":{"agreedtermsversion":1,"sender":"eosdaccustat"}},{"key":"eosdaccustau","payer":"eosdaccustau","json":{"agreedtermsversion":1,"sender":"eosdaccustau"}},{"key":"eosdaccustav","payer":"eosdaccustav","json":{"agreedtermsversion":1,"sender":"eosdaccustav"}},{"key":"eosdaccustaw","payer":"eosdaccustaw","json":{"agreedtermsversion":1,"sender":"eosdaccustaw"}},{"key":"eosdaccustax","payer":"eosdaccustax","json":{"agreedtermsversion":1,"sender":"eosdaccustax"}},{"key":"eosdaccustay","payer":"eosdaccustay","json":{"agreedtermsversion":1,"sender":"eosdaccustay"}},{"key":"eosdaccustaz","payer":"eosdaccustaz","json":{"agreedtermsversion":1,"sender":"eosdaccustaz"}},{"key":"eosdacthebot","payer":"eosdacthebot","json":{"agreedtermsversion":2,"sender":"eosdacthebot"}},{"key":"evilmikeher1","payer":"evilmikeher1","json":{"agreedtermsversion":2,"sender":"evilmikeher1"}},{"key":"evilmikeher2","payer":"evilmikeher2","json":{"agreedtermsversion":2,"sender":"evilmikeher2"}},{"key":"evilmikeher3","payer":"evilmikeher3","json":{"agreedtermsversion":2,"sender":"evilmikeher3"}},{"key":"evilmikeher4","payer":"evilmikeher4","json":{"agreedtermsversion":2,"sender":"evilmikeher4"}},{"key":"evilmikeher5","payer":"evilmikeher5","json":{"agreedtermsversion":2,"sender":"evilmikeher5"}},{"key":"evilmikehere","payer":"evilmikehere","json":{"agreedtermsversion":2,"sender":"evilmikehere"}},{"key":"gamblrtestee","payer":"gamblrtestee","json":{"agreedtermsversion":1,"sender":"gamblrtestee"}},{"key":"gqytqmbxgyge","payer":"gqytqmbxgyge","json":{"agreedtermsversion":1,"sender":"gqytqmbxgyge"}},{"key":"greenturtle1","payer":"greenturtle1","json":{"agreedtermsversion":1,"sender":"greenturtle1"}},{"key":"gu2tgmztgmge","payer":"gu2tgmztgmge","json":{"agreedtermsversion":1,"sender":"gu2tgmztgmge"}},{"key":"gyftieuser11","payer":"gyftieuser11","json":{"agreedtermsversion":1,"sender":"gyftieuser11"}},{"key":"johndoe12311","payer":"johndoe12311","json":{"agreedtermsversion":1,"sender":"johndoe12311"}},{"key":"kas","payer":"kas","json":{"agreedtermsversion":2,"sender":"kas"}},{"key":"kasdactokens","payer":"kasdactokens","json":{"agreedtermsversion":1,"sender":"kasdactokens"}},{"key":"lukedactest1","payer":"lukedactest1","json":{"agreedtermsversion":2,"sender":"lukedactest1"}},{"key":"michaelfuck4","payer":"michaelfuck4","json":{"agreedtermsversion":1,"sender":"michaelfuck4"}},{"key":"michaelzhang","payer":"michaelzhang","json":{"agreedtermsversion":1,"sender":"michaelzhang"}},{"key":"mustafabw123","payer":"mustafabw123","json":{"agreedtermsversion":1,"sender":"mustafabw123"}},{"key":"piecesnbits4","payer":"piecesnbits4","json":{"agreedtermsversion":2,"sender":"piecesnbits4"}},{"key":"piecesnbitss","payer":"piecesnbitss","json":{"agreedtermsversion":2,"sender":"piecesnbitss"}},{"key":"sdsdsdtptptp","payer":"sdsdsdtptptp","json":{"agreedtermsversion":1,"sender":"sdsdsdtptptp"}},{"key":"soleoneoneos","payer":"soleoneoneos","json":{"agreedtermsversion":2,"sender":"soleoneoneos"}},{"key":"testdaccus11","payer":"testdaccus11","json":{"agreedtermsversion":2,"sender":"testdaccus11"}},{"key":"testdaccus12","payer":"testdaccus12","json":{"agreedtermsversion":2,"sender":"testdaccus12"}},{"key":"testdaccus13","payer":"testdaccus13","json":{"agreedtermsversion":2,"sender":"testdaccus13"}},{"key":"testdaccus14","payer":"testdaccus14","json":{"agreedtermsversion":2,"sender":"testdaccus14"}},{"key":"testdaccus15","payer":"testdaccus15","json":{"agreedtermsversion":2,"sender":"testdaccus15"}},{"key":"testdaccust1","payer":"testdaccust1","json":{"agreedtermsversion":2,"sender":"testdaccust1"}},{"key":"testdaccust2","payer":"testdaccust2","json":{"agreedtermsversion":2,"sender":"testdaccust2"}},{"key":"testdaccust3","payer":"testdaccust3","json":{"agreedtermsversion":1,"sender":"testdaccust3"}},{"key":"testdaccust4","payer":"testdaccust4","json":{"agreedtermsversion":1,"sender":"testdaccust4"}},{"key":"testdaccust5","payer":"testdaccust5","json":{"agreedtermsversion":1,"sender":"testdaccust5"}},{"key":"tiktiktiktik","payer":"tiktiktiktik","json":{"agreedtermsversion":1,"sender":"tiktiktiktik"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_memberterms_eosdactokens_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90ad1237ae47206e4e3a41edf02bdd0ac97de766b243c9fd54a064292a09","up_to_block_num":73175213,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_memberterms_eosdactokens_eosdactokens_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90ad1237ae47206e4e3a41edf02bdd0ac97de766b243c9fd54a064292a09","up_to_block_num":73175213,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[{"key":"............1","payer":"eosdactokens","json":{"version":1,"hash":"82b647f721f27e08f4f2b313d6105294","terms":"https://raw.githubusercontent.com/eosdac/constitution/v1/constitution.md"}},{"key":"............2","payer":"eosdactokens","json":{"version":2,"hash":"6d2cc6201302b3f485e2a939881ae451","terms":"https://raw.githubusercontent.com/eosdac/constitution/v2/constitution.md"}},{"key":"............3","payer":"eosdactokens","json":{"version":3,"hash":"51c6a3db7c90801f81cdd2645228aa47","terms":"https://raw.githubusercontent.com/eosdac/constitution/v3/constitution.md"}},{"key":"............4","payer":"eosdactokens","json":{"version":4,"hash":"be2c9d0494417cf7522cd8d6f774477c","terms":"https://raw.githubusercontent.com/eosdac/constitution/v4/constitution.md"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_memberterms_kasdactokens_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e3a4d0983060a11811e08354faa66ecb87747e227d2bd0a057b411aa63","up_to_block_num":43512803,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"............1","payer":"kasdactokens","json":{"version":1,"hash":"6d2cc6201302b3f485e2a939881ae451","terms":"https://raw.githubusercontent.com/eosdac/constitution/14d8d6d0262707f7c72183cff505d19e321f1cb3/constitution.md"}},{"key":"............2","payer":"kasdactokens","json":{"version":2,"hash":"be2c9d0494417cf7522cd8d6f774477c","terms":"https://raw.githubusercontent.com/eosdac/eosdac-constitution/master/constitution.md"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_memberterms_kasdactokens_kasdactokens_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e25bbacc15f18abbbedd60ea7fa1edb954cb63d9d919a25837ea4a0e9d","up_to_block_num":43512802,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"............1","payer":"kasdactokens","json":{"version":1,"hash":"6d2cc6201302b3f485e2a939881ae451","terms":"https://raw.githubusercontent.com/eosdac/constitution/14d8d6d0262707f7c72183cff505d19e321f1cb3/constitution.md"}},{"key":"............2","payer":"kasdactokens","json":{"version":2,"hash":"be2c9d0494417cf7522cd8d6f774477c","terms":"https://raw.githubusercontent.com/eosdac/eosdac-constitution/master/constitution.md"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_state_daccustodian_daccustodian_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90b1218e6ca5775b5fcc287b425ba17bef34f94d852ed94f199510089a12","up_to_block_num":73175217,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[{"key":"state","payer":"daccustodian","json":{"met_initial_votes_threshold":true,"number_active_candidates":21,"total_votes_on_candidates":"5786698249925","total_weight_of_votes":"1234937547017","lastperiodtime":"2019-08-05T19:11:02"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_state_daccustodian_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90b2c9702b96ec253227faaa1aa6ca1156c97adc0c847a91a13118906628","up_to_block_num":73175218,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_state_dacelections_dacelections_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e53476ddea2b236d8dac1f30d6cea8f9ece632fd563d95b4046dceb698","up_to_block_num":43512805,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_state_dacelections_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e6be0e11066c33334c4db28fcdaca8699e14b50ec788a272882e167a9a","up_to_block_num":43512806,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"state","payer":"dacauthority","json":{"met_initial_votes_threshold":true,"number_active_candidates":44,"total_votes_on_candidates":"23692473049955","total_weight_of_votes":"9642135199997","lastperiodtime":"2019-07-17T21:22:47"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_votes_daccustodian_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"045c90b401e009930f0fcca4e78b09806f942142e0b07e53cc359ec40a2c8c3c","up_to_block_num":73175220,"last_irreversible_block_id":"045c8f67095c57aea2eaecb9232884d4abddf93cfd6de2ef8d64cee16260eac1","last_irreversible_block_num":73174887,"rows":[]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_votes_dacelections_dacelections_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e6be0e11066c33334c4db28fcdaca8699e14b50ec788a272882e167a9a","up_to_block_num":43512806,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"boiboiboiboi","json":{"candidates":["evilmikehere","boiboiboiboi","testdaccus12","piecesnbitss","lukedactest1"],"proxy":"","voter":"boiboiboiboi"}},{"key":"eosdaccustaa","payer":"eosdaccustaa","json":{"candidates":["eosdaccustar","eosdaccustaz","eosdaccustap","eosdaccustal","eosdaccustam"],"proxy":"","voter":"eosdaccustaa"}},{"key":"eosdaccustab","payer":"eosdaccustab","json":{"candidates":["eosdaccustab","eosdaccustaz","eosdaccustaj","eosdaccustao","eosdaccustan"],"proxy":"","voter":"eosdaccustab"}},{"key":"eosdaccustah","payer":"eosdaccustah","json":{"candidates":["eosdaccustad","eosdaccustae","eosdaccustaf","eosdaccustaj","eosdaccustag"],"proxy":"","voter":"eosdaccustah"}},{"key":"evilmikeher3","payer":"evilmikeher3","json":{"candidates":["eosdaccustao"],"proxy":"","voter":"evilmikeher3"}},{"key":"evilmikehere","payer":"evilmikehere","json":{"candidates":["evilmikehere","evilmikeher2"],"proxy":"","voter":"evilmikehere"}},{"key":"gqytqmbxgyge","payer":"gqytqmbxgyge","json":{"candidates":["evilmikehere"],"proxy":"","voter":"gqytqmbxgyge"}},{"key":"gu2tgmztgmge","payer":"gu2tgmztgmge","json":{"candidates":["evilmikehere","lukedactest1","eosdaccustay","eosdaccustaz","gqytqmbxgyge"],"proxy":"","voter":"gu2tgmztgmge"}},{"key":"gyftieuser11","payer":"gyftieuser11","json":{"candidates":["evilmikehere","lukedactest1"],"proxy":"","voter":"gyftieuser11"}},{"key":"kasdactokens","payer":"kasdactokens","json":{"candidates":["evilmikehere","piecesnbitss","boiboiboiboi","greenturtle1","testdaccus12"],"proxy":"","voter":"kasdactokens"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/_table_data_votes_dacelections_eos.dac_0_.json:
--------------------------------------------------------------------------------
1 | {"up_to_block_id":"0297f3e75ef79f72ca865a96f2af2b96bf227fe1ce699f0e25f0de1a705e63c9","up_to_block_num":43512807,"last_irreversible_block_id":"0297f29130fd8fac11162b66c8e9beeec1e9f80e24edfe6eac9550dfc1bbea53","last_irreversible_block_num":43512465,"rows":[{"key":"boiboiboiboi","payer":"dacelections","json":{"candidates":["evilmikehere","boiboiboiboi","testdaccus12","piecesnbitss","lukedactest1"],"proxy":"","voter":"boiboiboiboi"}},{"key":"eosdaccustaa","payer":"dacelections","json":{"candidates":["eosdaccustar","eosdaccustaz","eosdaccustap","eosdaccustal","eosdaccustam"],"proxy":"","voter":"eosdaccustaa"}},{"key":"eosdaccustab","payer":"dacelections","json":{"candidates":["eosdaccustab","eosdaccustaz","eosdaccustaj","eosdaccustao","eosdaccustan"],"proxy":"","voter":"eosdaccustab"}},{"key":"eosdaccustah","payer":"dacelections","json":{"candidates":["eosdaccustad","eosdaccustae","eosdaccustaf","eosdaccustaj","eosdaccustag"],"proxy":"","voter":"eosdaccustah"}},{"key":"evilmikeher3","payer":"dacelections","json":{"candidates":["eosdaccustao"],"proxy":"","voter":"evilmikeher3"}},{"key":"evilmikehere","payer":"evilmikehere","json":{"candidates":["evilmikeher2","evilmikehere"],"proxy":"","voter":"evilmikehere"}},{"key":"gqytqmbxgyge","payer":"dacelections","json":{"candidates":["evilmikehere"],"proxy":"","voter":"gqytqmbxgyge"}},{"key":"gu2tgmztgmge","payer":"dacelections","json":{"candidates":["evilmikehere","lukedactest1","eosdaccustay","eosdaccustaz","gqytqmbxgyge"],"proxy":"","voter":"gu2tgmztgmge"}},{"key":"gyftieuser11","payer":"dacelections","json":{"candidates":["evilmikehere","lukedactest1"],"proxy":"","voter":"gyftieuser11"}},{"key":"kasdactokens","payer":"dacelections","json":{"candidates":["evilmikehere","piecesnbitss","boiboiboiboi","greenturtle1","testdaccus12"],"proxy":"","voter":"kasdactokens"}},{"key":"lukedactest1","payer":"dacelections","json":{"candidates":["evilmikehere","lukedactest1","piecesnbitss","testdaccus11","testdaccus12"],"proxy":"","voter":"lukedactest1"}},{"key":"piecesnbits2","payer":"dacelections","json":{"candidates":["piecesnbits2"],"proxy":"","voter":"piecesnbits2"}},{"key":"piecesnbits4","payer":"dacelections","json":{"candidates":["evilmikehere"],"proxy":"","voter":"piecesnbits4"}},{"key":"piecesnbitss","payer":"piecesnbitss","json":{"candidates":["evilmikeher2","testdaccus12","piecesnbitss","evilmikehere"],"proxy":"","voter":"piecesnbitss"}},{"key":"testdaccust1","payer":"dacelections","json":{"candidates":["testdaccust1","testdaccust2","testdaccust3","testdaccust4","testdaccust5"],"proxy":"","voter":"testdaccust1"}},{"key":"testdaccust2","payer":"dacelections","json":{"candidates":["testdaccus11","testdaccus12","testdaccus13","testdaccus14","testdaccus15"],"proxy":"","voter":"testdaccust2"}}]}
--------------------------------------------------------------------------------
/dfuse-tools/cache/last_cache_update.txt:
--------------------------------------------------------------------------------
1 | 1565376626
--------------------------------------------------------------------------------
/dfuse-tools/includes/functions.php:
--------------------------------------------------------------------------------
1 | ";
12 | var_dump($var);
13 | print "";
14 | }
15 |
16 | function console_log($string) {
17 | print "";
18 | }
19 |
20 | // method should be "GET", "PUT", etc..
21 | function request($method, $url, $header, $params) {
22 | $opts = array(
23 | 'http' => array(
24 | 'method' => $method,
25 | ),
26 | );
27 |
28 | // serialize the params if there are any
29 | if (!empty($params)) {
30 | if ($method == "GET") {
31 | $params_array = array();
32 | foreach ($params as $key => $value) {
33 | $params_array[] = "$key=".urlencode($value);
34 | }
35 | $url .= '?'.implode('&', $params_array);
36 | }
37 | if ($method == "POST") {
38 | if (is_array($params)) {
39 | $data = json_encode($params);
40 | } else {
41 | $data = $params;
42 | }
43 | $opts['http']['content'] = $data;
44 | $header['Content-Length'] = strlen($data);
45 | }
46 | }
47 |
48 | // serialize the header if needed
49 | if (!empty($header)) {
50 | $header_str = '';
51 | foreach ($header as $key => $value) {
52 | $header_str .= "$key: $value\r\n";
53 | }
54 | $header_str .= "\r\n";
55 | $opts['http']['header'] = $header_str;
56 | }
57 | //var_dump($opts);
58 | //var_dump($url);
59 | $context = stream_context_create($opts);
60 | $data = file_get_contents($url, false, $context);
61 | return $data;
62 | }
63 |
64 | function getDateTimeFromBlockTime($block_time_string) {
65 | $block_time_string_format = "Y-m-d H:i:s";
66 | $block_time_string = str_replace("T", " ", $block_time_string);
67 | $block_time_string = str_replace(".5", "", $block_time_string);
68 | $block_time_string = str_replace("Z", "", $block_time_string);
69 | $BlockTime = DateTime::createFromFormat($block_time_string_format, $block_time_string);
70 | return $BlockTime;
71 | }
72 |
73 | function getGraphQLResults($q, $table, $token) {
74 | $json = searchGraphQLCached($q, $table, $token);
75 | $data = json_decode($json,true);
76 | $results = $data['data']['searchTransactionsForward']['results'];
77 | if (count($results)) {
78 | $cursor = $results[count($results)-1]['cursor'];
79 | $keep_fetching = true;
80 | while($keep_fetching) {
81 | $more_json = searchGraphQLCached($q, $table, $token, $cursor);
82 | $more_data = json_decode($more_json,true);
83 | $more_results = $more_data['data']['searchTransactionsForward']['results'];
84 | $keep_fetching = false;
85 | if (count($more_results)) {
86 | $keep_fetching = true;
87 | $results = array_merge($results,$more_results);
88 | $cursor = $more_results[count($more_results)-1]['cursor'];
89 | }
90 | }
91 | }
92 | return $results;
93 | }
94 |
95 | function searchGraphQLCached($q, $table, $token, $cursor = '') {
96 | console_log("searchGraphQLCached: Checking Cache... " . $q . " " . $table . " " . $cursor);
97 | $filename = __DIR__ . '/../cache/_' . str_replace(array(' ','/'),'-',$q) . '_' . $table . '_' . $cursor . '.json';
98 | $json = @file_get_contents($filename);
99 | if ($json) {
100 | console_log("searchGraphQLCached: Cache Hit!");
101 | return $json;
102 | }
103 | console_log("searchGraphQLCached: Searching...");
104 | $json = searchGraphQL($q, $table, $token, $cursor);
105 | file_put_contents($filename,$json);
106 | return $json;
107 | }
108 |
109 | function searchGraphQL($q, $table, $token, $cursor = '', $forward = true) {
110 | global $network;
111 | $url = 'https://mainnet.eos.dfuse.io/graphql';
112 | if ($network == 'jungle') {
113 | $url = 'https://jungle.eos.dfuse.io/graphql';
114 | }
115 | $header = array('Content-Type' => 'application/json');
116 | $header['Authorization'] = 'Bearer ' . $token;
117 | $cursor_string = '';
118 | if ($cursor) {
119 | $cursor_string = ', cursor: \"' . $cursor . '\"';
120 | }
121 | $search_type = 'Forward';
122 | if (!$forward) {
123 | $search_type = 'Backward';
124 | $cursor_string = ', lowBlockNum: 60000000';
125 | }
126 | $query = '{"query": "{ searchTransactions' . $search_type . '(query: \"' . $q . ' notif:false\"' . $cursor_string . ') {
127 | results {
128 | cursor
129 | trace {
130 | id
131 | block {
132 | timestamp
133 | }
134 | matchingActions {
135 | account
136 | name
137 | data
138 | authorization {
139 | actor
140 | }
141 | dbOps(table:\"' . $table . '\") {
142 | oldJSON {
143 | object
144 | }
145 | newJSON {
146 | object
147 | }
148 | }
149 | }
150 | }
151 | }
152 | }
153 | }"
154 | }';
155 | $query = str_replace("\n", "", $query);
156 | $json = request("POST", $url, $header, $query);
157 | return $json;
158 | }
159 |
160 | function getScopedAccountTableDataCached($account, $table, $scope, $block_num, $token, $cursor="") {
161 | $filename = __DIR__ . '/../cache/_table_data_' . $table . '_' . $account . '_' . $scope . '_' . $block_num . '_' . $cursor . '.json';
162 | $json = @file_get_contents($filename);
163 | if ($json) {
164 | return $json;
165 | }
166 | $json = getScopedAccountTableData($account, $table, $scope, $block_num, $token, $cursor);
167 | file_put_contents($filename,$json);
168 | return $json;
169 | }
170 |
171 | function getScopedAccountTableData($account, $table, $scope, $block_num, $token, $cursor="") {
172 | global $network;
173 | console_log("...Updating Cache: _table_data_" . $table . '_' . $account . '_' . $scope . '_' . $block_num . "...");
174 | $url = 'https://mainnet.eos.dfuse.io/v0/state/table';
175 | if ($network == 'jungle') {
176 | $url = 'https://jungle.eos.dfuse.io/v0/state/table';
177 | }
178 | $params = array('account' => $account, 'scope' => $scope, 'table' => $table, 'json' => true);
179 | if ($block_num > 0) {
180 | $params['block_num'] = $block_num;
181 | }
182 | if ($cursor != "") {
183 | $params['cursor'] = $cursor;
184 | }
185 | $header = array('Content-Type' => 'application/json');
186 | $header['Authorization'] = 'Bearer ' . $token;
187 | $json = request("GET", $url, $header, $params);
188 | return $json;
189 | }
190 |
191 | function compareData($old_data, $new_data) {
192 | $count = 0;
193 | foreach ($old_data['rows'] as $row) {
194 | $count++;
195 | $matched = false;
196 | $result = array();
197 | foreach ($new_data['rows'] as $new_row) {
198 | //if ($row['key'] == $new_row['key'] && $row['json']['agreedtermsversion'] == $new_row['json']['agreedtermsversion']) {
199 | if ($row['key'] == $new_row['key']) {
200 | //$result = array_diff_assoc($row['json'],$new_row['json']);
201 | $result = array_diff(array_map('serialize',$row['json']), array_map('serialize',$new_row['json']));
202 | if (count($result) == 0) {
203 | $matched = true;
204 | }
205 | }
206 | }
207 | if (!$matched) {
208 | print "Not a Match: " . $row['key'] . "\n
";
209 | if (count($result)) {
210 | print "Data mismatch: ";
211 | var_dump($result);
212 | print "\n
";
213 | }
214 |
215 | }
216 | }
217 | print $count . " records checked.\n
";
218 | }
219 |
220 | function checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$token) {
221 | print "
Compare (old to new): $contract: $table, old_scope: $old_scope, old_block_num: $old_block_num
";
222 |
223 | $old_json = getScopedAccountTableDataCached($contract, $table, $old_scope, $old_block_num, $token);
224 | $old_data = json_decode($old_json,true);
225 |
226 | $new_json = getScopedAccountTableDataCached($contract, $table, $new_scope, $new_block_num, $token);
227 | $new_data = json_decode($new_json,true);
228 |
229 | compareData($old_data, $new_data);
230 |
231 | print "Compare (new to old): $contract: $table, new_scope: $new_scope, new_block_num: $new_block_num
";
232 |
233 | compareData($new_data, $old_data);
234 | }
235 |
236 | function clearEmptyCacheFiles() {
237 | $files_to_delete = array(__DIR__ . '/../cache/_table_data_account_.json');
238 | $dir = new DirectoryIterator(__DIR__ . '/../cache');
239 | foreach ($dir as $fileinfo) {
240 | $filename = $fileinfo->getFilename();
241 | if (!$fileinfo->isDot() && $fileinfo->getExtension() == 'json' && substr($filename, 0, 1) == '_') {
242 | $delete_file = false;
243 | $json = file_get_contents(__DIR__ . '/../cache/' . $filename);
244 | $data = json_decode($json, true);
245 | if (isset($data['data']['searchTransactionsForward']['results']) && count($data['data']['searchTransactionsForward']['results'] == 0)) {
246 | $delete_file = true;
247 | }
248 | if (isset($data['data']['searchTransactionsBackward']['results']) && count($data['data']['searchTransactionsBackward']['results'] == 0)) {
249 | $delete_file = true;
250 | }
251 | if ($data && array_key_exists('cursor', $data) && $data['cursor'] == '') {
252 | $delete_file = true;
253 | }
254 | if ($delete_file) {
255 | $files_to_delete[] = __DIR__ . '/../cache/' . $filename;
256 | }
257 | }
258 | }
259 | foreach ($files_to_delete as $file) {
260 | @unlink($file);
261 | }
262 | }
263 |
264 | function authenticateDFuse() {
265 | $filename = __DIR__ . '/../.api_credentials.json';
266 | $json = file_get_contents($filename) or die("
Authentication file .api_credentials.json not found.");
267 | $api_credentials = json_decode($json, true);
268 | if (time() > $api_credentials['expires_at']) {
269 | console_log("...Updating DFuse Authentication Token...");
270 | $url = 'https://auth.dfuse.io/v1/auth/issue';
271 | $params = array('api_key' => $api_credentials['api_key']);
272 | $header = array('Content-Type' => 'application/json');
273 | $json = request("POST", $url, $header, $params);
274 | if ($json) {
275 | $new_token = json_decode($json, true);
276 | if (array_key_exists('token', $api_credentials)) {
277 | $api_credentials['token'] = $new_token['token'];
278 | $api_credentials['expires_at'] = $new_token['expires_at'];
279 | $data = json_encode($api_credentials);
280 | file_put_contents($filename,$data);
281 | }
282 | }
283 | }
284 | return $api_credentials;
285 | }
--------------------------------------------------------------------------------
/dfuse-tools/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Table Scope Checking Tool
6 |
7 |
31 |
32 |
33 |
34 |
35 | 3600) {
48 | $update_cache = true;
49 | print "
Cache updated.
";
50 | } else {
51 | print "
Error: You can only update the cache every hour.
";
52 | }
53 | }
54 | } else {
55 | $update_cache = true;
56 | }
57 | if ($update_cache) {
58 | clearEmptyCacheFiles();
59 | $last_cache_update = time();
60 | file_put_contents($cache_file_name,$last_cache_update);
61 | }
62 |
63 | $CachedDate = new DateTime();
64 | $CachedDate->setTimestamp($last_cache_update);
65 | print "Data last updated: " . $CachedDate->format('Y-m-d H:i:s T') . "
";
66 |
67 | print "To check data as a specific block number, include old_block_num and new_block_num GET attributes.
";
68 |
69 | $old_block_num = 0;
70 | if (isset($_GET['old_block_num'])) {
71 | $old_block_num = $_GET['old_block_num'];
72 | }
73 | $new_block_num = 0;
74 | if (isset($_GET['new_block_num'])) {
75 | $new_block_num = $_GET['new_block_num'];
76 | }
77 |
78 | $network = "jungle";
79 | print "Jungle Test
";
80 |
81 | $contract = "kasdactokens";
82 | $old_scope = $contract;
83 | $new_scope = "eos.dac";
84 | $table = "members";
85 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
86 | $table = "memberterms";
87 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
88 |
89 | $contract = "dacelections";
90 | $old_scope = $contract;
91 | $table = "candidates";
92 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
93 | $table = "custodians";
94 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
95 | $table = "state";
96 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
97 | $table = "votes";
98 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
99 |
100 | $network = "mainnet";
101 | print "Mainnet Test
";
102 |
103 | $contract = "eosdactokens";
104 | $old_scope = $contract;
105 | $new_scope = "eos.dac";
106 | $table = "members";
107 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
108 | $table = "memberterms";
109 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
110 |
111 | $contract = "daccustodian";
112 | $old_scope = $contract;
113 | $table = "candidates";
114 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
115 | $table = "custodians";
116 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
117 | $table = "state";
118 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
119 | $table = "votes";
120 | checkData($contract,$table,$old_scope,$old_block_num,$new_scope,$new_block_num,$api_credentials['token']);
121 |
122 | ?>
123 |
124 |
--------------------------------------------------------------------------------
/drop tool/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/drop tool/README.md:
--------------------------------------------------------------------------------
1 | # Purpose
2 | Tool to script the airdrop process to EOS accounts.
3 |
4 | # Caution
5 | Use this script at your own risk. I have tested the script multiple times on the jungletestnetwork with the genesis snapshot as input data without issues.
6 | We at eosDAC also dropped our tokens on the mainnet with this script. I strongly advice to do numerous test runs on the testnetwork before even attempting doing
7 | a drop on the mainnet. You really should know how the script works.
8 |
9 | # Technical Details
10 | Tool allows you to practice with practice runs and encourages it on the jungle testnet before mainnet implementation. The Drop object is created from dropper.js and it allows you to run through a mysql that is predefined with the snapshot which the developer has previously generated.
11 |
12 |
13 | # Author
14 | The drop tool was created by Kasper from eosDAC.
15 |
16 | You can contact him on the eosDAC Discord channel: https://discord.io/eosdac as @Kas#4648 or via Telegram as @kasperfish
17 |
--------------------------------------------------------------------------------
/drop tool/dropper.js:
--------------------------------------------------------------------------------
1 | /*
2 | Hello, use this script at your own risk. I have tested the script multiple times on the jungletestnetwork with the genesis snapshot as input data without issues.
3 | We at eosDAC also dropped our tokens on the mainnet with this script. I strongly advice to do numerous test runs on the testnetwork before even attempting doing
4 | a drop on the mainnet. You really should know how the script works. Anyone is free to use this script because it's made to serve the whole EOS community in
5 | particular other DACs. If you need help to do a LEGIT airdrop you are free to contact me.
6 | Author: Kasper from eosDAC. (find me on the eosDAC telegram @kasperfish)
7 | */
8 | const eosjs = require('eosjs');
9 | const mysql = require('mysql2/promise');
10 | const pMap = require('p-map');
11 | const colors = require('colors/safe');
12 |
13 |
14 |
15 | class Drop {
16 | constructor() {
17 | //script mode
18 | var self = this;
19 | this.script_mode = 'drop'; //drop, verify (for drop verification).
20 |
21 | //sender details
22 | this.user = {account:'kasperkasper', wif:'xxxxxxxxxxxxxxxxxx'};
23 | this.user.consumables = { freenet: null, freecpu: null, freeram: null };
24 | this.auth = { authorization: [ this.user.account+'@active' ] };
25 | //token account and symbol and memo
26 | this.token = {account: 'kasperkasper' , symbol: 'BEAST'};
27 | this.memo ='yooloo';
28 |
29 | //general performance settings
30 | this.batch_size = 30; //number of accounts processed in each transaction for dropping (minus not existing ones)
31 | this.rpc_speed = 10; //number of simultanous rpc calls. used for account check and retrieving balance.
32 | this.pause_time = 0; //pause between each transaction in millis. zero should be fine. on localhost you might need a small pauze ie.250ms
33 | this.gracefulstop = true; //recommended, it will enable the current transaction to complete before stopping the script (only for drop mode);
34 |
35 | /************IMPORTANT****************
36 | database settings and schema names
37 | Add manually 2 columns to your table
38 | 1) name: trx , default value: '', varchar (80)
39 | 2) name: account_valid, default value: 1, tinyint (1)
40 | reset table: UPDATE eosdac_sql_master SET trx = '', account_valid =1
41 | */
42 | this.db_config = { host: "localhost", user: "kasperfish", password: "xxxxxxxxxxx", database: "eosdac" };
43 | this.table_name = 'eosdac_sql_master'; //the table that holds your data
44 | this.column_name_token_amount = 'eosdac_tokens'; //the column name that holds the token amount that needs to be dropped. Must have correct decimals corresponding to the contract.
45 | this.column_name_accounts = 'account_name'; //the column name of the accounts that need to be processed.
46 |
47 | //queries... Be careful and double check if you make changes!!!
48 | //this query get called recursively until none gets selected
49 | //you need to change this query to match the records/accounts you want to drop to.
50 | this.drop_query = `SELECT ${this.column_name_accounts}, ${this.column_name_token_amount}
51 | FROM ${this.table_name}
52 | WHERE ${this.column_name_token_amount} > 0 && iscontract = 0 && isedfallback IS NULL && account_valid != 0 && trx = '' LIMIT ${this.batch_size}`;
53 |
54 | //this query is used to verify the token drop. The verification happens through retrieving the on chain balance and comparing it with the value in your table.
55 | //Mind that this only works if the tokens are sent in a frozen/locked state. If you don't have a token contract with lock function or don't know how to set it
56 | //up... don't hesitate to contact one of our team members. We are happy to help you. This query doesn't need a change by default but it my be helpfull to verify
57 | //the on chain token balance for a subset of your eos accounts.
58 | this.verify_query = `SELECT ${this.column_name_accounts}, ${this.column_name_token_amount}
59 | FROM ${this.table_name}
60 | WHERE ${this.column_name_accounts} !='' && trx != '' `;
61 |
62 | this.eos = eosjs({
63 | chainId: '038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca', // 32 byte (64 char) hex string
64 | keyProvider: [this.user.wif], // WIF string or array of keys..
65 | httpEndpoint: 'http://jungle.dutcheos.io:58888', //http://145.239.252.91:8888 , http://dev.cryptolions.io:38888 , http://jungle.dutcheos.io:58888 , http://27.254.175.2:8888 , http://jungle.cryptolions.io:18888
66 | broadcast: true,
67 | sign: true,
68 | debug: false,
69 | expireInSeconds: 60,
70 | logger: {error: null}
71 | });
72 |
73 | console.log('Connected to EOS network!');
74 | this._modeSwitcher();
75 | }
76 |
77 | _initGracefullStop(bool){
78 | var self = this;
79 | if(bool){
80 | process.on('SIGINT', function () {
81 | console.log('exit event received');
82 | self.gracefulstopflag = 1;
83 | });
84 | }
85 |
86 | }
87 |
88 | _initMysql(){
89 | return mysql.createConnection(this.db_config)
90 | .then(mysql => {console.log('Mysql Connected!'); return mysql})
91 | .catch(e => console.log('Mysql connection error.'))
92 | }
93 |
94 | _modeSwitcher(){
95 | switch(this.script_mode) {
96 | case 'drop':
97 | console.log('Starting in drop mode.');
98 | this._initGracefullStop(this.gracefulstop);
99 | this.drop();
100 | break;
101 | case 'verify':
102 | console.log('Starting in verify mode.');
103 | this.verify();
104 | break;
105 | default:
106 | console.log(colors.red(`script mode ${this.script_mode} does not exists!`));
107 | }
108 |
109 | }
110 |
111 | async drop(){
112 | var self = this;
113 | await this._sleep(this.pause_time);
114 | //only create a mysql connection when not initiated yet
115 | if(this.pool == undefined){
116 | this.pool = await this._initMysql();
117 | }
118 |
119 | // select batch from database
120 | // let query = `SELECT ${this.column_name_accounts}, ${this.column_name_token_amount} FROM ${this.table_name} WHERE ${this.column_name_token_amount} > 0 && iscontract = 0 && isfallback IS NULL && account_valid != 0 && trx = '' LIMIT ${this.batch_size}`;
121 | const [rows, fields] = await this.pool.execute(this.drop_query);
122 |
123 | if(!rows.length || this.gracefulstopflag){
124 | this.done();
125 | return false;
126 | }
127 | else{
128 | console.log(colors.magenta.bold(`\nNext ${this.batch_size} entries`))
129 | }
130 |
131 | //monitor consumables TODO do something with it besides displaying
132 | let new_consumables = await this.getSenderStats();
133 | let cost = {};
134 | cost['ramcost'] = this.user.consumables.freeram - new_consumables.freeram;
135 | cost['cpucost'] = this.user.consumables.freecpu - new_consumables.freecpu;//volatile returns, can't rely on this
136 | cost['netcost'] = this.user.consumables.freenet - new_consumables.freenet;
137 | let morecpu = Math.floor(new_consumables.freecpu/cost.cpucost);
138 | let morenet = Math.floor(new_consumables.freenet/cost.netcost);
139 | let moreram = Math.floor(new_consumables.freeram/cost.ramcost);
140 | this.user.consumables = new_consumables;
141 |
142 | console.log(JSON.stringify(this.user.consumables) );
143 | console.log(colors.yellow('Previous transaction: '+JSON.stringify(cost)) );
144 | console.log(colors.yellow(`Number of next rounds possible based on CPU: ${morecpu} NET:${morenet} RAM:${moreram}`) )
145 |
146 | //verify the accountnames undefined when not valid
147 | const mapper = row => this.checkAccount(row).then(res => res).catch(e => {console.log('MAPPER: '+e) });
148 |
149 | let verified = await pMap(rows, mapper, {concurrency: this.rpc_speed}).then(res => res);
150 |
151 | //initialize tokencontract only once
152 | if(this.tokencontract == undefined){
153 | this.tokencontract = await this.eos.contract(this.token.account);
154 | }
155 |
156 | //pack the transaction and push to chain
157 | try{
158 | let tx = await this.tokencontract.transaction(tr => {
159 | // tr.nonce(1, {authorization: self.user.account})
160 | verified.forEach(function(x){
161 | //can be undefined when accountname was invalid
162 | if(x != undefined){
163 | // console.log(JSON.stringify({from: self.user.account, to: x[0], quantity: x[1]+' '+self.token.symbol, memo: self.memo}) )
164 | tr.transfer({from: self.user.account, to: x[0], quantity: x[1]+' '+self.token.symbol, memo: self.memo});
165 | }
166 | })
167 | });
168 |
169 | //update database only when a txid is received
170 | if(tx != undefined && tx.hasOwnProperty('transaction_id')){
171 | console.log('Transaction Id: '+tx.transaction_id);
172 | let names = verified.map(function(el){
173 | if(el != undefined){
174 | return el[0];// accountname
175 | }
176 | })
177 | let db = await this.pool.execute(`UPDATE ${this.table_name} SET trx = '${tx.transaction_id}' WHERE ${self.column_name_accounts} IN ${JSON.stringify(names).replace('[','(').replace(']',')')}`)
178 | .then(x => {self.drop()})
179 | .catch(e => {console.log(e)});
180 |
181 | }
182 | else{
183 | console.log(colors.red('No txid received, trying again...'));
184 | self.drop();
185 | }
186 |
187 | }catch(e){
188 | this._errorHandler(e);
189 | }
190 | }
191 |
192 | checkAccount(row){
193 | var self = this;
194 | return this.eos.getAccount(row[self.column_name_accounts] ).then( x => {
195 |
196 | if(x.account_name == row[self.column_name_accounts] ){
197 |
198 | console.log(colors.green(x.account_name+' '+row[self.column_name_token_amount]+' '+self.token.symbol));
199 | return [x.account_name, row[self.column_name_token_amount] ];
200 | }
201 |
202 | }).catch(e =>{
203 | self.pool.execute(`UPDATE ${self.table_name} SET account_valid = 0 WHERE ${self.column_name_accounts} = "${row[self.column_name_accounts]}"`).then(()=>{
204 | console.log(colors.red(row[self.column_name_accounts] +' invalid accountname'));
205 | return undefined;
206 | });
207 | })
208 | }
209 |
210 | getSenderStats(){
211 | return this.eos.getAccount(this.user.account).then(x =>{
212 | let freenet = x.net_limit.available; //net_limit: { used: 28281, available: 17523327, max: 17551608 },
213 | let freecpu = x.cpu_limit.available; // cpu_limit: { used: 128480, available: 3222543, max: 3351023 },
214 | let freeram = x.ram_quota - x.ram_usage;
215 | let obj = {freenet: freenet, freecpu: freecpu, freeram: freeram}
216 | return obj;
217 | }).catch(e =>{console.log('error getting sender account stats') })
218 | }
219 |
220 | done(){
221 | this.pool.end();
222 | }
223 |
224 | getbalance(row){
225 | var self =this;
226 | // console.log({code: this.token.account, symbol: this.token.symbol, account: row.account });
227 | return this.eos.getCurrencyBalance({code: self.token.account, symbol: self.token.symbol, account: row[self.column_name_accounts] }).then(function(bal){
228 | if(bal[0]==undefined){
229 | console.log(colors.red(`${row[self.column_name_accounts]} has no ${self.token.symbol} in its account.`));
230 | self.pool.execute(`UPDATE ${self.table_name} set trx='' WHERE ${self.column_name_accounts} = '${row[self.column_name_accounts]}'`);
231 | self.verification_results.not_received++;
232 | return false;
233 |
234 | }
235 |
236 | let b = bal[0].slice(0, -(self.token.symbol.length + 1) );
237 | b = parseFloat(b);
238 | row[self.column_name_token_amount] = parseFloat(row[self.column_name_token_amount]);
239 |
240 | if(b == row[self.column_name_token_amount] ) {
241 | console.log(colors.green(`Match -> db: ${row[self.column_name_token_amount]} chain: ${b}`));
242 | self.verification_results.correct++;
243 | return true;
244 | }
245 | else{
246 | console.log(colors.red(`Missmatch -> db: ${row[self.column_name_token_amount]} chain: ${b}`));
247 | self.verification_results.mismatch++;
248 | return false;
249 | }
250 |
251 | }).catch(e => {
252 | console.log(colors.yellow(e) );
253 | self.verification_results.con_error++;
254 | } );
255 | }
256 |
257 | async verify(){
258 | this.verification_results={correct: 0, not_received: 0, mismatch: 0, con_error: 0};
259 | if(this.pool == undefined){
260 | this.pool = await this._initMysql();
261 | }
262 | console.log(colors.blue.underline(`Start verifying ${this.token.symbol} balances`));
263 | const [rows, fields] = await this.pool.execute(this.verify_query);
264 | console.log(`found ${rows.length} accounts with txid in database\n`);
265 | const mapper = row => this.getbalance(row).then(res => {return res }).catch(e => {console.log('MAPPER: '+e) });
266 | let result = await pMap(rows, mapper, {concurrency: this.rpc_speed }).then(result => { return result });
267 |
268 | console.log(colors.bold.underline(`\nChecked ${rows.length} dropped ${this.token.symbol} accounts`));
269 | console.log(colors.green.bold(`\ncorrect: ${this.verification_results.correct}`));
270 | console.log(colors.yellow.bold(`not_received: ${this.verification_results.not_received} `)+ '...run the script in drop mode to fix this.');
271 | console.log(colors.red.bold(`balance mismatch: ${this.verification_results.mismatch} `)+ '...this needs human investigation!');
272 | if(this.verification_results.con_error){
273 | console.log(`network error: ${this.verification_results.con_error} ...decrease rpc speed and try again.`);
274 | //TODO handle these errors for easy resume
275 | }
276 | this.done();
277 | }
278 |
279 | _sleep() {
280 | return new Promise(resolve => setTimeout(resolve, this.pause_time));
281 | }
282 |
283 | _errorHandler(e){
284 | var self =this;
285 | console.log(colors.red.bold(e));
286 | e = JSON.parse(e);
287 | let errorname = e.error.name;
288 |
289 | switch(errorname) {
290 | //{"code":500,"message":"Internal Service Error","error":{"code":3080006,"name":"deadline_exception","what":"transaction took too long","details":[]}}
291 | case 'deadline_exception':
292 | console.log(colors.magenta('restart in 10 seconds') );
293 | console.log('If this error keeps popping up you need to stop the script and adjust the batch and/or speed settings.');
294 | setTimeout(function(){self.drop()},10000);
295 | break;
296 | //{"code":500,"message":"Internal Service Error","error":{"code":3081001,"name":"leeway_deadline_exception","what":"transaction reached the deadline set due to leeway on account CPU limits","details":[]}}
297 | case 'leeway_deadline_exception':
298 | console.log(e.error.what);
299 | this.done();
300 | break;
301 | default:
302 | console.log('The script doesn\'t know this error. It may be not that bad. Contact Kasper from eosdac if you keep having problems.');
303 | this.done();
304 | }
305 | }
306 |
307 | }//end class
308 |
309 | test = new Drop();
310 |
--------------------------------------------------------------------------------
/drop tool/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eostest",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "binaryen": "^37.0.0",
13 | "colors": "^1.3.0",
14 | "eosjs": "^14.2.0",
15 | "eosjs-ecc": "^4.0.1",
16 | "mysql": "^2.15.0",
17 | "mysql2": "^1.5.3",
18 | "p-map": "^1.2.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/eosdac-testnet/README.md:
--------------------------------------------------------------------------------
1 | # eosDAC testnet purpose
2 |
3 | These scripts will install and configure eosDAC contracts on a freshly started chain.
4 |
5 | ## Configuration
6 |
7 | Copy the configuration files conf.example.sh, conf_private.example.sh and conf_dac.example.sh to conf.sh, conf_private.sh and conf_dac.sh
8 |
9 | You will need to modify all of the files to your needs, make sure that the public key in conf_private.sh matches your genesis.json file
10 |
11 | ## boot.sh
12 |
13 | This script will boot the base eosio chain and install the system contracts.
14 |
15 | ## populate.sh
16 |
17 | This will populate all of the eosDAC contracts as well as developer, test custodian and test voter accounts.
18 |
19 | ## build.sh
20 |
21 | Will compile and install the eosDAC contrats, run this if you modify the contracts after booting for the first time.
22 |
23 | ## permissions.sh
24 |
25 | All the DAC accounts will be resigned and permissions set up to allow the dac to operate.
26 |
27 | # Author
28 | eosDAC team members. Contact the team for questions on our Discord channel: https://discord.io/eosdac
--------------------------------------------------------------------------------
/eosdac-testnet/boot.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf.sh
5 | source ./functions.sh
6 |
7 |
8 |
9 | echo -e "\n\n----------------- BOOT SEQUENCE -------------------\n\n";
10 |
11 |
12 |
13 | run_cmd "set contract eosio "$CONTRACTS/eosio.bios" -p eosio";
14 |
15 | run_cmd "create account eosio eosio.msig $EOSIO_PUB"
16 | sleep 1;
17 | cleos --wallet-url $WALLET_URL -u $API_URL get account eosio.msig;
18 |
19 | run_cmd "create account eosio eosio.token $EOSIO_PUB"
20 | sleep 1;
21 | cleos --wallet-url $WALLET_URL -u $API_URL get account eosio.token;
22 |
23 | run_cmd "create account eosio eosio.ram $EOSIO_PUB"
24 | sleep 1;
25 | cleos -u $API_URL get account eosio.ram;
26 |
27 | run_cmd "create account eosio eosio.ramfee $EOSIO_PUB"
28 | sleep 1;
29 | cleos -u $API_URL get account eosio.ramfee;
30 |
31 | run_cmd "create account eosio eosio.names $EOSIO_PUB"
32 | sleep 1;
33 | cleos -u $API_URL get account eosio.names;
34 |
35 | run_cmd "create account eosio eosio.stake $EOSIO_PUB"
36 | sleep 1;
37 | cleos -u $API_URL get account eosio.stake;
38 |
39 | run_cmd "create account eosio eosio.saving $EOSIO_PUB"
40 | sleep 1;
41 | cleos -u $API_URL get account eosio.saving;
42 |
43 | run_cmd "create account eosio eosio.bpay $EOSIO_PUB"
44 | sleep 1;
45 | cleos -u $API_URL get account eosio.bpay;
46 |
47 | run_cmd "create account eosio eosio.vpay $EOSIO_PUB"
48 | sleep 1;
49 | cleos -u $API_URL get account eosio.vpay;
50 |
51 | run_cmd "push action eosio setpriv "'["eosio.msig",1]'" -p eosio"
52 | sleep 1;
53 | cleos -u $API_URL get account -j eosio.msig | jq
54 |
55 | run_cmd "set contract eosio.msig "$CONTRACTS/eosio.msig" -p eosio.msig"
56 | run_cmd "get code eosio.msig"
57 |
58 | run_cmd "set contract eosio.token "$CONTRACTS/eosio.token" -p eosio.token"
59 | run_cmd "get code eosio.token"
60 |
61 | cleos --wallet-url $WALLET_URL -u $API_URL push action eosio.token create '["eosio","10000000000.0000 EOS"]' -p eosio.token
62 |
63 | cleos --wallet-url $WALLET_URL -u $API_URL get currency stats eosio.token EOS
64 |
65 | cleos --wallet-url $WALLET_URL -u $API_URL push action eosio.token issue '["eosio", "1000000000.0000 EOS", "initial issuance"]' -p eosio
66 |
67 | cleos --wallet-url $WALLET_URL -u $API_URL get currency stats eosio.token EOS
68 |
69 |
70 | sleep 2
71 |
72 | # Install system contract
73 | run_cmd "set contract eosio "$CONTRACTS/eosio.system" -p eosio"
74 |
75 | run_cmd "get code eosio"
76 |
--------------------------------------------------------------------------------
/eosdac-testnet/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 | echo -e "\n\n----------------- BUILDING CONTRACTS -------------------\n\n";
9 |
10 | PWD=`pwd`
11 |
12 | cd $DACCONTRACTS/daccustodian/
13 | git pull
14 | $EOSIOCPP -DTOKEN_CONTRACT='"eosdactokens"' -DTRANSFER_DELAY=10 -o daccustodian.wasm daccustodian.cpp
15 |
16 | cd $DACCONTRACTS/eosdactoken/
17 | git pull
18 | cd eosdactoken/
19 | $EOSIOCPP -o eosdactoken.wasm eosdactoken.cpp
20 |
21 | cd $DACCONTRACTS/dacservice/
22 | git pull
23 | $EOSIOCPP -DTRANSFER_DELAY=60 -o dacservice.wasm dacservice.cpp
24 |
25 | cd $PWD
26 |
27 | run_cmd "set contract "$dactokens" "$DACCONTRACTS/eosdactoken/eosdactoken" -p $dactokens"
28 |
29 | run_cmd "set contract "$daccustodian" "$DACCONTRACTS/daccustodian" -p $daccustodian"
30 |
31 | run_cmd "set contract "$dacservice" "$DACCONTRACTS/dacservice" -p $dacservice"
32 |
--------------------------------------------------------------------------------
/eosdac-testnet/change_config.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | source ./conf_private.sh
5 | source ./conf_dac.sh
6 | source ./conf.sh
7 | source ./functions.sh
8 |
9 |
10 |
11 | echo -e "\n\n----------------- UPDATING CONFIG -------------------\n\n";
12 |
13 | ./msig/gen_requested_permissions.py
14 |
15 | run
16 | run_cmd "push action -s -d -j daccustodian updateconfig dac_config2.json -p dacauthority@high > updateconfig.trx"
17 | run_cmd "multisig cancel eosdaccustab updconfig eosdaccustab"
18 | run_cmd "multisig propose_trx updconfig ./requested_perms.json updateconfig.trx eosdaccustab"
19 |
20 | for x in {a..j}
21 | do
22 | CUST="eosdaccusta$x"
23 | run_cmd "multisig approve eosdaccustab updconfig '{\"actor\":\"$CUST\", \"permission\":\"active\"}' -p $CUST"
24 | done
25 | run_cmd "multisig exec eosdaccustab updconfig eosdaccustab"
26 |
--------------------------------------------------------------------------------
/eosdac-testnet/conf.example.sh:
--------------------------------------------------------------------------------
1 | API_URL="http://127.0.0.1:8888"
2 | WALLET_URL="http://127.0.0.1:8888"
3 | CONTRACTS="/path/to/eos/build/contracts"
4 | DACCONTRACTS="/path/to/eosdac/contracts"
5 | EOSIOCPP="eosio-cpp"
6 | TOKEN="EOSDAC"
7 |
--------------------------------------------------------------------------------
/eosdac-testnet/conf_dac.example.sh:
--------------------------------------------------------------------------------
1 | # eosDAC specific accounts and contracts
2 | # The account holding the custodian (voting) contract
3 | daccustodian="daccustodian"
4 | # An empty account used to represent various permission levels
5 | # All other DAC accounts will eventually point back to this
6 | dacauthority="dacauthority"
7 | # The token contract account
8 | dactokens="eosdactokens"
9 | # The money owning account. It is assumed that all tokens owned will be kept here
10 | dacowner="eosdacthedac"
11 | # An extra account used by eosDAC
12 | dacextra="eosdacserver"
13 | # Account which creates these accounts
14 | dacgenesis="eosio"
15 | # Service provider accounts
16 | dacservice="dacocoiogmbh"
17 | # Multisig relay
18 | dacmultisigs="dacmultisigs"
19 |
--------------------------------------------------------------------------------
/eosdac-testnet/conf_private.example.sh:
--------------------------------------------------------------------------------
1 | # Enter public and private key for eosio, this should match the public key in
2 | # the genesis.json file. This key will also be used to create all system and
3 | # DAC accounts
4 | EOSIO_PUB="EOS...";
5 | EOSIO_PVT="5...";
6 |
--------------------------------------------------------------------------------
/eosdac-testnet/dac_config.json:
--------------------------------------------------------------------------------
1 | ["35000.0000 EOSDAC", 5, 12, 60, "dacauthority", "eosdacthedac", "dacocoiogmbh", 1, 15, 3, 10, 9, 7, 7776000, "50.0000 EOS"]
2 |
--------------------------------------------------------------------------------
/eosdac-testnet/dac_config2.json:
--------------------------------------------------------------------------------
1 | ["5000.0000 EOSDAC", 5, 12, 604800, "dacauthority", "eosdacthedac", "dacocoiogmbh", 1, 15, 3, 10, 9, 7, 7776000, "50.0000 EOS"]
2 |
--------------------------------------------------------------------------------
/eosdac-testnet/fire.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 |
9 |
10 | echo -e "\n\n----------------- FIRING CUSTODIAN -------------------\n\n";
11 |
12 |
13 | ./msig/gen_requested_permissions.py
14 |
15 | cat requested_perms.json
16 |
17 | run_cmd "push action -s -d -j daccustodian firecust '[\"eosdaccustaa\"]' -p dacauthority@med > fire.trx"
18 | run_cmd "multisig propose_trx firecust ./requested_perms.json fire.trx eosdaccustab"
19 |
20 | for x in {a..i}
21 | do
22 | CUST="eosdaccusta$x"
23 | run_cmd "multisig approve eosdaccustab firecust '{\"actor\":\"$CUST\", \"permission\":\"active\"}' -p $CUST"
24 | done
25 | run_cmd "multisig exec eosdaccustab firecust eosdaccustab"
26 |
--------------------------------------------------------------------------------
/eosdac-testnet/functions.sh:
--------------------------------------------------------------------------------
1 |
2 | green=`tput setaf 2`
3 | reset=`tput sgr0`
4 |
5 | run_cmd() {
6 | cmd="$1";
7 | echo -e "\n\n >> ${green} Next command: $1 \n\n ${reset}";
8 | #wait;
9 | #read -p "Press enter to continue ${reset}";
10 | eval "cleos --wallet-url $WALLET_URL -u $API_URL $1";
11 | }
12 |
13 | create_act() {
14 | act="$1"
15 | key="$2"
16 | eval "cleos --wallet-url $WALLET_URL -u $API_URL system newaccount --stake-cpu \"10.0000 EOS\" --stake-net \"10.0000 EOS\" --transfer --buy-ram-kbytes 1024 eosio $act $key"
17 | }
18 |
--------------------------------------------------------------------------------
/eosdac-testnet/msig/gen_requested_permissions.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import subprocess
4 | import json
5 |
6 | permission_act = 'dacauthority'
7 | api_url = 'http://127.0.0.1:8666'
8 |
9 | res = subprocess.check_output(['cleos', '-u', api_url, 'get', 'account', '-j', permission_act])
10 |
11 | data = json.loads(res)
12 |
13 |
14 | permissions = data['permissions']
15 |
16 | requested_permissions = []
17 |
18 | for perm in permissions:
19 |
20 | if perm['perm_name'] == "high":
21 |
22 | acts = perm['required_auth']['accounts']
23 | for act in acts:
24 | requested_permissions.append(act['permission'])
25 | break
26 |
27 | requested_permissions_json = json.dumps(requested_permissions)
28 |
29 | requested_permissions_fp = open("requested_perms.json", "w")
30 | requested_permissions_fp.write(requested_permissions_json)
31 | requested_permissions_fp.close()
32 |
33 | print("Wrote requested_perms.json")
34 |
35 |
--------------------------------------------------------------------------------
/eosdac-testnet/newperiod.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 |
9 |
10 | echo -e "\n\n----------------- NEW PERIOD -------------------\n\n";
11 |
12 |
13 |
14 | run_cmd "push action daccustodian newperiod '[\"New Period\"]' -p eosdaccustab"
15 |
--------------------------------------------------------------------------------
/eosdac-testnet/permissions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 |
9 |
10 | echo -e "\n\n----------------- PERMISSIONS -------------------\n\n";
11 |
12 |
13 |
14 |
15 | # These have to be set now because they are required in daccustodian_transfer.json
16 | # These permissions are set in new period to the custodians with each configured threshold
17 | run_cmd "set account permission $dacauthority high $EOSIO_PUB active -p $dacauthority@owner"
18 | run_cmd "set account permission $dacauthority med $EOSIO_PUB high -p $dacauthority@owner"
19 | run_cmd "set account permission $dacauthority low $EOSIO_PUB med -p $dacauthority@owner"
20 | run_cmd "set account permission $dacauthority one $EOSIO_PUB low -p $dacauthority@owner"
21 |
22 |
23 | # resign extra account to dacauthority@active
24 | run_cmd "set account permission $dacextra active ./perms/resign.json owner -p $dacextra@owner"
25 | run_cmd "set account permission $dacextra owner ./perms/resign.json '' -p $dacextra@owner"
26 |
27 | # resign dactokens account to dacauthority@active
28 | run_cmd "set account permission $dactokens active ./perms/resign.json owner -p $dactokens@owner"
29 | run_cmd "set account permission $dactokens owner ./perms/resign.json '' -p $dactokens@owner"
30 |
31 | # resign dacmultisigs account to dacauthority@active
32 | run_cmd "set account permission $dacmultisigs active ./perms/resign.json owner -p $dacmultisigs@owner"
33 | run_cmd "set account permission $dacmultisigs owner ./perms/resign.json '' -p $dacmultisigs@owner"
34 |
35 | # resign dacowner account to dacauthority@active, must allow timelocked transfers
36 | # from daccustodian@eosio.code
37 | # daccustodian_transfer.json allows the contract to make transfers with a time delay, or
38 | # dacauthority@med without a time delay. dacowner must have permission in xfer to transfer tokens
39 | run_cmd "set account permission $dacowner xfer ./perms/daccustodian_transfer.json active -p $dacowner@owner"
40 | run_cmd "set action permission $dacowner eosio.token transfer xfer -p $dacowner@owner"
41 | # Resign eosdacthedac
42 | run_cmd "set account permission $dacowner active ./perms/resign.json owner -p $dacowner@owner"
43 | run_cmd "set account permission $dacowner owner ./perms/resign.json '' -p $dacowner@owner"
44 |
45 | # Create xfer permission and give it permission to transfer EOSDAC tokens
46 | run_cmd "set account permission $daccustodian xfer ./perms/daccustodian_transfer.json active -p $daccustodian@owner"
47 | run_cmd "set action permission $daccustodian $dactokens transfer xfer -p $daccustodian@owner"
48 | # Resign daccustodian
49 | run_cmd "set account permission $daccustodian active ./perms/resign.json owner -p $daccustodian@owner"
50 | run_cmd "set account permission $daccustodian owner ./perms/resign.json '' -p $daccustodian@owner"
51 |
52 |
53 |
54 | # Allow high to call any action on daccustodian
55 | run_cmd "set action permission $dacauthority $daccustodian '' high -p $dacauthority@owner"
56 | #run_cmd "set action permission $dacauthority $daccustodian '' high -p $dacauthority@owner"
57 | # These 2 actions require a medium permission
58 | run_cmd "set action permission $dacauthority $daccustodian firecust med -p $dacauthority@owner"
59 | run_cmd "set action permission $dacauthority $daccustodian firecand med -p $dacauthority@owner"
60 | # Allow one to call the multisig actions
61 | run_cmd "set action permission $dacauthority $dacmultisigs '' one -p $dacauthority@owner"
62 | #run_cmd "set action permission $dacauthority eosio updateauth owner -p $dacauthority@owner"
63 | # set dacauthority@owner to point to daccustodian@eosio.code
64 | run_cmd "set account permission $dacauthority active ./perms/dacauthority_active.json owner -p $dacauthority@owner"
65 | run_cmd "set account permission $dacauthority owner ./perms/daccustodian_updateauth.json '' -p $dacauthority@owner"
66 |
67 |
68 |
69 |
70 | dacaccounts="$dacextra $dacowner $dactokens $dacauthority $daccustodian $dacmultisigs"
71 |
72 | for act in $dacaccounts
73 | do
74 | echo "------------- $act ---------------"
75 | cleos --wallet-url $WALLET_URL -u $API_URL get account -j $act | jq '.permissions'
76 | done
77 |
78 | #run_cmd "set account permission $dacauthority owner ./dac_auth_perms.json '' -p dacauthority@owner"
79 |
--------------------------------------------------------------------------------
/eosdac-testnet/perms/dacauthority_active.json:
--------------------------------------------------------------------------------
1 | {
2 | "threshold": 1,
3 | "keys": [{"key":"EOS8PpzcMENPHNmmTfcE6Viu9pcqPHTr8iXXm6XX3fVLMggq4MZe2", "weight":1}],
4 | "accounts": [
5 | {"permission":{"actor":"dacauthority", "permission":"high"}, "weight":1}
6 | ],
7 | "waits": []
8 | }
9 |
--------------------------------------------------------------------------------
/eosdac-testnet/perms/daccustodian_transfer.json:
--------------------------------------------------------------------------------
1 | {
2 | "threshold": 2,
3 | "keys": [],
4 | "accounts": [
5 | {"permission":{"actor":"dacauthority", "permission":"med"}, "weight":2},
6 | {"permission":{"actor":"daccustodian", "permission":"eosio.code"}, "weight":1}
7 | ],
8 | "waits": [{"wait_sec":3600, "weight":1}]
9 | }
10 |
--------------------------------------------------------------------------------
/eosdac-testnet/perms/daccustodian_updateauth.json:
--------------------------------------------------------------------------------
1 | {
2 | "threshold": 1,
3 | "keys": [],
4 | "accounts": [
5 | {"permission":{"actor":"daccustodian", "permission":"eosio.code"}, "weight":1}
6 | ],
7 | "waits": []
8 | }
9 |
--------------------------------------------------------------------------------
/eosdac-testnet/perms/resign.json:
--------------------------------------------------------------------------------
1 | {
2 | "threshold" : 1,
3 | "keys" : [],
4 | "accounts": [{"permission":{"actor":"dacauthority", "permission":"active"}, "weight":1}],
5 | "waits": []
6 | }
7 |
--------------------------------------------------------------------------------
/eosdac-testnet/populate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | source ./conf_private.sh
5 | source ./conf_dac.sh
6 | source ./conf.sh
7 | source ./functions.sh
8 |
9 |
10 |
11 | echo -e "\n\n----------------- POPULATING DAC -------------------\n\n";
12 |
13 |
14 |
15 |
16 | dacaccounts="$dacextra $dacowner $dactokens $dacauthority $daccustodian $dacservice $dacmultisigs"
17 |
18 | for act in $dacaccounts
19 | do
20 | create_act $act $EOSIO_PUB
21 | #run_cmd "system newaccount --stake-cpu \"10.0000 EOS\" --stake-net \"10.0000 EOS\" --transfer --buy-ram-kbytes 1024 eosio $act $EOSIO_PUB"
22 | #sleep 1;
23 | #cleos --wallet-url $WALLET_URL -u $API_URL get account $act;
24 | done
25 |
26 | run_cmd "transfer eosio $dacowner \"100000.0000 EOS\""
27 |
28 | run_cmd "set contract "$dactokens" "$DACCONTRACTS/eosdactoken/eosdactoken" -p eosdactokens"
29 | run_cmd "get code $dactokens"
30 |
31 | run_cmd "push action $dactokens newmemterms terms.json -p $dactokens"
32 | echo "[$daccustodian]" > token_config.json
33 | run_cmd "push action $dactokens updateconfig token_config.json -p $dactokens"
34 | rm -f token_config.json
35 |
36 | cleos --wallet-url $WALLET_URL -u $API_URL push action $dactokens create '["eosdactokens", "10000000000.0000 EOSDAC", 0]' -p $dactokens
37 | cleos --wallet-url $WALLET_URL -u $API_URL push action $dactokens issue '["eosdactokens", "1000000000.0000 EOSDAC", "Issue"]' -p $dactokens
38 |
39 | run_cmd "set contract $daccustodian "$DACCONTRACTS/daccustodian" -p $daccustodian"
40 | run_cmd "get code $daccustodian"
41 |
42 | run_cmd "get table $daccustodian daccustodian config"
43 |
44 | run_cmd "push action $daccustodian updateconfig dac_config.json -p $daccustodian"
45 |
46 | run_cmd "get table $daccustodian $daccustodian config"
47 |
48 |
49 | run_cmd "set contract $dacservice "$DACCONTRACTS/dacservice" -p $dacservice"
50 | run_cmd "get code $dacservice"
51 |
52 | # Set dacmultisigs contract
53 | run_cmd "set contract $dacmultisigs "$DACCONTRACTS/eosdacmultis" -p $dacmultisigs"
54 | run_cmd "get code $dacmultisigs"
55 |
56 |
57 | # Developer accounts
58 | create_devs() {
59 | create_act evilmikehere EOS54NkNpEt9aotyBvEZVfj54NuFAebaDLnyg2GtJ6pyvBoxxg9Aw
60 | run_cmd "transfer eosio evilmikehere \"10000000.0000 EOS\""
61 | run_cmd "transfer -c eosdactokens eosdactokens evilmikehere \"100000000.0000 EOSDAC\""
62 |
63 | create_act kasperkasper EOS5JLKQDsJwqh6vVTbqVnHsHDk6He1Xo6nsQSy3536B1gx3FGzZJ
64 | run_cmd "transfer eosio kasperkasper \"10000000.0000 EOS\""
65 | run_cmd "transfer -c eosdactokens eosdactokens kasperkasper \"10000000.0000 EOSDAC\""
66 |
67 | create_act dallasdallas EOS5kt3N8qEwwRYYvWWZaJvsoz9iuVurLRhw36vckmSesHdm8A9su
68 | run_cmd "transfer eosio dallasdallas \"10000000.0000 EOS\""
69 | run_cmd "transfer -c eosdactokens eosdactokens dallasdallas \"10000000.0000 EOSDAC\""
70 |
71 | create_act lukedactest1 EOS8YE3xbMVSiDxrJCK3qRsxT8e7ThfvpxdmwaXgeMAn5VYJxE26G
72 | run_cmd "transfer eosio lukedactest1 \"5000000.0000 EOS\""
73 | run_cmd "transfer -c eosdactokens eosdactokens lukedactest1 \"5000000.0000 EOSDAC\""
74 |
75 | create_act lukedactest2 EOS5qhoS2McrhC6mkW2gN4eDPZZJhf3EQEvUf1gZoRxJTJXoNrFVk
76 | run_cmd "transfer eosio lukedactest2 \"5000000.0000 EOS\""
77 | run_cmd "transfer -c eosdactokens eosdactokens lukedactest2 \"5000000.0000 EOSDAC\""
78 |
79 | create_act tiktiktiktik EOS5yMoSRtLecubsQmTVSmdurCAnh6etwRsVDNoXx697Jr193GRKp
80 | run_cmd "transfer eosio tiktiktiktik \"10000000.0000 EOS\""
81 | run_cmd "transfer -c eosdactokens eosdactokens tiktiktiktik \"10000000.0000 EOSDAC\""
82 | }
83 | create_devs
84 |
85 |
86 | # Get the terms to hash it for registration
87 | CONSTITUTION=$(cleos -u $API_URL get table eosdactokens eosdactokens memberterms | jq '.rows[0].terms' | tr -d '"')
88 | wget -O constitution.md $CONSTITUTION
89 |
90 | ARCH=$( uname )
91 | if [ "$ARCH" == "Darwin" ]; then
92 | CON_MD5=$(md5 constitution.md | cut -d' ' -f4)
93 | else
94 | CON_MD5=$(md5sum constitution.md | cut -d' ' -f1)
95 | fi
96 |
97 | rm -f constitution.md
98 |
99 |
100 | # Build this array for random voting later
101 | CUST_ACCTS=()
102 |
103 |
104 | # Custodian accounts
105 | for x in {a..z}
106 | do
107 | CUST="eosdaccusta$x"
108 | CUST_ACTS+=($CUST)
109 | create_act $CUST $EOSIO_PUB
110 | run_cmd "transfer -c eosdactokens eosdactokens $CUST \"100000.0000 EOSDAC\""
111 | run_cmd "push action eosdactokens memberreg '[\"$CUST\", \"$CON_MD5\"]' -p $CUST"
112 | run_cmd "transfer -c eosdactokens $CUST daccustodian \"35000.0000 EOSDAC\" \"daccustodian\""
113 | run_cmd "push action daccustodian nominatecand '[\"$CUST\", \"10.0000 EOS\"]' -p $CUST"
114 | done
115 |
116 | # Voter accounts
117 | for x in {a..z}
118 | do
119 | for y in {a..z}
120 | do
121 | VOT="eosdacvote$x$y"
122 | create_act $VOT $EOSIO_PUB
123 | run_cmd "transfer -c eosdactokens eosdactokens $VOT \"300000.0000 EOSDAC\""
124 | run_cmd "push action eosdactokens memberreg '[\"$VOT\", \"$CON_MD5\"]' -p $VOT"
125 | # random votes
126 | numbers=$(jot -r 5 0 26)
127 | votes=()
128 | while read -r number; do
129 | vote=${CUST_ACTS[$number]}
130 | echo $vote
131 | votes+=($vote)
132 | done <<< "$numbers"
133 |
134 | votes_arr=($(tr ' ' '\n' <<< "${votes[@]}" | sort -u | tr '\n' ' '))
135 | json=$(jq -n --arg va "${votes_arr}" --arg v "${VOT}" '[$v, ($va | split(" ")) ]')
136 | echo $json > vote_data.json
137 | run_cmd "push action daccustodian votecust ./vote_data.json -p $VOT"
138 | done
139 | done
140 |
--------------------------------------------------------------------------------
/eosdac-testnet/resign.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 |
9 | echo -e "\n\n----------------- RESIGNING -------------------\n\n";
10 |
11 | RESIGNER=eosdaccustaa
12 |
13 | run_cmd "push action daccustodian withdrawcand '[\"$RESIGNER\"]' -p $RESIGNER"
14 | run_cmd "get currency balance $dactokens $RESIGNER EOSDAC"
15 | run_cmd "push action daccustodian unstake '[\"$RESIGNER\"]' -p $RESIGNER"
16 | run_cmd "get currency balance $dactokens $RESIGNER EOSDAC"
17 |
--------------------------------------------------------------------------------
/eosdac-testnet/terms.json:
--------------------------------------------------------------------------------
1 | ["https://raw.githubusercontent.com/eosdac/constitution/14d8d6d0262707f7c72183cff505d19e321f1cb3/constitution.md", "6d2cc6201302b3f485e2a939881ae451"]
2 |
--------------------------------------------------------------------------------
/eosdac-testnet/transfer_raw.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 | echo -e "\n\n----------------- TRANSFER TOKENS -------------------\n\n";
9 |
10 |
11 | ./msig/gen_requested_permissions.py
12 |
13 | run_cmd "transfer -s -d -j $dacowner eosio \"100.0000 EOS\" \"An msig transfer by med\" -p $dacowner@xfer > transfer.trx"
14 | run_cmd "multisig cancel eosdaccustab txprop eosdaccustab"
15 | run_cmd "multisig propose_trx txprop ./requested_perms.json transfer.trx eosdaccustab"
16 |
17 | for x in {a..i}
18 | do
19 | CUST="eosdaccusta$x"
20 | run_cmd "multisig approve eosdaccustab txprop '{\"actor\":\"$CUST\", \"permission\":\"active\"}' -p $CUST"
21 | done
22 | run_cmd "multisig exec eosdaccustab txprop eosdaccustab"
23 |
--------------------------------------------------------------------------------
/eosdac-testnet/update_contract.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source ./conf_private.sh
4 | source ./conf_dac.sh
5 | source ./conf.sh
6 | source ./functions.sh
7 |
8 |
9 |
10 | echo -e "\n\n----------------- UPDATE CONTRACT -------------------\n\n";
11 |
12 |
13 | ./msig/gen_requested_permissions.py
14 |
15 | run_cmd "set code -s -d -j $daccustodian $DACCONTRACTS/daccustodian/daccustodian_migrate.wasm -p $daccustodian@active > setcode.trx"
16 | run_cmd "multisig cancel eosdaccustab addmigrate eosdaccustab"
17 | run_cmd "multisig propose_trx addmigrate ./requested_perms.json setcode.trx eosdaccustab"
18 |
19 | for x in {a..j}
20 | do
21 | CUST="eosdaccusta$x"
22 | run_cmd "multisig approve eosdaccustab addmigrate '{\"actor\":\"$CUST\", \"permission\":\"active\"}' -p $CUST"
23 | done
24 | run_cmd "multisig exec eosdaccustab addmigrate eosdaccustab"
25 |
--------------------------------------------------------------------------------
/getvotes/README.md:
--------------------------------------------------------------------------------
1 | # Purpose
2 | Vote gathering tool to discover voting statistics for the top EOS accounts
3 |
4 | # Caution
5 | The top500.csv is a predetermined list which you can change.
6 |
7 | # Tech Details
8 | These are the details provided by the resulting csv:
9 | - account
10 | - proxy
11 | - staked
12 | - last_vote_weight
13 | - proxied_vote_weight
14 | - is_proxy
15 | - votes
16 |
17 | # Author
18 | eosDAC team members. Contact the team for questions on our Discord channel: https://discord.io/eosdac
--------------------------------------------------------------------------------
/getvotes/index.js:
--------------------------------------------------------------------------------
1 | const eosjs = require('eosjs-api');
2 | const colors = require('colors/safe');
3 | const pMap = require('p-map');
4 | const log = require('single-line-log').stdout;
5 | const fs = require('fs');
6 | const csv=require('csvtojson');
7 |
8 | // const schedule = require('node-schedule');
9 |
10 |
11 | class BPvotes{
12 |
13 | constructor(){
14 |
15 | this.inputFile= './top500.csv'; //change this path to point to your input file.
16 |
17 |
18 | this.output_folder ='./output/';
19 | console.log(colors.magenta('App started!') );
20 | this._initEos();
21 | this.work();
22 | }
23 |
24 | _initEos(){
25 | this.eos = eosjs({
26 | chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',
27 | keyProvider: null, // WIF string or array of keys..
28 | httpEndpoint: 'https://mainnet.eoscanada.com:443',
29 |
30 | });
31 | console.log('Connected to EOS network!');
32 | }
33 |
34 | async work(){
35 | let jsonArray=await csv({noheader:true,trim:true,}).fromFile(this.inputFile); // { field1: 'gezdenjxgene' },{ field1: 'gq2tknagenes' },
36 | console.log(colors.magenta(`found ${jsonArray.length} accounts\n`) );
37 | let mapper = ac => this.getVotes(ac.field1).then(res => {return res;}).catch(e => {console.log('MAPPER: '+e) });
38 | let voters = await pMap(jsonArray, mapper, {concurrency: 20 }).then(result => { return result });
39 | let proxies = voters.filter(vt =>vt.proxy !== '' && vt.proxy !== undefined ).map(p => p.proxy);
40 | proxies = [ ...new Set(proxies) ];
41 |
42 | console.log(colors.magenta(`\nfound ${proxies.length} used proxies\n`) );
43 | mapper = ac => this.getVotes(ac).then(res => {return res;}).catch(e => {console.log('MAPPER: '+e) });
44 | if(proxies.length){
45 | let proxyvotes = await pMap(proxies, mapper, {concurrency: 20 }).then(result => { return result });
46 | this.createcsv(proxyvotes, 'proxies.csv')
47 | }
48 |
49 | this.createcsv(voters, 'accounts.csv')
50 | // this.saveAsJson(result, 'output.json');
51 | }
52 |
53 |
54 | getVotes(account){
55 | return this.eos.getTableRows({"json":"true", "scope":"eosio", "code":"eosio", "table":"voters", "lower_bound":account, "limit":1}).then(res =>{
56 | let votes = {owner: account};
57 | if(res.rows[0].owner === account ){
58 | votes = res.rows[0];
59 |
60 | }
61 | log(colors.green(`${account} -> ${JSON.stringify(votes)}`));
62 |
63 | return votes;
64 |
65 | }).catch(e => {console.log(colors.red(`${account} -> ${e} \n` )); return [account] })
66 | }
67 | saveAsJson(tt, f){
68 | !fs.existsSync(this.output_folder) && fs.mkdirSync(this.output_folder);
69 | console.log('\nWriting to CSV-file: ' + this.output_folder + f);
70 | let file = fs.createWriteStream(this.output_folder+f);
71 | file.on('error', function(err) { console.log(colors.bold.red(err)) });
72 |
73 | file.write(JSON.stringify(tt) );
74 | file.end();
75 | }
76 |
77 | createcsv(tt, f){
78 | var self = this;
79 | !fs.existsSync(this.output_folder) && fs.mkdirSync(this.output_folder);
80 | console.log('\nWriting to CSV-file: ' + this.output_folder + f);
81 | let file = fs.createWriteStream(this.output_folder+f);
82 | file.on('error', function(err) { console.log(colors.bold.red(err)) });
83 |
84 | tt.forEach(function(v) {
85 | // account, proxy, staked, last_vote_weight, proxied_vote_weight, is_proxy, votes
86 | if((v.staked > 0) && (v.last_vote_weight > 0) && v.producers.length){
87 | v.vote_weight_now = self.calculateVotesNow(v.staked);
88 | let d = 100000000000000000;
89 | v.decay = (Math.abs((v.last_vote_weight*d) - (v.vote_weight_now*d)) /(((v.last_vote_weight*d)+(v.vote_weight_now*d))/2))*100;
90 | }
91 | else{
92 | v.vote_weight_now = 0;
93 | v.decay = 0;
94 | }
95 | v.proxy = v.proxy !=''? v.proxy : 0;
96 | let csvline = v.owner+', '+v.proxy+', '+v.staked+', '+v.last_vote_weight+', '+v.proxied_vote_weight+', '+v.is_proxy+', '+v.vote_weight_now+', '+v.decay+'%, '+JSON.stringify(v.producers)+'\n';
97 | file.write(csvline);
98 | });
99 | file.end();
100 | }
101 |
102 | calculateVotesNow(stakeamount){
103 | const epoch = 946684800000;
104 | const seconds_per_day = 86400;
105 | let now = new Date().getTime()/1000; //in seconds
106 | let weight = parseInt( (now - (epoch / 1000)) / (seconds_per_day * 7) )/52 ;
107 | return (stakeamount*Math.pow(2, weight)).toFixed(17);
108 | }
109 |
110 |
111 | }
112 |
113 | let test = new BPvotes();
--------------------------------------------------------------------------------
/getvotes/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "getvotes",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "ansi-regex": {
8 | "version": "2.1.1",
9 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
10 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
11 | },
12 | "bluebird": {
13 | "version": "3.5.2",
14 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz",
15 | "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg=="
16 | },
17 | "camel-case": {
18 | "version": "3.0.0",
19 | "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
20 | "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=",
21 | "requires": {
22 | "no-case": "2.3.2",
23 | "upper-case": "1.1.3"
24 | }
25 | },
26 | "code-point-at": {
27 | "version": "1.1.0",
28 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
29 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
30 | },
31 | "colors": {
32 | "version": "1.3.2",
33 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.2.tgz",
34 | "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ=="
35 | },
36 | "csvtojson": {
37 | "version": "2.0.8",
38 | "resolved": "https://registry.npmjs.org/csvtojson/-/csvtojson-2.0.8.tgz",
39 | "integrity": "sha512-DC6YFtsJiA7t/Yz+KjzT6GXuKtU/5gRbbl7HJqvDVVir+dxdw2/1EgwfgJdnsvUT7lOnON5DvGftKuYWX1nMOQ==",
40 | "requires": {
41 | "bluebird": "3.5.2",
42 | "lodash": "4.17.11",
43 | "strip-bom": "2.0.0"
44 | }
45 | },
46 | "encoding": {
47 | "version": "0.1.12",
48 | "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
49 | "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
50 | "requires": {
51 | "iconv-lite": "0.4.24"
52 | }
53 | },
54 | "eosjs-api": {
55 | "version": "7.0.4",
56 | "resolved": "https://registry.npmjs.org/eosjs-api/-/eosjs-api-7.0.4.tgz",
57 | "integrity": "sha512-oLbM39rcyWYkqu6nIEQ50I92yT2vvD7WZPZ3FujbydG2ssR5Re/uSvbkFfZTB02g3I4D+UDUA1jd65HlM7r3MQ==",
58 | "requires": {
59 | "camel-case": "3.0.0",
60 | "isomorphic-fetch": "2.2.1"
61 | }
62 | },
63 | "iconv-lite": {
64 | "version": "0.4.24",
65 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
66 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
67 | "requires": {
68 | "safer-buffer": "2.1.2"
69 | }
70 | },
71 | "is-fullwidth-code-point": {
72 | "version": "1.0.0",
73 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
74 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
75 | "requires": {
76 | "number-is-nan": "1.0.1"
77 | }
78 | },
79 | "is-stream": {
80 | "version": "1.1.0",
81 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
82 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
83 | },
84 | "is-utf8": {
85 | "version": "0.2.1",
86 | "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
87 | "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
88 | },
89 | "isomorphic-fetch": {
90 | "version": "2.2.1",
91 | "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",
92 | "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",
93 | "requires": {
94 | "node-fetch": "1.7.3",
95 | "whatwg-fetch": "3.0.0"
96 | }
97 | },
98 | "lodash": {
99 | "version": "4.17.11",
100 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
101 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
102 | },
103 | "lower-case": {
104 | "version": "1.1.4",
105 | "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
106 | "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw="
107 | },
108 | "no-case": {
109 | "version": "2.3.2",
110 | "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
111 | "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==",
112 | "requires": {
113 | "lower-case": "1.1.4"
114 | }
115 | },
116 | "node-fetch": {
117 | "version": "1.7.3",
118 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
119 | "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
120 | "requires": {
121 | "encoding": "0.1.12",
122 | "is-stream": "1.1.0"
123 | }
124 | },
125 | "number-is-nan": {
126 | "version": "1.0.1",
127 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
128 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
129 | },
130 | "p-map": {
131 | "version": "2.0.0",
132 | "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz",
133 | "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w=="
134 | },
135 | "safer-buffer": {
136 | "version": "2.1.2",
137 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
138 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
139 | },
140 | "single-line-log": {
141 | "version": "1.1.2",
142 | "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-1.1.2.tgz",
143 | "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=",
144 | "requires": {
145 | "string-width": "1.0.2"
146 | }
147 | },
148 | "string-width": {
149 | "version": "1.0.2",
150 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
151 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
152 | "requires": {
153 | "code-point-at": "1.1.0",
154 | "is-fullwidth-code-point": "1.0.0",
155 | "strip-ansi": "3.0.1"
156 | }
157 | },
158 | "strip-ansi": {
159 | "version": "3.0.1",
160 | "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
161 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
162 | "requires": {
163 | "ansi-regex": "2.1.1"
164 | }
165 | },
166 | "strip-bom": {
167 | "version": "2.0.0",
168 | "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
169 | "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
170 | "requires": {
171 | "is-utf8": "0.2.1"
172 | }
173 | },
174 | "upper-case": {
175 | "version": "1.1.3",
176 | "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz",
177 | "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg="
178 | },
179 | "whatwg-fetch": {
180 | "version": "3.0.0",
181 | "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz",
182 | "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q=="
183 | }
184 | }
185 | }
186 |
--------------------------------------------------------------------------------
/getvotes/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "getvotes",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "colors": "^1.3.2",
13 | "csvtojson": "^2.0.8",
14 | "eosjs-api": "^7.0.4",
15 | "p-map": "^2.0.0",
16 | "single-line-log": "^1.1.2"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/getvotes/top500.csv:
--------------------------------------------------------------------------------
1 | gqytqmbxgyge
2 | bithumbshiny
3 | gi3tiojtguge
4 | okexoffiline
5 | bitfinexcw55
6 | hezdeobug4ge
7 | hezdeobugage
8 | gm3tombuguge
9 | ebekjijzrdxk
10 | g4ydgmjug4ge
11 | binancecleos
12 | winterishere
13 | hezdeobuhege
14 | vuniyuoxoeub
15 | eosio.saving
16 | ha2tsmzqhege
17 | guzdkmrtgage
18 | okbtothemoon
19 | gy2dsnjugige
20 | bpvoter.one
21 | giytemzyhege
22 | se4xjymvrkcg
23 | vdxjamspwcsu
24 | ycheosforzb4
25 | dunamueoshot
26 | x5nvb1tucqk2
27 | gyzdgmbqgage
28 | wngsfcarhzkt
29 | aspovhegmfke
30 | bitfinexcw13
31 | vwgumvhjzkvn
32 | g4ydomrxhege
33 | chainceoneos
34 | ha4tqojrgige
35 | eosio.unregd
36 | gqztgmrwgene
37 | gqztgmjzgene
38 | eostothemoon
39 | bitfinexcw11
40 | vtlihyjbselb
41 | vcgqdyepghel
42 | vqudinrrqkus
43 | vxnfrgktdscf
44 | bitfinexcw24
45 | bitfinexcw15
46 | bitfinexcw32
47 | bitfinexcw21
48 | bitfinexcw25
49 | bitfinexcw31
50 | bitfinexcw23
51 | bitfinexcw33
52 | bitfinexcw22
53 | bitfinexcw12
54 | bitfinexcw14
55 | hazdcojrgyge
56 | krakenkraken
57 | ge3dknjugige
58 | eosio.ram
59 | gezdgojygene
60 | qpalzmwoskxg
61 | gy2tkojrg4ge
62 | guytcojzguge
63 | gu4dgojygege
64 | izcv2brw3sqe
65 | gezdgojsgene
66 | gm3dcnqgenes
67 | guztoojqgege
68 | ha2tanbqg4ge
69 | gmytmnjxhege
70 | gezdenbtgene
71 | vdcseqykmyrd
72 | vdvrbmlpacqz
73 | vqbhjbutawdh
74 | vumwtfajoomk
75 | vtdrjyxkwysj
76 | ycheosforzb3
77 | uixcernmdjhf
78 | eosforbp2222
79 | yangeosforz4
80 | qaojw3dryghl
81 | gq4dinigenes
82 | eosio.ramfee
83 | gezdgnjzgene
84 | gezdenbygene
85 | haytmmjrgige
86 | gezdenzugene
87 | gezdcobsgene
88 | bitfinexdep1
89 | ha2dimjqg4ge
90 | vawzvsywbzcc
91 | eosforbp1111
92 | eosforbp3333
93 | gezdenjxgene
94 | gq2tknagenes
95 | gy3dgojyhage
96 | gezdgnjsgene
97 | gezdemrrgene
98 | aircondition
99 | fjs3ipzchgmu
100 | gezdgnrvgene
101 | gezdgnzqgene
102 | eoswithmixin
103 | gm2dqnjugmge
104 | gezdembwgene
105 | 2joo3r3mf1oa
106 | ha4tsmrthage
107 | lemmingsfund
108 | gi2dgnzzgige
109 | guydsnbsgige
110 | sz1tkw34otro
111 | khrulqcqopt2
112 | poloniexeos1
113 | eoswalletold
114 | ge3tanjxgige
115 | gqytknygenes
116 | guytonjyg4ge
117 | gu2tkmztgige
118 | pxneosincome
119 | ge4denjsgage
120 | vvpoxnzkumsv
121 | vmlhksgswuca
122 | vubhblsuryem
123 | vnnfmmimozgc
124 | yangeosforz5
125 | yangeosforz1
126 | steamcapital
127 | daoxiangqvqv
128 | daoxiangququ
129 | falleninlove
130 | folleninlove
131 | asey1xkh2nht
132 | gateiowallet
133 | 3udul2oxofyi
134 | ge2tsmbzg4ge
135 | wallet4bixin
136 | tokenbankpro
137 | gu3domzrhege
138 | eoswarm1ledg
139 | newzealand13
140 | vrmapriliojz
141 | ge4dknjygyge
142 | ge4dimrzhege
143 | gy4tsobxguge
144 | otcbtcdotcom
145 | gm2tgmigenes
146 | gqydmmrygmge
147 | gezdimbvgene
148 | amandaamanda
149 | gq2tiobzguge
150 | gyztqobsgege
151 | st2xwkjconuh
152 | gi2dsnzrgmge
153 | gopaxdeposit
154 | hazdqojtgqge
155 | kucoincenter
156 | gq3timbugene
157 | gy2dgmrshage
158 | gy2tenjxg4ge
159 | gi3tgnbtgqge
160 | gm3tknrrguge
161 | gu2dgnbyhege
162 | guytemrxgege
163 | ge4dmmzugmge
164 | gezdemzugene
165 | eosio.names
166 | gm3dcnzwgmge
167 | gm2tcobtg4ge
168 | turkmanistan
169 | haytinzzg4ge
170 | geytkmbvgene
171 | ha4tgnjwgqge
172 | roztey4g53vc
173 | libertarian1
174 | gizdmmbxhage
175 | zbeoscharge1
176 | geyteojshege
177 | fiboscouncil
178 | gm2tsmrxgmge
179 | giytemzxgege
180 | crhxhns3qkln
181 | gq4tqmztguge
182 | eosbetcasino
183 | hazdmmrvgige
184 | bankreserves
185 | gqydimjvgene
186 | gqytkobqgyge
187 | idp5tgj21vla
188 | giytimrsgage
189 | ha4dcobvgmge
190 | hazdanjugege
191 | vgqvuacpfnmg
192 | vddudgwjpixi
193 | yangeosforz3
194 | eosairclubmc
195 | chainceonram
196 | zhuchzhwjsz1
197 | vlwvbjwwvbkd
198 | gm2tqnjygyge
199 | kickmyfatass
200 | gezdsmbsg4ge
201 | gu3tenagenes
202 | dg4ns3fpwupe
203 | mpzv1bwkwima
204 | gi4tmmbqg4ge
205 | g4ytmnzsgige
206 | djwqmqurkdov
207 | geztonrqgyge
208 | grtwhtbufalo
209 | ge3tmnzygege
210 | geydimjugene
211 | hezdgmbuhage
212 | gu2dkmjvgige
213 | geztamjtguge
214 | gy2dcoigenes
215 | coinonewallt
216 | biao55555555
217 | heztanrqgene
218 | sensaysensay
219 | ha2dgnbxhage
220 | gqydqnbqguge
221 | fcoindeposit
222 | g4ydmmjzg4ge
223 | evuaxqyrw5k2
224 | gu4tqnagenes
225 | gqztgmjrgene
226 | gu3dknrrgege
227 | gqzdknbsgage
228 | guztgojug4ge
229 | gi4dinbvhege
230 | gu3tmnrqgege
231 | charboledger
232 | gi3dkmbsg4ge
233 | geydonrsgage
234 | geytsojzg4ge
235 | gyzdggenesis
236 | maxlivswkgqh
237 | ge2tomrzgege
238 | ge2temzwgyge
239 | bcexcawallet
240 | ge3tenzwgene
241 | geydonbsgene
242 | gq4dsnzzgqge
243 | zhuchzhwjsz2
244 | g44tinbxhege
245 | 21zephyrfund
246 | g43dknztgene
247 | bitguildeos1
248 | chainceout11
249 | ha2tcojygene
250 | ycheosforzb1
251 | geydcmrqhege
252 | gmzdkojrgene
253 | he2dkmrrgene
254 | viabtccoinex
255 | gy2daobqguge
256 | meiling12345
257 | giytamjygage
258 | giydknygenes
259 | ge2dinrsgege
260 | gu4dknbugige
261 | geytsmjqgene
262 | ge2dimbugene
263 | giztanbxgige
264 | gmzdcobrg4ge
265 | zongzhongeos
266 | upupeosmacan
267 | gezdsnjtgige
268 | iftttttttttt
269 | geytgnrvgege
270 | guzdsnzqg4ge
271 | eosloveyouu1
272 | eosloveyouu2
273 | gyzdsobzg4ge
274 | gi4tkmjwgige
275 | gmytkmrrgene
276 | ge4tmmjsgqge
277 | g44damjqgige
278 | ge3dsmjvgege
279 | ge4tinjzgyge
280 | gy2tknbxgege
281 | ge4tkmjvhege
282 | eosofdeposit
283 | gm2toojrguge
284 | gy4tkmjugige
285 | gy4tkmjzgige
286 | hoowalletpro
287 | eoszxcvbnmaa
288 | bibraccount1
289 | heydemjzgene
290 | gi2demjwgmge
291 | gizdcmjrgage
292 | guytenjrgage
293 | gi3dcnqgenes
294 | coinonekorea
295 | gm2danrzgmge
296 | vqgwndvowlxq
297 | ha4dqmigenes
298 | gu3dsnbwgige
299 | guyteojugage
300 | gy4dinztgige
301 | g42dcmygenes
302 | giydgnjrg4ge
303 | ep3fot1dzims
304 | g4ydkmjvgene
305 | gqztcnygenes
306 | gy2dmmbtgene
307 | gy2dmnzzgene
308 | eosbetdice11
309 | haydemigenes
310 | bigdickrocks
311 | xjrnuy1cbmxn
312 | aexdepositbm
313 | red5stndngby
314 | gm2tqnjzgene
315 | w43lfmz2ozpf
316 | gyztombvguge
317 | gm4toojqgige
318 | gdexioforeos
319 | vczyeuludpja
320 | mv4xfzdutkys
321 | craigspys211
322 | gq2tinjwgige
323 | gyydanbwgage
324 | 52w2dlhbto3t
325 | ha2dmmbygene
326 | gu3tkmbwgmge
327 | gi3demjygage
328 | jlujyuw5gnpz
329 | gy3domrwg4ge
330 | gu2tsnjugmge
331 | gq2dmmzsgege
332 | eoshoowallet
333 | pxnramtrader
334 | vbwktqgx5bf5
335 | giyteojrgyge
336 | gyydimrxgene
337 | gq3tomrzgige
338 | heztoobygene
339 | gezdeojxgqge
340 | geydkmjxgene
341 | hezdkmztguge
342 | guzdknbsgege
343 | ge3dimzrgige
344 | g44daobxgene
345 | iloveeos1314
346 | kj1ffmdwgdyy
347 | puravida1111
348 | haztgnztgene
349 | gu3dsnjthage
350 | gezdgnrugage
351 | ge3tgmzxhege
352 | guytanrxguge
353 | 14r31c5eosda
354 | gq2dembvhege
355 | g44dqnygenes
356 | ha3dgobugage
357 | gu2dsnjygege
358 | ge3tanbzhege
359 | gm3dsnjzguge
360 | 4everxiaonan
361 | guytcmbqgege
362 | he4dmnrtgene
363 | g4ztomzwgyge
364 | ge2tiobzhage
365 | bbbbbbb11111
366 | seniorholder
367 | ge3deobtgege
368 | geytmmbwgene
369 | heydinryg4ge
370 | ge3dmojrgage
371 | ge3dgnzwgige
372 | ha4dsnqgenes
373 | 5.56E+11
374 | thankyou1314
375 | giztsobqgige
376 | ha2tomrqgmge
377 | geytqmjugqge
378 | gyytsmzygyge
379 | gy3dkobsgige
380 | hoowallet111
381 | gyztqnzrgmge
382 | yiyuncai1314
383 | g44donagenes
384 | wanglei11111
385 | geytinrxgene
386 | g43tmojzhage
387 | geytmmbzg4ge
388 | gmytomjvhage
389 | xiaonanzhang
390 | wanglei44444
391 | gu3tenzwhege
392 | gi2donjugqge
393 | ksmf4uoviepr
394 | eosfilevault
395 | gu2domryg4ge
396 | heztamjugmge
397 | ge2tkmjvgige
398 | eeeeyyyyeeee
399 | ge3tiobvgqge
400 | imatchapower
401 | heydenjrg4ge
402 | geztoojrgage
403 | gq4tmobxgmge
404 | geydonjxhage
405 | geztaobygene
406 | worblieosbp1
407 | gyztmnbugyge
408 | ge2tknjugqge
409 | gu4tqojxgege
410 | ge4dombsguge
411 | ha3danzxhege
412 | ha2tomrqgqge
413 | gu4tkmjsgige
414 | ge3dqmjzgege
415 | mylovemaggie
416 | freewallet12
417 | geytcmjqgene
418 | gu3diojyhage
419 | eidnc131zcxz
420 | ge4tinjwgige
421 | gmytknjqgene
422 | gy2teobyhege
423 | gy4dcmbvhege
424 | gq4tonbrhege
425 | gy3dgnbsgige
426 | ge2tonjtgige
427 | gq2tmmrugage
428 | gi3toojuhage
429 | g44tqojzgqge
430 | nannannan333
431 | gi4tcnjqhage
432 | gm2tsmztgene
433 | ha3tqmzwgene
434 | gizdonbzgqge
435 | geztemzqgyge
436 | t2jkavymxsoq
437 | ge3tqoigenes
438 | g44tgnqgenes
439 | gi2tsnrrhege
440 | ge3deojyguge
441 | zhangmeng135
442 | vlxwpb2qiekh
443 | gezdkobygene
444 | ge2dmnzwg4ge
445 | gezdinbwgene
446 | hazdemztgyge
447 | ge4tmmbvgage
448 | g44demzqgyge
449 | ge2denzzgqge
450 | guytsmjsgage
451 | dddvvv112233
452 | geytsobrgene
453 | gm3denbwguge
454 | gm3dcmzzgige
455 | gezdqmzqgege
456 | ge4dmnrwgmge
457 | gqytsmzzgege
458 | gmztqmjqgmge
459 | gi3dembzhage
460 | gm4tgmbwgyge
461 | g44tamqgenes
462 | fengyunxiao3
463 | gu4tknjugqge
464 | ge3tkmztgyge
465 | guytsmzwguge
466 | gq4toobzgage
467 | hzhbit3evyvs
468 | pinduoduoeos
469 | 2qcckb2bkedw
470 | aaa12345aaas
471 | gu4timjsgqge
472 | gi2tsnbtguge
473 | gq2tkmbugqge
474 | aldhp1333335
475 | ha2tsmbuhege
476 | ge2danrxhage
477 | daneosdaneos
478 | gq3demrug4ge
479 | ge2tmmbtgqge
480 | gm4tinjvgene
481 | guydcnzsgyge
482 | zmetafndsa31
483 | eoswalletsyj
484 | gm2tqmzrhege
485 | eoszxywjh311
486 | gyztqnjyhege
487 | 12e4zuynljmq
488 | np2zltjcvwis
489 | ge2taojrgene
490 | gi3dimbxgage
491 | huahua112233
492 | oupan5tjrqhf
493 | itlwnmcj423x
494 | devintherich
495 | ge3tsmjwhege
496 | gy2tsmrxhage
497 | gezdsmjygige
498 | ha2tsnzthege
499 |
--------------------------------------------------------------------------------
/memberstats/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/memberstats/README.md:
--------------------------------------------------------------------------------
1 | ## Purpose
2 | Get registered member statistics
3 |
4 | ## Technical Details
5 |
6 | Clone repo and install with npm in root folder
7 | ```
8 | cd ./memberstats
9 | npm install // or yarn
10 | ```
11 | Run script
12 | ```
13 | node index.js
14 | ```
15 | Example output
16 |
17 | 
18 |
19 | To export files (csv and sql used for table updates), run:
20 |
21 | ```
22 | node export_members_and_voters.js
23 | ```
24 | Which will create multiple files in the same directory for you.
25 |
26 |
27 | ## Author
28 | eosDAC team members. Contact the team for questions on our Discord channel: https://discord.io/eosdac
--------------------------------------------------------------------------------
/memberstats/api/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/memberstats/api/api_server.js:
--------------------------------------------------------------------------------
1 | var express = require("express");
2 | var bodyParser = require("body-parser");
3 | var routes = require("./routes/routes.js");
4 | var app = express();
5 | const MongoClient = require('mongodb').MongoClient;
6 | var CONF = require('./config.json')
7 | const mongoConfig = CONF.db.url;
8 |
9 |
10 | app.use(bodyParser.json());
11 | app.use(bodyParser.urlencoded({ extended: true }));
12 |
13 | app.use(function(req, res, next) {
14 | res.header("Access-Control-Allow-Origin", "*");
15 | res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
16 | next();
17 | });
18 |
19 |
20 | MongoClient.connect(mongoConfig,{ useNewUrlParser: true }).then(client => {
21 | console.log('mongo connected');
22 | let db = client.db(CONF.db.name);
23 | routes(app, db);
24 | var server = app.listen(CONF.api.port, function () {
25 | console.log("Server running on port.", server.address().port);
26 | });
27 | })
28 | .catch(e => {console.log(e); return null;} );
29 |
--------------------------------------------------------------------------------
/memberstats/api/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "api": {
3 | "port": 3000,
4 | "routes": {
5 | "/profile/:account": {
6 | "type": "String",
7 | "max": 13
8 | }
9 |
10 | }
11 | },
12 |
13 | "db": {
14 | "name": "eosdac",
15 | "url": "mongodb://kasperfish:kasper123@ds151012.mlab.com:51012/eosdac"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/memberstats/api/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "profile_api",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "body-parser": "^1.18.3",
13 | "express": "^4.16.3",
14 | "mongodb": "^3.1.6"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/memberstats/api/routes/routes.js:
--------------------------------------------------------------------------------
1 | var CONF = require('../config.json');
2 |
3 |
4 | var appRouter = function (app, db) {
5 |
6 | app.get("/memberstats/", async function (req, res) {
7 |
8 |
9 | db.collection('memberstats').find().toArray((err, result) => {
10 | if (err) return console.log(err);
11 |
12 | res.status(200).send(result);
13 | });
14 |
15 |
16 |
17 | });
18 |
19 |
20 |
21 | }
22 |
23 | module.exports = appRouter;
24 |
--------------------------------------------------------------------------------
/memberstats/api/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 | accepts@~1.3.5:
6 | version "1.3.5"
7 | resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2"
8 | dependencies:
9 | mime-types "~2.1.18"
10 | negotiator "0.6.1"
11 |
12 | array-flatten@1.1.1:
13 | version "1.1.1"
14 | resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
15 |
16 | body-parser@1.18.2:
17 | version "1.18.2"
18 | resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
19 | dependencies:
20 | bytes "3.0.0"
21 | content-type "~1.0.4"
22 | debug "2.6.9"
23 | depd "~1.1.1"
24 | http-errors "~1.6.2"
25 | iconv-lite "0.4.19"
26 | on-finished "~2.3.0"
27 | qs "6.5.1"
28 | raw-body "2.3.2"
29 | type-is "~1.6.15"
30 |
31 | body-parser@^1.18.3:
32 | version "1.18.3"
33 | resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4"
34 | dependencies:
35 | bytes "3.0.0"
36 | content-type "~1.0.4"
37 | debug "2.6.9"
38 | depd "~1.1.2"
39 | http-errors "~1.6.3"
40 | iconv-lite "0.4.23"
41 | on-finished "~2.3.0"
42 | qs "6.5.2"
43 | raw-body "2.3.3"
44 | type-is "~1.6.16"
45 |
46 | bson@^1.1.0:
47 | version "1.1.0"
48 | resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.0.tgz#bee57d1fb6a87713471af4e32bcae36de814b5b0"
49 |
50 | bytes@3.0.0:
51 | version "3.0.0"
52 | resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
53 |
54 | content-disposition@0.5.2:
55 | version "0.5.2"
56 | resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
57 |
58 | content-type@~1.0.4:
59 | version "1.0.4"
60 | resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
61 |
62 | cookie-signature@1.0.6:
63 | version "1.0.6"
64 | resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
65 |
66 | cookie@0.3.1:
67 | version "0.3.1"
68 | resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
69 |
70 | debug@2.6.9:
71 | version "2.6.9"
72 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
73 | dependencies:
74 | ms "2.0.0"
75 |
76 | depd@1.1.1:
77 | version "1.1.1"
78 | resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"
79 |
80 | depd@~1.1.1, depd@~1.1.2:
81 | version "1.1.2"
82 | resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
83 |
84 | destroy@~1.0.4:
85 | version "1.0.4"
86 | resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
87 |
88 | ee-first@1.1.1:
89 | version "1.1.1"
90 | resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
91 |
92 | encodeurl@~1.0.2:
93 | version "1.0.2"
94 | resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
95 |
96 | escape-html@~1.0.3:
97 | version "1.0.3"
98 | resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
99 |
100 | etag@~1.8.1:
101 | version "1.8.1"
102 | resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
103 |
104 | express@^4.16.3:
105 | version "4.16.3"
106 | resolved "http://registry.npmjs.org/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53"
107 | dependencies:
108 | accepts "~1.3.5"
109 | array-flatten "1.1.1"
110 | body-parser "1.18.2"
111 | content-disposition "0.5.2"
112 | content-type "~1.0.4"
113 | cookie "0.3.1"
114 | cookie-signature "1.0.6"
115 | debug "2.6.9"
116 | depd "~1.1.2"
117 | encodeurl "~1.0.2"
118 | escape-html "~1.0.3"
119 | etag "~1.8.1"
120 | finalhandler "1.1.1"
121 | fresh "0.5.2"
122 | merge-descriptors "1.0.1"
123 | methods "~1.1.2"
124 | on-finished "~2.3.0"
125 | parseurl "~1.3.2"
126 | path-to-regexp "0.1.7"
127 | proxy-addr "~2.0.3"
128 | qs "6.5.1"
129 | range-parser "~1.2.0"
130 | safe-buffer "5.1.1"
131 | send "0.16.2"
132 | serve-static "1.13.2"
133 | setprototypeof "1.1.0"
134 | statuses "~1.4.0"
135 | type-is "~1.6.16"
136 | utils-merge "1.0.1"
137 | vary "~1.1.2"
138 |
139 | finalhandler@1.1.1:
140 | version "1.1.1"
141 | resolved "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105"
142 | dependencies:
143 | debug "2.6.9"
144 | encodeurl "~1.0.2"
145 | escape-html "~1.0.3"
146 | on-finished "~2.3.0"
147 | parseurl "~1.3.2"
148 | statuses "~1.4.0"
149 | unpipe "~1.0.0"
150 |
151 | forwarded@~0.1.2:
152 | version "0.1.2"
153 | resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
154 |
155 | fresh@0.5.2:
156 | version "0.5.2"
157 | resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
158 |
159 | http-errors@1.6.2:
160 | version "1.6.2"
161 | resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736"
162 | dependencies:
163 | depd "1.1.1"
164 | inherits "2.0.3"
165 | setprototypeof "1.0.3"
166 | statuses ">= 1.3.1 < 2"
167 |
168 | http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3:
169 | version "1.6.3"
170 | resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d"
171 | dependencies:
172 | depd "~1.1.2"
173 | inherits "2.0.3"
174 | setprototypeof "1.1.0"
175 | statuses ">= 1.4.0 < 2"
176 |
177 | iconv-lite@0.4.19:
178 | version "0.4.19"
179 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
180 |
181 | iconv-lite@0.4.23:
182 | version "0.4.23"
183 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
184 | dependencies:
185 | safer-buffer ">= 2.1.2 < 3"
186 |
187 | inherits@2.0.3:
188 | version "2.0.3"
189 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
190 |
191 | ipaddr.js@1.8.0:
192 | version "1.8.0"
193 | resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.8.0.tgz#eaa33d6ddd7ace8f7f6fe0c9ca0440e706738b1e"
194 |
195 | media-typer@0.3.0:
196 | version "0.3.0"
197 | resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
198 |
199 | memory-pager@^1.0.2:
200 | version "1.1.0"
201 | resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.1.0.tgz#9308915e0e972849fefbae6f8bc95d6b350e7344"
202 |
203 | merge-descriptors@1.0.1:
204 | version "1.0.1"
205 | resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
206 |
207 | methods@~1.1.2:
208 | version "1.1.2"
209 | resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
210 |
211 | mime-db@~1.36.0:
212 | version "1.36.0"
213 | resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397"
214 |
215 | mime-types@~2.1.18:
216 | version "2.1.20"
217 | resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19"
218 | dependencies:
219 | mime-db "~1.36.0"
220 |
221 | mime@1.4.1:
222 | version "1.4.1"
223 | resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
224 |
225 | mongodb-core@3.1.5:
226 | version "3.1.5"
227 | resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-3.1.5.tgz#59ca67d7f6cea570d5437624a7afec8d752d477a"
228 | dependencies:
229 | bson "^1.1.0"
230 | require_optional "^1.0.1"
231 | safe-buffer "^5.1.2"
232 | optionalDependencies:
233 | saslprep "^1.0.0"
234 |
235 | mongodb@^3.1.6:
236 | version "3.1.6"
237 | resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.1.6.tgz#6054641973b5bf5b5ae1c67dcbcf8fa88280273d"
238 | dependencies:
239 | mongodb-core "3.1.5"
240 | safe-buffer "^5.1.2"
241 |
242 | ms@2.0.0:
243 | version "2.0.0"
244 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
245 |
246 | negotiator@0.6.1:
247 | version "0.6.1"
248 | resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
249 |
250 | on-finished@~2.3.0:
251 | version "2.3.0"
252 | resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
253 | dependencies:
254 | ee-first "1.1.1"
255 |
256 | parseurl@~1.3.2:
257 | version "1.3.2"
258 | resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"
259 |
260 | path-to-regexp@0.1.7:
261 | version "0.1.7"
262 | resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
263 |
264 | proxy-addr@~2.0.3:
265 | version "2.0.4"
266 | resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93"
267 | dependencies:
268 | forwarded "~0.1.2"
269 | ipaddr.js "1.8.0"
270 |
271 | qs@6.5.1:
272 | version "6.5.1"
273 | resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
274 |
275 | qs@6.5.2:
276 | version "6.5.2"
277 | resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
278 |
279 | range-parser@~1.2.0:
280 | version "1.2.0"
281 | resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
282 |
283 | raw-body@2.3.2:
284 | version "2.3.2"
285 | resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89"
286 | dependencies:
287 | bytes "3.0.0"
288 | http-errors "1.6.2"
289 | iconv-lite "0.4.19"
290 | unpipe "1.0.0"
291 |
292 | raw-body@2.3.3:
293 | version "2.3.3"
294 | resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3"
295 | dependencies:
296 | bytes "3.0.0"
297 | http-errors "1.6.3"
298 | iconv-lite "0.4.23"
299 | unpipe "1.0.0"
300 |
301 | require_optional@^1.0.1:
302 | version "1.0.1"
303 | resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e"
304 | dependencies:
305 | resolve-from "^2.0.0"
306 | semver "^5.1.0"
307 |
308 | resolve-from@^2.0.0:
309 | version "2.0.0"
310 | resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57"
311 |
312 | safe-buffer@5.1.1:
313 | version "5.1.1"
314 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
315 |
316 | safe-buffer@^5.1.2:
317 | version "5.1.2"
318 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
319 |
320 | "safer-buffer@>= 2.1.2 < 3":
321 | version "2.1.2"
322 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
323 |
324 | saslprep@^1.0.0:
325 | version "1.0.2"
326 | resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.2.tgz#da5ab936e6ea0bbae911ffec77534be370c9f52d"
327 | dependencies:
328 | sparse-bitfield "^3.0.3"
329 |
330 | semver@^5.1.0:
331 | version "5.5.1"
332 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477"
333 |
334 | send@0.16.2:
335 | version "0.16.2"
336 | resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
337 | dependencies:
338 | debug "2.6.9"
339 | depd "~1.1.2"
340 | destroy "~1.0.4"
341 | encodeurl "~1.0.2"
342 | escape-html "~1.0.3"
343 | etag "~1.8.1"
344 | fresh "0.5.2"
345 | http-errors "~1.6.2"
346 | mime "1.4.1"
347 | ms "2.0.0"
348 | on-finished "~2.3.0"
349 | range-parser "~1.2.0"
350 | statuses "~1.4.0"
351 |
352 | serve-static@1.13.2:
353 | version "1.13.2"
354 | resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1"
355 | dependencies:
356 | encodeurl "~1.0.2"
357 | escape-html "~1.0.3"
358 | parseurl "~1.3.2"
359 | send "0.16.2"
360 |
361 | setprototypeof@1.0.3:
362 | version "1.0.3"
363 | resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
364 |
365 | setprototypeof@1.1.0:
366 | version "1.1.0"
367 | resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656"
368 |
369 | sparse-bitfield@^3.0.3:
370 | version "3.0.3"
371 | resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11"
372 | dependencies:
373 | memory-pager "^1.0.2"
374 |
375 | "statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2":
376 | version "1.5.0"
377 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
378 |
379 | statuses@~1.4.0:
380 | version "1.4.0"
381 | resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
382 |
383 | type-is@~1.6.15, type-is@~1.6.16:
384 | version "1.6.16"
385 | resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194"
386 | dependencies:
387 | media-typer "0.3.0"
388 | mime-types "~2.1.18"
389 |
390 | unpipe@1.0.0, unpipe@~1.0.0:
391 | version "1.0.0"
392 | resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
393 |
394 | utils-merge@1.0.1:
395 | version "1.0.1"
396 | resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
397 |
398 | vary@~1.1.2:
399 | version "1.1.2"
400 | resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
401 |
--------------------------------------------------------------------------------
/memberstats/export_members_and_voters.js:
--------------------------------------------------------------------------------
1 | const eosjs = require('eosjs');
2 | const log = require('single-line-log').stdout;
3 | const colors = require('colors/safe');
4 | const pMap = require('p-map');
5 | const request = require('request');
6 | const fs = require('fs');
7 |
8 |
9 | class members{
10 |
11 | constructor(){
12 | console.log(colors.magenta('App started! \n') );
13 | this._initEos();
14 | this.work();
15 | }
16 |
17 | _initEos(){
18 | this.eos = eosjs({
19 | chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',
20 | keyProvider: null, // WIF string or array of keys..
21 | httpEndpoint: 'https://proxy.eosnode.tools:443',
22 | });
23 | console.log('Connected to EOS network!');
24 | }
25 |
26 | async work(){
27 |
28 | let lb='';
29 | let members = [];
30 | let voters = [];
31 | let keys = [];
32 | let sql = [];
33 | let string_to_write = '';
34 | let this_member = {};
35 | /*
36 | members[0] = {"sender":'1lukestokes1'};
37 | members[1] = {"sender":'lukeeosproxy'};
38 |
39 | voters[0] = {"voter":'1lukestokes1'};
40 | voters[1] = {"voter":'lukeeosproxy'};
41 | */
42 | console.log(colors.white('Getting All Members') );
43 | while(lb !== null){
44 | let c = await this.getMembers(lb);
45 | if(c){
46 |
47 | if(lb === c[c.length-1].sender){
48 | lb = null;
49 | }
50 | else{
51 | if(lb != ''){
52 | //remove first entry except for the first run
53 | c.shift();
54 | }
55 | //set lower_bound to the last received candidate_name
56 | lb = c[c.length-1].sender;
57 | members.push(...c);
58 | }
59 | }
60 | }
61 | lb='';
62 | console.log(colors.white('Getting All Voters') );
63 | while(lb !== null){
64 | let c = await this.getVoters(lb);
65 | if(c){
66 |
67 | if(lb === c[c.length-1].voter){
68 | lb = null;
69 | }
70 | else{
71 | if(lb != ''){
72 | //remove first entry except for the first run
73 | c.shift();
74 | }
75 | //set lower_bound to the last received candidate_name
76 | lb = c[c.length-1].voter;
77 | voters.push(...c);
78 | }
79 | }
80 | }
81 |
82 | console.log(colors.white('Getting All Member Keys') );
83 | const mapper = mem => this.getAccount(mem.sender).then(res => {
84 | mem.keys = [];
85 | mem.keys['active'] = '';
86 | mem.keys['owner'] = '';
87 | for (var i = res.permissions.length - 1; i >= 0; i--) {
88 | if (res.permissions[i].perm_name == 'owner' && res.permissions[i].required_auth.keys.length > 0) {
89 | mem.keys['owner'] = res.permissions[i].required_auth.keys[0].key;
90 | }
91 | if (res.permissions[i].perm_name == 'active' && res.permissions[i].required_auth.keys.length > 0) {
92 | mem.keys['active'] = res.permissions[i].required_auth.keys[0].key;
93 | }
94 | }
95 | return mem
96 | }).catch(e => {console.log('MAPPER: '+e) });
97 | members = await pMap(members, mapper, {concurrency: 20 }).then(result => { return result });
98 |
99 | console.log(colors.yellow('Retrieving all member balances! \n') );
100 | const balance_mapper = mem => this.getBalance(mem.sender).then(
101 | res => {
102 | mem.amount = res;
103 | return mem
104 | }
105 | ).catch(
106 | e => {
107 | console.log('MAPPER: '+e)
108 | }
109 | );
110 | let result = await pMap(members, balance_mapper, {concurrency: 20 }).then(result => { return result });
111 |
112 | console.log(colors.magenta('Saving balance_member_update.sql'));
113 | var balance_member_sql_stream = fs.createWriteStream("balance_member_update.sql");
114 | balance_member_sql_stream.once('open', function(fd) {
115 | members.forEach(i => {
116 | balance_member_sql_stream.write("UPDATE balances SET is_member = 1 WHERE account = '" + i.sender + "';\n");
117 | });
118 | balance_member_sql_stream.end();
119 | });
120 | console.log(colors.magenta('Saving members.csv'));
121 | var member_csv_stream = fs.createWriteStream("members.csv");
122 | member_csv_stream.once('open', function(fd) {
123 | members.forEach(i => {
124 | string_to_write = i.sender + ",";
125 | string_to_write += i.amount + ",";
126 | string_to_write += i.keys["owner"];
127 | string_to_write += ",";
128 | string_to_write += i.keys["active"];
129 | member_csv_stream.write(string_to_write + "\n");
130 | });
131 | member_csv_stream.end();
132 | });
133 |
134 | console.log(colors.magenta('Saving balance_voter_update.sql'));
135 | var balance_voter_sql_stream = fs.createWriteStream("balance_voter_update.sql");
136 | balance_voter_sql_stream.once('open', function(fd) {
137 | voters.forEach(i => {
138 | balance_voter_sql_stream.write("UPDATE balances SET is_member = 1 WHERE account = '" + i.voter + "';\n");
139 | });
140 | balance_voter_sql_stream.end();
141 | });
142 | console.log(colors.magenta('Saving voters.csv'));
143 | var voter_csv_stream = fs.createWriteStream("voters.csv");
144 | voter_csv_stream.once('open', function(fd) {
145 | voters.forEach(i => {
146 | for (var j = members.length - 1; j >= 0; j--) {
147 | if (members[j].sender == i.voter) {
148 | this_member = members[j];
149 | }
150 | }
151 | string_to_write = i.voter + ",";
152 | string_to_write += this_member.amount;
153 | string_to_write += ",";
154 | string_to_write += this_member.keys["owner"];
155 | string_to_write += ",";
156 | string_to_write += this_member.keys["active"];
157 | voter_csv_stream.write(string_to_write + "\n");
158 | });
159 | voter_csv_stream.end();
160 | });
161 | }
162 |
163 | getAccount(account=''){
164 | return this.eos.getAccount(account).then(res => res).catch(e => {console.log(e); return false;})
165 | }
166 |
167 | getBalance(account){
168 | return this.eos.getCurrencyBalance({code: 'eosdactokens', symbol: 'EOSDAC', account: account }).then(res =>{
169 | res = res[0];
170 | let bal = res === undefined?0:res;
171 | if(!this.verbose){
172 | log(colors.green(`${account} -> ${bal}`));
173 | }
174 | else{
175 | console.log(colors.green(`${account} -> ${bal}`) );
176 | }
177 |
178 | return bal;
179 |
180 | }).catch(e => {console.log(colors.red(`${account} -> ${e} \n` )) })
181 | }
182 |
183 |
184 | getMembers(lb=''){
185 | return this.eos.getTableRows({
186 | "json":"true",
187 | "scope":"eosdactokens",
188 | "code":"eosdactokens",
189 | "table":"members",
190 | "lower_bound":lb,
191 | "upper_bound":"",
192 | "limit":-1,
193 | "key_type":"",
194 | "index_position":""
195 | }).then(res => res.rows).catch(e => {console.log(e); return false;})
196 | }
197 |
198 | getVoters(lb=''){
199 | return this.eos.getTableRows({
200 | "json":"true",
201 | "scope":"daccustodian",
202 | "code":"daccustodian",
203 | "table":"votes",
204 | "lower_bound":lb,
205 | "upper_bound":"",
206 | "limit":-1,
207 | "key_type":"",
208 | "index_position":""
209 | }).then(res => res.rows).catch(e => {console.log(e); return false;})
210 | }
211 | }
212 |
213 | let test = new members();
214 |
--------------------------------------------------------------------------------
/memberstats/index.js:
--------------------------------------------------------------------------------
1 | const eosjs = require('eosjs');
2 | const log = require('single-line-log').stdout;
3 | const colors = require('colors/safe');
4 | const pMap = require('p-map');
5 | const request = require('request');
6 | const fs = require('fs');
7 | const MongoClient = require('mongodb').MongoClient;
8 | // const schedule = require('node-schedule');
9 |
10 |
11 | class members{
12 |
13 | constructor(){
14 | this.agreedterms = -1; //set to -1 to get all members that have registered before regardless of constitution version
15 | this.supply = 994895254.9762;
16 | this.verbose = false;
17 |
18 | this.tokenstatsapi = 'https://explorer.eosdac.io/explorer_base_api.php?get=tokenstats';
19 | this.mongoConfig = false;
20 |
21 | console.log(colors.magenta('App started! \n') );
22 | this._initEos();
23 | this.work();
24 | }
25 |
26 | _initEos(){
27 | this.eos = eosjs({
28 | chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',
29 | keyProvider: null, // WIF string or array of keys..
30 | httpEndpoint: 'https://eu.eosdac.io',
31 |
32 | });
33 | console.log('Connected to EOS network!');
34 | }
35 |
36 | async work(){
37 |
38 | let lb='';
39 | let temp = [];
40 | let votes = [];
41 | this.startblock = await this.getBlockNumber();
42 | if(!this.db && this.mongoConfig){
43 | this.db = await MongoClient.connect(this.mongoConfig,{ useNewUrlParser: true })
44 | .then(client => {
45 | console.log(colors.green('mongo connected'));
46 | let db = client.db('eosdac');
47 | return db;
48 | })
49 | .catch(e => {console.log(colors.red(e)); return null;} );
50 |
51 | }
52 |
53 | console.log(colors.white('Getting All Members.') );
54 | while(lb !== null){
55 | let c = await this.getMembers(lb);
56 | if(c){
57 |
58 | if(lb === c[c.length-1].sender){
59 | lb = null;
60 | }
61 | else{
62 | if(lb != ''){
63 | //remove first entry except for the first run
64 | c.shift();
65 | }
66 | //set lower_bound to the last received candidate_name
67 | lb = c[c.length-1].sender;
68 | temp.push(...c);
69 | }
70 | }
71 | }
72 |
73 | lb='';
74 | console.log(colors.white('Getting All Voters.') );
75 | while(lb !== null){
76 | let c = await this.getVoters(lb);
77 | if(c){
78 |
79 | if(lb === c[c.length-1].voter){
80 | lb = null;
81 | }
82 | else{
83 | if(lb != ''){
84 | //remove first entry except for the first run
85 | c.shift();
86 | }
87 | //set lower_bound to the last received candidate_name
88 | lb = c[c.length-1].voter;
89 | votes.push(...c);
90 | }
91 | }
92 | }
93 |
94 | console.log(`Found a total of ${colors.bgMagenta(votes.length)} voters` );
95 |
96 | let real_members = temp;
97 |
98 | console.log(`Found a total of ${colors.bgMagenta(real_members.length)} members` );
99 |
100 | // let stats = await this.getTokenStats();
101 |
102 | console.log(colors.yellow('Retrieving all member balances! \n') );
103 | const mapper = mem => this.getBalance(mem.sender).then(res => {mem.amount = res; return mem }).catch(e => {console.log('MAPPER: '+e) });
104 | let result = await pMap(real_members, mapper, {concurrency: 20 }).then(result => { return result });
105 | // console.log(result)
106 |
107 | let sorted = {};
108 |
109 | result.forEach(i => {
110 | (sorted[i.agreedtermsversion] = sorted[i.agreedtermsversion] ? sorted[i.agreedtermsversion] : []).push(i);
111 | })
112 |
113 | let totals= [];
114 |
115 |
116 | Object.keys(sorted).forEach(list => {
117 |
118 | totals.push( this.calculateStats(sorted[list]) );
119 | });
120 | totals.push(this.calculateStats(result));
121 | this.endblock = await this.getBlockNumber();
122 | let p = this.parseConsole(totals);
123 | this.SaveToDB(p);
124 |
125 | }
126 |
127 | async SaveToDB(entry){
128 |
129 | if(this.mongoConfig && this.db){
130 | try{
131 | await this.db.collection('memberstats').insertOne({_id: new Date().getTime(), data: entry});
132 | console.log('saved to db');
133 | }catch(e){
134 | console.log(colors.yellow(e));
135 | };
136 |
137 | }
138 | else{
139 | console.log('Not saved, no database configured.')
140 | }
141 | }
142 |
143 | calculateStats(members){
144 | let result = {agreedterms: members[0].agreedtermsversion, total_members: members.length, tokenless_members: 0, total_tokens: 0 };
145 | members.forEach(m => {
146 | if(m.amount){
147 | let tokens = parseFloat(m.amount.slice(0,-7) )*10000;
148 | result.total_tokens += tokens;
149 | }
150 | else{
151 | result.tokenless_members ++;
152 | }
153 | });
154 |
155 | return result;
156 |
157 | }
158 |
159 | parseConsole(res){
160 | console.log('\n');
161 | console.log(colors.underline('RESULTS')+'\n');
162 | console.log(colors.bgMagenta(`Total Supply = ${this.supply}`) );
163 | let parsed = [];
164 | res.forEach( (result, index, array) => {
165 | let ag = result.agreedterms;
166 | let tm = result.total_members;
167 | let tl = result.tokenless_members;
168 | let tw = result.total_members-result.tokenless_members;
169 | let tk = result.total_tokens/10000;
170 | let perc_t = ( (result.total_tokens/10000)/this.supply*100).toFixed(2);
171 |
172 | let p = [tm, tl, tw, tk, perc_t];
173 | let obj = {};
174 | if (index === array.length - 1){
175 | console.log('------------------------------------------------------------------------------\n');
176 | console.log(`TOTAL \tmembers ${colors.magenta(tm)} (${colors.green(tw)} + ${colors.red(tl)}) \t tokens ${colors.yellow(tk)} ${perc_t}%`);
177 | obj['total'] = p;
178 | parsed.push(obj);
179 |
180 |
181 | }
182 | else{
183 |
184 | console.log(`\nagreedterms v${colors.white(ag)} \t members ${colors.magenta(tm)} (${colors.green(tw)} + ${colors.red(tl)}) \t tokens ${colors.yellow(tk)} ${perc_t}%`)
185 |
186 | obj[ag] = p;
187 | parsed.push(obj);
188 | }
189 |
190 |
191 | })
192 |
193 | if(this.startblock && this.endblock){
194 | console.log(colors.italic(`\n\nThis test started at headblock ${this.startblock.head_block_num} and ended at block ${this.endblock.head_block_num}.`));
195 | let difblock = this.endblock.head_block_num - this.startblock.head_block_num;
196 | console.log(colors.italic(`There is a window of ${difblock} (approx ${difblock/2} seconds) blocks in which actions could have happend that are not taken in to account`))
197 | }
198 |
199 | console.log('\n\n')
200 | return parsed;
201 |
202 | }
203 |
204 | getMembers(lb=''){
205 | return this.eos.getTableRows({
206 | "json":"true",
207 | "scope":"eosdac",
208 | "code":"eosdactokens",
209 | "table":"members",
210 | "lower_bound":lb,
211 | "upper_bound":"",
212 | "limit":-1,
213 | "key_type":"",
214 | "index_position":""
215 | }).then(res => res.rows).catch(e => {console.log(e); return false;})
216 | }
217 |
218 | getVoters(lb=''){
219 | return this.eos.getTableRows({
220 | "json":"true",
221 | "scope":"eosdac",
222 | "code":"daccustodian",
223 | "table":"votes",
224 | "lower_bound":lb,
225 | "upper_bound":"",
226 | "limit":-1,
227 | "key_type":"",
228 | "index_position":""
229 | }).then(res => res.rows).catch(e => {console.log(e); return false;})
230 | }
231 |
232 |
233 | getBalance(account){
234 | return this.eos.getCurrencyBalance({code: 'eosdactokens', symbol: 'EOSDAC', account: account }).then(res =>{
235 | res = res[0];
236 | let bal = res === undefined?0:res;
237 | if(!this.verbose){
238 | log(colors.green(`${account} -> ${bal}`));
239 | }
240 | else{
241 | console.log(colors.green(`${account} -> ${bal}`) );
242 | }
243 |
244 | return bal;
245 |
246 | }).catch(e => {console.log(colors.red(`${account} -> ${e} \n` )) })
247 | }
248 |
249 | getTokenStats(){
250 | var self = this;
251 | return new Promise(function(resolve, reject) {
252 | request({
253 | url : self.tokenstatsapi,
254 | json:true
255 |
256 | }, function(err, response, body){
257 | if(err || response.statusCode !== 200){
258 | reject(false);
259 | }
260 | else{
261 | resolve(body[0]);
262 | }
263 | });
264 | });
265 | }
266 |
267 | getBlockNumber(){
268 | return this.eos.getInfo({}).then(res => res).catch(e => {console.log(e); return false});
269 | }
270 | }
271 |
272 | let test = new members();
--------------------------------------------------------------------------------
/memberstats/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "memberstats",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "colors": "^1.3.2",
13 | "eosjs": "^16.0.6",
14 | "mongodb": "^3.1.6",
15 | "p-map": "^1.2.0",
16 | "request": "^2.88.0",
17 | "request-promise-native": "^1.0.5",
18 | "single-line-log": "^1.1.2"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/memberstats/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/memberstats/www/style.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosdac/DACtools/c2cab65c67d13dfb382be393f6077faa1c038a60/memberstats/www/style.css
--------------------------------------------------------------------------------
/nodeselector/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/nodeselector/README.md:
--------------------------------------------------------------------------------
1 | ## Purpose
2 | Select fastest responding bp node
3 |
4 | ## Technical Details
5 |
6 | This script will select the fastest responding eos node from the 21 active blockproducers. It can also give you a list of all 21 BP-nodes filtered by https (option).
7 |
8 |
9 | It will first get the node urls from the 21 block producers through our bp.json api https://eosdac.io/topnodes.json. It will then start a request race, the fastest responding node that supports https will get resolved immediatly.
10 |
11 |
12 | Clone repo and install with npm in root folder
13 | ```
14 | cd ./nodeselector
15 | npm install
16 | ```
17 | Run test script
18 | ```
19 | node test.js
20 | ```
21 | Example output of test.js
22 |
23 | 
24 |
25 |
26 | ## Author
27 | eosDAC team members. Contact the team for questions on our Discord channel: https://discord.io/eosdac
--------------------------------------------------------------------------------
/nodeselector/nodeselector.js:
--------------------------------------------------------------------------------
1 | const request = require('request');
2 |
3 | class NodeSelector {
4 |
5 | constructor (nodes_api_url){
6 | //configs
7 | this.nodes_api_url = nodes_api_url;
8 | this.benchmark_url ='/v1/chain/get_info';
9 | }
10 |
11 | async get_fastest_node(){
12 | var self =this;
13 | //only get nodes if not already done
14 | if(this.nodelist == undefined){
15 | try{
16 | await this.get_nodes({https_only:true});
17 | }catch(e){};//no need to catch the error here
18 | }
19 | //return false if node api error
20 | if(!this.nodelist || !this.nodelist.length){
21 | console.log('error getting node list from api server!');
22 | return false;
23 | }
24 |
25 | return new Promise(async function(resolve, reject){
26 | let flag = true;
27 | while(flag){
28 | try{
29 | let winner = await self._start_race();
30 | if(winner.ms != 'error'){
31 | flag = false;
32 | resolve(winner);//valid winner
33 | }
34 | else{
35 | //node errored so exclude from next race
36 | self.nodelist = self.nodelist.filter((node) => {return node != winner.node;} );
37 | }
38 | }catch(e){console.log(e)};
39 | }
40 | })
41 | }
42 |
43 | get_nodes(config = {https_only:false} ){
44 | var self = this;
45 | return new Promise(function(resolve, reject) {
46 | request({
47 | url : self.nodes_api_url,
48 | json:true
49 |
50 | }, function(err, response, body){
51 | if(err || response.statusCode !== 200){
52 | self.nodelist=false;
53 | reject(false);
54 | }
55 | else{
56 | self.nodelist=body;
57 | if(config.https_only){
58 | self.nodelist = body.filter((node) => node.startsWith('https'));
59 | self.nodelist = self.nodelist.map(node => {
60 | node = node.substr(-1) =='/'?node.slice(0,-1):node;
61 | return node
62 | })
63 | }
64 | resolve(self.nodelist);
65 | }
66 | });
67 | });
68 | }
69 |
70 | _start_race(){
71 | var self = this;
72 | console.log(`start race with ${this.nodelist.length} nodes...`);
73 | if(this.nodelist.length < 1){
74 | console.log('There are no nodes left to race!');
75 | return false;
76 | }
77 | this.proms = [];
78 | this.nodelist.forEach((node, index) => {
79 | node = node.substr(-1) =='/'?node.slice(0,-1):node;
80 | let p = this._racer_request(node).then(res => res ).catch(e => e );
81 | this.proms.push(p)
82 | });
83 | return Promise.race(this.proms).then(function(winner) {
84 | return winner;
85 | })
86 | }
87 |
88 | _racer_request(node_url){
89 | var self = this;
90 | let url = node_url;
91 | return new Promise(function(resolve, reject) {
92 | request({
93 | url : url + self.benchmark_url,
94 | time : true,
95 | rejectUnauthorized: false,
96 | headers: {'User-Agent': 'Chrome/59.0.3071.115'},
97 |
98 | }, function(err, response){
99 | if(err){
100 | reject({node: node_url, ms: 'error'} );
101 | }
102 | else{
103 | resolve({node: node_url, ms: response.elapsedTime});
104 | }
105 |
106 | });
107 | });
108 | }
109 | }//end class
110 | export default NodeSelector
111 | /*module.exports = {
112 | NodeSelector
113 | };*/
114 |
--------------------------------------------------------------------------------
/nodeselector/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nodeselector",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "ajv": {
8 | "version": "5.5.2",
9 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
10 | "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
11 | "requires": {
12 | "co": "4.6.0",
13 | "fast-deep-equal": "1.1.0",
14 | "fast-json-stable-stringify": "2.0.0",
15 | "json-schema-traverse": "0.3.1"
16 | }
17 | },
18 | "asn1": {
19 | "version": "0.2.3",
20 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
21 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y="
22 | },
23 | "assert-plus": {
24 | "version": "1.0.0",
25 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
26 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
27 | },
28 | "asynckit": {
29 | "version": "0.4.0",
30 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
31 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
32 | },
33 | "aws-sign2": {
34 | "version": "0.7.0",
35 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
36 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
37 | },
38 | "aws4": {
39 | "version": "1.7.0",
40 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz",
41 | "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w=="
42 | },
43 | "bcrypt-pbkdf": {
44 | "version": "1.0.2",
45 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
46 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
47 | "optional": true,
48 | "requires": {
49 | "tweetnacl": "0.14.5"
50 | }
51 | },
52 | "bluebird": {
53 | "version": "3.5.1",
54 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
55 | "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
56 | },
57 | "caseless": {
58 | "version": "0.12.0",
59 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
60 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
61 | },
62 | "co": {
63 | "version": "4.6.0",
64 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
65 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
66 | },
67 | "combined-stream": {
68 | "version": "1.0.6",
69 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
70 | "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
71 | "requires": {
72 | "delayed-stream": "1.0.0"
73 | }
74 | },
75 | "core-util-is": {
76 | "version": "1.0.2",
77 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
78 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
79 | },
80 | "dashdash": {
81 | "version": "1.14.1",
82 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
83 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
84 | "requires": {
85 | "assert-plus": "1.0.0"
86 | }
87 | },
88 | "delayed-stream": {
89 | "version": "1.0.0",
90 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
91 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
92 | },
93 | "ecc-jsbn": {
94 | "version": "0.1.2",
95 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
96 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
97 | "optional": true,
98 | "requires": {
99 | "jsbn": "0.1.1",
100 | "safer-buffer": "2.1.2"
101 | }
102 | },
103 | "extend": {
104 | "version": "3.0.2",
105 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
106 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
107 | },
108 | "extsprintf": {
109 | "version": "1.3.0",
110 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
111 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
112 | },
113 | "fast-deep-equal": {
114 | "version": "1.1.0",
115 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
116 | "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
117 | },
118 | "fast-json-stable-stringify": {
119 | "version": "2.0.0",
120 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
121 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
122 | },
123 | "forever-agent": {
124 | "version": "0.6.1",
125 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
126 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
127 | },
128 | "form-data": {
129 | "version": "2.3.2",
130 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
131 | "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
132 | "requires": {
133 | "asynckit": "0.4.0",
134 | "combined-stream": "1.0.6",
135 | "mime-types": "2.1.19"
136 | }
137 | },
138 | "getpass": {
139 | "version": "0.1.7",
140 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
141 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
142 | "requires": {
143 | "assert-plus": "1.0.0"
144 | }
145 | },
146 | "har-schema": {
147 | "version": "2.0.0",
148 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
149 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
150 | },
151 | "har-validator": {
152 | "version": "5.0.3",
153 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz",
154 | "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
155 | "requires": {
156 | "ajv": "5.5.2",
157 | "har-schema": "2.0.0"
158 | }
159 | },
160 | "http-signature": {
161 | "version": "1.2.0",
162 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
163 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
164 | "requires": {
165 | "assert-plus": "1.0.0",
166 | "jsprim": "1.4.1",
167 | "sshpk": "1.14.2"
168 | }
169 | },
170 | "is-typedarray": {
171 | "version": "1.0.0",
172 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
173 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
174 | },
175 | "isstream": {
176 | "version": "0.1.2",
177 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
178 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
179 | },
180 | "jsbn": {
181 | "version": "0.1.1",
182 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
183 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
184 | "optional": true
185 | },
186 | "json-schema": {
187 | "version": "0.2.3",
188 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
189 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
190 | },
191 | "json-schema-traverse": {
192 | "version": "0.3.1",
193 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
194 | "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
195 | },
196 | "json-stringify-safe": {
197 | "version": "5.0.1",
198 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
199 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
200 | },
201 | "jsprim": {
202 | "version": "1.4.1",
203 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
204 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
205 | "requires": {
206 | "assert-plus": "1.0.0",
207 | "extsprintf": "1.3.0",
208 | "json-schema": "0.2.3",
209 | "verror": "1.10.0"
210 | }
211 | },
212 | "lodash": {
213 | "version": "4.17.10",
214 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
215 | "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
216 | },
217 | "mime-db": {
218 | "version": "1.35.0",
219 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz",
220 | "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg=="
221 | },
222 | "mime-types": {
223 | "version": "2.1.19",
224 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz",
225 | "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==",
226 | "requires": {
227 | "mime-db": "1.35.0"
228 | }
229 | },
230 | "oauth-sign": {
231 | "version": "0.8.2",
232 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
233 | "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM="
234 | },
235 | "performance-now": {
236 | "version": "2.1.0",
237 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
238 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
239 | },
240 | "psl": {
241 | "version": "1.1.28",
242 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.28.tgz",
243 | "integrity": "sha512-+AqO1Ae+N/4r7Rvchrdm432afjT9hqJRyBN3DQv9At0tPz4hIFSGKbq64fN9dVoCow4oggIIax5/iONx0r9hZw=="
244 | },
245 | "punycode": {
246 | "version": "1.4.1",
247 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
248 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
249 | },
250 | "qs": {
251 | "version": "6.5.2",
252 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
253 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
254 | },
255 | "request": {
256 | "version": "2.87.0",
257 | "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz",
258 | "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==",
259 | "requires": {
260 | "aws-sign2": "0.7.0",
261 | "aws4": "1.7.0",
262 | "caseless": "0.12.0",
263 | "combined-stream": "1.0.6",
264 | "extend": "3.0.2",
265 | "forever-agent": "0.6.1",
266 | "form-data": "2.3.2",
267 | "har-validator": "5.0.3",
268 | "http-signature": "1.2.0",
269 | "is-typedarray": "1.0.0",
270 | "isstream": "0.1.2",
271 | "json-stringify-safe": "5.0.1",
272 | "mime-types": "2.1.19",
273 | "oauth-sign": "0.8.2",
274 | "performance-now": "2.1.0",
275 | "qs": "6.5.2",
276 | "safe-buffer": "5.1.2",
277 | "tough-cookie": "2.3.4",
278 | "tunnel-agent": "0.6.0",
279 | "uuid": "3.3.2"
280 | },
281 | "dependencies": {
282 | "tough-cookie": {
283 | "version": "2.3.4",
284 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz",
285 | "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
286 | "requires": {
287 | "punycode": "1.4.1"
288 | }
289 | }
290 | }
291 | },
292 | "request-promise": {
293 | "version": "4.2.2",
294 | "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.2.tgz",
295 | "integrity": "sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=",
296 | "requires": {
297 | "bluebird": "3.5.1",
298 | "request-promise-core": "1.1.1",
299 | "stealthy-require": "1.1.1",
300 | "tough-cookie": "2.4.3"
301 | }
302 | },
303 | "request-promise-core": {
304 | "version": "1.1.1",
305 | "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz",
306 | "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=",
307 | "requires": {
308 | "lodash": "4.17.10"
309 | }
310 | },
311 | "safe-buffer": {
312 | "version": "5.1.2",
313 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
314 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
315 | },
316 | "safer-buffer": {
317 | "version": "2.1.2",
318 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
319 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
320 | },
321 | "sshpk": {
322 | "version": "1.14.2",
323 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz",
324 | "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=",
325 | "requires": {
326 | "asn1": "0.2.3",
327 | "assert-plus": "1.0.0",
328 | "bcrypt-pbkdf": "1.0.2",
329 | "dashdash": "1.14.1",
330 | "ecc-jsbn": "0.1.2",
331 | "getpass": "0.1.7",
332 | "jsbn": "0.1.1",
333 | "safer-buffer": "2.1.2",
334 | "tweetnacl": "0.14.5"
335 | }
336 | },
337 | "stealthy-require": {
338 | "version": "1.1.1",
339 | "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
340 | "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
341 | },
342 | "tough-cookie": {
343 | "version": "2.4.3",
344 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
345 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
346 | "requires": {
347 | "psl": "1.1.28",
348 | "punycode": "1.4.1"
349 | }
350 | },
351 | "tunnel-agent": {
352 | "version": "0.6.0",
353 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
354 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
355 | "requires": {
356 | "safe-buffer": "5.1.2"
357 | }
358 | },
359 | "tweetnacl": {
360 | "version": "0.14.5",
361 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
362 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
363 | "optional": true
364 | },
365 | "uuid": {
366 | "version": "3.3.2",
367 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
368 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
369 | },
370 | "verror": {
371 | "version": "1.10.0",
372 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
373 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
374 | "requires": {
375 | "assert-plus": "1.0.0",
376 | "core-util-is": "1.0.2",
377 | "extsprintf": "1.3.0"
378 | }
379 | }
380 | }
381 | }
382 |
--------------------------------------------------------------------------------
/nodeselector/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nodeselector",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "request": "^2.87.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/nodeselector/test.js:
--------------------------------------------------------------------------------
1 | const {NodeSelector} = require('./nodeselector.js');
2 |
3 |
4 | let test = new NodeSelector();
5 |
6 | //get node list (https only)
7 | //
8 | // test.get_nodes({https_only:true}).then(
9 | // list=> console.log(list) ).catch(e=>{});
10 |
11 |
12 | async function xxx(){
13 |
14 | //get fastest node
15 | let fastest = await test.get_fastest_node();
16 | console.log(fastest);
17 | console.log('this is printed after you get the fastest node')
18 | }
19 |
20 | xxx()
--------------------------------------------------------------------------------
/utilities/bpinfo.php:
--------------------------------------------------------------------------------
1 | url);
12 | curl_setopt($ch, CURLOPT_POST, 1);
13 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postdata);
14 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
15 | $output = curl_exec ($ch);
16 | curl_close ($ch);
17 |
18 | $d = json_decode($output);
19 |
20 | usort($d->rows, function($first,$second){
21 | return $first->total_votes < $second->total_votes;
22 | });
23 |
24 | $top21 = array_slice($d->rows, 0, 21);
25 | // print_r($top21);
26 | $alljson = array();
27 | foreach ($top21 as $bp){
28 | $json_file = @file_get_contents($bp->url.'/bp.json');
29 | if ($json_file !== false) {
30 | $bpdata = json_decode($json_file,true);
31 | }
32 | array_push($alljson, $bpdata);
33 | // echo $bp->url.'/bp.json
';
34 | }
35 | // echo json_encode($alljson);
36 | //echo count($alljson);
37 | //print_r($alljson);
38 | return $alljson;
39 | }
40 |
41 | public function getPublicNodes($bpdata)
42 | {
43 | $public_nodes = array();
44 | foreach ($bpdata as $bpindex => $bp) {
45 | if ($this->debug) {
46 | print "==== " . $bp['producer_account_name'] . " ====\n";
47 | }
48 | $public_node = '';
49 | if (array_key_exists('nodes', $bp)) {
50 | foreach ($bp['nodes'] as $nodeindex => $node) {
51 | if ($public_node == "" && array_key_exists('ssl_endpoint', $node) && $node['ssl_endpoint'] != '') {
52 | $public_node = $node['ssl_endpoint'];
53 | }
54 | if ($public_node == "" && array_key_exists('api_endpoint', $node) && $node['api_endpoint'] != '') {
55 | $public_node = $node['api_endpoint'];
56 | }
57 | }
58 | }
59 | if ($public_node != '') {
60 | $public_node = strip_tags($public_node);
61 | if (substr($public_node, 0,4) != 'http') {
62 | $public_node = 'http://' . $public_node;
63 | }
64 | $public_nodes[] = $public_node;
65 | }
66 | if ($this->debug) {
67 | print $public_node . "\n";
68 | }
69 | }
70 | return $public_nodes;
71 | }
72 | }
73 |
74 | $bpinfo = new eosBPinfo();
75 | $bpdata = $bpinfo->getTop21BP();
76 |
77 | // output unified JSON of the top 21 BPs
78 | $bpdata_json = json_encode($bpdata);
79 | $topbps_file = 'topbps.json';
80 | $fp = fopen($topbps_file, 'w');
81 | fwrite($fp,$bpdata_json);
82 | fclose($fp);
83 |
84 | // output nodes of the top 21 BPs
85 | $nodes = $bpinfo->getPublicNodes($bpdata);
86 | $nodes_json = json_encode($nodes);
87 | $topnodes_file = 'topnodes.json';
88 | $fp = fopen($topnodes_file, 'w');
89 | fwrite($fp,$nodes_json);
90 | fclose($fp);
91 |
92 | //var_dump($nodes);
93 |
--------------------------------------------------------------------------------