Author Topic: 1000 PTS - BitShares Block/Market Explorer [TO BE DEFINED]  (Read 7320 times)

0 Members and 1 Guest are viewing this topic.

Offline bytemaster

JSON-RPC Interface + Alpha Wallet available for testing.  Everything necessary for building a block explorer.

https://bitsharestalk.org/index.php?topic=1890.msg30368#msg30368

For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster


Example Transaction:
Code: [Select]
{
  "version": 0,
  "stake": 159535476,
  "timestamp": "19700101T000000",
  "valid_after": 0,
  "valid_blocks": 0,
  "inputs": [
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 0
      },
      "input_data": ""
    },
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 1
      },
      "input_data": ""
    }
  ],
  "outputs": [
    {
      "amount": 200000000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "PqdiEfgjYw8remotv6Zp25UbupJ"
      }
    },
    {
      "amount": 199348000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "QFFXKxxfNyYvFyyCMpfMTPrYr88"
      }
    }
  ],
  "sigs": [
    "1fdbdd814380c41102444bb4959d976645d668c0dd34d41c1f38b8c666b114b0aa0ff02d70f5d1926209a5f6ef9950b5d97cb6a360912e9263b685b4276db3adc9",
    "20596d1a215427a0ce4d71a6ccd9a72b4c5d1577c058d362d62caec7add86dad8ef3571e20a903f5bbaa7744831cd7b458207f7465b65aa6113bfc422f8019edb7"
  ]
}

Might make sense to put trx_hash in the transaction itself rather than as a field in the output_ref. Could you ever have inputs whose output_refs have different trx_hashes?

Yes, 99% of the time the trx_hashes are different.  This only happened because I was sending money to myself in the test case.   

The structure of the transaction is proven with testing and implementation.  This is not a SPEC, but a dump from actual running code.

The valid after and valid for integers will have to change to actual timestamps now that we are not using mining and have variable length blocks. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster


Example Transaction:
Code: [Select]
{
  "version": 0,
  "stake": 159535476,
  "timestamp": "19700101T000000",
  "valid_after": 0,
  "valid_blocks": 0,
  "inputs": [
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 0
      },
      "input_data": ""
    },
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 1
      },
      "input_data": ""
    }
  ],
  "outputs": [
    {
      "amount": 200000000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "PqdiEfgjYw8remotv6Zp25UbupJ"
      }
    },
    {
      "amount": 199348000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "QFFXKxxfNyYvFyyCMpfMTPrYr88"
      }
    }
  ],
  "sigs": [
    "1fdbdd814380c41102444bb4959d976645d668c0dd34d41c1f38b8c666b114b0aa0ff02d70f5d1926209a5f6ef9950b5d97cb6a360912e9263b685b4276db3adc9",
    "20596d1a215427a0ce4d71a6ccd9a72b4c5d1577c058d362d62caec7add86dad8ef3571e20a903f5bbaa7744831cd7b458207f7465b65aa6113bfc422f8019edb7"
  ]
}

Might make sense to put trx_hash in the transaction itself rather than as a field in the output_ref. Could you ever have inputs whose output_refs have different trx_hashes?

Yes, 99% of the time the trx_hashes are different.  This only happened because I was sending money to myself in the test case.   

The structure of the transaction is proven with testing and implementation.  This is not a SPEC, but a dump from actual running code.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Example Block:
Quote
...

block json got clipped
possibly because of quote tags instead of code tags
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai

Example Transaction:
Code: [Select]
{
  "version": 0,
  "stake": 159535476,
  "timestamp": "19700101T000000",
  "valid_after": 0,
  "valid_blocks": 0,
  "inputs": [
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 0
      },
      "input_data": ""
    },
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 1
      },
      "input_data": ""
    }
  ],
  "outputs": [
    {
      "amount": 200000000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "PqdiEfgjYw8remotv6Zp25UbupJ"
      }
    },
    {
      "amount": 199348000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "QFFXKxxfNyYvFyyCMpfMTPrYr88"
      }
    }
  ],
  "sigs": [
    "1fdbdd814380c41102444bb4959d976645d668c0dd34d41c1f38b8c666b114b0aa0ff02d70f5d1926209a5f6ef9950b5d97cb6a360912e9263b685b4276db3adc9",
    "20596d1a215427a0ce4d71a6ccd9a72b4c5d1577c058d362d62caec7add86dad8ef3571e20a903f5bbaa7744831cd7b458207f7465b65aa6113bfc422f8019edb7"
  ]
}

Might make sense to put trx_hash in the transaction itself rather than as a field in the output_ref. Could you ever have inputs whose output_refs have different trx_hashes?
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

