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
443cd527
Commit
443cd527
authored
Nov 17, 2021
by
Eriksson Monteiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update millix node
parent
e2d9fc68
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
689 additions
and
183 deletions
+689
-183
millix_node/api/NPCpnfUyPHRH4j29/index.js
millix_node/api/NPCpnfUyPHRH4j29/index.js
+54
-0
millix_node/api/rKclyiLtHx0dx55M/index.js
millix_node/api/rKclyiLtHx0dx55M/index.js
+29
-19
millix_node/api/xGaf7vbfY15TGsSd/index.js
millix_node/api/xGaf7vbfY15TGsSd/index.js
+57
-0
millix_node/core/config/api.json
millix_node/core/config/api.json
+18
-0
millix_node/core/config/config.js
millix_node/core/config/config.js
+23
-22
millix_node/core/wallet/wallet-sync.js
millix_node/core/wallet/wallet-sync.js
+179
-58
millix_node/core/wallet/wallet-transaction-consensus.js
millix_node/core/wallet/wallet-transaction-consensus.js
+62
-40
millix_node/core/wallet/wallet.js
millix_node/core/wallet/wallet.js
+52
-14
millix_node/database/database.js
millix_node/database/database.js
+3
-0
millix_node/database/repositories/transaction.js
millix_node/database/repositories/transaction.js
+194
-27
millix_node/database/shard.js
millix_node/database/shard.js
+16
-1
millix_node/index.js
millix_node/index.js
+1
-1
millix_node/net/peer.js
millix_node/net/peer.js
+1
-1
No files found.
millix_node/api/NPCpnfUyPHRH4j29/index.js
0 → 100644
View file @
443cd527
import
database
from
'
../../database/database
'
;
import
Endpoint
from
'
../endpoint
'
;
import
genesisConfig
from
'
../../core/genesis/genesis-config
'
;
import
_
from
'
lodash
'
;
/**
* api get_known_wallet_balance
*/
class
_NPCpnfUyPHRH4j29
extends
Endpoint
{
constructor
()
{
super
(
'
NPCpnfUyPHRH4j29
'
);
}
/**
* returns the available (stable) balance and pending (unstable) balance of
* all known wallet
* @param app
* @param req
* @param res
* @returns {*}
*/
handler
(
app
,
req
,
res
)
{
const
transactionRepository
=
database
.
getRepository
(
'
transaction
'
,
genesisConfig
.
genesis_shard_id
);
transactionRepository
.
getAllWalletBalance
(
true
)
.
then
(
stableBalance
=>
{
const
balance
=
{};
return
transactionRepository
.
getAllWalletBalance
(
false
)
.
then
(
pendingBalance
=>
{
_
.
each
(
stableBalance
,
item
=>
balance
[
item
.
address_key_identifier
]
=
{
...
item
,
balance_pending
:
_
.
find
(
pendingBalance
,
{
address_key_identifier
:
item
.
address_key_identifier
})?.
balance_pending
||
0
});
_
.
each
(
pendingBalance
,
item
=>
{
if
(
!
balance
[
item
.
address_key_identifier
])
{
balance
[
item
.
address_key_identifier
]
=
{
address_key_identifier
:
item
.
address_key_identifier
,
balance_stable
:
0
,
balance_pending
:
item
.
balance_pending
};
}
});
res
.
send
(
_
.
values
(
balance
));
});
})
.
catch
(
e
=>
res
.
send
({
api_status
:
'
fail
'
,
api_message
:
`unexpected generic api error: (
${
e
}
)`
}));
}
}
export
default
new
_NPCpnfUyPHRH4j29
();
millix_node/api/rKclyiLtHx0dx55M/index.js
View file @
443cd527
...
...
@@ -4,6 +4,7 @@ import database from '../../database/database';
import
_
from
'
lodash
'
;
import
network
from
'
../../net/network
'
;
import
logManager
from
'
../../core/log-manager
'
;
import
genesisConfig
from
'
../../core/genesis/genesis-config
'
;
/**
...
...
@@ -31,25 +32,34 @@ class _rKclyiLtHx0dx55M extends Endpoint {
return
transactionRepository
.
getWalletBalance
(
wallet
.
defaultKeyIdentifier
,
false
);
}).
then
(
balances
=>
_
.
sum
(
balances
)).
then
(
unstable
=>
{
return
wallet
.
getTransactionCount
().
then
(
transactionCount
=>
{
return
database
.
getRepository
(
'
transaction
'
).
countWalletUnstableTransactions
(
wallet
.
defaultKeyIdentifier
).
then
(
pendingTransactionCount
=>
{
res
.
send
({
balance
:
{
stable
,
unstable
},
network
:
{
online
:
network
.
initialized
,
peer_count
:
network
.
registeredClients
.
length
},
log
:
{
log_count
:
logManager
.
lastIdx
,
backlog_count
:
logManager
.
backLogSize
},
transaction
:
{
transaction_count
:
transactionCount
,
transaction_pending_validation
:
pendingTransactionCount
}
});
const
transactionRepository
=
database
.
getRepository
(
'
transaction
'
,
genesisConfig
.
genesis_shard_id
);
return
transactionRepository
.
countWalletUnstableTransactions
(
wallet
.
defaultKeyIdentifier
).
then
(
pendingTransactionCount
=>
{
return
transactionRepository
.
countAllUnstableTransactions
()
.
then
(
countAllUnstableTransactions
=>
{
return
transactionRepository
.
countAllTransactions
()
.
then
(
countAllTransactions
=>
{
res
.
send
({
balance
:
{
stable
,
unstable
},
network
:
{
online
:
network
.
initialized
,
peer_count
:
network
.
registeredClients
.
length
},
log
:
{
log_count
:
logManager
.
lastIdx
,
backlog_count
:
logManager
.
backLogSize
},
transaction
:
{
transaction_count
:
countAllTransactions
,
transaction_unstable_count
:
countAllUnstableTransactions
,
transaction_wallet_count
:
transactionCount
,
transaction_wallet_unstable_count
:
pendingTransactionCount
}
});
});
});
});
});
});
...
...
millix_node/api/xGaf7vbfY15TGsSd/index.js
0 → 100644
View file @
443cd527
import
database
from
'
../../database/database
'
;
import
Endpoint
from
'
../endpoint
'
;
import
genesisConfig
from
'
../../core/genesis/genesis-config
'
;
import
_
from
'
lodash
'
;
/**
* api get_known_address_balance
*/
class
_xGaf7vbfY15TGsSd
extends
Endpoint
{
constructor
()
{
super
(
'
xGaf7vbfY15TGsSd
'
);
}
/**
* returns the available (stable) balance and pending (unstable) balance of
* all known addresses
* @param app
* @param req
* @param res
* @returns {*}
*/
handler
(
app
,
req
,
res
)
{
const
transactionRepository
=
database
.
getRepository
(
'
transaction
'
,
genesisConfig
.
genesis_shard_id
);
transactionRepository
.
getAllAddressBalance
(
true
)
.
then
(
stableBalance
=>
{
const
balance
=
{};
return
transactionRepository
.
getAllAddressBalance
(
false
)
.
then
(
pendingBalance
=>
{
_
.
each
(
stableBalance
,
item
=>
balance
[
item
.
address
]
=
{
...
item
,
balance_pending
:
_
.
find
(
pendingBalance
,
{
address
:
item
.
address
})?.
balance_pending
||
0
});
_
.
each
(
pendingBalance
,
item
=>
{
if
(
!
balance
[
item
.
address
])
{
balance
[
item
.
address
]
=
{
address
:
item
.
address
,
balance_stable
:
0
,
balance_pending
:
item
.
balance_pending
};
}
else
{
balance
[
item
.
address
][
'
balance_pending
'
]
=
item
.
balance_pending
;
}
});
res
.
send
(
_
.
values
(
balance
));
});
})
.
catch
(
e
=>
res
.
send
({
api_status
:
'
fail
'
,
api_message
:
`unexpected generic api error: (
${
e
}
)`
}));
}
}
export
default
new
_xGaf7vbfY15TGsSd
();
millix_node/core/config/api.json
View file @
443cd527
...
...
@@ -440,6 +440,24 @@
"version_released"
:
"1.11.5"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"NPCpnfUyPHRH4j29"
,
"name"
:
"get_known_wallet_balance"
,
"description"
:
"returns the available (stable) balance and pending (unstable) balance of all known wallet"
,
"method"
:
"GET"
,
"version_released"
:
"1.11.5"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
},
{
"id"
:
"xGaf7vbfY15TGsSd"
,
"name"
:
"get_known_address_balance"
,
"description"
:
"returns the available (stable) balance and pending (unstable) balance of all known addresses"
,
"method"
:
"GET"
,
"version_released"
:
"1.11.5"
,
"permission"
:
"{
\"
require_identity
\"
: true,
\"
private
\"
: true}"
,
"enable"
:
true
}
]
}
millix_node/core/config/config.js
View file @
443cd527
...
...
@@ -709,14 +709,14 @@ export const NODE_CONNECTION_INBOUND_WHITELIST = [];
export
const
NODE_CONNECTION_OUTBOUND_WHITELIST
=
[];
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
CONSENSUS_ROUND_NODE_COUNT
=
3
;
export
const
CONSENSUS_ROUND_VALIDATION_REQUIRED
=
2
;
export
const
CONSENSUS_ROUND_VALIDATION_MAX
=
5
;
export
const
CONSENSUS_ROUND_NOT_FOUND_MAX
=
5
;
export
const
CONSENSUS_ROUND_DOUBLE_SPEND_MAX
=
5
;
export
const
CONSENSUS_ROUND_NODE_COUNT
=
12
;
export
const
CONSENSUS_ROUND_VALIDATION_REQUIRED
=
3
;
export
const
CONSENSUS_ROUND_VALIDATION_MAX
=
3
;
export
const
CONSENSUS_ROUND_NOT_FOUND_MAX
=
3
;
export
const
CONSENSUS_ROUND_DOUBLE_SPEND_MAX
=
3
;
export
const
CONSENSUS_VALIDATION_DEPTH_MAX
=
50
;
export
const
CONSENSUS_VALIDATION_REQUEST_DEPTH_MAX
=
10000
;
export
const
CONSENSUS_VALIDATION_WAIT_TIME_MAX
=
30
*
1000
;
export
const
CONSENSUS_VALIDATION_WAIT_TIME_MAX
=
15
*
1000
;
export
const
CONSENSUS_VALIDATION_RETRY_WAIT_TIME
=
10
*
1000
;
export
const
CONSENSUS_VALIDATION_PARALLEL_PROCESS_MAX
=
2
;
export
const
CONSENSUS_VALIDATION_PARALLEL_REQUEST_MAX
=
2
;
...
...
@@ -734,8 +734,8 @@ export const TRANSACTION_SIGNATURE_MAX = 128;
export
const
TRANSACTION_PROGRESSIVE_SYNC_TIMESPAN
=
60
;
export
const
TRANSACTION_OUTPUT_REFRESH_OLDER_THAN
=
10
;
export
const
TRANSACTION_OUTPUT_EXPIRE_OLDER_THAN
=
10
;
export
const
NODE_CONNECTION_INBOUND_MAX
=
3
0
;
export
const
NODE_CONNECTION_OUTBOUND_MAX
=
3
0
;
export
const
NODE_CONNECTION_INBOUND_MAX
=
6
0
;
export
const
NODE_CONNECTION_OUTBOUND_MAX
=
6
0
;
export
const
NODE_CONNECTION_PUBLIC_PERCENT
=
0.2
;
export
const
HEARTBEAT_TIMEOUT
=
10
*
1000
;
export
const
HEARTBEAT_RESPONSE_TIMEOUT
=
60
*
1000
;
...
...
@@ -772,7 +772,7 @@ export const DATABASE_ENGINE = 'sqlite';
export
const
DATABASE_CONNECTION
=
{};
export
const
MILLIX_CIRCULATION
=
9
e15
;
export
const
NODE_MILLIX_BUILD_DATE
=
1631097631
;
export
const
NODE_MILLIX_VERSION
=
'
1.11.
8
-tangled
'
;
export
const
NODE_MILLIX_VERSION
=
'
1.11.
10
-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
;
...
...
@@ -804,19 +804,20 @@ export const PEER_ROTATION_CONFIG = {
};
if
(
DATABASE_ENGINE
===
'
sqlite
'
)
{
DATABASE_CONNECTION
.
MAX_CONNECTIONS
=
1
;
DATABASE_CONNECTION
.
FOLDER
=
DATA_BASE_DIR
+
'
/
'
;
DATABASE_CONNECTION
.
FILENAME_MILLIX
=
'
millix.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_QUEUE
=
'
millix_transaction_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_SPEND_QUEUE
=
'
millix_transaction_spend_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_UNRESOLVED_QUEUE
=
'
millix_transaction_unresolved_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_JOB_ENGINE
=
'
millix_job_engine.sqlite
'
;
DATABASE_CONNECTION
.
SCRIPT_INIT_MILLIX
=
'
./scripts/initialize-millix-sqlite3.sql
'
;
DATABASE_CONNECTION
.
SCRIPT_INIT_MILLIX_SHARD
=
'
./scripts/initialize-millix-shard-sqlite3.sql
'
;
DATABASE_CONNECTION
.
SCRIPT_INIT_MILLIX_JOB_ENGINE
=
'
./scripts/initialize-millix-job-engine-sqlite3.sql
'
;
DATABASE_CONNECTION
.
SCRIPT_MIGRATION_DIR
=
'
./scripts/migration
'
;
DATABASE_CONNECTION
.
SCRIPT_MIGRATION_SHARD_DIR
=
'
./scripts/migration/shard
'
;
DATABASE_CONNECTION
.
SCHEMA_VERSION
=
'
16
'
;
DATABASE_CONNECTION
.
MAX_CONNECTIONS
=
1
;
DATABASE_CONNECTION
.
FOLDER
=
DATA_BASE_DIR
+
'
/
'
;
DATABASE_CONNECTION
.
FILENAME_MILLIX
=
'
millix.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_QUEUE
=
'
millix_transaction_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_SPEND_QUEUE
=
'
millix_transaction_spend_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_SPEND_WALLET_QUEUE
=
'
millix_transaction_spend_wallet_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_TRANSACTION_UNRESOLVED_QUEUE
=
'
millix_transaction_unresolved_queue.sqlite
'
;
DATABASE_CONNECTION
.
FILENAME_JOB_ENGINE
=
'
millix_job_engine.sqlite
'
;
DATABASE_CONNECTION
.
SCRIPT_INIT_MILLIX
=
'
./scripts/initialize-millix-sqlite3.sql
'
;
DATABASE_CONNECTION
.
SCRIPT_INIT_MILLIX_SHARD
=
'
./scripts/initialize-millix-shard-sqlite3.sql
'
;
DATABASE_CONNECTION
.
SCRIPT_INIT_MILLIX_JOB_ENGINE
=
'
./scripts/initialize-millix-job-engine-sqlite3.sql
'
;
DATABASE_CONNECTION
.
SCRIPT_MIGRATION_DIR
=
'
./scripts/migration
'
;
DATABASE_CONNECTION
.
SCRIPT_MIGRATION_SHARD_DIR
=
'
./scripts/migration/shard
'
;
DATABASE_CONNECTION
.
SCHEMA_VERSION
=
'
16
'
;
}
export
default
{
...
...
millix_node/core/wallet/wallet-sync.js
View file @
443cd527
This diff is collapsed.
Click to expand it.
millix_node/core/wallet/wallet-transaction-consensus.js
View file @
443cd527
This diff is collapsed.
Click to expand it.
millix_node/core/wallet/wallet.js
View file @
443cd527
...
...
@@ -380,13 +380,8 @@ class Wallet {
.
catch
((
e
)
=>
{
this
.
_transactionSendInterrupt
=
false
;
if
(
e
===
'
proxy_not_found
'
)
{
async
.
eachSeries
(
transactionOutputIDSpent
,
(
transactionID
,
callback
)
=>
{
database
.
applyShards
((
shardID
)
=>
{
const
transactionRepository
=
database
.
getRepository
(
'
transaction
'
,
shardID
);
return
transactionRepository
.
resetTransaction
(
transactionID
);
}).
then
(
_
=>
callback
());
});
if
(
e
===
'
transaction_proxy_rejected
'
)
{
this
.
resetTransactionValidationRejected
();
}
reject
(
e
);
...
...
@@ -569,13 +564,44 @@ class Wallet {
walletTransactionConsensus
.
resetTransactionValidationRejected
();
database
.
applyShards
(
shardID
=>
{
const
transactionRepository
=
database
.
getRepository
(
'
transaction
'
,
shardID
);
return
transactionRepository
.
listTransactionWithFreeOutput
(
this
.
defaultKeyIdentifier
)
return
transactionRepository
.
listTransactionWithFreeOutput
(
this
.
defaultKeyIdentifier
,
true
)
.
then
(
transactions
=>
new
Promise
(
resolve
=>
{
async
.
eachSeries
(
transactions
,
(
transaction
,
callback
)
=>
{
transactionRepository
.
resetTransaction
(
transaction
.
transaction_id
)
.
then
(()
=>
callback
())
.
catch
(()
=>
callback
());
},
()
=>
resolve
());
},
()
=>
resolve
(
new
Set
(
_
.
map
(
transactions
,
t
=>
t
.
transaction_id
))));
}))
.
then
(
rootTransactions
=>
new
Promise
(
resolve
=>
{
const
dfs
=
(
transactions
,
visited
=
new
Set
())
=>
{
const
listInputTransactionIdSpendingTransaction
=
new
Set
();
async
.
eachSeries
(
transactions
,
(
transactionID
,
callback
)
=>
{
transactionRepository
.
listTransactionInput
({
'
output_transaction_id
'
:
transactionID
})
.
then
(
inputs
=>
{
inputs
.
forEach
(
input
=>
{
if
(
!
visited
.
has
(
input
.
transaction_id
))
{
listInputTransactionIdSpendingTransaction
.
add
(
input
.
transaction_id
);
visited
.
add
(
input
.
transaction_id
);
}
});
callback
();
}).
catch
(()
=>
callback
());
},
()
=>
{
async
.
eachSeries
(
listInputTransactionIdSpendingTransaction
,
(
transactionID
,
callback
)
=>
{
transactionRepository
.
resetTransaction
(
transactionID
)
.
then
(()
=>
callback
())
.
catch
(()
=>
callback
());
},
()
=>
{
if
(
listInputTransactionIdSpendingTransaction
.
size
>
0
)
{
dfs
(
listInputTransactionIdSpendingTransaction
,
visited
);
}
else
{
resolve
();
}
});
});
};
dfs
(
rootTransactions
);
}));
}).
then
(
_
=>
_
);
}
...
...
@@ -783,9 +809,7 @@ class Wallet {
this
.
transactionSpendRequest
(
transaction
.
transaction_id
,
syncPriority
).
then
(
_
=>
_
).
catch
(
_
=>
_
);
if
(
isFundingWallet
||
hasKeyIdentifier
)
{
walletSync
.
syncTransactionSpendingOutputs
(
transaction
);
}
walletSync
.
syncTransactionSpendingOutputs
(
transaction
);
if
(
transaction
.
transaction_id
!==
genesisConfig
.
genesis_transaction
)
{
_
.
each
(
transaction
.
transaction_input_list
,
inputTransaction
=>
{
...
...
@@ -1563,8 +1587,22 @@ class Wallet {
error
:
true
,
message
:
e
})
:
callback
());
},
data
=>
data
&&
data
.
error
&&
typeof
data
.
message
===
'
string
'
&&
!
proxyErrorList
.
includes
(
data
.
message
)
?
reject
(
data
.
message
)
:
data
&&
data
.
transaction
?
resolve
(
data
.
transaction
)
:
reject
(
'
proxy_not_found
'
));
},
data
=>
{
if
(
data
&&
data
.
error
&&
typeof
data
.
message
===
'
string
'
&&
!
proxyErrorList
.
includes
(
data
.
message
))
{
reject
(
data
.
message
);
}
else
if
(
data
&&
data
.
transaction
)
{
resolve
(
data
.
transaction
);
}
else
{
if
(
data
&&
data
.
error
&&
typeof
data
.
message
===
'
string
'
&&
data
.
message
===
'
transaction_proxy_rejected
'
)
{
reject
(
'
transaction_proxy_rejected
'
);
}
else
{
reject
(
'
proxy_not_found
'
);
}
}
});
});
});
}
...
...
millix_node/database/database.js
View file @
443cd527
...
...
@@ -472,6 +472,9 @@ export class Database {
}
if
(
orderBy
)
{
if
(
orderBy
.
trim
().
split
(
"
"
).
length
===
1
)
{
orderBy
+=
'
asc
'
;
}
const
regExp
=
/^
(?<
column>
\w
+
)
(?<
order>asc|desc
)
$/
.
exec
(
orderBy
);
if
(
regExp
&&
regExp
.
groups
&&
regExp
.
groups
.
column
&&
regExp
.
groups
.
order
)
{
data
=
_
.
orderBy
(
data
,
regExp
.
groups
.
column
,
regExp
.
groups
.
order
);
...
...
millix_node/database/repositories/transaction.js
View file @
443cd527
This diff is collapsed.
Click to expand it.
millix_node/database/shard.js
View file @
443cd527
...
...
@@ -5,6 +5,7 @@ import {Schema, Transaction} from './repositories/repositories';
import
path
from
'
path
'
;
import
{
Database
}
from
'
./database
'
;
import
eventBus
from
'
../core/event-bus
'
;
import
os
from
'
os
'
;
export
default
class
Shard
{
constructor
(
databaseFile
,
shardID
)
{
...
...
@@ -16,6 +17,7 @@ export default class Shard {
initialize
()
{
if
(
config
.
DATABASE_ENGINE
===
'
sqlite
'
)
{
return
this
.
_initializeMillixShardSqlite3
()
.
then
(()
=>
this
.
_attachShardZero
())
.
then
(()
=>
this
.
_migrateTables
())
.
then
(()
=>
this
.
_initializeTables
());
}
...
...
@@ -23,7 +25,7 @@ export default class Shard {
}
_initializeTables
()
{
this
.
repositories
[
'
transaction
'
]
=
new
Transaction
(
this
.
database
);
this
.
repositories
[
'
transaction
'
]
=
new
Transaction
(
this
.
database
);
return
Promise
.
resolve
();
}
...
...
@@ -74,6 +76,19 @@ export default class Shard {
});
}
_attachShardZero
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
databaseRootFolder
=
path
.
join
(
os
.
homedir
(),
config
.
DATABASE_CONNECTION
.
FOLDER
);
const
shardZeroDBPath
=
path
.
join
(
databaseRootFolder
,
config
.
DATABASE_CONNECTION
.
FILENAME_MILLIX
);
this
.
database
.
exec
(
`ATTACH DATABASE '
${
shardZeroDBPath
}
' AS shard_zero`
,
(
err
)
=>
{
if
(
err
)
{
return
reject
(
err
);
}
return
resolve
();
});
});
}
_initializeMillixShardSqlite3
()
{
return
new
Promise
(
resolve
=>
{
const
sqlite3
=
require
(
'
sqlite3
'
);
...
...
millix_node/index.js
View file @
443cd527
...
...
@@ -126,6 +126,6 @@ db.initialize()
});
}
});
//millix v1.11.
8
-tangled
//millix v1.11.
10
-tangled
\ No newline at end of file
millix_node/net/peer.js
View file @
443cd527
...
...
@@ -677,7 +677,7 @@ class Peer {
callbackCalled
=
true
;
reject
();
}
},
config
.
NETWORK_LONG_TIME_WAIT_MAX
);
},
config
.
NETWORK_LONG_TIME_WAIT_MAX
*
3
);
}
else
{
reject
();
...
...
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