January 2019
Beginner to intermediate
372 pages
11h 17m
English
The NEO community has a created few JavaScript libraries to interface with the NEO blockchain. We will be using a popular library called neon-js (https://github.com/CityOfZion/neon-js), which is backed by the City of Zion community.
The following script creates an interface to query the owner of the asset for our proof of ownership application:
queryAsset(assetID) {
const props = {
scriptHash: '60a7ed582c6885addf1f9bec7e413d01abe54f1a',
operation: 'query',
args: [assetID.hexEncode()]
};
const Script = Neon.create.script(props);
rpc.Query.invokeScript(Script).execute('http://localhost:30333') .then((res) => {
return res.result.stack[0].value.hexDecode()
});
}
The interface created using the neon-js library builds ...