67 Commits

Author SHA1 Message Date
Ori Newman
aa22480d5e [NOD-88] Add getTopHeaders rpc command (#242)
* [NOD-88] Add getTopHeaders rpc command

* [NOD-88] Fix gofmt error

* [NOD-88] Remove unnecessary variable

* [NOD-88] Remove GetTopHeaders from rpcSyncMgr
2019-04-04 11:06:19 +03:00
Evgeny Khirin
7c30bc4301 [NOD-64] Remove subnetwork id supports all (#237)
* [NOD-64] Intermediate commit: need check tests on master

* [NOD-64] Commit before changing subnetwork IDS to new values

* [NOD-64] Fixed tests after changing subnetworks IDs constants

* [NOD-64] Extract duplicate code into functions

* [NOD-64] Renamed IsAllSubnetworks ==> IncludeAllSubnetworks
2019-04-03 17:03:48 +03:00
Ori Newman
254eab96cd [NOD-55] Change daghash hash to pointer in most places (#239)
* [NOD-55] Change daghash.Hash to pointer in most places

* [NOD-55] Fixed format error

* [NOD-55] Fixed merge error

* [NOD-55] Cancel copying hash in blockSet.hashes()
2019-04-02 13:49:47 +03:00
Ori Newman
20e24e3a23 [NOD-83] modify blocks parents children only after validation (#235)
* [NOD-83] Modify block parents' children only after validation

* [NOD-83] Creating CheckConnectBlockTemplateWithLock with RLock

* [NOD-83] Put updateParentsChildren inside updateParents

* [NOD-83] create updateParentsDiffs function
2019-04-01 13:03:13 +03:00
Ori Newman
62d14bf2bd [NOD-16] implement initial sync first version (#234)
* [NOD-58] Replace lastBlock with selected tip in version message (#210)

* [NOD-58] Replace lastBlock with selected tip in version message

* [NOD-58] Fix typo in comment

* [NOD-58] Add mutex to SelectedTipHash

* [NOD-58] Remove redundant comment

* [NOD-58] Remove wantStartingHeight from peerStats

* [NOD-58] Remove lock from SelectedTipHash

* Nod 53 change getheaders message to handle new block locator (#213)

* [NOD-53] Change getheaders message to handle the new block locator mechanism

* [NOD-53] Use heap in locateHeaders

* [NOD-53] Create a constructor for each heap direction

* [NOD-57] Check if a node is synced only by timestamps (#214)

* [NOD-60] implement isSyncCandidate (#218)

* [NOD-60] Implement isSyncCandidate

* [NOD-60] Fix typo

* [NOD-65] Fix netsync related tests and remove fields optionality from… (#220)

* [NOD-65] Fix netsync related tests and remove fields optionality from msgversion

* [NOD-65] gofmt rpcserver.go

* [NOD-65] add missing test for verRelayTxFalse

* [NOD-62] Change getblocks message to handle the new block locator mechanism (#219)

* [NOD-62] Change getblocks message to handle the new block locator mechanism

* [NOD-62] Add locateBlockNodes function

* [NOD-68] Adjust orphan parents requesting for a DAG (#222)

* [NOD-68] Adjust orphan parents requesting for a DAG

* [NOD-68] add sendInvsFromRequestedQueue and trigger it when requested blocks slice is empty, or immediatly if we're not in sync mode

* [NOD-68] Prevent duplicates from entering to state.requestQueue and add wrapping locks to addBlocksToRequestQueue

* [NOD-68] Fix Lock -> Unlock in sendInvsFromRequestedQueue

* [NOD-74] Starts syncing again when the current sync peer is done (#225)

* [NOD-74] Starts syncing again when the current sync peer is done

* [NOD-74] Unlock mtx before netsync is restarted

* [NOD-74] Fix name isSyncPeerFree -> isWaitingForBlocks

* [NOD-75] fixing netsync bugs (#227)

* [NOD-74] Starts syncing again when the current sync peer is done

* [NOD-74] Unlock mtx before netsync is restarted

* [NOD-75] Fixing netsync bugs

* [NOD-80] Request block data from block propagation just after you are… (#231)

* [NOD-80] Request block data from block propagation just after you are current

* [NOD-80] Fix adding to both queues in addInvToRequestQueue

* [NOD-81] Start to mine on top of genesis iff all peers selected tip is genesis (#232)

* [NOD-81] Start to mine on top of genesis only if all of your peers' selected tip is genesis

* [NOD-81] Explain forAllPeers/forAllOutboundPeers shouldContinue behaviour in comments

* [NOD-81] Add forAllInboundPeers and add return values for forAllPeers/forAllOutboundPeers/forAllInboundPeers functions

* [NOD-16] Add pushSet to the BlockHeap type

* [NOD-16] Fixed syntax error
2019-03-31 16:47:28 +03:00
Evgeny Khirin
0a30837aac [NOD-56] Lower mining difficulty as preparation for devnet (#223)
* [NOD-56] Created devnet

* [NOD-56] Fixed tests

* [NOD-56] Fixed go vet errors

* [NOD-56] Added TestSolveGenesisBlock function

* [NOD-56] Created command line tool for solving genesis blocks
2019-03-24 10:30:52 +02:00
Svarog
e93e60aa74 [NOD-63] Merge BlockAccepted and BlockConnected notifications into BlockAdded + remove BlockDisconnected notifications (#221)
* [NOD-63] Merge BlockAccepted and BlockConnected notifications into BlockAdded + remove BlockDisconnected notifications

* [NOD-63] Many instances of chain->DAG and similar

* [NOD-63] Some more chian -> DAG
2019-03-20 13:48:32 +02:00
Svarog
a2b69a84f4 [NOD-48] Make wire.NewMsgTx recieve all paramaters that go into MsgTx, and compute what can be computed. (#216)
* [NOD-48] Update wire.NewMsgTx to recieve all fields in msgTx

* [NOD-48] Fix all compilation errors resulting from modification of wire.NewMsgTx

* [NOD-48] Calculate payloadHash iff subnetworkID is not native

* [NOD-48] Update all places the instantiate wire.MsgTx to use wire.NewMsgTx

* [NOD-48] Remove 'wire.' calls inside wire package

* [NOD-48] Made newMsgTx with all parameters private, and added a few public functions that take various arguments for all common use-cases

* [NOD-48] Explicitly pass SubnetworkIDNative instead of nil to newMsgTx

* [NOD-48] Remove option to pass nil to newMsgTx
2019-03-19 12:28:24 +02:00
Ori Newman
1da045d1b9 [NOD-30] move wire.RandomUint64() and binarySerializer to util (#204)
* [NOD-30] move wire.RandomUint64() and binarySerializer to util

* [NOD-30] change const style
2019-03-12 13:03:08 +02:00
Evgeny Khirin
b4f50f4e48 [Nod-25] Add payload hash to wire transaction (#200)
* [NOD-25] Intermediate commit

* [NOD-25] Fixed tests crashes

* [NOD-25] Fixed tests

* [NOD-25] Removed temporary debug code

* [NOD-25] Fixed error message
2019-03-12 10:48:57 +02:00
Ori Newman
1e447432a7 [NOD-28] Move subnetwork consts to subnetworkid package (#197)
* [NOD-28] Move SubnetworkID constants to subnetworkid package

* [NOD-28] change subnetwork id constants to pointers
2019-03-10 12:27:06 +02:00
Ori Newman
aa46c167c8 [NOD-46] Immediately associate received address to their subnetwork (#196)
* [NOD-46] Immediately associate received address to their subnetwork

* [NOD-46] fix comment

* [NOD-46] Disconnect peer if it sends an MsgAddr with no subnetwork

* [NOD-46] Disconnect peer if it sends an MsgAddr with incorrect subnetwork id

* [NOD-46] add parenthesis to condition

* [NOD-46] change order of conditions
2019-03-07 16:33:10 +02:00
Evgeny Khirin
45cffb4f69 Dev 363 add subnets to dns seeder (#190)
* [DEV-363] Added testnet seeders

* [DEV-363] Prepare BTCD to work with DNS seeder

* [DEV-363] Finished BTCD part of DNS seeder

* [DEV-363] Reverted protocol changes

* [DEV-363] Reverted protocol changes

* [DEV-363] Reverted protocol changes and fixed tests

* [DEV-363] Added tests and refactored

* [DEV-363] Small refactoring of p2p changes

* [DEV-363] Update NeedMoreAddresses function to take into account full peers + small refactoring

* [DEV-363] Removed IsDNSSeederPeer flag

* [DEV-363] Fixed comment
2019-03-05 13:11:10 +02:00
Svarog
41647fd488 [DEV-376] Changed any instance of %v in format strings with a more specific format token (#188)
* [DEV-376] Changed any instance of %v in format strings with a more specific format token

* [DEV-376] Fixed some more wrong formatting strings + removed redundant
cast

* [DEV-376] Added fmt.Sprintf where it was missing

* [DEV-376] use %s for util.Amount, to invoke .String()

* [DEV-376] Some more fixes in format strings

* [DEV-376] fixed mruinvmap_test to expect the correct behaviour
2019-02-20 14:02:52 +02:00
Ori Newman
b74dc9dfd1 [DEV-316] Update JSON-RPC API to include new transaction fields (#186)
* [DEV-316] Update JSON-RPC API to include new transaction fields

* [DEV-316] Fix tests

* [DEV-316] Add txAcceptedVerbose test with subnetwork, gas and paylaod
2019-02-14 15:19:44 +02:00
Ori Newman
fd5ca4ac1a [DEV-360] Allow only 1 wire protocol version (#183) 2019-02-12 13:16:35 +02:00
Ori Newman
0aa7c430e0 Dev 364 implement the dag fee structure (#181)
* [DEV-364] Add fee transactions validation

* [DEV-364] make NextBlockFeeTransactions for creating block templates

* [DEV-364] apply coinbase rules to fee transaction is some cases

* [DEV-364] Add comments

* [DEV-364] put getTXO as separate function

* [DEV-364] Make getParentsFeeData a separate function

* [DEV-364] fix calculateFees

* [DEV-364] force maximum sequence for fee transactions

* [DEV-364] add TestValidateFeeTransactions

* [DEV-364] change fee transaction to be one tx per block rather than one tx for each blue

* [DEV-364] fix tests

* [DEV-364] Use constants instead of inline numbers
2019-02-11 17:33:55 +02:00
Ori Newman
3a9c06afd2 [DEV-371] Allow zero outputs for transactions (#182) 2019-02-11 12:42:26 +02:00
Evgeny Khirin
3eeff11231 [DEV-317] Update JSON-RPC API call GetBlock to allow filtering by SubNetworkID (#180)
* [DEV-317] Update JSON-RPC API call GetBlock to allow filtering by SubNetworkID

* [DEV-317] Changed comments, messages and refactored code
2019-02-05 16:38:21 +02:00
Ori Newman
1e09d470f7 [DEV-336] Update peer package to accommodate partial nodes (#176)
* [DEV-336] Split addresses in address manager by subnetwork id

* [DEV-336] Load DAG with subnetwork from the config file

* [DEV-336] Remove redundant checks in updateAddrNew and updateAddrTried
2019-01-28 13:55:58 +02:00
Evgeny Khirin
100fbbaaa4 [DEV-361] Create type TxID as alias to daghash.Hash. (#175)
* [DEV-361] Create type TxID as alias to daghash.Hash. Use it for transaction IDs

* [DEV-361] Fixed missed renames

* [DEV-361] Removed usage of zeroHash

* [DEV-361] Fixed more missed renames
2019-01-27 14:27:10 +02:00
stasatdaglabs
9a2eee78a4 [DEV-319] Update WS-API call notifyNewTransactions to allow filtering by SubNetworkID (#174)
* [DEV-319] Implemented transaction data sending logic.

* [DEV-319] Implemented NotifyNewTransactions command validation.

* [DEV-319] Reduced some duplication in notifyForNewTx.

* [DEV-319] Renamed a parameter for clarity.

* [DEV-319] Added a test for marshalling/unmarshalling the new varient of notifyNewTransactions.

* [DEV-319] Added a check in handleNotifyNewTransactions to avoid unnecessary validation.

* [DEV-319] Added comments to explain the initialization of marshalledJSONVerboseFull and marshalledJSONVerbosePartial.
2019-01-24 18:18:03 +02:00
Svarog
9f93a1c50b [DEV-311] Enforce gas limit in blocks (#172)
* [DEV-311] Moved subnetwork storage from directly in DAG to subnetworkStore

* Added gas validation in CheckBlockSanity

* [DEV-311] Add SubnetworkStore to last remaining call for CheckBlockSanity

* [DEV-311] Added subnetworkID to config in TestcheckBlockSanity

* [DEV-311] Moved CheckBlockSanity to be method of BlockDAG, and removed subnetworkStore argument

* [DEV-311] Removed SubnetworkID as parameter to CheckBlockSanity

* [DEV-311] Update gas usage before

* [DEV-311] some chain=>DAG updates in comments

* [DEV-311] Removed remaining dag-specific parameters from checkBlockSanity
2019-01-24 17:25:11 +02:00
stasatdaglabs
349e62fcd5 [DEV-332] Create partial block message in wire and make sure partial nodes receive partial blocks (#170)
* [DEV-332] Added MerkleProof to MsgBlock and rejected full-node/partial-block type misbehaviors.

* [DEV-332] Fixed merge issues.

* [DEV-332] Got rid of MerkleProof. Turns out we no longer need it.

* [DEV-332] Got rid of NTBlockDisconnected, as no one was ever triggering it. (It was part of reorg)

* [DEV-332] Implemented clearing out the payloads of transactions of outgoing blocks for partial nodes.

* [DEV-332] Extracted ConvertToPartial to its own method. Added a test. Added a condition for converting to a partial block.

* [DEV-332] Fixed bad ConvertToPartial condition.
2019-01-23 14:51:05 +02:00
Ori Newman
b963c0d364
Dev 334 make id merkle root and transaction id, fix tests, and add new tests (#166)
* [DEV-329] Add TxID

* [DEV-329] Change Transaction inputs to reference by tx id instead of tx hash

* [DEV-329] Fix tests

* [DEV-329] change txhash to txid in mempool

* [DEV-334] Make IDMerkleRoot

* [DEV-329] Add txid that excludes payload, gas and ScriptSigs (#158)

* [DEV-329] Add TxID

* [DEV-329] Change Transaction inputs to reference by tx id instead of tx hash

* [DEV-329] Fix tests

* [DEV-329] change txhash to txid in mempool

* [DEV-329] replace thinEncoding bool with txEncoding bitmask

* [DEV-329] Change txencoding var names

* [DEV-329] change txEncodingexcludeSignatureScript -> txEncodingExcludeSignatureScript

* [DEV-334] Add IDMerkleRoot to blocknode and recalculate IDMerkleRoot when extraNonce is changed

* [DEV-334] Fix tests

* [DEV-334] Fix tests

* [DEV-334] fix SubnetworkDAGCoin -> SubnetworkIDNative

* [DEV-334] Add ID() function to Coin interface and rename hash to txID in a few places

* [DEV-334] Add Root method for merkle root

* [DEV-334] add comment to dag.SubnetworkID()

* [DEV-334] fix serializeSize comment
2019-01-23 14:04:23 +02:00
stasatdaglabs
4be23bff07 [DEV-348] Don't send transactions of wrong sub-network to partial peers, and reject messages of such (#164)
* [DEV-348] Removed a couple of unused methods.

* [DEV-348] Implemented validating incoming transactions for bad partial transactions.

* [DEV-348] Added a (incomplete) filter for propogation of transactions.

* [DEV-348] Implemented filtering inventory by subnetwork.

* [DEV-348] Fixed broken tests.

* [DEV-348] Added test for non-zero payload partial transactions.

* [DEV-348] Added a comment for Config.SubnetworkID.

* [DEV-348] Fixed formatting.

* [DEV-348] Renamed isRemoteTransactionFull to shouldTxBeFull.

* [DEV-348] Added a check for invalid transaction in maybeAcceptTransaction. Added handling for native networks.

* [DEV-348] Fixed formatting.

* [DEV-348] Fixed a bug in transaction validation.

* [DEV-348] Rephrased a comment.

* [DEV-348] Extracted subnetwork compatibility to a method. Wrote a test for it.

* [DEV-348] Removed an unnecessary check over the native subnetwork.
2019-01-22 13:56:40 +02:00
stasatdaglabs
f00651c4e3 [DEV-353] Rename subnetwork to subnetworkID everywhere in the code except for the command line flag (#165)
* [DEV-353] Renamed subnetwork -> subnetworkID.

* [DEV-353] Renamed dagcoin -> native.
2019-01-20 16:22:25 +02:00
stasatdaglabs
10ee7df252 [DEV-333] Update version message to include sub-network (#163)
* [DEV-333] Added subnetwork to local peer version message.

* [DEV-333] Fixed broken references.

* [DEV-333] Added serialization/deserialization of the version message.

* [DEV-333] Added rejection for peers with wrong subnetwork.

* [DEV-333] Fixed bad comment.

* [DEV-333] Renamed ChainParams to DAGParams.

* [DEV-333] Fixed partial nodes disconnecting from full nodes.

* [DEV-333] chain -> DAG

* [DEV-333] Possibly fixed outbound msgVersion rules.

* [DEV-333] Combined the two incompatible subnetwork cases into one if.

* [DEV-333] Reformatted the condition.
2019-01-15 16:25:56 +02:00
Svarog
e3994cddac [DEV-347] Normalize the way 'subnetwork' is capitalized (#161) 2019-01-13 18:00:34 +02:00
Ori Newman
0553f7e2e7 [DEV-342] change subnetworkid to hash160 (#154)
* [DEV-342] Make subnetworkid Hash160

* [DEV-342] Fix tests

* [DEV-342] Fix rpcserver.go mismatched types

* [DEV-342] Change subnetworkhash type and package to subnetworkid

* [DEV-342] Add subnetworkid package
2019-01-09 17:55:25 +02:00
stasatdaglabs
cc9b8da351 [DEV-355] Disable all mining-related API calls on partial nodes (#151)
* [DEV-355] Disallowed mining-related RPC commands from running on any sub-network besides the "all" sub-network.

* [DEV-335] Fixed formatting errors.

* [DEV-335] Fixed some more formatting errors.

* [DEV-335] Changed error type to ErrRPCInvalidRequest and rephrased the error message.

* [DEV-335] Fixed formatting.

* [DEV-335] Removed error from getGenerate.
2019-01-09 12:54:43 +02:00
Mike Zak
c45cef0ffe Typo fixes in comments 2018-12-24 16:19:51 +02:00
Ori Newman
45c212deb4 [DEV-257] Include transaction acceptance status in getBlock RPC call (#123)
* [DEV-257] Include transaction acceptance status in getBlock RPC call

* [DEV-257] change txRawResult-accepted to camel case

* [DEV-257] gofmt

* [DEV-257] change getBlock-acceptedtx help entry to getBlock-acceptedTx

* [DEV-257] delete TxRawResult.accepted and instead create TxRawResult.acceptedBy
2018-11-08 13:19:53 +02:00
Svarog
225f349e6a [DEV-81] 100% Database Coverage (#110)
* [DEV-81] Overwrite maxOpenFiles for testInterface to force tests to check the LRU-mechanism in openFile

* [DEV-81] Added database.UseLogger test

* [DEV-81] Completed coverage of reconcileDB()

* [DEV-81] Added some tests for dbcache

* [DEV-81] Moved init and UseLogger to separate file to make them more easily-testable + added tests

* [DEV-81] Added tests for deleteFile

* [DEV-81] Added tests to cursor.Delete + made sure it returns error when transaction is not writable

* [DEV-81] Moved database/error_test.go from database_test package to database package + added test for IsErrorCode

* [DEV-81] Added tests for handleRollback error-cases

* [DEV-81] Added tests for cursor.skipPendingUpdates

* [DEV-81] Added tests for various cursor edge-cases

* [DEV-81] tx.putKey no longer returns error, because there is no case when it does

* [DEV-81] Added tests to CreateBucket error cases

* [DEV-81] Added tests to bucket.Get and .Delete error cases + .Delete now returns error on empty key

* [DEV-81] Added test for ForEachBucket

* [DEV-81] Added tests to StoreBlock

* [DEV-81] Added test for deleting a double nested bucket

* [DEV-81] Removed log_test, as it is no longer necessary with the logging system re-design

* [DEV-81] Added test to some of writePendingAndCommit error-cases

* [DEV-81] Update references from btcutil to btcd/util

* [DEV-81] Add tests for dbCacheIterator{.Next(), .Prev(), .Key, .Value()} in cases when iterator is exhausted

* [DEV-81] Added tests for ldbIterator placeholder functions

* [DEV-81] Added test name to Error messsages in TestSkipPendingUpdates

* [DEV-81] Begin writing TestSkipPendingUpdatesCache

* [DEV-81] Added error-cases for DBCache.flush() and DBCache.commitTreaps()

* [DEV-81] Use monkey.patch from bou.ke and not from github

* [DEV-81] Rewrote IsErrorCode in both database and txscript packages to be more concise

* [DEV-81] Rename any database.Tx to dbTx instead of tx - to remove confusion with coin Tx

* [DEV-81] Fix typo

* [DEV-81] Use os.TempDir() instead of /tmp/ to be cross-platform

* [DEV-81] use SimNet for database tests + Error if testDB exists after deleting it

* [DEV-81] Removed useLogger - it's redundant

* [DEV-81] Added comment on how CRC32 checksums are calculated in reconcile_test.go

* [DEV-81] Added comment that explains what setWriteRow does

* [DEV-81] Use constant instead of hard-coded value

* [DEV-81] Fixed some typo's + better formatting
2018-11-06 18:18:42 +02:00
Mike Zak
46ac9a6320 Gofmt fixes 2018-11-06 15:45:00 +02:00
stasatdaglabs
8a234bf4a3 [DEV-242] Parameter names should be also camelCase in JSON-RPC (#118)
* [DEV-242] Modified some help functionality to convert to lowercase camel case instead of just lowercase.

* [DEV-242] Corrected help functionality for struct field names.

* [DEV-242] Corrected help functionality for struct names.

* [DEV-242] Cleaned up toLowercaseCamelCase.

* [DEV-242] Renamed toLowercaseCamelCase to toCamelCase.

* [DEV-242] Converted the rest of the stuff in rpcserverhelp.go to camelCase. Fixed a bug in the camelCase converter.

* [DEV-242] camelCase-ified the last few RPC parameter names.

* [DEV-242] Fixed an off-by-one bug in toCamelCase.

* [DEV-242] Changed back from "jsonRpc" to "jsonrpc".

* [DEV-242] Moved toCamelCase into utils, wrote unit tests for it, and fixed an off-by-one bug.

* [DEV-242] Re-exported DefaultHomeDir because it's required in windows_service.go.

* [DEV-242] Added a comment above DefaultHomeDir to satisfy golint.

* [DEV-242] Formatted config/config.go.
2018-11-05 18:50:55 +02:00
Ori Newman
7093155c3a [DEV-234] Add to txindex method to return the block in which tx was accepted (or indication it was not accepted) (#116)
* [DEV-234] add TxAcceptedInBlock and TxBlocks

* [DEV-234] test TxAcceptedInBlock and TxBlocks

* [DEV-234] test TxAcceptedInBlock and TxFirstBlockRegion

* [DEV-234] rename selectedPathSet to selectedPathChain

* [DEV-234] set indexers db as part of index manager initialization

* [DEV-234] remove redudant dag instance in txindex

* [DEV-234] fix TestTxIndexConnectBlock and add DAGParams as part of config in DAGSetup

* [DEV-234] TestTxIndexConnectBlock make K=1 to make calculations easier

* [DEV-234] rename TxAcceptingBlock to BlockThatAcceptedTx

* [DEV-234] update block fields names in txindex_test.go

* [DEV-234] rename selectedPathChain -> selectedPathChainSet
2018-11-05 16:11:54 +02:00
Ori Newman
9519b9f2a1 [DEV-211] Change fields of serialized blocks and transactions to match spec (#104)
* [DEV-211] change block fields

* [DEV-211] change block fields

* [DEV-211] change comments to adhere to the new block field names
2018-11-05 13:11:42 +02:00
Svarog
35546b62d0
[DEV-240] Style fixes to satisfy golint (#112)
* [DEV-240] Unexport BlockDAG/SelectedTip, since it returns unexported *blockNode

* [DEV-240] Fix blockdag package comment to satisfy golint

* [DEV-240] Add comment explaining blank import of ffldb in blockdag/test_utils.go

* [DEV-240] Add comment to FullUTXOSet.Get

* [DEV-240] Unexported config.DefaultHomeDir

* [DEV-240] Remove blank import of ffldb from config/config.go

* [DEV-240] Added comment to daghash.Strings()

* [DEV-240] Added missing comments in hdkeychain/extendedkey.go

* [DEV-240] Re-activate goline in CI Dockerfile

* [DEV-240] Fixed some typos in comments

* [DEV-240] Typo fix in comment
2018-11-05 12:58:17 +02:00
Ori Newman
78e8c6084c [DEV-238] Remove addrlocal from getPeerInfo RPC call (#117) 2018-11-04 10:09:39 +02:00
stasatdaglabs
3ace16ad23 [DEV-134] Implement Continuous Integration (#105)
* [DEV-134] Implement Continuous Integration

Squashed commit:

[5e41d830] Dev 223 fix txindex (#100)

* [DEV-201] In handleGetBlockDAGInfo calculate difficulty by the tip with the lowest bits

* [DEV-202] Move VirtualBlock.GetUTXOEntry to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-204] Unexport VirtualBlock() and add CalcMedianTime method for DAG

* [DEV-204] add explanation about difficulty in CurrentBits() comment

* [DEV-204] unexport VirtualBlock type

* [DEV-223] make applyUTXOChanges return pastUTXOResults

* [DEV-223] add bluestxdata for current block as well

* [DEV-223] re-design tx index

* [DEV-223] edit txindex comments

* [DEV-223] rename BluesTxData -> AcceptedTxData, and return from applyUTXOChanges only transactions that got accepted

* [DEV-223] add unit test for txindex

* [DEV-223] fix comments and unite blueTransaction and AcceptedTxData to one type

* [DEV-223] use bucket cursor for dbFetchFirstTxRegion

* [DEV-223] use the same cursor instance for dbFetchFirstTxRegion

* [DEV-223] write in dbFetchFirstTxRegion's comment that it returns the first block region

* [DEV-223] rename type BlueBlockTransaction to TxWithBlockHash

* [DEV-223] add named returned value for applyUTXOChanges

[4c95e293] [DEV-134] Made golint ignore the vendor directory.

[21736dbc] [DEV-134] Renamed ExampleBlockChain_ProcessBlock to ExampleBlockDAG_ProcessBlock to satisfy go vet.

[beea6486] [DEV-134] Removed pushing the built docker to a remove repository. That's unnecessary at this stage.

[bee911ed] [DEV-134] Made all precompilation checks run on everything instead of only the root dir.

[585f92ae] [DEV-134] Added "github.com/pkg/errors" to dep.

[5f02f570] [DEV-134] -vendor-only is written with only one hyphen.

[3eee7f95] [DEV-134] go vet instead of go tool vet.

[0c2d4343] [DEV-134] Split all the pre-compile checks to separate lines to be able to tell which of them is failing.

[780519c8] [DEV-134] Ran gofmt on everything.

[8247146b] Dev 223 fix txindex (#100)

* [DEV-201] In handleGetBlockDAGInfo calculate difficulty by the tip with the lowest bits

* [DEV-202] Move VirtualBlock.GetUTXOEntry to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-204] Unexport VirtualBlock() and add CalcMedianTime method for DAG

* [DEV-204] add explanation about difficulty in CurrentBits() comment

* [DEV-204] unexport VirtualBlock type

* [DEV-223] make applyUTXOChanges return pastUTXOResults

* [DEV-223] add bluestxdata for current block as well

* [DEV-223] re-design tx index

* [DEV-223] edit txindex comments

* [DEV-223] rename BluesTxData -> AcceptedTxData, and return from applyUTXOChanges only transactions that got accepted

* [DEV-223] add unit test for txindex

* [DEV-223] fix comments and unite blueTransaction and AcceptedTxData to one type

* [DEV-223] use bucket cursor for dbFetchFirstTxRegion

* [DEV-223] use the same cursor instance for dbFetchFirstTxRegion

* [DEV-223] write in dbFetchFirstTxRegion's comment that it returns the first block region

* [DEV-223] rename type BlueBlockTransaction to TxWithBlockHash

* [DEV-223] add named returned value for applyUTXOChanges

[bff68aa3] [DEV-134] Gave executable permission to deploy.sh

[638a99d9] [DEV-134] Added jenkinsfile and deploy script.

* [DEV-134] Added a robust testing script.

* [DEV-134] Fixed a bash-ism.

* [DEV-134] Disabled testing with coverage for now.

* [DEV-134] Disabled golint and removed removing debug symbols.

* [DEV-134] Disabled aligncheck.

* [DEV-134] Disabled structcheck and varcheck.

* [DEV-134] Added "don't inline functions" to compiler flags for testing.

* [DEV-134] Made build fail if gofmt prints out anything.

* [DEV-134] Fixed misleading comment.

* [DEV-134] Added comments to test.sh.

* [DEV-134] Renamed tm to measure_runtime and removed do_ prefixes from functions.

* [DEV-134] Fixed gofmt line in build script.

* [DEV-134] Fixed gofmt some more.

* [DEV-134]  Fixed gofmt not actually failing due to logical or.
2018-10-25 18:58:41 +03:00
Evgeny Khirin
499adbf046 DEV-222: Changed type of TxOut.Value and util.Amount to uin64 (#108)
* [DEV-222] Changed type of TxOut.Value and util.Amount to uin64

* [DEV-222] Replaced math.MaxUint64 with 0

* [DEV-222] Fixed comment to reflect uint64 instead of int64

* [DEV-222] Fixed overflow comment
2018-10-24 16:29:50 +03:00
stasatdaglabs
ac01babfb1 [DEV-213] Converted all RPC commands to lowercaseCamelCase. (#106) 2018-10-23 12:24:57 +03:00
Ori Newman
5e41d83015
Dev 223 fix txindex (#100)
* [DEV-201] In handleGetBlockDAGInfo calculate difficulty by the tip with the lowest bits

* [DEV-202] Move VirtualBlock.GetUTXOEntry to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-204] Unexport VirtualBlock() and add CalcMedianTime method for DAG

* [DEV-204] add explanation about difficulty in CurrentBits() comment

* [DEV-204] unexport VirtualBlock type

* [DEV-223] make applyUTXOChanges return pastUTXOResults

* [DEV-223] add bluestxdata for current block as well

* [DEV-223] re-design tx index

* [DEV-223] edit txindex comments

* [DEV-223] rename BluesTxData -> AcceptedTxData, and return from applyUTXOChanges only transactions that got accepted

* [DEV-223] add unit test for txindex

* [DEV-223] fix comments and unite blueTransaction and AcceptedTxData to one type

* [DEV-223] use bucket cursor for dbFetchFirstTxRegion

* [DEV-223] use the same cursor instance for dbFetchFirstTxRegion

* [DEV-223] write in dbFetchFirstTxRegion's comment that it returns the first block region

* [DEV-223] rename type BlueBlockTransaction to TxWithBlockHash

* [DEV-223] add named returned value for applyUTXOChanges
2018-10-21 16:01:22 +03:00
Ori Newman
3deaea6c15 [DEV-224] Fix getblockcount RPC command to show real data (#97)
* [DEV-224] Fix getblockcount RPC command to show real data

* [DEV-227] provisionalNode.commit() should not update the original parents if the provisionalNode was created with withRelatives=false

* [DEV-224] remove debug info from TestBlockCount and BlockDAG.BlockCount()
2018-10-17 15:34:10 +03:00
Ori Newman
9ea9098fbc [DEV-204] Unexport VirtualBlock (#93)
* [DEV-201] In handleGetBlockDAGInfo calculate difficulty by the tip with the lowest bits

* [DEV-202] Move VirtualBlock.GetUTXOEntry to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-203] Move VirtualBlock.SelectedTip() to BlockDAG

* [DEV-204] Unexport VirtualBlock() and add CalcMedianTime method for DAG

* [DEV-204] add explanation about difficulty in CurrentBits() comment

* [DEV-204] unexport VirtualBlock type
2018-10-16 15:21:18 +03:00
Ori Newman
0bb2030200 [DEV-220] Fix NTBlockAccepted bug (#95) 2018-10-15 16:52:19 +03:00
Ori Newman
65788d4dc0 [DEV-200] convert nonce to uint64 (#90) 2018-10-15 15:17:41 +03:00
Ori Newman
b0aaa79ad0 [DEV-195] Implement addmanualnode, getallmanualnodesinfo, getmanualnodeinfo and removemanualnode RPC-API calls (#87)
* [DEV-195] Implement addmanualnode, getallmanualnodesinfo, getmanualnodeinfo and removemanualnode RPC-API calls

* [DEV-195] fix wrong types for handleRemoveManualNode and handleGetManualNodeInfo

* [DEV-195] fix addednode terminology to manualnode

* [DEV-195] add default values to details and onetry

* [DEV-195] fix comments
2018-10-11 12:38:54 +03:00
Ori Newman
3c88184b38 [DEV-169] add to BlockDAG TipHashes() and HighestTipHash() and remove Tiphashes() and SelectedTipHash from VirtualBlock (#82)
* [DEV-169] add to BlockDAG TipHashes() and HighestTipHash() and remove Tiphashes() and SelectedTipHash from VirtualBlock

* [DEV-169] move highest node logic to separate method of blockset
2018-10-07 13:07:30 +03:00