Coder Social home page Coder Social logo

nstratis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nstratis's Issues

Build failing for NStratis

NStratis was added as a project reference to a minimal project as follows:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include=".\NStratis\NBitcoin\NBitcoin.csproj" />
  </ItemGroup>
</Project>

The NStratis directory is a git submodule. This minimal project was then built from the command line, which fails:

$ dotnet build
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.

  HashLib -> /Users/zeptin/Projects/DotNET/StratisWiki/NStratis/Hashing/HashLib/bin/Debug/netstandard1.3/HashLib.dll
  NBitcoin -> /Users/zeptin/Projects/DotNET/StratisWiki/NStratis/NBitcoin/bin/Debug/netstandard1.6/NBitcoin.dll
/usr/local/share/dotnet/sdk/1.0.4/Microsoft.Common.CurrentVersion.targets(2867,5): error MSB3554: Cannot write to the output file "/Users/zeptin/Projects/DotNET/StratisWiki/obj/Debug/netcoreapp1.1/StratisWiki.NStratis.Hashing.TomanuExtensions.TestUtils.ProgressForm.resources". Positive number required. [/Users/zeptin/Projects/DotNET/StratisWiki/StratisWiki.csproj]
/usr/local/share/dotnet/sdk/1.0.4/Microsoft.Common.CurrentVersion.targets(2867,5): error MSB3554: Parameter name: bufferSize [/Users/zeptin/Projects/DotNET/StratisWiki/StratisWiki.csproj]

Build FAILED.

It is not clear why this issue is not affecting the full node, which also uses NStratis as a submodule. Is it necessary for the Hashing project have this forms resource file at all, given that NStratis is not graphical?

Transaction builder creates invalid asset issuance transaction

The problem appears to be that the interim wallet does not accept nulldata transactions with a value of 0. The NStratis TransactionBuilder verification regards them as valid.

Sample code that exhibits the problem (when the overridden transaction is submitted to the RPC server the 0.0001 assigned to the nulldata seems to get reassigned to the staking fees):

Transaction sourceTx = rpc.GetRawTransaction(uint256.Parse("d2401ed79279d909fc84b0f89bbec694eff576b9541cc70c717f640238719aef"));

BitcoinSecret sourcePrivateKey = new BitcoinSecret("xxx", Network.StratisMain);

var issuance = new IssuanceCoin(new OutPoint(sourceTx, 0), sourceTx.Outputs[0]);
var dest = BitcoinAddress.Create("SesDUTF3sdqC8mTfW9vJFQMeQGw6dv8Dzz");
TransactionBuilder builder = new TransactionBuilder();

var tx = builder
	.AddKeys(sourcePrivateKey)
	.AddCoins(issuance)
	.IssueAsset(dest, new AssetMoney(issuance.AssetId, quantity: 10))
	.SendFees(Money.Coins(0.001m))
	.SetChange(sourcePrivateKey.PubKey)
	.BuildTransaction(true);

TransactionPolicyError[] errorsfound = null;

// The transaction is rejected by the interim wallet's RPC server
// unless the output values are manually changed to make the nulldata
// transaction have a non-zero value:
tx.Outputs[1].Value = Money.Coins(1.79777270m);
tx.Outputs[2].Value = Money.Coins(0.0001m);

builder.SignTransactionInPlace(tx);

bool result = builder.Verify(tx, out errorsfound);

OP_RETURN script length inconsistent

nStratis allows OP_RETURN scripts up to the maximum length currently supported in Bitcoin itself (83 bytes).

The Stratis GUI wallet (currently 2.0.0.1) rejects the resulting OP_RETURN transaction from nStratis with an error in debug.log:

ERROR: AcceptToMemoryPool : nonstandard transaction: scriptpubkey

It appears that scripts < 40 bytes are accepted, so the length validation is incorrect in either nStratis or the wallet.

static ctor of Network must run before creating other networks

One cannot run NetworkBuilder.BuildAndRegister() to create a Network before triggering the static ctor of Network one time before so that it already creates BitcoinMain. Otherwise, this line will crash:
assert(consensus.HashGenesisBlock == uint256.Parse("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"));

This can be worked around like shown below, but it's very confusing :-)

 
public static void Main(string[] args)
        {
	        var fix= Network.Main; // execute static constructor of Network before everything else, or crash

	        var network = !args.Contains("-testnet") 
				? MyNetworks.RegisterMain() 
				: MyNetworks.RegisterTest();

	        if (NodeSettings.PrintHelp(args, network))
		        return;

Licensed by Metaco

License says "Copyright (c) 2014 Metaco SA". That should probably be StratisPlatform or something?

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.