rename package to eth_p2p to make it consistent with our naming scheme
This commit is contained in:
parent
a06bd8789e
commit
812c6284c0
|
@ -5,8 +5,10 @@
|
||||||
This library is a Nim re-implementation of the Ethereum DevP2P networking protocol.
|
This library is a Nim re-implementation of the Ethereum DevP2P networking protocol.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
$ nimble install ethp2p
|
|
||||||
|
|
||||||
|
```
|
||||||
|
$ nimble install eth_p2p
|
||||||
|
```
|
||||||
|
|
||||||
## RLPx
|
## RLPx
|
||||||
|
|
||||||
|
@ -16,7 +18,7 @@ network. Most of the client code of this library should not be concerned
|
||||||
with the implementation details of the underlying protocols and should use
|
with the implementation details of the underlying protocols and should use
|
||||||
the high-level APIs described in this section.
|
the high-level APIs described in this section.
|
||||||
|
|
||||||
To obtain a RLPx connection, use the proc `rlpxConnect` supplying the
|
To obtain a RLPx connection, use the `rlpxConnect` proc supplying the
|
||||||
id of another node in the network. On success, the proc will return a
|
id of another node in the network. On success, the proc will return a
|
||||||
`Peer` object representing the connection. Each of the RLPx sub-protocols
|
`Peer` object representing the connection. Each of the RLPx sub-protocols
|
||||||
consists of a set of strongly-typed messages, which are represented by
|
consists of a set of strongly-typed messages, which are represented by
|
||||||
|
|
|
@ -8,5 +8,5 @@
|
||||||
# MIT license (LICENSE-MIT)
|
# MIT license (LICENSE-MIT)
|
||||||
#
|
#
|
||||||
|
|
||||||
import ethp2p/[ecies, auth, enode, rlpxcrypt, discovery, kademlia]
|
import eth_p2p/[ecies, auth, enode, rlpxcrypt, discovery, kademlia]
|
||||||
export ecies, auth, enode, rlpxcrypt, discovery, kademlia
|
export ecies, auth, enode, rlpxcrypt, discovery, kademlia
|
|
@ -1,6 +1,6 @@
|
||||||
mode = ScriptMode.Verbose
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
packageName = "ethp2p"
|
packageName = "eth_p2p"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
author = "Status Research & Development GmbH"
|
author = "Status Research & Development GmbH"
|
||||||
description = "Ethereum P2P library"
|
description = "Ethereum P2P library"
|
||||||
|
@ -14,7 +14,7 @@ requires "nim > 0.18.0",
|
||||||
"eth_keys",
|
"eth_keys",
|
||||||
"ranges",
|
"ranges",
|
||||||
"stint",
|
"stint",
|
||||||
"https://github.com/status-im/nim-byteutils"
|
"byteutils"
|
||||||
|
|
||||||
proc runTest(name: string, lang = "c") = exec "nim " & lang & " -r tests/" & name
|
proc runTest(name: string, lang = "c") = exec "nim " & lang & " -r tests/" & name
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import ../ethp2p/[discovery, kademlia, peer_pool, enode]
|
import
|
||||||
import eth_keys, net, asyncdispatch, sequtils
|
eth_keys, net, asyncdispatch, sequtils, logging, byteutils,
|
||||||
|
../eth_p2p/[discovery, kademlia, peer_pool, enode]
|
||||||
import logging, byteutils
|
|
||||||
|
|
||||||
addHandler(newConsoleLogger())
|
addHandler(newConsoleLogger())
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,9 @@
|
||||||
# distribution, for details about the copyright.
|
# distribution, for details about the copyright.
|
||||||
#
|
#
|
||||||
|
|
||||||
import unittest
|
import
|
||||||
import eth_keys, ethp2p/auth, nimcrypto/utils, nimcrypto/keccak
|
unittest, eth_keys, nimcrypto/[utils, keccak],
|
||||||
|
eth_p2p/auth
|
||||||
|
|
||||||
# This was generated by `print` actual auth message generated by
|
# This was generated by `print` actual auth message generated by
|
||||||
# https://github.com/ethereum/py-evm/blob/master/tests/p2p/test_auth.py
|
# https://github.com/ethereum/py-evm/blob/master/tests/p2p/test_auth.py
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
# distribution, for details about the copyright.
|
# distribution, for details about the copyright.
|
||||||
#
|
#
|
||||||
|
|
||||||
import unittest
|
import
|
||||||
import eth_keys, ethp2p/auth, ethp2p/rlpxcrypt, nimcrypto/utils
|
unittest, eth_keys,
|
||||||
import nimcrypto/sysrand, nimcrypto/keccak
|
nimcrypto/[utils, sysrand, nimcrypto/keccak],
|
||||||
|
eth_p2p/[auth, rlpxcrypt]
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
("initiator_private_key",
|
("initiator_private_key",
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
# distribution, for details about the copyright.
|
# distribution, for details about the copyright.
|
||||||
#
|
#
|
||||||
|
|
||||||
import unittest
|
import
|
||||||
import eth_keys, ethp2p/ecies
|
unittest, eth_keys,
|
||||||
import nimcrypto/utils, nimcrypto/sha2, nimcrypto/hmac, nimcrypto/rijndael
|
nimcrypto/[utils, sha2, hmac, rijndael],
|
||||||
|
eth_p2p/ecies
|
||||||
|
|
||||||
proc compare[A, B](x: openarray[A], y: openarray[B], s: int = 0): bool =
|
proc compare[A, B](x: openarray[A], y: openarray[B], s: int = 0): bool =
|
||||||
result = true
|
result = true
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
# Apache License, version 2.0, (LICENSE-APACHEv2)
|
||||||
# MIT license (LICENSE-MIT)
|
# MIT license (LICENSE-MIT)
|
||||||
|
|
||||||
import unittest, net, ethp2p/enode
|
import
|
||||||
|
unittest, net, eth_p2p/enode
|
||||||
|
|
||||||
suite "ENode":
|
suite "ENode":
|
||||||
test "Go-Ethereum tests":
|
test "Go-Ethereum tests":
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import ../ethp2p/[discovery, kademlia, peer_pool, enode, server, rlpx]
|
import
|
||||||
import eth_keys, net, asyncdispatch, sequtils
|
eth_keys, net, asyncdispatch, sequtils,
|
||||||
|
../eth_p2p/[discovery, kademlia, peer_pool, enode, server, rlpx]
|
||||||
|
|
||||||
proc localAddress(port: int): Address =
|
proc localAddress(port: int): Address =
|
||||||
let port = Port(port)
|
let port = Port(port)
|
||||||
|
|
Loading…
Reference in New Issue