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
4a1943c6
Commit
4a1943c6
authored
Dec 20, 2021
by
Eriksson Monteiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update millix node
parent
e497b430
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
212 additions
and
65 deletions
+212
-65
millix_node/README.md
millix_node/README.md
+1
-1
millix_node/api/2wYLWQfWBa6GLPYs/index.js
millix_node/api/2wYLWQfWBa6GLPYs/index.js
+39
-0
millix_node/api/LLpSTquu4tZL8Nu5/index.js
millix_node/api/LLpSTquu4tZL8Nu5/index.js
+32
-14
millix_node/api/XgxHmjINTEqANwtS/index.js
millix_node/api/XgxHmjINTEqANwtS/index.js
+40
-0
millix_node/api/qRHogKQ1Bb7OT4N9/index.js
millix_node/api/qRHogKQ1Bb7OT4N9/index.js
+19
-0
millix_node/core/config/api.json
millix_node/core/config/api.json
+28
-1
millix_node/core/config/config.js
millix_node/core/config/config.js
+2
-2
millix_node/database/repositories/config.js
millix_node/database/repositories/config.js
+9
-6
millix_node/docker/Dockerfile
millix_node/docker/Dockerfile
+26
-26
millix_node/docker/docker-compose.yml
millix_node/docker/docker-compose.yml
+14
-14
millix_node/index.js
millix_node/index.js
+1
-1
millix_node/net/network.js
millix_node/net/network.js
+1
-0
No files found.
millix_node/README.md
View file @
4a1943c6
...
...
@@ -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.1
1.6
</small>
millix node
<small>
v1.1
2.7
</small>
<br>
</h1>
...
...
millix_node/api/2wYLWQfWBa6GLPYs/index.js
0 → 100644
View file @
4a1943c6
import
database
from
'
../../database/database
'
;
import
Endpoint
from
'
../endpoint
'
;
/**
* api get_config_by_name
*/
class
_2wYLWQfWBa6GLPYs
extends
Endpoint
{
constructor
()
{
super
(
'
2wYLWQfWBa6GLPYs
'
);
}
/**
* get config value by name
* @param app
* @param req
* @param res
* @returns {*}
*/
handler
(
app
,
req
,
res
)
{
const
{
p0
:
configName
}
=
req
.
query
;
if
(
!
configName
)
{
return
res
.
status
(
400
).
send
({
api_status
:
'
fail
'
,
api_message
:
'
p0<config_name> is required
'
});
}
const
configurationRepository
=
database
.
getRepository
(
'
config
'
);
configurationRepository
.
getConfig
(
configName
.
toLowerCase
())
.
then
(
configuration
=>
res
.
send
(
configuration
))
.
catch
(
e
=>
res
.
send
({
api_status
:
'
fail
'
,
api_message
:
`unexpected generic api error: (
${
e
}
)`
}));
}
}
export
default
new
_2wYLWQfWBa6GLPYs
();
\ No newline at end of file
millix_node/api/LLpSTquu4tZL8Nu5/index.js
View file @
4a1943c6
...
...
@@ -18,21 +18,39 @@ class _LLpSTquu4tZL8Nu5 extends Endpoint {
* @returns {*}
*/
handler
(
app
,
req
,
res
)
{
const
{
p0
:
configID
,
p1
:
value
}
=
req
.
query
;
if
(
!
configID
||
value
===
undefined
)
{
return
res
.
status
(
400
).
send
({
api_status
:
'
fail
'
,
api_message
:
'
p0<config_id> and p1<value> are required
'
});
}
if
(
req
.
method
===
'
POST
'
)
{
if
(
!
req
.
body
.
p0
||
!
req
.
body
.
p1
)
{
return
res
.
status
(
400
)
.
send
({
api_status
:
'
fail
'
,
api_message
:
`p0<config_id> and p1<config_value> are rquired`
})
}
let
configID
=
req
.
body
.
p0
;
let
value
=
req
.
body
.
p1
;
const
configurationRepository
=
database
.
getRepository
(
'
config
'
);
if
(
typeof
value
===
'
object
'
)
{
value
=
JSON
.
stringify
(
value
);
}
const
configurationRepository
=
database
.
getRepository
(
'
config
'
);
configurationRepository
.
updateConfigByID
(
configID
,
value
)
.
then
(()
=>
res
.
send
({
api_status
:
'
success
'
}))
.
catch
(
e
=>
res
.
send
({
api_status
:
'
fail
'
,
api_message
:
`unexpected generic api error: (
${
e
}
)`
}));
configurationRepository
.
updateConfigByID
(
configID
,
value
)
.
then
((
row
)
=>
res
.
send
({
api_status
:
'
success
'
,
row
:
row
}))
.
catch
(
e
=>
res
.
send
({
api_status
:
'
fail
'
,
api_message
:
`unexpected generic api error: (
${
e
}
)`
}));
}
else
{
return
res
.
status
(
400
)
.
send
({
api_status
:
'
fail
'
,
api_message
:
'
POST only
'
})
}
}
}
...
...
millix_node/api/XgxHmjINTEqANwtS/index.js
0 → 100644
View file @
4a1943c6
import
database
from
'
../../database/database
'
;
import
Endpoint
from
"
../endpoint
"
;
/**
* api remove_address_version
*/
class
_XgxHmjINTEqANwtS
extends
Endpoint
{
constructor
()
{
super
(
'
XgxHmjINTEqANwtS
'
);
}
/**
*
* @param app
* @param req
* @param res
* @returns {*}
*/
handler
(
app
,
req
,
res
)
{
const
{
p0
:
version
}
=
req
.
query
;
if
(
!
version
)
{
return
res
.
status
(
400
).
send
({
api_status
:
'
fail
'
,
api_message
:
'
p0<version> is required
'
});
}
database
.
getRepository
(
'
address
'
)
.
removeAddressVersion
(
version
)
.
then
(()
=>
res
.
send
({
app_status
:
'
success
'
}))
.
catch
(
e
=>
res
.
send
({
api_status
:
'
fail
'
,
api_message
:
`unexpected generic api error: (
${
e
}
)`
}));
}
}
export
default
new
_XgxHmjINTEqANwtS
();
\ No newline at end of file
millix_node/api/qRHogKQ1Bb7OT4N9/index.js
0 → 100644
View file @
4a1943c6
import
network
from
"
../../net/network
"
;
import
Endpoint
from
"
../endpoint
"
;
/**
* api get_node_public_ip
*/
class
_qRHogKQ1Bb7OT4N9
extends
Endpoint
{
constructor
()
{
super
(
'
qRHogKQ1Bb7OT4N9
'
);
}
handler
(
app
,
req
,
res
)
{
res
.
send
({
node_public_ip
:
network
.
nodePublicIp
})
}
}
export
default
new
_qRHogKQ1Bb7OT4N9
();
\ No newline at end of file
millix_node/core/config/api.json
View file @
4a1943c6
...
...
@@ -238,7 +238,7 @@
"id"
:
"LLpSTquu4tZL8Nu5"
,
"name"
:
"update_config_value"
,
"description"
:
"updates table config value field for the indicated config_id record"
,
"method"
:
"
GE
T"
,
"method"
:
"
POS
T"
,
"version_released"
:
"1.2.0"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
...
...
@@ -441,6 +441,15 @@
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"2wYLWQfWBa6GLPYs"
,
"name"
:
"get_config_by_name"
,
"description"
:
"get node config by name"
,
"method"
:
"GET"
,
"version_released"
:
"1.11.6"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"NPCpnfUyPHRH4j29"
,
"name"
:
"get_known_wallet_balance"
,
...
...
@@ -450,6 +459,24 @@
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"qRHogKQ1Bb7OT4N9"
,
"name"
:
"get_node_public_ip"
,
"description"
:
"get node public ip"
,
"method"
:
"GET"
,
"version_released"
:
"1.11.6"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"XgxHmjINTEqANwtS"
,
"name"
:
"remove_address_version"
,
"description"
:
"remove wallet address version"
,
"method"
:
"GET"
,
"version_released"
:
"1.11.6"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"xGaf7vbfY15TGsSd"
,
"name"
:
"get_known_address_balance"
,
...
...
millix_node/core/config/config.js
View file @
4a1943c6
...
...
@@ -771,8 +771,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
=
16
31097631
;
export
const
NODE_MILLIX_VERSION
=
'
1.12.
6
-tangled
'
;
export
const
NODE_MILLIX_BUILD_DATE
=
16
40009160
;
export
const
NODE_MILLIX_VERSION
=
'
1.12.
7
-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/database/repositories/config.js
View file @
4a1943c6
...
...
@@ -39,8 +39,7 @@ export default class Config {
],
(
err
,
row
)
=>
{
if
(
err
)
{
reject
(
row
);
}
else
{
}
else
{
resolve
(
row
);
}
});
...
...
@@ -60,11 +59,15 @@ export default class Config {
}
updateConfigByID
(
configID
,
value
)
{
let
where
=
{
config_id
:
configID
};
let
set
=
[];
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
database
.
run
(
'
UPDATE config SET value=? WHERE config_id=?
'
,
[
configID
,
value
],
(
err
,
row
)
=>
{
set
[
'
value
'
]
=
value
;
const
{
sql
,
parameters
}
=
Database
.
buildUpdate
(
'
UPDATE config
'
,
set
,
where
);
this
.
database
.
run
(
sql
,
parameters
,
(
err
,
row
)
=>
{
if
(
err
)
{
return
reject
(
err
.
message
);
}
...
...
millix_node/docker/Dockerfile
View file @
4a1943c6
FROM
node:12-alpine
RUN
apk update
&&
\
apk add --no-cache --virtual .build-deps-full \
build-base \
python2 \
curl \
wget \
gcc \
git
RUN
git clone https://github.com/millix/millix-node.git
-b
develop
WORKDIR
/millix-node
RUN
npm
install
-g
@babel/cli@7.8.4 @babel/core@7.8.4 @babel/node@7.8.4
&&
\
npm install
ENV
MILLIX_NODE_PASSWORD="millixpwd"
ENV
MILLIX_NODE_PORT=30000
ENV
MILLIX_NODE_PORT_API=5500
ENV
MILLIX_NODE_DATA_FOLDER="./data/"
COPY
run_node.sh run_node.sh
RUN
chmod
+x run_node.sh
EXPOSE
$MILLIX_NODE_PORT
EXPOSE
$MILLIX_NODE_PORT_API
ENTRYPOINT
[ "/bin/sh" ]
CMD
[ "run_node.sh" ]
FROM
node:12-alpine
RUN
apk update
&&
\
apk add
--no-cache
--virtual
.build-deps-full
\
build-base
\
python2
\
curl
\
wget
\
gcc
\
git
RUN
git clone https://github.com/millix/millix-node.git
-b
develop
WORKDIR
/millix-node
RUN
npm
install
-g
@babel/cli@7.8.4 @babel/core@7.8.4 @babel/node@7.8.4
&&
\
npm
install
ENV
MILLIX_NODE_PASSWORD="millixpwd"
ENV
MILLIX_NODE_PORT=30000
ENV
MILLIX_NODE_PORT_API=5500
ENV
MILLIX_NODE_DATA_FOLDER="./data/"
COPY
run_node.sh run_node.sh
RUN
chmod
+x run_node.sh
EXPOSE
$MILLIX_NODE_PORT
EXPOSE
$MILLIX_NODE_PORT_API
ENTRYPOINT
[ "/bin/sh" ]
CMD
[ "run_node.sh" ]
millix_node/docker/docker-compose.yml
View file @
4a1943c6
version
:
'
3'
services
:
millix-node
:
image
:
millix/millix-node
build
:
.
environment
:
-
MILLIX_NODE_PASSWORD=millixpwd
-
MILLIX_NODE_DATA_FOLDER=./data/
-
MILLIX_NODE_PORT=${MILLIX_NODE_PORT}
-
MILLIX_NODE_PORT_API=${MILLIX_NODE_PORT_API}
ports
:
-
${MILLIX_NODE_PORT}
-
${MILLIX_NODE_PORT_API}
version
:
'
3'
services
:
millix-node
:
image
:
millix/millix-node
build
:
.
environment
:
-
MILLIX_NODE_PASSWORD=millixpwd
-
MILLIX_NODE_DATA_FOLDER=./data/
-
MILLIX_NODE_PORT=${MILLIX_NODE_PORT}
-
MILLIX_NODE_PORT_API=${MILLIX_NODE_PORT_API}
ports
:
-
${MILLIX_NODE_PORT}
-
${MILLIX_NODE_PORT_API}
millix_node/index.js
View file @
4a1943c6
...
...
@@ -126,6 +126,6 @@ db.initialize()
});
}
});
//millix v1.12.
6
-tangled
//millix v1.12.
7
-tangled
\ No newline at end of file
millix_node/net/network.js
View file @
4a1943c6
...
...
@@ -918,6 +918,7 @@ class Network {
if
(
!
config
.
NODE_NAT_PMP
)
{
return
Promise
.
resolve
();
}
const
portMapper
=
util
.
promisify
(
this
.
natAPI
.
map
.
bind
(
this
.
natAPI
));
return
portMapper
({
publicPort
:
config
.
NODE_PORT
,
...
...
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