Running the Wallet Daemon
Along with running the Platform natively on your own cloud service, you can also build and run the wallet daemon natively too. This requires just a few steps to configure and build the app which can then be run from the same server as the platform or on a completely different server. It would be highly recommended to run the wallet daemon app on a separate server, and ideally one which is is configured to only allow connections to and from your platform server, or at least not generally accessible directly from the internet. Please note that 2GB of ram would be recommended when building the wallet daemon from source locally.
-
Start by installing or updating cargo:
apt install cargo
-
Install or update the openssl dev libs:
apt-get install libssl-dev pkg-config
-
Next add the
KEY_PASS
andPLATFORM_KEY
env vars to your environment variable list so they start on login, to do this create a newwallet-daemon.sh
file in/etc/profile.d/
:nano /etc/profile.d/wallet-daemon.sh
And then add the variables, choose a strong password for your
KEY_PASS
and set your platform's auth token in thePLATFORM_KEY
, save the file withctrl-x
followed byy
:export KEY_PASS="MySuperSecurePassword01" export PLATFORM_KEY="Your_Platform_Token_Here"
-
Once saved you'll need to log off from your server and log back in so they get loaded.
-
Next, create a new folder to hold the Wallet Daemon repo and build:
cd ~/enjin/ mkdir wallet-daemon
-
Pull the wallet-daemon repo from GitHub:
cd ~/enjin/wallet-daemon/ git clone https://github.com/enjin/wallet-daemon.git .
-
Edit the
config.json
file in nano to set which blockchain node and platform to connect to and also set where it can find the wallet private key, typically./store
, then save withctrl-x
y
:nano config.json
{ "node": "wss://rpc.matrix.canary.enjin.io:443", "relay_node": "wss://rpc.relay.canary.enjin.io:443", "api": "https://your-platform-url.com/graphql", "master_key": "./store" }
Using Platform on mainnet?
If you are using the Enjin Platform on mainnet, make sure to use a mainnet RPC (such as wss://rpc.matrix.blockchain.enjin.io)
-
Build the Wallet Daemon app:
cargo build --release
-
Remove the demo Wallet key:
rm store/73723235547f46358c6a32dd1ffb28ee537313a674dc3dc882beb3246e03aa4dc246022f
-
Attach to your
tmux
workers session and create a new pane for the wallet daemon, usectrl-b
"
to create a new pane andctrl-b
up-arrow
ordown-arrow
to navigate to it if not already selected:tmux a -t workers
-
Navigate to the wallet-daemon folder in your new pane and then run the wallet build:
cd ~/enjin/wallet-daemon ./target/release/wallet
-
Note down the account addresses that will be displayed, these are for your new Wallet Daemon account and will be used to sign transactions.
From here on you simply need to update the DAEMON_ACCOUNT
variable in your .ENV with the new wallet account address and fund the account. The wallet daemon will then poll for transactions every 6 seconds and process anything new that you create.
Updating the Wallet Daemon
If you're using Supervisor to keep the wallet running (Keeping the Platform Running) , stop it using:
sudo supervisorctl stop platform-wallet:*
Login as your platform user (or from root use su - platform
and change to the wallet daemon directory:
cd ~/enjin/wallet-daemon/
Pull the latest version from git and build:
git pull
cargo build --release
To test, you can run directly (omit if using supervisor):
./target/release/wallet
Start the wallet using supervisor:
sudo supervisorctl start platform-wallet:*
Updated 4 days ago