These are chat archives for ethereum/tutorials

29th
Aug 2017
Jpeng0108
@Jpeng0108
Aug 29 2017 02:26
what is difference between the "internal transfer" and "transfer" functions?
Brooks Boyd
@MidnightLightning
Aug 29 2017 02:37
@gabrielmoreira1975 Hmmm, I see in your code line you've got a semicolon at the end of the line; is this part of the declaration of a class variable? If so, then the real issue is likely somewhere else; you've got another variable with the same name which is getting mixed up with this class-level one? If you show more of your code, we can probably help you out more.
vin-wag
@vin-wag
Aug 29 2017 03:18
I need instructions to run a very simple Ehtereum code .. how do I create the most basic contract and how do I run it ? can someone help me get started ?
Brooks Boyd
@MidnightLightning
Aug 29 2017 03:26
@vin-wag Your best bet is to go through the sample exercises on https://www.ethereum.org/ to get started; those are some well-documented examples to start with.
VB
@helios1989
Aug 29 2017 07:37
hello everyone
i just started to use truffle to scaffold my project
May i ask how wil be the backend interact in truffle
AndyTrades
@AndyTrades
Aug 29 2017 10:15
I'm so close to downloading the Ethereum blockchain yet it stopped and I don't know what to do. I used the following code.
geth --syncmode "fast" --cache 1024
Ayushya Chitransh
@AyushyaChitransh
Aug 29 2017 10:20
Is anyone here using parity?
Brooks Boyd
@MidnightLightning
Aug 29 2017 11:41
@AyushyaChitransh Yes, I am.
manu3d
@emanuele3d
Aug 29 2017 12:21
I'm also having problems downloading the whole blockchain. It is stopping/hanging very close to the end. So far I found no solution. But the saddest part for me is that I was evaluating if ethereum could be the platform for e-voting for my local community and with these problems I cannot recommend it, it's just too rough on the edges for average computer users (and even worse for older people) to deal with. =(
I will nevertheless try some development through the available frameworks and test nets..
Brooks Boyd
@MidnightLightning
Aug 29 2017 13:05
@emanuele3d Even if you can't get your local node to sync up properly, that doesn't need to be a hindrance to keep you from using the Ethereum blockchain to create your own smart contracts. Using a tools like MetaMask, Remix, and MyEtherWallet, you can interact with the Ethereum network without needing to figure out how to run your own node.
phalexo
@phalexo
Aug 29 2017 13:36
@AndyTrades What OS?
@emanuele3d What OS?
panjian1969
@panjian1969
Aug 29 2017 14:36
helle
hello,everybody
who can help me to solve a small problem?
panjian1969
@panjian1969
Aug 29 2017 14:41
i want to create a new contract with Ethereum,when i did the last process ,the fee could not be transacted,and i got a notice that you account can not do incoming transaction.How can I do then? please help me ! This is important to me.Thank you!
the notice is :Accounts are password protected keys that can hold Ether and Ethereum-based tokens. They can control contracts, but can't display incoming transactions.
phalexo
@phalexo
Aug 29 2017 14:46
@panjian1969 The problem is with your understanding of English, not software.
panjian1969
@panjian1969
Aug 29 2017 14:47
:
?
please direct me!my English is really limited
phalexo
@phalexo
Aug 29 2017 14:50
The notice has nothing to do with any problems. It simply informs you that you would need a wallet to display transactions.
panjian1969
@panjian1969
Aug 29 2017 14:52
wallet? Is my account a wallet?I have an account with 1.01 ether
phalexo
@phalexo
Aug 29 2017 14:53
Accounts are not wallets, and wallets are not accounts.
panjian1969
@panjian1969
Aug 29 2017 14:53
ooo
phalexo
@phalexo
Aug 29 2017 14:53
A wallet manages 1 or more accounts (which are just public/private key pairs)
panjian1969
@panjian1969
Aug 29 2017 14:55
but I downloaded Ethereum Wallet ! and I created a new contract there!
how can I get a wallet?
phalexo
@phalexo
Aug 29 2017 14:57
You already have the Etherwallet. You can create another wallet that will be stored on the blockchain if you want.
That's all I have the time for. Someone else can help you more.
panjian1969
@panjian1969
Aug 29 2017 14:59
ok,thank you very much
but I 'm confused now
Brooks Boyd
@MidnightLightning
Aug 29 2017 15:17
@panjian1969 what language do you speak fluently? Maybe someone can jump in with your own language?
panjian1969
@panjian1969
Aug 29 2017 15:27
mandarin
chinese
@MidnightLightning mandarin
just now I 'm surprised, my ether is less! no transaction ,why less?
panjian1969
@panjian1969
Aug 29 2017 15:45
who can help me ? I'll crazy
Brooks Boyd
@MidnightLightning
Aug 29 2017 15:47
Your transaction has now gone through, which is why your balance is less now.
The "error" you saw earlier is not an error, just information. It was waiting for the blockchain to catch up.
panjian1969
@panjian1969
Aug 29 2017 16:06
@MidnightLightning ?
I don't think so,no transaction there,but ether is less now
Brooks Boyd
@MidnightLightning
Aug 29 2017 16:29
What is your account's public address?
vishwas96
@vishwas96
Aug 29 2017 17:27
hello
I want to know something. Does the code is itself is enough to create whole network of the crypto coin system
Brooks Boyd
@MidnightLightning
Aug 29 2017 17:34
If you are asking if you can write your own cryptocurrency on the Ethereum network, then yes. If that's not your question, can you try and explain it further?
manu3d
@emanuele3d
Aug 29 2017 20:43

@MidnightLightning the tutorials on ethereum.org are based on using EthereumWallet hence my (first) attempt going down that route. I will try the other solutions you suggest.

@phalexo: my OS is Windows 7.

Jumping the subject a bit, what are the current encryption capabilities within smart contracts? I.e. could a voter send a token containing an encrypted envelope with a vote/choice that only the contract can open, so that 1) the voter can only vote once and there is a record that the voter has voted, as a transaction 2) all the votes are unencrypted only when the tallying occurs and individual votes cannot be reconnected with the voter.

