Daemon First Steps
13

The Enjin Wallet Daemon is a utility that manages an Ethereum address linked to an Enjin Trusted Cloud identity. When a transaction is submitted on the Trusted Cloud, the wallet daemon receives that transaction, signs it, and sends it back to the Trusted Cloud.

Enjin Wallet Daemon Configuration

Before initializing the Wallet Daemon, open your enjin-wallet-daemon.1.x.x-beta folder and search for the example-config.json file, the contents of this file features some basic configuration parameters.

Copy the file from example-config.json to config.json and then open it in a text editor.

{
   "salt": "193e9997-5a10-4d9e-a829-69ddcf6cbf70",
   "keyIterations": 1000,
   "chain": "kovan",
   "enjinxEndpoint": "https://daemon.api.enjinx.io/",
   "minGasPrice": 1000000000,
   "maxGasPrice": 21000000000
}

<inline-code>"salt": "193e9997-5a10-4d9e-a829-69ddcf6cbf70"<inline-code> - This paramater is used when encrypting/decrypting your daemon password. For improved security, you can set the salt to anything else (such as a different UUID4 string).

<inline-code>"chain"<inline-code>: <inline-code>"kovan"<inline-code> or <inline-code>"mainnet"<inline-code> - This parameter defines which network you are going to be running your wallet daemon on.

<inline-code>"minGasPrice"<inline-code> and <inline-code>"maxGasPrice"<inline-code> - Both parameters refer to ETH gas prices and can be used to constrain the minimum and maximum amount of gas to be used when signing a transaction.

New Wallet Creation

This is the recommended way to initialize a Wallet Daemon.

<inline-code>Run node src/main.js account new<inline-code>
Notice the new wallet address is printed on the console.

Keep a backup of your password somewhere safe! Otherwise, there is no way to recover your account.

Import Existing Private Key

From Enjin Wallet

The Enjin Wallet uses the Ledger (ETH) HD derivation path (<inline-code>m/44'/60'/0'<inline-code>). You can use MyEtherWallet to rebuild your private key from the 12-word recovery phrase.

This method is rather insecure and should only be used knowing that it exposes your private key to a website that could have been compromised. To mitigate the risk, it's highly recommended to deploy a private copy of MyEtherWallet from https://github.com/kvhnuke/etherwallet/releases

If you decide to go this route, click on "View Wallet Info" and follow the onscreen instructions:

  • Mnemonic Phrase
  • Pasting your 12 words and keeping the password field empty
  • Selecting the Ledger (ETH) derivation path
  • Choosing the correct address from the suggestion list

From MetaMask

Go into account details and select "Export Private Key"

From Parity/Geth

Assuming your client installation uses the default data folders, the keys are stored there:

Parity
  • Windows: <inline-code>%HOMEPATH%/AppData/Roaming/Parity/Ethereum/keys<inline-code>
  • macOS: <inline-code>~/Library/Application\ Support/io.parity.ethereum/keys<inline-code>
  • Linux: <inline-code>$HOME/.local/share/io.parity.ethereum/keys<inline-code>
Geth
  • Windows: <inline-code>%APPDATA%\Ethereum\keystore<inline-code>
  • macOS: <inline-code>~/Library/Ethereum/keystore<inline-code>
  • Linux: <inline-code>~/.ethereum/keystore<inline-code>

Each key is stored in an extensionless json file. Here again, you can use "MyEtherWallet" to extract the private keys.

This method is rather insecure and should only be used knowing that it exposes your private key to a website that could have been compromised. To mitigate the risk, it's highly recommended to deploy a private copy of MyEtherWallet from https://github.com/kvhnuke/etherwallet/releases

If you decide to go this route, click on "View Wallet Info" and follow the onscreen instructions:

  • Keystore / JSON File
  • Select your file, enter your password

Link To Trusted Cloud

  1. Create an account on the Trusted Cloud.
  2. Create an identity for the application you want to control with the wallet daemon.
  3. Copy the linking code from the identity <inline-code><CODE><inline-code>.
  4. Run <inline-code>node src/main.js link <CODE><inline-code>

Run The Wallet Daemon

Run <inline-code>node src/main.js<inline-code>

Previous
next
On This Page