Giter Club home page Giter Club logo

neo-gui-developer's Introduction

neo-gui-developer

Custom development GUI for NEO Blockchain

!!! EXPERIMENTAL DEVELOPMENT GUI

!!! ONLY USE ON TESTNET. neo-gui-developer runs on testnet in default

This custom development Neo GUI is built on top of the official Neo GUI. It includes some additional features to make it easier to deploy Neo Smart contracts and get return/runtime events from invoking a smart contract

Features:

6. Updated Invoke Contract dialog

  • Invoke contract dialog now has a tree view to enable a better user experience when adding/editing parameters - for a quick tour: https://youtu.be/osmMdzaxuGQ
  • Nested arrays are fully supported, you can add an Array to the optional parameter array
  • Simple validation of some fields Hash160, Hash256, PublicKey
  • Smart contract monitor (address book) integration into script hash search field
  • Runtime.Notify now supported in Event Log tab
  • Sample contracts are available here: https://github.com/CityOfZion/smart-contract-examples-csharp

Previous Features:

1. Event log

  • Additional tab on the GUI which shows a list of events when any Neo smart contracts calls a Runtime.Log() function
  • Shows the local time when the event is received, block height, script info, and log message
  • Event log picks up events in both test invoke and blockchain invoke

2. Smart contract Return

  • Implemented an experimental feature to allow Neo Smart contract CheckWitness() authentication function to verify during test invoke
  • Custom GUI catches Neo smart contract byte[] (parameter 05) Return during test invoke (this is useful for functions returning information stored in Storage and true/false bool)
  • This function is activated as a messagebox popup during Test invoke
  • The return format is currently set as hexadecimal to show byte[] return, but also includes a UTF8 conversion of byte[]

3. Smart contract monitor

  • Script hash is now displayed in an Information box when a Smart contract is deployed during on DeployDialog
  • Optional smart contract monitor feature added to menu Advanced -> SC watchlist...
  • Smart contract watchlist shows the script info, Script hash, and status of the Neo smart contract on the blockchain
  • The watchlist automatically refreshes with the timer1 to check if the Neo Smart contract script hash can be found on the blockchain. Green "Found!" indicates the Neo Smart contract has been deployed successfully, red "Unavailable" indicates that it has not been deployed successfully
  • Neo Smart contract Script hash is automatically added to the watchlist when it is deployed on DeployDialog or looked up on InvokeDialog
  • The script hash on the watchlist are saved/loaded on a smartcontract.txt in the Neo main folder. Script hash can be removed/added on this txt file

4. Add params function

  • Implemented experimental Add params function to allow adding an optional params object[] during Invoke contract to pass an object[] parameter/argument. Add params button opens a new dialog with a listview to allow users to "build" an object[] array stack
  • The listview index corresponds to the required array index (i.e. first item in list is arg[0] in object[] array). This function currently supports three types: byte[], int, and string. Type is selected when adding an item in Add params with a dropdown list.
  • A Smart contract requires the correct number of arguments to be passed, otherwise it will fail. For example, a FunctionCode Main(byte[] operation, object[]) must have exactly 2 arguments, byte[] and object[], passed during Invoke. Supported parameter types can be set during Deploy and added with the usual Parameter Editor, while object[] can be not declared during Deploy but added with Add params functions after declared parameters are set. In the above-mentioned example, Parameter List is set as "05" during Deploy Smart contract. Thereafter during Invoke, the byte[] value is first declared using the Parameter Editor and the object[] array is then declared using the Add params function. An empty array has to be passed even if you do not require the object[] to be declated, this can be done by clicking Add params -> Accept without adding anything to the stack.

5. Crude support for Array type

  • Support for Array type in Parameter Editor
  • Currently only supports byte[] type in the array i.e. byte[][]
  • This option to pass an object[] type is to set "10" in Parameter List during Deploy Smart contract. That will add the parameter as an Array type in the Parameter Editor during Invoke, which can then be declared in the Parameter Editor as with other types
  • The stack can be built by writing each byte[] in a new line in the textbox, the second byte[] is written after a linebreak in a new line etc.