Also, I'm guessing the previous question might be more appropriate in another ethereum-related room? "research" perhaps?

phalexo
@phalexo
Aug 29 2017 20:51
@emanuele3d Find out what service you can use to sync your clock, on Linux it is NTP.
manu3d
@emanuele3d
Aug 29 2017 20:52
Win7 has an "Internet Time" which in my case is currently enabled and set to poll time.nist.gov.
So, my clock should be synchronized to a second or less with an atomic clock somewhere in the US.
phalexo
@phalexo
Aug 29 2017 20:53
Should be ok. So what happens with blockchain sync?
manu3d
@emanuele3d
Aug 29 2017 20:57
About 10 minutes ago I thought of starting Mist and it says it needs to be synced. It says it is downloading block 4217349 out of 4217527 and is currently hanging, seemingly doing nothing. A few minutes ago it said it was downloading the chain structure, but it often seem to restart the process from scratch as it currently says 700 out of 10000, with both numbers rapidly increasing... until they slow down and they disappear for a while.
phalexo
@phalexo
Aug 29 2017 21:01
My bet was the clock. Run geth from a command line with --fast --cache 1024 --ipcpath C:\temp\geth.ipc and wait for it to get to the point where it downloads 1 block at a time.
And then try to attach to it, with mist.exe --rpc C:\temp\geth.ipc
manu3d
@emanuele3d
Aug 29 2017 21:05
Trying now.
I thought --fast worked only if I used removedb first...
manu3d
@emanuele3d
Aug 29 2017 21:11
Something seems strange though. Nothing gets created in the ipcpath folder...
phalexo
@phalexo
Aug 29 2017 21:12
@emanuele3d Don't listen to idiots telling you to delete stuff.
manu3d
@emanuele3d
Aug 29 2017 21:12
Roger that. =)
phalexo
@phalexo
Aug 29 2017 21:13
There is no socket in C:\temp?
Does C:\temp exist?
manu3d
@emanuele3d
Aug 29 2017 21:13
I mean: the folder exist, the .ipc file doesn't.
phalexo
@phalexo
Aug 29 2017 21:14
Hm.
Maybe flags are different on Windows.
manu3d
@emanuele3d
Aug 29 2017 21:14
Lemmecheck.
At the beginning of the execution it said: IPC endpoint opened: \.\pipe\C:/temp/gethTmp/geth.ipc does that look alright to you? Of course I did create the gethTmp folder first.
phalexo
@phalexo
Aug 29 2017 21:17
Ok, so it did open the pipe.
manu3d
@emanuele3d
Aug 29 2017 21:17
--ipcpath is definitely mentioned in geth --help.
Yes, but there is nothing in that folder. Is that intended? I was expecting a geth.ipc file in there.
phalexo
@phalexo
Aug 29 2017 21:19
Maybe you'll have to pass C:/temp/gethTmp/geth.ipc to Mist.
can you see gethTmp in temp?
manu3d
@emanuele3d
Aug 29 2017 21:20
Yes, gethTmp is there. It's just empty.
phalexo
@phalexo
Aug 29 2017 21:20
Windows is strange.
It may be invisible
manu3d
@emanuele3d
Aug 29 2017 21:20
<sigh> yes.
I just ran ls -la (I installed unix commands) but it didn't find anything hidden. Let me check though.
phalexo
@phalexo
Aug 29 2017 21:22
The question is if geth is downloading blocks
And if it is 1 block at a time.
manu3d
@emanuele3d
Aug 29 2017 21:23

Most of the lines of output I see are in the form:

INFO [08-29|23:22:57] Imported new state entries count=2 flushed=0 elapsed=920.052ms processed=131 pending=1052 retry=0 duplicate=0 unexpected=0

phalexo
@phalexo
Aug 29 2017 21:23
No lines wth block numbers?
manu3d
@emanuele3d
Aug 29 2017 21:23

Just now a line in the form:

INFO [08-29|23:23:16] Imported new block receipts count=8 elapsed=33.001ms number=4217372 hash=f3814f…8b29d8 ignored=0

popped in.

phalexo
@phalexo
Aug 29 2017 21:24
at the end or close
manu3d
@emanuele3d
Aug 29 2017 21:24
Is that telling me 8 blocks have just been imported?
phalexo
@phalexo
Aug 29 2017 21:24
Still have to wait then
Until 1 block at a time.
manu3d
@emanuele3d
Aug 29 2017 21:25

So, that "count" is the number of blocks it imported? And what's the difference between block headers and block receipts? I.e.:

INFO [08-29|23:23:51] Imported new block headers count=0 elapsed=3.000ms number=4217564 hash=c81854…80d25f ignored=192
INFO [08-29|23:23:52] Imported new block headers count=41 elapsed=51.002ms number=4217632 hash=22428d…077237 ignored=27
INFO [08-29|23:23:59] Imported new block receipts count=22 elapsed=35.002ms number=4217394 hash=53a58b…4d6d18 ignored=0

phalexo
@phalexo
Aug 29 2017 21:26
about 300 to go
,640 on my end
manu3d
@emanuele3d
Aug 29 2017 21:27
Why is the process very slow toward the end of the chain? At the beginning it seemed very quick.
phalexo
@phalexo
Aug 29 2017 21:28
Probably compressed blocks.
manu3d
@emanuele3d
Aug 29 2017 21:28
You mean the initial... 4 million were compressed blocks?
phalexo
@phalexo
Aug 29 2017 21:29
Assuming.
Also more peers have older blocks, again my assumption.
,645 block here
manu3d
@emanuele3d
Aug 29 2017 21:31
I thought that might be, but I'm a newbie in P2P stuff and I didn't want to assume. =)

Last block-related line of output:

NFO [08-29|23:24:14] Imported new block receipts count=159 elapsed=311.017ms number=4217561 hash=1467fd…eb08c0 ignored=0

Did you see my question on voting? Would that be more appropriate in the research channel? I didn't even realize this is a tutorial channel.
Or perhaps the solidity channel?
phalexo
@phalexo
Aug 29 2017 21:34
There were some others talking about voting.
As I suggested to another guy 1) Fixed number of addresses with one token each stored on the blockchain before the election 2) Distribute addresses/keys randomly to voters 3) Have them send 1 token to the candidate's account they like.
manu3d
@emanuele3d
Aug 29 2017 21:40
That's an interesting twist on what I had in mind. Rather than distributing the tokens to known addresses and then working some kind of encryption magic from that starting point, you'd distribute the addresses at random. The distribution of addresses/keys needs to be done out of ethereum though, by a central authority rather than a smart contract, right?
phalexo
@phalexo
Aug 29 2017 21:42
It doesn't matter who or what distributes as long as it cannot be tracked.
phalexo
@phalexo
Aug 29 2017 21:47
Is it synced up?
,697 here
700
manu3d
@emanuele3d
Aug 29 2017 21:50

Well, if I (central authority) distribute the addresses/key manually (paper envelopes or via email) I can track things. It'd be good if a contract did it, but how can a contract distribute addresses and keys without being tracked? Wouldn't these addresses and keys be part of a transaction that gets stored in the chain?

Regarding your question, the last block-related output line is still the same as before:

INFO [08-29|23:24:14] Imported new block receipts count=159 elapsed=311.017ms number=4217561 hash=1467fd…eb08c0 ignored=0

After that there are about 40 lines "Importing new state entries".

Current last one:

INFO [08-29|23:50:41] Imported new state entries count=380 flushed=465 elapsed=5.404s processed=12477 pending=12367 retry=4 duplicate=0 unexpected=23

phalexo
@phalexo
Aug 29 2017 21:53
A contract would vote on your behalf.
manu3d
@emanuele3d
Aug 29 2017 21:55
You are being very synthetic and honestly with my lack of experience with smart contract I am struggling to connect the dots.
phalexo
@phalexo
Aug 29 2017 21:55
In a physical setting, one can print QR codes for each vote and put in a box.
manu3d
@emanuele3d
Aug 29 2017 21:56
Good point. And then people just extract the codes at random.
phalexo
@phalexo
Aug 29 2017 21:56
You come in, pull a vote at random and vote.
But they all have to be pre-stored so the person can check the vote after the fact on line.
manu3d
@emanuele3d
Aug 29 2017 21:59
So, thinking from a voter perspective: you get an envelope from a box with a QR code. You then go home and the QR code leads you to... a smart contract in which you can choose your vote? The smart contract then sends the token to the account corresponding to your choice? Did I get the workflow right?
phalexo
@phalexo
Aug 29 2017 22:01
Or you vote on the spot. Keep the QR code card, and check at home if your vote was cast correctly by looking up the blockchain transaction.
manu3d
@emanuele3d
Aug 29 2017 22:02
Certainly you have given me some interesting food for thought.
phalexo
@phalexo
Aug 29 2017 22:03
Is geth stuck?
manu3d
@emanuele3d
Aug 29 2017 22:04
It continues to output "Imported new state entries" type of line. But I haven't seen a block-related type of line since the one I mentioned earlier.
Is that not normal?
phalexo
@phalexo
Aug 29 2017 22:05
,743 block here
manu3d
@emanuele3d
Aug 29 2017 22:06
The last one for me still seems to be ,561.
phalexo
@phalexo
Aug 29 2017 22:06
I wonder where NTP gets its time. Whether it is from NIST.
manu3d
@emanuele3d
Aug 29 2017 22:07
There must be a config file somewhere? /etc?
phalexo
@phalexo
Aug 29 2017 22:09
What about locale, is that set correctly?
manu3d
@emanuele3d
Aug 29 2017 22:10
Hmmmm.... it depends on the definition of "correctly".
manu3d
@emanuele3d
Aug 29 2017 22:12
Oh, I know how to do that and I just re-synced the clock just in case. I'm not seeing any different behaviour. And I have three devices in sight that are all telling me the time on my system is correct.
phalexo
@phalexo
Aug 29 2017 22:14
Ok.
It is often the problem.
Can you restart geth with a small cache? I wonder if Windows 7 is not flushing buffers.
manu3d
@emanuele3d
Aug 29 2017 22:16
How small is small for you? =)
phalexo
@phalexo
Aug 29 2017 22:17
What it would allow as a valid argument.
Is it a landline by the way or wireless?
manu3d
@emanuele3d
Aug 29 2017 22:19
You mean how my computer is connected to the LAN or how my LAN is connected to the web?
phalexo
@phalexo
Aug 29 2017 22:19
Either. I wonder if the stuff gets buffered and the blockchain runs away.
Your geth node.
manu3d
@emanuele3d
Aug 29 2017 22:23
The laptop I'm running geth from is connected via WiFi - Win7 tells me at 144 Mbps. I then have about 100 Mbps bandwidth (fiber) to my ISP.
phalexo
@phalexo
Aug 29 2017 22:24
The geth node is on your laptop?
manu3d
@emanuele3d
Aug 29 2017 22:25

I restarted geth with the command line:

geth --fast --cache 1 --ipcpath C:/temp/gethTmp/geth.ipc

I do not see much improvement. Seems to have gotten a few blocks initially but we are back at "Imported new state entries".

Why would it be strange for a geth node to be on my laptop?

phalexo
@phalexo
Aug 29 2017 22:26
It is not strange, just considering different possible problems.
manu3d
@emanuele3d
Aug 29 2017 22:26
ah, ok. yes, I confirm it is on my laptop.
phalexo
@phalexo
Aug 29 2017 22:27
Can you restart without --fast flag?
manu3d
@emanuele3d
Aug 29 2017 22:28
Ok.
What's your last block?
I have ,807.
phalexo
@phalexo
Aug 29 2017 22:30
809
manu3d
@emanuele3d
Aug 29 2017 22:30
Does that mean I'm nearly synced?
phalexo
@phalexo
Aug 29 2017 22:31
So it appears.
manu3d
@emanuele3d
Aug 29 2017 22:31
Yay!
phalexo
@phalexo
Aug 29 2017 22:31
810
812
814
manu3d
@emanuele3d
Aug 29 2017 22:32
Still at 807 here. Only 3 "Imported new state entries" lines after that. Has been hanging for about a minute now.
Firing up mist, to see what it says...
phalexo
@phalexo
Aug 29 2017 22:33
Your ISP is fiber, right?
manu3d
@emanuele3d
Aug 29 2017 22:33
Yes.
More "Imported new state entries" lines. So, it is not completely stalled, it's just not getting any new blocks it seems.
Last line:
INFO [08-30|00:34:32] Imported new state entries count=384 flushed=0 elapsed=1m41.774s processed=1870 pending=24197 retry=244 duplicate=0 unexpected=97
phalexo
@phalexo
Aug 29 2017 22:35
How many peers do you have?
13 on my end.
manu3d
@emanuele3d
Aug 29 2017 22:37
Just shutted down geth and started mist: it says it's downloading block ,654 out of ,824. But given in geth I was at 807, I am a bit puzzled. Also, block download is still hanging. Chain structure is being downloaded instead.
phalexo
@phalexo
Aug 29 2017 22:38
Do this instead.
run Ethereumwallet -m mist
manu3d
@emanuele3d
Aug 29 2017 22:39
mist said 6 peers before it switched to the "Downloading..." string. I don't know how to see the peers in geth... should I attach another geth in a different ... ok, I'll follow your instructions...
manu3d
@emanuele3d
Aug 29 2017 22:44

Not much change other than the look and a broken icon in the mist GUI. In the console the only somewhat concerning outputs are:

