neo-project / neo-express Goto Github PK
View Code? Open in Web Editor NEWNeo Private Net optimized for development scenarios
License: MIT License
Neo Private Net optimized for development scenarios
License: MIT License
Most neo-express commands dump JSON responses to the console w/o explanation. This needs to be improved
Either:
a) Add a custom RPC endpoint for restoring checkpoints that returns an object indicating success or failure (and whether the failure was due to blockchain data already existing and -f not being supplied)
b) Add an option to make the existing restore command return JSON instead of text (and do not block waiting for the user to press 'q' when there is a failure)
PS> dotnet run -- create -p 1000
Created 1 node privatenet at C:<path removed for privacy reasons>\default.neo-express.json
Note: The private keys for the accounts in this file are are not encrypted.
Do not use these accounts on MainNet or in any other system where security is a concern.
Creating 125 empty blocks to preload 1000 GAS
Creating Block 100
Preload complete. 1000 GAS loaded into genesis account.
[ERROR][3/12/2020 11:09:03 PM][Thread 0004][akka://NeoSystem/system/IO-TCP/$a] Monitored actor [[akka://NeoSystem/user/$b#1672422064]] terminated
Cause: Akka.Actor.DeathPactException: Monitored actor [[akka://NeoSystem/user/$b#1672422064]] terminated
at Akka.Actor.ActorBase.Unhandled(Object message)
at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.ReceivedTerminated(Terminated t)
at Akka.Actor.ActorCell.AutoReceiveMessage(Envelope envelope)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)
This will make it more efficient for the vscode devtracker to hide empty blocks.
neo-express getclaimable RPC endpoint is returning claimable.txid field with a 0x
prefix. As per the docs, it should not
contract invocation isn't really feasible on the command line for anything but the simplest contracts. Instead of (or in addition to) providing contract parameters on the command line, user should be able to author a json file w/ the required parameters and pass a pointer to that file to contract invoke
use storage, use dynamic invoke, overwrite
In next NEO 3 preview, ExecutionEngine.Execute
will be virtual. Move ExpressApplicationEngine
start/end trace logic to virtual override of Execute method
RpcApplicationLog FromJson currently broken, so returning raw JSON. update once neo-project/neo-modules#324 is fixed
Encountering some problems using commands since I last updated.
show gas
no longer works for me, show unclaimed
(found it from #8) does work however:
I see from here that there are some other undocumented subcommands like unspents
and claimable
.
Is there any reason why claimable
is a separate command to unclaimed
, with different response formats? It seems like these should be unified (maybe have claimable as another alias).
Edit: Found answers to the above in the dev branch docs and claimable/unclaimed distinction from the official API docs.
My bigger problem right now is that claim gas
does not work, it just opens the claim
help context menu. That's blocking me from doing anything else with the private net.
contracts in NEO are identified by their script hash. However, during development, this hash changes with every update to the contract. Is there a way we can use a stable value that doesn't change during development for the hash?
At one point, neo-express was going to integrate with neo-debug to support an integrated debugging mode. neo-debug went a different path for getting blockchain data, but as part of that work we created a DebugSnapshot
that made a contract appear to be deployed w/o having to actually deploy it. I'm thinking we could do something similar by adding a --contract <avmPath>
argument to the run and checkpoint run commands. This argument would make the contract(s) appear to be deployed, but identifying contract by hashing the avm file name (not path, just filename).
--preload-gas
was added to the run
command, but it makes much more sense to add it to the create
command
neo-express has custom RPC endpoints for transfer, claim, contract deploy and contract invoke. These should be using the standard sendrawtransaction
RPC endpoint
i.e. a CLI command that invokes getrawtransaction
The design note states that an invocation file contains a JSON object, but neo-express attempts to parse it as an array:
static Task<JArray> LoadInvocationFileJson(string path)
{
using var fileStream = File.OpenRead(path);
using var reader = new StreamReader(fileStream);
using var jreader = new JsonTextReader(reader);
return JArray.LoadAsync(jreader);
}
Currently copy/pasted logic from https://github.com/neo-project/neo-modules/blob/master/src/ApplicationLogs/LogReader.cs to work w/ IStore based storage instead of using plugin directly because of neo-project/neo-modules#204
We initially created the express-get-populated-blocks to avoid having to make O(n) RPC calls when rendering a filtered page of blocks in the dev tracker (where n is the size of the blockchain).
The new design re-introduces this characteristic. It is 100x faster than it used to be (100 blocks can be checked at once) but still results in an unusable dev tracker UI experience when viewing a blockchain that has mostly unpopulated blocks (this will be common if a developer has left neo-express running generating empty blocks every 15s).
Suggest reverting #36. If we need a more efficient implementation of express-get-populated-blocks, we should maintain a persistent bitset of populated blocks within neo-express and update it as blocks are created. The dev tracker cannot maintain this data structure as it changes in-between checkpoints.
contract hash changes with every code change. Having to change the hash
value of every neo-invoke file on every code change gets very tedious. Add support for specifying a relative path to the .nef file instead of specifying the hash directly
specifics detailed in NDX Design Note 12
As of the next release of NEON, contract metadata is included in the .abi.json file. Read this new information and remove interactive prompts
It would be nice if neo-express was aware of what RPC servers are currently running and what config files they were started from. Then, when a user requests to create a checkpoint, neo-express can automatically decide whether to use online or offline mode.
Related to neo-project/neo-visual-tracker#53
ExpressApplicationEngine.WriteStorages
has its own copy of CreateSearchPrefix as StorageKey.CreateSearchPrefix was marked internal in Neo 3 preview 3. Will be public in next preview, so switch GetStorages
to use it
Gas related commands give all the error 'Invalid JavaScript property identifier character: -.
after the transfer from the genesis block
OSX 10.15.6
node 12.18.3 (via nvm)
Step the reproduce the error
run 0 -r
wallet create dev
show coin Dev
[]
show gas Dev
Unclaimed GAS for Dev: 0
Available GAS: 0
Unavailable GAS: 0
So far so good.
transfer neo 10 genesis Dev
Transfer Transaction 0x51b1864e3ea0ee0f3c25aec6e0e4c9fecb37d5a5a9858c6f82c571a7f734a0fa submitted
show account Dev
Account information for Dev:
Asset 0xc56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b: 10
show gas Dev
Invalid JavaScript property identifier character: -. Path 'result.unavailable', line 1, position 52.
show claimable Dev
Invalid JavaScript property identifier character: -. Path 'result.claimable[0].generated', line 1, position 178.
these show
sub commands were named to match the underlying RPC endpoints. But this naming scheme is not intuitive for users.
show gas
should be an alias for show unclaimed
show unspent
should be an alias for show unspents
Using this simple test contract:
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;
public class NEP5 : SmartContract
{
private static readonly byte[] owner = "AHWz3eLZL2Ymc8PKhQKzq9xDczWJf5K2ac".ToScriptHash();
public static void Main()
{
bool isOwner = Runtime.CheckWitness(owner);
if (isOwner)
Storage.Put(Storage.CurrentContext, "Hello", "World from owner");
else
Storage.Put(Storage.CurrentContext, "Hello", "World NOT from owner");
}
}`
with the standard setup of the neo-blockchain-toolkit works in debug mode (returns always true as defined in the default.neo-express.json) but throws an exception when running invoke from the terminal as follows:
C:...\NEP5>neo-express contract invoke NEP5 --account testWallet
Object reference not set to an instance of an object.
Usage: neo-express contract invoke [options]
Running the same contract after just changing the Runtime.CheckWitness line by:
bool isOwner = true;
works well. So I conclude is the call to CheckWitness that fails.
running main works in Debug NeoCompiler and in the de
Instead of dumping JSON to the console, lets write this info in a human readable format. but add a --json option to retain the JSON representation for tooling scenarios
Should be awaiting in the function in order to correctly managed file object lifetimes
Neo's LevelDBStore
returns a new DbCache instance on every call to GetAccounts. NeoExpress RocksDbStore and CheckpointStore always returns the same DbCache instance. This leads to stale data in the DbCache instance which leads to stale data returned from getaccountstate.
count parameter indicates the maximum number of populated blocks to return. This number defaults to 20 and has a maximum of 100. Asking for more than 100 will only return the first 100 populated blocks blocks.
start parameter indicates what block index to start from. by default, the current block height is used. If a start parameter larger than current block height is specified, current block height is used
Right now it is hard to programmatically no whether neo-express started successfully not because the process stays running even when there is an error (it shows a help message and waits for a user to hit 'q')
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.