6. Added libleveldb.dll to project

neo-gui-developer's People

Contributors

birmingh avatar danielcrenna avatar denebgarza avatar farukterzioglu avatar hal0x2328 avatar jonatanblockchain avatar localhuman avatar mwherman2000 avatar notatestuser avatar peterlinx avatar vincenttano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo-gui-developer's Issues

Gui window scaling

This is extremely minor, but windows like the "Parameter Editor" should have field boxes that shrink the same way when the gui window is slaked. Currently, the "Hex Encode" checkbox even vanishes when the window is too small. I noticed this when making the video. And I'm not sure why the window closes upon "insufficient funds".

Passing parameters when invoking contract

Hi.

I watched the video, but really, passing parameters when involing the contract is not clear at all.

So here is what I am trying to do:

http://prntscr.com/hgmflg

I want to pass a simple string to the contract. But when passing "Test" as parameter, it changes to ByteArray automaticaly. And I got the error displayed in the screenshot, what ever the tye of parameter I put.

Can someone explain clearly how to pass parameters?

neo-gui is crashing while resyncing from scratch around block, 1,170,000

Once it fails, it's repeatable. neo-gui will sync for a few blocks and then fails within a few seconds of starting. I'm running neo-gui in the Visual Studio debugger.
Traceback

Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
Exception thrown: 'System.NotSupportedException' in Neo.VM.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>neo-gui.exe</AppDomain><Exception><ExceptionType>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Operation is not valid due to the current state of the object.</Message><StackTrace>   at Neo.VM.RandomAccessStack`1.Peek(Int32 index)
   at Neo.SmartContract.ApplicationEngine.CheckArraySize()
   at Neo.SmartContract.ApplicationEngine.Execute()
   at Neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain.Persist(Block block)
   at Neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain.PersistBlocks()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at Neo.VM.RandomAccessStack`1.Peek(Int32 index)
   at Neo.SmartContract.ApplicationEngine.CheckArraySize()
   at Neo.SmartContract.ApplicationEngine.Execute()
   at Neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain.Persist(Block block)
   at Neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain.PersistBlocks()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()</ExceptionString></Exception></TraceRecord>
An unhandled exception of type 'System.InvalidOperationException' occurred in Neo.VM.dll
Operation is not valid due to the current state of the object.

Compiled binaries

Hi!
Could we have compiled binaries released on GitHub here for those of us not into using Windows platforms?

Want to test transfer method using neo-gui-developer

I want to invoke transfer method which is as following.

public static bool Transfer(StorageContext context, byte[] from, byte[] to, BigInteger amount)
{
            if (from.Length != 20 || to.Length != 20) return false;
            if (amount <= 0) return false;
            if (!Runtime.CheckWitness(from)) return false;
            if (from == to) return true;

            BigInteger fromBalance = Storage.Get(context, from).AsBigInteger();
            if (fromBalance < amount) return false;
            if (fromBalance == amount)
                Storage.Delete(context, from);
            else
                Storage.Put(context, from, fromBalance - amount);

            BigInteger toBalance = Storage.Get(context, to).AsBigInteger();
            Storage.Put(context, to, toBalance + amount);
            Transferred(from, to, amount);
            return true;
}

method invoke is not succeeded because it stops at line 5 if (!Runtime.CheckWitness(from)) return false;, which always returns false.

How can I make CheckWitness return true?
Thanks for help in advance.

Minor issues in the invoke params editor

So I suppose this is one for @birmas!

I don’t know if this was intended or serves another purpose, but when the last param type is 10 (an object array) we see an extra array for additional params in the UI, so 2 arrays in total. I get that this seems to be a catch-all for extras but when the last declared param is an array it doesn't make sense to have it.

And another thing I’ve noticed as a bonus: The string type (07) is not a registered as "string" in the UI but just shows as "7".

Build Error: MainForm.resx - Invalid ResX-File.

While trying to build the gui, I got the following error:

