Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    experience
    @experiencedft
    @AmritKumar It would be great to have an official one, Gitter is really bad I would like to emphasize that
    I am used to running managing Discord servers with bots etc
    I can help you set it up
    I can tell you it will be immensely better for all the devs interested in Zilliqa
    kishankumar258
    @kishankumar258
    I was using the python code of creating transactions from the link https://apidocs.zilliqa.com/?python#createtransaction but got this error after running the provided code for api . Can someone help on that.
    image.png
    evesnow91
    @evesnow91
    You need to import chain
    Solexplorer
    @Solexplorer
    lol
    running the script more times won't solve the issue
    kishankumar258
    @kishankumar258
    @evesnow91 are you talking about this "from pyzil.zilliqa import chain" as mentioned in the api docs for create transaction because I have written this line in the script. Also, the blockchain related scripts such as "GetNetworkId","GetNumTransactions" are running where the chain is being imported.
    Please tell if there's anything that else that I need to import while running the script for "CreateTransaction" as given in "https://apidocs.zilliqa.com/?python#transaction-related-methods" .
    Amrit Kumar
    @AmritKumar
    If you read the error message, it says active chain is not defined.
    It will be better if you could post your code.
    kishankumar258
    @kishankumar258

    from pyzil.crypto import zilkey
    from pyzil.zilliqa import chain
    chain.set_active_chain(chain.MainNet)

    my_key = zilkey.ZilKey(private_key="0xe19d05c5452598e24caad4a0d85a49146f7be089515c905ae6a19e8a578a6930")

    payload = {
    "to_addr": "4baf5fada8e5db92c3d3242618c5b47133ae003c",
    "amount": "1000000000000",
    "gas_price": "1000000000",
    "gas_limit": 1,
    "code": "",
    "data": "",
    "priority": False,
    }params = active_chain.build_transaction_params(my_key, **payload)
    txn_info = active_chain.api.CreateTransaction(params)
    print(txn_info)

    Amrit Kumar
    @AmritKumar
    You just posted your mainnet private key?
    kishankumar258
    @kishankumar258
    I have used test net here in my code and used private and public key for testnet
    Amrit Kumar
    @AmritKumar
    prepend active_chain with chain.
    And it should work
    So, params = active_chain.build_transaction_params(my_key, **payload) should be params = chain.active_chain.build_transaction_params(my_key, **payload)
    and active_chain.api.CreateTransaction(params) should be chain.active_chain.api.CreateTransaction(params)
    @kishankumar258
    Amrit Kumar
    @AmritKumar
    @jeremyid We have been discussing discord internally for a long time. Maybe we should push it.
    kishankumar258
    @kishankumar258
    @AmritKumar Thanks
    kishankumar258
    @kishankumar258

    @AmritKumar I ran the script by prepending chain to active chain as said but now I am getting this error

    File "zil.py", line 17, in <module>
    params = chain.active_chain.build_transaction_params(my_key, **payload)
    TypeError: build_transaction_params() missing 1 required positional argument: 'nonce'

    The code is exactly same as before just adding the chain before active chain

    evesnow91
    @evesnow91
    @kishankumar258 Do you know how to code in python?
    kishankumar258
    @kishankumar258
    @evesnow91 Yes, but I am using these blockchain related things first time in python.
    李大狗
    @leeduckgo
    Is there any describe about rules of calculate fee in transaction?gas_limit * gas_price == fee?
    李大狗
    @leeduckgo
    There is "for change" in Ethereum, but I haven't saw it in Zilliqa yet.
    Edison Lim
    @edisonljh
    To calculate fees, take the gas cost.
    gas cost * gas price = total price (in zils)
    Convert the gas cost to actual cost by multiplying that by current zil price.
    李大狗
    @leeduckgo
    thx a lot, but the response of rpc request has only "gas price" and "gas limit" but not "gas cost" field?
    image.png
    @edisonljh
    Edison Lim
    @edisonljh
    It's not there, you have to calculate that yourself.
    李大狗
    @leeduckgo
    how can I calculate it, I just want to know the fee of a transaction pull from chain🤣
    Edison Lim
    @edisonljh

    My message above.

    So example:
    If your transaction costs 1000 Gas according to the interpreter, and the gas price that you placed was 1,000 Li, then the gas cost to you for the transaction will be

    1,000 * 1,000 * 10^-6  = 1 Zil.

    That's the mathematical way to go around it. If you want it to be simpler, send a transaction on the devnet. The viewblock will show you the cost breakdown (in both Zils and USD)

    李大狗
    @leeduckgo
    I knew it, but I want to get the "Gas" I used by RPC, the response only contain the "gas_limit" filed.
    does "gas_limit" == "gas I spent"?
    Meai1
    @Meai1
    which wallet is official? they all look unofficial to me: https://chrome.google.com/webstore/search/zilliqa
    evesnow91
    @evesnow91
    We operate similar to Ethereum. There is no official wallet. I will recommend Moonlet, it’s akin to Metamask.
    Meai1
    @Meai1
    what's the fastest way to develop locally? I tried using kaya rpc server but it doesnt seem to work together with the javascript SDK as far as I can tell. I want to deploy contracts quickly (much quicker than 1min blocktime)
    evesnow91
    @evesnow91
    For contract development, I recommend following the contract testing methodology in Scilla binary via easyrun. For dapps testing, Kaya rpc will be revamped soon so they can work together. Please make do with the dev testnet for now.
    李大狗
    @leeduckgo
    image.png
    for example: the field in the return of api of ethereum is "gas". it's make sense, because this is the gas actually used in transaction.
    But the return of zilliqa, there is only "gas limit" and "gas price".
    That is confusing.
    image.png