Commit graph

479 commits

Author SHA1 Message Date
Ignotus Peverell
f45cfe97f2
HTTP API client utility functions (get, post, etc.) 2017-05-25 17:21:56 -07:00
Ignotus Peverell
ac553493f1
WIP: Wallet functionality to receive and send coins
Beginning of a first pass at simple wallet functionalities so
Grin can be used to author transactions. We introduce a
receiving server, to be at least able to build coinbase outputs
that can be used by the mining daemon.

Present:

* Coinbase receiving API.
* Command to start the receiving server.
* Beginning of a transaction sending command.
* Improvements to the REST API abstractions to support the above.

Still to do:

* Change to the miner daemon to use the receiving server.
* A command line sender.
* API to receive any transaction (not just coinbase).
* A command line receiver.

Beyond that, HD derivation and seed generation are very simple
so far and almost certainly insecure. Just for testing for now.
2017-05-24 16:09:39 -07:00
Jacob Payne
de4ebdde71 [WIP] Partial Transition from Writeable/Readable to Codecs (#51)
* Sample Signatures for put_enc and get_dec
* Implement put_enc and get_dec
* Implement ChainCodec in grin_chain
* Truncate src only on complete Blocks
* Truncate src only on complete Tip + Check Len
* Move BlockHeader Encoding to BlockHeaderCodec
* Define put_enc for store::Batch
* Replace BlockCodec and BlockHeaderCodec with generic BlockCodec<T>
* Implement Default for BlockCodec Manually
* Replace get_ser/put_ser with get_enc/get_dec for chain::ChainKVStore
* Remove Writeable/Readable for chain::Tip
* Add Tokio-io and Bytes to grin_p2p
* Additional Setup for Message enum + Msg{Encode,Decode} traits
* base msg ping pong encoding and test
* fill out msg-codec tests
* Implement Hand Encoding/Decoding
* msg-encode shake
* msg-encode getpeeraddr
* codec peer-addrs message, SockAddr struct wierdness
* header message codec
* msg encoding finished prelim
* Implement PeerCodec Encoding/Decoding
* Set PeerStore to use PeerCodec for Encoding/Decoding
* Add a DecIterator
* Prune PeerStore
* Replace Decoding and Encoding in handle_payload
* Prune Writeable/Readable methods in store::Store
* Remove Incomplete Frame Testing ( Not Nessesary right now )
* separate block and tx codec tests
* Refactor {Tx,Block}Codec Tests
2017-05-22 19:16:13 +02:00
Ignotus Peverell
a402f39633
Custom REST API operations in addition to CRUD
Allows for custom operations associated with POST requests under
the main resource path. For example, in addition to POST on /user
to create a user, allow easy support for /user/login and
/user/logout.
2017-05-19 14:35:49 -07:00
Ignotus Peverell
d8deba15ee
Deprecated. 2017-05-19 08:52:31 -07:00
MoaningMyrtle
23fd07be60 WIP: Tracking Transaction Pool Implementation (#48)
* Beginning work on pool design doc
* Refining data structures; adding connect capability
* Fleshing out the connectivity paths for the tx pool
* Bringing tx pool and orphan set add logic up into parent TransactionPool
* Use output's commitment as identifier in graph structures
* Breaking a bunch of stuff to start migration to output commitment as id instead of hash
* Wrapping up updates to pool using commitment keys, dummy blockchain. Contains lots of cleanup on the internal flow.
* Beginning work on new block reconciliation
* WIP: Replacing monolithic pool cleanup with mark-and-sweep, which greatly simplifies the logic.
* Laying the groundwork for pool tests; test tx generator
* WIP: More elaborate test helpers; starting work on more elaborate block acceptance test.
* Need DummyUtxoSet to actually apply blocks now
* Using search_for_best_output to validate output status in test_basic_pool_add
* Enable modification of chain while under shared pool ownership. Cleanup pending
* WIP: Begining to untangle the TransactionPool impl from Pool and Orphans data structures
* Finishing refactoring of pool block reconciliaition; getting tests working again
* Add metrics for graph sizes; prereq to pool size throttling
* Remove redundant search_for_available_output from pool graph container
* Minimum viable block builder: return all fully rooted txs
* Tests for block building procedure
* Delegate duplicate output checking to check_duplicate_outputs
* Delegate orphan reference resolution to resolve_orphan_refs
2017-05-19 17:22:08 +02:00
Ignotus Peverell
eb1e49094b
Minor clarifications and additional getting started link 2017-05-03 14:23:12 -07:00
dan-da
6122152003 Add some basic build instructions to help people get started (#50) 2017-05-03 13:56:03 -07:00
Jacob Payne
8ffc0c6f8e Delegate Block Encoding to Store (#44)
Builds codecs to encode and decode blocks, block headers, transactions, kernels, etc. Will be used by the store and peer-to-peer layer for serialization, but also to compute hashes. Separates out serialization from core.
2017-05-03 10:27:38 -07:00
gabriel-syme
2787d4259a Typo in intro doc: two inputs and one output (#45)
* vi1 and vi2 as input values. (2 inputs)
* vo3 as output value. (1 outputs)
2017-04-30 20:00:40 -07:00
Simon Horne
94539c768e Typo in intro doc: when->which (#47) 2017-04-30 19:59:39 -07:00
Laurent Meunier
24b107bdf7 Create the beginning of the wallet library. (#36)
The wallet library will be used to manage the keys of the user. Currenty it only contains a minimal implementation of the extended keys. The format of the extended keys is subject to change
2017-04-29 13:58:26 -07:00
Ignotus Peverell
a3a06951ff
Integrated clap for a better command line
Allows for client, server and wallet subcommands. Processes the
main necessary options for server mode right now.
2017-04-27 22:07:25 -07:00
Ignotus Peverell
1b78a73328
Variety of small p2p fixes to block sync
Adds a couple utility function to p2p server to check whether
we're already connected to a peer before trying again. Other
very minor fixes and logging improvements.
2017-04-27 22:05:12 -07:00
Ignotus Peverell
a7089d1975
Fixes for chain processing during bootstrap
Adds checks to ignore a block that's already known (can happen
if the block was saved but the chain update failed). Also saves
saves the chain slightly differently during bootstrap as the
header chain should only be updated when a header is received
(and not when we got a full block). Finally, do not broadcast
during bootstrap.
2017-04-27 21:59:53 -07:00
Ignotus Peverell
2d793639b5
Move main binary to a grin command line 2017-04-27 20:39:32 -07:00
Ignotus Peverell
f18aeb3024
Start of a binary file for the grin node 2017-04-24 18:55:01 -07:00
Ignotus Peverell
96ea9a7d9f
Minor fixes and URL for web static file seeds 2017-04-24 18:53:42 -07:00
Ignotus Peverell
3fe28b0f03
Server types cleanup and serde for configuration types
Moved error and configuration types from server.rs to types.rs
where they should have been from the start. Configuration types
for the server and p2p modules now derive serde Serialize and
Deserialize so we can have a simple JSON configuration file.
2017-04-24 18:49:57 -07:00
Ignotus Peverell
a37e2b99fb
Trivial formatting fixes 2017-04-24 18:47:36 -07:00
Ignotus Peverell
e4ca924b47
Various comment and dead wood cleanup 2017-04-20 11:31:02 -07:00
Ignotus Peverell
4e36c63cbb
Save outputs under their own keys
Save outputs in every new block under their own hash. Done in the
same batch as the block. Allows for direct output lookups by hash
required by the p2p layer. Also store an index of output
commitment to output hash for wallet and input lookups.
2017-04-20 11:31:02 -07:00
greybeard355113
ca496ee101 secp256k1zkp: Fix several warnings from implicitly declared function 'memcpy' (#42)
Added includes for <string.h> to explicitly declare 'memcpy' where needed.

This message is typical of messages suppressed by declaring 'memcpy':

    warning: In file included from depend/secp256k1-zkp/src/secp256k1.c:14:0:
    warning: depend/secp256k1-zkp/src/ecmult_impl.h: In function ‘secp256k1_ecmult_context_clone’:
    warning: depend/secp256k1-zkp/src/ecmult_impl.h:186:9: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
    warning:          memcpy(dst->pre_g, src->pre_g, size);
    warning:          ^~~~~~
2017-04-15 16:38:51 -07:00
Robert White (Vix)
5886d551c2 Fix error[E0243]: wrong number of type arguments (#41)
Change Result<Animal> to be ApiResult<Animal>
2017-04-15 16:36:42 -07:00
Ignotus Peverell
e71ae27f77
Invert inputs and outputs commitment sums. Fixes #37. 2017-04-10 00:27:19 -07:00
Merope Riddle
39ddeb0a2a core: various cleanups, improvements, code comments (#38)
* core: cleanup slicing impls for Hash
* core: clean up Readable trait, implement Readable/Writeable for various integers
* core: change Hash debug output to hex
* core: correct warnings in all modules
2017-04-09 23:17:23 -07:00
Jacob Payne
9e82fb1774 Replace AsFixedBytes with Sized + AsRef<[u8]> (#35)
* Replace AsFixedBytes with Sized + AsRef<[u8]>
* Add AsRef<u8> to impl_array_newtype!
* Include AsFixedBytes as marker trait
* Related fixes
* Remove Deref
2017-04-06 22:54:54 -07:00
Ignotus Peverell
382754e54c
Add workspace support for all crates 2017-04-05 23:41:49 -07:00
Ignotus Peverell
f16c4ac59b
Fix for hyper interface change 2017-04-05 23:28:53 -07:00
Ignotus Peverell
afb219ce5c
Hashed impl only needed for empty arrays. 2017-04-03 18:10:55 -07:00
Ignotus Peverell
fd26ec9753
Fix Hyper URL to URI ref 2017-03-23 18:04:49 -07:00
Ignotus Peverell
38d5d67e79
Add features bitmask to Block, Output, Kernel; coinbase validation
Block, Output and Kernel now have bitmasks to hold supported
features and eventually versioning. Will make adding features and
updates easier and open the possibility of soft forks.

First added feature for Output and Kernel is the marking of coinbase
related ones. Allows the validation of the coinbase part of a block.
2017-03-23 17:06:00 -07:00
Ignotus Peverell
a57c4e8f04
Replace IRC with Gitter 2017-03-23 17:04:00 -07:00
Ignotus Peverell
f9f69dea25
Small tweaks to intro doc following John Tromp's review
* Various typo fixes and minor improvements.
* Switch from v*G + k*H to r*G + v*G as symbols to stay more consistent
with the rest of the litterature.
2017-03-21 14:05:10 -07:00
Ignotus Peverell
cc63c17f39
Link introduction doc in README. 2017-03-21 11:18:09 -07:00
Ignotus Peverell
b6b815f6c1
Reintroduce block tests with new tx building
The build module introduced some facilities to build transactions
that can now be leveraged when building blocks and in related
tests.
2017-03-20 14:32:11 -07:00
Ignotus Peverell
6bd3fc0d48
Cleanup of Transaction and Block data structures
Some renaming and cleanup of the Input, Output, Transaction and
Block structs. The main change is the removal of all the overt
structures which are now replaced by a specialized module to
build transactions easily. More specifically:

* Rename the TxProof to TxKernel in Block to reflect the current
naming consensus in MimbleWimble.
* Change Input and Output to be plain structs instead of enums
making their manipulation a lot easier. The building of
transactions is now handled by the build module.
* Input now directly includes the commitment of the Output it's
spending instead of going through an intermediate hash.
* The new build module encapsulates all the transaction building
logic, making it very straightforward by chaining combinators.
* Moves some tests to the core mod.rs as they required being able
to build a transaction to test it.
2017-03-20 14:07:00 -07:00
Ignotus Peverell
95592d6624
Introduction to MimbleWimble and Grin
Documentation aimed at a technical audience, just requiring some basic
knowledge of bitcoin, to explain how MimbleWimble works and how it's
applied in Grin.
2017-03-20 09:57:54 -07:00
Ignotus Peverell
cb84f588fb
Small tweaks and addition to a Transaction to make 2-parts building easier. Unit test covering the standard exchange between 2 parties when building a transaction. 2017-03-11 13:48:33 -08:00
Ignotus Peverell
f64d20749f
Framework to define services as RESTful HTTP API services. Serde implementations for some core types. 2017-03-07 17:00:34 -08:00
Ignotus Peverell
d900f0b934
P2P server cleanup of disconnected peers. Mark those that don't respect the protocol as banned. 2017-02-27 14:17:53 -08:00
Ignotus Peverell
7c72ccec7c
Cleaned up error handling in p2p module. Setting peer status on disconnect. 2017-02-26 20:08:40 -08:00
Ignotus Peverell
78b223b4f0
Forgot to update seed address as well. 2017-02-19 11:08:57 -08:00
Ignotus Peverell
ca04327922
Reintroducing Rust beta channel testing. 2017-02-18 19:05:18 -08:00
Ignotus Peverell
c0e635071c
Fixed p2p tests. 2017-02-18 18:56:07 -08:00
Ignotus Peverell
eb024e91d2
Discovery and seeding of other peers. Relies either on a gist with IP addresses or a static list. Connects to a first list, sending peer request messages to discover more. Monitor the server to make sure there's always enough peer connections. 2017-02-18 18:42:34 -08:00
Ignotus Peverell
510feadce6
Minor compilation errors due to moving store Error. 2017-02-10 11:02:21 -08:00
Ignotus Peverell
786da24653
A db store for peer data. 2017-02-09 20:16:34 -08:00
Ignotus Peverell
85edf57366
Iterator for Readable impls stored in DB. 2017-02-09 20:15:22 -08:00
Ignotus Peverell
7ee408e067
Moved down to the store module some common persistence code. 2017-02-09 11:41:46 -08:00