Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
98 lines
4.0 KiB
JavaScript
Executable File
98 lines
4.0 KiB
JavaScript
Executable File
var Utils = require("../util"),
|
|
Constants = Utils.Constants;
|
|
|
|
/* The entries in the end of central directory */
|
|
module.exports = function () {
|
|
var _volumeEntries = 0,
|
|
_totalEntries = 0,
|
|
_size = 0,
|
|
_offset = 0,
|
|
_commentLength = 0;
|
|
|
|
return {
|
|
get diskEntries () { return _volumeEntries },
|
|
set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; },
|
|
|
|
get totalEntries () { return _totalEntries },
|
|
set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; },
|
|
|
|
get size () { return _size },
|
|
set size (/*Number*/val) { _size = val; },
|
|
|
|
get offset () { return _offset },
|
|
set offset (/*Number*/val) { _offset = val; },
|
|
|
|
get commentLength () { return _commentLength },
|
|
set commentLength (/*Number*/val) { _commentLength = val; },
|
|
|
|
get mainHeaderSize () {
|
|
return Constants.ENDHDR + _commentLength;
|
|
},
|
|
|
|
loadFromBinary : function(/*Buffer*/data) {
|
|
// data should be 22 bytes and start with "PK 05 06"
|
|
// or be 56+ bytes and start with "PK 06 06" for Zip64
|
|
if ((data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) &&
|
|
(data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)) {
|
|
|
|
throw new Error(Utils.Errors.INVALID_END);
|
|
}
|
|
|
|
if (data.readUInt32LE(0) === Constants.ENDSIG) {
|
|
// number of entries on this volume
|
|
_volumeEntries = data.readUInt16LE(Constants.ENDSUB);
|
|
// total number of entries
|
|
_totalEntries = data.readUInt16LE(Constants.ENDTOT);
|
|
// central directory size in bytes
|
|
_size = data.readUInt32LE(Constants.ENDSIZ);
|
|
// offset of first CEN header
|
|
_offset = data.readUInt32LE(Constants.ENDOFF);
|
|
// zip file comment length
|
|
_commentLength = data.readUInt16LE(Constants.ENDCOM);
|
|
} else {
|
|
// number of entries on this volume
|
|
_volumeEntries = Utils.readBigUInt64LE(data, Constants.ZIP64SUB);
|
|
// total number of entries
|
|
_totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT);
|
|
// central directory size in bytes
|
|
_size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZ);
|
|
// offset of first CEN header
|
|
_offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF);
|
|
|
|
_commentLength = 0;
|
|
}
|
|
|
|
},
|
|
|
|
toBinary : function() {
|
|
var b = Buffer.alloc(Constants.ENDHDR + _commentLength);
|
|
// "PK 05 06" signature
|
|
b.writeUInt32LE(Constants.ENDSIG, 0);
|
|
b.writeUInt32LE(0, 4);
|
|
// number of entries on this volume
|
|
b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
|
|
// total number of entries
|
|
b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
|
|
// central directory size in bytes
|
|
b.writeUInt32LE(_size, Constants.ENDSIZ);
|
|
// offset of first CEN header
|
|
b.writeUInt32LE(_offset, Constants.ENDOFF);
|
|
// zip file comment length
|
|
b.writeUInt16LE(_commentLength, Constants.ENDCOM);
|
|
// fill comment memory with spaces so no garbage is left there
|
|
b.fill(" ", Constants.ENDHDR);
|
|
|
|
return b;
|
|
},
|
|
|
|
toString : function() {
|
|
return '{\n' +
|
|
'\t"diskEntries" : ' + _volumeEntries + ",\n" +
|
|
'\t"totalEntries" : ' + _totalEntries + ",\n" +
|
|
'\t"size" : ' + _size + " bytes,\n" +
|
|
'\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" +
|
|
'\t"commentLength" : 0x' + _commentLength + "\n" +
|
|
'}';
|
|
}
|
|
}
|
|
}; |