Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ElMato

Pages: 1 ... 10 11 12 13 14 15 16 [17] 18 19 20
241
General Discussion / Maintain blockchain balances in DB
« on: November 04, 2014, 11:24:11 pm »
Can someone review this pseudo code and tell me if the fork handling is right?

Quote
def function_called_periodically()

    # My last block imported in DB
    my_last_block = get_last_block_from_db()

    # Network last block (head of master chain)
    network_last_block = blockchain_get_block_count()

    # Is network ahead of us?
    while network_last_block > my_last_block

      # Get next block based on my last imported block
      next_block = blockchain_get_block(my_last_block+1)

      # I'm on the main chain?
      if next_block['previous'] != my_last_block
        # NO => my block is on a forked chain, undo changes.
        undo_balances_changed_in_block(my_last_block)
        delete_from_db(my_last_block)
        my_last_block = get_last_block_from_db()
      else
        # YES => Import
        my_last_block = import_new_block_in_db_and_update_balances(next_block)

242
General Discussion / Re: I hope new bts will rise 200% after 11.05
« on: October 30, 2014, 03:15:42 pm »





For me it's quite easy ..
I can only sell late next year .. otherwise I need to state all that stuff in my tax declaration .. after a year .. all capital gains are free of tax ..
So I am neither in a hurry .. nor am I in bad mood of current prices ..

Further, I understand both, the technical and the economical implications of having a decentralized exchanged (which we all OWN) that has market pegging assets .. bla bla bla bla .. could go on four hours ... bla bla ..

TL;DR .. I have confidence we will change the world ..

+5%

243
General Discussion / Re: Let's Talk Argentina
« on: October 29, 2014, 04:23:32 pm »
We are planning to offer instant buy/sell of bitUSD as soon as we launch v2 of latincoin.com, but we need a mobile wallet first.

244
We really need a BitAsset specific mobile wallet for iOS and Android. I'd rank this as being very important.

I propose we either hire a delegate to develop a wallet or post a bounty.

Please post any open source wallet projects that can be forked and modified for BitAssets. How can we go from start to finish in as little time as possible?


MethodX,

Based on the information available this is what i think are the options for the mobile wallet.

1) Wait for the mail subsystem to be ready.
    Wait for bitshapire mobile wallet.
    --------------------
    I don't know what is the real status of both.
    Mail subsystem seems to be implemented in some way but i don't know if its usable.


2) Go the bitcoin way.

    Lets forget for a while about TITAN and its benefits (that i like so much) and go the bitcoin way. (No accouns, ugly addresses, etc).
   
    For this to work we need:
   
    a) Backend infrastructure to know the balance of any address.
    b) Backend infrastructure to create and publish transactions. (just "asset transfer" type of transactions, no bid, no ask, etc)
    c) UI design inspired in Circle wallet.
    d) Build the wallet. (just Js+html5)

    a) and b) can be integrated in bitsharesblocks.com

    http://api.blockcypher.com/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD/balance
    http://dev.blockcypher.com/reference.html#creating_transactions
 
     d) We should use something like http://ionicframework.com/ to go for Android/iPhone with the same codebase.
   

245
+5% for methodx delegate

246
General Discussion / Re: Help me craft a raw transaction
« on: October 28, 2014, 09:09:50 am »
It would be great if we can have our own blockcypher.com (or chain.com) or ask them to integrate bitshares.

I managed to create and broadcast a raw transaction using the code below.

Please give me some directions:

1) Who do i track records ids of accounts that are not in the wallet db? (read only accounts)
    Should i export the wallet to json and add a new account_record_type?

Code: [Select]
#include <iostream>
#include <vector>
#include <bts/blockchain/transaction.hpp>
#include <fc/crypto/elliptic.hpp>
#include <fc/io/json.hpp>
#include <fc/crypto/hex.hpp>
#include <bts/utilities/key_conversion.hpp>

using namespace bts::blockchain;
using namespace bts::utilities;

int main(int argc, char** argv)
{
  const std::string tx_json = R"(
  {
      "expiration": "20141028T085151",
      "delegate_slate_id": null,
      "operations": [{
          "type": "register_account_op_type",
          "data": {
            "name": "justtesting",
            "public_data": null,
            "owner_key": "BTSX6yNA6Kc1qYSUt1ppFe8oPKcnWGHCg11VLKTY36V9jfyQvswjdh",
            "active_key": "BTSX6yNA6Kc1qYSUt1ppFe8oPKcnWGHCg11VLKTY36V9jfyQvswjdh",
            "delegate_pay_rate": 255,
            "meta_data": {
              "type": "public_account",
              "data": ""
            }
          }
        },{
          "type": "withdraw_op_type",
          "data": {
            "balance_id": "BTSX6nhkTeg1qnBbCHtJ4q8GUrBU9Sq2fTS23",
            "amount": 50,
            "claim_input_data": ""
          }
        }
      ]
  }
  )";

  auto tx = fc::json::from_string(tx_json).as<signed_transaction>();

  auto priv = wif_to_key("[edited]");

  fc::sha256 chain_id;
  fc::from_variant("75c11a81b7670bbaa721cc603eadb2313756f94a3bcbb9928e9101432701ac5f", chain_id);

  auto signature = priv->sign_compact( tx.digest(chain_id) );

  tx.signatures.push_back(signature);

  std::cout << fc::json::to_pretty_string(tx) << std::endl;

  vector<char> data;
  data = fc::raw::pack(tx);

  std::cout << fc::to_hex(data) << std::endl;
 


  return 0;
}