Code: [Select]
enum claim_type_enum
{
   /** basic claim by single address */
   null_claim_type        = 0,
   claim_by_pts            = 1, ///< someone importing a PTS balance
   claim_by_signature    = 2, ///< someone signs with an address
   claim_by_bid             = 3, ///< someone makes an acceptable bid
   claim_by_long           = 4, ///< someone agrees to go long against a short
   claim_by_cover          = 5, ///< someone covers a short, freeing collateral
   claim_by_opt_execute = 6, ///< someone executes an option
   claim_by_multi_sig      = 7, ///< N of M signatures required
   claim_by_escrow         = 8, ///< claimable with 2 of 3 signatures, 3rd signature can only split between 1&2
   claim_by_password      = 9, ///< used for cross-chain trading
   num_claim_types
};

I will provide more information about the API shortly in the other bounty thread. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster

Example Block:
Quote
{
  "version": 0,
  "prev": "985359c27bfb0ee5d57dffe91af56d1eafffe723",
  "block_num": 1,
  "timestamp": "20140101T051724",
  "total_shares": 9999837000,
  "total_coindays_destroyed": 0,
  "trx_mroot": "54c52f03c52e5f670d0721aad8cf57ccfbb28e51",
  "trxs": [{
      "version": 0,
      "stake": 3260634008,
      "timestamp": "19700101T000000",
      "valid_after": 0,
      "valid_blocks": 0,
      "inputs": [{
          "output_ref": {
            "trx_hash": "41bda2a7a8fcbb4af49fed950eb1e01eb605ffd4",
            "output_idx": 0
          },
          "input_data": ""
        }
      ],
      "outputs": [{
          "amount": 2000000000,
          "unit": "bts",
          "claim_func": "claim_by_signature",
          "claim_data": {
            "owner": "GnNSoijg9wEhfaXWkbLR1bkyoFn"
          }
        },{
          "amount": 7999837000,
          "unit": "bts",
          "claim_func": "claim_by_signature",
          "claim_data": {
            "owner": "MNztHhCvn1YqTboeY1EyLfKxAcE"
          }
        }
      ],
      "sigs": [
        "1f0de2cc1ca8ecf6c6e156c973c7a15da5dfa4dfd5d01826a392cf7f7459b2dda3bdc7ab3625199bf79f3a82074107a5122442aba9947e01bf97f7ac6155860120"
      ]
    }
  ]
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster


Example Transaction:
Code: [Select]
{
  "version": 0,
  "stake": 159535476,
  "timestamp": "19700101T000000",
  "valid_after": 0,
  "valid_blocks": 0,
  "inputs": [
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 0
      },
      "input_data": ""
    },
    {
      "output_ref": {
        "trx_hash": "226632dd45b4da5d1800c9e05497fd8a9a57a794",
        "output_idx": 1
      },
      "input_data": ""
    }
  ],
  "outputs": [
    {
      "amount": 200000000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "PqdiEfgjYw8remotv6Zp25UbupJ"
      }
    },
    {
      "amount": 199348000,
      "unit": "bts",
      "claim_func": "claim_by_signature",
      "claim_data": {
        "owner": "QFFXKxxfNyYvFyyCMpfMTPrYr88"
      }
    }
  ],
  "sigs": [
    "1fdbdd814380c41102444bb4959d976645d668c0dd34d41c1f38b8c666b114b0aa0ff02d70f5d1926209a5f6ef9950b5d97cb6a360912e9263b685b4276db3adc9",
    "20596d1a215427a0ce4d71a6ccd9a72b4c5d1577c058d362d62caec7add86dad8ef3571e20a903f5bbaa7744831cd7b458207f7465b65aa6113bfc422f8019edb7"
  ]
}
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster

11:53pm. True believer here ;)

Happy New Year!

Happy New Year to you too... ok, working on this for you now.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
11:53pm. True believer here ;)

Happy New Year!
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

Any chance at even a partial json dump tonight?

Also, can you confirm that you will define this to be possible to finish before the official PTS->BTS launch block? (Is there a term for "block you use for determining balances"?)

I will try to put something together in the next 30 minutes (what time is it where you are?)
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Any chance at even a partial json dump tonight?

Also, can you confirm that you will define this to be possible to finish before the official PTS->BTS launch block? (Is there a term for "block you use for determining balances"?)
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

Do you have a sample blockchain .dat file?

I will post an example JSON dump of a block with transactions in it of every type.

I will also define a JSON RPC API to query blocks and transactions as well as market status.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster

Do you have a sample blockchain .dat file?

I will post an example JSON dump of a block with transactions in it of every type.

For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Do you have a sample blockchain .dat file?
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.