Commit Graph

1590 Commits

Author SHA1 Message Date
Joonas Koivunen
911fab510a chore: clippy push_str with single char str 2020-12-08 14:53:32 +02:00
Joonas Koivunen
6c7ce3747c chore: clippy extra return 2020-12-08 14:53:12 +02:00
Joonas Koivunen
232822ca58 chore: clippy strip prefix 2020-12-08 14:52:53 +02:00
Joonas Koivunen
5836fe194c chore: clippy unnecessary lazy eval 2020-12-08 14:52:27 +02:00
bors[bot]
75ed11a85d
Merge #416
416: Fix more missing doc warnings r=koivunej a=niklaslong

Follow up to #409 and part of #197.


Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-11-17 15:23:24 +00:00
Niklas Long
49b54bd45d docs: code review suggestions 2020-11-17 16:19:58 +01:00
bors[bot]
b1e83a69f7
Merge #429
429: feat: repo locking with fs2 r=koivunej a=niklaslong

supersedes #426 and resolves #243. 

This implements repo locking with fs2. The only concern for this crate is that it is poorly maintained but the functionality we need seems stable enough for now. 

Certain tests are currently failing, notably because multiple nodes are being created with the same repo (dag tests for instance). Not sure what the solution to this will be...

Update: running tests with `--test-threads=1` passes all unit tests. The integration tests fail (I think because multiple nodes are being spun up with the same repo). 

Update 2: all green, making sure test nodes use a different temp dir for the repo fixed the tests.

Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-11-17 14:55:55 +00:00
Niklas Long
404a61cb4c refactor: drop lockfile guard to avoid deadlocks 2020-11-17 15:40:06 +01:00
Niklas Long
70a9e992c7 refactor: clearer naming for lock related fields/error variants 2020-11-17 12:15:48 +01:00
Niklas Long
500e401a7a refactor: improve lock error variants 2020-11-17 11:40:19 +01:00
Niklas Long
a5e8116b71 feat: introduce repo locking error handling 2020-11-16 18:17:55 +01:00
Niklas Long
1fcf50029f refactor: move repo locking into init
Repo locking was previously performed on repo::new, this keeps
the Lock struct initialisation in repo::new but moves the locking into
repo::init.
2020-11-16 16:29:50 +01:00
bors[bot]
3fc24b0705
Merge #430
430: doc: update README r=koivunej a=niklaslong

What follows is just a suggestion. This updates the README with a _running the tests_ section, fixes the TOC, moves the _contributing_ section to where it's more obvious and links to the http crate tutorial. 


Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-11-16 09:02:39 +00:00
Niklas Long
9cafca73a3 doc: small tweaks to readme testing instructions 2020-11-16 09:52:58 +01:00
Niklas Long
2d99259367 refactor: remove unneeded #[async_trait] 2020-11-13 17:10:31 +01:00
Niklas Long
d8f9595b31 doc: update README 2020-11-13 11:33:01 +01:00
Niklas Long
cb30d0d0b2 docs(repo): add missing docs for repo variants 2020-11-13 10:25:49 +01:00
Niklas Long
2521cf8cfd docs(repo): add missing docs for repo and pinning 2020-11-13 10:25:49 +01:00
Niklas Long
1098f3102e fix(repo): fix typo in pinning strategy error msg 2020-11-13 10:25:49 +01:00
Niklas Long
474a392283 doc: add missing docs for Node module 2020-11-13 10:25:49 +01:00
Niklas Long
51793ed158 doc(libp2p): add missing Kademlia query result docs 2020-11-13 10:25:49 +01:00
Niklas Long
b1a0709c91 doc(libp2p): add missing pubsub docs 2020-11-13 10:25:49 +01:00
Niklas Long
defa810788 doc: add missing docs for IpldDag methods 2020-11-13 10:25:49 +01:00
Niklas Long
02d98ad923 refactor: implement Lock trait on FsLock and MemLock 2020-11-12 19:32:50 +01:00
Niklas Long
b483d7a724 fix: remove file existence check for repo lock
This was after concerns were raised about potential time-of-check to
time-of-use (TOCTOU) issues. The check isn't
actually necessary as `OpenOptions::create` set to `true` will create
only if the file doesn't already exist.
2020-11-12 12:49:24 +01:00
Niklas Long
11ec571429 doc: add changelog entry for #429 2020-11-12 11:12:29 +01:00
Niklas Long
38f6b00437 test: add unit test for repo lock 2020-11-12 10:36:38 +01:00
Niklas Long
f370a9b710 refactor: expect unstead of unwrap on lock creation 2020-11-11 18:29:54 +01:00
Niklas Long
e60e9835d0 fix: use unique repo dirs for testing nodes
The introduction of repo locking caused tests with multiple
nodes using the same temporary repo directory to fail.
2020-11-11 18:04:09 +01:00
Niklas Long
aed5ae2934 feat: repo locking with fs2 2020-11-10 17:40:32 +01:00
bors[bot]
d3c84ee52e
Merge #428
428: Update to go-ipfs 0.7.0 (used in interop tests)  r=koivunej a=niklaslong

