Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tangled
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eriksson monteiro
tangled
Commits
1f641fad
Commit
1f641fad
authored
Sep 08, 2021
by
Eriksson Monteiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update millix-node v1.11.6
parent
39531639
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
20 deletions
+61
-20
millix_node/README.md
millix_node/README.md
+1
-1
millix_node/api/server.js
millix_node/api/server.js
+1
-0
millix_node/core/config/config.js
millix_node/core/config/config.js
+2
-2
millix_node/core/wallet/wallet-transaction-consensus.js
millix_node/core/wallet/wallet-transaction-consensus.js
+0
-7
millix_node/index.js
millix_node/index.js
+1
-1
millix_node/net/network.js
millix_node/net/network.js
+55
-9
millix_node/package.json
millix_node/package.json
+1
-0
No files found.
millix_node/README.md
View file @
1f641fad
...
...
@@ -2,7 +2,7 @@
<br>
<a
href=
"#"
><img
src=
"https://github.com/millix/millix-wallet/blob/master/app/icon.png?raw=true"
alt=
"millix node"
width=
"200"
></a>
<br>
millix node
<small>
v1.11.
5
</small>
millix node
<small>
v1.11.
6
</small>
<br>
</h1>
...
...
millix_node/api/server.js
View file @
1f641fad
...
...
@@ -79,6 +79,7 @@ class Server {
}
else
{
console
.
log
(
'
api source code not found
'
);
database
.
getRepository
(
'
api
'
).
removeAPI
(
api
.
api_id
);
}
});
...
...
millix_node/core/config/config.js
View file @
1f641fad
...
...
@@ -766,8 +766,8 @@ export const NETWORK_SHORT_TIME_WAIT_MAX = 1500;
export
const
DATABASE_ENGINE
=
'
sqlite
'
;
export
const
DATABASE_CONNECTION
=
{};
export
const
MILLIX_CIRCULATION
=
9
e15
;
export
const
NODE_MILLIX_BUILD_DATE
=
163
0421866
;
export
const
NODE_MILLIX_VERSION
=
'
1.11.
5
-tangled
'
;
export
const
NODE_MILLIX_BUILD_DATE
=
163
1097631
;
export
const
NODE_MILLIX_VERSION
=
'
1.11.
6
-tangled
'
;
export
const
DATA_BASE_DIR_MAIN_NETWORK
=
'
./millix-tangled
'
;
export
const
DATA_BASE_DIR_TEST_NETWORK
=
'
./millix-tangled
'
;
let
DATA_BASE_DIR
=
MODE_TEST_NETWORK
?
DATA_BASE_DIR_TEST_NETWORK
:
DATA_BASE_DIR_MAIN_NETWORK
;
...
...
millix_node/core/wallet/wallet-transaction-consensus.js
View file @
1f641fad
...
...
@@ -207,13 +207,6 @@ export class WalletTransactionConsensus {
message
:
`not validated in a depth of
${
depth
}
`
});
}
else
if
(
transaction
&&
(
transaction
.
status
===
2
||
database
.
getRepository
(
'
transaction
'
).
isExpired
(
transaction
.
transaction_date
)))
{
return
reject
({
cause
:
'
transaction_validation_max_depth
'
,
transaction_id_fail
:
transactionID
,
message
:
`transaction expired and not validated`
});
}
if
(
transaction
&&
transaction
.
is_stable
!==
undefined
)
{
// transaction object needs to be normalized
transaction
=
database
.
getRepository
(
'
transaction
'
).
normalizeTransactionObject
(
transaction
);
...
...
millix_node/index.js
View file @
1f641fad
...
...
@@ -108,4 +108,4 @@ db.initialize()
});
}
});
//millix v1.11.
5
-tangled
//millix v1.11.
6
-tangled
millix_node/net/network.js
View file @
1f641fad
...
...
@@ -16,6 +16,7 @@ import util from 'util';
import
dns
from
'
dns
'
;
import
DHT
from
'
bittorrent-dht
'
;
import
signature
from
'
../core/crypto/signature
'
;
import
NatAPI
from
'
nat-api
'
;
const
WebSocketServer
=
Server
;
...
...
@@ -291,7 +292,11 @@ class Network {
this
.
addNode
(
node
.
node_prefix
,
node
.
node_address
,
node
.
node_port
,
node
.
node_port_api
,
node
.
node_id
);
callback
();
},
()
=>
{
_
.
each
(
_
.
shuffle
(
config
.
NODE_INITIAL_LIST
),
({
host
,
port_protocol
:
port
,
port_api
:
portApi
})
=>
{
_
.
each
(
_
.
shuffle
(
config
.
NODE_INITIAL_LIST
),
({
host
,
port_protocol
:
port
,
port_api
:
portApi
})
=>
{
let
prefix
=
config
.
WEBSOCKET_PROTOCOL
;
let
url
=
`
${
prefix
}
://
${
host
}
:
${
port
}
`
;
if
((
!
this
.
_nodeList
[
url
]
||
!
this
.
_nodeList
[
url
].
node_id
)
&&
(
prefix
&&
host
&&
port
&&
portApi
))
{
...
...
@@ -793,9 +798,35 @@ class Network {
}
}
doPortMapping
()
{
const
portMapper
=
util
.
promisify
(
this
.
natAPI
.
map
);
return
portMapper
({
publicPort
:
config
.
NODE_PORT
,
privatePort
:
config
.
NODE_PORT
,
protocol
:
'
TCP
'
,
description
:
'
millix network
'
})
.
then
(()
=>
portMapper
({
publicPort
:
config
.
NODE_PORT_API
,
privatePort
:
config
.
NODE_PORT_API
,
protocol
:
'
TCP
'
,
description
:
'
millix api
'
}))
.
then
(()
=>
portMapper
({
publicPort
:
config
.
NODE_PORT_DISCOVERY
,
privatePort
:
config
.
NODE_PORT_DISCOVERY
,
protocol
:
'
UDP
'
,
description
:
'
millix discovery
'
}));
}
_initializeServer
(
certificatePem
,
certificatePrivateKeyPem
)
{
console
.
log
(
'
node id :
'
,
this
.
nodeID
);
this
.
startAcceptingConnections
(
certificatePem
,
certificatePrivateKeyPem
);
this
.
natAPI
=
new
NatAPI
();
this
.
doPortMapping
()
.
then
(()
=>
this
.
startAcceptingConnections
(
certificatePem
,
certificatePrivateKeyPem
))
.
catch
(()
=>
this
.
startAcceptingConnections
(
certificatePem
,
certificatePrivateKeyPem
));
this
.
connectToNodes
();
this
.
initialized
=
true
;
eventBus
.
on
(
'
node_handshake
'
,
this
.
_onNodeHandshake
.
bind
(
this
));
...
...
@@ -835,13 +866,21 @@ class Network {
console
.
log
(
'
[network] node public-ip
'
,
ip
);
this
.
nodePublicIp
=
ip
;
walletUtils
.
loadNodeKeyAndCertificate
()
.
then
(({
certificate_private_key_pem
:
certificatePrivateKeyPem
,
certificate_pem
:
certificatePem
,
node_private_key
:
privateKey
,
node_public_key
:
publicKey
})
=>
{
.
then
(({
certificate_private_key_pem
:
certificatePrivateKeyPem
,
certificate_pem
:
certificatePem
,
node_private_key
:
privateKey
,
node_public_key
:
publicKey
})
=>
{
this
.
nodePrivateKey
=
privateKey
;
this
.
nodePublicKey
=
base58
.
encode
(
publicKey
.
toBuffer
());
this
.
nodeID
=
walletUtils
.
getNodeIdFromPublicKey
(
this
.
nodePublicKey
);
const
nodeIDHash160
=
objectHash
.
getSHA1Buffer
(
this
.
nodeID
);
this
.
_initializeServer
(
certificatePem
,
certificatePrivateKeyPem
);
const
bootstrap
=
_
.
map
(
config
.
NODE_INITIAL_LIST
,
({
host
,
port_discovery
:
port
})
=>
`
${
host
}
:
${
port
}
`
);
const
bootstrap
=
_
.
map
(
config
.
NODE_INITIAL_LIST
,
({
host
,
port_discovery
:
port
})
=>
`
${
host
}
:
${
port
}
`
);
this
.
dht
=
new
DHT
({
nodeId
:
nodeIDHash160
,
verify
:
(
sign
,
value
,
publicKeyRaw
)
=>
{
...
...
@@ -863,7 +902,7 @@ class Network {
this
.
dht
.
on
(
'
node
'
,
node
=>
{
console
.
log
(
`[network] new node discovered
${
node
.
host
}
:
${
node
.
port
}
`
);
});
console
.
log
(
config
.
NODE_PORT_DISCOVERY
);
this
.
dht
.
listen
(
config
.
NODE_PORT_DISCOVERY
);
this
.
dht
.
on
(
'
listening
'
,
()
=>
{
const
address
=
this
.
dht
.
address
();
...
...
@@ -914,10 +953,11 @@ class Network {
newSeqNumber
=
0
;
}
const
proxyData
=
previousProxyData
[
this
.
nodeID
]
;
let
newProxyData
;
const
nodeAddressDefault
=
address
.
address_key_identifier
+
address
.
address_version
+
address
.
address_key_identifier
;
if
(
this
.
_shouldUpdateProxyData
(
proxyData
,
this
.
nodePublicIp
,
config
.
NODE_PORT
,
config
.
TRANSACTION_FEE_PROXY
,
nodeAddressDefault
))
{
previousProxyData
[
this
.
nodeID
]
=
{
if
(
this
.
_shouldUpdateProxyData
(
previousProxyData
,
this
.
nodePublicIp
,
config
.
NODE_PORT
,
config
.
TRANSACTION_FEE_PROXY
,
nodeAddressDefault
))
{
newProxyData
=
{
node_id
:
this
.
nodeID
,
node_host
:
this
.
nodePublicIp
,
node_prefix
:
config
.
WEBSOCKET_PROTOCOL
,
node_port
:
config
.
NODE_PORT
,
...
...
@@ -926,14 +966,20 @@ class Network {
node_address_default
:
nodeAddressDefault
};
}
else
{
return
;
}
const
data
=
{
k
:
publicKey
,
seq
:
newSeqNumber
,
v
:
JSON
.
stringify
(
previous
ProxyData
),
v
:
JSON
.
stringify
(
new
ProxyData
),
sign
:
function
(
buf
)
{
return
signature
.
sign
(
objectHash
.
getHashBuffer
(
buf
,
true
),
privateKey
,
'
buffer
'
);
}
};
console
.
log
(
`[network] dht v=
${
data
.
v
}
, len=
${
data
.
v
.
length
}
`
);
this
.
dht
.
put
(
data
,
(
err
,
hash
)
=>
{
console
.
log
(
'
[network] dht key identifier registered hash=
'
,
hash
.
toString
(
'
hex
'
),
'
, err=
'
,
err
);
});
...
...
millix_node/package.json
View file @
1f641fad
...
...
@@ -39,6 +39,7 @@
"jwks-rsa"
:
"^1.5.1"
,
"lodash"
:
"^4.17.11"
,
"moment"
:
"^2.24.0"
,
"nat-api"
:
"^0.3.1"
,
"ntp-time-sync"
:
"^0.1.0"
,
"public-ip"
:
"^4.0.1"
,
"request"
:
"^2.88.0"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment