webdollar / node-webdollar Goto Github PK
View Code? Open in Web Editor NEWWebDollar Protocol - Currency of the Internet
Home Page: http://WebDollar.io
License: MIT License
WebDollar Protocol - Currency of the Internet
Home Page: http://WebDollar.io
License: MIT License
this prevents miner from swtiching to the outer fork
0|WebD | TypeError: Cannot read property 'length' of undefined
0|WebD | at MiniBlockchainTransactionFrom.calculateInputSum (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:15350:44)
0|WebD | at MiniBlockchainTransaction._processTransactionFees (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:9666:34)
0|WebD | at MiniBlockchainTransaction.processTransaction (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:10097:22)
0|WebD | at MiniBlockchainFork.preFork (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:12373:57)
0|WebD | at Object.success.blockchain.semaphoreProcessing.processSempahoreCallback [as callback] (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:6786:26)
0|WebD | at <anonymous>
0|WebD | at process._tickCallback (internal/process/next_tick.js:188:7)
0|WebD | blockchainForks preFork raised an error
Hi, I haven't been able to get anything related to the browser building to work like:
npm run build_browser
I keep getting this error related to argon2
ERROR in ./node_modules/argon2-browser/dist/argon2.wasm Module parse failed: Unexpected character '' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file) @ ./node_modules/argon2-browser/lib/argon2.js 82:35-65 @ ./src/common/crypto/Argon2/Argon2.js @ ./src/tests/crypto/Argon2.test.js @ ./src/tests/main.test.js
I am on Centos7, all of my development tools are up to date. I tried redownloading the package and even trying different versions and I get the same thing. Wasn't able to build argon2 from the source because for some reason my environmental variables CMAKE_MAKE_PROGRAM , CMAKE_C_COMPILER , CMAKE_CXX_COMPILER aren't set for some reason.
Thanks!
there is a call of non-existent function here hidden by the empty catch block
TypeError: this.blockchain.transactions.pendingQueue.findPendingIdenticalTransaction is not a function
at TransactionsDownloadManager._createTransaction
findPendingIdenticalTransaction is not declared in TransactionsPendingQueue
It looks like the domain detection code does not take into account wildcard domains.
See:
I installed the Node on a few units. A) Celleron CPU, Ryzen 5, AMD i5
No Matter what processor I only get approx 500-600 H/s.
The Browser based on the Ryzen5 and I 5 get about 1800H/s
I cant find any parameter for the node to increase the "power" usage of the CPUs to get a better node perfomance
Any suggestions, please would be appreciated
When I run npm run start_mining
in Terminal tested on Unix
The Wallet loadAddresses
freezes and never gets a resolved Promise. It always shows me the error message in terminal from the 10 second timeout.
//timeout, max 10 seconds to load the database
setTimeout(()=>{
console.log(colors.red("LOAD ADDRESSES FROZE AND FAILED !!"));
resolve(false);
}, 10000);
let buffer = await this.db.get(this.walletFileName); // never gets resolved
Any Idea? @s1lviu @opreacosmind
LE: In Browser it works perfectly!!!
What does this mean?
⚠ Error Including Transaction { message: 'Nonce is not right 2',
myNonce: 3,
nonce: null,
txId: '4301b0b2d2d2be1e7bedc4fce6d9ca0e2ac82ee7e15359d0969e2d1d4bed0f49' }
⚠ Error Including Transaction TypeError: Cannot read property 'node' of undefined
at Function.broadcastRequest (/home/webd/MiningPool1/dist_bundle/terminal-menu-bundle.js:6663:40)
at InterfaceBlockchainTransactionsProtocol.propagateNewMissingNonce (/home/webd/MiningPool1/dist_bundle/terminal-menu-bundle.js:24454:110)
at TransactionsPendingQueue.propagateMissingNonce (/home/webd/MiningPool1/dist_bundle/terminal-menu-bundle.js:24161:39)
at MiningTransactionsSelector.selectNextTransactions (/home/webd/MiningPool1/dist_bundle/terminal-menu-bundle.js:31600:79)
at <anonymous>
4301b0b2d2d2be1e7bedc4fce6d9ca0e2ac82ee7e15359d0969e2d1d4bed0f49 WEBD$gC4vLB$Y0S0KrBCUMhqbot10$27xi46dqz$
4301b0b2d2d2be1e7bedc4fce6d9ca0e2ac82ee7e15359d0969e2d1d4bed0f49 ------- GOOD tx
I think the main Mining Address should be saved in a separate file.
Before the PoS fork, the average block time was ~ 42s.
After the PoS fork, the average block time is ~45s.
Show me the math:
// Before PoS fork:
new Date("Wed, 30 Jan 2019 05:40:35 GMT")-new Date(1524743407 * 1000))/1000/(567810
// 42.4 s
// After PoS fork:
(new Date() - new Date("Wed, 30 Jan 2019 05:40:35 GMT"))/1000/(608372-567810)
// 45.3 seconds
Hi,
Could be easy to implement this?
looking into src/main-blockchain/wallet/Main-Blockchain-Wallet.js
Can
https://github.com/WebDollar/User-Interface-WebDollar/blob/df82421f4dc37fb58e45c987799ec52fa2b8037e/src/components/Wallet/Address/Address.vue#L137
function be called from there to auto download wallets ?
the conversion of Number to Buffer doesn't always work the way you expect thus giving you the wrong hash
> Buffer.from((0xAB).toString(16), 'hex').toString('hex');
'ab'
> Buffer.from((0xABC).toString(16), 'hex').toString('hex');
'ab'
> Buffer.from((0xABCD).toString(16), 'hex').toString('hex');
'abcd'
> Buffer.from((0xABCDE).toString(16), 'hex').toString('hex');
'abcd'
read this nodejs/node#21242 for details
� Pool Work Management raised an error { message: 'block was incorrectly mined',
work:
{ result: false,
hash: <Buffer 00 00 1a 25 a2 31 c1 ce ec ec 21 0c de 5d 8a 54 ba 4e 50 38 bb ed 4d e3 50 45 ea ec ea 14 ee 9d>,
nonce: 1018608,
id: 31 } }
Hello,
I do not want to run the WebDollar code, as I would like to refactor this part, as this code is core to what happens in the blockchain and it should be kept as loosely coupled as possible.
I have run the following and got the attachment data for block01 of webdollar blockchain
blockchainDB.get("block0", {attachments: true, include_docs: true}, function (err,doc) {data = doc._attachments.key.data})
Variable data looks like this:
data
'MDAwMDdlMzAxMzcxMWJjMTI2YTg3MDhhMzI0NDcyZmRmY2Y2ODU1Y2VmMWY5NzliMGRmNDM0NzVjOTU2OGUzMzAwMDBlNzI0MDAwMTczMWQ0NmMxMzFlYjZkZDQ2NjdhOTZiZGMyN2JhZjkyMjNiZWM3MmMzNDY4ZGZiNmJhNTJjNDYwZTc2NDIzYTQwMDAwMDQ0NzZjMWQzNTViMDMyMDU0MTIyMDQ4MDRlNDI3ZjlhNTZkZTE1ZjEwZjBjODBmYzUzMGZlY2RlOWE0OGFlNmFlZGU4NjFlOTkwM2U1NDIyZjdjMTExMzU4MDMyZGZlNmNhMzdhYWQ4YmRkNWRmNmUwZTI3NjEzNTlkMzBhODI3NTA1OGUyOTlmY2MwMzgxNTM0NTQ1ZjU1Y2Y0M2U0MTk4M2Y1ZDRjOTQ1NjAwMDAwMDAwMGExY2ZjZWIyMTVhZWFjNDZjMGI3ZWVhMGQ1ZGE5ZGVmZDkyN2UyNDUwNGI3NTdlNmMzZDM3MDI4NTNjOWM5OTAxMDAwMDAxNzMxZDQ2YzEzMWViNmRkNDY2N2E5NmJkYzI3YmFmOTIyM2JlYzcyYzM0NjhkZmI2YmE1MmM0NjBlNzY0MjNhNA=='
I would like now to deserialize it using the minimum noncluttered nodejs code and obtain the timestamp and previous hash, for example.
Got the code from:
function deserializeNumber(buffer){
if(buffer.length === 1) return buffer[0]; else
if (buffer.length === 2) return buffer[1] | (buffer[0] << 8); else
if (buffer.length === 3) return buffer[2] | (buffer[1] << 8) | (buffer[0] << 16); else
if (buffer.length === 4) return buffer[3] | (buffer[2] << 8) | (buffer[1] << 16) | (buffer[0] << 24); else
if (buffer.length === 6) return buffer[5] | (buffer[4] << 8) | (buffer[3] << 16) | (buffer[2] << 24) | (buffer[1] << 32) | (buffer[0] << 40);
}
function substr(buffer, index, count){
if (count === undefined)
count = buffer.length;
let length = Math.min(index + count, buffer.length);
if (length-index <= 0)
throw {message: "length-index <= 0...", buffer: buffer.toString("hex"), index:index, length:length, count: count};
let buf = new Buffer(length-index);
buffer.copy(buf, 0, index, length);
return buf;
}
buffer = Buffer.from(data, 'base64')
According to
I got a value but it is definitely not the one I am looking for:
substr(buffer, 0 + 32 + 4 +2, 32).toString("hex")
'3563656631663937396230646634333437356339353638653333303030306537'
I also get a very bad timestamp:
deserializeNumber(substr(buffer, 0 + 32 + 4 +2+32, 4))
842281008
Any help would be appreciated.
Thanks.
Issue is is function static getDifficultyMean( getDifficultyCallback, getTimeStampCallback, blockTimestamp, blockNumber)
The formula for calculating total time it took to mine last 10 blocks doesn't consider the timestamp of (firstblock -1)
. e.g, for calculating time it took to mine first block it would need to subtract timestamp of previous block from the timestamp of first block.
Even more , adding all the timestamps(firstblock to blocknumber(or firstblock+9)) and than subtrating 10x timestamp of firstblock is not a correct formula for getting the time it took to mine all the blocks.
A more direct formula would only include timestamps of previous block before firstblock and blocknumber(last block generated before hitting next%10==0). It is enough to just subtract these 2 timestamps in order to get the time that passed in between.
This keeps coming up while solo mining WebDollar on Linux Ubuntu 18, in terminal.
couldn't get level TypeError: Cannot read property 'difficultyTarget' of undefined
After this exception, the hashrate goes down to 0 hashes/s.
Also: BAAAAAANNNNS and BAAAAAAAAAAAN keeps coming up.
I am very disappointed with the general coding and development direction of this project.
My two cents on what has to be done so that webdollar becomes coding friendly:
Please add more to the list, if you consider so.
Personally, I will not contribute to the webdollar project if the above are not done ASAP, as I consider it a waste of time and resources.
Thanks.
Replication steps:
npm run commands
, select 8
, the express server starts on port 3333
npm run start_mining
, the express server starts on port 80
I believe this is inconsistent.
This is unreachable code since process.env is an object.
Lines 13 to 16 in 618a641
So, it looks like at one point webdollar.ddns.net:9094 was running, and that is where new mining pools default to. Looks like it hasn't been running for years though, and this isn't mentioned at all in the documentation or fixed. Just curious how I can get around this?
after 200-300 transactions with a walletu wallet are blocked and no longer traded
Test steps:
1
open http://webdollar.io/ in Firefox 58.0.2 (64-bit)
open http://webdollar.io/ in Google Chrome 64.0.3282.140 (64-bit)
2
Wait 1-5 minutes in order to mine a few units.
3
Check each wallet's amount.
4
Use download wallet functions to save each browser's wallet(walletFirefox and walletChrome)
Delete wallets from each browser.
5
Import walletFirefox in Firefox
Import walletChrome in Google Chrome
6
Check each wallet's amount.
Expected : same as step 3.
Obtained: same as step 3.
7
Stop mining to wallets tested
8
Import walletFirefox in Google Chrome
Import walletChrome in Firefox
9
Check each wallet's amount.
Expected : same as step 3.
Obtained: zero(0) !!!
It looks that the wallet is browser dependent. When imported in same browser from where it was created, the synchronizing with the network is done.
When changing browser for a wallet, the amount of units is set to zero. It's just like the imported address is a new one. May be a formatting issue with the address, I think. I haven't checked the code, is just an assumption.
How can we create a mining pool?
0|WebD | ✘ ERROR serializing block: TypeError: Cannot read property 'length' of undefined
0|WebD | at MiniBlockchainTransactionFrom.serializeFrom (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:15429:132)
0|WebD | at MiniBlockchainTransaction._serializeTransaction (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:10001:23)
0|WebD | at MiniBlockchainTransaction.serializeTransaction (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:9982:21)
0|WebD | at InterfaceBlockchainBlockDataTransactions.serializeTransactions (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:23542:48)
0|WebD | at MiniBlockchainBlockData._computeBlockDataHeaderPrefix (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:10574:31)
0|WebD | at MiniBlockchainBlockData._computeBlockDataHeaderPrefix (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:27340:74)
0|WebD | at MiniBlockchainBlockData.serializeData (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:10589:18)
0|WebD | at MiniBlockchainBlock._computeBlockHeaderPrefix (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:6070:64)
0|WebD | at MiniBlockchainBlock._computeBlockHeaderPrefix (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:27025:171)
0|WebD | at MiniBlockchainBlock.serializeBlock (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:6138:14)
mine WebDollar in a Linux terminal. but . I found out that argon2-bench2 process was lost after a few hours. pow is 0H/s .
why argon2-bench2 process lost ?
TOP
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1082774 root 20 0 453448 2716 1268 S 84.1 0.0 235:45.47 argon2-bench2
2191669 konds 20 0 1184284 192124 121484 S 1.3 1.2 21:29.18 chrome
2191706 konds 20 0 558636 117640 72284 S 1.0 0.7 36:34.18 chrome
3137 konds 20 0 2309476 192560 63828 S 0.7 1.2 17:12.53 gnome-shell
1080877 root 20 0 2177296 667544 38404 S 0.7 4.1 1:51.21 node
root@konds:# ps auxf | grep -i argon2-bench2#
root 1091216 0.0 0.0 14532 956 pts/2 S+ 18:57 0:00 _ grep -i argon2-bench2
root 1082773 0.0 0.0 4292 748 pts/1 S+ 17:36 0:00 | _ /bin/sh -c ./dist_bundle/CPU/argon2-bench2 -d 0 -c 6 -b 30000 -f ./dist_bundle/CPU/input.txt0.78002621121191450
root 1082774 291 0.0 453448 2716 pts/1 Rl+ 17:36 236:53 | _ ./dist_bundle/CPU/argon2-bench2 -d 0 -c 6 -b 30000 -f ./dist_bundle/CPU/input.txt0.78002621121191450
root@konds:
rgon2-bench2 process was lost after a few hours. pow is 0H/s
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1008884 konds 20 0 2165720 712864 204700 S 11.0 4.4 20:32.99 chrome
2191706 konds 20 0 589664 138948 86748 S 8.0 0.9 49:19.99 chrome
2975 konds 20 0 294360 44048 19200 S 3.3 0.3 22:22.60 Xorg
3137 konds 20 0 2335560 219188 82692 S 3.3 1.3 22:06.67 gnome-shell
1080877 root 20 0 2203352 709044 36848 S 2.3 4.3 6:28.96 node
3148 konds 9 -11 1702492 12708 9456 S 1.7 0.1 1:49.77 pulseaudio
2191669 konds 20 0 1574048 214316 122344 S 1.7 1.3 23:12.76 chrome
2445 root 20 0 515168 79048 10772 S 1.0 0.5 6:17.34 pvestatd
2191714 konds 20 0 554332 91524 59540 S 1.0 0.6 2:12.71 chrome
2191906 konds 20 0 831352 138396 62180 S 0.7 0.8 7:23.14 chrome
490 root -2 0 0 0 0 S 0.3 0.0 0:41.77 i915/signal:0
1736 debian-+ 20 0 188340 7280 6064 S 0.3 0.0 0:26.38 transmission-da
2453 root 20 0 517052 80816 10644 S 0.3 0.5 2:14.86 pve-firewall
1107116 root 20 0 46948 3776 3104 R 0.3 0.0 0:00.02 top
2437322 root 20 0 46916 4116 3136 S 0.3 0.0 7:44.65 top
1 root 20 0 205060 7500 5396 S 0.0 0.0 0:28.31 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.16 kthreadd
root@konds:# ps auxf | grep -i argon2-bench2#
root 1108018 0.0 0.0 14532 1028 pts/2 S+ 21:10 0:00 _ grep -i argon2-bench2
root@konds:
Changes in commit 644b3a3 cause new nodes on previously unused ports to not receive any incoming connections. Nodes using commit 94e7fb0 and prior versions do receive incoming connections. I have tested a node on each commit and 94e7fb0 has 10 connections to other nodes but 0 connections from other nodes after 8 hours. All versions since commit 94e7fb0 exhibit this behavior.
It is important to understand that any node that has recently run a version prior to 94e7fb0 and since upgraded to a newer version will have incoming connections because it's address has already propagated from the working version. But a new node on a new port with version 94e7fb0 or later will not have incoming connections. Nodes listed on the fallback list are an exception since they are discovered by default.
To reproduce:
npm install using commit 644b3a3. Start mining using a previously unused port (do NOT use a standard port: 80, 443 etc).
too many forks, please solve this problem. My pool goes into fork and twice a day. it is not normal.
There is a duplicate of information in the PoS block structure:
{ $where : "this.algorithm == 'pos' && this.resolver != '' && this.resolver2 != '' &&this.resolver2 != this.resolver" } --> this query always returns empty set of results.
resolver !="" on PoS blocks
when resolver2 != "", resolver == resolver2
There seems to be some kind of issue on the following code, which seems to not be restarting the worker correctly.
Whenever there is a POW round, and the computer has another program running at the same time, the worker stops generating hashes, it hangs for a while, then it shows the message that it's "Restarting Worker". Sometimes it shows one hash, and then hangs again, or it just hangs, generating no hashes at all, only to be restarted again, and the cycle repeats.
I know, the issue may be caused by using resources at the same time as the miner is trying to use them, causing a racing condition, which would be my fault, and that's a fair point. But, even if I free the cpu by closing everything, and keeping the miner open, the issue persists, failing to restart again, which at that point, makes it an issue with the miner, since the resources are available, it's just refusing to use them for some reason, possibly not restarting properly.
What I believe may be a solution to this, is using the code I changed on #348 , to stop mining completely, and then initialize the workers again, which would be a proper restart in my opinion, but since I'm not entirely familiar with the miner, and even less so with the inner workings of node.js, I'm not sure if that would solve it, or cause even more issues, heck, I'm not also entirely sure if #348 may have caused this or if I only started noticing this now, since I'm paying more attention now to the miner
Due to that, i'm just creating this issue for the time being, waiting for a opinion from someone who has more understanding on the matter.
Pool Administration
A bunch of new transactions is created via API and added to the miner pending queue. Shorty after that they either silently disappear like that
⚠ --------------------------------
⚠ pendingQueue 25
⚠ Transactions selected for mining: 25
⚠ --------------------------------
....
✘ block 296284 was not mined...
⚠ --------------------------------
⚠ pendingQueue 0
⚠ Transactions selected for mining: 0
⚠ --------------------------------
or in 10% cases the error is shown (honestly, the random logging approach just makes issue tracking unnecessary complicated)
⚠ Old Transaction removed because of exception { message: 'Nonce is not right',
myNonce: 1,
nonce: 2,
txId: 'a43354340e27773141f5145aeaa4476b7f2de03e6e45645d8a8ac33548372497' }
but I'm quite sure transactions were valid upon creation and inclusion to the pending queue a minute before which means there must be some mistake in the nonce calculation/validation logic.
can it be somehow connected to the nonce computation logic in MiniBlockchainTransaction ?
We want to change the transaction structure in order to be allow to each transaction to contain an 255 bytes messages;
Here is the branch https://github.com/WebDollar/Node-WebDollar/tree/tx-text
If you're interested to join this, let me know on telegram: @ionutalexpanait
Calls to the /wallets/import
endpoint fail with {"result":false,"message":"Address already exists!"}
, regardless of the privateKey
parameter.
0|WebD | ⚠ ----------------------------------------------------------------------------
0|WebD | ⚠ WebDollar Block was mined 286853 nonce ( 2151404650) 00000000519de640197b339687e4db296ee5efc6ca5b3d588aeb1d68d3b59b7b reward 6000 WEBD 3564a019aaf0306d5b5a76d9251cec8e84604d33
0|WebD | ⚠ ----------------------------------------------------------------------------
0|WebD | ✘ MiniBlockchain simulateNewBlock 1 raised an exception at blockHeight 286853 Error: [BigNumber Error] Number primitive has more than 15 significant digits: 336.34999999962747
0|WebD | at new BigNumber (/home/ubuntu/webdollar/node_modules/bignumber.js/bignumber.js:312:27)
0|WebD | at BigNumber.P.dividedToIntegerBy.P.idiv (/home/ubuntu/webdollar/node_modules/bignumber.js/bignumber.js:1569:31)
0|WebD | at InterfaceBlockchainBlocks.recalculateNetworkHashRate (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:23388:30)
0|WebD | at MainBlockchain._onBlockCreated (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:14184:25)
0|WebD | at MainBlockchain._onBlockCreated (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:13653:107)
0|WebD | at MainBlockchain.includeBlockchainBlock (/home/ubuntu/webdollar/dist_bundle/terminal-bundle.js:14163:20)
0|WebD | at <anonymous> { height: 286853,
Caching serialized transaction makes it impossible to generate more than one "from".
The first call of Address.signTransaction makes transaction to be serialized and cached. The rest of signatures remain empty in the serialized presentation -> transaction is not valid.
Changes made with this commit imply that named path parameters are always used:
on the other hand private API routing does not defined any named parameters:
so there is no way to pass URL parameters to the private API methods which makes them unusable.
P.S. Just my five cents - REST methods like wallets/create-transaction or wallets/import are typically called using POST.
A implementation of a protocol for miners that mine on consensus (not a pool) to process transfer tx set by a % by the user.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.