Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 05 2016 10:36
    @chriseth banned @adamskee
plainas
@plainas
@rusenask how expensive exactly? that is relative
@bobsummerwill I am not interested in alternative 'solutions' to any hypothetical problem. I am asking specifically about using ethereum network to host html content.
andreafspeziale
@andreafspeziale
Someone could suggest me how to start with smart contract dev? from writing to testing and deploying it
Bob Summerwill
@bobsummerwill

@plainas You could write a smart contract which pushed text strings containing HTML to the blockchain, but the blockchain itself cannot serve that HTML directly to end-users, so you would need to write a web app which talked to the blockchain to pull it out again. And it would be very expensive. It is a bad idea. Really.

What is the application you have in mind?

IPFS and Swarm are great solutions for distributed storage of HTML content. They aren't 'solutions'. They are very real technology, and a much better fit for storing file content.

plainas
@plainas
None in particular, just trying to understand how ethereum and dapps in particular work. All the dapps documents and tutorials start by saying that the UI is made in html. Please guys, stop the whole "it's not a good idea, what do you have in mind, there are better options" mantra. I'm just trying to understand how dapps work. I take it they require a special browser like mist? Why not just answering my question directly instead of giving me advice about "better options"?
yann300
@yann300
because the ethereum blockchain can't serve frontend resources, this is not designed for that and nobody does that.
if you want to start writing smart contract: https://ethereum.github.io/browser-solidity
then you will need https://github.com/ethereum/web3.js => web3.js is used to interact with your contract from a javascript app
plainas
@plainas
@yann300 I dont understand what you mean by "from javascript". On which environment is that javascript running? I might be confused, but I recall people talking about "ethereum browser", or pointing to adresses of smart contracts with UIs. Where are those UIs hosted?
yann300
@yann300
that javascript could be run everywhere (browser, nodejs, ...). the UI is either hosted by a websrever or in ipfs or in swarm or in electrum
Vincent
@Bunjin
Hi there, is there some equivalent what MIX IDE was allowing to do in terms of following and debugging the evolution of variables (in solidity form) while executing a tx step by step ? I have tried remix but I have trouble running it and most of all it seems to allow only assembly debbugging
vikasgrover2004
@vikasgrover2004
Hi, quick question. I need to test my dapp and need to give host:port
what is the testnet host:port and main net host:port
yann300
@yann300
@vikasgrover2004 host:port refers to the rpc server that the node is running. depends if your node is sync on the testnet or the mainnet.
mix has been discontinued a few month ago. I would suggest to take a look at https://ethereum.github.io/browser-solidity . browser-solidity integrates remix (debugger tool) https://gitter.im/ethereum/remix .
chriseth
@chriseth
@Bunjin we are working on that - it should not take too much longer. Yann already presented a preview at devcon
imrozoodles
@imrozoodles
@chriseth @yann300 , I am installing mix on Ubuntu machine
I get following error , how to fix and install mix
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mix : Depends: mix-ide but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
yann300
@yann300
@imrozoodles I don't recommend to use mix anymore, it has been replaced by browser solidity/remix https://ethereum.github.io/browser-solidity/
imrozoodles
@imrozoodles
@yann300 my solidity code of contract work fine on browser-solidity but when i debug that solidity code by web3 api , it does not give expected result which i get in browser solidity, what can be issue?
@yann300 how to debug solidity contract code by web3 api
chriseth
@chriseth
@imrozoodles which backend do you use? Not all backends are fully supported yet. Which results do you get and what are your expectations?
imrozoodles
@imrozoodles
@yann300 I am using nodejs
chriseth
@chriseth
I assume when you say "web3 api" that you use json-rpc to connect to a backend node. Is that correct?
oh, now I understand
you compare the result in browser-solidity to the result you get when directly interfacing with a backend via web3.js / json-rpc
so what are the differences?
imrozoodles
@imrozoodles
@chriseth suppose i compare two string on browser-solidity , it work fine.but sometime it does not work in web3 api with nodejs
@chriseth i am using json-rpc to connect backend nodejs
chriseth
@chriseth
This is almost certainly a problem with encoding and decoding the function parameters
imrozoodles
@imrozoodles
@chriseth how to do encoding and decoding perfect way, can u give some example
chriseth
@chriseth
this is probably something you should discuss in gitter.im/ethereum/web3.js
Ankith Raj
@ankithrajhassan

Hey guys, I am quite new to this. Please help me out.
I am trying to build a dapp using meteor. I am having a little trouble with calling a function of the contract using web3.
Here's the code snippet that's trying to call the function of the contract:

myContract.startAFunc.sendTransaction(
  "Name",{from: fromaddress, value: 500000000000000000},
  function(err,address) {
    if(!err)
      console.log(address);});

//myContract is the ABI array at the contract address, startAFunc is the function name

The function prototype is as follows:
function startABet(string _Input} payable

I am getting this error:
Uncaught Error: new BigNumber() not a number: [object Object]

The code was working a while ago. I wanted to make a little modification by sending a variable instead of a hard coded value, but was not able to do so. Later I tried to revert back, not this is not working either.
Can anyone please tell me what is the wrong that I am doing here. I have spent days on this, but haven't been able to figure it out.
I am running it on chrome browser with metamask extension on a ubuntu machine.

chriseth
@chriseth
this is probably something you should discuss in gitter.im/ethereum/web3.js
winsvega
@winsvega
@all has anybody here created a front-end contract page in mist ?
yann300
@yann300
@/all please move to https://gitter.im/ethereum/remix
vikasgrover2004
@vikasgrover2004
I have a question on Token Launch Smart Contract…anyone here can help?
yann300
@yann300
vikasgrover2004
@vikasgrover2004
@vikasgrover2004
Hey Guys, I need help with testing a smartcontract
anyone here with some time to spare to help me test my contract
Musk11
@Musk11
Have you all tried https://ethcrash.io ? It's the best Ethereum gambling site!
awdawdwawad
@awdawdwawad