We were using `0.6.0`, this upgrades to `0.7.0`. 

I also removed the `--bits` option as `0.7` uses `ed25519` by default. 

Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-11-10 09:02:07 +00:00
Niklas Long
0effe7a18a doc: add changelog entry for #428 2020-11-09 13:41:33 +01:00
Niklas Long
bf3ad6113d ci: update go-ipfs to 0.7.0 in interop tests
This also removes the --bits arg as go-ipfs now uses ed25519 keys
instead of 2048 bit RSA by default.
2020-11-09 13:00:12 +01:00
bors[bot]
4044d6cb86
Merge #427
427: Further reduction of ipfs-http compilation times, take two r=aphelionz a=koivunej

This PR supercedes #422 as bors couldn't handle the "PR is from removed repository" case, so this is made from a branch which has only the same commit as the previous PR. PR uses the balanced tree approach from warp issue for further compilation time speedups. The commit hash differs because I apparently applied it per githubs instructions on top of different commit than the original seems to be, with different metadata.

Closes #422.

Co-authored-by: Artem Tarasov <artem@devopps.de>
2020-11-05 14:36:43 +00:00
bors[bot]
1b07ed4b9b
Merge #420
420: docs(http): initial draft of tutorial r=koivunej a=niklaslong

This is a first draft of the tutorial mentioned in #402. 

It currently covers:
- installing rust
- configuration of the `IPFS_PATH` 
- `-- init`
- `-- daemon`
- `ipfs id` from the go-ipfs CLI 


Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-11-05 10:19:22 +00:00
Artem Tarasov
b2365db44e Improved "combine" macro in ipfs-http
Copy-and-paste from https://github.com/seanmonstar/warp/issues/619;
Further reduces compilation time (30-40% improvement observed).

Removed "combine_unify" macro since it didn't add any extra benefit.
2020-11-05 11:31:04 +02:00
bors[bot]
73409a8432
Merge #423
423: http: configuration refactor r=niklaslong a=niklaslong

This is a wip but opening as a draft to keep track of this follow up to #421. This is also part of #402. 

This introduces the `Config` struct to serve as a facade to the configuration module. It's essentially a flattened `CompatibleConfigFile` struct exposing only the fields necessary to running the daemon.  


Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-10-30 17:06:57 +00:00
Niklas Long
eb005bb99a refactor(http): widen write error variant 2020-10-30 17:50:08 +01:00
Niklas Long
328d2abf54 refactor(http): flush write buffer for config file 2020-10-30 13:32:48 +01:00
Niklas Long
57226e16c1 doc: add changelog entry for #423 2020-10-30 10:56:26 +01:00
Niklas Long
9768f04f21 refactor(http): introduce Config struct as configuration facade 2020-10-29 15:20:49 +01:00
Niklas Long
58e7368100 refactor(http): return config struct in load 2020-10-29 15:20:42 +01:00
Niklas Long
4352695e6d refactor(http): return config struct in init 2020-10-29 15:20:01 +01:00
Niklas Long
ad2d93b3c9 docs(http): more small tweaks to tutorial 2020-10-27 15:48:50 +01:00
bors[bot]
83e73abffe
Merge #421
421: feat(http): create Profile abstraction to allow port choice r=koivunej a=niklaslong

This PR introduces a `Profile` abstraction to allow the customisation of port selection as discussed in #402.

Two profiles are supported: 
- `Test` for use with conformance tests (ephemeral port selection)
- `Default` serves on `4004`

Co-authored-by: Niklas Long <niklas@equilibrium.co>
2020-10-27 14:02:57 +00:00
Niklas Long
3d677c6ecc fix(http): use slice pattern matching for MultiAddr match/conversion to SocketAddr 2020-10-27 14:47:40 +01:00
Niklas Long
70c2e7d76f docs(http): small tweaks to tutorial 2020-10-27 10:00:12 +01:00
Niklas Long
07f5c6a76b docs(http): explain cmd line options in tutorial 2020-10-27 09:18:07 +01:00
Niklas Long
7b79d5d49e docs(http): remove static version from getting started examples 2020-10-26 14:52:18 +01:00
Niklas Long
9fb93fc63d fix(http): use multiaddr instead of socketaddr in config 2020-10-26 12:44:08 +01:00