Initial Setup
Preparing to use the NIX SDK
Required Files
nixd
You'll need a running instance of nixd which can be downloaded from https://github.com/NixPlatform/NixCore/releases. After you've downloaded the nixd binary, create a config file in ~/.nix named nix.conf and configure the daemon to your liking. A working and valid example is shown below. Once configured, simply execute nixd or setup a systemd service to manage it.
SDK
You can use yarn or npm to install the SDK.
yarn add nix-coreor
npm install nix-core --saveNode Configuration
To establish a connection between the nixd instance and the SDK, an appropriate nix.conf configuration file is required.
daemon=1
server=1
par=1
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
rpcport=3335
rpcuser=username1
rpcpassword=password1
rpcclienttimeout=30
rpcthreads=2
rpcworkqueue=1000
staking=0
enableaccounts=1Connecting to the daemon in JavaScript
After nixd has been started with the above configuration, an instance can be created in the controlling JavaScript file:
More options can be found in the nix-core package documentation. With the client object, any command can now be executed. A list of selected commands can be found here.
Official NIX SDK Node
Alternatively, you can connect to ny.nixplatform.io using the following parameters:
Last updated
Was this helpful?