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
6467175e
Commit
6467175e
authored
Aug 18, 2022
by
Eriksson Monteiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tangled browser ui
parent
8b952e86
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
114 deletions
+133
-114
chrome/browser/resources/millix/app/static/js/main.chunk.js
chrome/browser/resources/millix/app/static/js/main.chunk.js
+1
-1
chrome/browser/resources/millix/app/static/js/main.chunk.js.map
.../browser/resources/millix/app/static/js/main.chunk.js.map
+1
-1
millix_node/api/SLzLU50givH77Rns/index.js
millix_node/api/SLzLU50givH77Rns/index.js
+76
-73
millix_node/core/config/config.js
millix_node/core/config/config.js
+29
-16
millix_node/core/storage/file-manager.js
millix_node/core/storage/file-manager.js
+26
-23
No files found.
chrome/browser/resources/millix/app/static/js/main.chunk.js
View file @
6467175e
This diff is collapsed.
Click to expand it.
chrome/browser/resources/millix/app/static/js/main.chunk.js.map
View file @
6467175e
This diff is collapsed.
Click to expand it.
millix_node/api/SLzLU50givH77Rns/index.js
View file @
6467175e
This diff is collapsed.
Click to expand it.
millix_node/core/config/config.js
View file @
6467175e
const
CONST_VALUE_DEFAULT
=
{
const
CONST_VALUE_DEFAULT
=
{
'
MODE_DEBUG
'
:
false
,
'
MODE_DEBUG
'
:
false
,
'
MODE_TEST_NETWORK
'
:
true
,
'
MODE_TEST_NETWORK
'
:
false
,
'
NODE_MILLIX_BUILD_DATE
'
:
1660820789
,
'
NODE_MILLIX_BUILD_DATE
'
:
1660831931
,
'
NODE_MILLIX_VERSION
'
:
'
1.20.4-testnet
'
,
'
NODE_MILLIX_VERSION
'
:
'
1.20.4
'
,
'
DATA_BASE_DIR_MAIN_NETWORK
'
:
'
./millix-tangled-testnet
'
,
'
DATA_BASE_DIR_MAIN_NETWORK
'
:
'
./millix
'
,
'
DATA_BASE_DIR_TEST_NETWORK
'
:
'
./millix-tangled-testnet
'
,
'
DATA_BASE_DIR_TEST_NETWORK
'
:
'
./millix-testnet
'
,
'
DEBUG_LOG_FILTER
'
:
[]
'
DEBUG_LOG_FILTER
'
:
[],
'
NODE_PORT_STORAGE_RECEIVER_TEST_NETWORK
'
:
6000
,
'
NODE_PORT_STORAGE_RECEIVER_MAIN_NETWORK
'
:
8000
,
'
NODE_PORT_STORAGE_PROVIDER_TEST_NETWORK
'
:
6001
,
'
NODE_PORT_STORAGE_PROVIDER_MAIN_NETWORK
'
:
8001
,
'
CONSENSUS_ROUND_NODE_COUNT
'
:
12
,
'
CONSENSUS_ROUND_VALIDATION_REQUIRED
'
:
3
,
'
CONSENSUS_ROUND_VALIDATION_MAX
'
:
3
,
'
CONSENSUS_ROUND_NOT_FOUND_MAX
'
:
3
,
'
CONSENSUS_ROUND_DOUBLE_SPEND_MAX
'
:
3
,
'
CONSENSUS_VALIDATION_WAIT_TIME_MAX
'
:
15
*
1000
};
};
let
environment
;
let
environment
;
...
@@ -40,10 +53,10 @@ export const NODE_PORT_MAIN_NETWORK = 10000;
...
@@ -40,10 +53,10 @@ export const NODE_PORT_MAIN_NETWORK = 10000;
export
const
NODE_PORT_TEST_NETWORK
=
30000
;
export
const
NODE_PORT_TEST_NETWORK
=
30000
;
export
const
NODE_PORT_DISCOVERY_TEST_NETWORK
=
4000
;
export
const
NODE_PORT_DISCOVERY_TEST_NETWORK
=
4000
;
export
const
NODE_PORT_DISCOVERY_MAIN_NETWORK
=
2000
;
export
const
NODE_PORT_DISCOVERY_MAIN_NETWORK
=
2000
;
export
const
NODE_PORT_STORAGE_RECEIVER_TEST_NETWORK
=
6000
;
export
const
NODE_PORT_STORAGE_RECEIVER_TEST_NETWORK
=
getConstValue
(
'
NODE_PORT_STORAGE_RECEIVER_TEST_NETWORK
'
)
;
export
const
NODE_PORT_STORAGE_RECEIVER_MAIN_NETWORK
=
8000
;
export
const
NODE_PORT_STORAGE_RECEIVER_MAIN_NETWORK
=
getConstValue
(
'
NODE_PORT_STORAGE_RECEIVER_MAIN_NETWORK
'
)
;
export
const
NODE_PORT_STORAGE_PROVIDER_TEST_NETWORK
=
6001
;
export
const
NODE_PORT_STORAGE_PROVIDER_TEST_NETWORK
=
getConstValue
(
'
NODE_PORT_STORAGE_PROVIDER_TEST_NETWORK
'
)
;
export
const
NODE_PORT_STORAGE_PROVIDER_MAIN_NETWORK
=
8001
;
export
const
NODE_PORT_STORAGE_PROVIDER_MAIN_NETWORK
=
getConstValue
(
'
NODE_PORT_STORAGE_PROVIDER_MAIN_NETWORK
'
)
;
export
const
NODE_PORT_STORAGE_RECEIVER
=
MODE_TEST_NETWORK
?
NODE_PORT_STORAGE_RECEIVER_TEST_NETWORK
:
NODE_PORT_STORAGE_RECEIVER_MAIN_NETWORK
;
export
const
NODE_PORT_STORAGE_RECEIVER
=
MODE_TEST_NETWORK
?
NODE_PORT_STORAGE_RECEIVER_TEST_NETWORK
:
NODE_PORT_STORAGE_RECEIVER_MAIN_NETWORK
;
export
const
NODE_PORT_STORAGE_PROVIDER
=
MODE_TEST_NETWORK
?
NODE_PORT_STORAGE_PROVIDER_TEST_NETWORK
:
NODE_PORT_STORAGE_PROVIDER_MAIN_NETWORK
;
export
const
NODE_PORT_STORAGE_PROVIDER
=
MODE_TEST_NETWORK
?
NODE_PORT_STORAGE_PROVIDER_TEST_NETWORK
:
NODE_PORT_STORAGE_PROVIDER_MAIN_NETWORK
;
export
const
NODE_PORT_DISCOVERY
=
MODE_TEST_NETWORK
?
NODE_PORT_DISCOVERY_TEST_NETWORK
:
NODE_PORT_DISCOVERY_MAIN_NETWORK
;
export
const
NODE_PORT_DISCOVERY
=
MODE_TEST_NETWORK
?
NODE_PORT_DISCOVERY_TEST_NETWORK
:
NODE_PORT_DISCOVERY_MAIN_NETWORK
;
...
@@ -757,14 +770,14 @@ export const NODE_CONNECTION_INBOUND_WHITELIST = [];
...
@@ -757,14 +770,14 @@ export const NODE_CONNECTION_INBOUND_WHITELIST = [];
export
const
NODE_CONNECTION_OUTBOUND_WHITELIST
=
[];
export
const
NODE_CONNECTION_OUTBOUND_WHITELIST
=
[];
export
const
NODE_CONNECTION_STATIC
=
[];
export
const
NODE_CONNECTION_STATIC
=
[];
export
const
NODE_INITIAL_LIST
=
MODE_TEST_NETWORK
?
NODE_INITIAL_LIST_TEST_NETWORK
:
NODE_INITIAL_LIST_MAIN_NETWORK
;
export
const
NODE_INITIAL_LIST
=
MODE_TEST_NETWORK
?
NODE_INITIAL_LIST_TEST_NETWORK
:
NODE_INITIAL_LIST_MAIN_NETWORK
;
export
const
CONSENSUS_ROUND_NODE_COUNT
=
2
;
export
const
CONSENSUS_ROUND_NODE_COUNT
=
getConstValue
(
'
CONSENSUS_ROUND_NODE_COUNT
'
)
;
export
const
CONSENSUS_ROUND_VALIDATION_REQUIRED
=
1
;
export
const
CONSENSUS_ROUND_VALIDATION_REQUIRED
=
getConstValue
(
'
CONSENSUS_ROUND_VALIDATION_REQUIRED
'
)
;
export
const
CONSENSUS_ROUND_VALIDATION_MAX
=
3
;
export
const
CONSENSUS_ROUND_VALIDATION_MAX
=
getConstValue
(
'
CONSENSUS_ROUND_VALIDATION_MAX
'
)
;
export
const
CONSENSUS_ROUND_NOT_FOUND_MAX
=
3
;
export
const
CONSENSUS_ROUND_NOT_FOUND_MAX
=
getConstValue
(
'
CONSENSUS_ROUND_NOT_FOUND_MAX
'
)
;
export
const
CONSENSUS_ROUND_DOUBLE_SPEND_MAX
=
3
;
export
const
CONSENSUS_ROUND_DOUBLE_SPEND_MAX
=
getConstValue
(
'
CONSENSUS_ROUND_DOUBLE_SPEND_MAX
'
)
;
export
const
CONSENSUS_VALIDATION_DEPTH_MAX
=
50
;
export
const
CONSENSUS_VALIDATION_DEPTH_MAX
=
50
;
export
const
CONSENSUS_VALIDATION_REQUEST_DEPTH_MAX
=
100
;
export
const
CONSENSUS_VALIDATION_REQUEST_DEPTH_MAX
=
100
;
export
const
CONSENSUS_VALIDATION_WAIT_TIME_MAX
=
15
*
1000
;
export
const
CONSENSUS_VALIDATION_WAIT_TIME_MAX
=
getConstValue
(
'
CONSENSUS_VALIDATION_WAIT_TIME_MAX
'
)
;
export
const
CONSENSUS_VALIDATION_RETRY_WAIT_TIME
=
10
*
1000
;
export
const
CONSENSUS_VALIDATION_RETRY_WAIT_TIME
=
10
*
1000
;
export
const
CONSENSUS_VALIDATION_PARALLEL_PROCESS_MAX
=
2
;
export
const
CONSENSUS_VALIDATION_PARALLEL_PROCESS_MAX
=
2
;
export
const
CONSENSUS_VALIDATION_PARALLEL_REQUEST_MAX
=
2
;
export
const
CONSENSUS_VALIDATION_PARALLEL_REQUEST_MAX
=
2
;
...
...
millix_node/core/storage/file-manager.js
View file @
6467175e
...
@@ -254,30 +254,32 @@ class FileManager {
...
@@ -254,30 +254,32 @@ class FileManager {
}
}
getBufferByTransactionAndFileHash
(
transactionId
,
addressKeyIdentifier
,
attributeTypeId
,
fileHash
,
fileKey
=
null
)
{
getBufferByTransactionAndFileHash
(
transactionId
,
addressKeyIdentifier
,
attributeTypeId
,
fileHash
,
fileKey
=
null
)
{
return
this
.
getAttributesByTransactionAndFileHash
(
transactionId
,
addressKeyIdentifier
,
attributeTypeId
,
fileHash
,
fileKey
).
then
(([
attributes
,
data
])
=>
{
return
this
.
getAttributesByTransactionAndFileHash
(
transactionId
,
addressKeyIdentifier
,
attributeTypeId
,
fileHash
,
fileKey
).
then
(([
attributes
,
data
])
=>
this
.
getDecryptedBuffer
(
attributes
,
data
,
attributeTypeId
,
fileHash
,
fileKey
));
for
(
const
attribute
of
attributes
)
{
}
attribute
.
value
=
JSON
.
parse
(
attribute
.
value
);
if
(
attribute
.
attribute_type_id
===
this
.
normalizationRepository
.
get
(
'
transaction_output_metadata
'
))
{
const
file
=
_
.
find
(
attribute
.
value
.
file_list
,
file
=>
file
.
hash
===
fileHash
);
if
(
!
file
)
{
return
Promise
.
reject
(
'
file_not_found
'
);
}
const
key
=
fileKey
?
Buffer
.
from
(
fileKey
,
'
hex
'
)
:
file
.
key
||
file
[
wallet
.
defaultKeyIdentifier
]?.
key
;
getDecryptedBuffer
(
attributes
,
transactionData
,
attributeTypeId
,
fileHash
,
fileKey
=
null
)
{
for
(
const
attribute
of
attributes
)
{
attribute
.
value
=
JSON
.
parse
(
attribute
.
value
);
if
(
attribute
.
attribute_type_id
===
this
.
normalizationRepository
.
get
(
'
transaction_output_metadata
'
))
{
const
file
=
_
.
find
(
attribute
.
value
.
file_list
,
file
=>
file
.
hash
===
fileHash
);
if
(
!
file
)
{
return
Promise
.
reject
(
'
file_not_found
'
);
}
if
(
!
key
)
{
const
key
=
fileKey
?
Buffer
.
from
(
fileKey
,
'
hex
'
)
:
file
.
key
||
file
[
wallet
.
defaultKeyIdentifier
]?.
key
;
return
Promise
.
reject
(
'
decrypt_key_not_found
'
);
}
const
dataType
=
file
.
type
||
'
json
'
;
if
(
!
key
)
{
return
this
.
decryptFile
(
data
.
address_key_identifier_from
,
data
.
transaction_date
,
data
.
transaction_id
,
file
.
hash
,
key
,
!!
fileKey
||
file
.
public
).
then
(
fileData
=>
({
return
Promise
.
reject
(
'
decrypt_key_not_found
'
);
file_data
:
fileData
,
mime_type
:
file
.
mime_type
,
data_type
:
dataType
}));
}
}
const
dataType
=
file
.
type
||
'
json
'
;
return
this
.
decryptFile
(
transactionData
.
address_key_identifier_from
,
transactionData
.
transaction_date
,
transactionData
.
transaction_id
,
file
.
hash
,
key
,
!!
fileKey
||
file
.
public
).
then
(
fileData
=>
({
file_data
:
fileData
,
mime_type
:
file
.
mime_type
,
data_type
:
dataType
}));
}
}
}
);
}
}
}
getBufferMetaByTransactionAndFileHash
(
transactionId
,
addressKeyIdentifier
,
attributeTypeId
,
fileHash
,
fileKey
=
null
)
{
getBufferMetaByTransactionAndFileHash
(
transactionId
,
addressKeyIdentifier
,
attributeTypeId
,
fileHash
,
fileKey
=
null
)
{
...
@@ -321,7 +323,7 @@ class FileManager {
...
@@ -321,7 +323,7 @@ class FileManager {
});
});
}).
then
(
attributes
=>
{
}).
then
(
attributes
=>
{
for
(
const
attribute
of
attributes
)
{
for
(
const
attribute
of
attributes
)
{
if
(
attribute
.
attribute_type_id
===
this
.
normalizationRepository
.
get
(
'
transaction_output_metadata
'
))
{
if
(
attribute
.
attribute_type_id
===
database
.
getRepository
(
'
normalization
'
)
.
get
(
'
transaction_output_metadata
'
))
{
attribute
.
value
=
JSON
.
parse
(
attribute
.
value
);
attribute
.
value
=
JSON
.
parse
(
attribute
.
value
);
const
file
=
_
.
find
(
attribute
.
value
.
file_list
,
file
=>
file
.
hash
===
fileHash
);
const
file
=
_
.
find
(
attribute
.
value
.
file_list
,
file
=>
file
.
hash
===
fileHash
);
if
(
!
file
)
{
if
(
!
file
)
{
...
@@ -468,9 +470,10 @@ class FileManager {
...
@@ -468,9 +470,10 @@ class FileManager {
if
(
file
.
type
.
endsWith
(
'
_meta
'
)
&&
file
.
name
.
endsWith
(
'
_meta
'
))
{
if
(
file
.
type
.
endsWith
(
'
_meta
'
)
&&
file
.
name
.
endsWith
(
'
_meta
'
))
{
const
dataFileName
=
file
.
name
.
substring
(
0
,
file
.
name
.
length
-
5
);
const
dataFileName
=
file
.
name
.
substring
(
0
,
file
.
name
.
length
-
5
);
keySet
[
file
.
name
]
=
keySet
[
dataFileName
];
keySet
[
file
.
name
]
=
keySet
[
dataFileName
];
fileCipher
=
crypto
.
createCipher
(
'
aes-256-cbc
'
,
keySet
[
file
.
name
]);
fileCipher
=
crypto
.
createCipher
(
'
aes-256-cbc
'
,
keySet
[
file
.
name
]);
}
else
{
}
else
{
fileCipher
=
crypto
.
createCipher
(
'
aes-256-cbc
'
,
keySet
[
file
.
name
]);
fileCipher
=
crypto
.
createCipher
(
'
aes-256-cbc
'
,
keySet
[
file
.
name
]);
}
}
...
...
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