Merge pull request #29 from cubedro/develop

Fixed propagation time and pending txs
This commit is contained in:
Marian OANCΞA 2015-04-03 00:08:49 +03:00
commit b908be66e9
5 changed files with 29 additions and 12 deletions

View File

@ -3,7 +3,7 @@
# update repository & install dependencies
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y git mercurial build-essential software-properties-common wget pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev nodejs npm
sudo apt-get install -y git mercurial build-essential software-properties-common wget pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev nodejs npm ntp
# add ethereum repos
sudo add-apt-repository -y ppa:ethereum/ethereum-qt
@ -29,3 +29,12 @@ npm install
npm install pm2 -g
cp -b ./processes-go.json ./../processes.json
# set up time update cronjob
cat > /etc/cron.hourly/ntpdate << EOF
#!/bin/sh
sudo service ntp stop
sudo ntpdate -s ntp.ubuntu.com
sudo service ntp start
EOF
sudo chmod 755 /etc/cron.hourly/ntpdate

View File

@ -16,7 +16,7 @@ sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential g++-4.8 git cmake libboost-all-dev automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons libncurses5-dev libcurl4-openssl-dev wget qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev libjsoncpp-dev libargtable2-dev clang-3.5 lldb-3.5 nodejs npm
sudo apt-get -y install build-essential g++-4.8 git cmake libboost-all-dev automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons libncurses5-dev libcurl4-openssl-dev wget qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev libcryptopp-dev libjson-rpc-cpp-dev libmicrohttpd-dev libjsoncpp-dev libargtable2-dev clang-3.5 lldb-3.5 nodejs npm ntp
# add node symlink
sudo ln -s /usr/bin/nodejs /usr/bin/node
@ -55,3 +55,11 @@ npm install
npm install pm2 -g
cp -b ./processes.json ./..
# set up time update cronjob
cat > /etc/cron.hourly/ntpdate << EOF
#!/bin/sh
sudo service ntp stop
sudo ntpdate -s ntp.ubuntu.com
sudo service ntp start
EOF
sudo chmod 755 /etc/cron.hourly/ntpdate

View File

@ -2,7 +2,7 @@
trap "exit" INT
if [ -f /usr/bin/ethereum ]
then
ethereum -rpc true
geth --rpc true
else
eth -x 15 -l 30303 -n off -m off -v 1 -j
fi

View File

@ -100,7 +100,7 @@ function Node()
console.error('Socket connection closed');
})
.on('error', function error(err) {
console.error(err);
console.error("socket:", err);
})
.on('reconnecting', function reconnecting(opts) {
console.warn('We are scheduling a reconnect operation', opts);
@ -143,7 +143,7 @@ Node.prototype.isActive = function()
code: '1',
msg: err
});
console.error(err);
console.error("peerCount:", err);
}
this.stats.active = false;
@ -177,13 +177,13 @@ Node.prototype.getBlock = function(number)
code: '3',
msg: err
});
console.error(err);
console.error("blockNumber:", err);
}
}
try {
block = web3.eth.getBlock(number, true);
block.arrival = Date.now();
block.arrival = (new Date()).getTime();
block.propagation = block.arrival - (block.timestamp * 1000);
if(block.hash != '?' && typeof block.difficulty !== 'undefined')
@ -196,7 +196,7 @@ Node.prototype.getBlock = function(number)
code: '2',
msg: err
});
console.error(err);
console.error("getBlock:", err);
}
return block;
@ -310,7 +310,7 @@ Node.prototype.getStats = function()
try {
this.stats.pending = web3.eth.getBlockTransactionCount('pending');
} catch (err) {
console.error(err);
console.error("getBlockTransactionCount('pending'):", err);
}
this.stats.mining = web3.eth.mining;
this.stats.gasPrice = web3.eth.gasPrice.toString(10);
@ -392,7 +392,7 @@ Node.prototype.emit = function(message, payload)
socket.emit(message, payload);
}
catch (err) {
console.error(err);
console.error("socket.emit:", err);
}
}
}

View File

@ -3,10 +3,11 @@
"name" : "eth",
"cwd" : "/home/ubuntu/bin/www/",
"script" : "bin/eth.sh",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"log_file" : "/home/ubuntu/logs/eth-log.log",
"out_file" : "/home/ubuntu/logs/eth-out.log",
"error_file" : "/home/ubuntu/logs/eth-err.log",
"merge_logs" : true,
"merge_logs" : false,
"watch" : false,
"cron_restart" : "0 0 * * *",
"exec_interpreter" : "bash",
@ -21,7 +22,6 @@
"error_file" : "/home/ubuntu/logs/node-app-err.log",
"merge_logs" : true,
"watch" : false,
// "cron_restart" : "0 0 * * *",
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":