247
General Discussion / Re: Help me craft a raw transaction
« on: October 27, 2014, 10:03:45 pm »
BM, thanks for your response.

Just let me know if I am on the right track.

wallet_account_balance_ids account
returns the complete "UTXO" set for the account?

Then i can use the balance ids to make this ...

Quote
{
  "trx": {
    "expiration": "20141027T205151",
    "delegate_slate_id": null,
    "operations": [{
        "type": "register_account_op_type",
        "data": {
          "name": "[put a name here]",
          "public_data": null,
          "owner_key": "[Public Key BTSX format]",
          "active_key": "[Public Key BTSX format]",
          "delegate_pay_rate": 255,
          "meta_data": {
            "type": "public_account",
            "data": ""
          }
        }
      },{
        "type": "withdraw_op_type",
        "data": {
          "balance_id": "[Balance Record ID]",
          "amount": 50000,
          "claim_input_data": ""
        }
      }
    ],
    "signatures": [
"[Signature for the withdraw]"
    ]
  }
}

Questions:

0) Is the above Json enough?

1) How is the signature generated ?
    (required_signatures adds balance_record.owner() but i can't figure what is signing)

2) How do i go from Json -> Hex? Is there any "createrawtransaction"?



248
General Discussion / Help me craft a raw transaction
« on: October 27, 2014, 05:06:58 am »
I know that devs are involved in more important things, but it would be really helpful to have a simple example of how to create two types of raw transactions.

1) Account register.
2) Asset transfer.

Number one is useful when i want to register an account on behalf of other person. (ie: Mobile Client signup process)
We will create the private keys like wallet_account_create does.

So far, this is what i have diving into the source code.

uint32_t utc_seconds;
uint64_t delegate_slate_id;
VARINT  n_ops; (number of ops)
-- register account operation
uint8_t                 operation_type
VARINT                  name_length
char[name_length]       name
VARIANT                   public_data  (json string serialized as VARIANT?)
uint8_t[33]             owner_key
uint8_t[33]             active_key
uint8_t                 delegate_pay_rate
uint32_t                account_type
VARINT                  data_length
char[data_length]       data

--- withdraw operations
....
-- signatures
....

is this ok?


Then i have to provide the signatures of the spent record ids (from the pay account) that pays for the transaction fee.
For this i need to know the blockchain format.

I remember that drltc was working on this, is there any documentation to look?

Other questions:
Do we have an equivalent of change addresses in bitshares?
Or balance records are modified "in place"?

Do we have any tool in python/ruby to read the blockchain and extract information?

 










249
General Discussion / Re: drltc is joining the BitShares team
« on: October 22, 2014, 06:43:46 pm »

In response to my previous thread [1], Toast invited me to come hang out with the BitShares team for a week in real life.  bytemaster invited me to join the BitShares team, and I accepted.

I'm impressed with the team's potential, and things will only get better with me on board.  Despite recent market movements, great things are ahead for BitShares!

[1] https://bitsharestalk.org/index.php?topic=9899.msg128766

+5% +5% +5% +5% +5% +5%
I'm so happy to see drltc join the team!

250
General Discussion / Re: How much btsx did you panic sell?
« on: October 21, 2014, 06:10:16 am »
0% ... Looking to buy more

251
Thanks xerox, i deleted the peers db but nothing special happens.

This is my current situation..
...
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 4 active connections to the p2p network
--- there are now 3 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 2 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network
--- there are now 1 active connections to the p2p network
--- there are now 0 active connections to the p2p network

(wallet closed) >>> blockchain_is_synced
false

(wallet closed) >>> blockchain_get_block_count
728214

(wallet closed) >>> debug_list_errors_brief
[[
    "20140823T230420.868295",
    "unspecified"
  ],[
    "20140823T230802.872564",
    "unspecified"
  ],[
    "20140823T234202.589317",
    "unspecified"
  ],[
    "20140823T234312.493486",
    "unspecified"
  ],[
    "20140823T235051.270832",
    "unspecified"
  ],[
    "20140823T235727.272364",
    "unspecified"
  ],[
    "20140824T000410.802489",
    "unspecified"
  ],[
    "20140824T000413.969695",
    "unspecified"
  ],[
    "20140824T000650.043646",
    "unspecified"
  ],[
    "20140824T000833.202415",
    "unspecified"
  ],[
    "20140824T004241.059218",
    "Assert Exception"
  ],[
    "20140824T005409.639546",
    "block is older than our undo history allows us to process"
  ],[
    "20140825T203439.640586",
    "unspecified"
  ],[
    "20140825T213825.395229",
    "Assert Exception"
  ],[
    "20140825T213825.415806",
    "Assert Exception"
  ],[
    "20140825T213826.445013",
    "Assert Exception"
  ],[
    "20140825T213826.877497",
    "Assert Exception"
  ],[
    "20140825T213827.370234",
    "Assert Exception"
  ],[
    "20140825T213828.519711",
    "Assert Exception"
  ],[
    "20140826T010257.132931",
    "block is older than our undo history allows us to process"
  ]
]