←[32m[2017-08-30 00:40:45.625] [INFO] Sockets/node-ipc - ←[39mConnect to {"path":"\\.\pipe\geth.ipc"}
←[33m[2017-08-30 00:40:45.627] [WARN] Sockets/node-ipc - ←[39mConnection failed, retrying after 1000ms...
←[33m[2017-08-30 00:40:46.627] [WARN] Sockets/node-ipc - ←[39mConnection failed, retrying after 1000ms...
←[33m[2017-08-30 00:40:47.628] [WARN] Sockets/node-ipc - ←[39mConnection failed, retrying after 1000ms...
←[31m[2017-08-30 00:40:48.626] [ERROR] Sockets/node-ipc - ←[39mConnection failed (3000ms elapsed)
←[33m[2017-08-30 00:40:48.627] [WARN] EthereumNode - ←[39mFailed to connect to node. Maybe it's not running so let's start our own...
←[32m[2017-08-30 00:40:48.627] [INFO] EthereumNode - ←[39mNode type: geth
←[32m[2017-08-30 00:40:48.627] [INFO] EthereumNode - ←[39mNetwork: main
←[32m[2017-08-30 00:40:48.628] [INFO] EthereumNode - ←[39mStart node: geth main
←[32m[2017-08-30 00:40:48.629] [INFO] EthereumNode - ←[39mStart node using C:\Users\manu\AppData\Roaming\Ethereum Wallet\binaries\Geth\unpacked\geth.exe
←[32m[2017-08-30 00:40:51.707] [INFO] EthereumNode - ←[39m3000ms elapsed, assuming node started up successfully
←[32m[2017-08-30 00:40:51.708] [INFO] EthereumNode - ←[39mStarted node successfully: geth main
←[32m[2017-08-30 00:40:51.709] [INFO] Sockets/node-ipc - ←[39mConnect to {"path":"\\.\pipe\geth.ipc"}
←[33m[2017-08-30 00:40:51.710] [WARN] Sockets/node-ipc - ←[39mConnection failed, retrying after 1000ms...
←[32m[2017-08-30 00:40:52.711] [INFO] Sockets/node-ipc - ←[39mConnected!
←[32m[2017-08-30 00:40:52.711] [INFO] NodeSync - ←[39mEthereum node connected, re-start sync
←[32m[2017-08-30 00:40:52.712] [INFO] NodeSync - ←[39mStarting sync loop
←[32m[2017-08-30 00:40:52.713] [INFO] Sockets/3 - ←[39mConnect to {"path":"\\.\pipe\geth.ipc"}
←[32m[2017-08-30 00:40:52.719] [INFO] Sockets/3 - ←[39mConnected!
←[32m[2017-08-30 00:40:52.729] [INFO] (ui: splashscreen) - ←[39mNetwork is mainnet
←[32m[2017-08-30 00:40:52.730] [INFO] (ui: splashscreen) - ←[39mNetwork is mainnet
←[32m[2017-08-30 00:41:17.116] [INFO] main - ←[39mConnected via IPC to node.

phalexo
@phalexo
Aug 29 2017 22:46
You didn't have node running, you killed geth. That is normal.
manu3d
@emanuele3d
Aug 29 2017 22:46
Ok.
Mist seemingly hanging. Block ,654 of ,835.
phalexo
@phalexo
Aug 29 2017 22:48
851 here.
Mist/Etherwallet store application data. Wonder if that is messed up.
manu3d
@emanuele3d
Aug 29 2017 22:49
Should I reinstall you think?
phalexo
@phalexo
Aug 29 2017 22:50
Before you do that, you need to preserve chaindata folder and keystore folder.
Don't want to re-download everything again.
If you have any ether associated with the account you may have set up you should back up accounts and make copies of UTC* keyfiles.
manu3d
@emanuele3d
Aug 29 2017 22:55
Nah. It's still empty. I was counting to do stuff on the test nets before I get any ether.
phalexo
@phalexo
Aug 29 2017 22:56
Ok, then you should move chaindata folder somewhere else before cleaning up and reinstalling.
manu3d
@emanuele3d
Aug 29 2017 22:57
I'm trying to do just that but it says a program is using it. Which is peculiar because I killed all geths and mists...
phalexo
@phalexo
Aug 29 2017 22:57
Windows make a mess of this. There are special steps one has to follow to get permissions.
I've to go, get something to eat. It's not an emergency at the moment?
manu3d
@emanuele3d
Aug 29 2017 23:00

I think I'll call it a day (1am here), and shut down the computer, hoping when I restart it tomorrow it will allow me to save that data somewhere else.

Thank you very much for your support over the past couple of hours. I'll let you know if the reinstall improved the situation.

phalexo
@phalexo
Aug 29 2017 23:01
Ok, perfect.
manu3d
@emanuele3d
Aug 29 2017 23:01
Definitely not an emergency. I'm just exploring the Ethereum dimension for curiosity.
Have a good day! And buon appetito!
eddie2024
@eddie2024
Aug 29 2017 23:07
Is there a way of assigning a token symbol and name within a contract so that new users will automatically have it assigned once they recieve the tokens?