Creating an asset in the testnetHi all,
I'm a developer struggling to define a new asset in the testnet
These are the steps I already managed to complete:
- Cloning and running the byteball client locally (from the code)
- Exchanging bytes on the livenet and testnet
- Running the byteball-headless client locally
What I understood from the documentation is that I need to run a command (there is a create_asset.js script in the play directory of headless byteball) in order to create an asset but I got stuck with some errors.
I firstly changed the hub url to the testnet in conf.js:
exports.hub = 'byteball.org/bb-test';
There seem to be some protocol compatibility problems I can read from the log (though it doesn't stop the client):
SENDING ["justsaying",{"subject":"error","body":"Incompatible versions, mine 1.0, yours 1.0t"}] to wss://byteball.org/bb-test
close event, removing 0: wss://byteball.org/bb-test
I have also encountered a problem pairing my UI client to the headless one, my parallel thread of investigation. The client is operating on the testnet as well and I set up the control_address and payout_address in configuration file (conf.js) as follows (they are the value I read from the UI client);
"use strict";
//exports.port = 6611;
//exports.myUrl = 'wss://mydomain.com/bb';
exports.bServeAsHub = false;
exports.bLight = false;
exports.storage = 'sqlite';
exports.hub = 'byteball.org/bb-test';
exports.deviceName = 'TestDevice';
exports.permanent_paring_secret = 'randomstring';
exports.control_addresses = ['0W87676ZG4ZT7AY2QX7C7YEJ5CEORIAF2'];
exports.payout_address = 'BKQXMJDKHC5W2JLMQVT2VEHQUC5WADZZ';
exports.KEYS_FILENAME = 'keys.json';
// where logs are written to (absolute path). Default is log.txt in app data directory
//exports.LOG_FILENAME = '/dev/null';
// this is for runnining RPC service only, see play/rpc_service.js
exports.rpcInterface = '127.0.0.1';
exports.rpcPort = '6332';
console.log('finished headless conf');
But the pairing doesn't occur. when I type the pairing code into the UI I get no complaints, but as soon as I start to type commands in the chat I get this message:
device with this pubkey is not registered here
My wild guess is that my headless client should have been already registered on the testnet at this point but it hasn't done it yet, maybe because of the protocol incompatibility. But it's just a guess.
Finally I tried to create an asset running node play/create_asset.js with poor results:
starting network
setDevicePrivateKey
objMyTempDeviceKey not set yet, can't log in
long query took 33ms:
SELECT MAX(lb_units.main_chain_index) AS min_retrievable_mci
FROM units JOIN units AS lb_units ON units.last_ball_unit=lb_units.unit
WHERE units.is_on_main_chain=1 AND units.is_stable=1,
load avg: 0.12890625, 0.291015625, 0.36767578125
no leftovers
outbound peers:
will connect to wss://byteball.org/bb-test
connectToPeer done
my_device_hub not set yet, can't log in
setDeviceName TestDevice
setDeviceHub byteball.org/bb-test
logging in to hub byteball.org/bb-test
outbound peers:
already connecting to wss://byteball.org/bb-test
====== my device address: ****************************************
====== my device pubkey: ****************************************
====== my pairing code: **************************************************************************************************************
/home/ignite/IdeaProjects/headless-byteball/node_modules/byteballcore/my_witnesses.js:32
throw Error("wrong number of my witnesses: "+arrWitnesses.length);
^
Error: wrong number of my witnesses: 0
at Error (native)
at /home/ignite/IdeaProjects/headless-byteball/node_modules/byteballcore/my_witnesses.js:32:10
at /home/ignite/IdeaProjects/headless-byteball/node_modules/byteballcore/sqlite_pool.js:220:5
at Statement.<anonymous> (/home/ignite/IdeaProjects/headless-byteball/node_modules/byteballcore/sqlite_pool.js:113:6)
At the moment I'm stuck. What am I doing wrong? Does anyone have the same issue or any clue? I would be thankful if you could give an hint.
Best regards,
Yary