GithubHelp home page GithubHelp logo

blockchain's People

Contributors

0xs34n avatar aitorjs avatar mattisg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockchain's Issues

Web UI

Hi, I run this project locally, but it is giving the functionality on CLI only, as you have shown on the website, the UI is a separate application? Can you give me a little guidance how did you developed the web interface to demonstrated all this on the web application very well. Thanks
@seanjameshan

error after command $npm start

node ./index.js

internal/modules/cjs/loader.js:584
throw err;
^

Error: Cannot find module 'wrtc'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users\astrea\blockchain\P2p.js:1:76)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node ./index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\extra\AppData\Roaming\npm-cache_logs\2019-03-28T05_00_46_463Z-debug.log

please help me out of this error as soon as possibel

File name issue in Linux

.js file name(block.js) throws error in linux systems as it is case sensitive. Maybe it helps someone. Renaming file resolves the issue

Longer Valid Chain Data Replacement Issue on blockchain demo website.

When a longer valid chain is created which differs from other smaller chains, the data of the longer chain is not replacing the data of shorter chains (though, the hashes are replaced).
Suppose 3 peers have 5 blocks, all in sync and then another peer joins and creates 7 blocks with blocks different from other peers. Here the longer valid blockchain should replace the smaller blockchains. But only the hashes are replaced, and the data remains the same. Only new blocks 6th and 7th get added to all other peers' blockchains. Their 1-5 blocks contain the same data (Hashes are replaced by those from the longer valid chains).

Invalid Magic Value

Hi, I've an error when I try to connect a peer to the network, the error is "Invalid magic value, peer not using PXP" What should I do? Thanks

where is de UI?

hi! I downloaded the project but is only CLI, you will upload UI source?

thanks!

High CPU on OS X

The code in nodejs or the web version (chrome), both use very high cpu.
Im using:
OS X High Sierra v10.13.1
NODEJS v6.12.0
CHROME v62.0.3202.94 (Official Build) (64-bit)

Question: Block sync

Let's say Peer P1 added a block called B1 to its blockchain and another peer P2 added a block B2 to its blockchain. After this, if both the peers are connected, then will the blockchain be synced between them?

I was expecting both the peers would have both the blocks, i.e, B1 and B2. Am I right?

Const syntax fails in start in P2p.js

const {
REQUEST_LATEST_BLOCK,
RECEIVE_LATEST_BLOCK,
REQUEST_BLOCKCHAIN,
RECEIVE_BLOCKCHAIN,
REQUEST_TRANSACTIONS,
RECEIVE_TRANSACTIONS
} = messageType;

This code block causes error with nodejs 6 and 5 on Ubuntu 16.04 system.

const {
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at Object. (/home/semih/mytone/blockchain/cli.js:2:13)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)

npm ERR! Linux 4.10.0-40-generic
npm ERR! argv "/home/semih/.nvm/versions/node/v5.12.0/bin/node" "/home/semih/.nvm/versions/node/v5.12.0/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node ./index.js
npm ERR! Exit status 1

Question: What's the difference between a peer and a miner?

I am a bit confused between peers and miners. I know that peers are the ones which have the entire blockchain with them and whenever a new block comes, it is broadcast to all peers, and the peers check the validity and finally add it to the blockchain.

Now I am confused as to who introduces the new block? I see the code which adds a new block which then gets broadcast to all peers but what I do not understand is, who calls the mineCommand()?

function mineCommand(vorpal) {
  vorpal
    .command('mine <data>', 'Mine a new block. Eg: mine hello!')
    .alias('m')
    .action(function(args, callback) {
      if (args.data) {
        blockchain.mine(args.data);
        p2p.broadcastLatest(); 
      }
      callback();
    })
}

From the UI, I get an impression that a peer is the one adding a new block but from the code it doesn't seem so.

Disconnecting and reconnecting peers block data bug

When disconnecting a peer, adding some blocks and reconnecting, the blockchain replacement sometimes doesn't replace the block data. It keeps the previous value, but if you change it to what it should be, the hash remains valid (and you don't need to mine it).

Say for instance I have a peer Satoshi and Humberto, which are connected and both have the same blockchain with 4 blocks. If I disconnect Humberto, add a block 'Humberto 1' to it, and add two blocks to Satoshi (say, 'Satoshi 1' and 'Satoshi 2'), when reconnecting, Humberto has the same blockchain as Satoshi, but instead of having a block say 'Satoshi 1' it says 'Humberto 1'. If you change this block's data to 'Satoshi 1', the block will be valid without needing to mine it.

It probably is just a visualization issue, but it does lead to some confusion. Hope this helps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.