1- 💰 http://ethcrash.net/jacky - Ethereum Based Crash Game

2- http://ethcrash.net/jacky ➡️ The original & most trusted Ethereum crash game ⬅️

EthCrash.io is a clone of the extremely popular bitcoin game Bustabit. While the rules and math are exactly the same, EthCrash is built to be played with Ethereum. This gives you much lower transaction fees, confirmation times, and the ability to play almost instantly!

3- Provably Fair Information http://ethcrash.net/jacky

How to Play?

Place a bet. Watch the multiplier increase from 1x upwards! Cash out any time to get your bet multiplied by that multiplier. But be careful because the game can crash at any time.

What is one "Ethos"?

Ethos is a millionth of one Ether. If you know Ethereum well, you might already know this unit as a Szabo! One Ethos is the same thing.

How do I deposit Ethos?

Send Ether to the deposit address on your account page! If you don't have any Ethereum, but do have other cryptos you use Shapeshift.io, Changelly or coinswitch.co. Also, if you're a Bustabit.com player we will exchange your bits directly into ethCrash.io for Ethos manually.

Why gamble with Ethereum?

Lower transaction fees Confirmation times The ability to play almost instantly

JOIN NOW! Come have fun on http://ethcrash.net/jacky

Lucas Vieira
@vieiralc
How do I retrieve information from a contract?
My contract is deployed to parity
And I've made a voting dapp where I can register candidates
but When I try to retrieve the candidates registered I just get a json
here the code

Creates the contract:

this.counter = bonds.makeContract(ContractAddress, CounterABI)

get total of candidates registered

atualizaTabela(){
        let qtdTotalCandidatos = this.counter.getTotalCandidatos()
        console.log(qtdTotalCandidatos)
    }
the contract:
contract Candidato {

    event NovoCadastro(string _nome, address _address);

    struct candidato {
        string nome;
        uint qtdVotos;
    }

    mapping (address => candidato) candidatos;
    address[] enderecos;
    uint qtdCandidatos;

    function setCandidato(address _address, string _nome) public {
        if(enderecoCadastrado(_address)) revert();
        candidatos[_address].nome = _nome;
        candidatos[_address].qtdVotos = 0;
        enderecos.push(_address);
        qtdCandidatos++;
        emit NovoCadastro(_nome, _address);
    }

    function getTotalCandidatos() public view returns (uint) {
        return qtdCandidatos;
    }
Lucas Vieira
@vieiralc
image.png
the getTotalCandidatos() functions just returns the total of candidates registered
Thats what the function atualizaTabela console logs:
Why it just doesn't return the number of candidates?
instead of this object
WinBigEasy
@WinBigEasy

1- 💰 Phun.io - Bitcoin Cash Based Crash Game

2- Phun.io
➡️ The original & most trusted Bitcoin Cash crash game ⬅️

Phun.io is a clone of the extremely popular bitcoin game Bustabit.
While the rules and math are exactly the same, Phun is built to be played with Bitcoin Cash.
This gives you much lower transaction fees, confirmation times, and the ability to play almost instantly!

3- Provably Fair Information https://bitcointalk.org/index.php?topic=3187788.0

How to Play?

Place a bet. Watch the multiplier increase from 1x upwards! Cash out any time to get your bet multiplied by that multiplier. But be careful because the game can crash at any time.

How do I deposit Bitcoin Cash?

Send Bitcoin Cash to the deposit address on your account page! If you don't have any BCC, but do have other cryptos you use Shapeshift.io, Changelly or coinswitch.co.

Why gamble with Bitcoin Cash?

Lower transaction fees
Confirmation times
The ability to play almost instantly

JOIN NOW! Come have fun on Phun.io

jenbobs
@JennyJennywren_twitter
This message was deleted
andreafspeziale
@andreafspeziale
@vieiralc You should need something like this:
const contract = web3.eth.contract(CONTRACT_ABI).at(CONTRACT_ADDRESS)
const totalCandidates = contract.getTotalCandidatos.call()
Dunno ur development environment, but check this for example:
https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods
NadimintiSaiSirisha
@NadimintiSaiSirisha
Hey! How can I login two different categories of users eg. Student, teacher in Ethereum Dapp? I also need to let the student know about every teacher and vice versa in the application. Can anyone help me?
angelmariadas
@angelmariadas

I am trying to create a dapp(web3js - truffle) where an API - GET method has to be implemented by setting 'x-api-key' on header. Here is the code :

app.js

//1st method
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", api, true );
xmlHttp.setRequestHeader("x-api-key",key);
xmlHttp.send();
console.log("Result "+JSON.stringify(xmlHttp));

//2nd method

$.ajax({

      url: "api",
      type: "GET",
      headers :{
        "Access-Control-Allow-Origin": "*"
      },
      beforeSend: function (xhr) {
         xhr.setRequestHeader('x-api-key', key);
      },
      success: function (resp) {
          console.log("REsult :"+JSON.stringify(resp))
      },
      error: function(result){
        console.log("ERror : "+JSON.stringify(result));
      }
  });

On chrome I get

Blocked by CORS policy: The 'Access-Control-Allow-Origin'

I am able to get data using POSTMAN and on an executable js script. Tried by adding Allow-Control-Allow-Origin: * extension and enabling it on chrome. Then output was :

Response to preflight request doesn't pass access control check: It does not have HTTP ok status

By trying above piece of code on meanstack - server side, it works. Do I have to write Nodejs backend for dapp? Is there other method to resolve it?