Ungültige ResX-Datei. Der angeforderte Wert "Ctrl" konnte nicht gefunden werden.
Zeile 573, Position 5.

Translated: Invalid ResX-File. The required value "Ctrl" could not be found.

As it turns out, I had to translate

Ctrl

to

Strg

(for Germany), which fixed the error. This fix may be different if the locale of your System or Visual Studio is different.

Invoke Neo Smart Contract with some Neo tokens transferring to the smart contract

I am creating an ICO and want to test it on privatenet.
The neo-gui allows to invoke smart contract but does not send Neo asset token along with the invocation.
The Neon wallet provides to participate in ICO but it does not work on privatenet setup using docker.

Any workaround to call ICO smart contract's mintToken along with some Neo token transferred?

neo-gui-developer crashes when syncing to testnet

Hi,

I have compiled(built) the neo-gui-developer in release and debug modes. While neo-gui synced on testnet, the neo-gui-developer (both release and debug versions) crashes on some block while syncing on testnet.

I think the source codes have to be reviewed.

There were problems in neo-gui-developer also in:

Program->InstallCertificate():

System.TypeInitializationException: 'The type initializer for 'Neo.Properties.Settings' threw an exception.'

Why ?

How to get it synced to the testnet?

Kind Regards.

Faulting module name: KERNELBASE.dll

App Crashes on Windows 10 and event log has below errors:

.NET Runtime version 4.0.30319.0 - Loading profiler failed during CoCreateInstance. Profiler CLSID: '{68130646-C19E-459E-8BF4-5137ED7B3FD7}'. HRESULT: 0x8007007e. Process ID (decimal): 5648. Message ID: [0x2504].

Application: neo-gui.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean)
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(System.Collections.Generic.IList`1<Microsoft.Extensions.Configuration.IConfigurationProvider>)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Neo.Properties.Settings..ctor()
at Neo.Properties.Settings..cctor()

Exception Info: System.TypeInitializationException
at Neo.Properties.Settings.get_Default()
at Neo.Program.InstallCertificate()
at Neo.Program.Main()

Faulting application name: neo-gui.exe, version: 2.3.6600.23928, time stamp: 0x5a6b2a70
Faulting module name: KERNELBASE.dll, version: 10.0.16299.15, time stamp: 0x4736733c
Exception code: 0xe0434352

unspent Neo

Hi City of Zion Team,

On 12/27/2016 I started a token transfer of 11,067 NEO to my Bittrex Wallet, but for an unkown reason 20,843 NEO have been transfered in total.

The problem is that 9,776 of the 20,843 NEO Coins have been transfered as unspent to a wallet I don't have access to.

The details are the following:

-transaction of 20,843 NEO in total on 12/27/2016, 12:15:11 (transaction Hash d832459fcbf9c1838d4ccc173cda4bc92a34efa992c5269cc30b31155b438b7b from wallet adress ATa1nvgygN6c8ACL4PATFMGXe3GVraKNeY )

-11,067 NEO went to my Bittrex Wallet AYmEw36bF54aX1xK9GvUiHicfL56S1MRgT

-9,776 NEO went to unknown an adress AbEM51hVzJsf65Lop9WbLjLjEdenbZK5zQ as unspent

Is there a way to get me back access to my unspent NEO?

Thanks for your help in advance

Martin

source code compile error

compile_error
i'm getting a compile time error
'CX509PrivateKey' does not contain a definition for 'AlgorithmName' and no extension method 'AlgorithmName' accepting a first argument of type 'CX509PrivateKey' could be found
if anyone suggest a fix that will be great, if not can someone send me a x64 version .exe file?

Deploy Contract and Invoke Contract dialogs: counter-intuitive

You can call it a usability or functionality or workflow issue but it appears that the contract deployment transaction doesn't happen (execute) until you click the Test button on the Invoke Contract dialog. This is counter-intuitive and will lead to a lot of "user error". Checkout the function btnTestScript_Click() here:

private void btnTestScript_Click(object sender, EventArgs e)

People are going to expect the deployment should take place when you click the Deploy button in the Deploy Contract dialog. This should be refactored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.