Commit graph

244 commits

Author SHA1 Message Date
Gary Yu
f645937a2b replace cyan and yellow which not easy to read on white background (#1903)
* replace cyan and yellow which not easy to read on white background

* wallet output color scheme configuration for terminal dark/white background

* use true for dark_background_color_scheme to make the default behavior same as before
2018-11-03 09:42:41 +01:00
Yeastplume
9d0641c2b8
Wallet restore fix (#1904)
* wallet restore txlog + status fixes

* rustfmt
2018-11-01 11:36:29 +00:00
Antioch Peverell
12be191ecd
validate root of header MMR when processing headers (during sync and full blocks) (#1836)
validate root of header MMR when processing headers (during sync and full blocks) (#1836)
2018-11-01 09:51:32 +00:00
Gary Yu
a8bf2eb126 avoid long display of TxLogEntryType (#1894) 2018-10-31 10:31:24 +00:00
Gary Yu
641e7f51f0 Adjust the title format of wallet txs output (#1882) 2018-10-30 14:40:53 -07:00
Ignotus Peverell
46051ee174
improve minimum difficulty handling (#1791)
* rename MIN_DIFFICULTY to UNIT_DIFFICULTY; define Difficulty::unit, fix INITIAL_DIFFICULTY
* improve minimum difficulty handling
* replace all Difficulty::one by ::min
* revert secondary scaling default in HeaderInfo; rename scaling_difficulty; refactor difficulty_data_to_vector
2018-10-27 10:37:44 -07:00
Ignotus Peverell
c083312ad4
Improve crate descriptors to be more cargo-friendly (#1844)
* Update secp dependency to use crates.io version
* Add more details to various Cargo.toml
* Remove use of env variables that aren't reliably provided by cargo
2018-10-25 17:44:50 -07:00
Ignotus Peverell
a42d66efff
Merge branch 'master' into unitdiff 2018-10-25 14:20:41 -07:00
Quentin Le Sceller
c343c65051
Remove fluff in SendTXArgs (#1825) 2018-10-24 12:10:40 +02:00
Yeastplume
029450a5ce
remove file wallet (#1824) 2018-10-24 11:03:50 +01:00
Quentin Le Sceller
d11088c987
Fix build error (#1803)
* Fix build error

* Cargo Lock
2018-10-21 23:56:42 +02:00
eupn
1195071f5b Replace logging backend to log4rs and add log rotation (#1789)
* Replace logging backend to flexi-logger and add log rotation
* Changed flexi_logger to log4rs
* Disable logging level filtering in Root logger
* Support different logging levels for file and stdout
* Don't log messages from modules other than Grin-related
* Fix formatting
* Place backed up compressed log copies into log file directory
* Increase default log file size to 16 MiB
* Add comment to config file on log_max_size option
2018-10-21 13:30:56 -07:00
Quentin Le Sceller
0852b0c4cf Expose post_tx in OwnerAPI Post (#1795)
* Add POST post_tx in wallet_owner_api
* Add docs for post_tx
2018-10-21 13:26:35 -07:00
Gary Yu
0d06561a91
replace stdlib RwLock and Mutex with parking_lot (#1793)
* replace all stdlib RwLock with parking_lot RwLock

* replace stdlib Mutex with parking_lot Mutex

* rustfmt
2018-10-20 08:13:07 +08:00
John Tromp
e1b5d7f3c2 revert secondary scaling default in HeaderInfo; rename scaling_difficulty; refactor difficulty_data_to_vector 2018-10-19 21:39:54 +02:00
eupn
a11778bf68 fix: mark potential coinbase outputs as mining instead of unconfirmed in wallet (#1787)
* Mark unconfirmed coinbase outputs as "Mining" instead of "Unconfirmed"

* Fix formatting
2018-10-18 15:42:31 +02:00
yeastplume
6980278b95 merge T4 into master - rustfmt 2018-10-18 11:23:22 +01:00
John Tromp
8540e4f723 [T4] tweaks and fixes (#1766)
* refactor consensus.rs, tweaking some values
* move scale() there
* fix set_header_nonce bug
* remove maturity soft-fork code
* increase diff target precision
* fix weight comments and try resolve PR conflict
2018-10-16 16:14:22 -07:00
John Tromp
34646ddf51 [T4] Rename all shiftsize / cuckoo_size to edge_bits and change value for T4 (#1752)
* replace all size_shift / cuckoo_size by edge_bits and change some constants for T4
* replace remaining occurrences of sizeshift
2018-10-15 16:14:23 -07:00
Ignotus Peverell
a41022f1e3
Fix last tests broken by secondary PoW factor adjustment 2018-10-15 22:53:28 +00:00
yeastplume
9423865f92 update cargo versioning 2018-10-15 10:34:33 +00:00
Yeastplume
13facfac4b
pre-testnet4 genesis values (#1744) 2018-10-15 11:14:49 +01:00
Ignotus Peverell
43f4f92730
[T4] Secondary proof of work difficulty adjustments (#1709)
* First pass at secondary proof of work difficulty adjustments
* Core and chain test fixes
* Next difficulty calc now needs a height. Scaling calculation fixes. Setting scaling on mined block.
* Change factor to u32 instead of u64.
* Cleanup structs used by next_difficulty
* Fix header size calc with u32 scaling
2018-10-13 13:57:01 -07:00
Yeastplume
d756da062a [T4] warning cleanup (#1713)
* clean up warnings
* rustfmt
2018-10-10 08:56:15 -07:00
Yeastplume
6c8c483172
[T4 ONLY] BIP32 Wallet Compliance - Aggsig Updates - Bulletproof Updates (#1501)
* change keychain to use bip32 paths

* convert keychain to use bip32

* change identifier to be serialisation of 4-level bip32 path

* wallet changes compiling, pass parent key into all wallet functions

* rustfmt

* fix tests in chain

* rustfmt

* core tests passing

* rustfmt

* pool tests

* rustfmt

* fixing wallet tests

* rustfmt

* remove file wallet

* wallet tests compiling

* rustfmt

* remove db_migrate

* successful tx exchange test using BIP32 paths

* rustfmt

* fix wallet derivation paths to m/0/0/0

* wallet test fixed again, working with default path

* rustfmt

* fix server tests

* rustfmt

* make parent_id a trait on walletbackend

* rustfmt

* add ability for wallet to switch between multiple named accounts, and tests (not complete)

* rustfmt

* account switching tests in place and passing

* rustfmt

* compile and test with latest libsecp changes

* added public key sum to calculated e for aggsig

* rustfmt

* Update secp to 26

* bulletproof bip32 path integration

* rustfmt

* wallet restore updated with bip32 paths, also restores accounts

* rustfmt

* rustfmt

* remove old extkey

* remove old extkey

* rustfmt

* add wallet account commands

* rustfmt

* update wallet documentation

* rustfmt

* merge from master

* update libsecp tag

* merge from upstream and fix server test

* rustfmt

* rustfmt

* merge from master

* update latest libsecp merge

* fix commitment to zero value generation
2018-10-10 10:11:01 +01:00
hashmap
28b0acc0e6
Support pem TLS certificates
Mostly to support let's encrypt. It requires to switch from native-tls and friends to rustls and friends, which perhap is a good thing per se, rustls looks more modern and for sure more Rusty.
Alternative would be manually convert pkcs12 certificates to pem, which requires openssl tools to be installed and make transparent integration whith let's encrypt much harder (this is out of the scope for now, perhaps in near future)
2018-10-05 17:09:19 +02:00
hashmap
4a6cae0fe6
Allow TLS for Wallet APIs (#1626)
* Allow TLS for Wallet APIs

This PR adds an optional support of TLS for wallet APIs. Only PKCS12 format is supported, will address .pem support in next PR and provide some documentation.
Address #1425
2018-10-02 09:49:36 +02:00
Quentin Le Sceller
a13c20ceb2 Fix API wallets calls (#1597)
* Add API Secret in wallet calls

* File node api secret default to same api secret and directly in http parameter
2018-09-27 21:45:48 +02:00
Quentin Le Sceller
62fd8f2124 Implement Basic Auth for API and Owner API (#1566)
* Add api_secret

* Add to base64 method

* Add basic auth in API

* Add Basic Auth to owner API

* Add flag to enable disable basic auth

* Add .api_secret file
2018-09-26 22:38:44 +02:00
hashmap
274df3b8bb
Fix wallet APIs launch command (#1574)
We used to launch a thread for API server inside the wallet crate, now we do it inside api crate, so the cmd tool launches API and exit. This fix makes sure that command will wait for API thread.
2018-09-22 09:34:28 +02:00
hashmap
3a3ba4d636
Improve middleware support in web layer (#1572)
* Middleware and handler (mw implements the same trait) could be attached to multiple nodes inside the router
* Middleware could be attached to the router (syntactic sugar, it is attached to the root node) as well as to any node
* Handler's call method receives an iterator of handlers and responsible for calling the next handler if needed
2018-09-21 19:57:59 +02:00
hashmap
972c2e5aa9
Support TLS in ApiServer (#1565)
* Support TLS in ApiServer

This is ground work to support TLS in Grin APIs (like wallet ot node). Particular API implemention needs to decide if TLS is used or not and pass certificate data etc.

* P12 format support
* New method to start TLS server
* Transparent TLS support in API client (depends on URL scheme http/https)
* Refactoring
* Initial support for graceful shutdown (commentred out int this PR, unstable for now)
* API server tests (TLS server test is disabled by default, hyper client rejects self-signed certificates, so extra step is needed to install local CA (I used mkcert)
* Add a cert file to make test complile
2018-09-21 13:33:23 +02:00
hashmap
521ce901e4
Merge pull request #1557 from yourowncrypto/api-refactor
Refactor hyper router
2018-09-19 19:33:48 +02:00
Roy Blankman
febe9076f0 fixes #1507 - proper tx confirmation calculation (#1552)
when self.height == current_height, # of confirmations should be 1 not 0
2018-09-19 16:55:03 +01:00
hashmap
d5ef3d9d12
Refactor hyper router
* Make it simpler to implement middleware
* Switch from the current thread runtime to the default one. It enables us to inject TLS support later one and potentially more scalable, unfortunately it involves some additonal cloning of the router, because we can't rely on thread local vars anymore
* Introduce `call` entrypoint for Handler, so it's possible to handle any HTTP method in one place, handy for middleware
* Implement example of middleware
2018-09-19 17:10:52 +02:00
hashmap
7db8e5e2dd Improve API errors (#1543)
Address ##1525 in particular and improve error messages in general.
Instead of `Request Error: Error { inner:` a client would get:
`Generic error: Invalid request body: missing field `method` at line 1 column 162`
2018-09-18 15:11:58 -07:00
Quentin Le Sceller
345a6cb53e Update rand crate to 0.5 (#1542)
* Update rand crate to 0.5

* Rustfmt

* Misplaced import
2018-09-18 09:39:45 +01:00
Gary Yu
a0deb18e77
Update version of some crates (#1536)
Update version of some crates
2018-09-17 10:47:48 +08:00
Antioch Peverell
dca0d52dcd
Cleanup transaction with offset (#1514)
* cleanup build::transaction_with_offset

* rustfmt
2018-09-12 12:17:36 +01:00
Quentin Le Sceller
dd1cef2148 Add file based transaction in owner API (#1484)
* Add file based transaction in owner API
* Add finalize tx in owner API
* Code cleanup and placed file_receive in correct API
* Output an explicit error when http dest seems incorrect
* Add doc on send method
* Add cancel tx endpoint in owner API
* Add dump stored tx endpoint in owner API
*  Add missing parameters
2018-09-10 19:18:10 -07:00
Antioch Peverell
dbe53f63c8
disable chain compaction on archive nodes (#1498)
* disable chain compaction when in archive mode

* rustfmt
2018-09-10 15:59:42 +01:00
Yeastplume
974feaf07f
Add chaintype to wallet config (#1480)
* Add chain type to grin-wallet.toml

* rustfmt
2018-09-05 14:37:37 +01:00
Yeastplume
75f0ea6dd3
Save transaction as part of TxLogEntry after transaction completion (#1473)
* save wallet transaction on transaction completion

* rustfmt

* add resend command

* rustfmt

* added unit tests + fixes for grin wallet repost

* add ability to dump transaction file contents

* rustfmt

* wallet doc update
2018-09-05 12:12:29 +01:00
John Tromp
c359c8aaf2 one day coinbase maturity (#1457)
* one day coinbase maturity

* make one day maturity a soft fork
2018-09-04 10:59:55 +01:00
Quentin Le Sceller
544a296f77
Fix typos and unused imports (#1466)
* Fix typos and unused imports
2018-09-03 13:09:28 +02:00
Antioch Peverell
939d391e0e
cache rangeproof and kernel signature verification results (#1419)
* wip - cache rangeproof verification

* rustfmt

* rustfmt

* rename to ok_verifier

* rustfmt

* wire in caching verifier in more places
skip rangeproof and kernel signature verification during deserialization

* rustfmt

* actually cache verification results via ok verifier

* rustfmt

* cleanup

* pass a cache around, not a verifier

* rustfmt

* cleanup trait shenanigans

* rustfmt

* core tests passing

* rustfmt

* rustfmt

* tests passing

* rustfmt

* verifier cache now takes vecs of data in and out

* rustfmt

* logging + rustfmt

* add docs and comments
2018-08-30 15:44:34 +01:00
Yeastplume
11d24fe0c1
update docs to reflect new file layout (#1444) 2018-08-30 11:47:04 +01:00
Yeastplume
1ded3f3972
Config + Default directories (#1433)
* config file can now be generated by executable

* rustfmt

* remove now-unnecessary config defaults test

* set up paths and config file creation in user's home directory

* rustfmt

* remove default grin.toml

* add grin configuration command to spit out config file

* Split configuration into wallet and server

* rustfmt

* Restore logging to wallet configurations

* rustfmt
2018-08-30 10:10:40 +01:00
Antioch Peverell
c334c557aa
Simplify tx.validate() and transaction::aggregate() (#1436)
* simplify tx validation and aggregation
we *only* need to account for reward when building a block from txs

* rustfmt

* cleanup and tests passing

* rustfmt

* better comments in with_reward()

* fix wallet tests
2018-08-28 20:00:25 +01:00
Ignotus Peverell
4048a3011a
Improve file-based tx send to not use private file (#1421)
Instead of generating a private file on send that needs to be
provided again in finalize, the private context information is
saved in the wallet db.

Also move internal Context to bona fide libwallet type
2018-08-27 20:57:33 -04:00