Commit Graph

69 Commits

Author SHA1 Message Date
AntiochP 2f09d2e630 rollback the change output in the wallet on tx failure (#345) 2017-11-20 14:12:52 -05:00
Yeastplume 4b3a374d98 Wallet Restore feature (#338)
* beginning to add wallet restore... api endpoints and basic restore

* basic restore working, still missing features

* rustfmt

* large speed up to output search, should be more or less working

* properly mark coinbase status
2017-11-20 00:50:09 +00:00
AntiochP 2645b9ffba Eliminate gap between generating next key in wallet and saving output for this key (#302) 2017-11-18 02:31:02 -05:00
Yeastplume 45ee34d113 Wallet doesn't update local status until getting a 200 from receiver (#299) 2017-11-17 18:33:16 -05:00
AntiochP f663340628 pass in max_transactions to wallet send/burn from grin.rs (#272) 2017-11-15 13:56:35 -05:00
AntiochP 9f7e047aeb first block is 1 confirmation (#270) 2017-11-15 08:46:32 -05:00
Ignotus Peverell 6ac2fe2a8c Major fee bump to come to more reasonable values
Starting on the higher side for testnet to see how it goes in
practice. Introduced constants for each smaller unit.
2017-11-14 20:14:07 -05:00
AntiochP 8269bdd873 Rework wallet coin selection to select a max of 500 outputs (#265) 2017-11-14 18:54:28 -05:00
Yeastplume 855602e98a add flag to show spent outputs in wallet output command (#263) 2017-11-14 16:13:58 +00:00
AntiochP 04eb400422 add "smallest first" strategy for coin selection (#256) 2017-11-10 14:33:36 -05:00
AntiochP 8f33c7e0fe cache key_id->derivation in the keychain (#253) 2017-11-10 10:12:15 -05:00
Yeastplume b831192335 added wallet info/outputs commands with pretty printing (#254)
* added wallet info/outputs commands with pretty printing

* added confirmed but locked to display output
2017-11-10 14:03:31 +00:00
AntiochP 2238495d23 rename JSONPartialTx -> PartialTx (#252) 2017-11-09 15:42:19 -05:00
AntiochP c1656f7660 use the static secp instance everywhere (except the wallet) (#250) 2017-11-09 14:26:45 -05:00
Yeastplume 5b47da907f fixing issue where wallet outputs become spent when api server doesn't exist (#242) 2017-11-08 00:44:20 +00:00
Yeastplume 1eeb1fae22 Wallet amounts (#241)
* allow selecting a commit while providing a key index

* misnamed variable

* added static reference to libsecp that can be called throughout

* don't serialise rangeproof to json if it's not desired

* forgotten new file

* amounts input and displayed in wallet are now in full grins, with optional decimal place

* rustfmt

* merge branch

* better acknowledgement of transaction being sent
2017-11-07 21:20:36 +00:00
Yeastplume 48a60858ba Wallet output selection performance (#238)
* allow selecting a commit while providing a key index
* added static reference to libsecp that can be called throughout
* don't serialise rangeproof to json if it's not desired
2017-11-07 11:48:37 -05:00
AntiochP 17bf3c2702 default wallet receive to listen on 127.0.0.1 (#229)
* default wallet receive to listen on 127.0.0.1, optional flag on wallet command to listen on 0.0.0.0
* fix simulnet for new wallet port/interface config
2017-11-02 16:19:22 -04:00
AntiochP 9e36b820f6 fix the wallet receiver api (#222) 2017-11-01 14:32:34 -04:00
Ignotus Peverell e4ebb7c7cb Cleanup HTTP APIs, update ports to avoid gap, rustfmt
Moved the HTTP APIs away from the REST endpoint abstraction and
to simpler Hyper handlers. Re-established all routes as v1.
Changed wallet receiver port to 13415 to avoid a gap in port
numbers.

Finally, rustfmt seems to have ignored specific files arguments,
running on everything.
2017-10-31 19:42:56 -04:00
Yeastplume 05d22cb632 changing secp import to tag, and consolidating Cargo.toml import (#220) 2017-10-31 23:20:55 +00:00
Ignotus Peverell 283b846243 Small fix to chain tip check for send 2017-10-30 21:35:43 -04:00
AntiochP 8b324f7429 add retry logic to miner when hitting wallet coinbase API (#213)
* mount v2 router for flexibility, wallet checker now refreshes multiple outputs via single api call
* fix the api router
* wallet api handlers, miner uses wallet_client
* retry logic via tokio_retry, miner creates new coinbase output via wallet API (retries several times)
* move wallet client into wallet crateand rework the lock acquisition logic to use tokio_retry
2017-10-27 17:36:03 +00:00
AntiochP 68bcd79da5 height 0 means we have 0 confirmations (cut-through output?) (#211) 2017-10-26 17:41:08 +00:00
AntiochP d7b94a12f5 only hold wallet write lock for write operations on the wallet (#210)
* mount v2 router for flexibility, wallet checker now refreshes multiple outputs via single api call
* add read_wallet so we can read without acquiring the lock
* fix the api router
* read wallet without acquiring or holding lock, only acquire the write lock for wallet when updating or adding outputs
2017-10-25 21:09:34 +00:00
AntiochP 7178b400b8 refresh multiple wallet outputs in single api call (#205)
* mount v2 router for flexibility - wallet checker now refreshes multiple outputs via single api call
* fix the api router
2017-10-25 17:57:48 +00:00
AntiochP 68cfbbecad "grin wallet init" to create the initial wallet.seed file (#198)
* "wallet init" to create the initial wallet.seed file
* cleanup and better error msgs
* add some basic wallet docs
* cleanup and make passphrase optional
2017-10-24 17:34:34 +00:00
Yeastplume 9c0411ac5e Bind to services to all interfaces rather than loopback (#197)
* changing default ip
2017-10-23 16:34:43 +00:00
AntiochP 4d7b46b0b9 wallet can now optionally spend zero-confirmation txs (#188)
* wallet can now optionally spend zero-confirmation txs
* add rule to get_mineable_transactions based on total pool size
2017-10-18 20:47:37 +00:00
AntiochP c84a136e48 refactor burn key into key_overrides on keychain (#178)
* refactor burn key into key_overrides on keychain
* introduce UnconfirmedChange output status, we can potentially spend these with zero confirmations
* pass in burn_key_id for the burn enabled keychain, spend *all* coins when spending from a wallet, spend UnconfirmedChange coins also
* add comment about simplifying wallet_data.select logic
* replace UnconfirmedChange output status with a more flexible zero_ok, flag on the output data
2017-10-16 17:11:01 +00:00
Yeastplume 49797853d9 tweaks to logging configuration (#176)
* tweaks to logging configuration
* doc port update
2017-10-13 16:42:04 +00:00
AntiochP 86420d4bca Shorter identifiers and call them key_id (not pubkey) (#175)
* rename pubkey -> key_id, these are key identifiers, not public keys
* reduce identifier seize to 10 bytes, get rid of fingerprints (identifiers are now small enough to use as-is)
* IDENTIFIER_SIZE const
* add FeeDispute error for when sender and recipient disagre on fee calculation (should never happen)
* does not need to be mut
* cleaned up some warnings
2017-10-13 04:45:07 +00:00
Yeastplume 8e382a7593 slog-rs logging (#171)
* added global slog instance, changed all logging macro formats to include logger instance
* adding configuration to logging, allowing for multiple log outputs
* updates to test, changes to build docs
* rustfmt
* moving logging functions into util crate
2017-10-12 16:56:44 +00:00
Ignotus Peverell b85006ebe5 Wallet operation to burn some coins (#172)
* Burn transaction for testing
* Burn bug fixes, embed burn key in keychain
* Better error logging in API, wallet fee calc fix
2017-10-12 03:35:40 +00:00
AntiochP bf7c1fb44f add lock_height to Transaction and TxKernel (#167)
* add lock_height to Transaction and TxKernel, sign msg including both fee and lock_height in kernel
* make the order of the fields in tx and kernel more consistent
* rename to kernel_sig_msg
* add test to cover adding timelocked tx to pool, where tx is invalid based on current height of the blockchain
* add tests for adding timelocked txs to blocks (valid and otherwise)
2017-10-11 18:12:01 +00:00
AntiochP dc0dbc62be Set approximate wallet fee to avoid LowFeeTransaction (#163)
Set approximate wallet fee when building a transaction so we avoid getting a LowFeeTransaction error from the pool

* rustfmt
2017-10-10 17:30:34 +00:00
AntiochP 62954f1549 Generate wallet key identifier from public key (#162) 2017-10-09 17:19:26 +00:00
AntiochP 3dd1dde00b Pass pubkey for coinbase (#159)
* store wallet output data in hashmap
* cleanup up commented out code
* pass pubkey/identifier and not derivation around to miner etc.
* fix failing tests
2017-10-07 17:38:41 +00:00
AntiochP 4e41365fe8 Fix duplicate wallet coinbase (#158)
* store wallet output data in hashmap
* cleanup up commented out and debug code
2017-10-06 20:10:30 +00:00
Ignotus Peverell 7012d37f5f Half of fees get rewarded, half burnt. Minor cleanups
Update coinbase building and block summation to account for half of
the fees going to the coinbase. Forcing fees to be even as a
consequence. Now that we can't build the coinbase independently
from the block (because fees), had to update the miner to keep the
key derivation so a new derivation isn't made any time a new block
gets worked on.

Minor doc and warning cleanups.
2017-10-05 07:30:10 +00:00
AntiochP 677d0a3a95 keychain crate (no more secretkeys in core) (#146)
* introduce grin_keychain, encapsulate derivation of secret_keys
* core compiles against keychain, tests don't run yet
* core tests are now passing against keychain
* wip - getting wallet working with keychain
* add util and keychain to travis test matrix
* basic test around key derivation
2017-10-03 00:02:31 +00:00
AntiochP 2210e706f9 Add fee amount to wallet receive_transaction (mainly for testing purposes) (#150) 2017-10-01 21:56:19 +00:00
Ignotus Peverell 8504efb796 Cargo fmt all the things 2017-09-29 18:44:25 +00:00
AntiochP 8800d1339d Wallet: key fingerprint as string (#142)
* wallet key fingerprint as hex string
* use lowercase hex in util::to_hex for consistency with various crypto libs, add some tests for util::to_hex and util::from_hex
* filter wallet info based on ext_key fingerprint
* cleanup format for fingerprints and output status
2017-09-27 23:03:59 +00:00
AntiochP 0b26a57ca6 Remove rust-crypto dependency (#141)
Use blake2b in wallet for key derivation and key identifiers
2017-09-26 22:51:45 +00:00
AntiochP 7d48e1da49 Use util::from_hex and get rid of dependency on rust-serialize in wallet (#136) 2017-09-24 04:41:35 +00:00
AntiochP 670aa11e5a expose "wallet info" on CLI (#132)
* expose "wallet info" on CLI
* add sleep and retry logic when obtaining wallet.lock
* fix pool test for immature coinbase
2017-09-24 04:40:31 +00:00
AntiochP a5b2c7d3f2 Introduce Identifier and Fingerprint to ExtendedKeys (#129) 2017-09-22 16:45:06 +00:00
AntiochP dbc4e10cec Wallet now supports coinbase maturity (#130) 2017-09-22 16:44:12 +00:00
AntiochP 139af79509 wallet listens by default on 13416 (#128)
wallet should default to checking against node on port 13413
2017-09-21 21:12:07 +00:00