Compare commits

...

1494 Commits

Author SHA1 Message Date
3983dd2428 Merge branch 'release/v0.7.10' 2014-12-20 02:34:12 +01:00
0a9dc1536c Increased peer from 10 to 30 2014-12-20 02:33:45 +01:00
1508a23a6f Minor updates on gas and removed/refactored old code. 2014-12-20 02:21:13 +01:00
f5b8f3d41b Removed OOG check. Revert should always happen. 2014-12-19 13:59:49 +01:00
0e93b98533 Transaction was generating incorrect hash because of var changes 2014-12-19 13:34:53 +01:00
5da5db5a0a Added authors 2014-12-19 13:34:21 +01:00
88af879f7a version bump 2014-12-19 01:18:22 +01:00
12671c82ea Moved VM to execution 2014-12-19 00:23:00 +01:00
59ef6e3693 Cleaned up objects 2014-12-19 00:18:52 +01:00
a7f4ade711 Fixed tests 2014-12-18 23:59:53 +01:00
1e985f9865 Fixed casting error
* big(bytes) == 0 when len(bytes) > 0
2014-12-18 23:59:40 +01:00
4789084998 updated tests 2014-12-18 23:32:58 +01:00
3325683794 Fixed refund model 2014-12-18 22:38:51 +01:00
f7287c626e updated tests 2014-12-18 21:58:53 +01:00
198cc69357 Gas corrections and vm fixes 2014-12-18 21:58:26 +01:00
5ad473d758 Moved methods to messages 2014-12-18 15:33:22 +01:00
db494170dc Created generic message (easy for testing) 2014-12-18 15:18:13 +01:00
9e286e1c33 updated tests 2014-12-18 13:32:47 +01:00
2d09e67713 Updated to new methods 2014-12-18 13:17:24 +01:00
49e0267fe7 Locks, refactor, tests
* Added additional chain tests
* Added proper mutex' on chain
* Removed ethereum dependencies
2014-12-18 13:12:54 +01:00
590aace88d Removed ethereum as dependency 2014-12-18 12:18:19 +01:00
4b2f1f7628 idx should return -1 2014-12-18 11:55:46 +01:00
df3366d910 Rlp shouldn't write null bytes 2014-12-18 11:39:24 +01:00
4dbdcaecb1 Moved pre-compiled, moved depth check
* Depth check has been moved to the execution
* Pre compiled execution has been moved to the VM
* PrecompiledAddress has been renamed to PrecompiledAccount
2014-12-17 23:58:52 +01:00
b1c58b76a9 moved err check 2014-12-17 12:57:35 +01:00
ef4135eabe Added topic utility functions to whisper 2014-12-15 16:12:34 +01:00
c3ba4ace64 Merge branch 'poc8' into develop 2014-12-15 10:22:57 +01:00
15e46b97b4 Merge pull request #204 from fjl/fix-p2p-disconnect
p2p: fix decoding of disconnect reason
2014-12-15 10:22:35 +01:00
da900f9435 p2p: add test for base protocol disconnect 2014-12-15 00:28:20 +01:00
f0f6727778 p2p: use an error type for disconnect requests
Test-tastic.
2014-12-15 00:28:20 +01:00
65e39bf20e p2p: add MsgPipe for protocol testing 2014-12-15 00:28:20 +01:00
f8061fcba8 fixed tests 2014-12-12 22:38:54 +01:00
4c84db85c5 eth-go packages ended up in whisper 2014-12-12 22:29:29 +01:00
0122989808 Merge branch 'poc8' into develop 2014-12-12 22:27:12 +01:00
ccb4fc8d03 Merge pull request #206 from ethereum/tests
Added Dockerfile to build from source
2014-12-12 22:26:54 +01:00
aec0c0efcb updated tests 2014-12-12 22:25:29 +01:00
bf566a657c Implemented Qt whisper interface 2014-12-12 22:24:41 +01:00
8577e4171a Panic for "Vm" 2014-12-12 22:24:27 +01:00
06e76422b5 Added length checkes 2014-12-12 22:24:04 +01:00
1c7fd62e57 Moved 2014-12-12 22:23:52 +01:00
a17a1f9208 Implemented watching using filter package
* Added filters / watches
* Removed event dep
2014-12-12 22:23:42 +01:00
ed1538248f Moved filter to events 2014-12-12 22:19:39 +01:00
9e1689df9c Generic filter interface 2014-12-12 21:42:21 +01:00
ca7f385294 Fix variable name 2014-12-12 10:54:32 -06:00
a92ccfc5c6 Added Dockerfile to build from source 2014-12-12 10:50:07 -06:00
25cf0c440c Accidentally changed max depth during testing & committed 2014-12-12 15:25:21 +01:00
05fd1dafe2 additional log 2014-12-12 13:26:01 +01:00
e28c60caf9 p2p: improve and test eofSignal 2014-12-12 11:40:02 +01:00
9423401d73 p2p: fix decoding of disconnect reason (fixes #200) 2014-12-12 11:40:02 +01:00
0d57ca486a Squashed commit of the following:
commit 779f25d36c
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 11 22:59:56 2014 +0100

    first random test

commit 68175386c0
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 11 21:34:50 2014 +0100

    update gas prices

commit ad322fbb58
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 8 06:01:17 2014 +0100

    Log as array

commit f989f42618
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Dec 5 15:12:12 2014 +0100

    state log tests

commit 4bc65d1129
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 4 18:18:49 2014 +0100

    add calldataload, codecopy, extcodecopy tests

commit 12cfae18e3
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 4 15:57:56 2014 +0100

    add calldataload test

commit 086caf3701
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Wed Dec 3 08:31:03 2014 +0100

    protocol update (CALLCODE <-> RETURN), topics in log are arrays not sets

commit e6c92673b9
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 21:14:08 2014 +0100

    update state tests with logs

commit 4089b809fb
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 18:19:40 2014 +0100

    update gas costs

commit cfdca62277
Merge: 2e5175e f59f89d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 18:04:51 2014 +0100

    Merge pull request #42 from negedzuregal/fix

    vmTest fix

commit f59f89d876
Author: alon muroch <alonmuroch@gmail.com>
Date:   Mon Dec 1 16:18:12 2014 +0100

    vmEnvironmentalInfoTest CALLDATACOPY, CODECOPY, EXTCODECOPY fix

commit 68da13fe3e
Author: alon muroch <alonmuroch@gmail.com>
Date:   Mon Dec 1 11:10:57 2014 +0100

    vmArithmeticTest exp fix

commit 2e5175e818
Author: ethers <ethereum@outlook.com>
Date:   Sun Nov 30 19:55:51 2014 +0100

    add vmLogTest

commit b5b9408e64
Author: Heiko Heiko <heiko@heiko.org>
Date:   Sun Nov 30 16:27:27 2014 +0100

    updated genesis to new header w/o min_gas_price

commit 8e69fbfa98
Author: ethers <ethereum@outlook.com>
Date:   Fri Nov 21 17:42:05 2014 -0800

    add special tests

commit 90f4f942e6
Author: ethers <ethereum@outlook.com>
Date:   Thu Nov 20 19:01:09 2014 -0800

    typo

commit c5e5228e0d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 20 17:04:06 2014 +0100

    Removed log,post,out,gas,callcreates if exception occured

commit 9c0232a2b9
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 18:19:05 2014 +0100

    MakeMoney test

commit 3ba0007e86
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 16:23:04 2014 +0100

    Added log sections in all vmtests + log tests

commit d84be4fe07
Merge: c8497ab 76d2542
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 10:00:24 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit c8497ab257
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 10:00:02 2014 +0100

    new push32 test and renaming

commit 76d25420e1
Author: ethers <ethereum@outlook.com>
Date:   Mon Nov 17 18:59:30 2014 -0800

    adding test

commit 0be275e757
Merge: 1d42d1d d90868c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 22:47:34 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 1d42d1d7c6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 22:46:51 2014 +0100

    fix ecrecover2

commit d90868c307
Merge: 1f38c8c 6dbcf6b
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 20:26:59 2014 +0100

    Merge pull request #39 from wanderer/develop

    added test for max call depth on creation

commit 6dbcf6b0d6
Author: wanderer <mjbecze@gmail.com>
Date:   Mon Nov 17 14:06:43 2014 -0500

    spelling fix

commit 6fc07a7f81
Author: wanderer <mjbecze@gmail.com>
Date:   Sat Nov 15 21:39:16 2014 -0500

    added test for max call depth on creation

commit 1f38c8c0a2
Merge: 279b284 cd85ca1
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 20:10:21 2014 -0500

    Merge pull request #38 from wanderer/develop

    updated test  'jeff' in trietest.json

commit cd85ca17ed
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 19:59:34 2014 -0500

    Update trietest.json

commit 279b284c0d
Merge: 89675a7 6cae937
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 17:43:49 2014 -0500

    Merge pull request #37 from wanderer/develop

    Update trietest.json

commit 6cae937e5e
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 17:20:03 2014 -0500

    Update trietest.json

    'emptyValues' should have the same root as 'puppy'

commit 89675a7153
Merge: f1de1cc 32f0c47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 23:17:49 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit f1de1cc97a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 23:17:13 2014 +0100

    Fix CallRecursiveBomb2

commit 32f0c47c68
Merge: ab50e76 3da90d0
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Thu Nov 13 15:26:49 2014 -0500

    Merge pull request #36 from wanderer/develop

    converted back to arrary format

commit ab50e76652
Merge: d06b792 78f1e4a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 07:52:35 2014 +0100

    Merge pull request #35 from ethers/delOld

    rename tests since they are valid opcodes that exist

commit 3da90d01f6
Author: wanderer <mjbecze@gmail.com>
Date:   Wed Nov 12 22:22:47 2014 -0500

    converted back to arrary format

commit 78f1e4a945
Author: ethers <ethereum@outlook.com>
Date:   Wed Nov 12 19:11:06 2014 -0800

    rename tests since they are valid opcodes that exist

commit d06b792cd0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 12 07:00:17 2014 +0100

    minor change in CallSha256_1_nonzeroValue test

commit d434ecdcc3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 12 06:56:31 2014 +0100

    Added CallSha256_1_nonzeroValue test

commit 2c06f34cc0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 18:10:26 2014 +0100

    Store return value of call to precompiled contracts

commit 4b0c3b29ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 17:51:14 2014 +0100

    Fix gas cost for OOG calls

commit 63bcca7604
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue Nov 11 08:59:19 2014 +0100

    fix: genesis test

commit 6e0310c1ea
Merge: 30c266c 2927763
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 08:34:36 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 30c266caff
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 08:33:59 2014 +0100

    jump to position outside code stops execution

commit 2927763d68
Author: ethers <ethereum@outlook.com>
Date:   Mon Nov 10 14:10:22 2014 -0800

    RandomTests were removed

commit a0fa91b2b8
Merge: 6092484 fcba866
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 10 22:22:05 2014 +0100

    Merge branch 'develop' of https://github.com/ethereum/tests into develop

commit 60924843f0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 10 22:21:37 2014 +0100

    Unintended Exceptions work like OOG

commit fcba866721
Author: ethers <TODO>
Date:   Thu Nov 6 14:19:59 2014 -0800

    add StateTests

commit a441074ba4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 17:54:36 2014 +0100

    Updated precompiled contracts test

commit 0afa72c82b
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 15:27:45 2014 +0100

    Added precompiledContracts tests

commit 6be83dd5a1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 13:31:34 2014 +0100

    Update gas cost for PoC7

commit c18b8ab2d3
Merge: 66c2e1f 9a93258
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 09:19:53 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 66c2e1f642
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 09:19:22 2014 +0100

    Updated SIGNEXTEND tests

commit 9a9325822e
Author: ethers <TODO>
Date:   Wed Nov 5 16:20:26 2014 -0800

    part of 9b4e768 - Delete vmNamecoin.json

commit e229374f46
Merge: 189527e 9b4e768
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:59:49 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 189527e563
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:59:20 2014 +0100

    added dynamic jump out of code

commit 9b4e768995
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:41:54 2014 +0100

    Delete vmNamecoin.json

commit 4669b5694b
Merge: a567fed aaba185
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 15:00:12 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit a567fedaa7
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 14:59:08 2014 +0100

    added state systemOperationsTest

commit aaba185ceb
Merge: 79d7cbf fa782ae
Author: ethers <ethereum@outlook.com>
Date:   Tue Nov 4 12:15:40 2014 -0800

    Merge pull request #32 from ethers/indexjs

    updates needed per restructure

commit fa782aed93
Author: ethers <TODO>
Date:   Tue Nov 4 11:28:56 2014 -0800

    updates needed per restructure

commit 79d7cbfc4a
Merge: 9120274 1c1ba8d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:32:11 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 9120274a46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:31:27 2014 +0100

    Update tests to latest protocol changes (PoC7)

commit 1c1ba8d161
Merge: 014d370 3aebe53
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:30:52 2014 +0100

    Merge pull request #31 from CJentzsch/develop

    Restructered tests in folders in accordance to test suites

commit 3aebe532e5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:58:21 2014 +0100

    Updated vmNamecoin.json to new sstore prices

commit 8a0be21839
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:53:00 2014 +0100

    Added example state test

commit 83643addbc
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:36:25 2014 +0100

    removed systemoperationstests

commit 3930ca3a9a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:22:15 2014 +0100

    Restructered tests in folders in accordance to test suites

commit 014d370b5d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 21:23:56 2014 +0100

    New SIGNEXTEND tets

commit 155d449be2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 20:59:05 2014 +0100

    New tests for BNOT and SIGNEXTEND

commit c9eae764b8
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 28 12:58:27 2014 +0100

    Update SSTORE gas cost and BNOT instead of NEG

commit ad2a75ac58
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 16:05:49 2014 +0200

    Added new recursive bombs

commit 834c52af64
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 12:01:05 2014 +0200

    Changing gas cost to zero at stackunderflow

commit c73a8a89d2
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed Oct 22 13:04:45 2014 +0200

    Reverted back to original value.

commit b9a8c92422
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Tue Oct 21 17:02:52 2014 -0400

    fix spelling error

commit b48ae74af4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:26:26 2014 +0200

    Added failing random tests

commit bee0a4100c
Merge: 5050d20 b315da6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:15:05 2014 +0200

    Merge remote-tracking branch 'origin/master' into develop

commit 5050d20b4d
Merge: 7516685 ba35362
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 20 20:18:20 2014 +0200

    Merge pull request #26 from wanderer/develop

    Add a package.json for node.js

commit ba35362876
Author: wanderer <mjbecze@gmail.com>
Date:   Sun Oct 19 23:59:47 2014 -0400

    turned tests into a node module

commit 751668571e
Author: ethers <ethereum@outlook.com>
Date:   Thu Oct 16 17:08:20 2014 -0700

    json was invalid and missing quotes

commit 0e687cee47
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu Oct 16 17:13:24 2014 +0200

    Update vmEnvironmentalInfoTest.json

commit 78a78e2e6c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 15 14:19:11 2014 +0200

    updated genesis_hash

commit b315da618b
Merge: 7a7e198 0a76a3a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 14 10:33:26 2014 +0200

    Merge pull request #23 from ethers/fix22

    numbers should be strings #22

commit 0a76a3a312
Author: ethers <ethereum@outlook.com>
Date:   Mon Oct 13 14:45:30 2014 -0700

    numbers should be strings #22

commit 1f67385f13
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:18:00 2014 +0200

    Added some MUL tests

commit 7a7e198395
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:11:59 2014 +0200

    Added some MUL tests

commit 46eb6283ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 12:18:13 2014 +0200

    tested new opcodes (JUMPDEST,CALLCODE) and created test for CALL/CREATE depth

commit 8d38d62d10
Author: Nick Savers <nicksavers@gmail.com>
Date:   Fri Oct 10 18:09:41 2014 +0200

    INVALID stops the operation and doesn't cost gas

commit ed6eba7c8e
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 19:08:48 2014 +0200

    Update + ABA recursive bomb which needs maximum recursion limit of 1024

commit 2d72050db1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 14:37:18 2014 +0200

    Applied recent protocol changes (PoC7) to existin tests

commit dfe66cab3f
Merge: 4513623 1a67a96
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 11:05:51 2014 +0200

    Merge remote-tracking branch 'origin/develop'

    Conflicts:
    	genesishashestest.json

commit 1a67a96cff
Merge: a4f5f45 ffd6bc9
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 15:10:23 2014 +0100

    Merge pull request #18 from CJentzsch/develop

    CallToNameRegistratorOutOfGas balance correction

commit ffd6bc97ad
Merge: a4f5f45 9779d67
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:47:34 2014 +0200

    Merge remote-tracking branch 'origin/develop' into develop

commit 9779d67b8c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:45:53 2014 +0200

    CallToNameRegistratorOutOfGas balance correction

    Even if execution fails, the value gets transferred.

commit a4f5f45228
Merge: 49a9f47 b6d7cba
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 14:13:12 2014 +0100

    Merge pull request #17 from CJentzsch/develop

    Added A calls B calls A contracts

commit b6d7cba499
Merge: 865cb40 49a9f47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 865cb4083d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:36 2014 +0200

    Added A calls B calls A contracts

commit 49a9f47aec
Merge: 3b0ec43 94a493b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Tue Oct 7 10:56:17 2014 +0200

    Merge pull request #16 from CJentzsch/develop

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 94a493b0d9
Merge: 72853c4 3b0ec43
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:32 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 72853c4382
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:07 2014 +0200

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 3b0ec436e4
Merge: aec3252 222068b
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 05:52:43 2014 +0100

    Merge pull request #15 from CJentzsch/develop

    corrected tests and different style for storage

commit 222068b9ba
Merge: c169653 aec3252
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:28 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit c1696531a6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:09 2014 +0200

    corrected tests and different style for storage

commit aec3252b8e
Merge: 25f9fd5 e17a909
Author: vbuterin <v@buterin.com>
Date:   Mon Oct 6 09:39:46 2014 +0100

    Merge pull request #14 from CJentzsch/develop

    corrected gas limit in vmSystemOperationsTest

commit e17a909f70
Merge: 33fcab5 25f9fd5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:31:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 33fcab5727
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:30:04 2014 +0200

    Bug fix, corrected gasLimit in vmSystemOperationsTest

commit 25f9fd542a
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:47:00 2014 -0400

    one more vm test

commit 2d561a5373
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:15:37 2014 -0400

    separated out vmtests

commit b0c48fa8d6
Merge: cb8261a 6cae166
Author: vbuterin <v@buterin.com>
Date:   Sat Oct 4 17:18:02 2014 +0100

    Merge pull request #13 from CJentzsch/develop

    Added comprehensive EVM test suite. All commands are tested.

commit 6cae166f6f
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 15:34:23 2014 +0200

    Delete tmp.json

commit 4ff906fbc2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 14:06:32 2014 +0200

    corrected CALLSTATELESS tests

commit 5b3fee6806
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 29 13:08:44 2014 +0200

    Completed vm tests. Added ADDMOD, MULMOD, POST, CALLSTATELESS

commit 9cdd218083
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 27 21:48:09 2014 +0200

    Added IOandFlowOperation-, PushDupSwap- and SystemOperations- tests. Removed empty storage from adresses.

commit 28ed968b46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:49:22 2014 +0200

    Added blockInfoTest

commit ffbd5a35b5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:37:52 2014 +0200

    Added environmentalInfo- and sha3- test

commit 54c14f1ff3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 22 13:06:57 2014 +0200

    Added bitwise logic operation test

commit d0af113aab
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 20 01:42:51 2014 +0200

    Added vm arithmetic test

commit cb8261a78b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Sep 19 13:15:44 2014 +0200

    Update genesishashestest.json

commit 4513623da1
Author: Maran <maran.hidskes@gmail.com>
Date:   Tue Jul 22 12:24:46 2014 +0200

    Update keyaddrtest to be valid JSON

commit e8cb5c221d
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 21 23:30:33 2014 -0400

    Added next/prev trie test

commit 98823c04b3
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 14 02:51:31 2014 -0400

    Replaced with deterministic test

commit 357eb21e4d
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun Jul 13 16:12:56 2014 -0400

    Added my own random and namecoin tests (pyethereum)

commit 00cd0cce8f
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jul 12 21:20:04 2014 +0200

    Output hex strings.

commit ddfa3af45d
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 11:28:35 2014 +0100

    Everything a string.

commit d659f469a9
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 10:16:25 2014 +0100

    Code fixes.

commit 5e83ea8228
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 16:17:12 2014 +0200

    Prettier VM tests.

commit a09aae0efe
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 15:46:01 2014 +0200

    Fix VM tests.

commit ec9a044a17
Merge: 4bb6461 5e0123f
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Jul 4 15:56:52 2014 +0200

    Merge pull request #10 from romanman/patch-1

    Update vmtests.json

commit 5e0123fbe1
Author: romanman <roman.mandeleil@gmail.com>
Date:   Fri Jul 4 10:23:04 2014 +0100

    Update vmtests.json

commit 2b6da2f5f2
Author: romanman <roman.mandeleil@gmail.com>
Date:   Thu Jul 3 17:45:04 2014 +0100

    Update vmtests.json

    arith testcase updated

commit 4bb646117d
Merge: bba3898 a33b309
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:22 2014 +0200

    Merge branch 'develop' of github.com:/ethereum/tests into develop

commit bba38980bd
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:06 2014 +0200

    New tests.

commit a33b309d99
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:14:05 2014 -0400

    Testing submodules

commit 50318217ca
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:10:46 2014 -0400

    Testing submodules

commit 57fa655522
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:09:08 2014 -0400

    Testing submodules

commit ea0eb0a8c8
Author: Gav Wood <i@gavwood.com>
Date:   Tue Jul 1 15:19:34 2014 +0200

    Latest genesis block.

commit 25bb76b69c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 13:25:04 2014 +0200

    Reset

commit 74c6d8424e
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 12:10:06 2014 +0200

    Updated wrong test

commit 9ea3a60291
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Sat Jun 28 18:48:28 2014 +0200

    Fixed roots

commit 5fc3ac0e92
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:40:06 2014 +0200

    Simple hex test.

commit edd3a00c2a
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:22:18 2014 +0200

    Additional test for jeff. Now use the 0x... notation.

commit 5021e0dd83
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 21:35:26 2014 +0200

    VM test framework updated.

commit c818d13202
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 18:18:24 2014 +0200

    Removed arrays from Trie tests JSON as per conformance guide and changed
    vocabulary to match other tests.
    VM test updates.

commit 714770ffb3
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jun 11 11:32:42 2014 +0100

    Added Gav's new address.

commit 9345bc13d4
Merge: a2257f3 78576dd
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:38 2014 +0200

    Merge branch 'master' of github.com:ethereum/tests into develop

commit a2257f3471
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:18 2014 +0200

    VM tests.

commit 78576dd3d3
Author: Heiko Heiko <heiko@heiko.org>
Date:   Fri May 30 17:19:09 2014 +0200

    changes based on new account structure nonce, balance, storage, code

commit 125839e848
Merge: 42e14ec 356a329
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu May 22 09:58:45 2014 +0200

    Merge pull request #5 from bkirwi/master

    Fix invalid JSON (removed trailing comma) and add test names

commit 356a3296bc
Author: Ben Kirwin <ben@kirw.in>
Date:   Thu May 22 00:20:48 2014 -0400

    Add some arbitrary test names

    This should now conform to the format specified in the README.

commit 42e14ec54f
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 23:27:40 2014 +0800

    revert to correct data

commit 4300197a74
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:42:23 2014 +0800

    fix: wrong sha3 hash because of the wrong rlp hex

commit a0d01b1a0b
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:29:53 2014 +0800

    fix: wrong rlp hex

commit 6bc2fc7405
Merge: 66bc366 c31a93c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed May 21 14:11:37 2014 +0200

    Merge pull request #4 from ethers/master

    fix file name that seems to have been a typo

commit c31a93c27a
Author: ethers <ethereum@outlook.com>
Date:   Tue May 20 15:42:39 2014 -0700

    fix file name that seems to have been a typo

commit 66bc3665c1
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:36:35 2014 +0200

    fix: represent integers as strings

commit ede5499da6
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:21:09 2014 +0200

    add: current initial alloc and genesis hashes

commit 5131429abb
Author: Ben Kirwin <ben@kirw.in>
Date:   Mon May 19 11:18:31 2014 -0400

    Delete a comma

    This should now be parseable as JSON.

commit f44a859331
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Sun May 18 15:04:42 2014 +0800

    add: case when value is long, ensure it's not get rlp encoded as node

commit e1ae4ad449
Author: Gav Wood <i@gavwood.com>
Date:   Mon May 12 14:40:47 2014 +0100

    PoC-5 VM tests.

commit 2b6c136dda
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun May 11 21:42:41 2014 -0400

    Moved txt to json

commit cbccbf977c
Merge: edbb8d4 45a0974
Author: Vitalik Buterin <v@buterin.com>
Date:   Thu May 8 21:54:48 2014 -0400

    New commit

commit edbb8d407e
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue May 6 16:53:43 2014 -0400

    Removed unneeded test, added new tests

commit 45a0974f6f
Merge: 15dd8fd 5fd2a98
Author: Gav Wood <i@gavwood.com>
Date:   Sun Apr 27 12:53:47 2014 +0100

    Merge pull request #3 from autolycus/develop

    Fixed formatting and added test cases

commit 5fd2a98fcb
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 13:26:14 2014 -0700

    Added some new test cases for the rlp encoding.

commit 4ba150954e
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 12:48:42 2014 -0700

    Converted spaces to tabs to be compliant with the coding standards defined in cpp-ethereum

commit 15dd8fd794
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 12:54:47 2014 +0000

    RLP tests and Trie updates.

commit 33f80fef21
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:39:35 2014 +0000

    Hex encode tests done.

commit e1f5e12abb
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:22:49 2014 +0000

    Fix RLP tests.

commit f87ce15ad2
Author: Gav Wood <i@gavwood.com>
Date:   Thu Feb 27 13:28:11 2014 +0000

    Fix empty string.

commit c006ed4ffd
Author: Gav Wood <i@gavwood.com>
Date:   Mon Feb 24 10:24:39 2014 +0000

    Tests fix.

commit 510ff56363
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:54:08 2014 +0000

    Updated the tests.

commit a0ec843832
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:49:24 2014 +0000

    Moved over to new format, but RLP tests still need updating.

commit 660cd26f31
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:35:51 2014 +0000

    More docs.

commit 6ad14c1a15
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:33:39 2014 +0000

    Added VM test suite.
    Added TODO.
    Renamed old files.

commit f91ad7b385
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 11:26:58 2014 -0500

    update trie algorithm

commit 6da2954462
Merge: cc42246 131c610
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 08:15:38 2014 -0500

    merge

commit cc4224675f
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Jan 7 14:35:26 2014 -0500

    Updated trie test

commit 131c610da6
Merge: 121632b 7613302
Author: vbuterin <v@buterin.com>
Date:   Wed Jan 1 06:40:54 2014 -0800

    Merge pull request #1 from obscuren/master

    Update trietest.txt

commit 7613302b49
Author: obscuren <obscuren@users.noreply.github.com>
Date:   Wed Jan 1 15:25:21 2014 +0100

    Update trietest.txt

    New proposed explanatory format

commit 121632bedd
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 1 08:26:18 2014 -0500

    Added obscure's tests

commit ef6c5506c3
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 19:04:48 2013 -0500

    Fixed tests a bit

commit 345e4bcfef
Merge: 2c81698 e4bbea4
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 15:52:46 2013 -0500

    Merge branch 'master' of github.com:ethereum/tests

commit 2c81698f31
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Dec 30 21:09:40 2013 -0500

    Added first three tests

commit e4bbea400f
Author: vbuterin <v@buterin.com>
Date:   Mon Dec 30 18:09:03 2013 -0800

    Initial commit
2014-12-12 11:34:27 +01:00
2b5fcb4642 moved interfaces 2014-12-10 20:26:55 +01:00
5553e5aaed states moved to chain 2014-12-10 19:59:12 +01:00
af6afbaa56 Removed start/stop methods 2014-12-10 16:48:39 +01:00
1b98cbbfa4 Moved pow 2014-12-10 16:45:16 +01:00
4082c8b61d added simple peer server 2014-12-10 15:29:22 +01:00
dda778eda7 Updated whisper messages to new crypto api + added tests 2014-12-10 14:17:32 +01:00
0f5c6c5e2d Changed new methods to use ecdsa package for pub prv keys 2014-12-10 14:17:10 +01:00
186948da22 changed to unsigned integers 2014-12-10 11:27:10 +01:00
4f1ef89cb2 updated tests 2014-12-10 11:04:21 +01:00
1fb84d3c5f Fixed tests 2014-12-10 10:57:19 +01:00
3308491c92 Removed tests because they've become obsolete 2014-12-10 00:09:32 +01:00
9ff7be68fb Merge branch 'poc8' into develop 2014-12-10 00:06:38 +01:00
ce0c4e5d86 Merge pull request #203 from fjl/rlp-fixes
RLP: remove signed integer support and other fixes
2014-12-10 00:06:17 +01:00
984c7e6689 Added encryption for messages better API for sealing messages 2014-12-10 00:03:50 +01:00
87adff7e18 Added Encrypt & Decrypt using the ECIES w/ tests 2014-12-10 00:03:21 +01:00
c24018e273 Added S256 curve 2014-12-10 00:02:43 +01:00
6cf4e0329c rlp: display decoder target type in more error messages
Decode error messages now say "expected input list for foo.MyStruct"
instead of just "expected List".
2014-12-09 22:28:49 +01:00
df5157c0b0 PV49 2014-12-09 20:28:36 +01:00
acf4b5753f Core changes
* Code = '' if gas < len(D) * 5
* Sha3 gas   10 + 10 * len(D), rounding up 32 bytes
* Sha256 gas 50 + 50 * len(D), rounding up 32 bytes
* Ripmed gas 50 + 50 * len(D), rounding up 32 bytes
* Accounts and value transfers no longer reverted
2014-12-09 20:27:57 +01:00
829730dec4 rlp: remove dead code 2014-12-09 12:49:20 +01:00
c084a7daa5 rlp: fix panic in decodeList on go 1.4+
The documentation for reflect.Value.Index states that it will
panic for out-of-bounds indices. Since go 1.4, it actually panics.
2014-12-09 10:58:46 +01:00
93e858f88e rlp: remove support for signed integer types
There is no agreement on how to encode negative integers
across implementations. cpp-ethereum doesn't support them either.
2014-12-09 10:58:46 +01:00
4f12f0697e rlp: move decoder type switch to decode.go 2014-12-09 10:52:05 +01:00
76842b0df8 Additional checks and debug output 2014-12-08 14:25:52 +01:00
e3a8412df3 Proper start/stoping wpeers 2014-12-08 13:16:50 +01:00
ebe2d9d872 First draft of Whisper messages relaying 2014-12-08 12:43:33 +01:00
f06543fd06 Merge branch 'poc8' into develop 2014-12-05 16:27:48 +01:00
195b2d2ebd Merge branch 'fjl-feature/p2p-protocol-interface' into poc8 2014-12-05 16:27:37 +01:00
384b8c75f0 Merge branch 'feature/p2p-protocol-interface' of https://github.com/fjl/go-ethereum into fjl-feature/p2p-protocol-interface 2014-12-05 16:27:11 +01:00
9925916851 upped proto version and modified block pool 2014-12-05 16:26:39 +01:00
095cb97675 EXP simplified 2014-12-05 14:52:36 +01:00
d80f8bda94 Fixed issue in VM where LOG didn't pop anything of the stack 2014-12-05 12:32:47 +01:00
3cf0477c21 Merge branch 'poc8' into develop 2014-12-04 23:54:40 +01:00
8dbca75d85 Skip mining on transactions that don't meet the min accepted gas price 2014-12-04 23:54:07 +01:00
710360bab6 Merge pull request #199 from ethereum/tests
Submit code coverage to coveralls only on travis build success
2014-12-04 23:00:12 +01:00
3db9c80070 Removed mutan. Closes #183 2014-12-04 17:13:23 +01:00
085f604b27 Show newly created private key during startup. Closes #126 2014-12-04 17:09:47 +01:00
a5b27bbc10 Improved and simplified wallet functions and behaviour 2014-12-04 16:44:43 +01:00
8c7e4b290f Added pre processing of transaction on the transient state 2014-12-04 16:44:14 +01:00
5653898150 vim error :S 2014-12-04 15:38:41 +01:00
73123bf257 Only set TD if it's actually higher 2014-12-04 15:35:21 +01:00
73c4ca3a6f Upped protocol version 2014-12-04 15:31:48 +01:00
296112848c Moved block validation as first step 2014-12-04 15:13:29 +01:00
008e91db6a null ptr fix 2014-12-04 12:43:12 +01:00
3043b233ea Log is now interface 2014-12-04 12:35:23 +01:00
bff5999efa sort tests for evm 2014-12-04 12:09:22 +01:00
f298ffdbb8 Renamed State => StateDB 2014-12-04 11:40:20 +01:00
3664cd58e3 Updated testing tools 2014-12-04 11:30:41 +01:00
491edc16e7 Fixes #189 2014-12-04 10:57:09 +01:00
83663ed4b0 Renames for chain, updated VM, moved methods
* Renamed a couple more chain => core
* Updated VM `pc` to be uint64 rather than big int
* XEth interface cleanup
2014-12-04 10:53:49 +01:00
9008b155d3 Renamed chain => core 2014-12-04 10:28:02 +01:00
b6cb5272de Descriptive function names for closure getters 2014-12-03 17:35:57 +01:00
6d99c03d91 Updated environments according to the new interface set 2014-12-03 17:22:26 +01:00
99853ac3ce Moved execution from vm to chain.
This moves call and create to the specified environments. Vms are no
longer re-used. Vm uses environment's Call(Code) and Create in order to
execute new contracts or transfer value between accounts.

State transition now uses the same mechanism described above.
2014-12-03 17:06:54 +01:00
8240550187 updated to types 2014-12-03 14:05:19 +01:00
709eff4ea7 reverted vm back 2014-12-03 13:52:30 +01:00
6212175be3 reverted vm back 2014-12-03 13:52:13 +01:00
6095edac58 merge 2014-12-03 13:50:51 +01:00
3d9a4e7084 Fixed mem error in vm. Fixed logs tests 2014-12-03 12:21:12 +01:00
f778922086 Set proper message value 2014-12-02 22:37:45 +01:00
edc52bdcbf Updated value for mined blocks. Closes #197 2014-12-02 22:23:20 +01:00
0a22dc2ce5 Check coinbase for from/to inclusion 2014-12-02 22:22:43 +01:00
cb4d168ecc Updated LOG to match proper gas in all cases 2014-12-02 17:22:33 +01:00
5ebae82eeb Additional logging and removed temp merged mining options. 2014-12-02 12:23:27 +01:00
64f35ba8d1 merge errors fixed 2014-12-02 11:52:56 +01:00
99481a245a Check for known block err and ignore 2014-12-02 11:37:33 +01:00
9f7a8ea5e6 updated tests 2014-12-02 10:29:39 +01:00
b4eeffa8f1 Transaction strictness 2014-12-02 00:14:34 +01:00
2df8ad6307 Added state tests 2014-12-02 00:03:53 +01:00
a052357872 Fixed EXP gas 2014-12-01 22:05:38 +01:00
a22056db59 Make an attempt to pay for the gas prior to expanding the mem. 2014-12-01 20:49:56 +01:00
beb7d35c40 Updated tests 2014-12-01 20:21:41 +01:00
d33987cb44 Additional fees for *COPY 2014-12-01 20:20:55 +01:00
6dc46d3341 Changed the way transactions are being added to the transaction pool 2014-12-01 20:18:09 +01:00
616066a598 rework vm 2014-11-30 21:02:59 +01:00
1bce02eff7 Fixed merge 2014-11-28 21:44:34 +01:00
a3559c5e1b updated PV 2014-11-28 21:38:10 +01:00
c8d0f8adc5 Changed refund 2014-11-28 21:20:32 +01:00
6ba8328077 Removed min gas price from genesis 2014-11-28 20:57:10 +01:00
61556ef01d GasData changes & removed min gas price 2014-11-28 20:47:24 +01:00
ef7961b7d2 Merge pull request #194 from ethereum/poc8
Update tests branch to PoC8
2014-11-27 13:23:31 +01:00
c17a3cb0ce chain coverage report & submission
prevent coverage results from being submitted to coveralls if when the
build fails
2014-11-27 12:42:13 +01:00
cfd7e74c25 p2p: add test for NewPeer 2014-11-26 22:49:40 +01:00
3a09459c4c p2p: make Disconnect not hang for peers created with NewPeer 2014-11-26 22:08:54 +01:00
9b85002b70 p2p: remove Msg.Value and MsgLoop 2014-11-25 16:01:39 +01:00
f816fdcb69 rlp: include target type in decoder error messages 2014-11-25 16:00:48 +01:00
6049fcd52a p2p: use package rlp for baseProtocol 2014-11-25 12:25:31 +01:00
c1fca72552 p2p: use package rlp 2014-11-24 19:03:20 +01:00
205af02a1f rlp: add NewListStream (for p2p) 2014-11-24 19:03:17 +01:00
5a5560f105 rlp: add Stream.Reset and accept any reader (for p2p) 2014-11-24 19:03:11 +01:00
59b63caf5e p2p: API cleanup and PoC 7 compatibility
Whoa, one more big commit. I didn't manage to untangle the
changes while working towards compatibility.
2014-11-21 21:52:45 +01:00
e4a601c644 p2p: disable failing Server tests for now 2014-11-21 21:52:45 +01:00
7149191dd9 p2p: fix issues found during review 2014-11-21 21:52:45 +01:00
f38052c499 p2p: rework protocol API 2014-11-21 21:52:45 +01:00
4cd9d57bad Merge pull request #187 from honestmoney/develop
Fix for broken develop build and install.sh
2014-11-21 13:22:14 -05:00
8cf9ed0ea5 Fixed test 2014-11-21 10:48:07 -05:00
28b7dcc204 go get deps doesnt work with develop branch 2014-11-21 08:16:32 -05:00
eba3fca7bc go get dependencies on executable 2014-11-21 08:05:52 -05:00
6c098ee779 changed install.sh to change branch and install executable 2014-11-21 00:06:33 -05:00
c0bbb7e69a fix for install script devel 2014-11-20 15:02:24 -05:00
d5ac24907e Updated install.sh - github paths for executables 2014-11-20 14:25:26 -05:00
0f47129113 Updated main.go - fix for broken develop build
Transaction execution fixes - 60cdb1148c
2014-11-20 14:16:22 -05:00
9b8a12b4b5 Removed naively casting to bytes 2014-11-20 18:20:04 +01:00
12f1aea38d Fixed iterator for short nodes.
In some cases the iterator didn't properly return the correct key
because it didn't append fields to the reverse lookup.
2014-11-20 18:11:31 +01:00
b05e63c34d Added paranoia check for tries 2014-11-19 16:56:01 +01:00
cab7e6000e Increased coverage 2014-11-19 16:35:57 +01:00
0f460ad26e Added caching and database interface to trie
* Reimplemented caching for trie
* Reimplemented resetting and persisting trie
2014-11-19 16:21:28 +01:00
e70529a977 Added new iterator and tests 2014-11-19 15:05:08 +01:00
14e2e488fd Added chain tests & minor fixes
* Fork tests (equal and larger chains)
* `chain.link` fields are now exported
* moved debug function from state to dump.go
2014-11-19 12:25:52 +01:00
437d79f094 Updated readme 2014-11-18 20:23:17 +01:00
93e693be72 Fixed tests for 'types' 2014-11-18 19:52:45 +01:00
675ba4d7eb Merge branch 'tests' into poc8 2014-11-18 19:48:35 +01:00
f8d0cd9906 Added a callback mechanism to chain adding.
Not sure if this is the right approach. Why? BlockChain shouldn't need
the "Ethereum" object. BlockChain shouldn't need to worry about
notifying listeners or message propagation.
2014-11-18 19:44:17 +01:00
a1b6a9ac29 Begin of moving objects to types package
* Block(s)
* Transaction(s)
2014-11-18 16:58:22 +01:00
62cd9946ee j => i 2014-11-18 12:20:14 +01:00
e08aba5dd9 added output test 2014-11-18 12:18:27 +01:00
34f29d57b6 Update vm_debug.go 2014-11-18 12:03:51 +01:00
3220a32ff0 Added some comparison tests for the new ptrie 2014-11-18 12:03:09 +01:00
f7417d3552 New modified patricia trie 2014-11-18 12:02:13 +01:00
5c958ec5f6 Undo running go vet in travis 2014-11-17 10:53:24 -06:00
2a5af8fac7 enable go vet 2014-11-17 10:40:40 -06:00
559a81da6f enable golint 2014-11-17 10:21:19 -06:00
a19d2c2278 Merge branch 'develop' into refactor 2014-11-17 12:14:05 +01:00
cad770c734 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-11-17 12:13:11 +01:00
ca74bcc4cd cleaning up 2014-11-17 12:12:55 +01:00
b4e47a094c Merge pull request #184 from fjl/feature/rlp
rlp: new package for streaming RLP decoder
2014-11-17 03:12:18 -08:00
bd0a50fdc3 rlp: fix pointer reuse 2014-11-17 12:02:08 +01:00
74266d5bbd rlp: new package for streaming RLP decoder 2014-11-17 01:49:47 +01:00
9095b37343 Convert vm test to checker
Tests are skipped due to reliance on deprecated mutan
2014-11-16 13:45:46 -06:00
ffab36c7d8 Update ethutil/common tests to checker 2014-11-16 12:08:27 -06:00
f82fb889b7 Add goveralls to travis builds 2014-11-16 08:34:28 -06:00
ddca18638f update imports order per goimports 2014-11-15 20:21:55 -06:00
3588c4a9fe formatting update per gofmt 2014-11-15 20:21:03 -06:00
71b338e8ac update travis steps 2014-11-15 19:45:05 -06:00
58812fad42 Reorg travis.yml 2014-11-15 19:36:30 -06:00
790ded0f47 Update travis deps script 2014-11-15 19:11:43 -06:00
6dbd7a9a80 add websocket to deps 2014-11-15 18:59:56 -06:00
e1e50f4afd add go cover to install list 2014-11-15 18:54:26 -06:00
3a656c07f1 add go-nat-pmp to manual install list 2014-11-15 18:49:18 -06:00
ec75119341 Update deps script 2014-11-15 18:42:48 -06:00
0b64906a72 Add -y flags 2014-11-15 18:28:09 -06:00
1beb9a2b8b update apt repos 2014-11-15 18:22:01 -06:00
242667ebe5 update travis build deps 2014-11-15 18:12:50 -06:00
5211fb0c79 make script executable 2014-11-15 17:56:16 -06:00
81e7f8679e script fix 2014-11-15 17:51:58 -06:00
6f7f570670 custom travis build script
Based on https://github.com/daaku/go.travis/blob/master/install
2014-11-15 17:45:08 -06:00
8f9a354682 try to fix travis dep error 2014-11-15 09:07:02 -06:00
bc5d924b83 more travis changes 2014-11-14 22:23:31 -06:00
9481f86c37 run coverage after build 2014-11-14 22:17:01 -06:00
dd9e99a418 try to get full coverage report on travis 2014-11-14 20:58:09 -06:00
33afb10b0d clean up 2014-11-15 00:29:27 +01:00
1ecb3b4cf3 Remove failing Printf 2014-11-14 15:53:45 -06:00
dcd8cc8341 added test file to root directory 2014-11-14 15:31:15 -06:00
e6e468ef59 Merge branch 'develop' of https://github.com/tgerring/go-ethereum into tests
Conflicts:
	p2p/messenger_test.go
	trie/trie_test.go
2014-11-14 15:19:50 -06:00
2a9fc7baa9 Merge branch 'develop' of https://github.com/tgerring/go-ethereum 2014-11-14 15:01:52 -06:00
56aa24002d Clean up 2014-11-14 14:17:54 +01:00
711be7009e Version bump 2014-11-14 13:51:41 +01:00
f6e55962a8 Fixes for PV41/42
* Don't expand mem on empty value
* Removed all coinbase logs for PV42
* Removed C++ bug stuff for LOG*
2014-11-14 13:47:12 +01:00
20d518ee95 Numerous fixes for consensus.
* Removed (buged) C++ specific gas specification for LOG*
* Fixed LOG* where mstart went after msize
*
2014-11-13 18:12:12 +01:00
313cfba7d4 convert trie encoding tests to checker 2014-11-13 04:40:21 +01:00
461324a801 Remove references to mutan
obscuren/mutan is deprecated
2014-11-12 22:08:56 +01:00
fa59db7595 Add initial state/TestDump test 2014-11-12 22:03:03 +01:00
bd9bd4abed Reorg state tests 2014-11-12 22:02:39 +01:00
6eacc8eab9 eth-go -> go-ethereum 2014-11-12 21:52:37 +01:00
00878e5b6e Convert trie tests to gocheck 2014-11-12 21:43:25 +01:00
60cdb1148c Transaction execution fixes 2014-11-12 01:36:36 +01:00
9bb1ac7564 Fixes for the log method 2014-11-11 23:14:22 +01:00
6c9e503eb8 Removed all implicit logging. Fixed gas issues and jump errors 2014-11-11 22:52:27 +01:00
1d866b5e57 Merge pull request #1 from tgerring/tests
Initial tests based on check framework
2014-11-11 20:37:18 +01:00
5c5df21e3d Update TestDeleteFromByteSlice
Still broken
2014-11-11 20:05:27 +01:00
12e8404f8f Fix TestBytestoNumber 2014-11-11 20:04:03 +01:00
0d1cdd26d6 Update TestNumberToBytes 2014-11-11 20:03:50 +01:00
cff0d93105 Converts bytes_test to checker 2014-11-11 19:38:23 +01:00
c24d143c9e Convert rand_test to checker 2014-11-11 19:18:52 +01:00
bfd1fe977e Update test style to checker 2014-11-11 19:05:35 +01:00
d9ccbf04db Move test bootstrap to main_test.go 2014-11-11 19:05:23 +01:00
cd94b5ffb3 Convert value_test to use gocheck 2014-11-11 15:04:11 +01:00
3c619baec5 Add verbose comments to TestSnapshot 2014-11-11 13:07:24 +01:00
8f3a03c0cc Update state tests to use gocheck 2014-11-11 12:52:43 +01:00
75ee3b3f08 debugging code 2014-11-11 12:16:36 +01:00
9509322ecd Updated readme 2014-11-10 13:36:53 +01:00
bed659f9b3 Moved ethtest to cmd 2014-11-10 13:31:18 +01:00
ad0acb5762 Moved messages eventing to chain manager 2014-11-10 13:27:24 +01:00
ebb7db263f Added dumps 2014-11-10 12:42:16 +01:00
d30571a7a8 Added VM testing tool 2014-11-10 11:47:37 +01:00
cbeebcd47d Fixed bloom, updated mining & block processing
* Reverted back to process blocks in batches method
* Bloom generation and lookup fix
* Minor UI changed (mainly debug)
2014-11-10 01:17:31 +01:00
f538ea25e4 Fixed bug on gas and setting of receipts and roots 2014-11-09 23:59:25 +01:00
429dd2a100 Implemented new miner w/ ui interface for merged mining. Closes #177
* Miner has been rewritten
* Added new miner pane
* Added option for local txs
* Added option to read from MergeMining contract and list them for
  merged mining
2014-11-07 12:18:48 +01:00
0a3a148ed4 Added more byte tests 2014-11-06 12:35:46 +01:00
48a3f0986c Add coverage for rand 2014-11-05 22:21:28 +01:00
a1d62abca4 Restructure StorageSize string test 2014-11-05 22:16:44 +01:00
be96da179a Added tests for FormatData 2014-11-05 22:01:41 +01:00
8f94f731a5 Reorder tests to match source order 2014-11-05 22:01:09 +01:00
ab6b9c44aa Added test for IsHex 2014-11-05 22:00:01 +01:00
4e15adac6d Remove fmt dependency 2014-11-05 21:59:22 +01:00
b100546c9d add test for Bytes.String() 2014-11-05 18:02:20 +01:00
834f8a1dc8 added test for CopyBytes 2014-11-05 17:48:23 +01:00
ada684e054 added test for BinaryLength 2014-11-05 17:44:28 +01:00
92b30cc452 add tests for ReadVarInt 2014-11-05 17:39:26 +01:00
cb32f52b9c added test for parsing bytes 2014-11-05 17:11:40 +01:00
4f00929084 Added byte padding tests 2014-11-05 17:04:24 +01:00
94b0ce84da Cleanup big_test.go 2014-11-05 13:35:43 +01:00
e76c58d175 New test coverage for ethutil/big.go 2014-11-05 13:23:50 +01:00
92299b7c24 New test coverage for ethutil/path.go 2014-11-05 11:23:30 +01:00
48488017e4 Proper packages 2014-11-05 00:34:59 +01:00
b4da085a9f Accidental packages 2014-11-05 00:34:04 +01:00
7db44b56b0 Updated to ethereum serpent 2014-11-05 00:32:51 +01:00
99d5769c2b There'll be jumping in to jumps 2014-11-04 18:38:19 +01:00
1b1fa049fa Fixed VM and added static analysis for EVM jumps 2014-11-04 18:18:57 +01:00
8cfbf1836d Added JUMP analysis (WIP) 2014-11-04 18:17:38 +01:00
78fb2af6f1 Squashed commit of the following:
commit 79d7cbfc4a
Merge: 9120274 1c1ba8d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:32:11 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 9120274a46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:31:27 2014 +0100

    Update tests to latest protocol changes (PoC7)

commit 1c1ba8d161
Merge: 014d370 3aebe53
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:30:52 2014 +0100

    Merge pull request #31 from CJentzsch/develop

    Restructered tests in folders in accordance to test suites

commit 3aebe532e5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:58:21 2014 +0100

    Updated vmNamecoin.json to new sstore prices

commit 8a0be21839
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:53:00 2014 +0100

    Added example state test

commit 83643addbc
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:36:25 2014 +0100

    removed systemoperationstests

commit 3930ca3a9a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:22:15 2014 +0100

    Restructered tests in folders in accordance to test suites

commit 014d370b5d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 21:23:56 2014 +0100

    New SIGNEXTEND tets

commit 155d449be2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 20:59:05 2014 +0100

    New tests for BNOT and SIGNEXTEND

commit c9eae764b8
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 28 12:58:27 2014 +0100

    Update SSTORE gas cost and BNOT instead of NEG

commit ad2a75ac58
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 16:05:49 2014 +0200

    Added new recursive bombs

commit 834c52af64
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 12:01:05 2014 +0200

    Changing gas cost to zero at stackunderflow

commit c73a8a89d2
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed Oct 22 13:04:45 2014 +0200

    Reverted back to original value.

commit b9a8c92422
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Tue Oct 21 17:02:52 2014 -0400

    fix spelling error

commit b48ae74af4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:26:26 2014 +0200

    Added failing random tests

commit bee0a4100c
Merge: 5050d20 b315da6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:15:05 2014 +0200

    Merge remote-tracking branch 'origin/master' into develop

commit 5050d20b4d
Merge: 7516685 ba35362
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 20 20:18:20 2014 +0200

    Merge pull request #26 from wanderer/develop

    Add a package.json for node.js

commit ba35362876
Author: wanderer <mjbecze@gmail.com>
Date:   Sun Oct 19 23:59:47 2014 -0400

    turned tests into a node module

commit 751668571e
Author: ethers <ethereum@outlook.com>
Date:   Thu Oct 16 17:08:20 2014 -0700

    json was invalid and missing quotes

commit 0e687cee47
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu Oct 16 17:13:24 2014 +0200

    Update vmEnvironmentalInfoTest.json

commit 78a78e2e6c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 15 14:19:11 2014 +0200

    updated genesis_hash

commit b315da618b
Merge: 7a7e198 0a76a3a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 14 10:33:26 2014 +0200

    Merge pull request #23 from ethers/fix22

    numbers should be strings #22

commit 0a76a3a312
Author: ethers <ethereum@outlook.com>
Date:   Mon Oct 13 14:45:30 2014 -0700

    numbers should be strings #22

commit 1f67385f13
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:18:00 2014 +0200

    Added some MUL tests

commit 7a7e198395
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:11:59 2014 +0200

    Added some MUL tests

commit 46eb6283ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 12:18:13 2014 +0200

    tested new opcodes (JUMPDEST,CALLCODE) and created test for CALL/CREATE depth

commit 8d38d62d10
Author: Nick Savers <nicksavers@gmail.com>
Date:   Fri Oct 10 18:09:41 2014 +0200

    INVALID stops the operation and doesn't cost gas

commit ed6eba7c8e
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 19:08:48 2014 +0200

    Update + ABA recursive bomb which needs maximum recursion limit of 1024

commit 2d72050db1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 14:37:18 2014 +0200

    Applied recent protocol changes (PoC7) to existin tests

commit dfe66cab3f
Merge: 4513623 1a67a96
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 11:05:51 2014 +0200

    Merge remote-tracking branch 'origin/develop'

    Conflicts:
    	genesishashestest.json

commit 1a67a96cff
Merge: a4f5f45 ffd6bc9
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 15:10:23 2014 +0100

    Merge pull request #18 from CJentzsch/develop

    CallToNameRegistratorOutOfGas balance correction

commit ffd6bc97ad
Merge: a4f5f45 9779d67
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:47:34 2014 +0200

    Merge remote-tracking branch 'origin/develop' into develop

commit 9779d67b8c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:45:53 2014 +0200

    CallToNameRegistratorOutOfGas balance correction

    Even if execution fails, the value gets transferred.

commit a4f5f45228
Merge: 49a9f47 b6d7cba
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 14:13:12 2014 +0100

    Merge pull request #17 from CJentzsch/develop

    Added A calls B calls A contracts

commit b6d7cba499
Merge: 865cb40 49a9f47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 865cb4083d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:36 2014 +0200

    Added A calls B calls A contracts

commit 49a9f47aec
Merge: 3b0ec43 94a493b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Tue Oct 7 10:56:17 2014 +0200

    Merge pull request #16 from CJentzsch/develop

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 94a493b0d9
Merge: 72853c4 3b0ec43
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:32 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 72853c4382
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:07 2014 +0200

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 3b0ec436e4
Merge: aec3252 222068b
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 05:52:43 2014 +0100

    Merge pull request #15 from CJentzsch/develop

    corrected tests and different style for storage

commit 222068b9ba
Merge: c169653 aec3252
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:28 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit c1696531a6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:09 2014 +0200

    corrected tests and different style for storage

commit aec3252b8e
Merge: 25f9fd5 e17a909
Author: vbuterin <v@buterin.com>
Date:   Mon Oct 6 09:39:46 2014 +0100

    Merge pull request #14 from CJentzsch/develop

    corrected gas limit in vmSystemOperationsTest

commit e17a909f70
Merge: 33fcab5 25f9fd5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:31:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 33fcab5727
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:30:04 2014 +0200

    Bug fix, corrected gasLimit in vmSystemOperationsTest

commit 25f9fd542a
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:47:00 2014 -0400

    one more vm test

commit 2d561a5373
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:15:37 2014 -0400

    separated out vmtests

commit b0c48fa8d6
Merge: cb8261a 6cae166
Author: vbuterin <v@buterin.com>
Date:   Sat Oct 4 17:18:02 2014 +0100

    Merge pull request #13 from CJentzsch/develop

    Added comprehensive EVM test suite. All commands are tested.

commit 6cae166f6f
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 15:34:23 2014 +0200

    Delete tmp.json

commit 4ff906fbc2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 14:06:32 2014 +0200

    corrected CALLSTATELESS tests

commit 5b3fee6806
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 29 13:08:44 2014 +0200

    Completed vm tests. Added ADDMOD, MULMOD, POST, CALLSTATELESS

commit 9cdd218083
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 27 21:48:09 2014 +0200

    Added IOandFlowOperation-, PushDupSwap- and SystemOperations- tests. Removed empty storage from adresses.

commit 28ed968b46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:49:22 2014 +0200

    Added blockInfoTest

commit ffbd5a35b5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:37:52 2014 +0200

    Added environmentalInfo- and sha3- test

commit 54c14f1ff3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 22 13:06:57 2014 +0200

    Added bitwise logic operation test

commit d0af113aab
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 20 01:42:51 2014 +0200

    Added vm arithmetic test

commit cb8261a78b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Sep 19 13:15:44 2014 +0200

    Update genesishashestest.json

commit 4513623da1
Author: Maran <maran.hidskes@gmail.com>
Date:   Tue Jul 22 12:24:46 2014 +0200

    Update keyaddrtest to be valid JSON

commit e8cb5c221d
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 21 23:30:33 2014 -0400

    Added next/prev trie test

commit 98823c04b3
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 14 02:51:31 2014 -0400

    Replaced with deterministic test

commit 357eb21e4d
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun Jul 13 16:12:56 2014 -0400

    Added my own random and namecoin tests (pyethereum)

commit 00cd0cce8f
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jul 12 21:20:04 2014 +0200

    Output hex strings.

commit ddfa3af45d
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 11:28:35 2014 +0100

    Everything a string.

commit d659f469a9
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 10:16:25 2014 +0100

    Code fixes.

commit 5e83ea8228
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 16:17:12 2014 +0200

    Prettier VM tests.

commit a09aae0efe
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 15:46:01 2014 +0200

    Fix VM tests.

commit ec9a044a17
Merge: 4bb6461 5e0123f
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Jul 4 15:56:52 2014 +0200

    Merge pull request #10 from romanman/patch-1

    Update vmtests.json

commit 5e0123fbe1
Author: romanman <roman.mandeleil@gmail.com>
Date:   Fri Jul 4 10:23:04 2014 +0100

    Update vmtests.json

commit 2b6da2f5f2
Author: romanman <roman.mandeleil@gmail.com>
Date:   Thu Jul 3 17:45:04 2014 +0100

    Update vmtests.json

    arith testcase updated

commit 4bb646117d
Merge: bba3898 a33b309
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:22 2014 +0200

    Merge branch 'develop' of github.com:/ethereum/tests into develop

commit bba38980bd
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:06 2014 +0200

    New tests.

commit a33b309d99
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:14:05 2014 -0400

    Testing submodules

commit 50318217ca
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:10:46 2014 -0400

    Testing submodules

commit 57fa655522
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:09:08 2014 -0400

    Testing submodules

commit ea0eb0a8c8
Author: Gav Wood <i@gavwood.com>
Date:   Tue Jul 1 15:19:34 2014 +0200

    Latest genesis block.

commit 25bb76b69c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 13:25:04 2014 +0200

    Reset

commit 74c6d8424e
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 12:10:06 2014 +0200

    Updated wrong test

commit 9ea3a60291
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Sat Jun 28 18:48:28 2014 +0200

    Fixed roots

commit 5fc3ac0e92
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:40:06 2014 +0200

    Simple hex test.

commit edd3a00c2a
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:22:18 2014 +0200

    Additional test for jeff. Now use the 0x... notation.

commit 5021e0dd83
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 21:35:26 2014 +0200

    VM test framework updated.

commit c818d13202
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 18:18:24 2014 +0200

    Removed arrays from Trie tests JSON as per conformance guide and changed
    vocabulary to match other tests.
    VM test updates.

commit 714770ffb3
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jun 11 11:32:42 2014 +0100

    Added Gav's new address.

commit 9345bc13d4
Merge: a2257f3 78576dd
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:38 2014 +0200

    Merge branch 'master' of github.com:ethereum/tests into develop

commit a2257f3471
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:18 2014 +0200

    VM tests.

commit 78576dd3d3
Author: Heiko Heiko <heiko@heiko.org>
Date:   Fri May 30 17:19:09 2014 +0200

    changes based on new account structure nonce, balance, storage, code

commit 125839e848
Merge: 42e14ec 356a329
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu May 22 09:58:45 2014 +0200

    Merge pull request #5 from bkirwi/master

    Fix invalid JSON (removed trailing comma) and add test names

commit 356a3296bc
Author: Ben Kirwin <ben@kirw.in>
Date:   Thu May 22 00:20:48 2014 -0400

    Add some arbitrary test names

    This should now conform to the format specified in the README.

commit 42e14ec54f
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 23:27:40 2014 +0800

    revert to correct data

commit 4300197a74
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:42:23 2014 +0800

    fix: wrong sha3 hash because of the wrong rlp hex

commit a0d01b1a0b
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:29:53 2014 +0800

    fix: wrong rlp hex

commit 6bc2fc7405
Merge: 66bc366 c31a93c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed May 21 14:11:37 2014 +0200

    Merge pull request #4 from ethers/master

    fix file name that seems to have been a typo

commit c31a93c27a
Author: ethers <ethereum@outlook.com>
Date:   Tue May 20 15:42:39 2014 -0700

    fix file name that seems to have been a typo

commit 66bc3665c1
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:36:35 2014 +0200

    fix: represent integers as strings

commit ede5499da6
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:21:09 2014 +0200

    add: current initial alloc and genesis hashes

commit 5131429abb
Author: Ben Kirwin <ben@kirw.in>
Date:   Mon May 19 11:18:31 2014 -0400

    Delete a comma

    This should now be parseable as JSON.

commit f44a859331
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Sun May 18 15:04:42 2014 +0800

    add: case when value is long, ensure it's not get rlp encoded as node

commit e1ae4ad449
Author: Gav Wood <i@gavwood.com>
Date:   Mon May 12 14:40:47 2014 +0100

    PoC-5 VM tests.

commit 2b6c136dda
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun May 11 21:42:41 2014 -0400

    Moved txt to json

commit cbccbf977c
Merge: edbb8d4 45a0974
Author: Vitalik Buterin <v@buterin.com>
Date:   Thu May 8 21:54:48 2014 -0400

    New commit

commit edbb8d407e
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue May 6 16:53:43 2014 -0400

    Removed unneeded test, added new tests

commit 45a0974f6f
Merge: 15dd8fd 5fd2a98
Author: Gav Wood <i@gavwood.com>
Date:   Sun Apr 27 12:53:47 2014 +0100

    Merge pull request #3 from autolycus/develop

    Fixed formatting and added test cases

commit 5fd2a98fcb
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 13:26:14 2014 -0700

    Added some new test cases for the rlp encoding.

commit 4ba150954e
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 12:48:42 2014 -0700

    Converted spaces to tabs to be compliant with the coding standards defined in cpp-ethereum

commit 15dd8fd794
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 12:54:47 2014 +0000

    RLP tests and Trie updates.

commit 33f80fef21
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:39:35 2014 +0000

    Hex encode tests done.

commit e1f5e12abb
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:22:49 2014 +0000

    Fix RLP tests.

commit f87ce15ad2
Author: Gav Wood <i@gavwood.com>
Date:   Thu Feb 27 13:28:11 2014 +0000

    Fix empty string.

commit c006ed4ffd
Author: Gav Wood <i@gavwood.com>
Date:   Mon Feb 24 10:24:39 2014 +0000

    Tests fix.

commit 510ff56363
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:54:08 2014 +0000

    Updated the tests.

commit a0ec843832
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:49:24 2014 +0000

    Moved over to new format, but RLP tests still need updating.

commit 660cd26f31
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:35:51 2014 +0000

    More docs.

commit 6ad14c1a15
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:33:39 2014 +0000

    Added VM test suite.
    Added TODO.
    Renamed old files.

commit f91ad7b385
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 11:26:58 2014 -0500

    update trie algorithm

commit 6da2954462
Merge: cc42246 131c610
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 08:15:38 2014 -0500

    merge

commit cc4224675f
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Jan 7 14:35:26 2014 -0500

    Updated trie test

commit 131c610da6
Merge: 121632b 7613302
Author: vbuterin <v@buterin.com>
Date:   Wed Jan 1 06:40:54 2014 -0800

    Merge pull request #1 from obscuren/master

    Update trietest.txt

commit 7613302b49
Author: obscuren <obscuren@users.noreply.github.com>
Date:   Wed Jan 1 15:25:21 2014 +0100

    Update trietest.txt

    New proposed explanatory format

commit 121632bedd
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 1 08:26:18 2014 -0500

    Added obscure's tests

commit ef6c5506c3
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 19:04:48 2013 -0500

    Fixed tests a bit

commit 345e4bcfef
Merge: 2c81698 e4bbea4
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 15:52:46 2013 -0500

    Merge branch 'master' of github.com:ethereum/tests

commit 2c81698f31
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Dec 30 21:09:40 2013 -0500

    Added first three tests

commit e4bbea400f
Author: vbuterin <v@buterin.com>
Date:   Mon Dec 30 18:09:03 2013 -0800

    Initial commit
2014-11-04 17:11:19 +01:00
b96a59eb28 Added tests for extra large values
Test “E” scientific notation formatting
2014-11-04 16:45:54 +01:00
64b6172089 added db 2014-11-04 16:43:02 +01:00
e7d9bcd36b Added Douglas and Einstein cases 2014-11-04 16:42:28 +01:00
123282e045 Update variable name to match unit name 2014-11-04 16:41:03 +01:00
e22e8b7fef Environment tests 2014-11-04 16:39:08 +01:00
a9db1ee8d4 Replaced to return the td and throw a specific error on TD 2014-11-04 13:00:47 +01:00
699dcaf65c Reworked chain handling process
* Forks
* Rename
* Moved inserting of blocks & processing
* Added chain testing method for validating pieces of a **a** chain.
2014-11-04 12:46:33 +01:00
f4b717cb9d Bloom validation 2014-11-04 11:04:02 +01:00
f59a3b67f6 StateManager => BlockManager 2014-11-04 10:57:02 +01:00
1025d097fd removed old bloom 2014-11-04 10:49:25 +01:00
d56d0c64aa Version bump 2014-11-04 01:50:16 +01:00
0c4adeceae Properly list caps 2014-11-04 01:47:02 +01:00
f76f953f0c Removed debug print 2014-11-04 01:33:31 +01:00
9c2b878678 Sha addresses 2014-11-04 01:29:49 +01:00
a82b89e2d5 Added storage root to dump 2014-11-03 23:45:44 +01:00
c8302882c8 method change 2014-11-03 23:45:32 +01:00
d87aa24885 Fixed genesis 2014-11-03 23:45:16 +01:00
92c7aca817 Refactored compress method into something more organised 2014-11-03 14:59:50 +01:00
76c9c8d653 Compress data on db level. Closes #174 2014-11-03 00:31:15 +01:00
bd4f51ff3c Use new iterator 2014-11-03 00:30:52 +01:00
5dcf59bdf4 Forgot to put in regular bytes during decompression 2014-11-03 00:29:34 +01:00
9f8bcf3abc Added RLE compression. Closes #171 2014-11-02 23:33:06 +01:00
1bb398f4e2 Sign ext 2014-11-02 19:39:45 +01:00
3f90f7c898 Signextend 2014-11-01 02:14:55 +01:00
c8438979a9 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-11-01 01:18:13 +01:00
141d3caabb Re-org op codes 2014-11-01 01:18:03 +01:00
394e0f60c2 chain, tests/helper, vm: make tests compile
They were broken by df5603de0a, when vm.Log became ethstate.Log.
2014-10-31 18:56:25 +01:00
b95d9e005d .gitignore: ignore .ethtest 2014-10-31 18:55:39 +01:00
f3473312ba all: fix rename breakage 2014-10-31 18:52:58 +01:00
5af4ff985d ethminer => miner 2014-10-31 14:56:42 +01:00
4914a78c8c ethwire => wire 2014-10-31 14:53:42 +01:00
af34749a6b ethtrie => trie 2014-10-31 14:45:03 +01:00
af8f5f0b69 ethstate => state 2014-10-31 14:43:14 +01:00
0ed1a8b50a ethpipe => xeth (eXtended ETHereum) 2014-10-31 14:30:08 +01:00
8826e9694c Moved utils to cmd 2014-10-31 14:20:11 +01:00
b1c247231b ethlog => logger 2014-10-31 12:56:05 +01:00
fd9da72536 ethcrypto => crypto 2014-10-31 12:37:43 +01:00
3ee0461cb5 Moved ethchain to chain 2014-10-31 10:59:17 +01:00
8e0a39f33f Updated to use ethereum.js 2014-10-31 10:50:16 +01:00
df5603de0a Moved logging to state, proper structured block
* Moved logs to state so it's subject to snapshotting
* Split up block header
* Removed logs from transactions and made them receipts only
2014-10-30 13:32:50 +01:00
fa890c8c01 Merge pull request #167 from fjl/feature/split-tx-event
Split TxEvent type for tx pre/post
2014-10-29 21:10:04 +01:00
ce2ec1980b Merge pull request #166 from fjl/fix/mist-quit
Fix Mist Shutdown
2014-10-29 21:09:32 +01:00
f05d422a97 ethchain: fix dependency 2014-10-29 20:39:26 +01:00
2ef044edfc Use new bloom when filtering for topics 2014-10-29 20:33:25 +01:00
cc67a84e94 Added bloom 9 point lookup and bloom test 2014-10-29 20:16:18 +01:00
81ec564ef6 Merge pull request #168 from fjl/feature/working-tests
Fix the tests
2014-10-29 19:48:38 +01:00
4cf69d7cd3 vm: fix basic VM tests
The tests now compile and won't panic for unexpected return values.

We need a recent-enough version of the mutan compiler because of
the new JUMPDEST requirements. Skip some tests if the installed mutan
version is too old. The debug VM test still fails, probably because
of an implementation bug.
2014-10-29 18:50:17 +01:00
38034c3066 ethwire: fix ClientIdentity test 2014-10-29 18:39:51 +01:00
56014844a9 ethpipe: delete useless test
It didn't compile and wouldn't have checked any results if it ever ran.
2014-10-29 18:38:52 +01:00
d9bccdde23 ethchain: fix tests
Adapted to recent BlockChain -> ChainManager rename.
2014-10-29 18:38:05 +01:00
051af604e2 ethcrypto: fix the tests
The Sha3 test contained the wrong expected result. Note that the
implementation hasn't changed, the test simply contained an outdated
expected value that was valid for the previous implementation.
2014-10-29 18:35:33 +01:00
9e2f071d26 Removed events from the state manager 2014-10-29 14:20:42 +01:00
fb4113dab4 PoC 7 updates
* Bloom
* Block restructure
* Receipts
2014-10-29 10:34:40 +01:00
665a44646e Generic hashing method 2014-10-29 10:29:22 +01:00
6b3f5fb82b cmd/mist, ethchain, ethminer: split TxEvent (#165) 2014-10-29 03:50:20 +01:00
e252dbf989 eth: stop eventMux first
This fixes the hang in Ethereum.Stop.
2014-10-29 03:01:20 +01:00
8170f96ded javascript: remove unused quit channel
This fixes the hang in JSRE.Stop.
2014-10-29 03:00:29 +01:00
48125a25eb Added missing requires on SSTORE SLOAD 2014-10-28 13:26:30 +01:00
7849b7e978 Refund SSTORE properly 2014-10-28 13:22:04 +01:00
5920aa7be6 Updated readme 2014-10-27 17:24:43 +01:00
1e55fe3aa2 Updated readme 2014-10-27 17:22:29 +01:00
9d386033ef Added bug 2014-10-27 17:16:03 +01:00
2b02d81253 Added in progress to readme 2014-10-27 17:14:37 +01:00
11b3f97520 Upped protocol 2014-10-27 17:02:45 +01:00
10782c5aae Added removal off erroneous txs. Fixed pipeline 2014-10-27 17:02:31 +01:00
cbc6709937 Version bump 2014-10-27 16:53:31 +01:00
ca18b3f1e9 Do not return error on VM exception 2014-10-27 16:53:20 +01:00
69e745c537 Return erroneous txs (so we can remove them from the pool) 2014-10-27 16:52:58 +01:00
003280888d increased default gas from 500 to 5000 2014-10-27 12:25:54 +01:00
797b93c98c Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-10-27 11:50:50 +01:00
b095bd3237 events should be set prior to calling mainloop 2014-10-27 11:50:38 +01:00
1d3f43f060 Added generic add balance method 2014-10-27 11:44:40 +01:00
d586dd902d Fixed bloom 2014-10-27 11:44:28 +01:00
272d58662c Implemented LOG. Closes #159 2014-10-27 11:44:16 +01:00
6623500c6b Implemented new bloom filter. Closes #156 2014-10-27 11:22:27 +01:00
08c26ab8b0 Removed unnecessary code. 2014-10-26 20:09:51 +01:00
f62b6742f2 Merge pull request #152 from ethersphere/p2p
initial commit of p2p package
2014-10-24 12:20:50 +01:00
e73aad959e ethutil: re-add build constraints in script*.go (fixes #151) 2014-10-24 01:04:10 +02:00
771fbcc02e initial commit of p2p package 2014-10-23 16:57:54 +01:00
119c5b40a7 Merge pull request #150 from fjl/develop
Merge eth-go repo into go-ethereum
2014-10-23 16:46:18 +02:00
184055b3e2 cmd/*: add license headers 2014-10-23 15:48:53 +02:00
bd2862aec6 fix 'go get' commands in after the move to cmd/ 2014-10-23 15:06:26 +02:00
69baa465ea Merge eth-go repository into go-ethereum
mist, etheruem have been moved to cmd/
2014-10-23 15:01:27 +02:00
feef194829 Chnged to use GetOp instead & added error + checking 2014-10-23 14:04:00 +02:00
91c876831a Update to HEAD tests 2014-10-23 13:25:10 +02:00
06aa74e7df All Stack requirements are now checked prior to reduring gas. 2014-10-23 10:14:55 +02:00
50fd469249 Merge branch 'master' into develop 2014-10-23 01:03:22 +02:00
7daa8c2f6e Merge pull request #148 from waffle-iron/master
waffle.io Badge
2014-10-23 01:03:05 +02:00
bb03276c19 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-10-23 01:01:56 +02:00
411b9800ae Reflect VM Env changes 2014-10-23 01:01:41 +02:00
29b8a0bc5f Updated the VM & VM tests
* Stack Error shouldn't revert to previous state
* Updated VM Test tool
* Added Transfer method to VM Env
2014-10-23 01:01:26 +02:00
2e45e4d015 Print error using regular println. Fixes #146
We can't use our own logger because it hasn't been set up properly at
that point.
2014-10-23 00:59:35 +02:00
5662176f8c Merge pull request #149 from JosephGoulden/develop
Develop
2014-10-23 00:30:38 +02:00
1880c6b3dc Make tab capitisation consistent 2014-10-22 23:00:22 +01:00
6247a99f41 add waffle.io badge 2014-10-22 15:56:40 -06:00
53d5c490be Fix right-click context menu of block chain view. 2014-10-22 22:50:47 +01:00
51ecab6967 Do not set error on recover 2014-10-22 23:39:15 +02:00
037039cace Updated tests-subtree 2014-10-22 15:24:17 +02:00
b5beb1aac1 added a transfer method to vm env 2014-10-22 15:22:21 +02:00
ce05634f38 Debug only if a tx is set. Fixes #134 2014-10-22 11:11:12 +02:00
27cb0750c1 Procotol version bump for uncle list change 2014-10-21 13:43:30 +02:00
6b92d541da Empty string for uncle 2014-10-21 13:30:23 +02:00
6f08e30109 Reflect RPC changes 2014-10-21 13:25:54 +02:00
520fdfe346 PoC7 Net 2014-10-21 13:25:31 +02:00
10b252dd05 WIP RPC interface 2014-10-21 13:24:48 +02:00
6ea44c466a Updated to reflect BlockChain changes 2014-10-20 12:03:31 +02:00
097ba56df5 Renamed block_chain to chain_manager 2014-10-20 11:53:11 +02:00
33ca8d7b8f moved 2014-10-18 23:31:10 +02:00
3ad1daa70d Added tests as subtree 2014-10-18 23:28:16 +02:00
3bc64b6b6e Readers 2014-10-18 23:20:25 +02:00
73c1c2c4af Travis bumped to 1.3 2014-10-18 14:20:51 +02:00
350b0b1f66 Re-enabled Travis 2014-10-18 13:50:48 +02:00
3ea0e904ad Reflect changed to eth/vm 2014-10-18 13:33:02 +02:00
20c742e474 Moved ethvm => vm 2014-10-18 13:31:20 +02:00
82a2e4fe28 Reflect changes to the eth/vm 2014-10-18 13:31:04 +02:00
6956b5104f fmt package was missing 2014-10-18 13:30:38 +02:00
a02dc4ccc3 Using proper naming scheme. Fixes #63 2014-10-18 13:23:01 +02:00
77badc8c46 Updated to reflect the Filter changes in eth-go 2014-10-18 13:20:35 +02:00
d2bb83833f Moved Filter's wrapping functions to their own util package. Fixes #61
* CLI ethereum should no longer require the Qt/QML package
2014-10-18 13:20:06 +02:00
e57989c0a6 Merge pull request #141 from thibauld/develop
Update documentation and install script to reflect renaming from ethereal to mist
2014-10-18 12:34:03 +02:00
b94dfc8d3a Update documentation and install.sh script to reflect renaming from ethereal to mist 2014-10-17 19:14:16 -04:00
70a00d602e Merge pull request #62 from fjl/fuck
tests/vm: fix syntax
2014-10-17 18:17:04 +02:00
df238dc7ec tests/vm: fix syntax 2014-10-17 17:39:31 +02:00
abdf5e76f3 Merge pull request #138 from erezwanderman/fixwindows
Fix ethereum compilation and functioning on Windows.
2014-10-17 17:26:04 +02:00
03fd832ee8 Merge pull request #139 from fjl/feature/simpler-log-system
Update for new ethlog.LogSystem interface
2014-10-17 17:24:51 +02:00
fc308b842e Merge pull request #59 from fjl/feature/raceless-ethlog
Improve package ethlog
2014-10-17 17:24:44 +02:00
35f339e942 ethlog: fix typo in documentation 2014-10-17 17:23:29 +02:00
fd9b03a431 ethlog: fix concurrency
Rather than spawning a new goroutine for each message,
run each log system in a dedicated goroutine.

Ensure that logging is still asynchronous by using a per-system buffer
(currently 500 messages). If it overflows all logging will hang,
but that's better than spawning indefinitely many goroutines.
2014-10-17 17:23:29 +02:00
c090a77f1c ethlog: simplify LogSystem interface
Messages are formatted by generic part, so the log system doesn't need
to provide formatting. This fixes the test from the previous commit.

As a small bonus, log systems now have access to the level of
the message. This could be used to provide colored logging in the
future.
2014-10-17 17:23:29 +02:00
50f5ba5b0c ethlog: add test for '%' in log message
This test fails because the log message is formatted twice.
2014-10-17 17:23:29 +02:00
cbd785cfe8 ethvm, tests/*: use log level constants 2014-10-17 17:23:28 +02:00
0165c18330 ethlog: use Godoc for code examples in documentation
This ensures that examples will actually compile.
2014-10-17 17:20:44 +02:00
e0f93c74c5 ethlog: add Godoc documentation, remove README 2014-10-17 17:20:44 +02:00
a6265cb49a ethlog: verify that Flush is blocking in TestLoggerFlush 2014-10-17 17:20:44 +02:00
793baf060a ethlog: don't buffer output in TestConcurrentAddSystem 2014-10-17 17:20:44 +02:00
ec132749aa ethlog: improve TestLogSystem
It's now safe for concurrent access.
Output checking looks better.
2014-10-17 17:20:44 +02:00
45d1052229 ethlog: fix StdLogSystem data race on level 2014-10-17 17:20:44 +02:00
d5a7ba1626 ethlog: add test that adds log systems concurrently 2014-10-17 17:20:44 +02:00
3b1296077b ethlog: Reset before each test 2014-10-17 17:20:43 +02:00
dac128a029 ethlog: fix test compilation error 2014-10-17 17:20:43 +02:00
4e95cecfb9 ethlog: improve dispatch concurrency
This also fixes a deadlock in the tests.
2014-10-17 17:20:43 +02:00
3976b52ed7 Updated vm 2014-10-17 17:14:29 +02:00
e183880d8b arith test 2014-10-17 17:11:45 +02:00
d7736a7bbb Quick dirty peer update 2014-10-17 17:11:34 +02:00
df2b70853f Merge pull request #58 from fjl/feature/event
Blocking event package
2014-10-17 17:10:34 +02:00
9e6411db31 Merge pull request #140 from fjl/feature/event
Adapt to new event package
2014-10-17 17:10:30 +02:00
3b70985284 added eth tester 2014-10-16 21:34:59 +02:00
fa84e50ddb event: panic for duplicate type 2014-10-16 18:59:28 +02:00
ade980912d ethreact: remove package 2014-10-16 18:51:21 +02:00
28570ef109 eventer: remove package 2014-10-16 18:51:21 +02:00
20cdb73862 ethchain: fix tests 2014-10-16 18:51:21 +02:00
36cdab2068 all: use (blocking) event package instead of ethreact 2014-10-16 18:50:48 +02:00
6906904896 event: make TypeMux zero value ready to use 2014-10-16 18:50:48 +02:00
10bbf265b2 event: make Unsubscribe idempotent 2014-10-16 18:50:48 +02:00
dac4a8f113 event: add some documentation 2014-10-16 18:50:48 +02:00
93fcabd251 Fixed most of the tests 2014-10-16 18:27:05 +02:00
f5b8775bed event: new package for event multiplexer 2014-10-16 18:14:35 +02:00
bb5038699e Corrected package .... 2014-10-16 13:41:44 +02:00
65cdb3436e Updated tests 2014-10-16 13:40:46 +02:00
86f789333a Moved state reset to defered function 2014-10-16 13:39:30 +02:00
febec5ca4a Switch EXT* codes 2014-10-16 13:39:11 +02:00
70f7a0be11 Use the state instead of the state object directly.
If a state gets reset and you still hold a pointer to the previous,
incorrect, state object you'll operate on the wrong object. Using the
state to set/get objects and attributes you won't have this problem
since the state will always have the correct object.
2014-10-16 13:38:21 +02:00
0a99719a39 mist: update for new ethlog.LogSystem interface (in ethereum/eth-go#59) 2014-10-16 12:07:43 +02:00
311c6f8a3f Fixed remote Arithmetic tests 2014-10-15 17:12:26 +02:00
7227552f42 Fix ethereum compilation and functioning on Windows.
repl console output is now colored.
repl "exit" command now works.
2014-10-15 02:41:26 +03:00
266d212094 Working on test suite 2014-10-15 00:41:00 +02:00
3d177be73e Couple of minor issues fixed
* CALLVALUE pushed incorrect value to the stack
* Set execution model to closure
2014-10-15 00:40:41 +02:00
0aea5fc4a3 adapt to new event package 2014-10-14 19:38:38 +02:00
7ca7938d8e Removed old installer script 2014-10-14 15:31:25 +02:00
f55e39cf1a Tests for native function calling 2014-10-14 13:37:26 +02:00
393a92811b Changed VM Test code 2014-10-14 12:21:46 +02:00
294b437414 New VM 2014-10-14 11:49:15 +02:00
c5bd32b0ad Refactored VM to two separate VMs; std & debug
Standard VM should be about 10x faster than the debug VM. Some error
checking has been removed, all of the log statements and therefor quite
some unnecessary if-statements.
2014-10-14 11:48:52 +02:00
03e082d4ac Merge branch 'master' into develop 2014-10-14 09:47:38 +02:00
db6f4ab1cc Merge branch 'master' into develop 2014-10-14 09:47:19 +02:00
1644b1e53e Merge pull request #137 from caktux/master
build status
2014-10-13 12:57:50 +02:00
cfd1f0907f build status 2014-10-12 02:15:15 -04:00
2e894b668a Max callstack 2014-10-11 00:41:37 +02:00
8128190fb2 Merge pull request #136 from fjl/feature/raceless-ethereum-filters
Fix chain filter data race
2014-10-10 22:59:11 +02:00
cb845b9bc8 Implemented AR PoW 2014-10-10 22:44:20 +02:00
56843ca0fc Added some methods to comply to the PoW block interface 2014-10-10 22:42:37 +02:00
e02c0fa808 Added generic big to 256 method. Implemented new iterator 2014-10-10 17:00:06 +02:00
9b494c6869 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-10-10 16:58:26 +02:00
3db6a8e92d Merge pull request #57 from fjl/feature/raceless-ethereum-filters
Fix filter map race
2014-10-10 16:57:54 +02:00
6fec5bd32e Merge pull request #56 from fjl/feature/raceless-eventer
Fix Eventer race
2014-10-10 16:57:50 +02:00
6877660fe2 Implemented new iterator 2014-10-10 16:56:28 +02:00
c1f8a640d3 mist: adapt to API changes in ethereum/eth-go#57 2014-10-08 19:16:03 +02:00
e83a999039 eth: fix filter map data race
This commit also documents (but doesn't enforce) that filters
are immutable while they're installed. This required a minor API
change.
2014-10-08 19:04:58 +02:00
44674cb96c eventer: fix data race 2014-10-08 16:31:08 +02:00
d451269977 eventer: add test for concurrent Post/Register
This test reports the race condition when run
using "go test -race".
2014-10-08 16:31:08 +02:00
7c9508ed71 eventer: fix tests 2014-10-08 16:31:08 +02:00
a38dafcc57 Moved the To256 2014-10-08 16:11:36 +02:00
bd7aca76e1 Proper new block 2014-10-08 12:33:33 +02:00
4de3ad1712 New block message 2014-10-08 12:29:49 +02:00
83a4b8b49b Version bump 2014-10-08 12:24:42 +02:00
b93d6ca5d2 Renamed Sha3Bin to Sha3 2014-10-08 12:06:48 +02:00
9d86a49a73 Renamed Sha3Bin to Sha3 2014-10-08 12:06:39 +02:00
f3196c915a Precompiled crypto contracts 2014-10-08 12:01:36 +02:00
9b60cf267a Removed POST & moved CALLCODE 2014-10-08 12:01:14 +02:00
11ace54307 ECRECOVER RIPEMD160 SHA256 2014-10-08 12:00:50 +02:00
6de726f16c Protocol bump 2014-10-08 12:00:03 +02:00
b417766b36 Minor tweaks for poc7 2014-10-08 11:59:44 +02:00
b4fa28a3e6 Merge branch 'release/0.6.8' into develop 2014-10-07 11:21:29 +02:00
d1a6084bf7 Merge branch 'release/0.6.8' 2014-10-07 11:20:52 +02:00
a9b857769d bump 2014-10-07 11:19:42 +02:00
0015ce1e35 kick of bad peers 2014-10-07 11:18:46 +02:00
4ed94d3d51 removed old windows & added websockets to mist 2014-10-07 11:18:34 +02:00
e100aa3c6c Changed to new "created address" 2014-10-02 17:35:57 +02:00
677836cbee Kick off bad peers on bad chains and improved catch up on diverted chain 2014-10-02 17:35:38 +02:00
a75c92000f Black listing of bad peers 2014-10-02 17:03:48 +02:00
b55e017e62 Proper delete 2014-10-02 17:03:36 +02:00
82be305496 Fixed inconsistencies 2014-10-02 17:03:15 +02:00
5053ec2190 Added download label 2014-10-02 01:37:23 +02:00
a34a971b50 improved blockchain downloading 2014-10-02 01:36:59 +02:00
5fa0173c41 msg 2014-10-02 00:03:19 +02:00
3af211dd65 Implemented WebSocket package 2014-09-30 23:26:52 +02:00
6db40ecb22 WebSocket interface
Web sockets handlers fully implemented. Filter handlers have yet to be
implemented.
2014-09-30 23:26:16 +02:00
ab6ede51d7 Working on new (blocking) event machine.
The new event machine will be used for loose coupling and handle the
communications between the services:

1) Block pool finds blocks which "links" with our current canonical
chain
2) Posts the blocks on to the event machine
3) State manager receives blocks & processes them
4) Broadcasts new post block event
2014-09-29 12:57:51 +02:00
ea0357bf02 Block pool is thread safe 2014-09-28 14:52:58 +02:00
44d50bc8d2 Have you seen my parents, sir? 2014-09-26 20:51:31 +02:00
e20b113053 Logging messages 2014-09-26 20:19:11 +02:00
0acdeca3d6 skip messages properly 2014-09-26 20:19:01 +02:00
a45e293267 Merge branch 'release/0.6.7' into develop 2014-09-26 13:48:04 +02:00
41ae6f298e Merge branch 'release/0.6.7' into develop 2014-09-26 13:47:47 +02:00
bd95fd770b Merge branch 'release/0.6.7' 2014-09-26 13:47:29 +02:00
b8354124be Added protocol caps accessors 2014-09-26 13:45:26 +02:00
2b8eae9810 Added protocol caps to window 2014-09-26 13:45:18 +02:00
b2dc19155f Renamed wallet to main 2014-09-26 13:38:40 +02:00
7a5b279459 Version bump 2014-09-26 13:35:48 +02:00
cf999c4622 Cleaned up 2014-09-26 13:34:06 +02:00
68119d0929 Fixed messages to use proper numbers 2014-09-26 13:32:54 +02:00
9ed8dc7384 Attempt to catch up from unknown block 2014-09-25 16:57:49 +02:00
dc944f7518 Added some lookup helper methods for name reg 2014-09-25 10:33:05 +02:00
d5d1e50365 Support multiple promises as data or mixed with non promises 2014-09-25 10:32:54 +02:00
2458697dad Merge branch 'master' into develop 2014-09-24 21:37:05 +02:00
206672db5e Merge pull request #52 from nicksavers/winfix
Add blank line after +build comment
2014-09-24 21:36:37 +02:00
5c2aa1d4f5 Merge branch 'master' into develop 2014-09-24 21:21:03 +02:00
5cb4120ef5 queue get peers each 10 seconds 2014-09-24 21:20:57 +02:00
496df5c29a Merge branch 'master' into develop 2014-09-24 21:13:35 +02:00
3aeba50c38 merge error 2014-09-24 21:13:28 +02:00
29f5dd38e3 Merge branch 'release/0.6.6' into develop 2014-09-24 20:41:22 +02:00
b8b1453392 Merge branch 'release/0.6.6' 2014-09-24 20:41:11 +02:00
ecdda01841 Merge branch 'release/0.6.6' into develop 2014-09-24 20:41:03 +02:00
bb4495722f Merge branch 'release/0.6.6' 2014-09-24 20:40:54 +02:00
1118aaf840 Temp work around 2014-09-24 20:40:40 +02:00
1cb12296f6 Temp work around 2014-09-24 20:40:18 +02:00
96fd1ce270 Bump 2014-09-24 20:04:14 +02:00
544b7fba7f Merge branch 'tmp' into develop
Conflicts:
	peer.go
2014-09-24 19:59:14 +02:00
6ecbbe4006 Download indicator 2014-09-24 19:57:22 +02:00
cba2f6c2c4 Block pool stop / start 2014-09-24 19:56:21 +02:00
1fe2d0d0e0 Peers no longer take care of block processing 2014-09-24 19:55:28 +02:00
54558dd8ae Removed log 2014-09-24 19:54:51 +02:00
60a8c9527c Mine without txs 2014-09-24 19:54:37 +02:00
84690bfbbe Changed the block fetching code and hash distribution 2014-09-24 19:54:30 +02:00
d3a0bb4f35 Info => Debug 2014-09-24 19:54:14 +02:00
ad13b402d7 Fixed race condition 2014-09-24 17:47:01 +02:00
b66fcf85df checkp 2014-09-24 11:55:02 +02:00
ba43364f36 tmp 2014-09-24 11:41:57 +02:00
57dc435f9b Added TD for each block 2014-09-24 11:39:17 +02:00
c582890590 Add blank line after +build comment 2014-09-23 20:04:06 +02:00
615d20598a Merge branch 'develop' 2014-09-23 18:19:56 +02:00
46a496428f ugh 2014-09-23 18:19:51 +02:00
acfb5b85fb Merge branch 'hotfix/0.6.5-2' into develop 2014-09-23 17:56:50 +02:00
70db149494 Merge branch 'hotfix/0.6.5-2' 2014-09-23 17:56:43 +02:00
a4007f3b68 Fixed min gas price on coin 2014-09-23 17:56:35 +02:00
bc1a173d2f Merge branch 'hotfix/0.6.5-3' into develop 2014-09-23 17:55:54 +02:00
5c5db7d931 Merge branch 'hotfix/0.6.5-3' 2014-09-23 17:55:45 +02:00
6800c3665a Re-added min gas price check on tx pool 2014-09-23 17:55:34 +02:00
b73c07dd80 Merge branch 'hotfix/0.6.5-2' into develop 2014-09-23 12:00:25 +02:00
ea67d853a8 Merge branch 'hotfix/0.6.5-2' 2014-09-23 12:00:10 +02:00
ac5e86b7ae Removed windows support for serpent :-( 2014-09-23 12:00:01 +02:00
353b558536 Merge branch 'develop' 2014-09-23 10:23:46 +02:00
8516e748ca Actually remove it alltogether 2014-09-23 10:23:37 +02:00
8780deece9 Merge branch 'hotfix/0.6.5-1' into develop 2014-09-23 10:21:45 +02:00
29ca238a7a Merge branch 'hotfix/0.6.5-1' 2014-09-23 10:21:39 +02:00
1b66e1c93a Merge branch 'hotfix/0.6.5-1' into develop 2014-09-23 10:21:29 +02:00
0705bb3fe5 Merge branch 'hotfix/0.6.5-1' 2014-09-23 10:21:13 +02:00
48fd23dc10 don't mine without transactions 2014-09-23 10:20:55 +02:00
6e4818d742 Konami 2014-09-23 10:20:35 +02:00
df30588eb6 Merge branch 'release/0.6.5' into develop 2014-09-22 19:34:49 +02:00
ce149d2733 Merge branch 'release/0.6.5' 2014-09-22 19:34:31 +02:00
9ac4e23b66 Merge branch 'release/0.6.5' into develop 2014-09-22 19:34:07 +02:00
7d08e4f7d1 Remove log 2014-09-22 18:15:32 +02:00
2ae3bda029 Increased from 200 nano to milliseconds 2014-09-22 18:15:10 +02:00
1bc815e0b1 Remove log 2014-09-22 16:30:30 +02:00
16871ae2b4 New Peer server 2014-09-22 16:28:49 +02:00
9ed5b4d90e Support C++ GetBlockHash by assuming empty = done 2014-09-22 16:28:28 +02:00
b65f29f8fa Added JavaScript JSON helper 2014-09-22 14:51:41 +02:00
65a802c678 Re-wrote Call and Execute to use the new vm messages 2014-09-22 14:51:21 +02:00
151f9c7f82 BigInt accept string 2014-09-22 14:50:53 +02:00
80261c803a Fixed deref ptr 2014-09-19 13:19:19 +02:00
863785a520 Updated opcodes 2014-09-18 16:48:42 +02:00
f3a93b046e Upped protocol version for VM change 2014-09-18 01:02:15 +02:00
b3834d8272 Removed extra slash so @nicksavers gets off my back ;-) 2014-09-17 16:28:30 +02:00
a26c479182 Added len 2014-09-17 15:58:02 +02:00
9559b53228 Added Past peers option 2014-09-17 15:57:44 +02:00
eb32fe20c8 Rewrite 2014-09-17 15:57:32 +02:00
fd041d91ee Truncate when writing 2014-09-17 15:57:07 +02:00
1549a29c9d Connect to previous peer 2014-09-16 16:36:27 +02:00
66e309c5c4 Up deadline to reduce cpu load 2014-09-16 16:36:18 +02:00
fb528c47c0 Moved code 2014-09-16 16:19:48 +02:00
74de0f1f2a Rewrote reading strategy 2014-09-16 16:06:38 +02:00
d02024929a require 5 for post 2014-09-16 11:35:26 +02:00
399256b384 VM execution fixes
Refactoring caused executing issues
2014-09-15 22:11:05 +02:00
33a0dec8a1 Improved catching up and refactored 2014-09-15 15:42:12 +02:00
2f614900e8 Updated GHOST 2014-09-15 01:11:01 +02:00
4db4ec1621 Added unique set 2014-09-15 01:10:50 +02:00
74ef22d824 add it to the list 2014-09-14 14:30:33 +02:00
86d1a26b13 fixed status message 2014-09-14 14:09:46 +02:00
742a9b00bc tmp 2014-09-14 13:47:29 +02:00
9e89dacc64 log removed 2014-09-14 13:42:13 +02:00
f63cb27803 tmp 2014-09-14 13:42:02 +02:00
954ba211bf Fixed contract validation address in tx pool 2014-09-14 12:02:35 +02:00
4b4830692a Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-09-14 00:13:32 +02:00
2fb57b2ea7 Reworked filters 2014-09-14 00:13:23 +02:00
96cf6fc147 Merge branch 'master' into develop 2014-09-13 14:39:10 +02:00
8ef17c2fb1 fi crypto 2014-09-13 14:39:01 +02:00
10564723b9 added string casting 2014-09-13 13:14:24 +02:00
369e8c4150 Merge pull request #49 from WeMeetAgain/develop
add pushtx to api
2014-09-11 13:28:05 +03:00
c0187930dc Removed some commented code 2014-09-10 11:39:11 +02:00
2f362509b8 New p2p protocol. NOTE: Needs major refactoring. See #50 2014-09-10 11:22:19 +02:00
8ac1b85a0b Merge branch 'feature-pushtx' into develop 2014-09-09 21:35:53 -07:00
7dacd7eb78 add pushtx to api
Previously the software assumed use of an internal private key for use in all broadcasted transactions. This addition lets nodes relay pre-signed transactions originating from sources other than the node itself.
2014-09-09 21:27:34 -07:00
2949990016 Added CALLSTATELESS 2014-09-10 00:19:20 +02:00
d91357d00c Added GetCode method 2014-09-08 00:50:04 +02:00
0fea62ec6d Make use of new list type for transactions instead of json 2014-09-08 00:49:47 +02:00
a63b74e345 New OPCODES
* EXT- CODECOPY, CODESIZE
2014-09-08 00:49:25 +02:00
0b6b6b52fe Contract creation address are empty again 2014-09-08 00:48:59 +02:00
250d40bca0 Reset the transient state when a new block's been found 2014-09-08 00:48:39 +02:00
adabd71a4a Changed back to FIPS 180 2014-09-07 22:34:24 +02:00
ff27df78fc Added new list type which can embed any slice type 2014-09-07 10:18:54 +02:00
627b7c9fd7 Updated to latest sha3 implementation. Fixes #48 2014-09-07 10:07:51 +02:00
6afc16399f Block size 2014-08-25 12:53:06 +02:00
3f904bf3ac Implemented POST 2014-08-25 11:29:42 +02:00
cdbc3ecc2a Serpent! :-) 2014-08-24 00:16:32 +02:00
67af300383 Merge branch 'master' into develop 2014-08-23 19:01:15 +02:00
ccea5fa948 changed to new nat-pmp repo 2014-08-23 19:01:06 +02:00
fcc6f183a4 Changed level 2014-08-23 19:00:52 +02:00
962255b373 Removed old code 2014-08-23 11:00:33 +02:00
d9d4f63cd4 Don't add ... 2014-08-22 17:57:33 +02:00
56103f0751 Log 2014-08-22 17:10:18 +02:00
be9bfb5536 Minor improvement catching up
* When catching up check linked up the chain of hashes
2014-08-22 14:52:20 +02:00
836ed9d6b7 Write Protocol version to the db so we can perform sanity checks 2014-08-22 11:34:59 +02:00
a9f9a59416 Extra checks 2014-08-22 10:58:57 +02:00
42d43147ca Changed log statements 2014-08-22 10:58:49 +02:00
93008e279d Removed old chain code 2014-08-22 10:58:14 +02:00
740081e2f7 Storage at changed to return bytes 2014-08-21 21:06:42 +02:00
088bbc6bb7 Merge branch 'release/0.6.4' into develop 2014-08-21 20:25:38 +02:00
2d00027fd9 Merge branch 'release/0.6.4' 2014-08-21 20:25:09 +02:00
d03ab3c976 invalidated SWAP/DUP 2014-08-21 20:25:02 +02:00
fb90ecc8bc Merge branch 'release/0.6.4' 2014-08-21 20:23:33 +02:00
5196f9a340 bump 2014-08-21 20:22:39 +02:00
732573ba51 Turbo mining 2014-08-21 20:13:26 +02:00
854d6d4e5c DUP/SWAP n & ADD/MULMOD 2014-08-21 19:23:54 +02:00
a289a77d5d DUP n SWAP n 2014-08-21 18:15:09 +02:00
3def9258be Turbo mode 2014-08-21 18:14:49 +02:00
0eb08693e9 Turbo mode 2014-08-21 18:14:41 +02:00
cc6ad034f1 Merge branch 'release/0.6.3' into develop 2014-08-21 15:46:51 +02:00
0af0f0d890 Merge branch 'release/0.6.3' 2014-08-21 15:46:26 +02:00
c173e9f4ab MIT -> LGPL 2014-08-21 15:43:14 +02:00
15ef3388c1 Doc 2014-08-21 15:27:01 +02:00
d90ae4d45b Prot 0.6.3 2014-08-21 15:24:19 +02:00
b368549fd5 Always return something valid 2014-08-21 15:12:13 +02:00
c44f4f32fe Re-enabled catching up flag 2014-08-21 14:52:21 +02:00
eaa2e8900d PoC 6 networking code.
* Added block pool for gathering blocks from the network (chunks)
* Re wrote syncing
2014-08-21 14:47:58 +02:00
79c64f6bca Added block by hash or number 2014-08-20 16:40:19 +02:00
89c442cadb Added block by number 2014-08-20 13:36:54 +02:00
55a2f35a64 JS Filter 2014-08-20 13:05:26 +02:00
b97ea0e447 Added JSFilter type 2014-08-20 09:59:09 +02:00
b0ae61c652 Removed the "Get" part 2014-08-18 10:17:45 +02:00
793e666f36 Dump bytes instead of strings 2014-08-17 12:42:32 +02:00
4008ff32c9 Mutan compile 2014-08-17 12:42:02 +02:00
d79387c27e Mutan compile 2014-08-17 12:41:52 +02:00
4bd6003b7f removed pub completely in favour of pipe 2014-08-16 01:38:02 +02:00
7d95e8624a Added message to closure && added change addresses 2014-08-15 16:19:10 +02:00
2b9f71c6ca Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-08-15 13:05:20 +02:00
d701b23230 Reworking the public js interface (pub) => (pipe) 2014-08-15 13:05:13 +02:00
79bc628858 Merge pull request #43 from ethersphere/develop
inline mnemonic wordlist to support binary builds without extra asset
2014-08-15 10:49:43 +02:00
ace551030f Convert to hex 2014-08-15 01:08:23 +02:00
c7ee9844bd Removed old code 2014-08-15 00:25:16 +02:00
0fcc606569 Added new filter from map 2014-08-15 00:24:37 +02:00
07cfb7b64a updated filter so it accepts multiple from and to 2014-08-14 17:02:39 +02:00
0d733aa071 Removed validation check from GetMessages 2014-08-14 17:02:21 +02:00
0283498140 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-08-14 12:11:59 +02:00
fa881220ae Updated lookup method to include CNAME's as well as A records 2014-08-13 10:52:50 +02:00
e85f3972b9 inline mnemonic wordlist to support binary builds without extra asset 2014-08-12 14:56:10 +02:00
a760ce05b9 Updated chain for filtering 2014-08-11 16:23:38 +02:00
2e5d28c73f Added bloom filter & block filter methods 2014-08-11 16:23:17 +02:00
42d2bc28af Upped protocol version 2014-08-09 18:10:11 +01:00
024be32f06 Make sure all left padded zero's aren't included 2014-08-09 18:09:55 +01:00
27290e1277 Fixed gas limit calculation 2014-08-09 18:06:16 +01:00
c51db4c940 Fixed stack issue 2014-08-08 14:36:59 +01:00
3fc24013ef Fixed issue with overflowing 256 bit integers 2014-08-08 12:04:18 +01:00
d6b0ab3028 Changed to DnsReg 2014-08-07 15:26:07 +02:00
7272577fe6 Added dns lookup 2014-08-07 15:11:54 +02:00
da50c75148 Added state dump method 2014-08-06 09:53:00 +02:00
4edf7cfb05 config => Config 2014-08-05 11:31:39 +02:00
3c78e418fb world => World 2014-08-05 11:30:12 +02:00
e71b198e3d Renamed object to Object 2014-08-05 11:26:12 +02:00
4f0bda403e Added vm options for object execution 2014-08-05 11:10:24 +02:00
c215bbadf1 pipe 2014-08-05 10:17:26 +02:00
0f84b9c30d Added exist method 2014-08-04 16:34:55 +02:00
342cc122b4 Added general Pipe API 2014-08-04 16:25:53 +02:00
03ce15df4c ethstate.NewState => ethstate.New 2014-08-04 10:42:40 +02:00
3debeb7236 ethtrie.NewTrie => ethtrie.New 2014-08-04 10:38:18 +02:00
2e7cf83522 Merge branch 'ethersphere-feature/ethutil-refactor' into develop 2014-08-01 10:30:19 +02:00
8bed47a2d4 Merge branch 'feature/ethutil-refactor' of https://github.com/ethersphere/eth-go into ethersphere-feature/ethutil-refactor 2014-08-01 10:22:25 +02:00
5ede1224e4 minor rlp things 2014-08-01 10:21:43 +02:00
9831619881 merge upstream 2014-07-30 18:03:20 +02:00
5a2d62e4d9 Added better data parser 2014-07-30 13:06:59 +02:00
42d47ecfb0 Removed peer disconnect on pong timeout. Fixes #106
This mechanism wasn't very accurate so it has been removed.
2014-07-30 11:26:38 +02:00
1f9894c084 Old code removed and renamed amount to balance 2014-07-30 00:31:15 +02:00
27f8922653 Increased block request amount 2014-07-29 23:34:21 +02:00
74d7012025 Added temp seed 2014-07-29 23:33:59 +02:00
5ca2938117 Fixed 2014-07-29 23:33:33 +02:00
6fd2401cdf Fixed issue with var int reading.
Reading uneven byte slices were broken.
2014-07-29 23:33:18 +02:00
6e94c024e4 Added big data test and updating to reader 2014-07-29 23:31:33 +02:00
d1d2b660dc Prot 2014-07-29 15:55:08 +02:00
8e7c4f91e3 Added ops 2014-07-29 10:33:30 +02:00
41bd38147c Clean up and util methods 2014-07-26 11:24:44 +02:00
92ffc1cc4c Merge branch 'release/0.6.0' into develop 2014-07-25 10:43:59 +02:00
d761af84c8 Merge branch 'release/0.6.0' 2014-07-25 10:43:35 +02:00
54f9ea14e1 Removed old S(DIV/MOD) 2014-07-25 09:57:47 +02:00
7ee49c32b7 Added update method and general service timer
* disable catching up if no block received for longer than 10 seconds
2014-07-24 17:10:54 +02:00
702cf5a3e1 Merge branch 'feature/refactor_vm' into develop 2014-07-24 14:16:04 +02:00
dcf4fad971 Networking code 2014-07-24 12:30:04 +02:00
6d69ca36a7 Peer reconnect attempt 2014-07-24 12:25:41 +02:00
a45c08f9fe Removed old code 2014-07-24 12:19:55 +02:00
3c3292d505 Added recoverable option 2014-07-24 12:12:00 +02:00
306b5bcff3 Changed catching up code & peer handler
* Peers should be added no matter what
* Catch up with _anyone_
2014-07-24 12:11:30 +02:00
cbd71ef8f5 Add Tx 2014-07-24 12:10:18 +02:00
32d125131f Refactored to new state and vm 2014-07-24 12:04:15 +02:00
958b482ada div 0 err 2014-07-23 12:36:47 +02:00
92b16618ed Merge branch 'master' into develop 2014-07-23 12:04:45 +02:00
a3771e7d7b Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-23 12:04:41 +02:00
06ec80f394 zero devision check 2014-07-23 12:04:27 +02:00
5d57b78471 Added big int to uint switch 2014-07-22 16:16:00 +02:00
490ca410c0 Minor improvements and fixes to the new vm structure 2014-07-22 15:57:54 +02:00
9c86e99968 Merge branch 'master' into develop 2014-07-22 12:16:09 +02:00
1e8b54abfb Refactored state, state object and vm
* The State and StateObject have been moved to their own package
* The VM is moved to it's own package
2014-07-22 11:54:48 +02:00
20ee1ae65e Refactored CALLDATALOAD to use big int
* Added BigMin
2014-07-21 20:38:43 +02:00
eab0b2a90a Merge branch 'master' into develop 2014-07-21 20:23:15 +02:00
194c58858c send zero event to miner.powQuitChan fixes miner hanging 2014-07-21 19:12:04 +01:00
67528cf970 ethreact/README.md 2014-07-21 15:10:56 +01:00
6774ddaba2 Fix regression on 32bit (windows) systems 2014-07-21 14:35:37 +02:00
13cc220c0d Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor 2014-07-21 13:31:26 +01:00
1e4af85a38 merge upstream 2014-07-21 13:26:29 +01:00
8f91d47bf3 Merge branch 'master' into develop 2014-07-21 12:21:42 +02:00
5d2669dbd3 Fixed tx sha creation 2014-07-21 12:21:34 +02:00
93261b98c2 Changed iterator 2014-07-21 11:56:04 +02:00
9f00aeae29 Base time on previous parent, not last block 2014-07-18 16:13:21 +02:00
2762ec22d0 Fixed miner and logger 2014-07-18 13:50:15 +02:00
cd9b344506 Fixed range 2014-07-18 13:21:40 +02:00
61cc2ba7d9 fixed 2014-07-18 13:00:22 +02:00
dad29bcaa1 Added channel for starting/stopping miner 2014-07-18 12:21:11 +02:00
65650a5c66 Merge branch 'develop' into guiminer 2014-07-18 12:03:19 +02:00
db8170def3 WIP to expose hashrate to gui 2014-07-18 12:01:08 +02:00
449b9a9d68 Check if version in known + fix 2014-07-18 11:57:44 +02:00
28a146d438 Added find name for namereg 2014-07-17 22:30:00 +02:00
6a19b62db6 added chainSync event 2014-07-17 22:01:13 +02:00
a626b7ebe1 Fixed string data 2014-07-17 17:11:00 +02:00
3331bb29ea bump 2014-07-17 15:35:46 +02:00
16f6100500 Removed debug log 2014-07-17 15:11:09 +02:00
90f63657cb Removed debug log 2014-07-17 15:01:33 +02:00
0415e4a637 Fixed coinbase copy in state 2014-07-17 14:53:27 +02:00
ed3424ff75 Trie fixes 2014-07-17 11:21:18 +02:00
14c4f06100 Convert a byte slice to address 2014-07-16 13:20:57 +02:00
8820d4e5ac Decreased timeout 2014-07-15 20:36:11 +02:00
7c0a27a0f4 Added each callback for storage 2014-07-15 20:36:04 +02:00
7a410643ac Added/changed logging 2014-07-15 20:35:55 +02:00
34da3b4fa8 Moved 2014-07-15 20:35:07 +02:00
4a2dd306c7 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-15 15:30:06 +02:00
09bade6466 Fixed an issue where the trie might crash on missmatching lengths 2014-07-15 15:29:54 +02:00
9a93169898 Rewrote mnemonic word loading to facilitate deployable builds. 2014-07-15 12:52:44 +02:00
017d36e6b2 properly unsubscribe react channels when miner stops - fixes write on closed chan crash 2014-07-15 01:29:07 +01:00
1735ec0362 use ethreact.Event and ethreact.ReactorEngine 2014-07-15 01:11:06 +01:00
0ecc5c815e reactor test 2014-07-15 00:15:37 +01:00
5ec62a5153 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-15 00:25:57 +02:00
2784e256f1 Vm logging on diff 2014-07-15 00:25:49 +02:00
50bc838047 Moved checks 2014-07-15 00:25:38 +02:00
69acda2c25 Paranoia check moved 2014-07-15 00:25:27 +02:00
98f21d8973 Compare method for receipts 2014-07-14 22:52:44 +02:00
767d24ea5d Removed defer and added receipts checking in tx processing 2014-07-14 22:52:30 +02:00
d1c89727dc fix send overwritten by merge 2014-07-14 19:02:34 +01:00
3d5db7288f merge upstream 2014-07-14 18:50:06 +01:00
dc11b5c55e fix reactor channel blocking 2014-07-14 18:40:18 +01:00
5c03adbded fix logger channel blocking 2014-07-14 18:37:01 +01:00
8845fb7eae Add windows helper functions 2014-07-14 15:24:38 +02:00
5a0c4ce295 Fixed "Copy" to also copy over the pending storage changes 2014-07-14 00:38:20 +02:00
04f8c455e2 Added diff type 2014-07-14 00:37:50 +02:00
2c46bfde8b Increased block request 2014-07-14 00:37:41 +02:00
5b2e5d180f Changed diff output not to prefix hex with 0x 2014-07-14 00:37:18 +02:00
6426f3635e Forgot to return gas when CALL's value transfer fails 2014-07-13 17:56:14 +02:00
ee3ba0b1d6 Catch up per 10 2014-07-13 17:45:39 +02:00
54715586ab Changed sha3 to official one 2014-07-12 11:10:47 +02:00
9010857677 Special diff output for execution 2014-07-11 16:04:09 +02:00
ff151f9fbc vm output 2014-07-10 21:54:36 +02:00
5c7e96d895 Removed serpent 2014-07-10 18:19:38 +02:00
04561c4ddc Updated VM & added helper methods to state
* VM BALANCE opcode updated to pop 1 item and use that to retrieve the
  address' balance
* GetBalance and GetNonce on state that'll always return something valid
2014-07-10 17:58:16 +02:00
9688ebef52 Return from execution immediately if there's no code 2014-07-10 15:31:48 +02:00
d6753b2883 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-10 15:06:55 +02:00
b7ff773ecf Removed debug log 2014-07-10 15:06:46 +02:00
e504088b79 Consensus and bug fixes
* Ensure that each state object has an address that is 20 bytes
* Byte logging for vm
* changed diff output
2014-07-10 15:05:06 +02:00
d52e5f7130 Removed hardcoded ip 2014-07-10 15:04:19 +02:00
bea468f1e5 Increased timeout to 500ms 2014-07-10 15:03:48 +02:00
639f1fd339 Log received and send to 2014-07-10 15:03:26 +02:00
67e5689f87 Fixed BYTE opcode 2014-07-10 12:51:19 +02:00
dcbd97d29c Check current folder for mnemonic words if it fails in source folder. For binary support 2014-07-09 10:59:49 +02:00
794e65b60e Updated peer server 2014-07-07 22:08:09 +02:00
6cb35836a2 Upped protocol version number 2014-07-07 16:06:09 +02:00
e4e704f480 Fix quit 2014-07-07 16:05:59 +02:00
14d13167a7 Remove debug println 2014-07-07 13:59:59 +02:00
78aad9a192 Getting rid of deprecated methods 2014-07-07 13:59:32 +02:00
b01cb2406f Fixed state reset case 2014-07-07 13:59:09 +02:00
42bb3d8aae Removed old if statement. No longer needed 2014-07-07 13:58:54 +02:00
96ac061e68 Log change 2014-07-07 13:58:28 +02:00
890745e846 Increased timeout 2014-07-07 13:58:20 +02:00
4d77b7face remove extra case in main loop 2014-07-07 12:30:25 +01:00
68fba4b781 Fixed state reset on err 2014-07-07 11:17:48 +02:00
239a5d3230 Merge pull request #34 from ethereum/revert-33-feature/ethutil-refactor
Revert "ethreact - Feature/ethutil refactor"
2014-07-07 10:59:26 +02:00
6fe9b4ab5e Revert "ethreact - Feature/ethutil refactor" 2014-07-07 10:59:16 +02:00
9dab7dcc3c Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-07 10:53:25 +02:00
d40cba3042 changed state reset 2014-07-07 10:53:20 +02:00
1199941475 Connect to peer node by default 2014-07-07 10:52:58 +02:00
ec040908e9 Protocol bump 2014-07-07 10:52:39 +02:00
b958179263 Merge pull request #33 from ethersphere/feature/ethutil-refactor
ethreact - Feature/ethutil refactor
2014-07-07 10:52:02 +02:00
5a2afc5754 fix reactor engine main loop blocked to wait if drained 2014-07-05 19:56:01 +01:00
d4300c406c logger fix
- introduce quit, drained, shutdown channels
- mainLoop falls through reading message channel to drained state, and waits is blocked in default branch until any message is sent
- Flush() waits for <-drained
- Stop() pushes quit and nodges mainloop out of blocking drained state
- package-global mutex
- Reset()
- clear tests
2014-07-05 19:11:08 +01:00
4fb2905b1e Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor 2014-07-05 12:53:00 +01:00
b232acd04e Debugging mode for vm 2014-07-05 13:24:49 +02:00
329887df99 Fixed crazy looping 2014-07-05 13:24:26 +02:00
44d0d6abd2 Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor 2014-07-04 19:40:23 +01:00
0c6f1c9c3a ethreact
- consistent renaming
- React -> Event
- ReactorEvent -> EventHandler
- NewReactorEngine -> New
- async ReactorEngine main loop with select on main eventChannel and quit channel
- ReactorEngine main loop control with Start() Stop() Flush()
- ReactorEngine.dispatch
- use sync.RWMutex
- delete eventHandler if subscribed channels go to 0
2014-07-04 19:38:53 +01:00
584d1c61ec use ethreact.Event and ethreact.ReactorEngine 2014-07-04 19:38:44 +01:00
af27264140 remove reactor code from ethutil 2014-07-04 19:37:40 +01:00
90eb4f1939 Debug output, minor fixes and tweaks
* Script compile length fix
* Transition fix
2014-07-04 15:32:10 +02:00
23b5b5fa36 Length check 2014-07-04 13:34:50 +02:00
d5bcc01eae Fixed shebang check. Previously it would hang on an unknown shebang 2014-07-04 13:05:07 +02:00
633027d980 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-04 00:13:57 +02:00
d3d043dba0 Merge branch 'ethersphere-feature/clientid' into develop 2014-07-04 00:13:42 +02:00
db60ebbbd7 Merge branch 'feature/clientid' of https://github.com/ethersphere/eth-go into ethersphere-feature/clientid 2014-07-04 00:12:28 +02:00
cb7ebdf821 Decreased timeout 2014-07-04 00:12:21 +02:00
70e1a1a4df Merge pull request #32 from josephyzhou/develop
typo, duplications
2014-07-04 00:10:29 +02:00
7c41e413e4 typo, duplications 2014-07-03 11:31:47 -07:00
f02602d02d ConfigManager (transitional)
- remove clientstring handling from ethutil.Config
- ReadConfig takes no Identifier argument
- members Ver, ClientString, ClientIdentifier removed from Config
- type ConfValue removed
- expose public type ethutil.ConfigManager
- Set -> Save(key string, value interface{}) now takes any value to allow for persisting non-string values directly
- TODO: eliminate all eth specific configs, just a wrapper around globalconf
2014-07-03 17:30:51 +01:00
90c2064640 peer constructors now set version string with ethereum.ClientIdentity().String() 2014-07-03 17:30:37 +01:00
c833c3fec8 add ClientIdentity() ethwire.ClientIdentity to Ethereum 2014-07-03 17:30:04 +01:00
c64629964f ethwire.ClientIdentity now handles Client info sent in handshake + test 2014-07-03 17:28:27 +01:00
de2da4fd19 Merge branch 'develop' of github.com:ethereum/eth-go into feature/clientid 2014-07-03 15:08:13 +01:00
198e5eeab9 EthManager interface extended with ClientIdentity() ethwire.ClientIdentity 2014-07-03 15:08:06 +01:00
8baa0f84e7 Fixed reverting error 2014-07-03 16:07:21 +02:00
5d67139206 Fix 2014-07-03 10:05:02 +02:00
5b8dde9602 Fixed CREATE op. Fixes #87 2014-07-03 10:04:38 +02:00
81bc721c5c Fixed address generation 2014-07-03 10:03:58 +02:00
35ae9e3aa8 Paranoia check 2014-07-02 17:48:10 +02:00
2f9bc2ab75 Removed old code 2014-07-02 17:47:33 +02:00
8de099ae75 Added paranoia check 2014-07-02 17:47:18 +02:00
40e3d2ab55 Changed CREATE 2014-07-02 17:47:09 +02:00
6748158ab4 Moved methods 2014-07-02 13:40:02 +02:00
e4d2d00d41 Added support for breakpoints on specific instructions 2014-07-02 13:08:32 +02:00
315d65280b Removed comment 2014-07-02 11:30:14 +02:00
d15952c867 Moved debug hook to Vm directly 2014-07-02 01:04:21 +02:00
1954ef47e6 Suicide is deferred to update 2014-07-02 00:06:21 +02:00
fd1d0bbde7 Updated to generic padding function 2014-07-02 00:05:48 +02:00
d7e396a98c l <=> r 2014-07-01 23:59:37 +02:00
00d3935aac Removed old method 2014-07-01 23:59:18 +02:00
bb2433ca1a Added quitting reason 2014-07-01 20:32:47 +02:00
7238a77327 Removed old code 2014-07-01 20:12:18 +02:00
dd869064a6 delete? 2014-07-01 20:09:37 +02:00
7a2a63f32b Added utility wrapper for Ethereum Config contract
Note, this utility function has to move elsewhere
2014-07-01 20:09:21 +02:00
28ef7d228c Added Left and Right padding utility functions 2014-07-01 20:08:48 +02:00
6151ae7db5 Fixed key import for empty entries 2014-07-01 20:08:32 +02:00
3889785017 Added Path utility 2014-07-01 20:08:18 +02:00
7a9ff4f8d4 bump 2014-07-01 16:28:17 +02:00
29f613ef84 Merge pull request #28 from ethersphere/feature/keys
Feature/keys
2014-07-01 16:16:05 +02:00
ff5703fd9b ethutil -> ethtrie.NewTrie 2014-07-01 15:09:43 +01:00
89630d2826 merge upstream 2014-07-01 15:03:02 +01:00
550407b0ec Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-01 15:44:43 +02:00
d0959063d5 Up 2014-07-01 15:28:12 +02:00
d294dedfad Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-07-01 15:26:18 +02:00
e798294a4b Update min GasLimit 2014-07-01 15:25:57 +02:00
114e715e3c Merge branch 'ethersphere-feature/keys' into develop 2014-07-01 13:48:28 +02:00
253c23240b Merge branch 'feature/keys' of https://github.com/ethersphere/go-ethereum into ethersphere-feature/keys
Conflicts:
	.gitignore
	README.md
2014-07-01 13:45:39 +02:00
0ce9003ba7 Fix for creating a tx from an unknown account 2014-07-01 12:16:14 +02:00
2bbc204328 Close pow chat. Fixes #95 2014-07-01 11:55:50 +02:00
92693e4459 The dragon has been slain. Consensus reached! 2014-07-01 11:26:45 +02:00
39263b674c Paranoia 2014-07-01 09:56:10 +02:00
5f5910c603 Regression test for trie 2014-07-01 09:55:20 +02:00
ed276cd7c2 Added Paranoia check for VM execution 2014-06-30 20:03:31 +02:00
82272ee08a Iterator fix 2014-06-30 14:28:54 +02:00
9ed0d389b2 Generic trie 2014-06-30 13:34:47 +02:00
00bb68d7d2 Merge branch 'develop' into interop 2014-06-30 13:13:55 +02:00
c23074d5ad Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-30 13:13:45 +02:00
8ddd4c4c52 wip 2014-06-30 13:09:04 +02:00
5a86892ecb Using remote for test cases 2014-06-30 13:08:00 +02:00
12972b4b65 DBKeyStore.Load returns no error if keyring not found in db 2014-06-29 20:53:26 +01:00
2920795168 using keyPair.Mnemonic() in file key store Save method 2014-06-29 20:28:54 +01:00
25314313f8 added Mnemonic() and AsStrings() methods, added memoization for address 2014-06-29 20:28:04 +01:00
a8be0d9f48 add InitFromString method to be used in gui 2014-06-29 20:26:55 +01:00
dabaa4cce0 change all modified calls to ethtrie, ethutil and ethcrypto functions 2014-06-29 18:30:05 +01:00
707d413761 refactor ethutil/trie to ethtrie 2014-06-29 16:26:58 +01:00
4be3521727 import math/big 2014-06-29 16:17:33 +01:00
e3b911652d move CreateAddress from ethutil/common to ethcrypto 2014-06-29 16:08:33 +01:00
5e50b50dc3 no strconv import needed 2014-06-29 16:06:54 +01:00
772e7e8c8d Key Manager
- keypair, keyring:
-- consistent naming of methods
-- error propagation
-- no panic
- keyManager: persist, import, export, initialize and (re)set keyring
- no global public "singleton" keyring, instead interface via keyManager
- keys test
- KeyStore interface, DB and File store implementations
2014-06-29 16:02:23 +01:00
e1ea41ee9c remove ethutil helpers (refactored), and keypair (key management under ethcrypto package) 2014-06-29 16:01:57 +01:00
d87857ffdb config Pubkey removed (unused) 2014-06-29 15:59:57 +01:00
1db3e2241e move ethutil/mnemonic to ethcrypto - electrum word list now sourced from file 2014-06-29 15:59:35 +01:00
d085133c6d move ethutil helper crypto functions to ethcrypto/crypto 2014-06-29 15:57:12 +01:00
5c1e0a6dc4 move ethutil hex conversion functions to bytes 2014-06-29 15:56:40 +01:00
7489fb784e move ethutil helper slice functions -> slice 2014-06-29 15:56:19 +01:00
2eae52ebd1 Merge pull request #27 from ethersphere/bugfix/ethchain-test
transitional ethutil.ReadConfig fixes in ethchain tests (they still fail...
2014-06-28 10:22:23 +02:00
79009ca074 transitional ethutil.ReadConfig fixes in ethchain tests (they still fail! FIXME :) 2014-06-27 15:56:45 +01:00
8151858e70 Merge branch 'master' of github.com-obscure:ethereum/eth-go 2014-06-27 00:17:15 +02:00
6c7e58643c Merge branch 'develop' 2014-06-27 00:17:04 +02:00
423beddf57 nil check 2014-06-27 00:16:49 +02:00
30f5642c62 Merge pull request #26 from ethersphere/master
bump v5.15
2014-06-27 00:11:55 +02:00
e3ad2a3969 Merge branch 'develop' 2014-06-27 00:08:29 +02:00
8119d77a21 :-( 2014-06-27 00:08:19 +02:00
d551a75c35 bump v5.15 2014-06-26 21:20:02 +01:00
8935a93cf8 Merge branch 'release/0.5.15' into develop 2014-06-26 19:55:19 +02:00
9d5a3f0131 Merge branch 'release/0.5.15' 2014-06-26 19:55:14 +02:00
a98e6a262a Merge branch 'develop' into release/0.5.15 2014-06-26 19:53:08 +02:00
491925b71e Merge branch 'ethersphere-feature/logging' into develop 2014-06-26 19:52:31 +02:00
853053a3b2 go fmt 2014-06-26 18:45:57 +01:00
21e389bec5 bump 2014-06-26 19:04:57 +02:00
da38faa8f7 merge upstream; fix port in use warning; new logger API 2014-06-26 16:37:56 +01:00
098136b681 ethereum logs server started/stopped message 2014-06-26 10:43:02 +01:00
0ed19d9f20 Logging, variable rearrangement 2014-06-26 11:26:42 +02:00
39cb34850a Added instruction numbers 2014-06-26 11:25:43 +02:00
782f780476 space in miner logging message 2014-06-25 18:43:35 +01:00
a243e3b858 new logger API for upstream merge 2014-06-25 17:59:35 +01:00
98f1ee9442 merge upstream 2014-06-25 16:58:07 +01:00
a02edf7a93 put back extra debug detail logging to the right places using logger.DebugDetailf 2014-06-25 16:40:06 +01:00
6465e4c3fd update doc: list levels and show usage of named print methods 2014-06-25 16:38:42 +01:00
e75f7ae330 implement DebugDetail loglevel and named print methods 2014-06-25 16:37:38 +01:00
b0dc50c2a0 New mutan implementation 2014-06-25 17:26:34 +02:00
6d32bef65a Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-25 17:22:30 +02:00
4141cc39d0 Merge remote-tracking branch 'upstream/develop' into feature/logging 2014-06-25 16:13:27 +01:00
d8c675afbf Implement something that looks like confirmations, wip 2014-06-25 16:23:10 +02:00
8fe8175c78 Implemented TX History for ethPub 2014-06-25 16:12:33 +02:00
589d27386a Fix key generation in ethPub 2014-06-25 14:05:55 +02:00
e58ba2fcfa Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-25 09:47:27 +02:00
9dae1a1732 Removed BlockDo Method 2014-06-25 09:47:19 +02:00
0c55a11318 Support hex and decimal keys for GetStorageAt RPC. Fixes ethereum/go-ethereum#74 2014-06-24 11:15:26 +02:00
16e8fc7427 Logging order 2014-06-23 16:11:55 +02:00
f58c7ac5a6 merge upstream 2014-06-23 13:07:43 +01:00
63157c798d refactor config (transitional). Details:
- ReadConfig initialiser sets up global ethutil.Config via config file passed from wrappers
- does not write out adhoc default (not meant to) but creates empty config file if it does not exist so that globalconf does not complain if persists a flag
- default datadir and default config file set together with other flag defaults in wrappers
- default assetpath set together with other command line flags defaults in gui wrapper (not in ethutil.Config or ui/ui_lib)
- add EnvPrefix, to handle environment variable options too via globalconf
- this is still transitional: global Config should just be a wrapper around globalconfig config handler and should be moved to go-ethereum
- actual eth stack config should not be global instead config handled properly with explicit dependency injectioninto eth stack component instances
2014-06-23 12:55:38 +01:00
b9e8a3e024 modified logging API
- package vars for tagged loggers
- weed out spurious fmt.PrintX and log.PrintX logging
- tried to second guess loglevel for some :)
2014-06-23 12:54:10 +01:00
8e9cc36979 refactor logging. Details:
- packages use tagged logger sending log messages to shared (process-wide) logging engine
- log writers (interface ethlog.LogSystem) can be added to the logging engine by wrappers/guis/clients
- shared logging engine dispatching to multiple log systems
- log level can be set separately per log system
- async logging thread: logging IO does not block main thread
- log messages are synchronously stringified to avoid incorrectly logging of changed states
- README.md
- loggers_test
2014-06-23 12:49:04 +01:00
614624754d Let the state create the object 2014-06-23 13:42:30 +02:00
d890258af6 Minor fixes to vm output 2014-06-23 11:26:51 +02:00
803e4807ed Removed comments 2014-06-23 11:26:31 +02:00
a4e26bf7c2 Added Block do which replays the given block or error 2014-06-23 11:25:14 +02:00
9350ecd36f Do not keep on asking for the same chain 2014-06-23 11:24:45 +02:00
8c96c5662f Added hex script method 2014-06-23 11:24:07 +02:00
842d52db7b Make sure that public key always uses 64 bytes 2014-06-23 11:23:51 +02:00
bb1641e4ec Clean up & refactored methods 2014-06-23 11:23:18 +02:00
299b50a0d4 Support serpent lang 2014-06-21 02:40:25 +02:00
931ae0f116 Append zero's in R & S 2014-06-20 20:12:08 +02:00
7fb5e993e3 Moved 0 check to state object for now 2014-06-20 20:11:40 +02:00
0251fae5cc Changed loggers 2014-06-20 01:10:39 +02:00
0c6b41f4c9 CALLDATACOPY 2014-06-20 01:10:20 +02:00
f63f3853bb Merge branch 'release/0.5.14' into develop 2014-06-20 00:47:59 +02:00
3f1f8438ed Merge branch 'release/0.5.14' 2014-06-20 00:47:52 +02:00
7ad073fb30 bump 2014-06-20 00:47:50 +02:00
09f37bd023 Returned to single method 2014-06-20 00:45:44 +02:00
8f29f6a4d4 Removed some logging 2014-06-20 00:42:26 +02:00
6fcc6a2f7c Changed copy/set 2014-06-20 00:41:42 +02:00
0b8ba1d55b Renamed snapshot to copy/set and added it back to the VM 2014-06-20 00:41:28 +02:00
933aa63b7d Length check on get 2014-06-19 21:41:37 +02:00
80ffe1610c Removed log 2014-06-19 13:45:46 +02:00
9104dcc29c Fixed call 2014-06-19 13:45:29 +02:00
7e6684d926 Method for checking contract addresses 2014-06-19 13:42:47 +02:00
1b431f29e5 Added missing types 2014-06-19 13:42:28 +02:00
5ea7598408 Update after each transition instead of at the end.
Updating the state /after/ the entire transition creates invalid
receipts.
2014-06-19 13:42:14 +02:00
731f55a05d Reset state when a transition fails 2014-06-19 13:41:17 +02:00
509389be97 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-18 13:48:52 +02:00
f911087eab Logging 2014-06-18 13:48:42 +02:00
c4af1340fa Updated test 2014-06-18 13:48:29 +02:00
3bc57fe5b5 CALLDATALOAD return 32 byte at all times 2014-06-18 13:48:08 +02:00
7f94bd09ae Return a single byte if byte get called 2014-06-18 13:47:40 +02:00
d179f31d4f Merge branch 'feature/peers' into develop 2014-06-18 13:19:12 +02:00
fba6de834e Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-06-18 13:19:03 +02:00
1f79175898 Reworked peers to check for public key duplication and adding peers to peerlist only after the handshake has come in 2014-06-18 13:06:48 +02:00
2fbcfd8824 Proper checks for multiple data items. Fixes #80 2014-06-18 11:55:05 +02:00
22e16f15a6 Reduce peer timeout to 10 seconds 2014-06-18 10:39:42 +02:00
dc9c9369e0 log 2014-06-18 00:36:23 +02:00
2565a79575 Swapped vars 2014-06-18 00:32:48 +02:00
8a885c2606 Fixed GT and LT 2014-06-18 00:25:58 +02:00
ca79360fd7 Verbose logging for VM 2014-06-17 18:49:26 +02:00
34c8045d5b Fixed issue where JUMPI would do an equally check with 1 instead of GT 2014-06-17 18:05:46 +02:00
a90ffe1af1 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-06-17 11:40:37 +02:00
01e6f63e98 A handful of GUI fixes 2014-06-17 11:40:23 +02:00
3621988e15 Removed deprecated states 2014-06-17 11:07:37 +02:00
53e30f750d Removal of manual updating of state objects
* You'll only ever need to update the state by calling Update. Update
  will take care of the updating of it's child state objects.
2014-06-17 11:06:06 +02:00
6656f99c54 Merge branch 'release/0.5.13' into develop 2014-06-16 18:25:33 +02:00
5a0e751736 Merge branch 'release/0.5.13' 2014-06-16 18:25:24 +02:00
ff0f15f763 bump 2014-06-16 18:25:21 +02:00
887debb055 comment 2014-06-16 18:20:38 +02:00
0d77632839 Refund gas 2014-06-16 12:25:18 +02:00
8b15732c1e Check for nil receiver 2014-06-16 12:04:56 +02:00
48bca30e61 Fixed minor issue with the gas pool 2014-06-16 11:51:16 +02:00
9f62d441a7 Moved gas limit err check to buy gas 2014-06-16 11:14:01 +02:00
b836267401 .. 2014-06-16 11:13:37 +02:00
7b55bcf484 Removed old fees 2014-06-16 11:13:19 +02:00
15d1f753f7 Removed old fees 2014-06-16 11:13:06 +02:00
1d76e433f7 Removed some comments 2014-06-16 10:40:21 +02:00
02d8ad030f Keeping old code for reference 2014-06-16 10:35:35 +02:00
58a0e8e3e2 Changed RlpEncodable 2014-06-16 00:52:10 +02:00
dccef70728 Method for creating a new key from scratch 2014-06-16 00:51:55 +02:00
1fbea2e438 Reworking messaging interface 2014-06-16 00:51:21 +02:00
8198fd7913 Cache whole objects instead of states only 2014-06-16 00:51:04 +02:00
d80f999a21 Run contracts 2014-06-15 00:11:06 +02:00
5871dbaf5a Set contract addr for new transactions 2014-06-15 00:10:42 +02:00
b0e023e432 Increase ping timeout to 30 seconds 2014-06-15 00:04:18 +02:00
6d52da58d9 Logging mechanism 2014-06-14 15:44:13 +02:00
63883bf27d Moving closer to interop 2014-06-14 11:46:09 +02:00
8124547348 Moving a head closer to interop 2014-06-13 16:06:27 +02:00
c734dde982 comments & refactor 2014-06-13 13:06:27 +02:00
cebf4e3697 Refactored state transitioning to its own model 2014-06-13 12:58:01 +02:00
5e2bf12a31 Refactored state transitioning to its own model 2014-06-13 12:57:52 +02:00
d078e9b8c9 Refactoring state transitioning 2014-06-13 12:45:11 +02:00
b855e5f7df Changed opcode numbers and added missing opcodes 2014-06-12 11:19:32 +02:00
6593c69424 Merge branch 'develop' into interop 2014-06-12 10:07:40 +02:00
3a9d7d318a log changes 2014-06-12 10:07:27 +02:00
8a2e50ab2a Merge branch 'develop' into interop
Conflicts:
	peer.go
2014-06-11 21:56:59 +02:00
9ee6295c75 Minor changes 2014-06-11 21:55:45 +02:00
1bf6f8b4a6 Added a buy gas method 2014-06-11 21:55:34 +02:00
4d3209ad1d Moved process transaction to state manager
* Buy gas of the coinbase address
2014-06-11 21:55:23 +02:00
9ff97a98a7 Namereg lookup fix 2014-06-11 21:51:21 +02:00
1938bfcddf Fix compare 2014-06-11 16:16:57 +02:00
71ab5d52b6 Exposed usedGas through ethPub 2014-06-11 11:40:50 +02:00
e090d131c3 Implemented counting of usedGas 2014-06-11 11:40:40 +02:00
97cc762143 Expose GasLimit to ethPub 2014-06-11 10:28:18 +02:00
bdc206885a Don't mine transactions if they would go over the GasLimit implements ethereum/go-ethereum#77 further. 2014-06-10 17:23:32 +02:00
69044fe577 Refactor to use new method 2014-06-10 17:22:43 +02:00
753f749423 Implement CalcGasPrice for ethereum/go-ethereum#77 2014-06-10 17:22:06 +02:00
2e6cf42011 Fix BigMax to return the biggest number, not the smallest 2014-06-10 17:15:18 +02:00
2995d6c281 Validate minimum gasPrice and reject if not met 2014-06-10 15:02:41 +02:00
1b40f69ce5 Prevent peer stop crash by removing logging 2014-06-10 14:59:38 +02:00
771f64397f Stop peers when they don't respond to ping/pong. Might fix ethereum/go-ethereum#78 2014-06-10 13:51:34 +02:00
d8339fa29a Merge branch 'release/poc5-rc12' into develop 2014-06-09 22:24:13 +02:00
006ac772e6 Merge branch 'release/poc5-rc12' 2014-06-09 22:24:05 +02:00
a51dfe89c0 bump 2014-06-09 22:23:30 +02:00
c7d1924c34 sha 2014-06-09 21:35:56 +02:00
1153fd9a0c Added Douglas and Einstan 2014-06-06 12:12:27 +02:00
a56f78af67 Implement getStateKeyVal for JS bindings.
Gives JS the option to 'loop' over contract key/val storage
2014-06-04 15:54:39 +02:00
d7b882977c Make contract creation error more explicit by mentioning the sneder 2014-06-03 11:56:19 +02:00
2010fea088 Added faux latency for peeroverview 2014-06-03 10:42:55 +02:00
fb6ff61730 Implemented Public Peer interface 2014-06-02 15:20:27 +02:00
ff8a834ccc Merge branch 'develop' 2014-05-30 19:51:25 +02:00
9e8127accb woops 2014-05-30 19:51:19 +02:00
6b7dfa1fb5 Merge branch 'develop' 2014-05-30 16:58:31 +02:00
17c825f53a Peer changes broadcasting and minor miner fix 2014-05-30 16:57:58 +02:00
b15e03acd7 Fixed issue with casting to smaller byte array 2014-05-30 16:57:40 +02:00
e0b6a31613 Buffered channel to fix not ready (blocking) 2014-05-30 13:27:56 +02:00
f382221b28 Broadcast "peerList" event upon removing or adding peers 2014-05-30 13:04:08 +02:00
6c91ffcfbe Do not panic, but return nil instead 2014-05-30 11:48:37 +02:00
15e0093e13 Fixed issue where the client could crash when sending malformed data 2014-05-30 11:48:23 +02:00
99797858a6 Added coin base to pub block 2014-05-30 11:47:23 +02:00
8fcba0eb1e fixed test 2014-05-29 23:54:48 +02:00
9bb7633254 Removed fmt 2014-05-29 11:50:36 +02:00
e7097641e3 Support for namereg 2014-05-29 11:49:41 +02:00
a2d01d6af8 Removed comments 2014-05-29 02:05:57 +02:00
2ef3a98929 Merge branch 'develop' 2014-05-28 23:23:40 +02:00
4d98762486 Fixed state object gas return 2014-05-28 23:16:54 +02:00
73a42d34a5 Merge branch 'release/poc5-rc11' into develop 2014-05-28 16:19:42 +02:00
95adac7522 Merge branch 'release/poc5-rc11' 2014-05-28 16:19:31 +02:00
76a59274bf Bump to RC11 2014-05-28 16:19:25 +02:00
a453b5514d Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-28 15:54:56 +02:00
8601604a09 Hooked up the Block Explorer to the Debugger so we can instantly debug made transactions 2014-05-28 15:48:23 +02:00
b695c82520 Fixes #60 2014-05-28 15:07:11 +02:00
a98e35d7a0 Length checking 2014-05-28 13:55:32 +02:00
65722aeeca Added StringToBytesFunc 2014-05-28 13:14:56 +02:00
8278ba5e45 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-28 12:39:41 +02:00
6e98e5709a Set initial used gas 2014-05-28 12:39:34 +02:00
2fec1af275 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-28 12:15:46 +02:00
cfb979b5e3 Add contract addr if it's a contract creation tx 2014-05-28 12:15:43 +02:00
9988b1a047 Sort transactions based on the nonce
* Added a transaction sorter
2014-05-28 12:06:09 +02:00
73761f7af6 Closure call now returns the total usage as well
* Return the used gas value based on the UseGas and ReturnGas
2014-05-28 12:05:46 +02:00
1c01e9c095 10 2014-05-28 12:03:40 +02:00
98d4b51120 Changed opcode names 2014-05-28 12:03:12 +02:00
ab8c7252da Merge branch 'release/poc5-rc10' into develop 2014-05-27 16:11:25 +02:00
818cbcbdd4 Merge branch 'release/poc5-rc10' 2014-05-27 16:11:19 +02:00
a428533160 bump 2014-05-27 16:10:18 +02:00
006c757a03 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-27 13:32:37 +02:00
4eb1771e67 Hooks can now quit the vm 2014-05-27 13:32:31 +02:00
aba3066658 Changed debug hook and added state iterator 2014-05-27 13:10:18 +02:00
c1b09d639c Disamble tx data before adding it to PTx object 2014-05-27 10:38:31 +02:00
817def000b Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-27 10:29:47 +02:00
6e24d603a1 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-27 01:08:59 +02:00
5cdfee5143 New Trie iterator 2014-05-27 01:08:51 +02:00
2232974cda Changed var names around 2014-05-26 17:18:51 +02:00
aefcb83419 Updated Public Block and Transaction objects with more information 2014-05-26 17:07:04 +02:00
24a6d87c3f Don't handshake if there is no key yet; first start on Ethereal 2014-05-26 11:47:47 +02:00
4c7bd75c1a Merge branch 'release/poc5-rc9' into develop 2014-05-26 00:42:18 +02:00
b1463b2dc2 Merge branch 'release/poc5-rc9' 2014-05-26 00:42:07 +02:00
1f3f76cb09 bump 2014-05-26 00:38:53 +02:00
3ebd7f1166 State snapshotting 2014-05-26 00:09:38 +02:00
81ef40010f The body of contracts are now returned instead 2014-05-25 14:13:54 +01:00
99fa9afaf1 Updated to work with the new config 2014-05-25 14:13:07 +01:00
281559d427 Canonical contract creation 2014-05-22 18:24:04 +02:00
cc8464ce80 Transaction querying 2014-05-22 17:56:33 +02:00
230aafbf66 Working on interop
* Receipts after each transaction
* Fee structure
* Applying fees to miners
2014-05-22 17:35:26 +02:00
14787ac148 Fixed some issues connecting for interop 2014-05-22 17:33:46 +02:00
4e1c6a8a22 Added start / stopping methods 2014-05-22 00:25:34 +02:00
f8f84ef095 Removed old contract creation code 2014-05-22 00:25:02 +02:00
e1b7bd51ee Return a disassembled script instead of the hex 2014-05-21 15:54:44 +02:00
56c2f651fe Merge branch 'develop' 2014-05-21 14:06:03 +02:00
c371f9a162 Merge branch 'release/poc5-rc8' into develop 2014-05-21 14:05:48 +02:00
d6e398aba4 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-21 14:05:30 +02:00
7fe73deb2d Merge branch 'release/poc5-rc8' 2014-05-21 14:04:25 +02:00
8f5eddd0ba Bumped 2014-05-21 14:04:19 +02:00
f5852b47d1 Removed some logging and refactored a bit 2014-05-21 14:00:13 +02:00
1275e5bdc9 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-21 13:06:42 +02:00
86cf69648e Improved miner so it won't include invalid transactions 2014-05-21 13:04:40 +02:00
d658a7f4ab Implemented missing EthPub calls in RPC server 2014-05-21 12:46:24 +02:00
0e9c8568fd Re broadcast transactions 2014-05-21 12:39:15 +02:00
2667cb3ab6 Apply to parent 2014-05-21 12:39:07 +02:00
0c27c5eb7f Proper log statement 2014-05-21 12:38:56 +02:00
05e4e97276 Fixed Public block creation. Added block logging 2014-05-21 12:09:28 +02:00
07fe00c466 Changed numbers 2014-05-21 11:42:31 +02:00
cbf221f6b7 Fixed competing block method 2014-05-21 11:42:20 +02:00
734b2e4cf7 Merge branch 'hotfix/4' into develop 2014-05-21 01:12:39 +02:00
85793a4706 Merge branch 'hotfix/4' 2014-05-21 01:12:33 +02:00
3c35ba7c31 Fixed state overwriting issue 2014-05-21 01:12:28 +02:00
5ceb1620e9 Fixed couple issues
* (imp) Lock / RLock tries
* (fix) stack
2014-05-21 00:17:50 +02:00
e8b4585295 Merge branch 'master' into develop 2014-05-20 22:45:10 +02:00
6ef2832083 Upped prot 2014-05-20 22:45:01 +02:00
6ba534af92 Merge branch 'hotfix/3' into develop 2014-05-20 22:44:10 +02:00
47fd4833ee Merge branch 'hotfix/3' 2014-05-20 22:44:05 +02:00
64701e388c Fixed state issue 2014-05-20 22:43:59 +02:00
27aae60381 Merge branch 'hotfix/2' into develop 2014-05-20 22:05:04 +02:00
7dae955c1a Merge branch 'hotfix/2' 2014-05-20 22:04:58 +02:00
3b38df085e Fixed casting issue 2014-05-20 22:04:47 +02:00
de87e436ab Merge branch 'hotfix/1' into develop 2014-05-20 19:20:09 +02:00
e837c9ab3f Merge branch 'hotfix/1' 2014-05-20 19:20:04 +02:00
ad51c85e5d Fixed crash 2014-05-20 19:19:53 +02:00
9562aba86a Merge branch 'release/poc5-rc7' into develop 2014-05-20 17:09:53 +02:00
4b13f93a3e Merge branch 'release/poc5-rc7' 2014-05-20 17:09:44 +02:00
c37b3cef7d Bump 2014-05-20 17:08:53 +02:00
0c4040d191 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-20 15:02:53 +02:00
2bd377a3de Changed transaction hash for poc 5 2014-05-20 15:02:46 +02:00
31e44c2ab9 Change shorthands 2014-05-20 14:53:34 +02:00
f5d4414734 Fix notification when processing block that didn't have this client as origin 2014-05-20 14:41:35 +02:00
7d3e99a2ab Fixed genesis and block data 2014-05-20 14:29:52 +02:00
b4e156e1d7 Up protocol version 2014-05-20 13:29:46 +02:00
6a31d55b2e added roman 2014-05-20 13:29:21 +02:00
45b810450f ... 2014-05-20 13:09:44 +02:00
f292e93e0e Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
Conflicts:
	ethchain/transaction.go
2014-05-20 13:07:08 +02:00
378815ee62 Rearranged according to YP 2014-05-20 13:06:47 +02:00
38b4dc2cdf Merge pull request #21 from nicksavers/patch-1
Rearrange transaction RLP encoding...
2014-05-20 13:06:27 +02:00
530ab6b8fc Re-arranged transaction RLP encoding...
According to latest Yellow Paper specs and conform other clients
4794642e51
2014-05-20 13:02:37 +02:00
fafdd21e4f unused 2014-05-20 12:23:49 +02:00
faa57ecaef Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-20 12:19:25 +02:00
2450398862 Added Maran to premine 2014-05-20 12:19:21 +02:00
36c9c93720 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-20 11:50:43 +02:00
12f30e6220 Refactored a lot of the chain catchup/reorg. 2014-05-20 11:50:34 +02:00
fd19142c0d No longer store script directly in the state tree 2014-05-20 11:19:07 +02:00
a2fb265563 Added a fatal method 2014-05-19 17:02:16 +02:00
b8034f4d9e Increment nonce in the public api 2014-05-19 12:14:04 +02:00
bd48690f63 Testing different mining state 2014-05-19 11:25:27 +02:00
8730dfdcc2 Changed how changes are being applied to states 2014-05-17 14:07:52 +02:00
88686cbed2 listen to pre instead of post 2014-05-15 15:00:25 +02:00
f95993e326 M 2014-05-15 14:54:07 +02:00
7bf2ae0b11 Removed old tx pool notification system. Fixes #19 2014-05-15 14:05:15 +02:00
2734fc4079 Merge branch 'release/poc5-rc6' into develop 2014-05-14 21:34:49 +02:00
6efdd21633 Merge branch 'release/poc5-rc6' 2014-05-14 21:34:30 +02:00
ad4ffdc947 Bumped version 2014-05-14 21:34:13 +02:00
65f570271c Fixed catching up 2014-05-14 20:50:37 +02:00
a6b9ea05e8 Test 2014-05-14 20:36:21 +02:00
166853aed9 Test 2014-05-14 20:35:23 +02:00
98a631b556 Remove any invalid transactions after block processing 2014-05-14 16:29:34 +02:00
ff2cf2dacd Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-14 13:57:08 +02:00
3ac74b1e78 Implemented IsUpToDate to mark the node as ready to start mining 2014-05-14 13:57:04 +02:00
f4fa0d48cb Moved keyring to ethutil & removed old methods. Implements #20 2014-05-14 13:54:40 +02:00
0512113bdd Removed defer 2014-05-14 11:56:06 +02:00
7c0df348f8 Increased deadline 2014-05-14 11:52:16 +02:00
0c1f732c64 Do not queue messages if the peer isn't connected (e.g. timing out) 2014-05-14 11:29:57 +02:00
283f4d8eb3 Merge branch 'develop' 2014-05-13 17:59:10 +02:00
a4883a029f Propagate back to network 2014-05-13 17:51:33 +02:00
b2181ac814 Merge branch 'develop' 2014-05-13 16:38:56 +02:00
b0798e0a72 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-13 16:38:47 +02:00
9831ba20b2 Merge branch 'release/poc5-rc4' into develop 2014-05-13 16:38:38 +02:00
485e04d9df Merge branch 'release/poc5-rc4' 2014-05-13 16:38:26 +02:00
86d6aba012 Bumped 2014-05-13 16:36:43 +02:00
c9ac5b0f74 Removed lingering log statement 2014-05-13 14:44:12 +02:00
28357d657b Implemented new JS/EthPub methods
- getTxCountAt
- getPeerCount
- getIsMining
- getIsListening
- getCoinbase
2014-05-13 14:43:29 +02:00
8ec1bb382a Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-13 12:42:35 +02:00
cac9562c05 Use EthManager interface instead 2014-05-13 12:42:24 +02:00
d31303a592 Implemented support for a custom RPC port 2014-05-13 12:01:34 +02:00
a9d5656a46 Added support to NewJsonRpc to return an error as well as an interface
Also changed default port to 8080. Fixes #18
2014-05-13 11:49:55 +02:00
3647cc5b07 Implemented our own makeshift go seed. Fixes #16 2014-05-13 11:35:21 +02:00
cc341b8734 Added debug message if you try to add a peer when max peers has been reached. 2014-05-12 16:36:14 +02:00
52b664b0ae Removed peers from peerlist as soon as they disconnect. Might fix #13
We used to wait for the reaping timer to clean up the peerlist, not any longer
2014-05-12 16:32:21 +02:00
8fe0864680 Only accept peers if we asked for them 2014-05-12 16:09:23 +02:00
5fcbaefd0b Don't forward localhost connections over the public network 2014-05-12 15:43:10 +02:00
7f9fd08792 Implemented proper peer checking when adding new peers
We now resolve a hostname to IP before we try to compare it to the existing peer pool
2014-05-12 15:08:21 +02:00
8b4ed8c505 Properly exchange peer capabilities between peers 2014-05-12 13:39:37 +02:00
4eb3ad192e Made the debug line for invalid peer versions dynamic 2014-05-12 12:28:56 +02:00
36572f03a7 Merge branch 'release/poc5-rc3' into develop 2014-05-10 16:24:21 +02:00
a32dffb0e8 Merge branch 'release/poc5-rc3' 2014-05-10 16:24:14 +02:00
e22e83b19a bump 2014-05-10 16:23:50 +02:00
d3d9ed62e2 Upgraded to new mutan 2014-05-10 16:23:07 +02:00
be7da48dad Merge branch 'release/poc5-rc2' into develop 2014-05-10 02:04:14 +02:00
3af35d922e Merge branch 'release/poc5-rc2' 2014-05-10 02:04:06 +02:00
dbf8645aaf Bump 2014-05-10 02:02:54 +02:00
c03bf14e02 Fixed some tests 2014-05-10 02:01:09 +02:00
afe83af219 Moved seeding and moved manifest 2014-05-09 16:09:28 +02:00
5a0bae1dae Auto update state changes notifications 2014-05-08 19:09:36 +02:00
e8fb965ccb Cleaned up
Removed the unneeded address watch mechanism. State manager's transient
state should now take care of this.
2014-05-08 18:41:45 +02:00
d709815106 Added trans state and removed watch address etc
The transient state can be used to test out changes before committing
them to the proc state. The transient state is currently being used by
the gui to support proper nonce updating without having to wait for a
block. This used to be done by a cached state mechanism which can now
safely by removed.
2014-05-08 18:26:46 +02:00
f0440e85dc Removed value from closure. 2014-05-08 14:20:45 +02:00
554f4f6f7d Fixed disasamble for all pushes 2014-05-08 14:20:06 +02:00
6c66cb3fa9 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-07 11:05:53 +02:00
45ce820b11 Implemented value() 2014-05-07 11:05:49 +02:00
76d7bad722 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-06 17:43:34 +02:00
a0af7de58e Optimizations 2014-05-06 17:43:27 +02:00
050684450b Assume arguments are supplied as strings to the rpc interface 2014-05-06 17:04:52 +02:00
e18b96b486 Fix an issue where we don't have the rpc so we dont have to close it 2014-05-06 14:15:02 +02:00
af6875f4b2 Changed to lower case 2014-05-05 17:14:29 +02:00
66af749023 Merge branch 'release/poc5-rc1' into develop 2014-05-05 15:55:55 +02:00
2096b3a9ed Merge branch 'release/poc5-rc1' 2014-05-05 15:55:43 +02:00
fedd4c906f bump 2014-05-05 15:55:26 +02:00
78cb04cca3 wrong string 2014-05-05 15:51:43 +02:00
14a6e6a9ce Added the ability to submit byte code for contracts instead of Mutan code. 2014-05-05 15:48:17 +02:00
3e5a7b34b1 Now with files 2014-05-05 15:15:43 +02:00
a4ca9927ab Renamed etherpc to ethrpc 2014-05-05 15:15:14 +02:00
9b1f11695d Get rid of that annoying number that keeps popping up in stdout 2014-05-05 14:20:20 +02:00
87a5e94525 Merge branch 'develop' into feature/rpc 2014-05-05 14:16:53 +02:00
b98cc2fb4e Fixed GetBlock when no block can be found 2014-05-05 14:15:58 +02:00
fde3e01f80 Fixed import cycle 2014-05-05 14:15:31 +02:00
c496aad20b Renamed Ethereum RPC package 2014-05-05 13:49:59 +02:00
8adad0654a Added more JSON niceties to types 2014-05-05 13:49:46 +02:00
5757f5df2a Added secret to address method 2014-05-05 13:09:29 +02:00
39b8c83ba6 Impelemented GetStorageAt 2014-05-05 13:01:02 +02:00
7c91159449 Added different storage notification object 2014-05-05 11:56:25 +02:00
4f20e8f649 Implemented first few methods via public api 2014-05-02 20:00:58 +02:00
1f6df0cd52 Added receipts for tx creation 2014-05-02 14:08:54 +02:00
69d83b1da5 Merge branch 'develop' into feature/rpc 2014-05-02 14:08:27 +02:00
e798f221dd Added public interface 2014-05-02 13:55:43 +02:00
c54788338a Merge branch 'develop' into feature/rpc 2014-05-02 13:35:54 +02:00
ebdf339a61 Implemented RPC framework 2014-05-02 13:35:25 +02:00
70c8656640 Added a KeyPairFromSec function which creates a new keypair based on the given seckey 2014-05-02 12:11:55 +02:00
17674fb888 Added suicide back in 2014-05-01 22:14:34 +02:00
91aa189ef3 Fixed Upnp bug 2014-05-01 22:14:20 +02:00
e6a68f0c3a Removed debug log 2014-05-01 22:13:59 +02:00
d2ab322267 Removed debugging log 2014-04-30 17:43:48 +02:00
c3293641e7 Removed debug logging 2014-04-30 17:13:32 +02:00
21724f7ef9 Added manifest changes and changed closures 2014-04-30 14:43:32 +02:00
38d6b67b5c Fixed state problem 2014-04-29 12:36:27 +02:00
5516efdfa0 Removed old code 2014-04-27 18:05:30 +02:00
21f8806eed Moved assembler stage to the mutan compiler 2014-04-27 18:01:37 +02:00
bf850974f3 Using mutan assembler stage 2014-04-27 18:00:38 +02:00
338b698091 Refactoring and added documentation comments 2014-04-27 17:16:53 +02:00
16e52327a4 Upped version number 2014-04-27 16:53:35 +02:00
05d2d8f27d Actually convert gas 2014-04-26 02:11:00 +02:00
ca6e3f6def Notify of changes 2014-04-26 02:06:25 +02:00
d3a159ad3d Fixed tests 2014-04-26 01:54:45 +02:00
0f93da400a Added new state object change echanism 2014-04-26 01:48:40 +02:00
f3818478e2 Removed debug & unused functions 2014-04-24 13:48:33 +02:00
ee7c16a8d9 Fixed Base problem and sload/sstore 2014-04-24 13:30:57 +02:00
1c85d8c66b Minor improvements and bug fixes
* Fixed VM base bug
2014-04-24 00:00:50 +02:00
0651af9dfd Removed some log statements and disabled additional validation checks 2014-04-23 15:54:15 +02:00
c81804444f Call initial closure with proper tx argument 2014-04-23 15:53:53 +02:00
ef7f3f36e2 Renamed CALLDATA to CALLDATALOAD 2014-04-23 15:53:34 +02:00
f7d4e3cd6b Copy over bytes from previous root
Copy over instead of directly using the previous root. This is order to
avoid resetting problems
2014-04-23 15:52:50 +02:00
6b08efabf8 @maranh see comment 2014-04-23 12:14:28 +02:00
3a9a252f6e Fixed minor issue with gas and added state object init 2014-04-23 11:51:04 +02:00
61cd1594b5 Fixed gas, price & value setters on initialization 2014-04-23 11:50:38 +02:00
11c26e3211 Implemented ethereum package reader 2014-04-23 11:50:17 +02:00
6930260962 Updated VM 2014-04-20 01:31:01 +02:00
a96c8c8af9 Added proper gas handling 2014-04-18 13:41:07 +02:00
c5729d7ecc comments 2014-04-16 04:07:52 +02:00
d811920d8b Hack for miner problem added w/ note
@maranh please check
2014-04-16 04:07:21 +02:00
9c6aca7893 Merged accounts and contracts in to StateObject
* Account removed
* Contract removed
* Address state changed to CachedStateObject
* Added StateObject
2014-04-16 04:06:51 +02:00
ca13e3b105 Moved assembler stage processing to it's own file 2014-04-15 16:16:38 -04:00
086acd122b Added pre processing of script data 2014-04-12 00:13:42 -04:00
116516158d Renamed 2014-04-11 13:29:57 -04:00
ca747f2688 Added the possibility for debug hooks during closure call 2014-04-11 08:28:30 -04:00
7d6ba88d2b Merge branch 'split' into develop 2014-04-10 21:05:58 -04:00
d927c154e7 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-04-10 21:05:23 -04:00
25dd46061f Added push20 2014-04-10 21:03:14 -04:00
afc92fb7d7 Added better address format 2014-04-10 18:32:54 -04:00
891f725909 Added better address format 2014-04-10 18:14:19 -04:00
969e748dce Call fixed 2014-04-10 15:30:14 -04:00
6a530ea371 Call fixed 2014-04-10 14:40:12 -04:00
0fccbeabcc No longer return a list, but raw bytes 2014-04-09 12:28:34 -04:00
720521ed4a Changed how txs define their data & added init field 2014-04-09 12:28:16 -04:00
e09f0a5f2c Split code for contracts 2014-04-09 12:27:54 -04:00
4f2e9c2640 Check for nil 2014-04-09 12:27:25 -04:00
5714a82778 Small tweaks to mnemonic 2014-04-09 11:06:30 -04:00
272b135b74 One more line of comment 2014-04-09 10:40:55 -04:00
335dc9e687 Merge branch 'develop' into feature/mnemonic 2014-04-09 10:06:51 -04:00
03e139d23b Switched variable names 2014-04-09 16:04:36 +02:00
6d28bf534f Added a length for copy 2014-04-09 16:00:28 +02:00
c0cad0b534 Merge branch 'miner' of github.com-obscure:ethereum/eth-go into miner 2014-04-09 15:50:49 +02:00
a83db489df Fix transaction on new blocks 2014-04-09 09:48:17 -04:00
035f0ffb8a Reverted changes 2014-04-09 15:08:10 +02:00
b66a99e32d Added todo 2014-04-09 08:55:39 -04:00
527a3bbc2a Typo fix 2014-04-09 14:53:20 +02:00
c0a030ef0a Added new insruction methods 2014-04-09 14:08:18 +02:00
35a82f8f4a Added support for mneomnic privkeys 2014-04-07 14:00:02 +02:00
12643c7c57 Merge branch 'develop' into miner 2014-04-05 11:25:29 +02:00
90bb512f42 Update 2014-04-05 10:49:07 +02:00
782910eaa7 Small tweaks 2014-04-01 15:54:29 +02:00
3558dd5ed4 Finalize blockchain reverting test 2014-04-01 14:42:48 +02:00
0a88010826 Merge conflicts 2014-04-01 14:20:55 +02:00
7d0348e4ba Handle contract messages 2014-04-01 10:41:30 +02:00
5f49a659c3 More blockchain testing 2014-03-31 12:54:37 +02:00
7277c42047 Fixed some state issues 2014-03-31 01:03:28 +02:00
7cc28c8b46 Added storage test 2014-03-30 22:03:08 +02:00
205e33bc83 Fixed bug in stack to expand beyond expectations. Fixed EQ and NOT opcode 2014-03-30 18:55:51 +02:00
6625b6ffbd Changed to new mutan API 2014-03-30 12:58:37 +02:00
b888652201 Added missing GetTx (0x16) wire message 2014-03-28 11:20:07 +01:00
60fd2f3521 Update vm_test.go
store ...
2014-03-27 23:25:03 +01:00
75e6406c1f Fixed tests 2014-03-27 23:17:23 +01:00
3c3431d111 Fixed IsContract method to use the contractCreation flag 2014-03-27 23:17:14 +01:00
56a58ad70d Removed debug and comments 2014-03-27 22:02:39 +01:00
00c5f9b9a6 Updated transaction model
Changed the behaviour of decoding rlp data. Something is considered to
be creating a contract if the 4th item is a list.

Changed constructors.
2014-03-27 19:49:47 +01:00
7660e1ed90 Added a IsList method for type checking []interface{} 2014-03-27 19:42:01 +01:00
43cad69016 Reworked transaction constructors 2014-03-27 15:42:39 +01:00
308c59320c Fixed typo 2014-03-27 15:38:55 +01:00
6253d10938 initial testcode for canonical chain 2014-03-24 15:04:29 +01:00
e0b6091d7e Test fixes and removed old code. Added VM gas fees 2014-03-24 13:20:34 +01:00
ec6ec62dd4 Remove some xtra logs 2014-03-24 10:56:52 +01:00
97786d03d5 Merge branch 'master' into miner 2014-03-24 10:24:39 +01:00
274d5cc91c FindCanonicalChain returns true or false when we are on the Canonical chain or not 2014-03-24 10:24:06 +01:00
6a86c517c4 Removed old VM code 2014-03-22 11:47:27 +01:00
01c1bce9c5 Removed regular ints from the virtual machine and closures 2014-03-21 18:22:47 +01:00
9a9e252cab Changes 'compiler' to work with any type 2014-03-21 15:27:18 +01:00
b52b1fca89 Initial block reorganisation code 2014-03-21 15:06:23 +01:00
2ea4c632d1 Closure return, arguments fixed. Added proper tests 2014-03-21 14:47:55 +01:00
fa1db8d2dc Implemented closure arguments 2014-03-21 11:54:36 +01:00
9cf8ce9ef8 New tx methods and added new vm to state manager 2014-03-21 00:04:31 +01:00
f567f89b99 Added address to account and contract
Contract and account now both have an address field or method for the
sake of simplicity.
2014-03-20 23:38:16 +01:00
7705b23f24 Removed caller from tx and added "callership" to account.
Transactions can no longer serve as callers. Accounts are now the
initial callee of closures. Transactions now serve as transport to call
closures.
2014-03-20 23:17:53 +01:00
f3d27bf5d8 Rewrote opcodes again 2014-03-20 22:51:20 +01:00
c68ff9886b Fixed MSTORE and added some more commets 2014-03-20 19:50:53 +01:00
f21eb88ad1 Some minor updates 2014-03-20 17:27:48 +01:00
c642094cac Added encoder interface 2014-03-20 17:27:26 +01:00
3520771d68 Comply to Callee interface 2014-03-20 17:27:09 +01:00
c17381b853 Moved code around 2014-03-20 17:26:51 +01:00
59d8dc3950 Fixed issue with stack where it sliced of the wrong values 2014-03-20 17:26:30 +01:00
38ea6a6d5d Closures and vm based on closures
Status: Work in progress
2014-03-20 17:26:07 +01:00
82d0f65dab Comply to Callee structure 2014-03-20 17:25:11 +01:00
c135b389fe Commented out code due to rewrite vm 2014-03-20 17:24:53 +01:00
bdc0d1b7ad Added AddFunds method 2014-03-20 17:24:02 +01:00
ae837c4719 More mining rework 2014-03-20 11:20:29 +01:00
344e827061 Added client string to configuration
Clients can set their own client string which will be send to connected
peers during the handshake.
2014-03-17 12:08:16 +01:00
2be2fc7974 Merge branch 'develop' into miner 2014-03-17 11:15:28 +01:00
826c827e6b Added a copy method to state 2014-03-17 11:15:09 +01:00
2b9b02812e Log 2014-03-17 11:14:00 +01:00
07578fe25f Pretty print nonce 2014-03-17 11:13:35 +01:00
095d5baaed Merge conflicts 2014-03-17 10:41:05 +01:00
8ea7e21f64 Merge 2014-03-17 10:37:37 +01:00
3274e0a249 Removed extra invalid nonce return 2014-03-17 10:37:29 +01:00
b15a4985e8 Moved on to the state manager 2014-03-17 10:33:03 +01:00
d5efeab8f9 Initial smart-miner stuff 2014-03-10 11:53:02 +01:00
54bcee512d Merge branch 'develop' of https://github.com/jarradh/eth-go into jarradh-develop 2014-03-07 11:26:46 +01:00
685ea3e9a9 Wip keychains 2014-03-07 11:26:35 +01:00
694ef47041 gofmt -w ethereum.go 2014-03-07 11:11:11 +01:00
9d887234ea Small Optimization on port 2014-03-06 19:11:38 +01:00
e2e338929f Fix Whitespace 2014-03-06 19:03:26 +01:00
8162aff8cf Add DNS Bootstrapping 2014-03-06 19:01:38 +01:00
ea873304ca No longer dev 2014-03-06 13:10:39 +01:00
f80984491a Removed comments 2014-03-06 13:09:55 +01:00
e7770b2332 Added miner state 2014-03-06 13:06:54 +01:00
be543a6d17 Removed comments 2014-03-06 13:03:24 +01:00
6c6e8b0fd7 Renamed block manager to state manager 2014-03-05 10:57:32 +01:00
79320e2868 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-03-05 10:44:57 +01:00
92f2abdf76 Partially refactored server/txpool/block manager/block chain
The Ethereum structure now complies to a EthManager interface which is
being used by the tx pool, block manager and block chain in order to
gain access to each other. It's become simpeler.
TODO: BlockManager => StateManager
2014-03-05 10:42:51 +01:00
c1de7bcec5 Merge pull request #10 from mquandalle/patch-1
Rename .travil.yml to .travis.yml
2014-03-04 11:28:01 +01:00
8577e9116e Rename .travil.yml to .travis.yml 2014-03-03 18:13:08 +01:00
5b1613d65b Merge branch 'master' into develop 2014-03-03 11:35:35 +01:00
c1d0ea7366 Updated protocol version to 7 2014-03-03 11:34:04 +01:00
9d492b0509 Renamed Address to Account 2014-03-03 11:05:12 +01:00
bfed1c7cac Trie's are no longer referenced directly but through State instead 2014-03-03 11:03:16 +01:00
d2bc57cd34 PoC reactor pattern 2014-03-03 00:55:10 +01:00
d65b4cd0dd Updated block to use state instead of trie directly 2014-03-02 20:42:05 +01:00
f1b354e6aa Reactor implemented 2014-03-02 02:22:20 +01:00
d7c5936ac4 Merge branch 'hotfix/0.3.1' into develop 2014-02-28 16:46:12 +01:00
ceada15290 Merge branch 'hotfix/0.3.1' 2014-02-28 16:45:54 +01:00
b462ca4aad Bump 2014-02-28 16:45:46 +01:00
601340bd46 Fixed shutting down 2014-02-28 16:45:29 +01:00
8ee8ec8a36 Merge branch 'develop' of https://github.com/james-c/eth-go into james-c-develop
Conflicts:
	ethdb/database.go
2014-02-28 12:43:31 +01:00
7de2c7f176 Merge branch 'release/0.3.0' into develop 2014-02-28 12:21:19 +01:00
839bd73fbb Merge branch 'release/0.3.0' 2014-02-28 12:21:12 +01:00
3f7ec1a83f Conform to Db interface 2014-02-28 12:19:45 +01:00
8fa19664e6 Added BigCopy 2014-02-28 12:19:21 +01:00
9d06f9e6fb Updated readme#trie 2014-02-28 12:19:01 +01:00
c0fcefa3a0 Added a GetKeys method to support multiple accounts 2014-02-28 12:18:41 +01:00
c9f3d1c00b leveldb API changed for NewIterator. Fixes #20 2014-02-28 10:36:06 +01:00
179255c3fe Merge branch 'goleveldb_fix' into develop 2014-02-26 15:28:27 +00:00
4fad5958d0 Fix error in call to NewIterator function
Change number of args passed to NewIterator in print function to reflect changes in the goleveldb project.
2014-02-26 15:26:39 +00:00
e98b53bbef WIP Observing pattern 2014-02-25 11:22:27 +01:00
4b8c50e2cd Deprication 2014-02-25 11:22:18 +01:00
1e7b3cbb13 Removed debug log 2014-02-25 11:22:05 +01:00
ce07d9bb4c Error logging on tx processing 2014-02-25 11:21:49 +01:00
507fc7b9d1 Length checking when fetching contract. Contract always have 3 fields 2014-02-25 11:21:35 +01:00
4f4175a3e2 Addad db name for new ldb 2014-02-25 11:21:03 +01:00
c7e73ba12d Added currency converting 2014-02-25 11:20:24 +01:00
b30b9ab8cb Fixed a minor issue where a string is expected but returns slice 2014-02-25 10:50:53 +01:00
0afdedb01a Some log statements changed to the default logger 2014-02-24 13:50:52 +01:00
6c7255cde2 Fixed a minor issue on crashed contracts 2014-02-24 13:15:34 +01:00
f2234264ed Merge pull request #8 from josephyzhou/develop
parse returns byte array instead of string now
2014-02-24 12:53:30 +01:00
95a8ebc249 Changed MakeContract on block
MakeContract in Block is now using the MakeContract defined in
contract.go
2014-02-24 12:45:21 +01:00
88a9c62fcc Proper tests 2014-02-24 12:44:29 +01:00
b29c1eecd1 Removed debug print 2014-02-24 12:44:18 +01:00
d69db6e617 Removed compiling from the transaction 2014-02-24 12:13:42 +01:00
d8b5bbd48c Added compile 2014-02-24 12:13:22 +01:00
22e2c3429b Infof rather than infoln 2014-02-24 12:12:53 +01:00
4cc5b03137 Added opcodes 2014-02-24 12:12:32 +01:00
a3fb7008b2 Added make contract 2014-02-24 12:12:24 +01:00
55c1c220d0 Added delete to database interfaces 2014-02-24 12:12:01 +01:00
5971c82094 Updated opcodes ... again 2014-02-24 12:11:42 +01:00
1a98bbf1c8 Added a trie iterator 2014-02-24 12:11:00 +01:00
377c995103 Separated the VM from the block manager and added states 2014-02-24 12:10:45 +01:00
8ecb24f114 parse now returns byte[] instead of string 2014-02-23 14:43:18 -08:00
3a45cdeaf9 Moved txpool start to initialisation method of ethereumm 2014-02-23 01:57:45 +01:00
a4a4ffbeff Moved address 2014-02-23 01:57:22 +01:00
f5737b929a Added a secondary processor 2014-02-23 01:57:04 +01:00
c66cf95b40 Added address states for storing a session based address 2014-02-23 01:56:48 +01:00
73b9ae9579 Updated some of the log statements to use the ethutil logger 2014-02-22 01:53:25 +01:00
4bfd717ba2 Added the ability to extend the logger with more sub systems 2014-02-22 01:53:09 +01:00
cca8585554 Get a chain of blocks made simple 2014-02-21 13:05:59 +01:00
18cc35338a Fixed contract running 2014-02-21 12:37:16 +01:00
681eacaa7f Removed old instruction code 2014-02-21 12:37:06 +01:00
b20c0b1d59 Removed all old code 2014-02-21 12:36:41 +01:00
f2a1260294 Nil is also considered empty 2014-02-21 12:36:22 +01:00
06ea7fc830 re: Added contract fees 2014-02-20 23:11:17 +01:00
ed05779adb Updated fees 2014-02-20 23:10:43 +01:00
8f69c2ac45 Added contract addr acessors 2014-02-20 23:10:36 +01:00
504d356232 Added peek(n) 2014-02-20 23:10:16 +01:00
059ad35215 Type checking 2014-02-20 23:10:05 +01:00
9bc5c4a0c5 Long over due Trie delete implemented 2014-02-20 14:40:00 +01:00
4afb624c45 WIP state object 2014-02-19 16:28:08 +01:00
39b6eaf51c Debug logging functions 2014-02-19 16:27:35 +01:00
d4cc125456 Added more logging functions 2014-02-19 16:27:22 +01:00
dc994b3518 Changed fee structure 2014-02-19 16:27:08 +01:00
8e7daec886 Added fees and debugging 2014-02-19 16:26:55 +01:00
b3da104e56 Corrected contract addresses 2014-02-19 16:26:35 +01:00
0936e5ccf5 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
Conflicts:
	ethutil/config.go
2014-02-19 11:40:02 +01:00
531b3a96eb Merge pull request #5 from sdboyer/iotas
Idiomatic go: use iotas for const declarations
2014-02-19 11:38:02 +01:00
3dae732f36 Merge pull request #6 from sdboyer/genisis
Fix typo(?) in naming - s/GenisisHeader/GenesisHeader/
2014-02-19 11:36:53 +01:00
1e241e3a61 Merge pull request #7 from sdboyer/vet-fixes
Fix a couple errors from go vet
2014-02-19 11:36:23 +01:00
24f2b2afc3 Running contracts fixed 2014-02-19 11:35:17 +01:00
357b4bc14c Add comment explaining why iota is not used. 2014-02-18 17:24:44 -05:00
5adbd39946 Express bit flag constants using iota bitshift. 2014-02-18 17:20:41 -05:00
6dac014978 Fix a couple errors from go vet 2014-02-18 10:47:09 -05:00
4d405f6654 s/GenisisHeader/GenesisHeader/ 2014-02-18 10:40:58 -05:00
bbcf304b99 Merge pull request #3 from josephyzhou/develop
Migrated to here
2014-02-18 16:04:45 +01:00
c866fcc5b3 Added new address 2014-02-18 12:10:21 +01:00
d7eca7bcc1 Rlp update 2014-02-18 01:34:06 +01:00
68028f492f Fixed block handling 2014-02-18 01:33:26 +01:00
8629d9a418 String changed and removed some debugging code 2014-02-18 01:33:15 +01:00
c7623c3165 Changed debug messages 2014-02-18 01:32:39 +01:00
ba95849097 Added hex method 2014-02-18 01:32:20 +01:00
bb3e28310e If sender is receiver only subtract the fee 2014-02-18 01:31:51 +01:00
a5b7279cb5 Changed uncle block fee as to what it should be 2014-02-18 01:31:31 +01:00
c5b009ba6f new line 2014-02-17 15:47:33 -08:00
e72a782bf0 adding compact decode tests 2014-02-17 15:46:16 -08:00
7413552a28 Root should reset on undo 2014-02-17 20:40:33 +01:00
b7a636b894 Values should accept bytes as valid string output 2014-02-17 20:29:54 +01:00
e5b97fe03e Added proper error message 2014-02-16 20:33:23 +01:00
2ea05292c0 Added proper name :) 2014-02-16 20:33:07 +01:00
e4a6ee3d7f Added dirty tracking on the cache 2014-02-16 20:32:56 +01:00
7264044122 Added a few tests 2014-02-16 20:31:02 +01:00
f1d6f1bd17 Removed Reset 2014-02-16 20:30:50 +01:00
c95a27e394 Added more tests 2014-02-16 20:30:33 +01:00
066940f134 Defer undo on the current block's state 2014-02-16 20:30:21 +01:00
07c12f0b92 Added trie tests, value tests 2014-02-15 13:21:11 +01:00
5883446b21 Fixed test 2014-02-15 12:41:17 +01:00
9bcb3d2216 Fixed test 2014-02-15 12:40:19 +01:00
424b0b8bac Merge branch 'hotfix/0.2.2-1' into develop 2014-02-15 12:12:01 +01:00
30ee32a725 Merge branch 'hotfix/0.2.2-1' 2014-02-15 12:11:53 +01:00
f5fbbb147f Removed debug message 2014-02-15 12:11:40 +01:00
147a74dff2 Merge branch 'release/0.2.2' into develop 2014-02-15 11:53:02 +01:00
60afd02e59 Merge branch 'release/0.2.2' 2014-02-15 11:52:38 +01:00
fd1aa869e1 Bumped version number 2014-02-15 11:52:28 +01:00
334c41d088 Added MIT license 2014-02-15 11:49:53 +01:00
4a656eff7b Added git flow explanation 2014-02-15 11:49:39 +01:00
73fd358d94 Removed RlpValue in favour of Value 2014-02-15 01:34:18 +01:00
f247f0c518 Added readme 2014-02-15 00:04:46 +01:00
f6d1bfe45b The great merge 2014-02-14 23:56:09 +01:00
c2fb9f06ad Refactoring RlpValue => Value 2014-02-13 15:12:16 +01:00
67de76c217 Put leveldb 2014-02-11 20:09:58 +01:00
02acef23d5 Interop! 2014-02-11 18:46:28 +01:00
5a83114efd Seed bootstrapping added 2014-02-10 20:59:31 +01:00
42123b4396 Fixed peer handling 2014-02-10 16:41:36 +01:00
0ae6a38825 Database 2014-02-10 16:04:57 +01:00
8ab6c53231 Reversed back 2014-02-10 13:59:05 +01:00
1d26ae2dea Changed client id 2014-02-10 11:45:08 +01:00
d2edc2bbf4 Added some loggers 2014-02-10 11:36:49 +01:00
8db7d791f0 Corrected version number in error log 2014-02-10 11:20:42 +01:00
a50b4f6b11 Forgot to bump the version 2014-02-10 01:15:14 +01:00
156495732b level db back in 2014-02-10 01:10:02 +01:00
3c4fb01da3 Version 3 and added added catch up 2014-02-10 01:09:12 +01:00
c00b1dd508 Self connect on handshake 2014-02-09 23:58:59 +01:00
0de31a3898 Fixed self connect through public key discovery.
Bumped protocol version number
2014-02-09 23:34:33 +01:00
24349bc431 Changed peer format 2014-02-08 21:02:42 +01:00
1f7b13ff4e Switched over to leveldb instead of memdb 2014-02-08 21:02:09 +01:00
04c00f40f0 Fixed value 2014-02-06 13:27:57 +01:00
9e9b7a520e Do not quit if upnp fails 2014-02-03 17:26:37 +01:00
f995f5763b Properly encode tx 2014-02-03 01:12:44 +01:00
6292c5ad5a Transaction processing 2014-02-03 01:10:10 +01:00
a9a564c226 removed self connect log 2014-02-02 20:54:13 +01:00
04b6e413d9 Encode caps as byte 2014-02-02 20:06:37 +01:00
aa9341570b Disconnection reasons 2014-02-02 20:00:09 +01:00
f4a96ca588 Removed the seed peer option from start 2014-02-02 19:46:37 +01:00
48b41862ef UPnP Support 2014-02-02 19:44:47 +01:00
3f503ffc7f Implemented support for UPnP 2014-02-02 19:22:39 +01:00
ae0d4eb7aa removed upnp 2014-02-02 16:29:13 +01:00
cb8a7d979d upnp test 2014-02-02 16:15:39 +01:00
b70fe3a9be Reverted back to messages 2014-02-02 01:39:06 +01:00
dfa778fed6 UPNP wip 2014-02-01 21:30:54 +01:00
8c4746a3df (un)pack addr 2014-01-31 20:01:28 +01:00
ce69334988 For the testnet always 30303 for now to make it easy 2014-01-31 13:37:16 +01:00
8c09602a8b Self connect 2014-01-31 13:03:13 +01:00
da66eddfcc Get peers returns now both in and outbound peers 2014-01-31 11:57:56 +01:00
dfa38b3f91 Peer connection checking 2014-01-31 11:18:10 +01:00
36f221dbe7 Don't connect to peers that are already connected 2014-01-31 01:12:48 +01:00
7f100e9610 Self connect detect 2014-01-31 00:56:32 +01:00
7ccf51fd30 Updated seed peers 2014-01-30 23:48:52 +01:00
3e400739a7 Implemented get chain msg 2014-01-28 15:35:44 +01:00
4a82230de5 Switched port and removed logging 2014-01-27 22:13:46 +01:00
884f792871 Removed default connection 2014-01-27 15:34:50 +01:00
7931c6624c Graceful shutdown of peers 2014-01-25 17:13:33 +01:00
1b7cba1878 Updated peers 2014-01-24 17:48:21 +01:00
233f5200ef Data send over the wire shouldn't be RLPed more then once 2014-01-23 22:32:50 +01:00
878e796c0a Updated packages 2014-01-23 20:55:23 +01:00
2b32f47d2c Initial commit bootstrapping package 2014-01-23 20:14:01 +01:00
345 changed files with 68899 additions and 2391 deletions

4
.gitignore vendored
View File

@ -9,6 +9,4 @@
*un~
.DS_Store
*/**/.DS_Store
ethereum/ethereum
ethereal/ethereal
.ethtest

View File

@ -1,4 +1,25 @@
before_install: sudo apt-get install libgmp3-dev
language: go
go:
- 1.2
- 1.3
before_install:
- sudo add-apt-repository ppa:ubuntu-sdk-team/ppa -y
- sudo apt-get update -qq
- sudo apt-get install -yqq libgmp3-dev qtbase5-private-dev qtdeclarative5-private-dev libqt5opengl5-dev libreadline6-dev
install:
- go get code.google.com/p/go.tools/cmd/goimports
- go get github.com/golang/lint/golint
# - go get code.google.com/p/go.tools/cmd/vet
- go get code.google.com/p/go.tools/cmd/cover
- go get github.com/mattn/goveralls
- ./install_deps.sh
before_script:
- gofmt -l -w .
- goimports -l -w .
- golint .
# - go vet ./...
# - go test -race ./...
script:
- ./gocoverage.sh && goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN
env:
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="

41
Dockerfile Normal file
View File

@ -0,0 +1,41 @@
FROM ubuntu:14.04
## Environment setup
ENV HOME /root
ENV GOPATH /root/go
ENV PATH /go/bin:/root/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
RUN mkdir -p /root/go
ENV DEBIAN_FRONTEND noninteractive
## Install base dependencies
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y git mercurial build-essential software-properties-common pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev
## Build and install Go
RUN hg clone -u release https://code.google.com/p/go
RUN cd go && hg update go1.4
RUN cd go/src && ./all.bash && go version
## Install GUI dependencies
RUN add-apt-repository ppa:ubuntu-sdk-team/ppa -y
RUN apt-get update -y
RUN apt-get install -y qtbase5-private-dev qtdeclarative5-private-dev libqt5opengl5-dev
## Fetch and install serpent-go
RUN go get -v -d github.com/ethereum/serpent-go
WORKDIR $GOPATH/src/github.com/ethereum/serpent-go
RUN git checkout master
RUN git submodule update --init
RUN go install -v
# Fetch and install go-ethereum
RUN go get -v -d github.com/ethereum/go-ethereum/...
WORKDIR $GOPATH/src/github.com/ethereum/go-ethereum
RUN git checkout poc8
RUN ETH_DEPS=$(go list -f '{{.Imports}} {{.TestImports}} {{.XTestImports}}' github.com/ethereum/go-ethereum/... | sed -e 's/\[//g' | sed -e 's/\]//g' | sed -e 's/C //g'); if [ "$ETH_DEPS" ]; then go get $ETH_DEPS; fi
RUN go install -v ./cmd/ethereum
# Run JSON RPC
ENTRYPOINT ["ethereum", "-rpc=true", "-rpcport=8080"]
EXPOSE 8080

View File

@ -1,16 +1,16 @@
Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; if not, write to the Free Software
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA

View File

@ -1,44 +1,75 @@
[![Bugs](https://badge.waffle.io/ethereum/go-ethereum.png?label=bug&title=Bugs)](https://waffle.io/ethereum/go-ethereum)
[![Stories in Ready](https://badge.waffle.io/ethereum/go-ethereum.png?label=ready&title=Ready)](https://waffle.io/ethereum/go-ethereum)
[![Stories in
Progress](https://badge.waffle.io/ethereum/go-ethereum.svg?label=in%20progress&title=In Progress)](http://waffle.io/ethereum/go-ethereum)
Ethereum
========
Master [![Build
Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-master-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-master-docker/builds/-1) Develop [![Build
Status](http://cpt-obvious.ethercasts.com:8010/buildstatusimage?builder=go-ethereum-develop-docker)](http://cpt-obvious.ethercasts.com:8010/builders/go-ethereum-develop-docker/builds/-1)
[![Build
Status](http://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20master%20branch)](http://build.ethdev.com:8010/builders/Linux%20Go%20master%20branch/builds/-1) master [![Build
Status](http://build.ethdev.com/buildstatusimage?builder=Linux%20Go%20develop%20branch)](http://build.ethdev.com:8010/builders/Linux%20Go%20develop%20branch/builds/-1) develop
Ethereum Go Client © 2014 Jeffrey Wilcke.
Current state: Proof of Concept 0.6.5.
Current state: Proof of Concept 0.7
For the development package please see the [eth-go package](https://github.com/ethereum/eth-go).
Ethereum is currently in its testing phase.
Build
=======
=====
To build Ethereal (GUI):
To build Mist (GUI):
`go get github.com/ethereum/go-ethereum/ethereal`
`go get github.com/ethereum/go-ethereum/cmd/mist`
To build the node (CLI):
`go get github.com/ethereum/go-ethereum/ethereum`
`go get github.com/ethereum/go-ethereum/cmd/ethereum`
For further, detailed, build instruction please see the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go))
Automated (dev) builds
======================
* [[OS X](http://build.ethdev.com/builds/OSX%20Go%20develop%20branch/latest/app/)]
* [Windows] Coming soon&trade;
* [Linux] Coming soon&trade;
Binaries
========
Go Ethereum comes with several binaries found in
[cmd](https://github.com/ethereum/go-ethereum/tree/master/cmd):
* `mist` Official Ethereum Browser
* `ethereum` Ethereum CLI
* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/testes) suit:
`ethtest "`cat myfile.json`"`.
* `evm` is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas
10000 -price 0 -dump`. See `-h` for a detailed description.
General command line options
====================
============================
```
Shared between ethereum and ethereal
== Shared between ethereum and Mist ==
= Settings
-id Set the custom identifier of the client (shows up on other clients)
-port Port on which the server will accept incomming connections
-upnp Enable UPnP
-maxpeer Desired amount of peers
-rpc Start JSON RPC
-dir Data directory used to store configs and databases
-import Import a private key
-genaddr Generates a new address and private key (destructive action)
-h This
= Utility
-h This
-import Import a private key
-genaddr Generates a new address and private key (destructive action)
-dump Dump a specific state of a block to stdout given the -number or -hash
-difftool Supress all output and prints VM output to stdout
-diff vm=only vm output, all=all output including state storage
Ethereum only
ethereum [options] [filename]
@ -46,31 +77,34 @@ ethereum [options] [filename]
filename Load the given file and interpret as JavaScript
-m Start mining blocks
Etheral only
== Mist only ==
-asset_path absolute path to GUI assets directory
```
Contribution
============
If you would like to contribute to Ethereum Go, please fork, fix, commit and
send a pull request to the main repository. Commits which do not comply with the coding standards explained below
will be ignored. If you send a pull request, make sure that you
commit to the `develop` branch and that you do not merge to `master`.
Commits that are directly based off of the `master` branch instead of the `develop` branch will be ignored.
If you'd like to contribute to Ethereum please fork, fix, commit and
send a pull request. Commits who do not comply with the coding standards
are ignored (use gofmt!). If you send pull requests make absolute sure that you
commit on the `develop` branch and that you do not merge to master.
Commits that are directly based on master are simply ignored.
To make this process simpler try following the [git flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model, as it sets this process up and streamlines work flow.
To make life easier try [git flow](http://nvie.com/posts/a-successful-git-branching-model/) it sets
this all up and streamlines your work flow.
Coding standards
================
Code should be formatted according to the [Go Formatting
Sources should be formatted according to the [Go Formatting
Style](http://golang.org/doc/effective_go.html#formatting).
Unless struct fields are supposed to be directly accessible, provide
getters and hide the fields through Go's exporting facility.
Unless structs fields are supposed to be directly accesible, provide
Getters and hide the fields through Go's exporting facility.
Make comments in your code meaningful and only use them when necessary. Describe in detail what your code is trying to achieve. For example, this would be redundant and unnecessary commenting:
When you comment put meaningfull comments. Describe in detail what you
want to achieve.
*wrong*
@ -81,7 +115,12 @@ if x > y {
}
```
Everyone reading the source code should know what this code snippet was meant to achieve, and so those are **not** meaningful comments.
Everyone reading the source probably know what you wanted to achieve
with above code. Those are **not** meaningful comments.
While this project is constantly tested and run, code tests should be written regardless. There is not time to evaluate every person's code specifically, so it is expected of you to write tests for the code so that it does not have to be tested manually. In fact, contributing by simply writing tests is perfectly fine!
While the project isn't 100% tested I want you to write tests non the
less. I haven't got time to evaluate everyone's code in detail so I
expect you to write tests for me so I don't have to test your code
manually. (If you want to contribute by just writing tests that's fine
too!)

BIN
_data/chain1 Executable file

Binary file not shown.

BIN
_data/chain2 Executable file

Binary file not shown.

351
block_pool.go Normal file
View File

@ -0,0 +1,351 @@
package eth
import (
"bytes"
"container/list"
"fmt"
"math"
"math/big"
"sync"
"time"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/wire"
)
var poollogger = logger.NewLogger("BPOOL")
type block struct {
from *Peer
peer *Peer
block *types.Block
reqAt time.Time
requested int
}
type BlockPool struct {
mut sync.Mutex
eth *Ethereum
hashes [][]byte
pool map[string]*block
td *big.Int
quit chan bool
fetchingHashes bool
downloadStartedAt time.Time
ChainLength, BlocksProcessed int
peer *Peer
}
func NewBlockPool(eth *Ethereum) *BlockPool {
return &BlockPool{
eth: eth,
pool: make(map[string]*block),
td: ethutil.Big0,
quit: make(chan bool),
}
}
func (self *BlockPool) Len() int {
return len(self.hashes)
}
func (self *BlockPool) Reset() {
self.pool = make(map[string]*block)
self.hashes = nil
}
func (self *BlockPool) HasLatestHash() bool {
self.mut.Lock()
defer self.mut.Unlock()
return self.pool[string(self.eth.ChainManager().CurrentBlock().Hash())] != nil
}
func (self *BlockPool) HasCommonHash(hash []byte) bool {
return self.eth.ChainManager().GetBlock(hash) != nil
}
func (self *BlockPool) Blocks() (blocks types.Blocks) {
for _, item := range self.pool {
if item.block != nil {
blocks = append(blocks, item.block)
}
}
return
}
func (self *BlockPool) FetchHashes(peer *Peer) bool {
highestTd := self.eth.HighestTDPeer()
if (self.peer == nil && peer.td.Cmp(highestTd) >= 0) || (self.peer != nil && peer.td.Cmp(self.peer.td) > 0) || self.peer == peer {
if self.peer != peer {
poollogger.Infof("Found better suitable peer (%v vs %v)\n", self.td, peer.td)
if self.peer != nil {
self.peer.doneFetchingHashes = true
}
}
self.peer = peer
self.td = peer.td
if !self.HasLatestHash() {
self.fetchHashes()
}
return true
}
return false
}
func (self *BlockPool) fetchHashes() {
peer := self.peer
peer.doneFetchingHashes = false
const amount = 256
peerlogger.Debugf("Fetching hashes (%d) %x...\n", amount, peer.lastReceivedHash[0:4])
peer.QueueMessage(wire.NewMessage(wire.MsgGetBlockHashesTy, []interface{}{peer.lastReceivedHash, uint32(amount)}))
}
func (self *BlockPool) AddHash(hash []byte, peer *Peer) {
self.mut.Lock()
defer self.mut.Unlock()
if self.pool[string(hash)] == nil {
self.pool[string(hash)] = &block{peer, nil, nil, time.Now(), 0}
self.hashes = append([][]byte{hash}, self.hashes...)
}
}
func (self *BlockPool) Add(b *types.Block, peer *Peer) {
self.addBlock(b, peer, false)
}
func (self *BlockPool) AddNew(b *types.Block, peer *Peer) {
self.addBlock(b, peer, true)
}
func (self *BlockPool) addBlock(b *types.Block, peer *Peer, newBlock bool) {
self.mut.Lock()
defer self.mut.Unlock()
hash := string(b.Hash())
if self.pool[hash] == nil && !self.eth.ChainManager().HasBlock(b.Hash()) {
poollogger.Infof("Got unrequested block (%x...)\n", hash[0:4])
self.hashes = append(self.hashes, b.Hash())
self.pool[hash] = &block{peer, peer, b, time.Now(), 0}
// The following is only performed on an unrequested new block
if newBlock {
fmt.Println("1.", !self.eth.ChainManager().HasBlock(b.PrevHash), ethutil.Bytes2Hex(b.Hash()[0:4]), ethutil.Bytes2Hex(b.PrevHash[0:4]))
fmt.Println("2.", self.pool[string(b.PrevHash)] == nil)
fmt.Println("3.", !self.fetchingHashes)
if !self.eth.ChainManager().HasBlock(b.PrevHash) /*&& self.pool[string(b.PrevHash)] == nil*/ && !self.fetchingHashes {
poollogger.Infof("Unknown chain, requesting (%x...)\n", b.PrevHash[0:4])
peer.QueueMessage(wire.NewMessage(wire.MsgGetBlockHashesTy, []interface{}{b.Hash(), uint32(256)}))
}
}
} else if self.pool[hash] != nil {
self.pool[hash].block = b
}
self.BlocksProcessed++
}
func (self *BlockPool) Remove(hash []byte) {
self.mut.Lock()
defer self.mut.Unlock()
self.hashes = ethutil.DeleteFromByteSlice(self.hashes, hash)
delete(self.pool, string(hash))
}
func (self *BlockPool) DistributeHashes() {
self.mut.Lock()
defer self.mut.Unlock()
var (
peerLen = self.eth.peers.Len()
amount = 256 * peerLen
dist = make(map[*Peer][][]byte)
)
num := int(math.Min(float64(amount), float64(len(self.pool))))
for i, j := 0, 0; i < len(self.hashes) && j < num; i++ {
hash := self.hashes[i]
item := self.pool[string(hash)]
if item != nil && item.block == nil {
var peer *Peer
lastFetchFailed := time.Since(item.reqAt) > 5*time.Second
// Handle failed requests
if lastFetchFailed && item.requested > 5 && item.peer != nil {
if item.requested < 100 {
// Select peer the hash was retrieved off
peer = item.from
} else {
// Remove it
self.hashes = ethutil.DeleteFromByteSlice(self.hashes, hash)
delete(self.pool, string(hash))
}
} else if lastFetchFailed || item.peer == nil {
// Find a suitable, available peer
eachPeer(self.eth.peers, func(p *Peer, v *list.Element) {
if peer == nil && len(dist[p]) < amount/peerLen && p.statusKnown {
peer = p
}
})
}
if peer != nil {
item.reqAt = time.Now()
item.peer = peer
item.requested++
dist[peer] = append(dist[peer], hash)
}
}
}
for peer, hashes := range dist {
peer.FetchBlocks(hashes)
}
if len(dist) > 0 {
self.downloadStartedAt = time.Now()
}
}
func (self *BlockPool) Start() {
go self.downloadThread()
go self.chainThread()
}
func (self *BlockPool) Stop() {
close(self.quit)
}
func (self *BlockPool) downloadThread() {
serviceTimer := time.NewTicker(100 * time.Millisecond)
out:
for {
select {
case <-self.quit:
break out
case <-serviceTimer.C:
// Check if we're catching up. If not distribute the hashes to
// the peers and download the blockchain
self.fetchingHashes = false
eachPeer(self.eth.peers, func(p *Peer, v *list.Element) {
if p.statusKnown && p.FetchingHashes() {
self.fetchingHashes = true
}
})
if len(self.hashes) > 0 {
self.DistributeHashes()
}
if self.ChainLength < len(self.hashes) {
self.ChainLength = len(self.hashes)
}
if self.peer != nil &&
!self.peer.doneFetchingHashes &&
time.Since(self.peer.lastHashAt) > 10*time.Second &&
time.Since(self.peer.lastHashRequestedAt) > 5*time.Second {
self.fetchHashes()
}
/*
if !self.fetchingHashes {
blocks := self.Blocks()
chain.BlockBy(chain.Number).Sort(blocks)
if len(blocks) > 0 {
if !self.eth.ChainManager().HasBlock(b.PrevHash) && self.pool[string(b.PrevHash)] == nil && !self.fetchingHashes {
}
}
}
*/
}
}
}
func (self *BlockPool) chainThread() {
procTimer := time.NewTicker(500 * time.Millisecond)
out:
for {
select {
case <-self.quit:
break out
case <-procTimer.C:
blocks := self.Blocks()
types.BlockBy(types.Number).Sort(blocks)
// Find common block
for i, block := range blocks {
if self.eth.ChainManager().HasBlock(block.PrevHash) {
blocks = blocks[i:]
break
}
}
if len(blocks) > 0 {
if self.eth.ChainManager().HasBlock(blocks[0].PrevHash) {
for i, block := range blocks[1:] {
// NOTE: The Ith element in this loop refers to the previous block in
// outer "blocks"
if bytes.Compare(block.PrevHash, blocks[i].Hash()) != 0 {
blocks = blocks[:i]
break
}
}
} else {
blocks = nil
}
}
if len(blocks) > 0 {
chainman := self.eth.ChainManager()
err := chainman.InsertChain(blocks)
if err != nil {
poollogger.Debugln(err)
self.Reset()
if self.peer != nil && self.peer.conn != nil {
poollogger.Debugf("Punishing peer for supplying bad chain (%v)\n", self.peer.conn.RemoteAddr())
}
// This peer gave us bad hashes and made us fetch a bad chain, therefor he shall be punished.
self.eth.BlacklistPeer(self.peer)
self.peer.StopWithReason(DiscBadPeer)
self.td = ethutil.Big0
self.peer = nil
}
for _, block := range blocks {
self.Remove(block.Hash())
}
}
}
}
}

16
cmd/LICENSE Normal file
View File

@ -0,0 +1,16 @@
Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA

52
cmd/ethereum/cmd.go Normal file
View File

@ -0,0 +1,52 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"io/ioutil"
"os"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/cmd/ethereum/repl"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/javascript"
)
func InitJsConsole(ethereum *eth.Ethereum) {
repl := ethrepl.NewJSRepl(ethereum)
go repl.Start()
utils.RegisterInterrupt(func(os.Signal) {
repl.Stop()
})
}
func ExecJsFile(ethereum *eth.Ethereum, InputFile string) {
file, err := os.Open(InputFile)
if err != nil {
clilogger.Fatalln(err)
}
content, err := ioutil.ReadAll(file)
if err != nil {
clilogger.Fatalln(err)
}
re := javascript.NewJSRE(ethereum)
utils.RegisterInterrupt(func(os.Signal) {
re.Stop()
})
re.Run(string(content))
}

View File

@ -1,45 +1,70 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"flag"
"fmt"
"log"
"os"
"os/user"
"path"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/vm"
)
var Identifier string
var KeyRing string
var DiffTool bool
var DiffType string
var KeyStore string
var StartRpc bool
var RpcPort int
var UseUPnP bool
var OutboundPort string
var ShowGenesis bool
var AddPeer string
var MaxPeer int
var GenAddr bool
var UseSeed bool
var SecretFile string
var ExportDir string
var NonInteractive bool
var Datadir string
var LogFile string
var ConfigFile string
var DebugFile string
var LogLevel int
var Dump bool
var DumpHash string
var DumpNumber int
var (
Identifier string
KeyRing string
DiffTool bool
DiffType string
KeyStore string
StartRpc bool
StartWebSockets bool
RpcPort int
UseUPnP bool
OutboundPort string
ShowGenesis bool
AddPeer string
MaxPeer int
GenAddr bool
UseSeed bool
SecretFile string
ExportDir string
NonInteractive bool
Datadir string
LogFile string
ConfigFile string
DebugFile string
LogLevel int
Dump bool
DumpHash string
DumpNumber int
VmType int
)
// flags specific to cli client
var StartMining bool
var StartJsConsole bool
var InputFile string
var (
StartMining bool
StartJsConsole bool
InputFile string
)
func defaultDataDir() string {
usr, _ := user.Current()
@ -54,14 +79,16 @@ func Init() {
flag.PrintDefaults()
}
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
flag.StringVar(&Identifier, "id", "", "Custom client identifier")
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)")
flag.StringVar(&OutboundPort, "port", "30303", "listening port")
flag.BoolVar(&UseUPnP, "upnp", false, "enable UPnP support")
flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers")
flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers")
flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on")
flag.BoolVar(&StartRpc, "rpc", false, "start rpc server")
flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
flag.BoolVar(&UseSeed, "seed", true, "seed peers")
flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key")
@ -71,7 +98,7 @@ func Init() {
flag.StringVar(&Datadir, "datadir", defaultDataDir(), "specifies the datadir to use")
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
flag.BoolVar(&DiffTool, "difftool", false, "creates output for diff'ing. Sets LogLevel=0")
flag.StringVar(&DiffType, "diff", "all", "sets the level of diff output [vm, all]. Has no effect if difftool=false")
flag.BoolVar(&ShowGenesis, "genesis", false, "Dump the genesis block")
@ -85,5 +112,9 @@ func Init() {
flag.Parse()
if VmType >= int(vm.MaxVmTy) {
log.Fatal("Invalid VM type ", VmType)
}
InputFile = flag.Arg(0)
}

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
@ -5,18 +22,18 @@ import (
"os"
"runtime"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
)
const (
ClientIdentifier = "Ethereum(G)"
Version = "0.6.5"
Version = "0.7.10"
)
var logger = ethlog.NewLogger("CLI")
var clilogger = logger.NewLogger("CLI")
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
@ -31,7 +48,7 @@ func main() {
LogLevel = 0
}
utils.InitConfig(ConfigFile, Datadir, "ETH")
utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
ethutil.Config.Diff = DiffTool
ethutil.Config.DiffType = DiffType
@ -42,7 +59,7 @@ func main() {
db := utils.NewDatabase()
err := utils.DBSanityCheck(db)
if err != nil {
logger.Errorln(err)
fmt.Println(err)
os.Exit(1)
}
@ -57,14 +74,14 @@ func main() {
ethereum := utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer)
if Dump {
var block *ethchain.Block
var block *types.Block
if len(DumpHash) == 0 && DumpNumber == -1 {
block = ethereum.BlockChain().CurrentBlock
block = ethereum.ChainManager().CurrentBlock()
} else if len(DumpHash) > 0 {
block = ethereum.BlockChain().GetBlock(ethutil.Hex2Bytes(DumpHash))
block = ethereum.ChainManager().GetBlock(ethutil.Hex2Bytes(DumpHash))
} else {
block = ethereum.BlockChain().GetBlockByNumber(uint64(DumpNumber))
block = ethereum.ChainManager().GetBlockByNumber(uint64(DumpNumber))
}
if block == nil {
@ -76,11 +93,14 @@ func main() {
os.Exit(1)
}
fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.GetRoot(), block.Hash())
// block.GetRoot() does not exist
//fmt.Printf("RLP: %x\nstate: %x\nhash: %x\n", ethutil.Rlp(block), block.GetRoot(), block.Hash())
// Leave the Println. This needs clean output for piping
fmt.Printf("%s\n", block.State().Dump())
fmt.Println(block)
os.Exit(0)
}
@ -103,9 +123,13 @@ func main() {
utils.StartRpc(ethereum, RpcPort)
}
if StartWebSockets {
utils.StartWebSockets(ethereum)
}
utils.StartEthereum(ethereum, UseSeed)
// this blocks the thread
ethereum.WaitForShutdown()
ethlog.Flush()
logger.Flush()
}

View File

@ -0,0 +1,97 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
/* Inspired by https://github.com/xuyu/logging/blob/master/colorful_win.go */
package ethrepl
import (
"syscall"
"unsafe"
)
type color uint16
const (
green = color(0x0002)
red = color(0x0004)
yellow = color(0x000E)
)
const (
mask = uint16(yellow | green | red)
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
procGetStdHandle = kernel32.NewProc("GetStdHandle")
procSetConsoleTextAttribute = kernel32.NewProc("SetConsoleTextAttribute")
procGetConsoleScreenBufferInfo = kernel32.NewProc("GetConsoleScreenBufferInfo")
hStdout uintptr
initScreenInfo *consoleScreenBufferInfo
)
func setConsoleTextAttribute(hConsoleOutput uintptr, wAttributes uint16) bool {
ret, _, _ := procSetConsoleTextAttribute.Call(hConsoleOutput, uintptr(wAttributes))
return ret != 0
}
type coord struct {
X, Y int16
}
type smallRect struct {
Left, Top, Right, Bottom int16
}
type consoleScreenBufferInfo struct {
DwSize coord
DwCursorPosition coord
WAttributes uint16
SrWindow smallRect
DwMaximumWindowSize coord
}
func getConsoleScreenBufferInfo(hConsoleOutput uintptr) *consoleScreenBufferInfo {
var csbi consoleScreenBufferInfo
ret, _, _ := procGetConsoleScreenBufferInfo.Call(hConsoleOutput, uintptr(unsafe.Pointer(&csbi)))
if ret == 0 {
return nil
}
return &csbi
}
const (
stdOutputHandle = uint32(-11 & 0xFFFFFFFF)
)
func init() {
hStdout, _, _ = procGetStdHandle.Call(uintptr(stdOutputHandle))
initScreenInfo = getConsoleScreenBufferInfo(hStdout)
}
func resetColorful() {
if initScreenInfo == nil {
return
}
setConsoleTextAttribute(hStdout, initScreenInfo.WAttributes)
}
func changeColor(c color) {
attr := uint16(0) & ^mask | uint16(c)
setConsoleTextAttribute(hStdout, attr)
}

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package ethrepl
import (
@ -7,13 +24,13 @@ import (
"os"
"path"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/logger"
)
var logger = ethlog.NewLogger("REPL")
var repllogger = logger.NewLogger("REPL")
type Repl interface {
Start()
@ -42,7 +59,7 @@ func NewJSRepl(ethereum *eth.Ethereum) *JSRepl {
func (self *JSRepl) Start() {
if !self.running {
self.running = true
logger.Infoln("init JS Console")
repllogger.Infoln("init JS Console")
reader := bufio.NewReader(self.history)
for {
line, err := reader.ReadString('\n')
@ -63,7 +80,7 @@ func (self *JSRepl) Stop() {
if self.running {
self.running = false
self.re.Stop()
logger.Infoln("exit JS Console")
repllogger.Infoln("exit JS Console")
self.history.Close()
}
}

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package ethrepl
// #cgo darwin CFLAGS: -I/usr/local/opt/readline/include
@ -9,6 +26,7 @@ package ethrepl
// #include <readline/history.h>
import "C"
import (
"fmt"
"os"
"os/signal"
"strings"
@ -118,6 +136,9 @@ func (self *JSRepl) PrintValue(v interface{}) {
method, _ := self.re.Vm.Get("prettyPrint")
v, err := self.re.Vm.ToValue(v)
if err == nil {
method.Call(method, v)
val, err := method.Call(method, v)
if err == nil {
fmt.Printf("%v", val)
}
}
}

View File

@ -0,0 +1,92 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package ethrepl
import (
"bufio"
"fmt"
"os"
"strings"
)
func (self *JSRepl) read() {
reader := bufio.NewReader(os.Stdin)
for {
fmt.Printf(self.prompt)
str, _, err := reader.ReadLine()
if err != nil {
fmt.Println("Error reading input", err)
} else {
if string(str) == "exit" {
self.Stop()
break
} else {
self.parseInput(string(str))
}
}
}
}
func addHistory(s string) {
}
func printColored(outputVal string) {
for outputVal != "" {
codePart := ""
if strings.HasPrefix(outputVal, "\033[32m") {
codePart = "\033[32m"
changeColor(2)
}
if strings.HasPrefix(outputVal, "\033[1m\033[30m") {
codePart = "\033[1m\033[30m"
changeColor(8)
}
if strings.HasPrefix(outputVal, "\033[31m") {
codePart = "\033[31m"
changeColor(red)
}
if strings.HasPrefix(outputVal, "\033[35m") {
codePart = "\033[35m"
changeColor(5)
}
if strings.HasPrefix(outputVal, "\033[0m") {
codePart = "\033[0m"
resetColorful()
}
textPart := outputVal[len(codePart):len(outputVal)]
index := strings.Index(textPart, "\033")
if index == -1 {
outputVal = ""
} else {
outputVal = textPart[index:len(textPart)]
textPart = textPart[0:index]
}
fmt.Printf("%v", textPart)
}
}
func (self *JSRepl) PrintValue(v interface{}) {
method, _ := self.re.Vm.Get("prettyPrint")
v, err := self.re.Vm.ToValue(v)
if err == nil {
val, err := method.Call(method, v)
if err == nil {
printColored(fmt.Sprintf("%v", val))
}
}
}

128
cmd/ethtest/main.go Normal file
View File

@ -0,0 +1,128 @@
/*
This file is part of go-ethereum
go-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
go-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @authors:
* Jeffrey Wilcke <i@jev.io>
* @date 2014
*
*/
package main
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"os"
"strings"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/tests/helper"
)
type Account struct {
Balance string
Code string
Nonce string
Storage map[string]string
}
func StateObjectFromAccount(addr string, account Account) *state.StateObject {
obj := state.NewStateObject(ethutil.Hex2Bytes(addr))
obj.SetBalance(ethutil.Big(account.Balance))
if ethutil.IsHex(account.Code) {
account.Code = account.Code[2:]
}
obj.Code = ethutil.Hex2Bytes(account.Code)
obj.Nonce = ethutil.Big(account.Nonce).Uint64()
return obj
}
type VmTest struct {
Callcreates interface{}
Env map[string]string
Exec map[string]string
Gas string
Out string
Post map[string]Account
Pre map[string]Account
}
func RunVmTest(js string) (failed int) {
tests := make(map[string]VmTest)
data, _ := ioutil.ReadAll(strings.NewReader(js))
err := json.Unmarshal(data, &tests)
if err != nil {
log.Fatalln(err)
}
for name, test := range tests {
state := state.New(helper.NewTrie())
for addr, account := range test.Pre {
obj := StateObjectFromAccount(addr, account)
state.SetStateObject(obj)
}
ret, _, gas, err := helper.RunVm(state, test.Env, test.Exec)
// When an error is returned it doesn't always mean the tests fails.
// Have to come up with some conditional failing mechanism.
if err != nil {
log.Println(err)
}
rexp := helper.FromHex(test.Out)
if bytes.Compare(rexp, ret) != 0 {
log.Printf("%s's return failed. Expected %x, got %x\n", name, rexp, ret)
failed = 1
}
gexp := ethutil.Big(test.Gas)
if gexp.Cmp(gas) != 0 {
log.Printf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas)
failed = 1
}
for addr, account := range test.Post {
obj := state.GetStateObject(helper.FromHex(addr))
for addr, value := range account.Storage {
v := obj.GetState(helper.FromHex(addr)).Bytes()
vexp := helper.FromHex(value)
if bytes.Compare(v, vexp) != 0 {
log.Printf("%s's : (%x: %s) storage failed. Expected %x, got %x (%v %v)\n", name, obj.Address()[0:4], addr, vexp, v, ethutil.BigD(vexp), ethutil.BigD(v))
failed = 1
}
}
}
}
return
}
func main() {
helper.Logger.SetLogLevel(5)
if len(os.Args) == 1 {
log.Fatalln("no json supplied")
}
os.Exit(RunVmTest(os.Args[1]))
}

1
cmd/evm/code.txt Normal file
View File

@ -0,0 +1 @@
60006102ff5360003560001a60008114156103395760013560405260216040516020025990590160009052606052604051602002816060513760405160200281019050506002604051121561005957604051602002606051f35b604051602002599059016000905260a052600060c052604051602002599059016000905260e0526000610100526001610120525b604051610120511215610109576060515161012051602002606051015112156100d8576101205160200260605101516101005160200260e051015260016101005101610100526100f9565b61012051602002606051015160c05160200260a0510152600160c0510160c0525b600161012051016101205261008d565b60216020599059016000905260c051808252806020028301925050602082015990590160009052600081538151600182015260218101825160200260a0518260005b8381101561016657808301518186015260208101905061014b565b50505050825160200281019050604059905901600090526102405281610240515283602061024051015261024051905090509050905060c05160200280599059016000905281816020850151855160003060195a03f1508090509050905060a05260216020599059016000905261010051808252806020028301925050602082015990590160009052600081538151600182015260218101825160200260e0518260005b8381101561022557808301518186015260208101905061020a565b50505050825160200281019050604059905901600090526102c052816102c051528360206102c05101526102c05190509050905090506101005160200280599059016000905281816020850151855160003060195a03f1508090509050905060e05260405160200259905901600090526102e0526000610120525b610100516101205112156102d7576101205160200260e0510151610120516020026102e051015260016101205101610120526102a0565b60605151610100516020026102e05101526000610120525b60c05161012051121561032d576101205160200260a05101516101205160016101005101016020026102e051015260016101205101610120526102ef565b6040516020026102e051f35b50

1
cmd/evm/input.txt Normal file

File diff suppressed because one or more lines are too long

164
cmd/evm/main.go Normal file
View File

@ -0,0 +1,164 @@
/*
This file is part of go-ethereum
go-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
go-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @authors
* Jeffrey Wilcke <i@jev.io>
* @date 2014
*
*/
package main
import (
"flag"
"fmt"
"log"
"math/big"
"os"
"runtime"
"time"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/vm"
)
var (
code = flag.String("code", "", "evm code")
loglevel = flag.Int("log", 4, "log level")
gas = flag.String("gas", "1000000000", "gas amount")
price = flag.String("price", "0", "gas price")
value = flag.String("value", "0", "tx value")
dump = flag.Bool("dump", false, "dump state after run")
data = flag.String("data", "", "data")
)
func perr(v ...interface{}) {
fmt.Println(v...)
//os.Exit(1)
}
func main() {
flag.Parse()
logger.AddLogSystem(logger.NewStdLogSystem(os.Stdout, log.LstdFlags, logger.LogLevel(*loglevel)))
ethutil.ReadConfig("/tmp/evmtest", "/tmp/evm", "")
db, _ := ethdb.NewMemDatabase()
statedb := state.New(trie.New(db, ""))
sender := statedb.NewStateObject([]byte("sender"))
receiver := statedb.NewStateObject([]byte("receiver"))
//receiver.SetCode([]byte(*code))
receiver.SetCode(ethutil.Hex2Bytes(*code))
vmenv := NewEnv(statedb, []byte("evmuser"), ethutil.Big(*value))
tstart := time.Now()
ret, e := vmenv.Call(sender, receiver.Address(), ethutil.Hex2Bytes(*data), ethutil.Big(*gas), ethutil.Big(*price), ethutil.Big(*value))
logger.Flush()
if e != nil {
perr(e)
}
if *dump {
fmt.Println(string(statedb.Dump()))
}
var mem runtime.MemStats
runtime.ReadMemStats(&mem)
fmt.Printf("vm took %v\n", time.Since(tstart))
fmt.Printf(`alloc: %d
tot alloc: %d
no. malloc: %d
heap alloc: %d
heap objs: %d
num gc: %d
`, mem.Alloc, mem.TotalAlloc, mem.Mallocs, mem.HeapAlloc, mem.HeapObjects, mem.NumGC)
fmt.Printf("%x\n", ret)
}
type VMEnv struct {
state *state.StateDB
block *types.Block
transactor []byte
value *big.Int
depth int
Gas *big.Int
time int64
}
func NewEnv(state *state.StateDB, transactor []byte, value *big.Int) *VMEnv {
return &VMEnv{
state: state,
transactor: transactor,
value: value,
time: time.Now().Unix(),
}
}
func (self *VMEnv) State() *state.StateDB { return self.state }
func (self *VMEnv) Origin() []byte { return self.transactor }
func (self *VMEnv) BlockNumber() *big.Int { return ethutil.Big0 }
func (self *VMEnv) PrevHash() []byte { return make([]byte, 32) }
func (self *VMEnv) Coinbase() []byte { return self.transactor }
func (self *VMEnv) Time() int64 { return self.time }
func (self *VMEnv) Difficulty() *big.Int { return ethutil.Big1 }
func (self *VMEnv) BlockHash() []byte { return make([]byte, 32) }
func (self *VMEnv) Value() *big.Int { return self.value }
func (self *VMEnv) GasLimit() *big.Int { return big.NewInt(1000000000) }
func (self *VMEnv) Depth() int { return 0 }
func (self *VMEnv) SetDepth(i int) { self.depth = i }
func (self *VMEnv) AddLog(log state.Log) {
self.state.AddLog(log)
}
func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error {
return vm.Transfer(from, to, amount)
}
func (self *VMEnv) vm(addr, data []byte, gas, price, value *big.Int) *core.Execution {
evm := vm.New(self, vm.DebugVmTy)
return core.NewExecution(evm, addr, data, gas, price, value)
}
func (self *VMEnv) Call(caller vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) {
exe := self.vm(addr, data, gas, price, value)
ret, err := exe.Call(addr, caller)
self.Gas = exe.Gas
return ret, err
}
func (self *VMEnv) CallCode(caller vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) {
exe := self.vm(caller.Address(), data, gas, price, value)
return exe.Call(addr, caller)
}
func (self *VMEnv) Create(caller vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error, vm.ClosureRef) {
exe := self.vm(addr, data, gas, price, value)
return exe.Create(caller)
}

View File

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 1004 B

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 905 B

After

Width:  |  Height:  |  Size: 905 B

View File

@ -357,7 +357,7 @@ ApplicationWindow {
anchors.right: parent.right
model: ListModel {
ListElement { text: "Snippets" ; value: "" }
ListElement { text: "Call Contract" ; value: "var[2] in;\nvar ret;\n\nin[0] = \"arg1\"\nin[1] = 0xdeadbeef\n\nvar success = call(0x0c542ddea93dae0c2fcb2cf175f03ad80d6be9a0, 0, 7000, in, ret)\n\nreturn ret" }
ListElement { text: "Call Contract" ; value: "var[2] in = { \"arg1\", 0xdeadbeef };\nvar ret;\n\nvar success = call(0x0c542ddea93dae0c2fcb2cf175f03ad80d6be9a0, 0, 7000, in, ret)\n\nreturn ret" }
}
onCurrentIndexChanged: {
if(currentIndex != 0) {

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
var bigInt = (function () {
var base = 10000000, logBase = 7;
var sign = {

14
cmd/mist/assets/ext/eth.js/.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
/tmp
*/**/*un~
*un~
.DS_Store
*/**/.DS_Store
ethereum/ethereum
ethereal/ethereal

View File

@ -0,0 +1,18 @@
# Ethereum JavaScript API
This is the Ethereum compatible JavaScript API using `Promise`s
which implements the [Generic JSON RPC](https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC) spec.
For an example see `index.html`.
**Please note this repo is in it's early stage.**
If you'd like to run a WebSocket ethereum node check out
[go-ethereum](https://github.com/ethereum/go-ethereum).
To install ethereum and spawn a node:
```
go get github.com/ethereum/go-ethereum/ethereum
ethereum -ws -loglevel=4
```

View File

@ -0,0 +1,70 @@
(function () {
var HttpRpcProvider = function (host) {
this.handlers = [];
this.host = host;
};
function formatJsonRpcObject(object) {
return {
jsonrpc: '2.0',
method: object.call,
params: object.args,
id: object._id
}
};
function formatJsonRpcMessage(message) {
var object = JSON.parse(message);
return {
_id: object.id,
data: object.result
};
};
HttpRpcProvider.prototype.sendRequest = function (payload, cb) {
var data = formatJsonRpcObject(payload);
var request = new XMLHttpRequest();
request.open("POST", this.host, true);
request.send(JSON.stringify(data));
request.onreadystatechange = function () {
if (request.readyState === 4 && cb) {
cb(request);
}
}
};
HttpRpcProvider.prototype.send = function (payload) {
var self = this;
this.sendRequest(payload, function (request) {
self.handlers.forEach(function (handler) {
handler.call(self, formatJsonRpcMessage(request.responseText));
});
});
};
HttpRpcProvider.prototype.poll = function (payload, id) {
var self = this;
this.sendRequest(payload, function (request) {
var parsed = JSON.parse(request.responseText);
if (parsed.result instanceof Array ? parsed.result.length === 0 : !parsed.result) {
return;
}
self.handlers.forEach(function (handler) {
handler.call(self, {_event: payload.call, _id: id, data: parsed.result});
});
});
};
Object.defineProperty(HttpRpcProvider.prototype, "onmessage", {
set: function (handler) {
this.handlers.push(handler);
}
});
if (typeof(web3) !== "undefined" && web3.providers !== undefined) {
web3.providers.HttpRpcProvider = HttpRpcProvider;
}
})();

View File

@ -0,0 +1,33 @@
<!doctype>
<html>
<head>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript" src="websocket.js"></script>
<script type="text/javascript" src="qt.js"></script>
<script type="text/javascript" src="httprpc.js"></script>
<script type="text/javascript">
function registerName() {
var name = document.querySelector("#name").value;
name = web3.fromAscii(name);
var eth = web3.eth;
eth.transact({to: "NameReg", gas: "10000", gasPrice: eth.gasPrice, data: [web3.fromAscii("register"), name]}).then(function(tx) {
document.querySelector("#result").innerHTML = "Registered name. Please wait for the next block to come through.";
}, function(err) {
console.log(err);
});
}
</script>
</head>
<body>
<h1>std::name_reg</h1>
<input type="text" id="name"></input>
<input type="submit" onClick="registerName();"></input>
<div id="result"></div>
</body>
</html>

View File

@ -0,0 +1,432 @@
(function(window) {
function isPromise(o) {
return o instanceof Promise
}
function flattenPromise (obj) {
if (obj instanceof Promise) {
return Promise.resolve(obj);
}
if (obj instanceof Array) {
return new Promise(function (resolve) {
var promises = obj.map(function (o) {
return flattenPromise(o);
});
return Promise.all(promises).then(function (res) {
for (var i = 0; i < obj.length; i++) {
obj[i] = res[i];
}
resolve(obj);
});
});
}
if (obj instanceof Object) {
return new Promise(function (resolve) {
var keys = Object.keys(obj);
var promises = keys.map(function (key) {
return flattenPromise(obj[key]);
});
return Promise.all(promises).then(function (res) {
for (var i = 0; i < keys.length; i++) {
obj[keys[i]] = res[i];
}
resolve(obj);
});
});
}
return Promise.resolve(obj);
};
var ethMethods = function () {
var blockCall = function (args) {
return typeof args[0] === "string" ? "blockByHash" : "blockByNumber";
};
var transactionCall = function (args) {
return typeof args[0] === "string" ? 'transactionByHash' : 'transactionByNumber';
};
var uncleCall = function (args) {
return typeof args[0] === "string" ? 'uncleByHash' : 'uncleByNumber';
};
var methods = [
{ name: 'balanceAt', call: 'balanceAt' },
{ name: 'stateAt', call: 'stateAt' },
{ name: 'countAt', call: 'countAt'},
{ name: 'codeAt', call: 'codeAt' },
{ name: 'transact', call: 'transact' },
{ name: 'call', call: 'call' },
{ name: 'block', call: blockCall },
{ name: 'transaction', call: transactionCall },
{ name: 'uncle', call: uncleCall },
{ name: 'compile', call: 'compile' }
];
return methods;
};
var ethProperties = function () {
return [
{ name: 'coinbase', getter: 'coinbase', setter: 'setCoinbase' },
{ name: 'listening', getter: 'listening', setter: 'setListening' },
{ name: 'mining', getter: 'mining', setter: 'setMining' },
{ name: 'gasPrice', getter: 'gasPrice' },
{ name: 'account', getter: 'account' },
{ name: 'accounts', getter: 'accounts' },
{ name: 'peerCount', getter: 'peerCount' },
{ name: 'defaultBlock', getter: 'defaultBlock', setter: 'setDefaultBlock' },
{ name: 'number', getter: 'number'}
];
};
var dbMethods = function () {
return [
{ name: 'put', call: 'put' },
{ name: 'get', call: 'get' },
{ name: 'putString', call: 'putString' },
{ name: 'getString', call: 'getString' }
];
};
var shhMethods = function () {
return [
{ name: 'post', call: 'post' },
{ name: 'newIdentity', call: 'newIdentity' },
{ name: 'haveIdentity', call: 'haveIdentity' },
{ name: 'newGroup', call: 'newGroup' },
{ name: 'addToGroup', call: 'addToGroup' }
];
};
var ethWatchMethods = function () {
var newFilter = function (args) {
return typeof args[0] === 'string' ? 'newFilterString' : 'newFilter';
};
return [
{ name: 'newFilter', call: newFilter },
{ name: 'uninstallFilter', call: 'uninstallFilter' },
{ name: 'getMessages', call: 'getMessages' }
];
};
var shhWatchMethods = function () {
return [
{ name: 'newFilter', call: 'shhNewFilter' },
{ name: 'uninstallFilter', call: 'shhUninstallFilter' },
{ name: 'getMessage', call: 'shhGetMessages' }
];
};
var setupMethods = function (obj, methods) {
methods.forEach(function (method) {
obj[method.name] = function () {
return flattenPromise(Array.prototype.slice.call(arguments)).then(function (args) {
var call = typeof method.call === "function" ? method.call(args) : method.call;
return {call: call, args: args};
}).then(function (request) {
return new Promise(function (resolve, reject) {
web3.provider.send(request, function (result) {
//if (result || typeof result === "boolean") {
resolve(result);
return;
//}
//reject(result);
});
});
}).catch(function( err) {
console.error(err);
});
};
});
};
var setupProperties = function (obj, properties) {
properties.forEach(function (property) {
var proto = {};
proto.get = function () {
return new Promise(function(resolve, reject) {
web3.provider.send({call: property.getter}, function(result) {
resolve(result);
});
});
};
if (property.setter) {
proto.set = function (val) {
return flattenPromise([val]).then(function (args) {
return new Promise(function (resolve) {
web3.provider.send({call: property.setter, args: args}, function (result) {
resolve(result);
});
});
}).catch(function (err) {
console.error(err);
});
}
}
Object.defineProperty(obj, property.name, proto);
});
};
var web3 = {
_callbacks: {},
_events: {},
providers: {},
toHex: function(str) {
var hex = "";
for(var i = 0; i < str.length; i++) {
var n = str.charCodeAt(i).toString(16);
hex += n.length < 2 ? '0' + n : n;
}
return hex;
},
toAscii: function(hex) {
// Find termination
var str = "";
var i = 0, l = hex.length;
for(; i < l; i+=2) {
var code = hex.charCodeAt(i)
if(code == 0) {
break;
}
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return str;
},
toDecimal: function (val) {
return parseInt(val, 16);
},
fromAscii: function(str, pad) {
pad = pad === undefined ? 32 : pad;
var hex = this.toHex(str);
while(hex.length < pad*2)
hex += "00";
return hex
},
eth: {
prototype: Object(),
watch: function (params) {
return new Filter(params, ethWatch);
},
},
db: {
prototype: Object()
},
shh: {
prototype: Object(),
watch: function (params) {
return new Filter(params, shhWatch);
}
},
on: function(event, id, cb) {
if(web3._events[event] === undefined) {
web3._events[event] = {};
}
web3._events[event][id] = cb;
return this
},
off: function(event, id) {
if(web3._events[event] !== undefined) {
delete web3._events[event][id];
}
return this
},
trigger: function(event, id, data) {
var callbacks = web3._events[event];
if (!callbacks || !callbacks[id]) {
return;
}
var cb = callbacks[id];
cb(data);
},
};
var eth = web3.eth;
setupMethods(eth, ethMethods());
setupProperties(eth, ethProperties());
setupMethods(web3.db, dbMethods());
setupMethods(web3.shh, shhMethods());
var ethWatch = {
changed: 'changed'
};
setupMethods(ethWatch, ethWatchMethods());
var shhWatch = {
changed: 'shhChanged'
};
setupMethods(shhWatch, shhWatchMethods());
var ProviderManager = function() {
this.queued = [];
this.polls = [];
this.ready = false;
this.provider = undefined;
this.id = 1;
var self = this;
var poll = function () {
if (self.provider && self.provider.poll) {
self.polls.forEach(function (data) {
data.data._id = self.id;
self.id++;
self.provider.poll(data.data, data.id);
});
}
setTimeout(poll, 12000);
};
poll();
};
ProviderManager.prototype.send = function(data, cb) {
data._id = this.id;
if (cb) {
web3._callbacks[data._id] = cb;
}
data.args = data.args || [];
this.id++;
if(this.provider !== undefined) {
this.provider.send(data);
} else {
console.warn("provider is not set");
this.queued.push(data);
}
};
ProviderManager.prototype.set = function(provider) {
if(this.provider !== undefined && this.provider.unload !== undefined) {
this.provider.unload();
}
this.provider = provider;
this.ready = true;
};
ProviderManager.prototype.sendQueued = function() {
for(var i = 0; this.queued.length; i++) {
// Resend
this.send(this.queued[i]);
}
};
ProviderManager.prototype.installed = function() {
return this.provider !== undefined;
};
ProviderManager.prototype.startPolling = function (data, pollId) {
if (!this.provider || !this.provider.poll) {
return;
}
this.polls.push({data: data, id: pollId});
};
ProviderManager.prototype.stopPolling = function (pollId) {
for (var i = this.polls.length; i--;) {
var poll = this.polls[i];
if (poll.id === pollId) {
this.polls.splice(i, 1);
}
}
};
web3.provider = new ProviderManager();
web3.setProvider = function(provider) {
provider.onmessage = messageHandler;
web3.provider.set(provider);
web3.provider.sendQueued();
};
var Filter = function(options, impl) {
this.impl = impl;
this.callbacks = [];
var self = this;
this.promise = impl.newFilter(options);
this.promise.then(function (id) {
self.id = id;
web3.on(impl.changed, id, self.trigger.bind(self));
web3.provider.startPolling({call: impl.changed, args: [id]}, id);
});
};
Filter.prototype.arrived = function(callback) {
this.changed(callback);
}
Filter.prototype.changed = function(callback) {
var self = this;
this.promise.then(function(id) {
self.callbacks.push(callback);
});
};
Filter.prototype.trigger = function(messages) {
for(var i = 0; i < this.callbacks.length; i++) {
this.callbacks[i].call(this, messages);
}
};
Filter.prototype.uninstall = function() {
var self = this;
this.promise.then(function (id) {
self.impl.uninstallFilter(id);
web3.provider.stopPolling(id);
web3.off(impl.changed, id);
});
};
Filter.prototype.messages = function() {
var self = this;
return this.promise.then(function (id) {
return self.impl.getMessages(id);
});
};
function messageHandler(data) {
if(data._event !== undefined) {
web3.trigger(data._event, data._id, data.data);
return;
}
if(data._id) {
var cb = web3._callbacks[data._id];
if (cb) {
cb.call(this, data.data)
delete web3._callbacks[data._id];
}
}
}
/*
// Install default provider
if(!web3.provider.installed()) {
var sock = new web3.WebSocket("ws://localhost:40404/eth");
web3.setProvider(sock);
}
*/
window.web3 = web3;
})(this);

View File

@ -0,0 +1,27 @@
(function() {
var QtProvider = function() {
this.handlers = [];
var self = this;
navigator.qt.onmessage = function (message) {
self.handlers.forEach(function (handler) {
handler.call(self, JSON.parse(message.data));
});
}
};
QtProvider.prototype.send = function(payload) {
navigator.qt.postMessage(JSON.stringify(payload));
};
Object.defineProperty(QtProvider.prototype, "onmessage", {
set: function(handler) {
this.handlers.push(handler);
},
});
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
web3.providers.QtProvider = QtProvider;
}
})();

View File

@ -0,0 +1,51 @@
(function() {
var WebSocketProvider = function(host) {
// onmessage handlers
this.handlers = [];
// queue will be filled with messages if send is invoked before the ws is ready
this.queued = [];
this.ready = false;
this.ws = new WebSocket(host);
var self = this;
this.ws.onmessage = function(event) {
for(var i = 0; i < self.handlers.length; i++) {
self.handlers[i].call(self, JSON.parse(event.data), event)
}
};
this.ws.onopen = function() {
self.ready = true;
for(var i = 0; i < self.queued.length; i++) {
// Resend
self.send(self.queued[i]);
}
};
};
WebSocketProvider.prototype.send = function(payload) {
if(this.ready) {
var data = JSON.stringify(payload);
this.ws.send(data);
} else {
this.queued.push(payload);
}
};
WebSocketProvider.prototype.onMessage = function(handler) {
this.handlers.push(handler);
};
WebSocketProvider.prototype.unload = function() {
this.ws.close();
};
Object.defineProperty(WebSocketProvider.prototype, "onmessage", {
set: function(provider) { this.onMessage(provider); }
});
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
web3.providers.WebSocketProvider = WebSocketProvider;
}
})();

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
// Main Ethereum library
window.eth = {
prototype: Object(),

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
var ethx = {
prototype: Object,

View File

@ -1,9 +1,25 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
// The magic return variable. The magic return variable will be set during the execution of the QML call.
(function(window) {
function message(type, data) {
document.title = JSON.stringify({type: type, data: data});
return window.____returnData;
var Promise = window.Promise;
if(typeof(Promise) === "undefined") {
var Promise = Q.Promise;
}
function isPromise(o) {
@ -92,19 +108,19 @@
promises.push(params.from.then(function(_from) { params.from = _from; }));
}
if(isPromise(params.data)) {
promises.push(params.data.then(function(_code) { params.data = _code; }));
} else {
if(typeof params.data === "object") {
data = "";
for(var i = 0; i < params.data.length; i++) {
data += params.data[i]
}
} else {
data = params.data;
}
}
if(typeof params.data !== "object" || isPromise(params.data)) {
params.data = [params.data]
}
var data = params.data;
for(var i = 0; i < params.data.length; i++) {
if(isPromise(params.data[i])) {
var promise = params.data[i];
var _i = i;
promises.push(promise.then(function(_arg) { params.data[_i] = _arg; }));
}
}
// Make sure everything is string
var fields = ["value", "gas", "gasPrice"];
for(var i = 0; i < fields.length; i++) {
@ -117,6 +133,7 @@
// Load promises then call the last "transact".
return Q.all(promises).then(function() {
return new Promise(function(resolve, reject) {
params.data = params.data.join("");
postData({call: "transact", args: params}, function(data) {
if(data[1])
reject(data[0]);
@ -335,7 +352,7 @@
Object.defineProperty(eth, "gasPrice", {
get: function() {
return "1000000000000"
return "10000000000000"
}
});
@ -445,6 +462,7 @@
}
});
var g_seed = 1;
function postData(data, cb) {
data._seed = g_seed;
@ -458,24 +476,6 @@
g_seed++;
navigator.qt.postMessage(JSON.stringify(data));
}
navigator.qt.onmessage = function(ev) {
var data = JSON.parse(ev.data)
if(data._event !== undefined) {
eth.trigger(data._event, data.data);
} else {
if(data._seed) {
var cb = eth._callbacks[data._seed];
if(cb) {
cb.call(this, data.data)
// Remove the "trigger" callback
delete eth._callbacks[ev._seed];
}
}
}
window._messagingAdapter.call(this, JSON.stringify(data))
}
})(this);

View File

@ -0,0 +1,30 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
// this function is included locally, but you can also include separately via a header definition
function request(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = (function(req) {
return function() {
if(req.readyState === 4) {
callback(req);
}
}
})(xhr);
xhr.open('GET', url, true);
xhr.send('');
}

View File

@ -0,0 +1,30 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
function HandleMessage(data) {
var message;
try { message = JSON.parse(data) } catch(e) {};
if(message) {
switch(message.type) {
case "coinbase":
return eth.coinBase();
case "block":
return eth.blockByNumber(0);
}
}
}

View File

@ -0,0 +1,38 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
window._messagingAdapter = function(data) {
navigator.qt.postMessage(data);
};
navigator.qt.onmessage = function(ev) {
var data = JSON.parse(ev.data)
if(data._event !== undefined) {
eth.trigger(data._event, data.data);
} else {
if(data._seed) {
var cb = eth._callbacks[data._seed];
if(cb) {
cb.call(this, data.data)
// Remove the "trigger" callback
delete eth._callbacks[ev._seed];
}
}
}
}

View File

@ -0,0 +1,8 @@
(function() {
if (typeof(Promise) === "undefined")
window.Promise = Q.Promise;
var eth = web3.eth;
web3.setProvider(new web3.providers.QtProvider());
})()

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
String.prototype.pad = function(l, r) {
if (r === undefined) {
r = l

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
cmd/mist/assets/miner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
// Helper function for generating pseudo callbacks and sending data to the QML part of the application
function postData(data, cb) {
data._seed = Math.floor(Math.random() * 1000000)

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 932 B

After

Width:  |  Height:  |  Size: 932 B

View File

@ -0,0 +1,892 @@
import QtQuick 2.0
import QtQuick.Controls 1.0;
import QtQuick.Layouts 1.0;
import QtQuick.Dialogs 1.0;
import QtQuick.Window 2.1;
import QtQuick.Controls.Styles 1.1
import Ethereum 1.0
import "../ext/filter.js" as Eth
import "../ext/http.js" as Http
ApplicationWindow {
id: root
property var ethx : Eth.ethx
property var browser
width: 1200
height: 820
minimumHeight: 300
title: "Mist"
// This signal is used by the filter API. The filter API connects using this signal handler from
// the different QML files and plugins.
signal messages(var messages, int id);
function invokeFilterCallback(data, receiverSeed) {
//var messages = JSON.parse(data)
// Signal handler
messages(data, receiverSeed);
root.browser.view.messages(data, receiverSeed);
}
TextField {
id: copyElementHax
visible: false
}
function copyToClipboard(text) {
copyElementHax.text = text
copyElementHax.selectAll()
copyElementHax.copy()
}
// Takes care of loading all default plugins
Component.onCompleted: {
var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum", active: true});
var browser = addPlugin("./webapp.qml", {noAdd: true, close: false, section: "ethereum", active: true});
root.browser = browser;
addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: true});
addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/chain.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/pending_tx.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/info.qml", {noAdd: true, close: false, section: "legacy"});
addPlugin("./views/jeffcoin/jeffcoin.qml", {noAdd: true, close: false, section: "apps"})
mainSplit.setView(wallet.view, wallet.menuItem);
// Call the ready handler
gui.done();
}
function addViews(view, path, options) {
var views = mainSplit.addComponent(view, options)
views.menuItem.path = path
mainSplit.views.push(views);
if(!options.noAdd) {
gui.addPlugin(path)
}
return views
}
function addPlugin(path, options) {
try {
if(typeof(path) === "string" && /^https?/.test(path)) {
console.log('load http')
Http.request(path, function(o) {
if(o.status === 200) {
var view = Qt.createQmlObject(o.responseText, mainView, path)
addViews(view, path, options)
}
})
return
}
var component = Qt.createComponent(path);
if(component.status != Component.Ready) {
if(component.status == Component.Error) {
ethx.note("error: ", component.errorString());
}
return
}
var view = mainView.createView(component, options)
var views = addViews(view, path, options)
return views
} catch(e) {
ethx.note(e)
}
}
menuBar: MenuBar {
Menu {
title: "File"
MenuItem {
text: "Import App"
shortcut: "Ctrl+o"
onTriggered: {
generalFileDialog.show(true, importApp)
}
}
/*
MenuItem {
text: "Browser"
onTriggered: eth.openBrowser()
}
*/
MenuItem {
text: "Add plugin"
onTriggered: {
generalFileDialog.show(true, function(path) {
addPlugin(path, {close: true, section: "apps"})
})
}
}
MenuSeparator {}
MenuItem {
text: "Import key"
shortcut: "Ctrl+i"
onTriggered: {
generalFileDialog.show(true, function(path) {
gui.importKey(path)
})
}
}
MenuItem {
text: "Export keys"
shortcut: "Ctrl+e"
onTriggered: {
generalFileDialog.show(false, function(path) {
})
}
}
}
Menu {
title: "Developer"
MenuItem {
iconSource: "../icecream.png"
text: "Debugger"
shortcut: "Ctrl+d"
onTriggered: eth.startDebugger()
}
MenuItem {
text: "Import Tx"
onTriggered: {
txImportDialog.visible = true
}
}
MenuItem {
text: "Run JS file"
onTriggered: {
generalFileDialog.show(true, function(path) {
eth.evalJavascriptFile(path)
})
}
}
MenuItem {
text: "Dump state"
onTriggered: {
generalFileDialog.show(false, function(path) {
// Empty hash for latest
gui.dumpState("", path)
})
}
}
MenuSeparator {}
/*
MenuItem {
id: miningSpeed
text: "Mining: Turbo"
onTriggered: {
gui.toggleTurboMining()
if(text == "Mining: Turbo") {
text = "Mining: Normal";
} else {
text = "Mining: Turbo";
}
}
}
*/
}
Menu {
title: "Network"
MenuItem {
text: "Add Peer"
shortcut: "Ctrl+p"
onTriggered: {
addPeerWin.visible = true
}
}
MenuItem {
text: "Show Peers"
shortcut: "Ctrl+e"
onTriggered: {
peerWindow.visible = true
}
}
}
Menu {
title: "Help"
MenuItem {
text: "About"
onTriggered: {
aboutWin.visible = true
}
}
}
Menu {
title: "GLOBAL SHORTCUTS"
visible: false
MenuItem {
visible: false
shortcut: "Ctrl+l"
onTriggered: {
url.focus = true
}
}
}
}
statusBar: StatusBar {
//height: 32
id: statusBar
Label {
//y: 6
id: walletValueLabel
font.pixelSize: 10
styleColor: "#797979"
}
Label {
//y: 6
objectName: "miningLabel"
visible: true
font.pixelSize: 10
anchors.right: lastBlockLabel.left
anchors.rightMargin: 5
}
Label {
//y: 6
id: lastBlockLabel
objectName: "lastBlockLabel"
visible: true
text: ""
font.pixelSize: 10
anchors.right: peerGroup.left
anchors.rightMargin: 5
}
ProgressBar {
id: downloadIndicator
value: 0
objectName: "downloadIndicator"
y: -4
x: statusBar.width / 2 - this.width / 2
width: 160
}
Label {
objectName: "downloadLabel"
//y: 7
anchors.left: downloadIndicator.right
anchors.leftMargin: 5
font.pixelSize: 10
text: "0 / 0"
}
RowLayout {
id: peerGroup
//y: 7
anchors.right: parent.right
MouseArea {
onDoubleClicked: peerWindow.visible = true
anchors.fill: parent
}
Label {
id: peerLabel
font.pixelSize: 10
text: "0 / 0"
}
}
}
property var blockModel: ListModel {
id: blockModel
}
SplitView {
property var views: [];
id: mainSplit
anchors.fill: parent
resizing: false
function setView(view, menu) {
for(var i = 0; i < views.length; i++) {
views[i].view.visible = false
views[i].menuItem.setSelection(false)
}
view.visible = true
//menu.border.color = "#CCCCCC"
//menu.color = "#FFFFFFFF"
menu.setSelection(true)
}
function addComponent(view, options) {
view.visible = false
view.anchors.fill = mainView
var menuItem = menu.createMenuItem(view, options);
if( view.hasOwnProperty("menuItem") ) {
view.menuItem = menuItem;
}
if( view.hasOwnProperty("onReady") ) {
view.onReady.call(view)
}
if( options.active ) {
setView(view, menuItem)
}
return {view: view, menuItem: menuItem}
}
/*********************
* Main menu.
********************/
Rectangle {
id: menu
Layout.minimumWidth: 210
Layout.maximumWidth: 210
anchors.top: parent.top
color: "#ececec"
Component {
id: menuItemTemplate
Rectangle {
id: menuItem
property var view;
property var path;
property var closable;
property alias title: label.text
property alias icon: icon.source
property alias secondaryTitle: secondary.text
function setSelection(on) {
sel.visible = on
}
width: 206
height: 28
color: "#00000000"
anchors {
left: parent.left
leftMargin: 4
}
Rectangle {
id: sel
visible: false
anchors.fill: parent
color: "#00000000"
Rectangle {
id: r
anchors.fill: parent
border.color: "#CCCCCC"
border.width: 1
radius: 5
color: "#FFFFFFFF"
}
Rectangle {
anchors {
top: r.top
bottom: r.bottom
right: r.right
}
width: 10
color: "#FFFFFFFF"
Rectangle {
anchors {
left: parent.left
right: parent.right
top: parent.top
}
height: 1
color: "#CCCCCC"
}
Rectangle {
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
height: 1
color: "#CCCCCC"
}
}
}
MouseArea {
anchors.fill: parent
onClicked: {
mainSplit.setView(view, menuItem)
}
}
Image {
id: icon
height: 20
width: 20
anchors {
left: parent.left
verticalCenter: parent.verticalCenter
leftMargin: 3
}
MouseArea {
anchors.fill: parent
onClicked: {
menuItem.closeApp()
}
}
}
Text {
id: label
anchors {
left: icon.right
verticalCenter: parent.verticalCenter
leftMargin: 3
}
color: "#0D0A01"
font.pixelSize: 12
}
Text {
id: secondary
anchors {
right: parent.right
rightMargin: 8
verticalCenter: parent.verticalCenter
}
color: "#AEADBE"
font.pixelSize: 12
}
function closeApp() {
if(!this.closable) { return; }
if(this.view.hasOwnProperty("onDestroy")) {
this.view.onDestroy.call(this.view)
}
this.view.destroy()
this.destroy()
gui.removePlugin(this.path)
}
}
}
function createMenuItem(view, options) {
if(options === undefined) {
options = {};
}
var section;
switch(options.section) {
case "ethereum":
section = menuDefault;
break;
case "legacy":
section = menuLegacy;
break;
default:
section = menuApps;
break;
}
var comp = menuItemTemplate.createObject(section)
comp.view = view
comp.title = view.title
if(view.hasOwnProperty("iconSource")) {
comp.icon = view.iconSource;
}
comp.closable = options.close;
return comp
}
ColumnLayout {
id: menuColumn
y: 10
width: parent.width
anchors.left: parent.left
anchors.right: parent.right
spacing: 3
Text {
text: "ETHEREUM"
font.bold: true
anchors {
left: parent.left
leftMargin: 5
}
color: "#888888"
}
ColumnLayout {
id: menuDefault
spacing: 3
anchors {
left: parent.left
right: parent.right
}
}
Text {
text: "APPS"
font.bold: true
anchors {
left: parent.left
leftMargin: 5
}
color: "#888888"
}
ColumnLayout {
id: menuApps
spacing: 3
anchors {
left: parent.left
right: parent.right
}
}
Text {
text: "DEBUG"
font.bold: true
anchors {
left: parent.left
leftMargin: 5
}
color: "#888888"
}
ColumnLayout {
id: menuLegacy
spacing: 3
anchors {
left: parent.left
right: parent.right
}
}
}
}
/*********************
* Main view
********************/
Rectangle {
anchors.right: parent.right
anchors.left: menu.right
anchors.bottom: parent.bottom
anchors.top: parent.top
color: "#00000000"
Rectangle {
id: urlPane
height: 40
color: "#00000000"
anchors {
left: parent.left
right: parent.right
leftMargin: 5
rightMargin: 5
top: parent.top
topMargin: 5
}
TextField {
id: url
objectName: "url"
placeholderText: "DApp URL"
anchors {
left: parent.left
right: parent.right
top: parent.top
topMargin: 5
rightMargin: 5
leftMargin: 5
}
Keys.onReturnPressed: {
if(/^https?/.test(this.text)) {
root.browser.view.open(this.text);
mainSplit.setView(root.browser.view, root.browser.menuItem);
} else {
addPlugin(this.text, {close: true, section: "apps"})
}
}
}
}
// Border
Rectangle {
id: divider
anchors {
left: parent.left
right: parent.right
top: urlPane.bottom
}
z: -1
height: 1
color: "#CCCCCC"
}
Rectangle {
id: mainView
color: "#00000000"
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.top: divider.bottom
function createView(component) {
var view = component.createObject(mainView)
return view;
}
}
}
}
/******************
* Dialogs
*****************/
FileDialog {
id: generalFileDialog
property var callback;
onAccepted: {
var path = this.fileUrl.toString();
callback.call(this, path);
}
function show(selectExisting, callback) {
generalFileDialog.callback = callback;
generalFileDialog.selectExisting = selectExisting;
this.open();
}
}
/******************
* Wallet functions
*****************/
function importApp(path) {
var ext = path.split('.').pop()
if(ext == "html" || ext == "htm") {
eth.openHtml(path)
}else if(ext == "qml"){
addPlugin(path, {close: true, section: "apps"})
}
}
function setWalletValue(value) {
walletValueLabel.text = value
}
function loadPlugin(name) {
console.log("Loading plugin" + name)
var view = mainView.addPlugin(name)
}
function setPeers(text) {
peerLabel.text = text
}
function addPeer(peer) {
// We could just append the whole peer object but it cries if you try to alter them
peerModel.append({ip: peer.ip, port: peer.port, lastResponse:timeAgo(peer.lastSend), latency: peer.latency, version: peer.version, caps: peer.caps})
}
function resetPeers(){
peerModel.clear()
}
function timeAgo(unixTs){
var lapsed = (Date.now() - new Date(unixTs*1000)) / 1000
return (lapsed + " seconds ago")
}
function convertToPretty(unixTs){
var a = new Date(unixTs*1000);
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
var sec = a.getSeconds();
var time = date+' '+month+' '+year+' '+hour+':'+min+':'+sec ;
return time;
}
/**********************
* Windows
*********************/
Window {
id: peerWindow
//flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
height: 200
width: 700
Rectangle {
anchors.fill: parent
property var peerModel: ListModel {
id: peerModel
}
TableView {
anchors.fill: parent
id: peerTable
model: peerModel
TableViewColumn{width: 100; role: "ip" ; title: "IP" }
TableViewColumn{width: 60; role: "port" ; title: "Port" }
TableViewColumn{width: 140; role: "lastResponse"; title: "Last event" }
TableViewColumn{width: 100; role: "latency"; title: "Latency" }
TableViewColumn{width: 260; role: "version" ; title: "Version" }
TableViewColumn{width: 80; role: "caps" ; title: "Capabilities" }
}
}
}
Window {
id: aboutWin
visible: false
title: "About"
minimumWidth: 350
maximumWidth: 350
maximumHeight: 280
minimumHeight: 280
Image {
id: aboutIcon
height: 150
width: 150
fillMode: Image.PreserveAspectFit
smooth: true
source: "../facet.png"
x: 10
y: 30
}
Text {
anchors.left: aboutIcon.right
anchors.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: 30
font.pointSize: 12
text: "<h2>Mist (0.7.10)</h2><br><h3>Development</h3>Jeffrey Wilcke<br>Viktor Trón<br>Felix Lange<br>Taylor Gerring<br>Daniel Nagy<br><h3>UX</h3>Alex van de Sande<br>"
}
}
Window {
id: txImportDialog
minimumWidth: 270
maximumWidth: 270
maximumHeight: 50
minimumHeight: 50
TextField {
id: txImportField
width: 170
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
onAccepted: {
}
}
Button {
anchors.left: txImportField.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 5
text: "Import"
onClicked: {
eth.importTx(txImportField.text)
txImportField.visible = false
}
}
Component.onCompleted: {
addrField.focus = true
}
}
Window {
id: addPeerWin
visible: false
minimumWidth: 300
maximumWidth: 300
maximumHeight: 50
minimumHeight: 50
title: "Connect to peer"
ComboBox {
id: addrField
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: addPeerButton.left
anchors.leftMargin: 10
anchors.rightMargin: 10
onAccepted: {
eth.connectToPeer(addrField.currentText)
addPeerWin.visible = false
}
editable: true
model: ListModel { id: pastPeers }
Component.onCompleted: {
var ips = eth.pastPeers()
for(var i = 0; i < ips.length; i++) {
pastPeers.append({text: ips.get(i)})
}
pastPeers.insert(0, {text: "poc-7.ethdev.com:30303"})
}
}
Button {
id: addPeerButton
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 10
text: "Add"
onClicked: {
eth.connectToPeer(addrField.currentText)
addPeerWin.visible = false
}
}
Component.onCompleted: {
addrField.focus = true
}
}
}

View File

@ -8,8 +8,7 @@ import Ethereum 1.0
Rectangle {
id: root
property var title: "Network"
property var iconSource: "../net.png"
property var title: "Block Chain"
property var menuItem
objectName: "chainView"
@ -64,12 +63,12 @@ Rectangle {
Menu {
id: contextMenu
property var row;
property var row
MenuItem {
text: "Details"
onTriggered: {
popup.visible = true
popup.setDetails(blockModel.get(this.row))
popup.setDetails(blockModel.get(contextMenu.row))
}
}
@ -78,7 +77,7 @@ Rectangle {
MenuItem {
text: "Copy"
onTriggered: {
copyToClipboard(blockModel.get(this.row).hash)
copyToClipboard(blockModel.get(contextMenu.row).hash)
}
}
@ -86,7 +85,7 @@ Rectangle {
text: "Dump State"
onTriggered: {
generalFileDialog.show(false, function(path) {
var hash = blockModel.get(this.row).hash;
var hash = blockModel.get(contextMenu.row).hash;
gui.dumpState(hash, path);
});
@ -102,22 +101,18 @@ Rectangle {
initial = false
}
/*
var txs = JSON.parse(block.transactions);
if(txs != null){
amount = txs.length
}
*/
var txs = block.transactions;
var amount = block.transactions.length;
var txs = [];
for(var i = 0; i < block.transactions.length; i++) {
var tx = JSON.parse(block.transactions.getAsJson(i));
txs.push(tx);
}
if(initial){
blockModel.append({size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)})
blockModel.append({raw: block.raw, bloom: block.bloom, size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)})
} else {
blockModel.insert(0, {size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)})
blockModel.insert(0, {bloom: block.bloom, size: block.size, number: block.number, name: block.name, gasLimit: block.gasLimit, gasUsed: block.gasUsed, coinbase: block.coinbase, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)})
}
//root.secondary.text = "#" + block.number;
}
Window {
@ -141,6 +136,7 @@ Rectangle {
Text { text: '<h3>Block details</h3>'; color: "#F2F2F2"}
Text { text: '<b>Block number:</b> ' + number + " (Size: " + size + ")"; color: "#F2F2F2"}
Text { text: '<b>Hash:</b> ' + hash; color: "#F2F2F2"}
Text { text: '<b>Bloom:</b> ' + bloom; color: "#F2F2F2"}
Text { text: '<b>Coinbase:</b> &lt;' + name + '&gt; ' + coinbase; color: "#F2F2F2"}
Text { text: '<b>Block found at:</b> ' + prettyTime; color: "#F2F2F2"}
Text { text: '<b>Gas used:</b> ' + gasUsed + " / " + gasLimit; color: "#F2F2F2"}
@ -215,7 +211,7 @@ Rectangle {
anchors.topMargin: 10
text: "Debug contract"
onClicked: {
if(tx.createsContract){
if(tx && tx.createsContract){
eth.startDbWithCode(tx.rawData)
}else {
eth.startDbWithContractAndData(tx.address, tx.rawData)
@ -227,11 +223,17 @@ Rectangle {
text: "Contract"
anchors.top: contractLabel.bottom
anchors.left: parent.left
anchors.bottom: popup.bottom
anchors.right: parent.right
wrapMode: Text.Wrap
width: parent.width - 30
height: 80
anchors.leftMargin: 10
}
TextArea {
id: dumpData
anchors.top: contractData.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 300
}
}
property var transactionModel: ListModel {
@ -240,19 +242,20 @@ Rectangle {
property var singleBlock: ListModel {
id: singleBlock
}
function setDetails(block){
singleBlock.set(0,block)
function setDetails(bl){
singleBlock.set(0, bl)
popup.height = 300
transactionModel.clear()
if(block.txs !== undefined){
for(var i = 0; i < block.txs.length; i++) {
transactionModel.insert(0, block.txs.get(i))
if(bl.txs !== undefined){
for(var i = 0; i < bl.txs.count; i++) {
transactionModel.insert(0, bl.txs.get(i))
}
if(block.txs.length > 0 && block.txs.get(0).data){
popup.showContractData(block.txs.get(0))
if(bl.txs.count > 0 && bl.txs.get(0).data){
popup.showContractData(bl.txs.get(0))
}
}
txView.forceActiveFocus()
dumpData.text = bl.raw;
}
}
}

View File

@ -7,7 +7,6 @@ import QtQuick.Controls.Styles 1.1
import Ethereum 1.0
Rectangle {
property var iconSource: "../tx.png"
property var title: "Transactions"
property var menuItem

View File

@ -7,8 +7,7 @@ import QtQuick.Controls.Styles 1.1
import Ethereum 1.0
Rectangle {
property var title: "Information"
property var iconSource: "../heart.png"
property var title: "Debug Info"
property var menuItem
objectName: "infoView"
@ -121,6 +120,23 @@ Rectangle {
}
}
/*
TableView {
id: logView
headerVisible: false
anchors {
right: logLevelSlider.left
left: parent.left
bottom: parent.bottom
top: parent.top
}
TableViewColumn{ role: "description" ; title: "log" }
model: logModel
}
*/
Slider {
id: logLevelSlider
value: gui.getLogLevelInt()
@ -149,52 +165,6 @@ Rectangle {
id: logModel
}
/*
RowLayout {
id: logLayout
width: parent.width
height: 200
anchors.bottom: parent.bottom
TableView {
id: logView
headerVisible: false
anchors {
right: logLevelSlider.left
left: parent.left
bottom: parent.bottom
top: parent.top
}
TableViewColumn{ role: "description" ; title: "log" }
model: logModel
}
Slider {
id: logLevelSlider
value: gui.getLogLevelInt()
anchors {
right: parent.right
top: parent.top
bottom: parent.bottom
rightMargin: 5
leftMargin: 5
topMargin: 5
bottomMargin: 5
}
orientation: Qt.Vertical
maximumValue: 5
stepSize: 1
onValueChanged: {
gui.setLogLevel(value)
}
}
}
*/
function addDebugMessage(message){
debuggerLog.append({value: message})
}

View File

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -22,6 +22,8 @@ Rectangle {
var me = eth.key().address;
if((to == me|| from == me) && message.input.length == 128) {
var to = eth.lookupName(to)
var from = eth.lookupName(from)
txModel.insert(0, {confirmations: blockNumber - message.number, from: from, to: to, value: value})
}
}
@ -47,9 +49,9 @@ Rectangle {
});
var blockNumber = eth.block(-1).number;
var messages = filter.messages()
for(var i = messages.length-1; i >= 0; i--) {
var message = messages.get(i)
var msgs = filter.messages()
for(var i = msgs.length-1; i >= 0; i--) {
var message = JSON.parse(msgs.getAsJson(i))
insertTx(message, blockNumber)
}
@ -151,7 +153,11 @@ Rectangle {
Button {
text: "Send"
onClicked: {
eth.transact({from: eth.key().privateKey, to:address, gas: "9000", gasPrice: "100000000000", data: ["0x"+txTo.text, txValue.text]})
var lookup = eth.lookupAddress(address)
if(lookup.length == 0)
lookup = address
eth.transact({from: eth.key().privateKey, to:lookup, gas: "9000", gasPrice: "10000000000000", data: ["0x"+txTo.text, txValue.text]})
}
}
}

View File

@ -0,0 +1,254 @@
import QtQuick 2.0
import QtQuick.Controls 1.0;
import QtQuick.Layouts 1.0;
import QtQuick.Dialogs 1.0;
import QtQuick.Window 2.1;
import QtQuick.Controls.Styles 1.1
import Ethereum 1.0
Rectangle {
id: root
property var title: "Miner"
property var iconSource: "../miner.png"
property var menuItem
color: "#00000000"
ColumnLayout {
spacing: 10
anchors.fill: parent
Rectangle {
id: mainPane
color: "#00000000"
anchors {
top: parent.top
bottom: localTxPane.top
left: parent.left
right: parent.right
}
Rectangle {
id: menu
height: 25
anchors {
left: parent.left
}
RowLayout {
id: tools
anchors {
left: parent.left
right: parent.right
}
Button {
text: "Start"
onClicked: {
eth.setGasPrice(minGasPrice.text || "10000000000000");
if (eth.toggleMining()) {
this.text = "Stop";
} else {
this.text = "Start";
}
}
}
Rectangle {
anchors.top: parent.top
anchors.topMargin: 2
width: 200
TextField {
id: minGasPrice
placeholderText: "Min Gas: 10000000000000"
width: 200
validator: RegExpValidator { regExp: /\d*/ }
}
}
}
}
Column {
anchors {
left: parent.left
right: parent.right
top: menu.bottom
topMargin: 5
}
Text {
text: "<b>Merged mining options</b>"
}
TableView {
id: mergedMiningTable
height: 300
anchors {
left: parent.left
right: parent.right
}
Component {
id: checkBoxDelegate
Item {
id: test
CheckBox {
anchors.fill: parent
checked: styleData.value
onClicked: {
var model = mergedMiningModel.get(styleData.row)
if (this.checked) {
model.id = txModel.createLocalTx(model.address, "0", "5000", "0", "")
} else {
txModel.removeWithId(model.id);
model.id = 0;
}
}
}
}
}
TableViewColumn{ role: "checked" ; title: "" ; width: 40 ; delegate: checkBoxDelegate }
TableViewColumn{ role: "name" ; title: "Name" ; width: 480 }
model: ListModel {
objectName: "mergedMiningModel"
id: mergedMiningModel
function addMergedMiningOption(model) {
this.append(model);
}
}
Component.onCompleted: {
/*
// XXX Temp. replace with above eventually
var tmpItems = ["JEVCoin", "Some coin", "Other coin", "Etc coin"];
var address = "e6716f9544a56c530d868e4bfbacb172315bdead";
for (var i = 0; i < tmpItems.length; i++) {
mergedMiningModel.append({checked: false, name: tmpItems[i], address: address, id: 0, itemId: i});
}
*/
}
}
}
}
Rectangle {
id: localTxPane
color: "#ececec"
border.color: "#cccccc"
border.width: 1
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
height: 300
ColumnLayout {
spacing: 10
anchors.fill: parent
RowLayout {
id: newLocalTx
anchors {
left: parent.left
leftMargin: 5
top: parent.top
topMargin: 5
bottomMargin: 5
}
Text {
text: "Local tx"
}
Rectangle {
width: 250
color: "#00000000"
anchors.top: parent.top
anchors.topMargin: 2
TextField {
id: to
placeholderText: "To"
width: 250
validator: RegExpValidator { regExp: /[abcdefABCDEF1234567890]*/ }
}
}
TextField {
property var defaultGas: "5000"
id: gas
placeholderText: "Gas"
text: defaultGas
validator: RegExpValidator { regExp: /\d*/ }
}
TextField {
id: gasPrice
placeholderText: "Price"
validator: RegExpValidator { regExp: /\d*/ }
}
TextField {
id: value
placeholderText: "Amount"
text: "0"
validator: RegExpValidator { regExp: /\d*/ }
}
TextField {
id: data
placeholderText: "Data"
validator: RegExpValidator { regExp: /[abcdefABCDEF1234567890]*/ }
}
Button {
text: "Create"
onClicked: {
if (to.text.length == 40 && gasPrice.text.length != 0 && value.text.length != 0 && gas.text.length != 0) {
txModel.createLocalTx(to.text, gasPrice.text, gas.text, value.text, data.text);
to.text = ""; gasPrice.text = "";
gas.text = gas.defaultGas;
value.text = "0"
}
}
}
}
TableView {
id: txTableView
anchors {
top: newLocalTx.bottom
topMargin: 5
left: parent.left
right: parent.right
bottom: parent.bottom
}
TableViewColumn{ role: "to" ; title: "To" ; width: 480 }
TableViewColumn{ role: "gas" ; title: "Gas" ; width: 100 }
TableViewColumn{ role: "gasPrice" ; title: "Gas Price" ; width: 100 }
TableViewColumn{ role: "value" ; title: "Amount" ; width: 100 }
TableViewColumn{ role: "data" ; title: "Data" ; width: 100 }
model: ListModel {
id: txModel
Component.onCompleted: {
}
function removeWithId(id) {
for (var i = 0; i < this.count; i++) {
if (txModel.get(i).id == id) {
this.remove(i);
eth.removeLocalTransaction(id)
break;
}
}
}
function createLocalTx(to, gasPrice, gas, value, data) {
var id = eth.addLocalTransaction(to, data, gas, gasPrice, value)
txModel.insert(0, {to: to, gas: gas, gasPrice: gasPrice, value: value, data: data, id: id});
return id
}
}
}
}
}
}
}

View File

@ -8,7 +8,6 @@ import Ethereum 1.0
Rectangle {
property var title: "Pending Transactions"
property var iconSource: "../tx.png"
property var menuItem
objectName: "pendingTxView"

View File

@ -7,8 +7,7 @@ import QtQuick.Controls.Styles 1.1
import Ethereum 1.0
Rectangle {
property var iconSource: "../new.png"
property var title: "New transaction"
property var title: "New Transaction"
property var menuItem
objectName: "newTxView"
@ -115,7 +114,7 @@ Rectangle {
width: 50
validator: RegExpValidator { regExp: /\d*/ }
placeholderText: "Gas"
text: "500"
text: "5000"
}
Label {
id: atLabel

View File

@ -16,7 +16,13 @@ Rectangle {
anchors.fill: parent
function onReady() {
menuItem.secondaryTitle = eth.numberToHuman(eth.balanceAt(eth.key().address))
setBalance()
}
function setBalance() {
balance.text = "<b>Balance</b>: " + eth.numberToHuman(eth.balanceAt(eth.key().address))
if(menuItem)
menuItem.secondaryTitle = eth.numberToHuman(eth.balanceAt(eth.key().address))
}
ListModel {
@ -39,7 +45,6 @@ Rectangle {
Text {
id: balance
text: "<b>Balance</b>: " + eth.numberToHuman(eth.balanceAt(eth.key().address))
font.pixelSize: 24
anchors {
horizontalCenter: parent.horizontalCenter
@ -126,7 +131,6 @@ Rectangle {
var value = txValue.text + denomModel.get(valueDenom.currentIndex).zeros;
var gasPrice = "10000000000000"
var res = eth.transact({from: eth.key().privateKey, to: txTo.text, value: value, gas: "500", gasPrice: gasPrice})
console.log(res)
}
}
}
@ -144,23 +148,36 @@ Rectangle {
id: txTableView
anchors.fill : parent
TableViewColumn{ role: "num" ; title: "#" ; width: 30 }
TableViewColumn{ role: "from" ; title: "From" ; width: 280 }
TableViewColumn{ role: "to" ; title: "To" ; width: 280 }
TableViewColumn{ role: "from" ; title: "From" ; width: 340 }
TableViewColumn{ role: "to" ; title: "To" ; width: 340 }
TableViewColumn{ role: "value" ; title: "Amount" ; width: 100 }
model: ListModel {
id: txModel
Component.onCompleted: {
var filter = ethx.watch({latest: -1, from: eth.key().address});
filter.changed(addTxs)
var me = eth.key().address;
var filterTo = ethx.watch({latest: -1, to: me});
var filterFrom = ethx.watch({latest: -1, from: me});
filterTo.changed(addTxs)
filterFrom.changed(addTxs)
addTxs(filter.messages())
addTxs(filterTo.messages())
addTxs(filterFrom.messages())
}
function addTxs(messages) {
setBalance()
for(var i = 0; i < messages.length; i++) {
var message = messages.get(i);
txModel.insert(0, {num: txModel.count, from: message.from, to: message.to, value: eth.numberToHuman(message.value)})
var to = eth.lookupName(message.to);
var from;
if(message.from.length == 0) {
from = "- MINED -";
} else {
from = eth.lookupName(message.from);
}
txModel.insert(0, {num: txModel.count, from: from, to: to, value: eth.numberToHuman(message.value)})
}
}
}

View File

@ -0,0 +1,413 @@
import QtQuick 2.0
import QtWebKit 3.0
import QtWebKit.experimental 1.0
import QtQuick.Controls 1.0;
import QtQuick.Controls.Styles 1.0
import QtQuick.Layouts 1.0;
import QtQuick.Window 2.1;
import Ethereum 1.0
Rectangle {
id: window
property var title: "Browser"
property var iconSource: "../browser.png"
property var menuItem
property alias url: webview.url
property alias webView: webview
property var cleanPath: false
property var open: function(url) {
if(!window.cleanPath) {
var uri = url;
if(!/.*\:\/\/.*/.test(uri)) {
uri = "http://" + uri;
}
var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/
if(reg.test(uri)) {
uri.replace(reg, function(match, pre, domain, path) {
uri = pre;
var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4));
var ip = [];
for(var i = 0, l = lookup.length; i < l; i++) {
ip.push(lookup.charCodeAt(i))
}
if(ip.length != 0) {
uri += lookup;
} else {
uri += domain;
}
uri += path;
});
}
window.cleanPath = true;
webview.url = uri;
//uriNav.text = uri.text.replace(/(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.\w{2,3})(.*)/, "$1$2<span style='color:#CCC'>$3</span>");
uriNav.text = uri;
} else {
// Prevent inf loop.
window.cleanPath = false;
}
}
Component.onCompleted: {
webview.url = "http://etherian.io"
}
signal messages(var messages, int id);
onMessages: {
// Bit of a cheat to get proper JSON
var m = JSON.parse(JSON.parse(JSON.stringify(messages)))
webview.postEvent("messages", [m, id]);
}
Item {
objectName: "root"
id: root
anchors.fill: parent
state: "inspectorShown"
RowLayout {
id: navBar
height: 40
anchors {
left: parent.left
right: parent.right
leftMargin: 7
}
Button {
id: back
onClicked: {
webview.goBack()
}
style: ButtonStyle {
background: Image {
source: "../back.png"
width: 30
height: 30
}
}
}
TextField {
anchors {
left: back.right
right: toggleInspector.left
leftMargin: 5
rightMargin: 5
}
text: "http://etherian.io"
id: uriNav
y: parent.height / 2 - this.height / 2
Keys.onReturnPressed: {
webview.url = this.text;
}
}
Button {
id: toggleInspector
anchors {
right: parent.right
}
iconSource: "../bug.png"
onClicked: {
if(inspector.visible == true){
inspector.visible = false
}else{
inspector.visible = true
inspector.url = webview.experimental.remoteInspectorUrl
}
}
}
}
WebView {
objectName: "webView"
id: webview
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
top: navBar.bottom
}
//property var cleanPath: false
onNavigationRequested: {
window.open(request.url.toString());
}
function sendMessage(data) {
webview.experimental.postMessage(JSON.stringify(data))
}
experimental.preferences.javascriptEnabled: true
experimental.preferences.navigatorQtObjectEnabled: true
experimental.preferences.developerExtrasEnabled: true
//experimental.userScripts: ["../ext/qt_messaging_adapter.js", "../ext/q.js", "../ext/big.js", "../ext/string.js", "../ext/html_messaging.js"]
experimental.userScripts: ["../ext/q.js", "../ext/eth.js/main.js", "../ext/eth.js/qt.js", "../ext/setup.js"]
experimental.onMessageReceived: {
console.log("[onMessageReceived]: ", message.data)
// TODO move to messaging.js
var data = JSON.parse(message.data)
try {
switch(data.call) {
case "compile":
postData(data._id, eth.compile(data.args[0]))
break
case "coinbase":
postData(data._id, eth.coinBase())
case "account":
postData(data._id, eth.key().address);
case "isListening":
postData(data._id, eth.isListening())
break
case "isMining":
postData(data._id, eth.isMining())
break
case "peerCount":
postData(data._id, eth.peerCount())
break
case "countAt":
require(1)
postData(data._id, eth.txCountAt(data.args[0]))
break
case "codeAt":
require(1)
var code = eth.codeAt(data.args[0])
postData(data._id, code);
break
case "blockByNumber":
require(1)
var block = eth.blockByNumber(data.args[0])
postData(data._id, block)
break
case "blockByHash":
require(1)
var block = eth.blockByHash(data.args[0])
postData(data._id, block)
break
require(2)
var block = eth.blockByHash(data.args[0])
postData(data._id, block.transactions[data.args[1]])
break
case "transactionByHash":
case "transactionByNumber":
require(2)
var block;
if (data.call === "transactionByHash")
block = eth.blockByHash(data.args[0])
else
block = eth.blockByNumber(data.args[0])
var tx = block.transactions.get(data.args[1])
postData(data._id, tx)
break
case "uncleByHash":
case "uncleByNumber":
require(2)
var block;
if (data.call === "uncleByHash")
block = eth.blockByHash(data.args[0])
else
block = eth.blockByNumber(data.args[0])
var uncle = block.uncles.get(data.args[1])
postData(data._id, uncle)
break
case "transact":
require(5)
var tx = eth.transact(data.args)
postData(data._id, tx)
break
case "stateAt":
require(2);
var storage = eth.storageAt(data.args[0], data.args[1]);
postData(data._id, storage)
break
case "call":
require(1);
var ret = eth.call(data.args)
postData(data._id, ret)
break
case "balanceAt":
require(1);
postData(data._id, eth.balanceAt(data.args[0]));
break
case "watch":
require(2)
eth.watch(data.args[0], data.args[1])
case "disconnect":
require(1)
postData(data._id, null)
break;
case "messages":
require(1);
var messages = JSON.parse(eth.getMessages(data.args[0]))
postData(data._id, messages)
break
case "mutan":
require(1)
var code = eth.compileMutan(data.args[0])
postData(data._id, "0x"+code)
break;
case "newFilterString":
require(1)
var id = eth.newFilterString(data.args[0])
postData(data._id, id);
break;
case "newFilter":
require(1)
var id = eth.newFilter(data.args[0])
postData(data._id, id);
break;
case "getMessages":
require(1);
var messages = eth.messages(data.args[0]);
var m = JSON.parse(JSON.parse(JSON.stringify(messages)))
postData(data._id, m);
break;
case "deleteFilter":
require(1);
eth.uninstallFilter(data.args[0])
break;
}
} catch(e) {
console.log(data.call + ": " + e)
postData(data._id, null);
}
}
function post(seed, data) {
postData(data._id, data)
}
function require(args, num) {
if(args.length < num) {
throw("required argument count of "+num+" got "+args.length);
}
}
function postData(seed, data) {
webview.experimental.postMessage(JSON.stringify({data: data, _id: seed}))
}
function postEvent(event, data) {
webview.experimental.postMessage(JSON.stringify({data: data, _event: event}))
}
function onWatchedCb(data, id) {
var messages = JSON.parse(data)
postEvent("watched:"+id, messages)
}
function onNewBlockCb(block) {
postEvent("block:new", block)
}
function onObjectChangeCb(stateObject) {
postEvent("object:"+stateObject.address(), stateObject)
}
function onStorageChangeCb(storageObject) {
var ev = ["storage", storageObject.stateAddress, storageObject.address].join(":");
postEvent(ev, [storageObject.address, storageObject.value])
}
}
Rectangle {
id: sizeGrip
color: "gray"
visible: false
height: 10
anchors {
left: root.left
right: root.right
}
y: Math.round(root.height * 2 / 3)
MouseArea {
anchors.fill: parent
drag.target: sizeGrip
drag.minimumY: 0
drag.maximumY: root.height
drag.axis: Drag.YAxis
}
}
WebView {
id: inspector
visible: false
anchors {
left: root.left
right: root.right
top: sizeGrip.bottom
bottom: root.bottom
}
}
states: [
State {
name: "inspectorShown"
PropertyChanges {
target: inspector
}
}
]
}
}

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,16 +1,31 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"encoding/json"
"fmt"
"os"
"strconv"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
)
type plugin struct {
@ -18,16 +33,8 @@ type plugin struct {
Path string `json:"path"`
}
func (gui *Gui) Println(v ...interface{}) {
gui.printLog(fmt.Sprintln(v...))
}
func (gui *Gui) Printf(format string, v ...interface{}) {
gui.printLog(fmt.Sprintf(format, v...))
}
// Print function that logs directly to the GUI
func (gui *Gui) printLog(s string) {
// LogPrint writes to the GUI log.
func (gui *Gui) LogPrint(level logger.LogLevel, msg string) {
/*
str := strings.TrimRight(s, "\n")
lines := strings.Split(str, "\n")
@ -38,12 +45,12 @@ func (gui *Gui) printLog(s string) {
}
*/
}
func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (*ethpipe.JSReceipt, error) {
func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (string, error) {
var data string
if len(recipient) == 0 {
code, err := ethutil.Compile(d, false)
if err != nil {
return nil, err
return "", err
}
data = ethutil.Bytes2Hex(code)
} else {
@ -62,18 +69,14 @@ func (gui *Gui) GetCustomIdentifier() string {
return gui.clientIdentity.GetCustomIdentifier()
}
func (gui *Gui) ToggleTurboMining() {
gui.miner.ToggleTurbo()
}
// functions that allow Gui to implement interface ethlog.LogSystem
func (gui *Gui) SetLogLevel(level ethlog.LogLevel) {
// functions that allow Gui to implement interface guilogger.LogSystem
func (gui *Gui) SetLogLevel(level logger.LogLevel) {
gui.logLevel = level
gui.stdLog.SetLogLevel(level)
gui.config.Save("loglevel", level)
}
func (gui *Gui) GetLogLevel() ethlog.LogLevel {
func (gui *Gui) GetLogLevel() logger.LogLevel {
return gui.logLevel
}
@ -100,18 +103,18 @@ func (self *Gui) DumpState(hash, path string) {
var stateDump []byte
if len(hash) == 0 {
stateDump = self.eth.StateManager().CurrentState().Dump()
stateDump = self.eth.ChainManager().State().Dump()
} else {
var block *ethchain.Block
var block *types.Block
if hash[0] == '#' {
i, _ := strconv.Atoi(hash[1:])
block = self.eth.BlockChain().GetBlockByNumber(uint64(i))
block = self.eth.ChainManager().GetBlockByNumber(uint64(i))
} else {
block = self.eth.BlockChain().GetBlock(ethutil.Hex2Bytes(hash))
block = self.eth.ChainManager().GetBlock(ethutil.Hex2Bytes(hash))
}
if block == nil {
logger.Infof("block err: not found %s\n", hash)
guilogger.Infof("block err: not found %s\n", hash)
return
}
@ -120,29 +123,12 @@ func (self *Gui) DumpState(hash, path string) {
file, err := os.OpenFile(path[7:], os.O_CREATE|os.O_RDWR, os.ModePerm)
if err != nil {
logger.Infoln("dump err: ", err)
guilogger.Infoln("dump err: ", err)
return
}
defer file.Close()
logger.Infof("dumped state (%s) to %s\n", hash, path)
guilogger.Infof("dumped state (%s) to %s\n", hash, path)
file.Write(stateDump)
}
func (gui *Gui) ToggleMining() {
var txt string
if gui.eth.Mining {
utils.StopMining(gui.eth)
txt = "Start mining"
gui.getObjectByName("miningLabel").Set("visible", false)
} else {
utils.StartMining(gui.eth)
gui.miner = utils.GetMiner()
txt = "Stop mining"
gui.getObjectByName("miningLabel").Set("visible", true)
}
gui.win.Root().Set("miningButtonText", txt)
}

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
@ -7,11 +24,11 @@ import (
"strings"
"unicode"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethvm"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
"gopkg.in/qml.v1"
)
@ -20,10 +37,10 @@ type DebuggerWindow struct {
engine *qml.Engine
lib *UiLib
vm *ethvm.Vm
vm *vm.DebugVm
Db *Debugger
state *ethstate.State
state *state.StateDB
}
func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
@ -37,7 +54,7 @@ func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
win := component.CreateWindow(nil)
w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: &ethvm.Vm{}}
w := &DebuggerWindow{engine: engine, win: win, lib: lib, vm: &vm.DebugVm{}}
w.Db = NewDebugger(w)
return w
@ -64,7 +81,7 @@ func (self *DebuggerWindow) SetData(data string) {
func (self *DebuggerWindow) SetAsm(data []byte) {
self.win.Root().Call("clearAsm")
dis := ethchain.Disassemble(data)
dis := core.Disassemble(data)
for _, str := range dis {
self.win.Root().Call("setAsm", str)
}
@ -124,28 +141,24 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
keyPair = self.lib.eth.KeyManager().KeyPair()
)
state := self.lib.eth.StateManager().TransState()
account := self.lib.eth.StateManager().TransState().GetAccount(keyPair.Address())
contract := ethstate.NewStateObject([]byte{0})
contract.Balance = value
statedb := self.lib.eth.ChainManager().TransState()
account := self.lib.eth.ChainManager().TransState().GetAccount(keyPair.Address())
contract := statedb.NewStateObject([]byte{0})
contract.SetCode(script)
contract.SetBalance(value)
self.SetAsm(script)
block := self.lib.eth.BlockChain().CurrentBlock
block := self.lib.eth.ChainManager().CurrentBlock()
callerClosure := ethvm.NewClosure(&ethstate.Message{}, account, contract, script, gas, gasPrice)
env := utils.NewEnv(state, block, account.Address(), value)
vm := ethvm.New(env)
vm.Verbose = true
vm.Dbg = self.Db
env := utils.NewEnv(statedb, block, account.Address(), value)
self.vm = vm
self.Db.done = false
self.Logf("callsize %d", len(script))
go func() {
ret, g, err := callerClosure.Call(vm, data)
tot := new(big.Int).Mul(g, gasPrice)
self.Logf("gas usage %v total price = %v (%v)", g, tot, ethutil.CurrencyToString(tot))
ret, err := env.Call(account, contract.Address(), data, gas, gasPrice, ethutil.Big0)
//ret, g, err := callerClosure.Call(evm, data)
tot := new(big.Int).Mul(env.Gas, gasPrice)
self.Logf("gas usage %v total price = %v (%v)", env.Gas, tot, ethutil.CurrencyToString(tot))
if err != nil {
self.Logln("exited with errors:", err)
} else {
@ -156,7 +169,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
}
}
state.Reset()
statedb.Reset()
if !self.Db.interrupt {
self.Db.done = true
@ -251,13 +264,13 @@ type storeVal struct {
Key, Value string
}
func (self *Debugger) BreakHook(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool {
func (self *Debugger) BreakHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool {
self.main.Logln("break on instr:", pc)
return self.halting(pc, op, mem, stack, stateObject)
}
func (self *Debugger) StepHook(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool {
func (self *Debugger) StepHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool {
return self.halting(pc, op, mem, stack, stateObject)
}
@ -269,7 +282,7 @@ func (self *Debugger) BreakPoints() []int64 {
return self.breakPoints
}
func (d *Debugger) halting(pc int, op ethvm.OpCode, mem *ethvm.Memory, stack *ethvm.Stack, stateObject *ethstate.StateObject) bool {
func (d *Debugger) halting(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool {
d.win.Root().Call("setInstruction", pc)
d.win.Root().Call("clearMem")
d.win.Root().Call("clearStack")

53
cmd/mist/errors.go Normal file
View File

@ -0,0 +1,53 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"fmt"
"os"
"gopkg.in/qml.v1"
)
func ErrorWindow(err error) {
engine := qml.NewEngine()
component, e := engine.LoadString("local", qmlErr)
if e != nil {
fmt.Println("err:", err)
os.Exit(1)
}
win := component.CreateWindow(nil)
win.Root().ObjectByName("label").Set("text", err.Error())
win.Show()
win.Wait()
}
const qmlErr = `
import QtQuick 2.0; import QtQuick.Controls 1.0;
ApplicationWindow {
width: 600; height: 150;
flags: Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
title: "Error"
Text {
x: parent.width / 2 - this.width / 2;
y: parent.height / 2 - this.height / 2;
objectName: "label";
}
}
`

143
cmd/mist/ext_app.go Normal file
View File

@ -0,0 +1,143 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"encoding/json"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/ui/qt"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
)
type AppContainer interface {
Create() error
Destroy()
Window() *qml.Window
Engine() *qml.Engine
NewBlock(*types.Block)
NewWatcher(chan bool)
Messages(state.Messages, string)
Post(string, int)
}
type ExtApplication struct {
*xeth.JSXEth
eth core.EthManager
events event.Subscription
watcherQuitChan chan bool
filters map[string]*core.Filter
container AppContainer
lib *UiLib
}
func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication {
return &ExtApplication{
JSXEth: xeth.NewJSXEth(lib.eth),
eth: lib.eth,
watcherQuitChan: make(chan bool),
filters: make(map[string]*core.Filter),
container: container,
lib: lib,
}
}
func (app *ExtApplication) run() {
// Set the "eth" api on to the containers context
context := app.container.Engine().Context()
context.SetVar("eth", app)
context.SetVar("ui", app.lib)
err := app.container.Create()
if err != nil {
guilogger.Errorln(err)
return
}
// Subscribe to events
mux := app.lib.eth.EventMux()
app.events = mux.Subscribe(core.NewBlockEvent{}, state.Messages(nil))
// Call the main loop
go app.mainLoop()
app.container.NewWatcher(app.watcherQuitChan)
win := app.container.Window()
win.Show()
win.Wait()
app.stop()
}
func (app *ExtApplication) stop() {
app.events.Unsubscribe()
// Kill the main loop
app.watcherQuitChan <- true
app.container.Destroy()
}
func (app *ExtApplication) mainLoop() {
for ev := range app.events.Chan() {
switch ev := ev.(type) {
case core.NewBlockEvent:
app.container.NewBlock(ev.Block)
case state.Messages:
for id, filter := range app.filters {
msgs := filter.FilterMessages(ev)
if len(msgs) > 0 {
app.container.Messages(msgs, id)
}
}
}
}
}
func (self *ExtApplication) Watch(filterOptions map[string]interface{}, identifier string) {
self.filters[identifier] = qt.NewFilterFromMap(filterOptions, self.eth)
}
func (self *ExtApplication) GetMessages(object map[string]interface{}) string {
filter := qt.NewFilterFromMap(object, self.eth)
messages := filter.Find()
var msgs []javascript.JSMessage
for _, m := range messages {
msgs = append(msgs, javascript.NewJSMessage(m))
}
b, err := json.Marshal(msgs)
if err != nil {
return "{\"error\":" + err.Error() + "}"
}
return string(b)
}

View File

@ -1,8 +1,26 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"flag"
"fmt"
"log"
"os"
"os/user"
"path"
@ -10,29 +28,34 @@ import (
"runtime"
"bitbucket.org/kardianos/osext"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/vm"
)
var Identifier string
var KeyRing string
var KeyStore string
var StartRpc bool
var RpcPort int
var UseUPnP bool
var OutboundPort string
var ShowGenesis bool
var AddPeer string
var MaxPeer int
var GenAddr bool
var UseSeed bool
var SecretFile string
var ExportDir string
var NonInteractive bool
var Datadir string
var LogFile string
var ConfigFile string
var DebugFile string
var LogLevel int
var (
Identifier string
KeyRing string
KeyStore string
StartRpc bool
StartWebSockets bool
RpcPort int
UseUPnP bool
OutboundPort string
ShowGenesis bool
AddPeer string
MaxPeer int
GenAddr bool
UseSeed bool
SecretFile string
ExportDir string
NonInteractive bool
Datadir string
LogFile string
ConfigFile string
DebugFile string
LogLevel int
VmType int
)
// flags specific to gui client
var AssetPath string
@ -44,7 +67,7 @@ func defaultAssetPath() string {
// assume a debug build and use the source directory as
// asset directory.
pwd, _ := os.Getwd()
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "mist") {
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist") {
assetPath = path.Join(pwd, "assets")
} else {
switch runtime.GOOS {
@ -75,14 +98,16 @@ func Init() {
flag.PrintDefaults()
}
flag.IntVar(&VmType, "vm", 0, "Virtual Machine type: 0-1: standard, debug")
flag.StringVar(&Identifier, "id", "", "Custom client identifier")
flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use")
flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)")
flag.StringVar(&OutboundPort, "port", "30303", "listening port")
flag.BoolVar(&UseUPnP, "upnp", true, "enable UPnP support")
flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers")
flag.IntVar(&MaxPeer, "maxpeer", 30, "maximum desired peers")
flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on")
flag.BoolVar(&StartRpc, "rpc", false, "start rpc server")
flag.BoolVar(&StartWebSockets, "ws", false, "start websocket server")
flag.BoolVar(&NonInteractive, "y", false, "non-interactive mode (say yes to confirmations)")
flag.BoolVar(&UseSeed, "seed", true, "seed peers")
flag.BoolVar(&GenAddr, "genaddr", false, "create a new priv/pub key")
@ -92,9 +117,13 @@ func Init() {
flag.StringVar(&Datadir, "datadir", defaultDataDir(), "specifies the datadir to use")
flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file")
flag.StringVar(&DebugFile, "debug", "", "debug file (no debugging if not set)")
flag.IntVar(&LogLevel, "loglevel", int(ethlog.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
flag.IntVar(&LogLevel, "loglevel", int(logger.InfoLevel), "loglevel: 0-5: silent,error,warn,info,debug,debug detail)")
flag.StringVar(&AssetPath, "asset_path", defaultAssetPath(), "absolute path to GUI assets directory")
flag.Parse()
if VmType >= int(vm.MaxVmTy) {
log.Fatal("Invalid VM type ", VmType)
}
}

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import "C"
@ -13,15 +30,15 @@ import (
"strings"
"time"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethminer"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethreact"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/wire"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
)
@ -47,8 +64,17 @@ func LoadExtension(path string) (uintptr, error) {
return ptr.Interface().(uintptr), nil
}
*/
/*
vec, errr := LoadExtension("/Users/jeffrey/Desktop/build-libqmltest-Desktop_Qt_5_2_1_clang_64bit-Debug/liblibqmltest_debug.dylib")
fmt.Printf("Fetched vec with addr: %#x\n", vec)
if errr != nil {
fmt.Println(errr)
} else {
context.SetVar("vec", (unsafe.Pointer)(vec))
}
*/
var logger = ethlog.NewLogger("GUI")
var guilogger = logger.NewLogger("GUI")
type Gui struct {
// The main application window
@ -65,30 +91,30 @@ type Gui struct {
txDb *ethdb.LDBDatabase
logLevel ethlog.LogLevel
logLevel logger.LogLevel
open bool
pipe *ethpipe.JSPipe
pipe *xeth.JSXEth
Session string
clientIdentity *ethwire.SimpleClientIdentity
clientIdentity *wire.SimpleClientIdentity
config *ethutil.ConfigManager
plugins map[string]plugin
miner *ethminer.Miner
stdLog ethlog.LogSystem
miner *miner.Miner
stdLog logger.LogSystem
}
// Create GUI, but doesn't start it
func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIdentity *ethwire.SimpleClientIdentity, session string, logLevel int) *Gui {
func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIdentity *wire.SimpleClientIdentity, session string, logLevel int) *Gui {
db, err := ethdb.NewLDBDatabase("tx_database")
if err != nil {
panic(err)
}
pipe := ethpipe.NewJSPipe(ethereum)
gui := &Gui{eth: ethereum, txDb: db, pipe: pipe, logLevel: ethlog.LogLevel(logLevel), Session: session, open: false, clientIdentity: clientIdentity, config: config, plugins: make(map[string]plugin)}
pipe := xeth.NewJSXEth(ethereum)
gui := &Gui{eth: ethereum, txDb: db, pipe: pipe, logLevel: logger.LogLevel(logLevel), Session: session, open: false, clientIdentity: clientIdentity, config: config, plugins: make(map[string]plugin)}
data, _ := ethutil.ReadAllFile(path.Join(ethutil.Config.ExecPath, "plugins.json"))
json.Unmarshal([]byte(data), &gui.plugins)
@ -96,16 +122,17 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden
}
func (gui *Gui) Start(assetPath string) {
defer gui.txDb.Close()
guilogger.Infoln("Starting GUI")
// Register ethereum functions
qml.RegisterTypes("Ethereum", 1, 0, []qml.TypeSpec{{
Init: func(p *ethpipe.JSBlock, obj qml.Object) { p.Number = 0; p.Hash = "" },
Init: func(p *xeth.JSBlock, obj qml.Object) { p.Number = 0; p.Hash = "" },
}, {
Init: func(p *ethpipe.JSTransaction, obj qml.Object) { p.Value = ""; p.Hash = ""; p.Address = "" },
Init: func(p *xeth.JSTransaction, obj qml.Object) { p.Value = ""; p.Hash = ""; p.Address = "" },
}, {
Init: func(p *ethpipe.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" },
Init: func(p *xeth.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" },
}})
// Create a new QML engine
gui.engine = qml.NewEngine()
@ -116,16 +143,6 @@ func (gui *Gui) Start(assetPath string) {
context.SetVar("gui", gui)
context.SetVar("eth", gui.uiLib)
/*
vec, errr := LoadExtension("/Users/jeffrey/Desktop/build-libqmltest-Desktop_Qt_5_2_1_clang_64bit-Debug/liblibqmltest_debug.dylib")
fmt.Printf("Fetched vec with addr: %#x\n", vec)
if errr != nil {
fmt.Println(errr)
} else {
context.SetVar("vec", (unsafe.Pointer)(vec))
}
*/
// Load the main QML interface
data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
@ -139,40 +156,39 @@ func (gui *Gui) Start(assetPath string) {
addlog = true
}
if err != nil {
logger.Errorln("asset not found: you can set an alternative asset path on the command line using option 'asset_path'", err)
guilogger.Errorln("asset not found: you can set an alternative asset path on the command line using option 'asset_path'", err)
panic(err)
}
logger.Infoln("Starting GUI")
gui.open = true
win.Show()
// only add the gui logger after window is shown otherwise slider wont be shown
// only add the gui guilogger after window is shown otherwise slider wont be shown
if addlog {
ethlog.AddLogSystem(gui)
logger.AddLogSystem(gui)
}
win.Wait()
// need to silence gui logger after window closed otherwise logsystem hangs (but do not save loglevel)
gui.logLevel = ethlog.Silence
// need to silence gui guilogger after window closed otherwise logsystem hangs (but do not save loglevel)
gui.logLevel = logger.Silence
gui.open = false
}
func (gui *Gui) Stop() {
if gui.open {
gui.logLevel = ethlog.Silence
gui.logLevel = logger.Silence
gui.open = false
gui.win.Hide()
}
gui.uiLib.jsEngine.Stop()
logger.Infoln("Stopped")
guilogger.Infoln("Stopped")
}
func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) {
component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/wallet.qml"))
component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/main.qml"))
if err != nil {
return nil, err
}
@ -213,51 +229,34 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
func (gui *Gui) ImportAndSetPrivKey(secret string) bool {
err := gui.eth.KeyManager().InitFromString(gui.Session, 0, secret)
if err != nil {
logger.Errorln("unable to import: ", err)
guilogger.Errorln("unable to import: ", err)
return false
}
logger.Errorln("successfully imported: ", err)
guilogger.Errorln("successfully imported: ", err)
return true
}
func (gui *Gui) CreateAndSetPrivKey() (string, string, string, string) {
err := gui.eth.KeyManager().Init(gui.Session, 0, true)
if err != nil {
logger.Errorln("unable to create key: ", err)
guilogger.Errorln("unable to create key: ", err)
return "", "", "", ""
}
return gui.eth.KeyManager().KeyPair().AsStrings()
}
func (gui *Gui) setInitialBlockChain() {
sBlk := gui.eth.BlockChain().LastBlockHash
blk := gui.eth.BlockChain().GetBlock(sBlk)
for ; blk != nil; blk = gui.eth.BlockChain().GetBlock(sBlk) {
func (gui *Gui) setInitialChain(ancientBlocks bool) {
sBlk := gui.eth.ChainManager().LastBlockHash()
blk := gui.eth.ChainManager().GetBlock(sBlk)
for ; blk != nil; blk = gui.eth.ChainManager().GetBlock(sBlk) {
sBlk = blk.PrevHash
addr := gui.address()
// Loop through all transactions to see if we missed any while being offline
for _, tx := range blk.Transactions() {
if bytes.Compare(tx.Sender(), addr) == 0 || bytes.Compare(tx.Recipient, addr) == 0 {
if ok, _ := gui.txDb.Get(tx.Hash()); ok == nil {
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
}
}
}
gui.processBlock(blk, true)
}
}
type address struct {
Name, Address string
}
func (gui *Gui) loadAddressBook() {
view := gui.getObjectByName("infoView")
view.Call("clearAddress")
nameReg := gui.pipe.World().Config().Get("NameReg")
if nameReg != nil {
nameReg.EachStorage(func(name string, value *ethutil.Value) {
@ -270,8 +269,31 @@ func (gui *Gui) loadAddressBook() {
}
}
func (gui *Gui) insertTransaction(window string, tx *ethchain.Transaction) {
nameReg := ethpipe.New(gui.eth).World().Config().Get("NameReg")
func (self *Gui) loadMergedMiningOptions() {
view := self.getObjectByName("mergedMiningModel")
nameReg := self.pipe.World().Config().Get("MergeMining")
if nameReg != nil {
i := 0
nameReg.EachStorage(func(name string, value *ethutil.Value) {
if name[0] != 0 {
value.Decode()
view.Call("addMergedMiningOption", struct {
Checked bool
Name, Address string
Id, ItemId int
}{false, name, ethutil.Bytes2Hex(value.Bytes()), 0, i})
i++
}
})
}
}
func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
pipe := xeth.New(gui.eth)
nameReg := pipe.World().Config().Get("NameReg")
addr := gui.address()
var inout string
@ -282,14 +304,14 @@ func (gui *Gui) insertTransaction(window string, tx *ethchain.Transaction) {
}
var (
ptx = ethpipe.NewJSTx(tx)
send = nameReg.Storage(tx.Sender())
rec = nameReg.Storage(tx.Recipient)
ptx = xeth.NewJSTx(tx, pipe.World().State())
send = nameReg.Storage(tx.From())
rec = nameReg.Storage(tx.To())
s, r string
)
if tx.CreatesContract() {
rec = nameReg.Storage(tx.CreationAddress())
if core.MessageCreatesContract(tx) {
rec = nameReg.Storage(core.AddressFromMessage(tx))
}
if send.Len() != 0 {
@ -300,10 +322,10 @@ func (gui *Gui) insertTransaction(window string, tx *ethchain.Transaction) {
if rec.Len() != 0 {
r = strings.Trim(rec.Str(), "\x00")
} else {
if tx.CreatesContract() {
r = ethutil.Bytes2Hex(tx.CreationAddress())
if core.MessageCreatesContract(tx) {
r = ethutil.Bytes2Hex(core.AddressFromMessage(tx))
} else {
r = ethutil.Bytes2Hex(tx.Recipient)
r = ethutil.Bytes2Hex(tx.To())
}
}
ptx.Sender = s
@ -317,9 +339,9 @@ func (gui *Gui) insertTransaction(window string, tx *ethchain.Transaction) {
}
func (gui *Gui) readPreviousTransactions() {
it := gui.txDb.Db().NewIterator(nil, nil)
it := gui.txDb.NewIterator()
for it.Next() {
tx := ethchain.NewTransactionFromBytes(it.Value())
tx := types.NewTransactionFromBytes(it.Value())
gui.insertTransaction("post", tx)
@ -327,9 +349,9 @@ func (gui *Gui) readPreviousTransactions() {
it.Release()
}
func (gui *Gui) processBlock(block *ethchain.Block, initial bool) {
func (gui *Gui) processBlock(block *types.Block, initial bool) {
name := strings.Trim(gui.pipe.World().Config().Get("NameReg").Storage(block.Coinbase).Str(), "\x00")
b := ethpipe.NewJSBlock(block)
b := xeth.NewJSBlock(block)
b.Name = name
gui.getObjectByName("chainView").Call("addBlock", b, initial)
@ -359,131 +381,113 @@ func (self *Gui) getObjectByName(objectName string) qml.Object {
func (gui *Gui) update() {
// We have to wait for qml to be done loading all the windows.
for !gui.qmlDone {
time.Sleep(500 * time.Millisecond)
time.Sleep(300 * time.Millisecond)
}
go func() {
go gui.setInitialBlockChain()
go gui.setInitialChain(false)
gui.loadAddressBook()
gui.loadMergedMiningOptions()
gui.setPeerInfo()
gui.readPreviousTransactions()
}()
for _, plugin := range gui.plugins {
logger.Infoln("Loading plugin ", plugin.Name)
guilogger.Infoln("Loading plugin ", plugin.Name)
gui.win.Root().Call("addPlugin", plugin.Path, "")
}
var (
blockChan = make(chan ethreact.Event, 100)
txChan = make(chan ethreact.Event, 100)
objectChan = make(chan ethreact.Event, 100)
peerChan = make(chan ethreact.Event, 100)
chainSyncChan = make(chan ethreact.Event, 100)
miningChan = make(chan ethreact.Event, 100)
)
peerUpdateTicker := time.NewTicker(5 * time.Second)
generalUpdateTicker := time.NewTicker(1 * time.Second)
generalUpdateTicker := time.NewTicker(500 * time.Millisecond)
statsUpdateTicker := time.NewTicker(5 * time.Second)
state := gui.eth.StateManager().TransState()
state := gui.eth.ChainManager().TransState()
unconfirmedFunds := new(big.Int)
gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance)))
gui.getObjectByName("syncProgressIndicator").Set("visible", !gui.eth.IsUpToDate())
gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance())))
lastBlockLabel := gui.getObjectByName("lastBlockLabel")
miningLabel := gui.getObjectByName("miningLabel")
events := gui.eth.EventMux().Subscribe(
eth.ChainSyncEvent{},
eth.PeerListEvent{},
core.NewBlockEvent{},
core.TxPreEvent{},
core.TxPostEvent{},
)
go func() {
defer events.Unsubscribe()
for {
select {
case b := <-blockChan:
block := b.Resource.(*ethchain.Block)
gui.processBlock(block, false)
if bytes.Compare(block.Coinbase, gui.address()) == 0 {
gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Balance, nil)
case ev, isopen := <-events.Chan():
if !isopen {
return
}
case txMsg := <-txChan:
tx := txMsg.Resource.(*ethchain.Transaction)
if txMsg.Name == "newTx:pre" {
object := state.GetAccount(gui.address())
if bytes.Compare(tx.Sender(), gui.address()) == 0 {
unconfirmedFunds.Sub(unconfirmedFunds, tx.Value)
} else if bytes.Compare(tx.Recipient, gui.address()) == 0 {
unconfirmedFunds.Add(unconfirmedFunds, tx.Value)
switch ev := ev.(type) {
case core.NewBlockEvent:
gui.processBlock(ev.Block, false)
if bytes.Compare(ev.Block.Coinbase, gui.address()) == 0 {
gui.setWalletValue(gui.eth.ChainManager().State().GetBalance(gui.address()), nil)
}
gui.setWalletValue(object.Balance, unconfirmedFunds)
case core.TxPreEvent:
tx := ev.Tx
tstate := gui.eth.ChainManager().TransState()
cstate := gui.eth.ChainManager().State()
taccount := tstate.GetAccount(gui.address())
caccount := cstate.GetAccount(gui.address())
unconfirmedFunds := new(big.Int).Sub(taccount.Balance(), caccount.Balance())
gui.setWalletValue(taccount.Balance(), unconfirmedFunds)
gui.insertTransaction("pre", tx)
} else {
case core.TxPostEvent:
tx := ev.Tx
object := state.GetAccount(gui.address())
if bytes.Compare(tx.Sender(), gui.address()) == 0 {
object.SubAmount(tx.Value)
object.SubAmount(tx.Value())
//gui.getObjectByName("transactionView").Call("addTx", ethpipe.NewJSTx(tx), "send")
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
} else if bytes.Compare(tx.Recipient, gui.address()) == 0 {
object.AddAmount(tx.Value)
} else if bytes.Compare(tx.To(), gui.address()) == 0 {
object.AddAmount(tx.Value())
//gui.getObjectByName("transactionView").Call("addTx", ethpipe.NewJSTx(tx), "recv")
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
}
gui.setWalletValue(object.Balance, nil)
gui.setWalletValue(object.Balance(), nil)
state.UpdateStateObject(object)
}
case msg := <-chainSyncChan:
sync := msg.Resource.(bool)
gui.win.Root().ObjectByName("syncProgressIndicator").Set("visible", sync)
case <-objectChan:
gui.loadAddressBook()
case <-peerChan:
gui.setPeerInfo()
case eth.PeerListEvent:
gui.setPeerInfo()
}
case <-peerUpdateTicker.C:
gui.setPeerInfo()
case msg := <-miningChan:
if msg.Name == "miner:start" {
gui.miner = msg.Resource.(*ethminer.Miner)
} else {
gui.miner = nil
}
case <-generalUpdateTicker.C:
statusText := "#" + gui.eth.BlockChain().CurrentBlock.Number.String()
statusText := "#" + gui.eth.ChainManager().CurrentBlock().Number.String()
lastBlockLabel.Set("text", statusText)
miningLabel.Set("text", "Mining @ "+strconv.FormatInt(gui.uiLib.miner.GetPow().GetHashrate(), 10)+"Khash")
if gui.miner != nil {
pow := gui.miner.GetPow()
miningLabel.Set("text", "Mining @ "+strconv.FormatInt(pow.GetHashrate(), 10)+"Khash")
}
blockLength := gui.eth.BlockPool().BlocksProcessed
chainLength := gui.eth.BlockPool().ChainLength
var (
pct float64 = 1.0 / float64(chainLength) * float64(blockLength)
dlWidget = gui.win.Root().ObjectByName("downloadIndicator")
dlLabel = gui.win.Root().ObjectByName("downloadLabel")
)
dlWidget.Set("value", pct)
dlLabel.Set("text", fmt.Sprintf("%d / %d", blockLength, chainLength))
case <-statsUpdateTicker.C:
gui.setStatsPane()
}
}
}()
reactor := gui.eth.Reactor()
reactor.Subscribe("newBlock", blockChan)
reactor.Subscribe("newTx:pre", txChan)
reactor.Subscribe("newTx:post", txChan)
reactor.Subscribe("chainSync", chainSyncChan)
reactor.Subscribe("miner:start", miningChan)
reactor.Subscribe("miner:stop", miningChan)
nameReg := gui.pipe.World().Config().Get("NameReg")
reactor.Subscribe("object:"+string(nameReg.Address()), objectChan)
reactor.Subscribe("peerList", peerChan)
}
func (gui *Gui) setStatsPane() {
@ -491,7 +495,7 @@ func (gui *Gui) setStatsPane() {
runtime.ReadMemStats(&memStats)
statsPane := gui.getObjectByName("statsPane")
statsPane.Set("text", fmt.Sprintf(`###### Mist 0.6.5 (%s) #######
statsPane.Set("text", fmt.Sprintf(`###### Mist %s (%s) #######
eth %d (p2p = %d)
@ -504,7 +508,7 @@ Heap Alloc: %d
CGNext: %x
NumGC: %d
`, runtime.Version(),
`, Version, runtime.Version(),
eth.ProtocolVersion, eth.P2PVersion,
runtime.NumCPU, runtime.NumGoroutine(), runtime.NumCgoCall(),
memStats.Alloc, memStats.HeapAlloc,
@ -514,7 +518,6 @@ NumGC: %d
func (gui *Gui) setPeerInfo() {
gui.win.Root().Call("setPeers", fmt.Sprintf("%d / %d", gui.eth.PeerCount(), gui.eth.MaxPeers))
gui.win.Root().Call("resetPeers")
for _, peer := range gui.pipe.Peers() {
gui.win.Root().Call("addPeer", peer)

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
@ -10,11 +27,11 @@ import (
"path"
"path/filepath"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
"github.com/howeyc/fsnotify"
"gopkg.in/qml.v1"
)
@ -81,12 +98,12 @@ func (app *HtmlApplication) NewWatcher(quitChan chan bool) {
app.watcher, err = fsnotify.NewWatcher()
if err != nil {
logger.Infoln("Could not create new auto-reload watcher:", err)
guilogger.Infoln("Could not create new auto-reload watcher:", err)
return
}
err = app.watcher.Watch(app.RootFolder())
if err != nil {
logger.Infoln("Could not start auto-reload watcher:", err)
guilogger.Infoln("Could not start auto-reload watcher:", err)
return
}
for _, folder := range app.RecursiveFolders() {
@ -102,11 +119,11 @@ func (app *HtmlApplication) NewWatcher(quitChan chan bool) {
app.watcher.Close()
break out
case <-app.watcher.Event:
//logger.Debugln("Got event:", ev)
//guilogger.Debugln("Got event:", ev)
app.webView.Call("reload")
case err := <-app.watcher.Error:
// TODO: Do something here
logger.Infoln("Watcher error:", err)
guilogger.Infoln("Watcher error:", err)
}
}
}()
@ -121,12 +138,12 @@ func (app *HtmlApplication) Window() *qml.Window {
return app.win
}
func (app *HtmlApplication) NewBlock(block *ethchain.Block) {
b := &ethpipe.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())}
func (app *HtmlApplication) NewBlock(block *types.Block) {
b := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())}
app.webView.Call("onNewBlockCb", b)
}
func (self *HtmlApplication) Messages(messages ethstate.Messages, id string) {
func (self *HtmlApplication) Messages(messages state.Messages, id string) {
var msgs []javascript.JSMessage
for _, m := range messages {
msgs = append(msgs, javascript.NewJSMessage(m))

View File

@ -1,18 +1,37 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"fmt"
"os"
"runtime"
"time"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/logger"
"gopkg.in/qml.v1"
)
const (
ClientIdentifier = "Mist"
Version = "0.6.5"
Version = "0.7.10"
)
var ethereum *eth.Ethereum
@ -21,7 +40,8 @@ func run() error {
// precedence: code-internal flag default < config file < environment variables < command line
Init() // parsing command line
config := utils.InitConfig(ConfigFile, Datadir, "ETH")
tstart := time.Now()
config := utils.InitConfig(VmType, ConfigFile, Datadir, "ETH")
utils.InitDataDir(Datadir)
@ -34,14 +54,11 @@ func run() error {
os.Exit(1)
}
keyManager := utils.NewKeyManager(KeyStore, Datadir, db)
// create, import, export keys
utils.KeyTasks(keyManager, KeyRing, GenAddr, SecretFile, ExportDir, NonInteractive)
clientIdentity := utils.NewClientIdentity(ClientIdentifier, Version, Identifier)
ethereum = utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer)
if ShowGenesis {
@ -58,7 +75,10 @@ func run() error {
utils.RegisterInterrupt(func(os.Signal) {
gui.Stop()
})
utils.StartEthereum(ethereum, UseSeed)
go utils.StartEthereum(ethereum, UseSeed)
fmt.Println("ETH stack took", time.Since(tstart))
// gui blocks the main thread
gui.Start(AssetPath)
@ -80,6 +100,10 @@ func main() {
utils.HandleInterrupt()
if StartWebSockets {
utils.StartWebSockets(ethereum)
}
// we need to run the interrupt callbacks in case gui is closed
// this skips if we got here by actual interrupt stopping the GUI
if !interrupted {
@ -87,5 +111,5 @@ func main() {
}
// this blocks the thread
ethereum.WaitForShutdown()
ethlog.Flush()
logger.Flush()
}

85
cmd/mist/qml_container.go Normal file
View File

@ -0,0 +1,85 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
"fmt"
"runtime"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
)
type QmlApplication struct {
win *qml.Window
engine *qml.Engine
lib *UiLib
path string
}
func NewQmlApplication(path string, lib *UiLib) *QmlApplication {
engine := qml.NewEngine()
return &QmlApplication{engine: engine, path: path, lib: lib}
}
func (app *QmlApplication) Create() error {
path := string(app.path)
// For some reason for windows we get /c:/path/to/something, windows doesn't like the first slash but is fine with the others so we are removing it
if app.path[0] == '/' && runtime.GOOS == "windows" {
path = app.path[1:]
}
component, err := app.engine.LoadFile(path)
if err != nil {
guilogger.Warnln(err)
}
app.win = component.CreateWindow(nil)
return nil
}
func (app *QmlApplication) Destroy() {
app.engine.Destroy()
}
func (app *QmlApplication) NewWatcher(quitChan chan bool) {
}
// Events
func (app *QmlApplication) NewBlock(block *types.Block) {
pblock := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())}
app.win.Call("onNewBlockCb", pblock)
}
func (self *QmlApplication) Messages(msgs state.Messages, id string) {
fmt.Println("IMPLEMENT QML APPLICATION MESSAGES METHOD")
}
// Getters
func (app *QmlApplication) Engine() *qml.Engine {
return app.engine
}
func (app *QmlApplication) Window() *qml.Window {
return app.win
}
func (app *QmlApplication) Post(data string, s int) {}

View File

@ -1,3 +1,20 @@
// Copyright (c) 2013-2014, Jeffrey Wilcke. All rights reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA
package main
import (
@ -7,13 +24,16 @@ import (
"strconv"
"strings"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethstate"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/ui/qt"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
)
@ -24,7 +44,7 @@ type memAddr struct {
// UI Library that has some basic functionality exposed
type UiLib struct {
*ethpipe.JSPipe
*xeth.JSXEth
engine *qml.Engine
eth *eth.Ethereum
connected bool
@ -37,21 +57,26 @@ type UiLib struct {
jsEngine *javascript.JSRE
filterCallbacks map[int][]int
miner *miner.Miner
}
func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
return &UiLib{JSPipe: ethpipe.NewJSPipe(eth), engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(eth), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*ethpipe.JSFilter)}
lib := &UiLib{JSXEth: xeth.NewJSXEth(eth), engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(eth), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*xeth.JSFilter)}
lib.miner = miner.New(eth.KeyManager().Address(), eth)
return lib
}
func (self *UiLib) Notef(args []interface{}) {
logger.Infoln(args...)
guilogger.Infoln(args...)
}
func (self *UiLib) LookupDomain(domain string) string {
world := self.World()
if len(domain) > 32 {
domain = string(ethcrypto.Sha3Bin([]byte(domain)))
domain = string(crypto.Sha3([]byte(domain)))
}
data := world.Config().Get("DnsReg").StorageString(domain).Bytes()
@ -71,13 +96,42 @@ func (self *UiLib) LookupDomain(domain string) string {
}
}
func (self *UiLib) LookupName(addr string) string {
var (
nameReg = self.World().Config().Get("NameReg")
lookup = nameReg.Storage(ethutil.Hex2Bytes(addr))
)
if lookup.Len() != 0 {
return strings.Trim(lookup.Str(), "\x00")
}
return addr
}
func (self *UiLib) LookupAddress(name string) string {
var (
nameReg = self.World().Config().Get("NameReg")
lookup = nameReg.Storage(ethutil.RightPadBytes([]byte(name), 32))
)
if lookup.Len() != 0 {
return ethutil.Bytes2Hex(lookup.Bytes())
}
return ""
}
func (self *UiLib) PastPeers() *ethutil.List {
return ethutil.NewList(eth.PastPeers())
}
func (self *UiLib) ImportTx(rlpTx string) {
tx := ethchain.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx))
self.eth.TxPool().QueueTransaction(tx)
tx := types.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx))
err := self.eth.TxPool().Add(tx)
if err != nil {
guilogger.Infoln("import tx failed ", err)
}
}
func (self *UiLib) EvalJavascriptFile(path string) {
@ -114,7 +168,7 @@ func (ui *UiLib) OpenBrowser() {
func (ui *UiLib) Muted(content string) {
component, err := ui.engine.LoadFile(ui.AssetPath("qml/muted.qml"))
if err != nil {
logger.Debugln(err)
guilogger.Debugln(err)
return
}
@ -146,7 +200,7 @@ func (ui *UiLib) AssetPath(p string) string {
func (self *UiLib) StartDbWithContractAndData(contractHash, data string) {
dbWindow := NewDebuggerWindow(self)
object := self.eth.StateManager().CurrentState().GetStateObject(ethutil.Hex2Bytes(contractHash))
object := self.eth.ChainManager().State().GetStateObject(ethutil.Hex2Bytes(contractHash))
if len(object.Code) > 0 {
dbWindow.SetCode("0x" + ethutil.Bytes2Hex(object.Code))
}
@ -167,30 +221,34 @@ func (self *UiLib) StartDebugger() {
dbWindow.Show()
}
func (self *UiLib) NewFilter(object map[string]interface{}) int {
filter, id := self.eth.InstallFilter(object)
filter.MessageCallback = func(messages ethstate.Messages) {
self.win.Root().Call("invokeFilterCallback", ethpipe.ToJSMessages(messages), id)
func (self *UiLib) NewFilter(object map[string]interface{}) (id int) {
filter := qt.NewFilterFromMap(object, self.eth)
filter.MessageCallback = func(messages state.Messages) {
self.win.Root().Call("invokeFilterCallback", xeth.ToJSMessages(messages), id)
}
id = self.eth.InstallFilter(filter)
return id
}
func (self *UiLib) NewFilterString(typ string) int {
filter, id := self.eth.InstallFilter(nil)
filter.BlockCallback = func(block *ethchain.Block) {
self.win.Root().Call("invokeFilterCallback", "{}", id)
func (self *UiLib) NewFilterString(typ string) (id int) {
filter := core.NewFilter(self.eth)
filter.BlockCallback = func(block *types.Block) {
if self.win != nil && self.win.Root() != nil {
self.win.Root().Call("invokeFilterCallback", "{}", id)
} else {
fmt.Println("QML is lagging")
}
}
id = self.eth.InstallFilter(filter)
return id
}
func (self *UiLib) Messages(id int) *ethutil.List {
filter := self.eth.GetFilter(id)
if filter != nil {
messages := filter.Find()
messages := xeth.ToJSMessages(filter.Find())
return ethpipe.ToJSMessages(messages)
return messages
}
return ethutil.EmptyList()
@ -240,7 +298,6 @@ func mapToTxParams(object map[string]interface{}) map[string]string {
dataStr += str
}
object["data"] = dataStr
fmt.Println(object)
conv := make(map[string]string)
for key, value := range object {
@ -252,10 +309,10 @@ func mapToTxParams(object map[string]interface{}) map[string]string {
return conv
}
func (self *UiLib) Transact(params map[string]interface{}) (*ethpipe.JSReceipt, error) {
func (self *UiLib) Transact(params map[string]interface{}) (string, error) {
object := mapToTxParams(params)
return self.JSPipe.Transact(
return self.JSXEth.Transact(
object["from"],
object["to"],
object["value"],
@ -277,7 +334,7 @@ func (self *UiLib) Compile(code string) (string, error) {
func (self *UiLib) Call(params map[string]interface{}) (string, error) {
object := mapToTxParams(params)
return self.JSPipe.Execute(
return self.JSXEth.Execute(
object["to"],
object["value"],
object["gas"],
@ -285,3 +342,33 @@ func (self *UiLib) Call(params map[string]interface{}) (string, error) {
object["data"],
)
}
func (self *UiLib) AddLocalTransaction(to, data, gas, gasPrice, value string) int {
return self.miner.AddLocalTx(&miner.LocalTx{
To: ethutil.Hex2Bytes(to),
Data: ethutil.Hex2Bytes(data),
Gas: gas,
GasPrice: gasPrice,
Value: value,
}) - 1
}
func (self *UiLib) RemoveLocalTransaction(id int) {
self.miner.RemoveLocalTx(id)
}
func (self *UiLib) SetGasPrice(price string) {
self.miner.MinAcceptedGasPrice = ethutil.Big(price)
}
func (self *UiLib) ToggleMining() bool {
if !self.miner.Mining() {
self.miner.Start()
return true
} else {
self.miner.Stop()
return false
}
}

40
cmd/peerserver/main.go Normal file
View File

@ -0,0 +1,40 @@
package main
import (
"crypto/elliptic"
"fmt"
"log"
"net"
"os"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/p2p"
)
func main() {
logger.AddLogSystem(logger.NewStdLogSystem(os.Stdout, log.LstdFlags, logger.InfoLevel))
key, _ := crypto.GenerateKey()
marshaled := elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y)
srv := p2p.Server{
MaxPeers: 10,
Identity: p2p.NewSimpleClientIdentity("Ethereum(G)", "0.1", "Peer Server Two", string(marshaled)),
ListenAddr: ":30301",
NAT: p2p.UPNP(),
}
if err := srv.Start(); err != nil {
fmt.Println("could not start server:", err)
os.Exit(1)
}
// add seed peers
seed, err := net.ResolveTCPAddr("tcp", "poc-7.ethdev.com:30300")
if err != nil {
fmt.Println("couldn't resolve:", err)
os.Exit(1)
}
srv.SuggestPeer(seed.IP, seed.Port, nil)
select {}
}

View File

@ -13,18 +13,18 @@ import (
"time"
"bitbucket.org/kardianos/osext"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethminer"
"github.com/ethereum/eth-go/ethpipe"
"github.com/ethereum/eth-go/ethrpc"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/wire"
"github.com/ethereum/go-ethereum/xeth"
)
var logger = ethlog.NewLogger("CLI")
var clilogger = logger.NewLogger("CLI")
var interruptCallbacks = []func(os.Signal){}
// Register interrupt handlers callbacks
@ -38,7 +38,7 @@ func HandleInterrupt() {
go func() {
signal.Notify(c, os.Interrupt)
for sig := range c {
logger.Errorf("Shutting down (%v) ... \n", sig)
clilogger.Errorf("Shutting down (%v) ... \n", sig)
RunInterruptCallbacks(sig)
}
}()
@ -100,7 +100,7 @@ func InitDataDir(Datadir string) {
}
}
func InitLogging(Datadir string, LogFile string, LogLevel int, DebugFile string) ethlog.LogSystem {
func InitLogging(Datadir string, LogFile string, LogLevel int, DebugFile string) logger.LogSystem {
var writer io.Writer
if LogFile == "" {
writer = os.Stdout
@ -108,28 +108,31 @@ func InitLogging(Datadir string, LogFile string, LogLevel int, DebugFile string)
writer = openLogFile(Datadir, LogFile)
}
sys := ethlog.NewStdLogSystem(writer, log.LstdFlags, ethlog.LogLevel(LogLevel))
ethlog.AddLogSystem(sys)
sys := logger.NewStdLogSystem(writer, log.LstdFlags, logger.LogLevel(LogLevel))
logger.AddLogSystem(sys)
if DebugFile != "" {
writer = openLogFile(Datadir, DebugFile)
ethlog.AddLogSystem(ethlog.NewStdLogSystem(writer, log.LstdFlags, ethlog.DebugLevel))
logger.AddLogSystem(logger.NewStdLogSystem(writer, log.LstdFlags, logger.DebugLevel))
}
return sys
}
func InitConfig(ConfigFile string, Datadir string, EnvPrefix string) *ethutil.ConfigManager {
func InitConfig(vmType int, ConfigFile string, Datadir string, EnvPrefix string) *ethutil.ConfigManager {
InitDataDir(Datadir)
return ethutil.ReadConfig(ConfigFile, Datadir, EnvPrefix)
cfg := ethutil.ReadConfig(ConfigFile, Datadir, EnvPrefix)
cfg.VmType = vmType
return cfg
}
func exit(err error) {
status := 0
if err != nil {
logger.Errorln("Fatal: ", err)
clilogger.Errorln("Fatal: ", err)
status = 1
}
ethlog.Flush()
logger.Flush()
os.Exit(status)
}
@ -141,15 +144,14 @@ func NewDatabase() ethutil.Database {
return db
}
func NewClientIdentity(clientIdentifier, version, customIdentifier string) *ethwire.SimpleClientIdentity {
logger.Infoln("identity created")
return ethwire.NewSimpleClientIdentity(clientIdentifier, version, customIdentifier)
func NewClientIdentity(clientIdentifier, version, customIdentifier string) *wire.SimpleClientIdentity {
return wire.NewSimpleClientIdentity(clientIdentifier, version, customIdentifier)
}
func NewEthereum(db ethutil.Database, clientIdentity ethwire.ClientIdentity, keyManager *ethcrypto.KeyManager, usePnp bool, OutboundPort string, MaxPeer int) *eth.Ethereum {
func NewEthereum(db ethutil.Database, clientIdentity wire.ClientIdentity, keyManager *crypto.KeyManager, usePnp bool, OutboundPort string, MaxPeer int) *eth.Ethereum {
ethereum, err := eth.New(db, clientIdentity, keyManager, eth.CapDefault, usePnp)
if err != nil {
logger.Fatalln("eth start err:", err)
clilogger.Fatalln("eth start err:", err)
}
ethereum.Port = OutboundPort
ethereum.MaxPeers = MaxPeer
@ -157,26 +159,26 @@ func NewEthereum(db ethutil.Database, clientIdentity ethwire.ClientIdentity, key
}
func StartEthereum(ethereum *eth.Ethereum, UseSeed bool) {
logger.Infof("Starting %s", ethereum.ClientIdentity())
clilogger.Infof("Starting %s", ethereum.ClientIdentity())
ethereum.Start(UseSeed)
RegisterInterrupt(func(sig os.Signal) {
ethereum.Stop()
ethlog.Flush()
logger.Flush()
})
}
func ShowGenesis(ethereum *eth.Ethereum) {
logger.Infoln(ethereum.BlockChain().Genesis())
clilogger.Infoln(ethereum.ChainManager().Genesis())
exit(nil)
}
func NewKeyManager(KeyStore string, Datadir string, db ethutil.Database) *ethcrypto.KeyManager {
var keyManager *ethcrypto.KeyManager
func NewKeyManager(KeyStore string, Datadir string, db ethutil.Database) *crypto.KeyManager {
var keyManager *crypto.KeyManager
switch {
case KeyStore == "db":
keyManager = ethcrypto.NewDBKeyManager(db)
keyManager = crypto.NewDBKeyManager(db)
case KeyStore == "file":
keyManager = ethcrypto.NewFileKeyManager(Datadir)
keyManager = crypto.NewFileKeyManager(Datadir)
default:
exit(fmt.Errorf("unknown keystore type: %s", KeyStore))
}
@ -189,7 +191,7 @@ func DefaultAssetPath() string {
// assume a debug build and use the source directory as
// asset directory.
pwd, _ := os.Getwd()
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "mist") {
if pwd == path.Join(os.Getenv("GOPATH"), "src", "github.com", "ethereum", "go-ethereum", "cmd", "mist") {
assetPath = path.Join(pwd, "assets")
} else {
switch runtime.GOOS {
@ -208,7 +210,7 @@ func DefaultAssetPath() string {
return assetPath
}
func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) {
func KeyTasks(keyManager *crypto.KeyManager, KeyRing string, GenAddr bool, SecretFile string, ExportDir string, NonInteractive bool) {
var err error
switch {
@ -237,22 +239,23 @@ func KeyTasks(keyManager *ethcrypto.KeyManager, KeyRing string, GenAddr bool, Se
exit(err)
}
}
clilogger.Infof("Main address %x\n", keyManager.Address())
}
func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
var err error
ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpipe.NewJSPipe(ethereum), RpcPort)
ethereum.RpcServer, err = rpc.NewJsonRpcServer(xeth.NewJSXEth(ethereum), RpcPort)
if err != nil {
logger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err)
clilogger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err)
} else {
go ethereum.RpcServer.Start()
}
}
var miner *ethminer.Miner
var gminer *miner.Miner
func GetMiner() *ethminer.Miner {
return miner
func GetMiner() *miner.Miner {
return gminer
}
func StartMining(ethereum *eth.Ethereum) bool {
@ -261,16 +264,16 @@ func StartMining(ethereum *eth.Ethereum) bool {
addr := ethereum.KeyManager().Address()
go func() {
logger.Infoln("Start mining")
if miner == nil {
miner = ethminer.NewDefaultMiner(addr, ethereum)
clilogger.Infoln("Start mining")
if gminer == nil {
gminer = miner.New(addr, ethereum)
}
// Give it some time to connect with peers
time.Sleep(3 * time.Second)
for !ethereum.IsUpToDate() {
time.Sleep(5 * time.Second)
}
miner.Start()
gminer.Start()
}()
RegisterInterrupt(func(os.Signal) {
StopMining(ethereum)
@ -294,9 +297,9 @@ func FormatTransactionData(data string) []byte {
}
func StopMining(ethereum *eth.Ethereum) bool {
if ethereum.Mining && miner != nil {
miner.Stop()
logger.Infoln("Stopped mining")
if ethereum.Mining && gminer != nil {
gminer.Stop()
clilogger.Infoln("Stopped mining")
ethereum.Mining = false
return true
@ -307,14 +310,14 @@ func StopMining(ethereum *eth.Ethereum) bool {
// Replay block
func BlockDo(ethereum *eth.Ethereum, hash []byte) error {
block := ethereum.BlockChain().GetBlock(hash)
block := ethereum.ChainManager().GetBlock(hash)
if block == nil {
return fmt.Errorf("unknown block %x", hash)
}
parent := ethereum.BlockChain().GetBlock(block.PrevHash)
parent := ethereum.ChainManager().GetBlock(block.PrevHash)
_, err := ethereum.StateManager().ApplyDiff(parent.State(), parent, block)
_, err := ethereum.BlockManager().TransitionState(parent.State(), parent, block)
if err != nil {
return err
}

70
cmd/utils/vm_env.go Normal file
View File

@ -0,0 +1,70 @@
package utils
import (
"math/big"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
type VMEnv struct {
state *state.StateDB
block *types.Block
transactor []byte
value *big.Int
depth int
Gas *big.Int
}
func NewEnv(state *state.StateDB, block *types.Block, transactor []byte, value *big.Int) *VMEnv {
return &VMEnv{
state: state,
block: block,
transactor: transactor,
value: value,
}
}
func (self *VMEnv) Origin() []byte { return self.transactor }
func (self *VMEnv) BlockNumber() *big.Int { return self.block.Number }
func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash }
func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase }
func (self *VMEnv) Time() int64 { return self.block.Time }
func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty }
func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
func (self *VMEnv) Value() *big.Int { return self.value }
func (self *VMEnv) State() *state.StateDB { return self.state }
func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
func (self *VMEnv) Depth() int { return self.depth }
func (self *VMEnv) SetDepth(i int) { self.depth = i }
func (self *VMEnv) AddLog(log state.Log) {
self.state.AddLog(log)
}
func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error {
return vm.Transfer(from, to, amount)
}
func (self *VMEnv) vm(addr, data []byte, gas, price, value *big.Int) *core.Execution {
return core.NewExecution(self, addr, data, gas, price, value)
}
func (self *VMEnv) Call(caller vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) {
exe := self.vm(addr, data, gas, price, value)
ret, err := exe.Call(addr, caller)
self.Gas = exe.Gas
return ret, err
}
func (self *VMEnv) CallCode(caller vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error) {
exe := self.vm(caller.Address(), data, gas, price, value)
return exe.Call(addr, caller)
}
func (self *VMEnv) Create(caller vm.ClosureRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error, vm.ClosureRef) {
exe := self.vm(addr, data, gas, price, value)
return exe.Create(caller)
}

161
cmd/utils/websockets.go Normal file
View File

@ -0,0 +1,161 @@
package utils
import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/websocket"
"github.com/ethereum/go-ethereum/xeth"
)
func args(v ...interface{}) []interface{} {
return v
}
type WebSocketServer struct {
ethereum *eth.Ethereum
filterCallbacks map[int][]int
}
func NewWebSocketServer(eth *eth.Ethereum) *WebSocketServer {
return &WebSocketServer{eth, make(map[int][]int)}
}
func (self *WebSocketServer) Serv() {
pipe := xeth.NewJSXEth(self.ethereum)
wsServ := websocket.NewServer("/eth", ":40404")
wsServ.MessageFunc(func(c *websocket.Client, msg *websocket.Message) {
switch msg.Call {
case "compile":
data := ethutil.NewValue(msg.Args)
bcode, err := ethutil.Compile(data.Get(0).Str(), false)
if err != nil {
c.Write(args(nil, err.Error()), msg.Seed)
}
code := ethutil.Bytes2Hex(bcode)
c.Write(args(code, nil), msg.Seed)
case "getBlockByNumber":
args := msg.Arguments()
block := pipe.BlockByNumber(int32(args.Get(0).Uint()))
c.Write(block, msg.Seed)
case "getKey":
c.Write(pipe.Key().PrivateKey, msg.Seed)
case "transact":
if mp, ok := msg.Args[0].(map[string]interface{}); ok {
object := mapToTxParams(mp)
c.Write(
args(pipe.Transact(object["from"], object["to"], object["value"], object["gas"], object["gasPrice"], object["data"])),
msg.Seed,
)
}
case "getCoinBase":
c.Write(pipe.CoinBase(), msg.Seed)
case "getIsListening":
c.Write(pipe.IsListening(), msg.Seed)
case "getIsMining":
c.Write(pipe.IsMining(), msg.Seed)
case "getPeerCoint":
c.Write(pipe.PeerCount(), msg.Seed)
case "getCountAt":
args := msg.Arguments()
c.Write(pipe.TxCountAt(args.Get(0).Str()), msg.Seed)
case "getCodeAt":
args := msg.Arguments()
c.Write(len(pipe.CodeAt(args.Get(0).Str())), msg.Seed)
case "getBlockByHash":
args := msg.Arguments()
c.Write(pipe.BlockByHash(args.Get(0).Str()), msg.Seed)
case "getStorageAt":
args := msg.Arguments()
c.Write(pipe.StorageAt(args.Get(0).Str(), args.Get(1).Str()), msg.Seed)
case "getBalanceAt":
args := msg.Arguments()
c.Write(pipe.BalanceAt(args.Get(0).Str()), msg.Seed)
case "getSecretToAddress":
args := msg.Arguments()
c.Write(pipe.SecretToAddress(args.Get(0).Str()), msg.Seed)
case "newFilter":
case "newFilterString":
case "messages":
// TODO
}
})
wsServ.Listen()
}
func StartWebSockets(eth *eth.Ethereum) {
sock := NewWebSocketServer(eth)
go sock.Serv()
}
// TODO This is starting to become a generic method. Move to utils
func mapToTxParams(object map[string]interface{}) map[string]string {
// Default values
if object["from"] == nil {
object["from"] = ""
}
if object["to"] == nil {
object["to"] = ""
}
if object["value"] == nil {
object["value"] = ""
}
if object["gas"] == nil {
object["gas"] = ""
}
if object["gasPrice"] == nil {
object["gasPrice"] = ""
}
var dataStr string
var data []string
if str, ok := object["data"].(string); ok {
data = []string{str}
}
for _, str := range data {
if ethutil.IsHex(str) {
str = str[2:]
if len(str) != 64 {
str = ethutil.LeftPadString(str, 64)
}
} else {
str = ethutil.Bytes2Hex(ethutil.LeftPadBytes(ethutil.Big(str).Bytes(), 32))
}
dataStr += str
}
object["data"] = dataStr
conv := make(map[string]string)
for key, value := range object {
if v, ok := value.(string); ok {
conv[key] = v
}
}
return conv
}

View File

@ -0,0 +1,84 @@
package rle
import (
"bytes"
"errors"
"github.com/ethereum/go-ethereum/crypto"
)
const (
token byte = 0xfe
emptyShaToken = 0xfd
emptyListShaToken = 0xfe
tokenToken = 0xff
)
var empty = crypto.Sha3([]byte(""))
var emptyList = crypto.Sha3([]byte{0x80})
func Decompress(dat []byte) ([]byte, error) {
buf := new(bytes.Buffer)
for i := 0; i < len(dat); i++ {
if dat[i] == token {
if i+1 < len(dat) {
switch dat[i+1] {
case emptyShaToken:
buf.Write(empty)
case emptyListShaToken:
buf.Write(emptyList)
case tokenToken:
buf.WriteByte(token)
default:
buf.Write(make([]byte, int(dat[i+1]-2)))
}
i++
} else {
return nil, errors.New("error reading bytes. token encountered without proceeding bytes")
}
} else {
buf.WriteByte(dat[i])
}
}
return buf.Bytes(), nil
}
func compressChunk(dat []byte) (ret []byte, n int) {
switch {
case dat[0] == token:
return []byte{token, tokenToken}, 1
case len(dat) > 1 && dat[0] == 0x0 && dat[1] == 0x0:
j := 0
for j <= 254 && j < len(dat) {
if dat[j] != 0 {
break
}
j++
}
return []byte{token, byte(j + 2)}, j
case len(dat) >= 32:
if dat[0] == empty[0] && bytes.Compare(dat[:32], empty) == 0 {
return []byte{token, emptyShaToken}, 32
} else if dat[0] == emptyList[0] && bytes.Compare(dat[:32], emptyList) == 0 {
return []byte{token, emptyListShaToken}, 32
}
fallthrough
default:
return dat[:1], 1
}
}
func Compress(dat []byte) []byte {
buf := new(bytes.Buffer)
i := 0
for i < len(dat) {
b, n := compressChunk(dat[i:])
buf.Write(b)
i += n
}
return buf.Bytes()
}

View File

@ -0,0 +1,118 @@
package rle
import (
"testing"
checker "gopkg.in/check.v1"
)
func Test(t *testing.T) { checker.TestingT(t) }
type CompressionRleSuite struct{}
var _ = checker.Suite(&CompressionRleSuite{})
func (s *CompressionRleSuite) TestDecompressSimple(c *checker.C) {
exp := []byte{0xc5, 0xd2, 0x46, 0x1, 0x86, 0xf7, 0x23, 0x3c, 0x92, 0x7e, 0x7d, 0xb2, 0xdc, 0xc7, 0x3, 0xc0, 0xe5, 0x0, 0xb6, 0x53, 0xca, 0x82, 0x27, 0x3b, 0x7b, 0xfa, 0xd8, 0x4, 0x5d, 0x85, 0xa4, 0x70}
res, err := Decompress([]byte{token, 0xfd})
c.Assert(err, checker.IsNil)
c.Assert(res, checker.DeepEquals, exp)
// if bytes.Compare(res, exp) != 0 {
// t.Error("empty sha3", res)
// }
exp = []byte{0x56, 0xe8, 0x1f, 0x17, 0x1b, 0xcc, 0x55, 0xa6, 0xff, 0x83, 0x45, 0xe6, 0x92, 0xc0, 0xf8, 0x6e, 0x5b, 0x48, 0xe0, 0x1b, 0x99, 0x6c, 0xad, 0xc0, 0x1, 0x62, 0x2f, 0xb5, 0xe3, 0x63, 0xb4, 0x21}
res, err = Decompress([]byte{token, 0xfe})
c.Assert(err, checker.IsNil)
c.Assert(res, checker.DeepEquals, exp)
// if bytes.Compare(res, exp) != 0 {
// t.Error("0x80 sha3", res)
// }
res, err = Decompress([]byte{token, 0xff})
c.Assert(err, checker.IsNil)
c.Assert(res, checker.DeepEquals, []byte{token})
// if bytes.Compare(res, []byte{token}) != 0 {
// t.Error("token", res)
// }
res, err = Decompress([]byte{token, 12})
c.Assert(err, checker.IsNil)
c.Assert(res, checker.DeepEquals, make([]byte, 10))
// if bytes.Compare(res, make([]byte, 10)) != 0 {
// t.Error("10 * zero", res)
// }
}
// func TestDecompressMulti(t *testing.T) {
// res, err := Decompress([]byte{token, 0xfd, token, 0xfe, token, 12})
// if err != nil {
// t.Error(err)
// }
// var exp []byte
// exp = append(exp, crypto.Sha3([]byte(""))...)
// exp = append(exp, crypto.Sha3([]byte{0x80})...)
// exp = append(exp, make([]byte, 10)...)
// if bytes.Compare(res, res) != 0 {
// t.Error("Expected", exp, "result", res)
// }
// }
// func TestCompressSimple(t *testing.T) {
// res := Compress([]byte{0, 0, 0, 0, 0})
// if bytes.Compare(res, []byte{token, 7}) != 0 {
// t.Error("5 * zero", res)
// }
// res = Compress(crypto.Sha3([]byte("")))
// if bytes.Compare(res, []byte{token, emptyShaToken}) != 0 {
// t.Error("empty sha", res)
// }
// res = Compress(crypto.Sha3([]byte{0x80}))
// if bytes.Compare(res, []byte{token, emptyListShaToken}) != 0 {
// t.Error("empty list sha", res)
// }
// res = Compress([]byte{token})
// if bytes.Compare(res, []byte{token, tokenToken}) != 0 {
// t.Error("token", res)
// }
// }
// func TestCompressMulti(t *testing.T) {
// in := []byte{0, 0, 0, 0, 0}
// in = append(in, crypto.Sha3([]byte(""))...)
// in = append(in, crypto.Sha3([]byte{0x80})...)
// in = append(in, token)
// res := Compress(in)
// exp := []byte{token, 7, token, emptyShaToken, token, emptyListShaToken, token, tokenToken}
// if bytes.Compare(res, exp) != 0 {
// t.Error("expected", exp, "got", res)
// }
// }
// func TestCompressDecompress(t *testing.T) {
// var in []byte
// for i := 0; i < 20; i++ {
// in = append(in, []byte{0, 0, 0, 0, 0}...)
// in = append(in, crypto.Sha3([]byte(""))...)
// in = append(in, crypto.Sha3([]byte{0x80})...)
// in = append(in, []byte{123, 2, 19, 89, 245, 254, 255, token, 98, 233}...)
// in = append(in, token)
// }
// c := Compress(in)
// d, err := Decompress(c)
// if err != nil {
// t.Error(err)
// }
// if bytes.Compare(d, in) != 0 {
// t.Error("multi failed\n", d, "\n", in)
// }
// }

12
core/.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
/tmp
*/**/*un~
*un~
.DS_Store
*/**/.DS_Store

50
core/asm.go Normal file
View File

@ -0,0 +1,50 @@
package core
import (
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/vm"
)
func Disassemble(script []byte) (asm []string) {
pc := new(big.Int)
for {
if pc.Cmp(big.NewInt(int64(len(script)))) >= 0 {
return
}
// Get the memory location of pc
val := script[pc.Int64()]
// Get the opcode (it must be an opcode!)
op := vm.OpCode(val)
asm = append(asm, fmt.Sprintf("%04v: %v", pc, op))
switch op {
case vm.PUSH1, vm.PUSH2, vm.PUSH3, vm.PUSH4, vm.PUSH5, vm.PUSH6, vm.PUSH7, vm.PUSH8,
vm.PUSH9, vm.PUSH10, vm.PUSH11, vm.PUSH12, vm.PUSH13, vm.PUSH14, vm.PUSH15,
vm.PUSH16, vm.PUSH17, vm.PUSH18, vm.PUSH19, vm.PUSH20, vm.PUSH21, vm.PUSH22,
vm.PUSH23, vm.PUSH24, vm.PUSH25, vm.PUSH26, vm.PUSH27, vm.PUSH28, vm.PUSH29,
vm.PUSH30, vm.PUSH31, vm.PUSH32:
pc.Add(pc, ethutil.Big1)
a := int64(op) - int64(vm.PUSH1) + 1
if int(pc.Int64()+a) > len(script) {
return
}
data := script[pc.Int64() : pc.Int64()+a]
if len(data) == 0 {
data = []byte{0}
}
asm = append(asm, fmt.Sprintf("%04v: 0x%x", pc, data))
pc.Add(pc, big.NewInt(a-1))
}
pc.Add(pc, ethutil.Big1)
}
return asm
}

371
core/block_manager.go Normal file
View File

@ -0,0 +1,371 @@
package core
import (
"bytes"
"container/list"
"errors"
"fmt"
"math/big"
"sync"
"time"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/pow/ezp"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/wire"
)
var statelogger = logger.NewLogger("BLOCK")
type Peer interface {
Inbound() bool
LastSend() time.Time
LastPong() int64
Host() []byte
Port() uint16
Version() string
PingTime() string
Connected() *int32
Caps() *ethutil.Value
}
type EthManager interface {
BlockManager() *BlockManager
ChainManager() *ChainManager
TxPool() *TxPool
Broadcast(msgType wire.MsgType, data []interface{})
PeerCount() int
IsMining() bool
IsListening() bool
Peers() *list.List
KeyManager() *crypto.KeyManager
ClientIdentity() wire.ClientIdentity
Db() ethutil.Database
EventMux() *event.TypeMux
}
type BlockManager struct {
// Mutex for locking the block processor. Blocks can only be handled one at a time
mutex sync.Mutex
// Canonical block chain
bc *ChainManager
// non-persistent key/value memory storage
mem map[string]*big.Int
// Proof of work used for validating
Pow pow.PoW
txpool *TxPool
// The last attempted block is mainly used for debugging purposes
// This does not have to be a valid block and will be set during
// 'Process' & canonical validation.
lastAttemptedBlock *types.Block
events event.Subscription
eventMux *event.TypeMux
}
func NewBlockManager(txpool *TxPool, chainManager *ChainManager, eventMux *event.TypeMux) *BlockManager {
sm := &BlockManager{
mem: make(map[string]*big.Int),
Pow: ezp.New(),
bc: chainManager,
eventMux: eventMux,
txpool: txpool,
}
return sm
}
func (sm *BlockManager) TransitionState(statedb *state.StateDB, parent, block *types.Block) (receipts types.Receipts, err error) {
coinbase := statedb.GetOrNewStateObject(block.Coinbase)
coinbase.SetGasPool(block.CalcGasLimit(parent))
// Process the transactions on to current block
receipts, _, _, _, err = sm.ApplyTransactions(coinbase, statedb, block, block.Transactions(), false)
if err != nil {
return nil, err
}
return receipts, nil
}
func (self *BlockManager) ApplyTransactions(coinbase *state.StateObject, state *state.StateDB, block *types.Block, txs types.Transactions, transientProcess bool) (types.Receipts, types.Transactions, types.Transactions, types.Transactions, error) {
var (
receipts types.Receipts
handled, unhandled types.Transactions
erroneous types.Transactions
totalUsedGas = big.NewInt(0)
err error
cumulativeSum = new(big.Int)
)
done:
for i, tx := range txs {
// If we are mining this block and validating we want to set the logs back to 0
state.EmptyLogs()
txGas := new(big.Int).Set(tx.Gas())
cb := state.GetStateObject(coinbase.Address())
st := NewStateTransition(cb, tx, state, block)
_, err = st.TransitionState()
if err != nil {
switch {
case IsNonceErr(err):
err = nil // ignore error
continue
case IsGasLimitErr(err):
unhandled = txs[i:]
break done
default:
statelogger.Infoln(err)
erroneous = append(erroneous, tx)
err = nil
}
}
txGas.Sub(txGas, st.gas)
cumulativeSum.Add(cumulativeSum, new(big.Int).Mul(txGas, tx.GasPrice()))
// Update the state with pending changes
state.Update(txGas)
cumulative := new(big.Int).Set(totalUsedGas.Add(totalUsedGas, txGas))
receipt := types.NewReceipt(state.Root(), cumulative)
receipt.SetLogs(state.Logs())
receipt.Bloom = types.CreateBloom(types.Receipts{receipt})
chainlogger.Debugln(receipt)
// Notify all subscribers
if !transientProcess {
go self.eventMux.Post(TxPostEvent{tx})
}
receipts = append(receipts, receipt)
handled = append(handled, tx)
if ethutil.Config.Diff && ethutil.Config.DiffType == "all" {
state.CreateOutputForDiff()
}
}
block.Reward = cumulativeSum
block.GasUsed = totalUsedGas
return receipts, handled, unhandled, erroneous, err
}
func (sm *BlockManager) Process(block *types.Block) (td *big.Int, msgs state.Messages, err error) {
// Processing a blocks may never happen simultaneously
sm.mutex.Lock()
defer sm.mutex.Unlock()
if sm.bc.HasBlock(block.Hash()) {
return nil, nil, &KnownBlockError{block.Number, block.Hash()}
}
if !sm.bc.HasBlock(block.PrevHash) {
return nil, nil, ParentError(block.PrevHash)
}
parent := sm.bc.GetBlock(block.PrevHash)
return sm.ProcessWithParent(block, parent)
}
func (sm *BlockManager) ProcessWithParent(block, parent *types.Block) (td *big.Int, messages state.Messages, err error) {
sm.lastAttemptedBlock = block
state := parent.State().Copy()
// Defer the Undo on the Trie. If the block processing happened
// we don't want to undo but since undo only happens on dirty
// nodes this won't happen because Commit would have been called
// before that.
defer state.Reset()
// Block validation
if err = sm.ValidateBlock(block, parent); err != nil {
return
}
receipts, err := sm.TransitionState(state, parent, block)
if err != nil {
return
}
rbloom := types.CreateBloom(receipts)
if bytes.Compare(rbloom, block.LogsBloom) != 0 {
err = fmt.Errorf("unable to replicate block's bloom=%x", rbloom)
return
}
txSha := types.DeriveSha(block.Transactions())
if bytes.Compare(txSha, block.TxSha) != 0 {
err = fmt.Errorf("validating transaction root. received=%x got=%x", block.TxSha, txSha)
return
}
receiptSha := types.DeriveSha(receipts)
if bytes.Compare(receiptSha, block.ReceiptSha) != 0 {
//chainlogger.Debugf("validating receipt root. received=%x got=%x", block.ReceiptSha, receiptSha)
fmt.Printf("%x\n", ethutil.Encode(receipts))
err = fmt.Errorf("validating receipt root. received=%x got=%x", block.ReceiptSha, receiptSha)
return
}
if err = sm.AccumelateRewards(state, block, parent); err != nil {
return
}
state.Update(ethutil.Big0)
if !block.State().Cmp(state) {
err = fmt.Errorf("invalid merkle root. received=%x got=%x", block.Root(), state.Root())
return
}
// Calculate the new total difficulty and sync back to the db
if td, ok := sm.CalculateTD(block); ok {
// Sync the current block's state to the database and cancelling out the deferred Undo
state.Sync()
messages := state.Manifest().Messages
state.Manifest().Reset()
chainlogger.Infof("Processed block #%d (%x...)\n", block.Number, block.Hash()[0:4])
sm.txpool.RemoveSet(block.Transactions())
return td, messages, nil
} else {
return nil, nil, errors.New("total diff failed")
}
}
func (sm *BlockManager) CalculateTD(block *types.Block) (*big.Int, bool) {
uncleDiff := new(big.Int)
for _, uncle := range block.Uncles {
uncleDiff = uncleDiff.Add(uncleDiff, uncle.Difficulty)
}
// TD(genesis_block) = 0 and TD(B) = TD(B.parent) + sum(u.difficulty for u in B.uncles) + B.difficulty
td := new(big.Int)
td = td.Add(sm.bc.Td(), uncleDiff)
td = td.Add(td, block.Difficulty)
// The new TD will only be accepted if the new difficulty is
// is greater than the previous.
if td.Cmp(sm.bc.Td()) > 0 {
return td, true
}
return nil, false
}
// Validates the current block. Returns an error if the block was invalid,
// an uncle or anything that isn't on the current block chain.
// Validation validates easy over difficult (dagger takes longer time = difficult)
func (sm *BlockManager) ValidateBlock(block, parent *types.Block) error {
expd := CalcDifficulty(block, parent)
if expd.Cmp(block.Difficulty) < 0 {
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Difficulty, expd)
}
diff := block.Time - parent.Time
if diff < 0 {
return ValidationError("Block timestamp less then prev block %v (%v - %v)", diff, block.Time, sm.bc.CurrentBlock().Time)
}
/* XXX
// New blocks must be within the 15 minute range of the last block.
if diff > int64(15*time.Minute) {
return ValidationError("Block is too far in the future of last block (> 15 minutes)")
}
*/
// Verify the nonce of the block. Return an error if it's not valid
if !sm.Pow.Verify(block /*block.HashNoNonce(), block.Difficulty, block.Nonce*/) {
return ValidationError("Block's nonce is invalid (= %v)", ethutil.Bytes2Hex(block.Nonce))
}
return nil
}
func (sm *BlockManager) AccumelateRewards(statedb *state.StateDB, block, parent *types.Block) error {
reward := new(big.Int).Set(BlockReward)
knownUncles := ethutil.Set(parent.Uncles)
nonces := ethutil.NewSet(block.Nonce)
for _, uncle := range block.Uncles {
if nonces.Include(uncle.Nonce) {
// Error not unique
return UncleError("Uncle not unique")
}
uncleParent := sm.bc.GetBlock(uncle.PrevHash)
if uncleParent == nil {
return UncleError(fmt.Sprintf("Uncle's parent unknown (%x)", uncle.PrevHash[0:4]))
}
if uncleParent.Number.Cmp(new(big.Int).Sub(parent.Number, big.NewInt(6))) < 0 {
return UncleError("Uncle too old")
}
if knownUncles.Include(uncle.Hash()) {
return UncleError("Uncle in chain")
}
nonces.Insert(uncle.Nonce)
r := new(big.Int)
r.Mul(BlockReward, big.NewInt(15)).Div(r, big.NewInt(16))
uncleAccount := statedb.GetAccount(uncle.Coinbase)
uncleAccount.AddAmount(r)
reward.Add(reward, new(big.Int).Div(BlockReward, big.NewInt(32)))
}
// Get the account associated with the coinbase
account := statedb.GetAccount(block.Coinbase)
// Reward amount of ether to the coinbase address
account.AddAmount(reward)
statedb.Manifest().AddMessage(&state.Message{
To: block.Coinbase,
Input: nil,
Origin: nil,
Block: block.Hash(), Timestamp: block.Time, Coinbase: block.Coinbase, Number: block.Number,
Value: new(big.Int).Add(reward, block.Reward),
})
return nil
}
func (sm *BlockManager) GetMessages(block *types.Block) (messages []*state.Message, err error) {
if !sm.bc.HasBlock(block.PrevHash) {
return nil, ParentError(block.PrevHash)
}
sm.lastAttemptedBlock = block
var (
parent = sm.bc.GetBlock(block.PrevHash)
state = parent.State().Copy()
)
defer state.Reset()
sm.TransitionState(state, parent, block)
sm.AccumelateRewards(state, block, parent)
return state.Manifest().Messages, nil
}

355
core/chain_manager.go Normal file
View File

@ -0,0 +1,355 @@
package core
import (
"fmt"
"math/big"
"sync"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/state"
)
var chainlogger = logger.NewLogger("CHAIN")
func AddTestNetFunds(block *types.Block) {
for _, addr := range []string{
"51ba59315b3a95761d0863b05ccc7a7f54703d99",
"e4157b34ea9615cfbde6b4fda419828124b70c78",
"b9c015918bdaba24b4ff057a92a3873d6eb201be",
"6c386a4b26f73c802f34673f7248bb118f97424a",
"cd2a3d9f938e13cd947ec05abc7fe734df8dd826",
"2ef47100e0787b915105fd5e3f4ff6752079d5cb",
"e6716f9544a56c530d868e4bfbacb172315bdead",
"1a26338f0d905e295fccb71fa9ea849ffa12aaf4",
} {
codedAddr := ethutil.Hex2Bytes(addr)
account := block.State().GetAccount(codedAddr)
account.SetBalance(ethutil.Big("1606938044258990275541962092341162602522202993782792835301376")) //ethutil.BigPow(2, 200)
block.State().UpdateStateObject(account)
}
}
func CalcDifficulty(block, parent *types.Block) *big.Int {
diff := new(big.Int)
adjust := new(big.Int).Rsh(parent.Difficulty, 10)
if block.Time >= parent.Time+5 {
diff.Sub(parent.Difficulty, adjust)
} else {
diff.Add(parent.Difficulty, adjust)
}
return diff
}
type ChainManager struct {
//eth EthManager
processor types.BlockProcessor
eventMux *event.TypeMux
genesisBlock *types.Block
// Last known total difficulty
mu sync.RWMutex
td *big.Int
lastBlockNumber uint64
currentBlock *types.Block
lastBlockHash []byte
transState *state.StateDB
}
func (self *ChainManager) Td() *big.Int {
self.mu.RLock()
defer self.mu.RUnlock()
return self.td
}
func (self *ChainManager) LastBlockNumber() uint64 {
self.mu.RLock()
defer self.mu.RUnlock()
return self.lastBlockNumber
}
func (self *ChainManager) LastBlockHash() []byte {
self.mu.RLock()
defer self.mu.RUnlock()
return self.lastBlockHash
}
func (self *ChainManager) CurrentBlock() *types.Block {
self.mu.RLock()
defer self.mu.RUnlock()
return self.currentBlock
}
func NewChainManager(mux *event.TypeMux) *ChainManager {
bc := &ChainManager{}
bc.genesisBlock = types.NewBlockFromBytes(ethutil.Encode(Genesis))
bc.eventMux = mux
bc.setLastBlock()
bc.transState = bc.State().Copy()
return bc
}
func (self *ChainManager) SetProcessor(proc types.BlockProcessor) {
self.processor = proc
}
func (self *ChainManager) State() *state.StateDB {
return self.CurrentBlock().State()
}
func (self *ChainManager) TransState() *state.StateDB {
return self.transState
}
func (bc *ChainManager) setLastBlock() {
data, _ := ethutil.Config.Db.Get([]byte("LastBlock"))
if len(data) != 0 {
// Prep genesis
AddTestNetFunds(bc.genesisBlock)
block := types.NewBlockFromBytes(data)
bc.currentBlock = block
bc.lastBlockHash = block.Hash()
bc.lastBlockNumber = block.Number.Uint64()
// Set the last know difficulty (might be 0x0 as initial value, Genesis)
bc.td = ethutil.BigD(ethutil.Config.Db.LastKnownTD())
} else {
bc.Reset()
}
chainlogger.Infof("Last block (#%d) %x\n", bc.lastBlockNumber, bc.currentBlock.Hash())
}
// Block creation & chain handling
func (bc *ChainManager) NewBlock(coinbase []byte) *types.Block {
bc.mu.RLock()
defer bc.mu.RUnlock()
var root interface{}
hash := ZeroHash256
if bc.CurrentBlock != nil {
root = bc.currentBlock.Root()
hash = bc.lastBlockHash
}
block := types.CreateBlock(
root,
hash,
coinbase,
ethutil.BigPow(2, 32),
nil,
"")
parent := bc.currentBlock
if parent != nil {
block.Difficulty = CalcDifficulty(block, parent)
block.Number = new(big.Int).Add(bc.currentBlock.Number, ethutil.Big1)
block.GasLimit = block.CalcGasLimit(bc.currentBlock)
}
return block
}
func (bc *ChainManager) Reset() {
bc.mu.Lock()
defer bc.mu.Unlock()
AddTestNetFunds(bc.genesisBlock)
bc.genesisBlock.Trie().Sync()
// Prepare the genesis block
bc.write(bc.genesisBlock)
bc.insert(bc.genesisBlock)
bc.currentBlock = bc.genesisBlock
bc.setTotalDifficulty(ethutil.Big("0"))
// Set the last know difficulty (might be 0x0 as initial value, Genesis)
bc.td = ethutil.BigD(ethutil.Config.Db.LastKnownTD())
}
func (self *ChainManager) Export() []byte {
self.mu.RLock()
defer self.mu.RUnlock()
chainlogger.Infof("exporting %v blocks...\n", self.currentBlock.Number)
blocks := make([]*types.Block, int(self.currentBlock.Number.Int64())+1)
for block := self.currentBlock; block != nil; block = self.GetBlock(block.PrevHash) {
blocks[block.Number.Int64()] = block
}
return ethutil.Encode(blocks)
}
func (bc *ChainManager) insert(block *types.Block) {
encodedBlock := block.RlpEncode()
ethutil.Config.Db.Put([]byte("LastBlock"), encodedBlock)
bc.currentBlock = block
bc.lastBlockHash = block.Hash()
}
func (bc *ChainManager) write(block *types.Block) {
bc.writeBlockInfo(block)
encodedBlock := block.RlpEncode()
ethutil.Config.Db.Put(block.Hash(), encodedBlock)
}
// Accessors
func (bc *ChainManager) Genesis() *types.Block {
return bc.genesisBlock
}
// Block fetching methods
func (bc *ChainManager) HasBlock(hash []byte) bool {
data, _ := ethutil.Config.Db.Get(hash)
return len(data) != 0
}
func (self *ChainManager) GetChainHashesFromHash(hash []byte, max uint64) (chain [][]byte) {
block := self.GetBlock(hash)
if block == nil {
return
}
// XXX Could be optimised by using a different database which only holds hashes (i.e., linked list)
for i := uint64(0); i < max; i++ {
chain = append(chain, block.Hash())
if block.Number.Cmp(ethutil.Big0) <= 0 {
break
}
block = self.GetBlock(block.PrevHash)
}
return
}
func (self *ChainManager) GetBlock(hash []byte) *types.Block {
data, _ := ethutil.Config.Db.Get(hash)
if len(data) == 0 {
return nil
}
return types.NewBlockFromBytes(data)
}
func (self *ChainManager) GetBlockByNumber(num uint64) *types.Block {
self.mu.RLock()
defer self.mu.RUnlock()
block := self.currentBlock
for ; block != nil; block = self.GetBlock(block.PrevHash) {
if block.Number.Uint64() == num {
break
}
}
if block != nil && block.Number.Uint64() == 0 && num != 0 {
return nil
}
return block
}
func (bc *ChainManager) setTotalDifficulty(td *big.Int) {
ethutil.Config.Db.Put([]byte("LTD"), td.Bytes())
bc.td = td
}
func (self *ChainManager) CalcTotalDiff(block *types.Block) (*big.Int, error) {
parent := self.GetBlock(block.PrevHash)
if parent == nil {
return nil, fmt.Errorf("Unable to calculate total diff without known parent %x", block.PrevHash)
}
parentTd := parent.BlockInfo().TD
uncleDiff := new(big.Int)
for _, uncle := range block.Uncles {
uncleDiff = uncleDiff.Add(uncleDiff, uncle.Difficulty)
}
td := new(big.Int)
td = td.Add(parentTd, uncleDiff)
td = td.Add(td, block.Difficulty)
return td, nil
}
func (bc *ChainManager) BlockInfo(block *types.Block) types.BlockInfo {
bi := types.BlockInfo{}
data, _ := ethutil.Config.Db.Get(append(block.Hash(), []byte("Info")...))
bi.RlpDecode(data)
return bi
}
// Unexported method for writing extra non-essential block info to the db
func (bc *ChainManager) writeBlockInfo(block *types.Block) {
bc.lastBlockNumber++
bi := types.BlockInfo{Number: bc.lastBlockNumber, Hash: block.Hash(), Parent: block.PrevHash, TD: bc.td}
// For now we use the block hash with the words "info" appended as key
ethutil.Config.Db.Put(append(block.Hash(), []byte("Info")...), bi.RlpEncode())
}
func (bc *ChainManager) Stop() {
if bc.CurrentBlock != nil {
chainlogger.Infoln("Stopped")
}
}
func (self *ChainManager) InsertChain(chain types.Blocks) error {
for _, block := range chain {
td, messages, err := self.processor.Process(block)
if err != nil {
if IsKnownBlockErr(err) {
continue
}
chainlogger.Infof("block #%v process failed (%x)\n", block.Number, block.Hash()[:4])
chainlogger.Infoln(block)
chainlogger.Infoln(err)
return err
}
self.mu.Lock()
{
self.write(block)
if td.Cmp(self.td) > 0 {
if block.Number.Cmp(new(big.Int).Add(self.currentBlock.Number, ethutil.Big1)) < 0 {
chainlogger.Infof("Split detected. New head #%v (%x), was #%v (%x)\n", block.Number, block.Hash()[:4], self.currentBlock.Number, self.currentBlock.Hash()[:4])
}
self.setTotalDifficulty(td)
self.insert(block)
self.transState = self.currentBlock.State().Copy()
}
}
self.mu.Unlock()
self.eventMux.Post(NewBlockEvent{block})
self.eventMux.Post(messages)
}
return nil
}

Some files were not shown because too many files have changed in this diff Show More