You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The config.json file should be an object with a top-level blockchains property which is a list of config objects for different blockchains which are supported by ldpos-wallet by default (out of the box). There should be 2 different config.json files; one for mainnet and one for testnet.
Each config object in this array should be in the format (example for testnet of capitalisk blockchain):
When it starts up, ldpos-wallet should load all the available blockchains from this config.json file. The first entry in the list should be treated as the default blockchain to connect to (Capitalisk by default).
2. A mechanism for adding new blockchains to the config.json
In order to add support for a new blockchain on their ldpos-wallet app, a non-technical user needs a mechanism to add a new entry to the config.json file without actually having to actually physically modify the config.json file or having to restart the app.
A simple modal which prompts for hostname, port, networkSymbol and chainModuleName with a save button should suffice.
For hostname and port, the user just needs to point to any node within the target blockchain network.
Once the user clicks on the save button, it should update the config.json file with the new entry (be sure to not mix up testnet versus mainnet config files).
3. A mechanism for switching to one of the available blockchains
The user should be able to make the ldpos-wallet app point to any blockchain which it knows about.
This includes blockchain config objects which were inside config.json during launch as well as new blockchain config objects which were added using the modal as described in part 2.
It can be a simple dropdown. When the user selects the blockchain to switch to, it should create a new LDPoSClient instance by providing the config values for that target blockchain to the createClient function:
Make sure that you client.disconnect() and discard the reference to the old client before creating a new client.
If the user was already logged in when they switch to the different blockchain, client.connect(...) should be called and the existing (last used) passphrase should be provided. The same passphrase can work with any LDPoS-based blockchain; the client.walletAddress will be different.
The fact that the same passphrase can be used for multiple networks will be the basis for the 'quick convert' feature which we will implement later. The switching mechanism needs to be as seamless as possible.
The text was updated successfully, but these errors were encountered:
The
ldpos-wallet
application should support adding and switching between different blockchain networks.The
ldpos-client
library already supports this feature as part of thecreateClient
function. For example:There are 3 parts to this feature:
1. A config.json file for default blockchains
The
config.json
file should be an object with a top-levelblockchains
property which is a list of config objects for different blockchains which are supported byldpos-wallet
by default (out of the box). There should be 2 differentconfig.json
files; one for mainnet and one for testnet.Each config object in this array should be in the format (example for testnet of capitalisk blockchain):
When it starts up,
ldpos-wallet
should load all the available blockchains from thisconfig.json
file. The first entry in the list should be treated as the default blockchain to connect to (Capitalisk by default).2. A mechanism for adding new blockchains to the config.json
In order to add support for a new blockchain on their
ldpos-wallet
app, a non-technical user needs a mechanism to add a new entry to theconfig.json
file without actually having to actually physically modify theconfig.json
file or having to restart the app.A simple modal which prompts for
hostname
,port
,networkSymbol
andchainModuleName
with a save button should suffice.For
hostname
andport
, the user just needs to point to any node within the target blockchain network.Once the user clicks on the save button, it should update the
config.json
file with the new entry (be sure to not mix uptestnet
versusmainnet
config files).3. A mechanism for switching to one of the available blockchains
The user should be able to make the
ldpos-wallet
app point to any blockchain which it knows about.This includes blockchain config objects which were inside
config.json
during launch as well as new blockchain config objects which were added using the modal as described in part 2.It can be a simple dropdown. When the user selects the blockchain to switch to, it should create a new
LDPoSClient
instance by providing the config values for that target blockchain to thecreateClient
function:Make sure that you
client.disconnect()
and discard the reference to the old client before creating a new client.If the user was already logged in when they switch to the different blockchain,
client.connect(...)
should be called and the existing (last used) passphrase should be provided. The same passphrase can work with any LDPoS-based blockchain; theclient.walletAddress
will be different.The fact that the same passphrase can be used for multiple networks will be the basis for the 'quick convert' feature which we will implement later. The switching mechanism needs to be as seamless as possible.
The text was updated successfully, but these errors were encountered: