Author Topic: My testnet no bitshares-ui write access but works with cli_wallet  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

Offline j-v-h-silver

  • Newbie
  • *
  • Posts: 15
    • View Profile
I have a VM with Ubuntu 16.04 LTS and downloaded https://github.com/bitshares/bitshares-core built it as per instructions and witness_node is running.
The witness_node starts with
./witness_node --data-dir=data-bts/myblocktestnet  --genesis-json=genesis/my-genesis.json --enable-stale-production --seed-nodes "[]"
and is running properly
The Cli_wallet starts with
 ./cli_wallet --wallet-file my-wallet.json --chain-id c3807ea4b7d28da76249c6be53dc6342a12888327aab9d66ac1d53e31e797ae3 --server-rpc-endpoint ws://0.0.0.0:8090 -u '' -p ''

as the config file in the data-bts/myblocktestnet has the rpc as
# Endpoint for websocket RPC to listen on
rpc-endpoint = 0.0.0.0:8090

I note that the line for API is still commented out as I chose to rely on defaults

# JSON file specifying API permissions
# api-access =

and I have made users and sent "test" assets to them successfully
"info command in cli_wallet shows the following
unlocked >>> info
{
  "head_block_num": 5359,
  "head_block_id": "000014ef5d66f77c29bce7c12bdc83722520818e",
  "head_block_age": "0 second old",
  "next_maintenance_time": "31 minutes in the future",
  "chain_id": "c3807ea4b7d28da76249c6be53dc6342a12888327aab9d66ac1d53e31e797ae3",
  "participation": "100.00",
  "active_witnesses": [
    "1.6.1",
    "1.6.2",
    "1.6.3",
    "1.6.4",
    "1.6.5",
    "1.6.6",
    "1.6.7",
    "1.6.8",
    "1.6.9",
    "1.6.10",
    "1.6.11"
  ],
  "active_committee_members": [
    "1.5.0",
    "1.5.1",
    "1.5.2",
    "1.5.3",
    "1.5.4",
    "1.5.5",
    "1.5.6",
    "1.5.7",
    "1.5.8",
    "1.5.9",
    "1.5.10"
  ]
}


However the  bitshares-ui which I built also from latest github code connects once I populate "settings" / "nodes" / "personal"
with ws://localhost:8090 in the firefox browser within the VM
However "send" and permissions are "greyed out" and I cannot seem to do anything but have readonly "database_api" access.
This is the case whether in a VM browser like firefox on Ubuntu or my Windows host accessing the VM ip address via the VM bridged network .. which also allows connections but active buttons greyed out.

 I have not built a faucet so logins are via saved BIN wallet files generated via brainkeys made from the suggest_brain_key cli_wallet feature

So I cant use the bitshares-ui with my testnet and am wondering if its because of using local login via a brainkey restored wallet OR that I need a API referenced file in config.ini with something like
{
   "permission_map" :
   [
     
      [
         "*",
         {
            "password_hash_b64" : "*",
            "password_salt_b64" : "*",
            "allowed_apis" : ["database_api", "network_broadcast_api", "history_api"]
         }
      ]
   ]
}


Any help would be greatly appreciated for which direction to take and perhaps any steps required.
Regards John

Online sschiessl

Re: My testnet no bitshares-ui write access but works with cli_wallet
« Reply #1 on: December 16, 2020, 06:45:17 am »
Any console log output? Added chainid to ChainConfig ws-js?

Offline j-v-h-silver

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: My testnet no bitshares-ui write access but works with cli_wallet
« Reply #2 on: December 16, 2020, 08:44:44 am »
I use Putty to connect and interact with the virtualbox vm and log that interaction.
Here is the startup. I have also added the config.ini file contents at the end ( without most private keys ).
Should I enable logging via config.ini, there is a logging.ini file and I left it at defaults since its noted # Logging configuration is loaded from logging.ini by default.??
The rpc.log.20201215T210000 is 0 bytes .. empty?

./witness_node --data-dir=data-bts/myblocktestnet    --genesis-json=genesis/my-genesis.json --enable-stale-pro
oduction --seed-nodes "[]"

3341493ms th_a       witness.cpp:121               plugin_initialize    ] witness plugin:  plugin_initialize() begin
3341495ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
3341496ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS65xyKR7wS2tAH31W7zFUNG1mGpuXTKz3Nnbw9uaPvfb21PbRS3
3341496ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS6bdFMZW3PMP9zKcCVryVLVwkrFBs5iTdesD3tCYpwX9uiRpjkS
3341497ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS6RUf4miMPNrRfPX1cv7L1Z1EeBdNmkEbjSWzQ1viAouEZZHXNa
3341498ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS5CJSxFmCXoqZDsDCWcCx8MSbbqcxFjKjY2MA6Q5HCeqoMGouZr
3341499ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS7Vw3WF4NEvxNLmxsq9TZVkdnd84Bf13oHs92knYPuDuCC2BSvR
3341500ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS6T75ZsjWuxD8DjK6Gq2DHV5fW8hoiCXUXsy3DaaNLVqM3WE2qo
3341501ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS6GkFsEqCc5ZaXqrsTRXekhNPtTQ52GfbDqdJ3N4SMBHgi44MmU
3341501ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS5U3QJR8YNtg6TekogorP2V6ps4P1md3ittwSwmg9XsCCbhBbr5
3341502ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS5SPcntktmrGQKYfSE39tqebEu1UkMZnLwvqW34fc1gab8D4WwC
3341503ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS7ZKUsFpLMG4rCyT4rgBuvPVvWz8AuXRbYYDDs6xmBkFNehFK7r
3341503ms th_a       witness.cpp:114               add_private_key      ] Public Key: BTS5GSfsQeEDmQQAe9fqze51ewLmQUMAGYfMp22J239oXbxsVZTuV
3341504ms th_a       witness.cpp:163               plugin_initialize    ] witness plugin: Warning - Low required participation of 0% found
3341504ms th_a       witness.cpp:167               plugin_initialize    ] witness plugin:  plugin_initialize() end
3341506ms th_a       object_database.cpp:114       open                 ] Opening object database from /home/traede/bitshares-core-5.0.0-linux-amd64-bin/data-bts/TRAEDEblocktestnet/blockchain ...
3341555ms th_a       object_database.cpp:123       open                 ] Done opening object database.
3341556ms th_a       db_management.cpp:65          reindex              ] reindexing blockchain
3341557ms th_a       db_management.cpp:70          reindex              ] Replaying blocks, starting at 2291...
3341558ms th_a       db_management.cpp:162         reindex              ] Done reindexing, elapsed time: 0.00103400000000000 sec
3341561ms th_a       application.cpp:150           reset_p2p_node       ] Configured p2p node to listen on 127.0.0.1:11010
3341562ms th_a       application.cpp:202           reset_websocket_serv ] Configured websocket rpc to listen on 0.0.0.0:8090
3341563ms th_a       application.cpp:1194          startup_plugins      ] Plugin account_history started
3341564ms th_a       api_helper_indexes.cpp:149    plugin_startup       ] api_helper_indexes: plugin_startup() begin
3341564ms th_a       application.cpp:1194          startup_plugins      ] Plugin api_helper_indexes started
3341565ms th_a       custom_operations_plugin.cpp:155 plugin_startup       ] custom_operations: plugin_startup() begin
3341565ms th_a       application.cpp:1194          startup_plugins      ] Plugin custom_operations started
3341566ms th_a       application.cpp:1194          startup_plugins      ] Plugin grouped_orders started
3341567ms th_a       application.cpp:1194          startup_plugins      ] Plugin market_history started
3341567ms th_a       witness.cpp:172               plugin_startup       ] witness plugin:  plugin_startup() begin
3341568ms th_a       witness.cpp:176               plugin_startup       ] Launching block production for 11 witnesses.
3341569ms th_a       witness.cpp:195               plugin_startup       ] witness plugin:  plugin_startup() end
3341569ms th_a       application.cpp:1194          startup_plugins      ] Plugin witness started
3341570ms th_a       main.cpp:187                  main                 ] Started BitShares node on a chain with 2297 blocks.
3341570ms th_a       main.cpp:188                  main                 ] Chain ID is c3807ea4b7d28da76249c6be53dc6342a12888327aab9d66ac1d53e31e797ae3
3342001ms th_a       witness.cpp:277               block_production_loo ] Generated block #2298 with 0 transaction(s) and timestamp 2020-12-08T06:55:40 at time 2020-12-08T06:55:42
3345000ms th_a       witness.cpp:277               block_production_loo ] Generated block #2299 with 0 transaction(s) and timestamp 2020-12-08T06:55:45 at time 2020-12-08T06:55:45
3350002ms th_a       witness.cpp:277               block_production_loo ] Generated block #2300 with 0 transaction(s) and timestamp 2020-12-08T06:55:50 at time 2020-12

==============Config.ini==================
# Endpoint for P2P node to listen on
p2p-endpoint = 127.0.0.1:11010

# P2P nodes to connect to on startup (may specify multiple times)
# seed-node =

# JSON array of P2P nodes to connect to on startup
# seed-nodes =

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =

# Endpoint for websocket RPC to listen on
rpc-endpoint = 0.0.0.0:8090

# Endpoint for TLS websocket RPC to listen on
# rpc-tls-endpoint =

# The TLS certificate file for this server
# server-pem =

# Password for this certificate
# server-pem-password =

# A HTTP header similar to X-Forwarded-For (XFF), used by the RPC server to extract clients' address info, usually added by a trusted reverse proxy
# proxy-forwarded-for-header =

# File to read Genesis State from
# genesis-json =

# Block signing key to use for init witnesses, overrides genesis file
# dbg-init-key =

# JSON file specifying API permissions
# api-access =

# Number of IO threads, default to 0 for auto-configuration
# io-threads =

# Whether allow API clients to subscribe to universal object creation and removal events
# enable-subscribe-to-all =

# Whether to enable tracking of votes of standby witnesses and committee members. Set it to true to provide accurate data to API clients, set to false for slightly better performance.
# enable-standby-votes-tracking =

# For history_api::get_account_history_operations to set max limit value
api-limit-get-account-history-operations = 100

# For history_api::get_account_history to set max limit value
api-limit-get-account-history = 100

# For orders_api::get_grouped_limit_orders to set max limit value
api-limit-get-grouped-limit-orders = 101

# For history_api::get_relative_account_history to set max limit value
api-limit-get-relative-account-history = 100

# For history_api::get_account_history_by_operations to set max limit value
api-limit-get-account-history-by-operations = 100

# For asset_api::get_asset_holders to set max limit value
api-limit-get-asset-holders = 100

# For database_api_impl::get_key_references to set max limit value
api-limit-get-key-references = 100

# For database_api_impl::get_htlc_by_from and get_htlc_by_to to set max limit value
api-limit-get-htlc-by = 100

# For database_api_impl::get_full_accounts to set max accounts to query at once
api-limit-get-full-accounts = 50

# For database_api_impl::get_full_accounts to set max items to return in the lists
api-limit-get-full-accounts-lists = 500

# For database_api_impl::get_top_voters to set max limit value
api-limit-get-top-voters = 200

# For database_api_impl::get_call_orders and get_call_orders_by_account to set max limit value
api-limit-get-call-orders = 300

# For database_api_impl::get_settle_orders and get_settle_orders_by_account to set max limit value
api-limit-get-settle-orders = 300

# For database_api_impl::list_assets and get_assets_by_issuer to set max limit value
api-limit-get-assets = 101

# For database_api_impl::get_limit_orders to set max limit value
api-limit-get-limit-orders = 300

# For database_api_impl::get_limit_orders_by_account to set max limit value
api-limit-get-limit-orders-by-account = 101

# For database_api_impl::get_order_book to set max limit value
api-limit-get-order-book = 50

# For database_api_impl::lookup_accounts to set max limit value
api-limit-lookup-accounts = 1000

# For database_api_impl::lookup_witness_accounts to set max limit value
api-limit-lookup-witness-accounts = 1000

# For database_api_impl::lookup_committee_member_accounts to set max limit value
api-limit-lookup-committee-member-accounts = 1000

# For database_api_impl::lookup_vote_ids to set max limit value
api-limit-lookup-vote-ids = 1000

# For database_api_impl::get_account_limit_orders to set max limit value
api-limit-get-account-limit-orders = 101

# For database_api_impl::get_collateral_bids to set max limit value
api-limit-get-collateral-bids = 100

# For database_api_impl::get_top_markets to set max limit value
api-limit-get-top-markets = 100

# For database_api_impl::get_trade_history to set max limit value
api-limit-get-trade-history = 100

# For database_api_impl::get_trade_history_by_sequence to set max limit value
api-limit-get-trade-history-by-sequence = 100

# For database_api_impl::get_withdraw_permissions_by_giver to set max limit value
api-limit-get-withdraw-permissions-by-giver = 101

# For database_api_impl::get_withdraw_permissions_by_recipient to set max limit value
api-limit-get-withdraw-permissions-by-recipient = 101

# For database_api_impl::get_liquidity_pools_* to set max limit value
api-limit-get-liquidity-pools = 101

# Space-separated list of plugins to activate
plugins = witness account_history market_history grouped_orders api_helper_indexes custom_operations

# Do not exit if api_helper_indexes plugin is not enabled.
# ignore-api-helper-indexes-warning =


# ==============================================================================
# witness plugin options
# ==============================================================================

# Enable block production, even if the chain is stale.
enable-stale-production = true

# Percent of witnesses (0-100) that must be participating in order to produce blocks
# required-participation = 33
required-participation = 0

# ID of witness controlled by this node (e.g. "1.6.5", quotes are required, may specify multiple times)
# witness-id =
witness-id = "1.6.1"
witness-id = "1.6.2"
witness-id = "1.6.3"
witness-id = "1.6.4"
witness-id = "1.6.5"
witness-id = "1.6.6"
witness-id = "1.6.7"
witness-id = "1.6.8"
witness-id = "1.6.9"
witness-id = "1.6.10"
witness-id = "1.6.11"

# Tuple of [PublicKey, WIF private key] (may specify multiple times)
private-key = ["BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbw****"]

# Path to a file containing tuples of [PublicKey, WIF private key]. The file has to contain exactly one tuple (i.e. private - public key pair) per line. This option may be specified multiple times, thus multiple files can be provided.
# private-key-file =


# ==============================================================================
# debug_witness plugin options
# ==============================================================================

# Tuple of [PublicKey, WIF private key] (may specify multiple times)
# debug-private-key = ["BTS65xyKR7wS2tAH31W7zFUNG1mGpuXTKz3Nnbw9uaPvfb21PbRS3","5KjupAySNsouzmFTXmJAPxmPRBigkPFn67MXrKFrm9wtmEReDAe"]
debug-private-key = ["BTS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]


# ==============================================================================
# account_history plugin options
# ==============================================================================

# Account ID to track history for (may specify multiple times; if unset will track all accounts)
# track-account =

# Keep only those operations in memory that are related to account history tracking
partial-operations = 1

# Maximum number of operations per account that will be kept in memory
max-ops-per-account = 100

# Maximum number of operations to keep for accounts for which extended history is kept
# extended-max-ops-per-account =

# Track longer history for these accounts (may specify multiple times)
# extended-history-by-account =

# Track longer history for accounts with this registrar (may specify multiple times)
# extended-history-by-registrar =


# ==============================================================================
# elasticsearch plugin options
# ==============================================================================

# Elastic Search database node url(http://localhost:9200/)
# elasticsearch-node-url =

# Number of bulk documents to index on replay(10000)
# elasticsearch-bulk-replay =

# Number of bulk documents to index on a syncronied chain(100)
# elasticsearch-bulk-sync =

# Use visitor to index additional data(slows down the replay(false))
# elasticsearch-visitor =

# Pass basic auth to elasticsearch database('')
# elasticsearch-basic-auth =

# Add a prefix to the index(bitshares-)
# elasticsearch-index-prefix =

# Save operation as object(true)
# elasticsearch-operation-object =

# Start doing ES job after block(0)
# elasticsearch-start-es-after-block =

# Save operation as string. Needed to serve history api calls(false)
# elasticsearch-operation-string =

# Mode of operation: only_save(0), only_query(1), all(2) - Default: 0
# elasticsearch-mode =


# ==============================================================================
# market_history plugin options
# ==============================================================================

# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
bucket-size = [60,300,900,1800,3600,14400,86400]

# How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000)
history-per-size = 1000

# Will only store this amount of matched orders for each market in order history for querying, or those meet the other option, which has more data (default: 1000)
max-order-his-records-per-market = 1000

# Will only store matched orders in last X seconds for each market in order history for querying, or those meet the other option, which has more data (default: 259200 (3 days))
max-order-his-seconds-per-market = 259200


# ==============================================================================
# delayed_node plugin options
# ==============================================================================

# RPC endpoint of a trusted validating node (required for delayed_node)
# trusted-node =


# ==============================================================================
# snapshot plugin options
# ==============================================================================

# Block number after which to do a snapshot
# snapshot-at-block =

# Block time (ISO format) after which to do a snapshot
# snapshot-at-time =

# Pathname of JSON file where to store the snapshot
# snapshot-to =


# ==============================================================================
# es_objects plugin options
# ==============================================================================

# Elasticsearch node url(http://localhost:9200/)
# es-objects-elasticsearch-url =

# Basic auth username:password('')
# es-objects-auth =

# Number of bulk documents to index on replay(10000)
# es-objects-bulk-replay =

# Number of bulk documents to index on a synchronized chain(100)
# es-objects-bulk-sync =

# Store proposal objects(true)
# es-objects-proposals =

# Store account objects(true)
# es-objects-accounts =

# Store asset objects(true)
# es-objects-assets =

# Store balances objects(true)
# es-objects-balances =

# Store limit order objects(false)
# es-objects-limit-orders =

# Store feed data(true)
# es-objects-asset-bitasset =

# Add a prefix to the index(objects-)
# es-objects-index-prefix =

# Keep only current state of the objects(true)
# es-objects-keep-only-current =

# Start doing ES job after block(0)
# es-objects-start-es-after-block =


# ==============================================================================
# grouped_orders plugin options
# ==============================================================================

# Group orders by percentage increase on price. Specify a JSON array of numbers here, each number is a group, number 1 means 0.01%.
tracked-groups = [10,100]


# ==============================================================================
# custom_operations plugin options
# ==============================================================================

# Start processing custom operations transactions with the plugin only after this block
custom-operations-start-block = 45000000


# ==============================================================================
# logging options
# ==============================================================================
#
# Logging configuration is loaded from logging.ini by default.
# If logging.ini exists, logging configuration added in this file will be ignored.

Online sschiessl

Re: My testnet no bitshares-ui write access but works with cli_wallet
« Reply #3 on: December 16, 2020, 09:14:36 am »
My answer was concerning bitshares-ui source code.

Offline j-v-h-silver

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: My testnet no bitshares-ui write access but works with cli_wallet
« Reply #4 on: December 16, 2020, 01:25:17 pm »
I think the source is fine .. I can use "npm start" to get a web wallet and it can connect to the eu testnet with a cloud login and I can send "test" to others etc also I ran "npm run build" to get a dist that works on a external linux server on the internet to connect to testnet as well as mainnet.

There are no errors ( a few warnings is all ) BUT for my testnet I dont have permission to send or do any actons that are not read only, but only via bitshares_ui not cli_wallet. So I am thinking its either they are using different authentication or API OR my "local wallet" which I "restored" via a brainkey and imported my private key is missing some key or other permission.
How can I log errors from the bitshares_ui in case that is the issue?
I have not tried to build a faucet which I presume is needed for a cloud wallet.
Can I do a cloud login with my account name and private key as the password?

Many thanks for any help - John

Online sschiessl

Re: My testnet no bitshares-ui write access but works with cli_wallet
« Reply #5 on: December 16, 2020, 02:21:09 pm »
Added chainid to ChainConfig ws-js?

Did you do this?

Offline j-v-h-silver

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: My testnet no bitshares-ui write access but works with cli_wallet
« Reply #6 on: December 29, 2020, 03:44:16 am »
Sorry sschiessl
I am finding my way around bitshares and have a fulltime job and young kids as well so couldn't get back straight away.
Where can I add the chain-id in the bitshares_ui code?
I have looked in the code and deoxygen documentation. You mention Added chainid to ChainConfig ws-js can you point me to where the ChainConfig is for the bitshares_ui ?
I will keep looking but many thanks for any links or insights.
I am mainly a SQL programmer and basic knowledge of js
Regards John