Add comprehensive installation and setup documentation

- Add GETTING_STARTED.md with quick start guide and development modes
- Add INSTALL.sh automated installation script
- Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md
- Add QUICK_REFERENCE.md for common commands
- Add SETUP_GUIDE.md with detailed setup instructions
- Update README.md with improved project overview
- Add did-wallet app dependencies and node_modules
This commit is contained in:
Dorian
2026-01-27 17:18:21 +00:00
parent a81f655133
commit 0d073fa89e
22658 changed files with 4494151 additions and 6 deletions
+24
View File
@@ -0,0 +1,24 @@
# EditorConfig is awesome: http://EditorConfig.org
# Download a plugin for your favorite editor from http://editorconfig.org/#download
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
[*.js]
insert_final_newline = true
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 4
[package.json]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
+59
View File
@@ -0,0 +1,59 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Wizcorp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+69
View File
@@ -0,0 +1,69 @@
# network-interfaces for Node.js
Utility functions for dealing with network interfaces and IP addresses in Node.js.
## Installation
```sh
npm install --save network-interfaces
```
## Usage
All functions take an options object that contains filter instructions. Every property is optional, and leaving one out
means no effort will be made to filter on that specific property.
```js
const ni = require('network-interfaces');
const options = {
internal: false, // boolean: only acknowledge internal or external addresses (undefined: both)
ipVersion: 4 // integer (4 or 6): only acknowledge addresses of this IP address family (undefined: both)
};
```
**Interface name to IP address**
Returns the first IP address found on the interface with the given name. Throws if none can be found.
```js
const ip = ni.toIp('eth0', options);
```
**Interface name to IP addresses**
Returns all IP addresses found on the interface with the given name. Returns empty array if none can be found.
```js
const ips = ni.toIps('eth0', options);
```
**IP address to interface name**
Returns a network interface name for the given IP address. Throws if none can be found.
```js
const interfaceName = ni.fromIp('127.0.0.1', options);
```
**Getting one interface name**
Returns the first network interface name that contains at least one IP address that matches the given options. Throws
if none can be found.
```js
const interfaceName = ni.getInterface(options);
```
**Getting all interface names**
Returns all network interface names that contain at least one IP address that matches the given options. Returns empty
array if none can be found.
```js
const interfaceNames = ni.getInterfaces(options);
```
## License
MIT
+144
View File
@@ -0,0 +1,144 @@
'use strict';
const os = require('os');
function isValid(address, options) {
if (typeof options.internal === 'boolean' && address.internal !== options.internal) {
return false;
}
if (options.ipVersion === 4 && address.family !== 'IPv4') {
return false;
}
if (options.ipVersion === 6 && address.family !== 'IPv6') {
return false;
}
return true;
}
function findAddresses(interfaceName, options = {}) {
const addresses = os.networkInterfaces()[interfaceName];
if (!addresses) {
throw new Error(`Network interface "${interfaceName}" does not exist`);
}
const result = [];
for (const address of addresses) {
if (isValid(address, options)) {
result.push(address);
}
}
return result;
}
/**
* Returns an IP address on the given interface name, filtered by the given options
*
* @param {string} interfaceName
* @param {Object} [options]
* @param {boolean} [options.internal] If given, returns only internal addresses if true, or only external if false
* @param {integer} [options.ipVersion] If given, returns only addresses who match this IP version (4 or 6)
* @returns {string} The first IP address found
*/
exports.toIp = function (interfaceName, options) {
const addresses = findAddresses(interfaceName, options);
if (addresses.length === 0) {
throw new Error(`No suitable IP address found on interface "${interfaceName}"`);
}
return addresses[0].address;
};
/**
* Returns all IP addresses on the given interface name, filtered by the given options
*
* @param {string} interfaceName
* @param {Object} [options]
* @param {boolean} [options.internal] If given, returns only internal addresses if true, or only external if false
* @param {integer} [options.ipVersion] If given, returns only addresses who match this IP version (4 or 6)
* @returns {string[]} All matching IP addresses
*/
exports.toIps = function (interfaceName, options) {
return findAddresses(interfaceName, options).map((address) => address.address);
};
/**
* Returns a network interface name for the given IP address, filtered by the given options
*
* @param {string} ip
* @param {Object} [options]
* @param {boolean} [options.internal] If given, only evaluates internal addresses if true, or only external if false
* @param {integer} [options.ipVersion] If given, only evaluates addresses who match this IP version (4 or 6)
* @returns {string} The interface name that the given IP is bound to
*/
exports.fromIp = function (ip, options) {
const interfaces = os.networkInterfaces();
const interfaceNames = Object.keys(interfaces);
for (const interfaceName of interfaceNames) {
for (const address of interfaces[interfaceName]) {
if (address.address === ip && isValid(address, options)) {
return interfaceName;
}
}
}
throw new Error(`No suitable interfaces were found with IP address "${ip}"`);
};
/**
* Returns the first network interface name that contains at least one IP address that matches the given options
*
* @param {Object} [options]
* @param {boolean} [options.internal] If given, only evaluates internal addresses if true, or only external if false
* @param {integer} [options.ipVersion] If given, only evaluates addresses who match this IP version (4 or 6)
* @returns {string} The matching interface name
*/
exports.getInterface = function (options) {
const interfaces = os.networkInterfaces();
const interfaceNames = Object.keys(interfaces);
for (const interfaceName of interfaceNames) {
if (findAddresses(interfaceName, options).length > 0) {
return interfaceName;
}
}
throw new Error(`No suitable interfaces were found`);
};
/**
* Returns all network interface names that contain at least one IP address that matches the given options
*
* @param {Object} [options]
* @param {boolean} [options.internal] If given, only evaluates internal addresses if true, or only external if false
* @param {integer} [options.ipVersion] If given, only evaluates addresses who match this IP version (4 or 6)
* @returns {string[]} The matching interface names
*/
exports.getInterfaces = function (options) {
const interfaces = os.networkInterfaces();
const interfaceNames = Object.keys(interfaces);
const result = [];
for (const interfaceName of interfaceNames) {
if (findAddresses(interfaceName, options).length > 0) {
result.push(interfaceName);
}
}
return result;
};
+21
View File
@@ -0,0 +1,21 @@
{
"name": "network-interfaces",
"version": "1.1.0",
"description": "Utility functions for dealing with network interfaces and IP addresses in Node.js",
"main": "index.js",
"keywords": [
"interface",
"interfaces",
"network",
"ip"
],
"repository": {
"type": "git",
"url": "https://github.com/Wizcorp/network-interfaces"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Ron Korving <rkorving@wizcorp.jp>",
"license": "MIT"
}