I'm getting a lot of "key_not_found_exception" in p2p.log
"6 key_not_found_exception: Key Not Found\nunable to find key 728788\n"

what does it means?




252
Yes ...

(wallet closed) >>> get_info
{
  "blockchain_head_block_num": 728214,
  "blockchain_head_block_age": "7 days old",
  "blockchain_head_block_timestamp": "2014-10-13T01:38:00",
  "blockchain_average_delegate_participation": "0.16 %",
  "blockchain_confirmation_requirement": 1,
  "blockchain_delegate_pay_rate": "1.81292 BTSX",
  "blockchain_share_supply": "1,999,937,082.29552 BTSX",
  "blockchain_blocks_left_in_round": 97,
  "blockchain_next_round_time": "at least 16 minutes in the future",
  "blockchain_next_round_timestamp": "2014-10-20T07:56:00",
  "blockchain_random_seed": "a759ec9fa6857f2498f49f5ea9ab9fe3f4d1023d",
  "client_data_dir": "/Users/[edited]/Library/Application Support/BitShares X",
  "client_version": "v0.4.20",
  "network_num_connections": 2,
  "network_num_connections_max": 200,
  "ntp_time": "2014-10-20T07:39:55",
  "ntp_time_error": -0.065501000000000004,
  "wallet_open": false,
  "wallet_unlocked": null,
  "wallet_unlocked_until": null,
  "wallet_unlocked_until_timestamp": null,
  "wallet_last_scanned_block_timestamp": null,
  "wallet_scan_progress": null,
  "wallet_block_production_enabled": null,
  "wallet_next_block_production_time": null,
  "wallet_next_block_production_timestamp": null
}

253
Im connected to the network (network_get_connection_count between 1 and 5) but i cant go beyond block 728214.

(wallet closed) >>> about
{
  "blockchain_name": "BitShares X",
  "blockchain_description": "Decentralized Autonomous Exchange",
  "client_version": "v0.4.20",
  "bitshares_toolkit_revision": "ab40d8dc51cd4e54c0e05a2e9770fca3f03d6565",
  "bitshares_toolkit_revision_age": "18 days ago",
  "fc_revision": "c4e814d7ded6099dc4297aa843d4be7afa98b3ed",
  "fc_revision_age": "20 days ago",
  "compile_date": "compiled on Oct 10 2014 at 21:45:38",
  "boost_version": "1.56",
  "openssl_version": "OpenSSL 1.0.1i 6 Aug 2014",
  "build": "osx 64-bit"
}

(wallet closed) >>> blockchain_get_block_count
728214

(wallet closed) >>> blockchain_get_block 728214
{
  "previous": "65de54a989bbff9364f7de5eda59e04361950a3b",
  "block_num": 728214,
  "timestamp": "20141013T013800",
  "transaction_digest": "c8cf12fe3180ed901a58a0697a522f1217de72d04529bd255627a4ad6164f0f0",
  "next_secret_hash": "6796a4eb42517bba7bed76f5d4a617421837cbc5",
  "previous_secret": "6861922a10b235011fbdd9df9384d0c891dea065",
  "delegate_signature": "1fa445545cf7d186e61d35bf983fb2fd7d319ffb42ce1791a15d27b6ca56b37328aaced8b185b98e752c101201b0a76596b4bf5fbccbbbb259ce47ef596bc44d5c",
  "user_transaction_ids": []
}

Based on http://bitsharesblocks.com/blocks/block?id=728214, it seems that i'm not in a fork

I know that i can remove everything and start all over again, but i would like to diagnose whats happening.

Any hint?

254
General Discussion / Re: Max Wright video tweeted on Coinapult
« on: October 13, 2014, 04:12:37 am »
Another response would be to fork Andreas Schildbach bitcoin wallet and instead of a "Locks" button add a "to bitUSD" button.
( https://medium.com/@Coinapult/electrum-locks-plugin-beta-9d8f724af19a )

But we should rely on a centralized exchange to do the conversion because we don't have cross-chain trading yet.
This will give the same value proposition as locks but with new benefits.

255
Technical Support / v0.4.16 compile error on osx
« on: September 22, 2014, 03:51:48 am »
Trying to compile tag v0.4.16 from https://github.com/dacsunlimited/bitsharesx/

-- Target htdocs directory already exists, exiting...
[ 95%] Built target buildweb
make[2]: *** No rule to make target `programs/qt_wallet/images/splash_screen.jpg', needed by `programs/qt_wallet/qrc_bitshares.cpp'.  Stop.
make[1]: *** [programs/qt_wallet/CMakeFiles/BitSharesX.dir/all] Error 2
make: *** [all] Error 2

Any hint?

Pages: 1 ... 10 11 12 13 14 15 16 [17] 18 19 20