Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Validate NEP5 implementation against latest changes #4

Closed
ixje opened this issue Jan 16, 2018 · 14 comments
Closed

Validate NEP5 implementation against latest changes #4

ixje opened this issue Jan 16, 2018 · 14 comments
Assignees

Comments

@ixje
Copy link
Member

ixje commented Jan 16, 2018

The NEP5 proposal has changed since my last implementation. Validate if it's still correct and update where needed.

See changes here

@ixje ixje added this to the v0.1 (first app store release) milestone Jan 16, 2018
@ixje ixje self-assigned this Jan 16, 2018
@chrismpalmer
Copy link

chrismpalmer commented Apr 25, 2018

Not sure the nep5 transfer call is working. I do the call and actually get back "false" in the result. Of course this assumes my setup data is correct. I can fetch the nep5 smart contract balance deployed on my private net.

@ixje
Copy link
Member Author

ixje commented Apr 25, 2018

@chrismpalmer I'm spinning up a private network as I'm writing this to test the function. Strange enough I didn't get notified about this comment and just happen to stumble on it. It might be best to tag me in the future if you have a question to make sure I won't miss them.

edit: I'm experiencing the same 'false' response as you report. I have not yet figured out the cause. Will look more into it the coming days (I have time tomorrow and then Saturday again).

@ixje
Copy link
Member Author

ixje commented Apr 26, 2018

So this became interesting. I worked on it again today and I couldn't reproduce the false RPC response anymore. It now just works 🤔

img

I modified the homescreen code for testing as shown here

What I can say at least is that I compared the output of this function

function buildTokenTransferScript(token, fromAddr, toAddr, amount) {

with the equivalent of neo-python and the results are identical. So if for whatever reason the RPC calls start failing again I would probably continue and double check the results of these lines
const signature = signTransactionData(txData, fromAccount.privateKey)
const rawTXData = buildRawTransaction(txData, signature, fromAccount.publicKeyEncoded)
return queryRPC('sendrawtransaction', [rawTXData.toString('hex')], 4)

For now I kind of have to conclude it's working because I can't reproduce it anymore. If you figure out how to reproduce it, let me know and I'd be happy to re-open and investigate further!

@ixje ixje closed this as completed Apr 26, 2018
@chrismpalmer
Copy link

chrismpalmer commented Apr 26, 2018

Hi @ixje Thanks for being so thorough... I created a quick node js project and I can do every transaction against my privnet.... for some reason the transaction comes back but its false. You can test the rpc end point at : https://neo-privnet-rpc.ngrok.io and https://neoscan-privnet.ngrok.io. There are a few changes Attached is a quick patch of trunk. It should run enough... you can open this dummy wallet using its privateKey KzGnppHL8hfE5deorkcn25rs6sGEzHRvxd3wWnvcpRxnxc7Qi9qZ
QuickTest.txt

I am really at a loss... perhaps on TestNet this all works. I am running the Docker Scanner Net image?

@ixje ixje reopened this Apr 28, 2018
@ixje
Copy link
Member Author

ixje commented Apr 28, 2018

@chrismpalmer I would like to also connect using neo-python (a node client) so I can run some tests, but I need a bit more details. Can you link me to the "Docker Scanner Net" image you're referring to? I don't know which one that is. I'm in particular looking for information contained in this file as well as the RPC port numbers.

I tried guessing the most common used ones (10333-10336, 20332-20336, 30332-30336) but without luck. If you can provide the above information and validate that those ports are exposed to the outside world then I can give it another try.

PS: I was also running a private network, so shouldn't matter. We can figure it out no worries :)

@chrismpalmer
Copy link

@ixje thanks, https://github.com/CityOfZion/neo-privatenet-docker is the project my rpc node is port 30333.

@ixje
Copy link
Member Author

ixje commented Apr 28, 2018

@chrismpalmer still doesn't seem to work.

(venv) Eriks-Air:neo-python erik$ curl -X POST https://neo-privnet-rpc.ngrok.io:30333 -H 'Content-Type: application/json' -d '{ "jsonrpc": "2.0", "id": 5, "method": "getversion", "params": [] }'
curl: (7) Failed to connect to neo-privnet-rpc.ngrok.io port 30333: Operation timed out

where as

(venv) Eriks-Air:neo-python erik$ curl -X POST http://seed2.cityofzion.io:8080 -H 'Content-Type: application/json' -d '{ "jsonrpc": "2.0", "id": 5, "method": "getversion", "params": [] }'
{"jsonrpc":"2.0","id":5,"result":{"port":10333,"nonce":1478959039,"useragent":"\/NEO:2.7.4\/"}}

If you're up for it we can try to resolve it a bit more realtime using the NEO Discord. Just DM me at the same username. I'll be on for at least the next 3 hours and perhaps longer.

@chrismpalmer
Copy link

@ixje you don’t need the port it’s auto mapped

@chrismpalmer
Copy link

@ixje thanks for the offer I’m at a surf contest with my son I can’t get it till another day. Sounds like the plan though.

@ixje
Copy link
Member Author

ixje commented Apr 28, 2018

@chrismpalmer no port for the RPC server worked! The only thing where that trick doesn't work is for connecting neo-python via P2P. That really needs a port. I'll see how far I can get using just the available RPC server.

Wish him good luck on the contest and cheer hard! 🏄

@chrismpalmer
Copy link

@ixje ok, I can expose the p2p just have to do it when I get home

@ixje
Copy link
Member Author

ixje commented Apr 28, 2018

@chrismpalmer can you also give me the contract hash of the NEP5 token you've deployed on your privatenet? thanks.

@ixje
Copy link
Member Author

ixje commented May 10, 2018

Going to assume my Discord feedback solved the issue, haven't heard anything anymore for a week.

@ixje ixje closed this as completed May 10, 2018
@chrismpalmer
Copy link

@ixje Hi Erik! Left you some notes on Discord. I am really sorry I didn't get back to you quick. We just got assigned this again so I am back on it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants