These are chat archives for Nethereum/Nethereum

21st
Sep 2017
kai
@kaista82_twitter
Sep 21 2017 08:38
hey Juan, do you know of any public IPFS gateways which are writable?
kai
@kaista82_twitter
Sep 21 2017 08:48
hey Juan, do you know of any public IPFS gateways which are writable?
Juan Blanco
@juanfranblanco
Sep 21 2017 08:51
hey @kaista82_twitter is infura not writable?
hey @kaista82_twitter is infura not writable?
kai
@kaista82_twitter
Sep 21 2017 08:51
not sure ill try it
:4001?
first time using ipfs you see
just want to try to publish some html
Juan Blanco
@juanfranblanco
Sep 21 2017 08:52
use https
this is what herman always says :)
use the url from infura
kai
@kaista82_twitter
Sep 21 2017 08:52
yeah im just finding the url now
Juan Blanco
@juanfranblanco
Sep 21 2017 08:54
use the access token as it will help you with stats of usage
(still works without it)
kai
@kaista82_twitter
Sep 21 2017 08:54
erm
net-ipfs-api
the one you suggested
Juan Blanco
@juanfranblanco
Sep 21 2017 08:54
yes
kai
@kaista82_twitter
Sep 21 2017 08:54
is that using the http api yeah
Juan Blanco
@juanfranblanco
Sep 21 2017 08:55
let me check some old code
have not use it for a while
kai
@kaista82_twitter
Sep 21 2017 08:55
IPFS RPC is 5001
so guessing net-ipfs-api uses the rpc
connection
Juan Blanco
@juanfranblanco
Sep 21 2017 08:56
using (var ipfs = new IpfsClient(ipfsUrl))
            {
                var inputStream = new IpfsStream(name, stream);

                var merkleNode = await ipfs.Add(inputStream).ConfigureAwait(false);
                var multiHash = ipfs.Pin.Add(merkleNode.Hash.ToString());
                return merkleNode;
            }
kai
@kaista82_twitter
Sep 21 2017 08:56
i just need to test it
im doing something stupid its complaining of closed stream
Juan Blanco
@juanfranblanco
Sep 21 2017 08:59
set the _stream.Position = 0;
kai
@kaista82_twitter
Sep 21 2017 09:00
well i cant seem to find where to put my infura key into the url / headers either tbh yet
all other urls have it as examples when you sign up cept for ipfs
Juan Blanco
@juanfranblanco
Sep 21 2017 09:00
have you registered?
oh.. then don't put it :D
kai
@kaista82_twitter
Sep 21 2017 09:00
yeah, cant access closed stream
maybe the connection is wrong
Juan Blanco
@juanfranblanco
Sep 21 2017 09:01
yes that seems correct
kai
@kaista82_twitter
Sep 21 2017 09:01
my code must be wrong
then
Juan Blanco
@juanfranblanco
Sep 21 2017 09:01
need to find my config files :D they are in Azue
kai
@kaista82_twitter
Sep 21 2017 09:02
:D
kai
@kaista82_twitter
Sep 21 2017 09:10
ok well
i think erm, it may be working or trying
and also
im stupid btw
:D
trying to access it outside the using LOL
already disposed
and me being a bright spark am trying to access it yay
Juan Blanco
@juanfranblanco
Sep 21 2017 09:10
ah.. yes that does not work
ha ha yes.. i have just seen it
kai
@kaista82_twitter
Sep 21 2017 09:11
however now its just frozen, i take it its waiting for the block??
oh god my gaff is there for the world to see lol
Juan Blanco
@juanfranblanco
Sep 21 2017 09:11
well delete it :D
gone
kai
@kaista82_twitter
Sep 21 2017 09:12
lol
tbh
i dont mind i was just playing but nice one
Juan Blanco
@juanfranblanco
Sep 21 2017 09:13
this is the path to query https://ipfs.infura.io/ipfs/
kai
@kaista82_twitter
Sep 21 2017 09:14
yeah i aint got hash back
just trying somethign
Juan Blanco
@juanfranblanco
Sep 21 2017 09:15
and yes this is the url https://ipfs.infura.io:5001/
for add
cannot find my app, i have deleted it
kai
@kaista82_twitter
Sep 21 2017 09:15
ok right that retruend some crazy chars so im converting the hash wrong but looks promising yay
System.Text.Encoding.UTF8.GetString(_response.Hash.Value); not playing ball
i think im close already though wow
???x{??+Y??P?= ?36
hahaha
my hash
so good
that's made me chuckle
Juan Blanco
@juanfranblanco
Sep 21 2017 09:19
yes that is not it
kai
@kaista82_twitter
Sep 21 2017 09:19
hahahaha
damn right its not it hahahahaha
lolol
such a programmer thing to do, i goto .hash rather than just tostring the root obj
wow im great
kai
@kaista82_twitter
Sep 21 2017 09:21
solved
its just response.tostring()
haha
Juan Blanco
@juanfranblanco
Sep 21 2017 09:22
ah.. i was just checking the url
kai
@kaista82_twitter
Sep 21 2017 09:22
one of those mornings hahahaha
QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNR
now to see if it worked!
:|
think ill pick this up later when im not stupid
unless its to do with utf16
Juan Blanco
@juanfranblanco
Sep 21 2017 09:25
well now you are sorted
kai
@kaista82_twitter
Sep 21 2017 09:26
yeah atleast I think its uploading
its just must be uploading wrong or my url is wrong
Juan Blanco
@juanfranblanco
Sep 21 2017 09:26
no it should be fine..
overall the url is
i mean this
Juan Blanco
@juanfranblanco
Sep 21 2017 09:27
then you get thash node.Hash.ToString()
kai
@kaista82_twitter
Sep 21 2017 09:27
yeah that url you gave was perfect
Ohhhh
        var _client = new IPFSService("https://ipfs.infura.io:5001"); //"https://ipfs.infura.io:5001"
        var _response = await _client.Upload();
        textBox.Text = "Waiting";
        textBox.Text = _response.Hash.ToString();
Juan Blanco
@juanfranblanco
Sep 21 2017 09:27
yes
kai
@kaista82_twitter
Sep 21 2017 09:27
yeah moans about encoding
but damn close man
thx for recommending this library
Daniel Hursan
@hdany
Sep 21 2017 09:28
Hey guys, sorry to jump in :D
you seem to have really good experience with geth, so maybe you could help me a bit
let me post a screenshot
kai
@kaista82_twitter
Sep 21 2017 09:29
ok
Juan Blanco
@juanfranblanco
Sep 21 2017 09:29
your file reading is ok too
Daniel Hursan
@hdany
Sep 21 2017 09:29
Capture.PNG
It's my first time developing with geth and nodejs, so I'm pretty noob to this
amjadDev
@amjadDev
Sep 21 2017 09:30
want to execute a particular function at a specific time in solidity for erc20 token let suppose at 11 PM UTC and what timezone ethereum support @kaista82_twitter @juanfranblanco
kai
@kaista82_twitter
Sep 21 2017 09:30
yeah I've not really touched on that personally
sorry, I would just use nethereum itself
which works brilliantly
Daniel Hursan
@hdany
Sep 21 2017 09:31
do you know why "accounts" property is missing from the eth object?
Juan Blanco
@juanfranblanco
Sep 21 2017 09:31
@hdany lol yes :D
kai
@kaista82_twitter
Sep 21 2017 09:31
you should be able to get a ref to web3 just by typing it is all i know about that hdany, pretty sure im missing the point though
brb
Juan Blanco
@juanfranblanco
Sep 21 2017 09:31
that will be because it is a shortcut to eth.getAccounts
Daniel Hursan
@hdany
Sep 21 2017 09:32
but that function is missing as well, right?
Juan Blanco
@juanfranblanco
Sep 21 2017 09:32
(top of my head)
Daniel Hursan
@hdany
Sep 21 2017 09:32
from what I see
funny thing is when I try to use the geth console in nethereum, all works fine
eth.accounts property is there, etc
Juan Blanco
@juanfranblanco
Sep 21 2017 09:33
from your shot i can see is complaining on the requires
have you npm install the required libraries?
@amjadDev you cannot do that
you need an oracle (ie a backend service) to do that
Daniel Hursan
@hdany
Sep 21 2017 09:35
@juanfranblanco , good point, let me try again npm install web3
amjadDev
@amjadDev
Sep 21 2017 09:35
@juanfranblanco i have to call that specific method from my account at specific time correct ?
Juan Blanco
@juanfranblanco
Sep 21 2017 09:35
yes that s about it
amjadDev
@amjadDev
Sep 21 2017 09:36
gotcha
Juan Blanco
@juanfranblanco
Sep 21 2017 09:36
you can create an azure job / cron job / service to do so
Daniel Hursan
@hdany
Sep 21 2017 09:36
@juanfranblanco , seems I missed the install part :D thanks a lot! ;)
Juan Blanco
@juanfranblanco
Sep 21 2017 09:37
@hdany no bother, now you are on fire
node is not bad
kaista82_twitter @kaista82_twitter gets the fire extinguisher
Daniel Hursan
@hdany
Sep 21 2017 09:39
I only started looking into node when the compile and deploy of contracts seemed to not work anymore in nethereum
I read somewhere that I have to use node and solc in order to compile and deploy
Juan Blanco
@juanfranblanco
Sep 21 2017 09:39
so what is your problem
you can use visual studio code and the solidity extension ;)
or remix
and of course truffle
to do the compilation
Daniel Hursan
@hdany
Sep 21 2017 09:40
this is what I was originally aiming for:
Juan Blanco
@juanfranblanco
Sep 21 2017 09:40
also that will generate your "c# service" (The visual studio extension)
Daniel Hursan
@hdany
Sep 21 2017 09:41
var compiledContract = await web3.Eth.Compile.CompileSolidity.SendRequestAsync(File.ReadAllText("ThankYou.sol"));
same with deploy, to automate this a bit and automatically read the abi and bytecode afterwards from generated files
Juan Blanco
@juanfranblanco
Sep 21 2017 09:41
ah.. for that you need to have installed solidity c++ and set the path
so geth can find it
and the trigger it from nethereum
but that is a bit conversome
Daniel Hursan
@hdany
Sep 21 2017 09:42
got it, I'll stick to VS Code then ;)
Juan Blanco
@juanfranblanco
Sep 21 2017 09:42
specially as you may have different file references, etc
Daniel Hursan
@hdany
Sep 21 2017 09:44
thanks again for your help, I appreciate it!
Juan Blanco
@juanfranblanco
Sep 21 2017 09:45
you could automate the reading of the binary and abi, to create a generic service.. But if anyone needs to consume it, still need to know the information about the methods, etc.. hence (IMHO) is to generate the services that give you all the information
Daniel Hursan
@hdany
Sep 21 2017 09:49
by the way
if I compile with VS Code, all is good
if I try right click on contract in Visual Studio 2015 -> Compile contract, I get
Error occurred when compiling the contract:
C:\dev\ThankYouCards\ThankYouCards.Contracts\DecentralizedApp\src\ThankYou.sol:1:1: Error: Expected import directive or contract definition.
pragma solidity ^0.4.10;
do you know why I get different results?
contract is like this:

