Commit graph

5 commits

Author SHA1 Message Date
decentralisedkev
1a6bdd4099
[Server] Implements Orchestration server (#252)
* [pubsub]

- remove pubsub package

* [chain]

- Add height to chain

* [peer]

- remove unnecesary println

* [server]

- Implement server package

* Add main.go to run node
2019-03-28 22:49:34 +00:00
decentralisedkev
493d8f3d95
[chain] Refactor, add chaincfg and database initialisation (#243)
* [chain]

- Add basic chain cfg parameters

- Added logic to insert genesis block, if it is a fresh database

- changed SaveBlock to ProcessBlock
- changed SaveHeaders to ProcessHeaders

- Changed parameter from a wire message to the payload, for header and
block processing

- Added check in chain for when the block is in the future, i.e. not at
the tip of the chain

- Added custom error returns, to distinguish between a database error
and a validation error
2019-03-28 20:23:50 +00:00
dauTT
ce1fe72607 Finalized size calculation methodology (#215)
- Simplified Transactioner interface
-  Added size calculation test
- Added utility methods in the address pkg: FromUint160, Uint160Decode
2019-03-25 01:04:54 +00:00
decentralisedkev
7d84d44b08
[chain] (#209)
- Add basic skeleton for chain struct
2019-03-23 19:09:25 +00:00
decentralisedkev
30e5aa8f48
Add Chain saving functionality to Database (#206)
* [database]

- Add Prefix method to interface
- Convert leveldb error to `database error`
- Be explicit with prefixedKey in `Table` as slices can be pointers

* [protocol]
- Add stringer method to protocol

* [Chaindb]

- Added saveBlock() which will allow us to save a block into the
database. The block is broken up into transactions and Headers. The
headers are saved as is. The transactions are saved as is, then the
utxos in the transactions are collected to make the utxo db.

- Verification for blocks and transactions will reside in the same
package. Note that the save methods are all unexported, while the Get
methods are exported. Making it so that any can call a get method, but
only code in this package may save to the database. The other code which
will reside in this package will be code verification logic.

* [chaindb]

- Added saveHeader function which saveHeaders  uses

- Update the latest header, each time we save a header instead of after a batch. This is so that we can call saveHeader without saveHeaders. This functionality can be rolled back if the performance of updating the header after a batch is significant

- small refactor in test code
2019-03-23 16:57:05 +00:00