Questions tagged [eosio-code]

Questions relating to the official eosio code--for instance, this may include questions about particular functions or data structures, certain files or contracts, compilation or building problems, related libraries, scripts, binaries, or similar.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Caught exception: TypeError: Cannot read property 'getAvailableKeys' of undefined

When i try to do transaction this error gets thrown no information on this so far I am using latest version of eosjs v= 21.0.2 I am reading the accounts names balance to transfer and public key from a ...
0
votes
0answers
9 views

Erorr : assertion failure with message: unable to find key on push action eosio init

I have read other answers regarding this error but this case is different. I have created a private network on which i deployed eosio.token contract on a account with name other than eosio.token (...
0
votes
0answers
7 views

What is purpose of eos flag --enable-stale-production?

I am trying to setup a private eos network but when i unset flag --enable-stale-flags node does not start producing blocks what is exactly the purpose of this flag In which cases this flag should be ...
0
votes
0answers
5 views

How to replace EOS as core system token with some other(created) token for private network

Is it possible to replace eos with some other token created from eosio.token contract and make it core system token
0
votes
1answer
18 views

Can we make txs free of cost/without staking on privately deployed eos network

I want to deploy a private eos network on which users don't have to stake or pay ram or network or cpu is that possible if yes how so ? do I have to tweak code in eosio.system contracts Also what are ...
0
votes
1answer
24 views

EOS Node Build Help

I'm new to development so hopefully someone can point out what I may have done wrong. I'm trying to set up an EOS node using Ubuntu VirtualBox on my Windows machine. I have installed everything ...
0
votes
1answer
21 views

How to reduce block production speed in private Network Setup

I setup an eos private network which is creating block at speed of 500ms per block is it possible to reduce it to 2sec per block or more The problem is most of the blocks gets produced with 0 txs in ...
0
votes
0answers
18 views

eosio-explorer can't see block and transactions,postgreSQL light is red

I want to build a local blcokchain explorer. I used the offical eosio-explorer, but it didn't work. The postgreSQL light always red. I can't search the block form number or transactions. I can use the ...
0
votes
0answers
22 views

How to catch Error in EOS smart contract?

I am writing a smart contract to add, erase data and write logs accordingly. Below is my smart contract: #include <eosio/eosio.hpp> #include <eosio/print.hpp> #include <eosio/system....
0
votes
1answer
21 views

How to integrate Restfull API with smart contract using c#?

I am new to EOSIO. I referred eos.io for learning. Now I need to learn how to integrate API with a smart contract. I am willing to do this in c#. I got answers mostly for eosjs which is used in nodejs,...
0
votes
0answers
14 views

EOSIO calculate transaction_mroot

As a general task i am trying to reverse engineer the production of a Block. With the help of EOSJS i was able to make a transaction from scratch and i can de/serialize it and sign it and so on. Now i ...
0
votes
2answers
10 views

No member name in namespace 'block-signing_authority' in eosio

I am having issues compling the eosio.system contract with the new eosio 2.0 upgrades I keep generating the same error below. What could be the cause of this error ? include/eosio.system/eosio....
0
votes
1answer
57 views

Setting eosio.code permission for contract account in eosjs

I am trying to set the eosio.code permission for my contract on account kbo2byvpkbiy (private blockchain). The reason I want to do this is calling eosio.token/transfer from within this contract. All ...
1
vote
1answer
19 views

Eos-sharp jungle Error 3090003 when trying to call external smart contract

I’m trying to achieve something quite simple. I try to call eosio.token transfer from one of my smartContract (lomtaxjungle dopurchase), but after severals days i still don’t manage to do it. From ...
1
vote
1answer
51 views

I have doubts about intercontract communication

I have read that: In order to call an inline action, that is to call an action of contract A from contract B, there is a need to set some special permission. In this case, the Ram payer for the ...
0
votes
0answers
29 views

Does anyone used EOSIO-java to connect to EOSIO?

I am trying to connect Java to EOSIO using eosio-java example. tried with gradle and maven in java, with the below example https://github.com/EOSIO/eosio-java#installation Two classes are not found....
0
votes
0answers
18 views

Eosio-java unable to download all the maven required dependencies

I am trying the eosio-java example. I am using the below dependencies and repository. Only eosiojava and eosiojavasoftkeysignatureprovider are successful.I knew other two dependencies are specific to ...
0
votes
2answers
46 views

(eosio v2.0.2) contract prints are not shown, even using nodeos with --contracts-console parameter

simple contract compiled using eosio.cdt v1.7.0: #include <eosiolib/contracts/eosio/eosio.hpp> #include <eosiolib/core/eosio/print.hpp> using namespace eosio; CONTRACT eventhandler : ...
1
vote
0answers
25 views

Is it possible to let caller to pay for the cpu of an inline deferred transaction of a contract?

For example, A send a transaction t1 that will call the contract action act1, act1 will send a deferred transaction t2. Is it possilbe that let A pay for the cpu instead of the contract account?
2
votes
2answers
54 views

Problems with [[eosio::on_notify…]

Thanks in advance for any help. I can't seem to get on_notify to work (attempting to trigger for any tokens sent to the contract, but for the example I've tested both * and eosio.token) The method: ...
1
vote
0answers
38 views

How to pass in a public key as a string to an action?

I see that public_key is public_key = std::variant<ecc_public_key, ecc_public_key, webauthn_public_key> While ecc_public_key is std::array<char, 33> How would I create a public key ...
0
votes
1answer
21 views

Send_transaction function is it used?

I found a strange function(send_transaction) in eos. The function is used in 1.7 version. But It looks like doesn't used in 1.8 version. And the function is duplicated of the push_transaction. ...
0
votes
0answers
123 views

eosio.contract unit_test error “critical check validate()” when added new global table and bps change

i get the an error from the eosio.contract unit_test as follow: /eosio/1.8/include/eosio/testing/tester.hpp(364): fatal error: in "eosio_system_tests/vote_producers_in_and_out": critical check ...
0
votes
1answer
48 views

Unable to creating Eos account with nodejs using eosjs library

I have no idea where am i making mistake? please help. const express = require('express'); const path= require('path'); const app =express(); const { Api, JsonRpc, RpcError } = require('eosjs'); ...
0
votes
2answers
81 views

how can you use the ONLY_BILL_FIRST_AUTHORIZER feature for updateauth?

when i try to put 2 authorities to updateauth i get this error Error: updateauth action should only have one declared authorization so how can i use another accounts cpu to change my keys not using ...
0
votes
1answer
26 views

Function not giving expected output Eos smart contract

My contract .Cpp part void mainloan::adduwr(name acc_name, double interest, uint64_t loan_amount ) { print("Adding underwriter", acc_name); // require_auth( _self ); uwr_table.emplace(get_self(...
0
votes
1answer
53 views

Convert String to double (flaot32/float64) in EOSIO [duplicate]

serialize support for float types is not added in flutter and thats why i have to come to this way,so if anyone have any working example for this,ill be really thankful for that. I have tried this ...
0
votes
0answers
19 views

A non-producing block, create account stuck

I am having a non-producing node for my chain. But when I run the command cleos create account eosio myaccount PUB_KEY PUB_KEY But it stuck somewhere. No output for a long time. I have put --print-...
0
votes
0answers
16 views

Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations [duplicate]

I am trying to create an account with different creator NOT EOSIO. I have configured node config.ini producer-name = sunny signature-provider = PUB_KEY=KEY:PRIVATE_KEY Error 3090003: Provided keys, ...
0
votes
2answers
81 views

Calling Action on EOS blockchain with Flutter App throwing Exeception Unknown type : float32 or float64

Hey I'm working on a Eosio blockchain dapp, so for front end I'm using flutter. We have a package Eosdart for connecting flutter to eos blockchain. Everything was good till here, but the problem ...
0
votes
0answers
33 views

Unvote a producer

I am working on eosio.system contract, I run my own local chain, in which I elect 5 block-producers and they start to produce block. Now let suppose I want to kick-out any block-producer from my ...
0
votes
1answer
56 views

how to create a unique user name using public or private key in nodejs?

Like BTC, ETH etc has address, do EOS has address or username etc, I am using below code to generate the public and private key, we do transaction in bitcoin,ethereum etc with a unique address sample ...
0
votes
1answer
37 views

Understanding EOSIO voting mechanism and decay

I have a question on eosio-voting and decay. Suppose there are only 21 block-producers (registered) and only 10 users having equally eos-token. These users now voting for each block-producers, it mean ...
0
votes
1answer
24 views

Unknown action hashit in contract eosio

stdClass Object ( [code] => 500 [message] => Internal Service Error [error] => stdClass Object ( [code] => 3050000 [name] => action_validate_exception [what] => Action validate exception [details] => ...
0
votes
1answer
173 views

How can we retrieve table data with secondary Index in EOS table

this is my table struct [[eosio::table]] payment_made { uint64_t pay_id; uint64_t loan_id; uint64_t pay_amunt; time_point_sec pay_date_req; time_point_sec pay_date_approve; ...
0
votes
1answer
33 views

Where in the code are eosio.prods permission set

where can I find the code in which eosio.prods permission are set? I couldn't find it in system_contract or producer_plugin. thx for any help!!
0
votes
1answer
197 views

Invalid packed transaction

I am trying RPC API. Here is the code which I am using on cmd for testing a dummy transaction. curl --request POST --url http://localhost:8080/v1/chain/push_transaction --header 'accept: application/...
4
votes
2answers
168 views

How to calculate `action_mroot`

UPDATE #3 for future action_mroot calculators: The two critical bits of info needed to do this (that are neither easy to find nor documented) are: There exists an extra action (which has a receipt) ...
0
votes
0answers
38 views

Problem in deferred transaction function

I have added the problem statement as a comment in code so please read the commented line in code. void mainloan::checkdaily(uint64_t loan_id) { require_auth(_self); auto itr = loan_table.find(...
0
votes
0answers
20 views

EOS deferred transaction Error while running

I'm doing this but i'm getting an error, what should i improve? void mainloan::checkdaily(uint64_t loan_id) { auto itr = loan_table.find(loan_id); auto borrower = itr->borr_name; eosio::...
0
votes
2answers
113 views

how do i use current_time_point() to store date in eos table

I have tried This way and its not getting store,infact its giving me error,please sugguest if im making any mistake. error: use of undeclared identifier 'current_time_point'; did you mean '...
0
votes
0answers
18 views

Missing permission of account, but permission is given to acting account

I have account1 and account2. account1 has a contract with an action called update(): void mycontract::update(){ require_auth(get_self()); table_t t(get_self(),scope); auto r = t.find(index); ...
1
vote
1answer
345 views

Code examples for ONLY_BILL_FIRST_AUTHORIZER

Can someone please add code example or describe how to only bill first authorizer? I have tried but can't get it to work. Thanks!
0
votes
0answers
21 views

Eosio 1.8 is released and live, but are the features activated as of today 2019 Oct 7?

I read that the eosio 1.8 is live, but much of the new features are not activated. Where can we see what 1.8 features are activated or pending activation?
1
vote
1answer
64 views

Wondering how to fix eosio.token transfer error in contract

I am developing an EOS dapp game When the user acts on the contract after Scatter authentication, the logic is to deposit the bet amount from the user to the contract account. But I get an eosio....
0
votes
0answers
24 views

Resources for EOS Smart Contract Source Code

What are some educational EOS Smart Contract Examples like Elemental Battles? The best way to learn coding smart contracts and using EOS blockchain is to get some really good example references of ...
1
vote
0answers
7 views

what is the native?

eos/chain/apply_context.cpp 66 line i had been found the something where account_name newly was created like eosio.token, eosio.rex.... So, i found some hint controller.cpp // 321 Line #define ...
0
votes
1answer
51 views

multi_index table get const_iterator at a specific position

is there a better way than a loop to get the value/const_iterator at a specific position in multi_index table? current: auto idx = _table.get_index<"name"_n>(); const_iterator b; int count = ...
0
votes
0answers
28 views

eosjs sign data does not match with eosio assert_recover_key data

at client, I create a signature from seed like this. the key pair is [ '5KgLbwEy7d4qufeLqPnPL1YQU1tscJXCnpqTTn7REaZsjYBjDWr', 'EOS5Mk748B6ojrZdTHP8BoLBXyKjQzzthaqGa4v97vfiGEfbEM2Np'] import ...
0
votes
1answer
109 views

Deferred transaction on EOS [duplicate]

Is it 100% sure that deferred transaction will run on what delay is defined? Is there any possibility that deferred transaction failed to run on defined day? If it fails what is the alternative? ...