pragma solidity ^0.4.10;

contract ThankYou {
......

Juan Blanco
@juanfranblanco
Sep 21 2017 09:51
oh the Vs2015 extension is being updated
Daniel Hursan
@hdany
Sep 21 2017 09:51
so I should just wait before using that, right?
Juan Blanco
@juanfranblanco
Sep 21 2017 09:51
stick with code for the time being
Daniel Hursan
@hdany
Sep 21 2017 09:51
ok, great
amjadDev
@amjadDev
Sep 21 2017 09:56
want to burn token and transfer ether associated with those token in solidity? @juanfranblanco @kaista82_twitter
to owner address
Juan Blanco
@juanfranblanco
Sep 21 2017 09:57
care to explain a bit further?
amjadDev
@amjadDev
Sep 21 2017 10:04
sorry its wrong question
actually i just want to burn a amount of token from a address on some condition
any function available in solidity for erc20 token?
@juanfranblanco
like burntokem(address from, unit ammount)
amjadDev
@amjadDev
Sep 21 2017 10:11
ERC-20 token contracts that burn tokens commonly transfer() the tokens to the 0 address in lieu of real burning. is this okay
or have some standard method?
Juan Blanco
@juanfranblanco
Sep 21 2017 10:15
you will need your custom ERC20 compliant standard token, with the added function burn tokens which will reduce the supply and the msg.sender balance
amjadDev
@amjadDev
Sep 21 2017 10:49
@juanfranblanco thanks