Skip to content

Instantly share code, notes, and snippets.

@daviddias
Last active September 15, 2016 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daviddias/9205784d3d05a0cc2153ab899432999b to your computer and use it in GitHub Desktop.
Save daviddias/9205784d3d05a0cc2153ab899432999b to your computer and use it in GitHub Desktop.
message Message {
message Wantlist {
repeated Entry entries = 1; // a list of wantlist entries
optional bool full = 2; // whether this is the full wantlist. default to false
message Entry {
optional bytes block = 1; // the block key
optional bool cancel = 2; // whether this revokes an entry
}
}
optional Wantlist wantlist = 1;
repeated bytes blocks = 2;
}
wanderer> first create a blockchain instance https://github.com/ethereumjs/ethereumjs-vm/blob/master/tests/blockchainRunner.js#L17
<wanderer> then a new VM https://github.com/ethereumjs/ethereumjs-vm/blob/master/tests/blockchainRunner.js#L19-L22
<wanderer> add some blocks to your vm https://github.com/ethereumjs/ethereumjs-vm/blob/master/tests/blockchainRunner.js#L68-L70
<wanderer> [edit] add some blocks to your blockchain https://github.com/ethereumjs/ethereumjs-vm/blob/master/tests/blockchainRunner.js#L68-L70
<wanderer> then run the vm on the blockchain https://github.com/ethereumjs/ethereumjs-vm/blob/master/tests/blockchainRunner.js#L79-L81

Notes:

  • The JavaScript implementation of ethereum can't connect to the rest of the ethereum network due to the changes in the network protocol (61 to 62)
    • node-blockchain-server is broken because of this
  • ethereum JSON-RPC doesn't return full blocks or transactions (therefore, no way to check signtures)
  • JSON-RPC docs https://github.com/ethereum/wiki/wiki/JSON-RPC
@whyrusleeping
Copy link

@diasdavid do we need to reply with which blocks we're sending you? or can you just guess by hashing them?

@daviddias
Copy link
Author

@whyrusleeping: yep :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment