Commit Graph

449 Commits

Author SHA1 Message Date
Dmitriy Ryajov 7f0627378c misc 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov fceea14aa5 adding bufferred stream 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov cbf0f4f186 move streams to own dir 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov ef7a0b41e4 add switch tests to native 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 0f3d024c0a avoid unnecesary temps 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 18b9765525 fix: cleaning up based on jangko review 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov db1aad3df0 adding switch e2e test 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 79129ea6d1 `handles` should be called on concrete transport 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 3df92e0d67 wip: switch 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 152c1e3c14 close connections asyncronously 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 022a248ca3 reworked protocol 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 3d74a4c82a add base upgrade method 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 71282fa442 make matcher func gcsafe 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 1cef1b803b don't await twise 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov e2b04fc30d add gcsafe pragma 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov ca4ccbe37f don't use method as handler in protocol base 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov e7c3412d69 expose private and public keys 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov e5be1fcaee wip: switch 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 5eced0abee rename multistream 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov aa2dfababd wip: identify 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 682fecc395 make things public 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 054bd365af protocol handler method should receive context 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov b85d616a13 call the handler with the protocol context 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov a9c9788356 we don't need the switch in the protos after all 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov a7709b8afc use gcsafe in closures 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov b56b005ab7 make object instead of ref 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 2d2c3ba977 identify message protobuf encode/decode 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov e77ebc2e5a pretty 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 954a78fda0 remove useless error pragma 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 261204853e rename readwrite to stream 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov f56d925f6f rename supports to handles 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov e486b5e40c make fields privae 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 90d9dcbce9 wip: identify and switch 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov ec86afebe0 modeling the switch 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 3d7f657ce8 rename readerwriter to stream 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov d23398f498 nimpretty 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 187645013f fix: ls and other minor issues 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 139b8a752b correctly close stream 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 47b6b89fc5 fix: call on reader 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 77aa11f0f3 removing bins 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 8a52cfa9b0 use consistent dispatcher object name 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 64e92eb9da adding `na` test/functionality 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 6e5641dc48 add closed flag 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov f24c866a30 use loop on closed flag 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 402067ceae await for void features and add closed flag 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov e13f42f9bb wip: initial multistream handler implementation 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 307c76e139 feat: implemented select 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov f23106029f feat: added length prefixed read/write methods 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov cb4ff262b0 wip: multistreamselect 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 7d647c1555 remove error pragma 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 368176f8d1 remote templated write 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 5d07145a0a feat: added stream abstraction and chronos wrapper 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 5f8e633c0f feat: use error pragma to signal abstract methods 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov a91c15c47a feat: adding dial/listen test with transports on both ends 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov c15a9bdd67 feat: adding dial tests 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov c8546583e6 feat: tcp transport listen 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 47106a6a7d wip: adding test 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 5b7e8d99bd initial commit for native libp2p implementation 2019-10-11 08:15:24 +09:00
cheatfate fb9d2d7d05
Add MultiAddress.init(TransportAddress). 2019-10-10 07:16:02 +03:00
Yuriy Glukhov 1ecdf159bb
Extern bearssl 2019-10-08 14:41:24 +03:00
Zahary Karadjov 1018bffb3f
Add gcsafe markers to make Nim 1.0 happy 2019-09-29 22:17:10 +03:00
cheatfate 41e1479213
Add rust's TwofishCTR support. 2019-09-13 09:52:13 +03:00
cheatfate 54f9a5be7c
Fix getOrder() bug. 2019-09-12 23:11:50 +03:00
cheatfate 7138f7e94d
Add more primitives for SecIO.
Fix SIGSEGV inside of rsa.nim and ecnist.nim.
2019-09-11 19:03:39 +03:00
cheatfate f2b10776db
Add utility procedures for SECIO.
Add 2 more length encodings for protobuf.
2019-09-09 19:57:17 +03:00
cheatfate c584583678
Fix compilation error for Nim devel. 2019-09-03 16:22:55 +03:00
cheatfate 40ad427ea0
Fix mistype. 2019-09-02 21:59:32 +03:00
cheatfate 968e635746
Add secp256k1 curve support and tests for it. 2019-09-02 21:55:42 +03:00
cheatfate 15a7136ad1
Add more supported `go-libp2p-daemon` flags to DaemonAPI. 2019-08-28 09:19:16 +03:00
cheatfate 53fb5924ea
Fix daemonapi flags in startProcess. 2019-08-25 13:53:41 +03:00
cheatfate 0bbd87b536
Fix bug in daemonapi length decoding message. 2019-08-25 10:09:54 +03:00
cheatfate 78f6afb544
Change default logging level to Debug. 2019-08-22 13:29:54 +03:00
cheatfate c5925d0d9a
Fix appveyor problems. 2019-08-22 13:01:28 +03:00
cheatfate 236c685fb7
Attempt #4 to fix Appveyor CI freeze. 2019-08-22 09:17:49 +03:00
cheatfate 708dcbd1a1
Attempt #3 to fix Appveyor CI freeze. 2019-08-22 09:09:44 +03:00
cheatfate 5a45944489
Attempt #2 to fix Appveyor CI freeze. 2019-08-22 08:56:36 +03:00
cheatfate 2ab6b2c3ca
Fix #17.
Add go-libp2p-daemon logging to file.
Fix mistypes in tests.
Fix issues with connection to dedicated go-libp2p2-daemon.
2019-08-22 00:42:44 +03:00
cheatfate dfd824bd03
Fix #22.
Fix wire.initTAddress(MultiAddress).
Add Windows support to daemonapi.
Add CI tests for daemonapi on Windows.
Fix Linux CI tests to install latest daemon.
2019-08-01 08:56:59 +03:00
cheatfate bf7a7f9b73
Fix #23. 2019-06-25 11:27:38 +03:00
Zahary Karadjov 3493b9ff7f Cosmetic changes requested by cheatfate 2019-06-24 05:39:13 +03:00
Zahary Karadjov dbcc6ce78b Add support for specifying the listening address of the Daemon 2019-06-24 05:39:13 +03:00
Zahary Karadjov d5b51bcf9e Use CatchableError 2019-06-24 05:39:13 +03:00
cheatfate 774f5c8232
Proper fix for #18. 2019-06-13 12:05:03 +03:00
cheatfate d685147c52
Move ipnet/iface functionality to nim-chronos.
Adjust tests.
2019-04-15 11:16:54 +03:00
cheatfate ab8b87be9a
Fix deprecation warnings. 2019-03-31 01:32:04 +02:00
cheatfate f8dc3abe36
Add MultiAddress pattern matching procedures (go-multiaddr-fmt) with tests.
Add some comments.
2019-03-20 11:41:37 +02:00
cheatfate 4fa5ee3c93
Move iface.nim and ipnet.nim to proper place. 2019-03-18 10:47:54 +02:00
cheatfate 44d0cc2dea
Fix undefined reference to `br_ec_c25519_m31'. 2019-03-16 00:56:10 +02:00
cheatfate 80ec410118
Fix compilation error. 2019-03-16 00:47:04 +02:00
Ștefan Talpalaru eed7ce92c1
Merge branch 'master' of github.com:status-im/nim-libp2p 2019-03-14 03:56:55 +01:00
Ștefan Talpalaru 7cbb89c7e4
assert() -> doAssert()
and refactored the "test" task in libp2p.nimble
2019-03-14 03:55:47 +01:00
Zahary Karadjov d21953e458 Add a userdata field to the DaemonAPI to support attaching application data 2019-03-11 13:07:19 +02:00
cheatfate dc2d0538ff
Fix import bugs.
Add PublicKey and Signature types to daemonapi.
Add more tests for crypto.nim
2019-03-06 13:23:12 +02:00
cheatfate 39129d0ec1
Add base64 and tests for it.
Adopt multibase to be able to use base64.
Fix base32 typos.
2019-03-06 02:36:09 +02:00
cheatfate d7a7f8102d
Change PeerID type from distinct type.
Fix MultiAddress compilation error.
Fix chat example.
2019-03-05 22:28:46 +02:00
cheatfate a96718cf9e
Add PeerID support to multiaddress.
Change some PeerID api.
Some fixes to chat.
2019-03-05 14:09:26 +02:00
cheatfate 215c6c4257
Add SHA-1 support to multihash.nim, enabled tests for it. 2019-03-05 11:49:59 +02:00
cheatfate 68f3f506f3
Fix multihash dependency. 2019-03-05 02:04:45 +02:00
cheatfate 046c693e3a
Merge branch 'master' of github.com:status-im/nim-libp2p into peer 2019-03-05 01:57:33 +02:00
cheatfate d7d9d7bd40
Fix daemonapi and examples. 2019-03-05 01:57:18 +02:00
Zahary Karadjov db64bd100e Bugfix: Protobuf length prefix was assumed to be 1 byte
The error in the code was that the `vsizeof(n)` was called
with a dummy zeroed variable, instead of the proper size of
the buffer. This resulted in an assertion failure when the
prefix length needs to be stored in more than 1 byte.
2019-03-04 20:26:46 +02:00
cheatfate 1e6c8b2171
Fix examples.
Add peer.nim.
Switch daemonapi to use PeerID from peer.nim.
2019-03-04 20:22:38 +02:00
cheatfate b235c84bb2
Add key interface with test vectors. 2019-03-02 21:19:41 +02:00
cheatfate 14686714c0
Add raw init functions for ecnist.nim
Add ECDHE helpers for ecnist.nim
Add test vectors for ECDHE.
2019-03-01 08:34:52 +02:00
cheatfate 411d9f0b9c
Fix protobuf's do not check error value. 2019-02-28 22:29:03 +02:00
cheatfate 5e6d740ee7
Cleanup. 2019-02-28 18:17:24 +02:00
cheatfate 2a2e378ced
Fix checkScalar in ecnist.
Add ed25519 and tests.
Add some comments.
2019-02-28 14:17:39 +02:00
cheatfate cb334cc8ab
Fix inline documentation. 2019-02-25 20:03:52 +02:00
cheatfate 887795bbd2 Final RSA changes.
Add RSA tests and test vectors.
2019-02-24 02:07:13 +02:00
cheatfate 1aaf4797c9 Finish EC NIST curves implementation.
Add EC NIST curves tests and test vectors.
2019-02-22 13:32:15 +02:00
cheatfate f67a7a2a3e Add minimal ASN.1 encoding/decoding primitives.
Add ASN.1 DER serialization for EC NIST curves.
2019-02-21 06:10:21 +02:00
cheatfate 467d8e1db6 Add BearSSL submodule
Fix common.nim path to BearSSL submodule.
2019-02-20 00:24:43 +02:00
cheatfate 52f88dbd1e Initial commit, not ready yet. 2019-02-20 00:11:59 +02:00
cheatfate f37c6b1fe1 Last rename of asyncdispatch2 -> chronos. 2019-02-14 03:38:21 +02:00
cheatfate ab274f0bdc Rename asyncdispatch2 -> chronos. 2019-02-14 03:15:48 +02:00
cheatfate 7593d4d970 Fix unix path multiaddress serialization/deserialization.
Add tests for unix path multiaddress.
Add wire.nim.
Fix latest breaking changes from go-libp2p-daemon.
2019-01-09 19:12:15 +02:00
cheatfate 7e2d3e213f Add isWire() procedure for MultiAddress. 2018-12-29 14:44:27 +02:00
cheatfate e9785bb509 Make unix socket name generation more reliable (depending on process id).
Add examples of bootstrap node and gossipsub node.
2018-12-18 16:31:58 +02:00
cheatfate 79fbd74acd Remove debug echo. 2018-12-18 05:19:11 +02:00
cheatfate 4ba727b768 Add NAT-PMP support. 2018-12-17 22:39:25 +02:00
cheatfate bf2737525d Fix cid with proper CIDv1 code.
Fix daemonapi to use proper Cid type.
Make daemonapi cid test more complex.
2018-12-16 15:51:12 +02:00
cheatfate d96756f6e3 Add missed file. 2018-12-16 04:55:20 +02:00
cheatfate 38f82df582 Add write() and encode() procedures. 2018-12-16 04:54:07 +02:00
cheatfate 8b00514dd7 Fix compilation error. 2018-12-14 12:28:22 +02:00
cheatfate a7c54c76fb Add write(vbuffer, entity) procedure.
Add validate(openarray[byte])/
2018-12-14 11:49:55 +02:00
cheatfate 0b807e7ee5 Workaround for bug https://github.com/libp2p/go-libp2p-pubsub/issues/130. 2018-12-13 11:17:02 +02:00
cheatfate 39deeca600 Fix for MacOS. 2018-12-12 16:52:29 +02:00
cheatfate 0eb649c990 Add logging `go-libp2p-daemon`.
Comment FloodSub test.
2018-12-12 16:08:55 +02:00
cheatfate 7d60e22782 MultiBase initial implementation with tests. 2018-12-12 03:52:42 +02:00
cheatfate fc6902dda2 Add PeerInfo string representation procedure.
Use only IPv4 for pubsub tests.
2018-12-11 04:17:36 +02:00
cheatfate 01a268a440 Attempt to fix tests. 2018-12-10 22:55:06 +02:00
cheatfate 337c6c932c Fix go-libp2p-daemon shutdown. 2018-12-10 12:38:12 +02:00
cheatfate 7e5f52afff Fixes for pubsub methods and full tests for both methods. 2018-12-09 18:44:20 +02:00
cheatfate b486410ac0 Add multicodec to table and make it single source of multiformat codes.
Adapt multiaddress and multihash to use multicodec.
2018-12-05 17:24:07 +02:00
cheatfate bdcfa1f189 Add multihash test. 2018-12-05 03:01:00 +02:00
cheatfate 53fc4cce41 Fix MultiAddress Onion and P2P address validation and encoding/decoding.
Enabled Onion/P2P tests.
Add nimcrypto dependency to nimble file.
2018-12-05 02:30:50 +02:00
cheatfate 2e1b5b0fbf Fixed multihash implementation. 2018-12-04 23:11:13 +02:00
cheatfate 09facf55e4 Compiler got fail on this. 2018-12-04 19:53:36 +02:00
cheatfate 3abf7df73d Fix base32 encoding and added more tests. 2018-12-03 16:59:40 +02:00
cheatfate 04b4d8f688 Add base32 encoding/decoding procedures and tests. 2018-12-03 15:07:14 +02:00
cheatfate 9d55f41909 Update example chat /consearch now shows if peers are supporting p2p-circuit.
Add utility procedures for multiaddress.
2018-11-27 22:58:16 +02:00
cheatfate b4e9a7b8a6 Fix daemonapi connect/streamOpen to support timeouts.
Add more commands to chat example.
2018-11-27 14:33:41 +02:00
cheatfate 98aa3ed281 Add VBuffer implementation.
Add MultiAddress implementation and tests.
Adapt chat to use /p2p-circuit
2018-11-27 14:16:04 +02:00
cheatfate cd190e62c2 Add base58 encoding and tests. 2018-11-24 00:06:06 +02:00
cheatfate 83c18a5906 Add timeout to CONNECT, STREAM_OPEN. 2018-11-23 12:16:35 +02:00
cheatfate 66973aed3f Simple chat. 2018-11-22 16:12:46 +02:00
cheatfate 3b554d0f51 Add LibP2P varint and tests.
Generalize Varint.
2018-11-20 23:39:35 +02:00
cheatfate f49d67bc0d Add one more test for self-connect-open-accept-stream. 2018-11-19 19:30:40 +02:00
cheatfate 1211ffbb5c Add daemon api sources. 2018-11-19 04:52:11 +02:00