A Node-RED fork for machine-to-machine commerce powered by Hedera blockchain technology. This package provides custom nodes for buyers and sellers to interact with the Neuron network.
Before you begin, ensure you have the following installed:
- Node.js (v18.5 or higher - required for Node-RED 4.x)
- Go (v1.19 or higher)
- Git
Note: Node-RED is already included in this package, so no separate installation is required.
This package requires two Go-based dependencies that must be compiled from source:
- neuron-go-hedera-sdk - The Go Hedera SDK
- neuron-nodered-sdk-wrapper - The Node-RED SDK wrapper
Both must be compiled for your specific platform and placed in the same directory.
- macOS (Intel x64 and Apple Silicon ARM64)
- Linux (x64 and ARM64)
- Windows (x64)
git clone <repository-url>
cd neuron-nodebuildernpm installBefore starting the application, you must compile the Node-RED editor assets:
npx grunt buildThis step is required for Node-RED 4.x to function properly. It compiles:
- JavaScript source files into minified bundles
- SASS files into CSS
- Vendor libraries into production assets
- Creates the
public/directory with all required static files
Without this step, the web interface will not load and you'll see a black screen with MIME type errors.
After running grunt build, verify the public directory exists:
ls packages/node_modules/@node-red/editor-client/public/
# Should show: red/, vendor/, types/, favicon.icoFollow the detailed instructions in the Building Dependencies from Source section below to compile the required Go dependencies.
A .env file is pre-filled with default values in the project root. Do not change the pre-filled values. You only need to update the following variables:
# Your Hedera Credentials (Required - obtain from neuron website)
HEDERA_OPERATOR_ID=0.0.XXXXXX
HEDERA_OPERATOR_KEY=3030020100300706052b8104000a04220420...
HEDERA_OPERATOR_EVM=0x1234567890abcdef...
# SDK Configuration (Required - path to compiled wrapper)
NEURON_SDK_PATH=/path/to/neuron-nodered-sdk-wrapper
# Optional: Logging Configuration
SDK_LOG_FOLDER=/path/to/logs- Hedera Credentials: You must obtain
HEDERA_OPERATOR_ID,HEDERA_OPERATOR_KEY, andHEDERA_OPERATOR_EVMby creating an account on the Neuron website - NEURON_SDK_PATH: Must point to the full path of
neuron-nodered-sdk-wrapperexecutable you compiled - SDK_LOG_FOLDER: Optional. If not set, process logs will be suppressed
- Pre-filled Values: All other values in the
.envfile are pre-configured and should not be changed
The package includes a submodule for the neuron-registration library. Build it:
cd neuron/nodes/neuron-registration
npm install
npm run build
cd ../../..Start Neuron Node Builder with the custom settings:
npm run startFollow these steps to compile the required Go dependencies from source:
- Go (v1.19 or higher) - Download from golang.org
- Git
# Using Homebrew
brew install go
# Or download from golang.org
# Visit https://golang.org/dl/ and download the macOS installer# Ubuntu/Debian
sudo apt update
sudo apt install golang-go
# CentOS/RHEL/Fedora
sudo yum install golang
# or
sudo dnf install golangDownload the installer from golang.org/dl/
go version# Clone the repository
git clone https://github.com/NeuronInnovations/neuron-nodered-sdk-wrapper.git
cd neuron-nodered-sdk-wrapper
# Build for your platform
go build -o neuron-nodered-sdk-wrapper
# For cross-platform builds:
# macOS ARM64 (Apple Silicon)
GOOS=darwin GOARCH=arm64 go build -o neuron-nodered-sdk-wrapper-darwin-arm64
# macOS Intel
GOOS=darwin GOARCH=amd64 go build -o neuron-nodered-sdk-wrapper-darwin-amd64
# Linux x64
GOOS=linux GOARCH=amd64 go build -o neuron-nodered-sdk-wrapper-linux-amd64
# Linux ARM64
GOOS=linux GOARCH=arm64 go build -o neuron-nodered-sdk-wrapper-linux-arm64
# Windows
GOOS=windows GOARCH=amd64 go build -o neuron-nodered-sdk-wrapper.exeMove compiled executables to a directory. For example, create a bin directory in your project:
# Create bin directory
mkdir -p bin
# Copy the compiled executables
cp ../neuron-nodered-sdk-wrapper/neuron-nodered-sdk-wrapper bin/
# Make them executable (on Unix-like systems)
chmod +x bin/neuron-nodered-sdk-wrapperUpdate your .env file to point to the compiled wrapper:
# SDK Configuration
NEURON_SDK_PATH=/path/to/your/project/bin/neuron-nodered-sdk-wrapperWhen you first start Neuron Node Builder, you'll be automatically redirected to a setup wizard if your Hedera credentials are not configured. The wizard will:
- Prompt you to enter your Hedera credentials
- Save them to the
.envfile - Redirect you to the normal Neuron Node Builder interface
The Buyer node allows you to:
- Create a buyer device on the Hedera network
- Connect to selected seller nodes
- Consume data from the Neuron network
Configuration:
- Smart Contract: Select the contract type (jetvision, chat, challenges)
- Device Type: Specify the type of device
- Select Sellers: Choose which seller nodes to connect to
The Seller node allows you to:
- Create a seller device on the Hedera network
- Publish data to the network
- Connect to selected buyer nodes
Configuration:
- Device Name: Name of your seller device
- Smart Contract: Select the contract type
- Device Role: Role of the device
- Serial Number: Unique identifier
- Device Type: Type of device
- Price: Price for the service
- Select Buyers: Choose which buyer nodes to connect to
This section covers how to package the Neuron Node Builder application into standalone executables and create professional distribution packages for macOS.
- Node.js 20.x (required for optimal memory management)
- macOS (for creating macOS packages)
- Apple Developer Account (for code signing and notarization)
- Valid Code Signing Certificate (Developer ID Application certificate)
First, build the standalone executable using the included build script:
# Build the standalone executable
npm run packageThis will:
- Download the required
neuron-wrapperbinaries for your platform - Package Node-RED and all dependencies into a single executable
- Generate the executable in
build/releases/directory
Note: The build process uses pkg with optimized memory settings to prevent OOM errors.
Create a professional macOS application bundle:
# Create .app bundle
npm run create-app-bundleThis generates:
build/releases/Neuron-Node-builder.app- A proper macOS application bundle- Includes all necessary resources and dependencies
- Ready for code signing and distribution
Alternatively, create a professional DMG installer:
# Create DMG installer
npm run create-dmgThis generates:
build/releases/Neuron-Node-builder.dmg- A professional disk image installer- Includes drag-and-drop installation
- Applications folder shortcut
- Custom volume icon (if available)
# Sign and notarize the .app bundle
./sign-and-notarize-app.shThis script will:
- Sign the app bundle with your Developer ID certificate
- Apply hardened runtime and entitlements
- Submit for Apple notarization
- Staple the notarization ticket
# Sign and notarize the DMG
./sign-and-notarize-dmg.shThis script will:
- Sign the DMG with your Developer ID certificate
- Apply hardened runtime and entitlements
- Submit for Apple notarization
- Staple the notarization ticket
For quick testing or manual notarization:
# Simple signing without automatic notarization
./simple-sign.shRun the complete automated workflow:
# Run complete build, package, and sign workflow
./build-workflow.shThis script automates the entire process:
- Package the application
- Create app bundle or DMG
- Sign with code signing certificate
- Submit for notarization
- Staple the notarization ticket
The packaging process automatically includes an entitlements.plist file with necessary permissions:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>These entitlements allow:
- JIT compilation for Node.js
- Third-party library loading
- Dynamic code execution
The packaged application uses:
- Port 1880 for Node-RED (configurable in
neuron-settings.js) - Automatic browser opening after startup
- Environment variables from
~/.neuron-node-builder/.env
After successful signing and notarization:
- App Bundle: Users can drag the
.appto Applications folder - DMG: Users can mount and install via drag-and-drop
- No Security Warnings: Properly signed and notarized packages bypass Gatekeeper
- Professional Installation: Clean, professional user experience
-
"Fatal javascript OOM in MemoryChunk allocation failed during deserialization"
- Ensure you're using Node.js 20.x
- The build script includes optimized memory settings
-
"Binary path does not exist"
- Check that
build/bin/contains the required binaries - Verify the build process completed successfully
- Check that
-
"Error loading settings file"
- Ensure
neuron-settings.jsis included in the package - Check the pkg configuration in
build.js
- Ensure
-
"codesign not found"
- Install Xcode Command Line Tools:
xcode-select --install
- Install Xcode Command Line Tools:
-
"No Developer ID certificate found"
- Import your Developer ID certificate to the keychain
- Use the provided import scripts or import manually
-
Notarization failures
- Check Apple's notarization logs for specific issues
- Ensure all dependencies are properly signed
- Verify the entitlements are appropriate
Modify build.js to customize:
- Target platforms and architectures
- Memory allocation settings
- Asset inclusion/exclusion
- Binary download sources
Modify signing scripts to:
- Use different certificates
- Apply custom entitlements
- Configure notarization settings
- Set custom bundle identifiers
-
"NEURON_SDK_PATH environment variable is not set"
- Ensure you've set the
NEURON_SDK_PATHin your.envfile - Make sure the path points to the correct executable
- Ensure you've set the
-
"Executable not found"
- Verify the executable exists at the specified path
- Ensure you downloaded the correct version for your platform
- Check file permissions (should be executable)
-
"Missing Hedera credentials"
- Complete the setup wizard when Node-RED starts
- Or manually add your credentials to the
.envfile
-
Process fails to start
- Check the console logs for error messages
- Verify all environment variables are set correctly
- Ensure the Go SDK dependencies are in the same directory
-
Black screen with MIME type errors
- Root Cause: Missing Node-RED build step
- Solution: Run
npx grunt buildbefore starting the application - Verification: Check that
packages/node_modules/@node-red/editor-client/public/directory exists
-
404 errors for static assets (vendor/vendor.js, red/red.min.js, etc.)
- Root Cause:
public/directory doesn't exist - Solution: Run
npx grunt buildto create compiled assets - Verification: Ensure
public/red/andpublic/vendor/directories contain the required files
- Root Cause:
"grunt command not found"
- Ensure you're in the project root directory
- Run
npm installfirst to install dependencies - Use
npx grunt buildinstead of justgrunt build
Build fails with errors
- Check that all Node.js dependencies are installed
- Verify you have sufficient disk space
- Check console output for specific error messages
- Ensure you have Node.js v18.5+ installed
Go module dependency issues
- If
go buildfails with "missing go.sum entry" - Run
go mod tidybefore building - Ensure Go v1.19+ is installed
If SDK_LOG_FOLDER is set, check the log files for detailed error information:
buyer-{nodeId}-stdout.log- Buyer process stdoutbuyer-{nodeId}-stderr.log- Buyer process stderrseller-{nodeId}-stdout.log- Seller process stdoutseller-{nodeId}-stderr.log- Seller process stderr
Correct deployment sequence:
- Clone repository
- Install Node.js dependencies (
npm install) - Build Node-RED assets (
npx grunt build) - Build Go dependencies from source
- Configure environment variables
- Start application (
npm run start)
Critical Notes:
- The Node-RED build step is not optional - it's required for the UI to function
- Without
npx grunt build, you'll see a black screen with MIME type errors - Always verify the
public/directory exists before starting the application