cityofzion / neo-lux Goto Github PK
View Code? Open in Web Editor NEWThis project forked from relfos/neo-lux
.NET SDK to interact with the NEO blockchain and invoke smart contracts
License: MIT License
This project forked from relfos/neo-lux
.NET SDK to interact with the NEO blockchain and invoke smart contracts
License: MIT License
Neo.Lux already supports sending assets to multiple outputs in a single transaction, however the Light Wallet demo is missing support for this in the GUI.
NeoRPC.cs row 58
public override byte[] GetStorage(string scriptHash, byte[] key)
{
var response = QueryRPC("getstorage", new object[] { key.ByteToHex() });
var result = response.GetString("result");
if (string.IsNullOrEmpty(result))
{
return null;
}
return result.HexToBytes();
}
you missed the param of "scriptHash", it should be the first param in new object[]
Thanks for your work.
There are some obvious errors in file "NeoDemo.cs".
eg:
using NeoLux; using Neo; using Neo.Cryptography; using Neo.VM;
Base on your lastest Neo-Lux it should like
using Neo; using Neo.Lux; using Neo.Lux.Core; using Neo.Lux.Utils; using Neo.Lux.Cryptography;
It will be greatly helpfull if you can fix them .
Thanks in advance
Some users might need to test their dApps in a private test net, Neo-Lux must have a way to support this.
I can see from source code that .NET Core
standard is added, but I guess it isn't published to nuget.
Are you planning to publish it ?
Should be possible to call a method Withdraw(from_address, to_address) which will create a transaction that requests an asset withdrawal or token withdrawal.
Hi guys .
Please tell me when your library is coming to .net ?
case "getvalidators":
{
var validators = Blockchain.Default.GetValidators();
return Blockchain.Default.GetEnrollments().Select(p =>
{
JObject validator = new JObject();
validator["publickey"] = p.PublicKey.ToString();
validator["votes"] = p.Votes.ToString();
validator["active"] = validators.Contains(p.PublicKey);
return validator;
}).ToArray();
}
It's realy helpful on working with unity.
I want to get a datanode object on calling a method from contract.
but now I got a transaction from which nothing usedfull data is included.
Any advice is appreciated.
The logic in WaitForTransaction
was wrong for finding the confirmed block that contained a specific Tx. I've fixed it.
I found this by running my console app side by side with the NEO-GUI transaction log.
CallContract
would only succeed after the previous Tx was confirmed in NEO-GUI and WaitForTransaction
was returning too quickly ...relative to what I was seeing in NEO-GUI.
Wait times are about 40-50 seconds (FYI).
Fixes:
https://github.com/mwherman2000/neo-lux/blob/master/Neo.Lux/Core/NeoAPI.cs#L1019
https://github.com/mwherman2000/neo-lux/blob/master/Neo.Lux/Core/NeoAPI.cs#L1069
The fix uses a derivative of my "batches of blocks" looping pattern that I first used in the NeoEventMonitor1 class: https://github.com/mwherman2000/neo-lux/blob/master/NEO.mwherman2000.MonitorEvents/NeoEventMonitor1.cs#L81
Severity Code Description Project File Line Suppression State
Error CS0103 The name 'NeoDB' does not exist in the current context Neo.Lux.Demo D:\repos\neo-lux\Neo.Lux.Demo\Demo.cs 14 Active
Error CS1579 foreach statement cannot operate on variables of type '?' because '?' does not contain a public definition for 'GetEnumerator' Neo.Lux.Demo D:\repos\neo-lux\Neo.Lux.Demo\Demo.cs 26 Active
Error CS0103 The name 'NeoDB' does not exist in the current context Neo.Lux.Demo D:\repos\neo-lux\Neo.Lux.Demo\Demo.cs 34 Active
Error CS0103 The name 'NeoDB' does not exist in the current context Neo.Lux.Tests D:\repos\neo-lux\Neo.Lux.Tests\NEP5.cs 15 Active
Hi all,
I would like to add MyWish (http://neoscan.mywish.io) to NeoRPC.cs file as PrivateNet.
I have added the following lines, but it does not work.
Could you help me about how to add MyWish as RemoteRPCNode?
Thank you.
public static NeoRPC ForPrivateNet()
{
return new RemoteRPCNode(20332, "http://neo.mywish.io", NEONodesKind.MYWISH);
}
Also, I have added this code structure to NeoRPC.cs file.
case NEONodesKind.MYWISH:
{
nodes = new string[4];
for (int i = 0; i < nodes.Length; i++)
{
nodes[i] = $"http://neo.mywish.io:{port}";
port = port + 1;
}
break;
}
I'm playing around with neo-lux tonight. Trying to call my NPCdApp:
Script Hash: 0x7074acf3f06dd3f456e11053ebf61c5b04b07ebc
(testnet)
public static object Main(string operation, params object[] args)
(link to source)
win-gui parameter type: 0710
I tried to change your Demo.cs in a simple way but I'm just getting a null result back (should get back the string "success"). Here's the 4 lines I added to your Demo.cs:
https://github.com/mwherman2000/neo-lux/blob/master/neo-lux-demo/Demo.cs#L51
var NPCdAppContractHash = "0x7074acf3f06dd3f456e11053ebf61c5b04b07ebc".Replace("0x", "");
var response2 = api.TestInvokeScript(NPCdAppContractHash, "test2", new object[] { new BigInteger(5) } );
var result2 = System.Text.Encoding.ASCII.GetString((byte[])response2.result);
Console.WriteLine("result2" + result2);
Is there a simple fix?
Here's the Main() for my SC: https://github.com/mwherman2000/neo-persistibleclasses/blob/master/NPCdApp/NPCdApp.cs#L96
Cheers,
Michael
How to use api.CallContract?
public Transaction CallContract (KeyPair key, UInt160 scriptHash, string operation, object[] args, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null);
These are the errors...
Severity Code Description Project File Line Suppression State
Error CS0117 'NeoRPC' does not contain a definition for 'ForMainNet' neo-lux-demo D:\repos\neo-lux\neo-lux-demo\Demo.cs 31 Active
Error CS0117 'NeoRPC' does not contain a definition for 'ForTestNet' neo-lux-demo D:\repos\neo-lux\neo-lux-demo\Demo.cs 11 Active
Error CS1579 foreach statement cannot operate on variables of type '?' because '?' does not contain a public definition for 'GetEnumerator' neo-lux-demo D:\repos\neo-lux\neo-lux-demo\Demo.cs 23 Active
Error CS0117 'NeoRPC' does not contain a definition for 'ForTestNet' neo-lux-light-wallet D:\repos\neo-lux\neo-lux-light-wallet\WalletForm.cs 11 Active
Error CS0117 'NeoRPC' does not contain a definition for 'ForMainNet' neo-sender D:\repos\neo-lux\neo-sender\Sender.cs 36 Active
Error CS0117 'NeoRPC' does not contain a definition for 'ForTestNet' neo-sender D:\repos\neo-lux\neo-sender\Sender.cs 37 Active
Error CS7036 There is no argument given that corresponds to the required formal parameter 'port' of 'NeoRPC.NeoRPC(string, int)' neo-sender D:\repos\neo-lux\neo-sender\Sender.cs 38 Active
Is there any documented way to call MultiSig wallet and pass signatures to it ?
I am trying to invoke a smartcontract and make a transaction over a private network but there is some issue that i am unable to resolve. Will be grateful if someone help me solve the issue.
This is my smart contract code:
This is how i am trying to invoke the contract from api code:
Transaction and result are always returned as null as shown below
Since there are already lots of demos, the readme should be updated with a table containing list of demos and descriptions / notes for each
The ScriptBuilder is emitting a trimmed hexstring for BigInteger representation. Usually, the BigInteger is represented as a 16 character hexstring. Trimming may occur for excess zeroes. However, this trimming is causing an issue as the node seems to be unable to process the trimmed BigInteger.
Take for example, 78a1552b1a4cf1eb04a9cfa4998965603a0beb148a80354f0d2d58ef5aeb58c2
on testnet. The VM script uses a trimmed hexstring for the amount
and the user reports that the transaction did not effect a change in tokens.
I had this experience in neon-js too and the solution was to always use 8 bytes to represent a BigInteger.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.