Code Monkey home page Code Monkey logo

testchains's Introduction

Nethereum TestChains

Developing with Blockchains often requires running a local client (AKA: TestChain or Devchain). Testchains are optimized for development, they keep your work private and speed up transaction validation time.

In order to speed up the process, this repo contains all you need to spin up a local TestChain in a few minutes. Each of these chains use PoA (Proof of Authority) as a consensus model for faster response. They all launch using provided scripts, automatically provided with funded accounts and passwords.

The preconfigured account used across every Testchain is 0x12890d2cce102216644c59daE5baed380d84830c with private key 0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7.

The account key store file password is : password

Geth


Devchain version of Geth (Ethereum Go client) configured with PoA (Proof of Authority) for fast response.

Geth for Windows

Just launch > > geth-clique-windows > startgeth.bat

Latest versions of geth can be downloaded here, simply download the latest geth executable and replace the old one.

Geth for Mac

Launch > > geth-clique-mac > startgeth.sh

Note: use chmod +x startgeth.sh and chmod +x geth to allow geth to execute.

Latest versions of geth can be downloaded here, simply download the geth executable and replace the old one.

Geth for Linux

Launch > > geth-clique-linux > startgeth.sh

Note: use chmod +x startgeth.sh and chmod +x geth to allow geth to execute.

Latest versions of geth can be downloaded here, simply download the geth executable and replace the old one.

Parity


Devchain version of Parity (Ethereum Rust client) configured with PoA (Proof of Authority) for fast response.

Parity for Windows

Launch > > parity-poa-windows > launch.bat

Latest versions of Parity can be downloaded here, simply download the Parity executable and replace the old one.

Parity for Mac

Launch > > parity-poa-mac > launch.sh

Latest versions of Parity can be downloaded here, simply download the Parity executable and replace the old one.

Note: use chmod +x launch.sh and chmod +x parity to allow geth to execute.

Parity for Linux

Launch > > parity-poa-linux > launch.sh

Note: use chmod +x launch.sh and chmod +x parity to allow geth to execute.

Latest versions of Parity can be downloaded here, simply download the Parity executable and replace the old one.

Hyperledger-Besu


Ethereum client developed written in Java. Testchains is setup with Hyperledger-Besu with Proof of Authority (IBFT 2.0 and Clique) consensus mechanisms. Hyperledger-Besu supports enterprise features including privacy and permissioning.

Hyperledger-Besu for Windows

You will first need to install Hyperledger-Besu

Latest versions of Hyperledger-Besu can be downloaded here.

Hyperledger-Besu Clique for Windows

hyperledger-besu-clique-windows > startChain.bat

Hyperledger-Besu IBFT PoA for Windows

hyperledger-besu-IBFT-windows > startChain.bat

Hyperledger-Besu for Linux

!!! info Hyperledger-Besu requires Java 8+ to compile Make sure to run > > hyperledger-besu-clique-linux > updater.sh to run the current version of hyperledger-besu

Latest versions of Hyperledger-Besu can be downloaded here.

Hyperledger-Besu Clique for Linux

hyperledger-besu-clique-linux-mac > startChain.sh

Hyperledger-Besu IBFT for Linux

hyperledger-besu-IBFT-linux > startChain.sh

Ganache


parity-poa-windows

CLI version of Truffle's devchain.

Ganache for Windows

npm install ganache-cli@latest or yarn add ganache-cli@latest

ganache-windows > launch.bat

Ganache for Mac

npm install ganache-cli@latest or yarn add ganache-cli@latest

ganache-mac > ./launch.sh

Ganache for Linux

npm install ganache-cli@latest or yarn add ganache-cli@latest

ganache-linux > ./launch.sh

testchains's People

Contributors

anegg0 avatar dave-whiffin avatar juanfranblanco avatar npattarone avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar

testchains's Issues

Every transaction fails (after successful deployment) with "gas required exceeds allowance or always failing transaction"

Hi.

I'm playing with a smart-contract whose solidity source has been validated at runtime using ganache desktop app and remix-ide and nethereum (I'm using autogen nuget package).

Deploying it on geth-clique PoA testchain (for windows) I can successfully deploy contract (both in remix ide and with nethereum), but any execution of a transaction method raises (both in remix and in nethereum) " gas required exceeds allowance or always failing transaction".

Same exception raises when estimating required gas.

This is solidity code:

pragma solidity >=0.4.10 <0.7.0;

contract Playground {
    
    address payable _owner;
    
    bool public _toggler = false;
    uint32 public _counter = 0;
    
    constructor() public {
        _owner=msg.sender;
    }
    
    event evtUno(bool indexed val);
    event evtDue(uint32 val);
    event evtTre(string val, uint32 val2, bool val3);
    
    function logSomething() public returns (bool) {
        
        _counter++;
        
        bool latestToggler=_toggler;
        
        _toggler=!_toggler;
        
        emit evtUno(_toggler);
        emit evtDue(_counter);
        emit evtTre("hit!", 10, true);
        
        return latestToggler;
    }
    
    function kill() public {
       if (_owner == msg.sender) { // We check who is calling
          selfdestruct(_owner); //Destruct the contract
       }
    }
}

This is c# code for my test:

private const string WEB3_RPC_ENDPOINT_TESTCHAIN = "http://localhost:8545";

[Fact]
public async Task EstimateGas_TestChain()
        {
            var accounts = new List<(string account_address, string pk)>();

            accounts.Add(("0x12890d2cce102216644c59daE5baed380d84830c", "0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7"));

            var web3 = new Web3(new Account(accounts[0].pk), WEB3_RPC_ENDPOINT_TESTCHAIN);;

            var cts = new CancellationTokenSource();

            // smart contract deployment
            var service = await PlaygroundService.DeployContractAndGetServiceAsync(web3, new PlaygroundDeployment(), cancellationTokenSource: cts);

            _output.WriteLine($"Playground contract deployed at {service.ContractHandler.ContractAddress}");

            var gasEstimation = await service.ContractHandler.GetFunction<LogSomethingFunction>().EstimateGasAsync();

            _output.WriteLine($"\nGas Estimation: {gasEstimation}");

This is exception call stack:

Nethereum.JsonRpc.Client.RpcResponseException : gas required exceeds allowance or always failing transaction
   at Nethereum.JsonRpc.Client.ClientBase.HandleRpcError(RpcResponseMessage response)
   at Nethereum.JsonRpc.Client.ClientBase.SendInnerRequestAsync[T](RpcRequestMessage reqMsg, String route)
   at Nethereum.JsonRpc.Client.ClientBase.SendInnerRequestAsync[T](RpcRequest request, String route)
   at Nethereum.JsonRpc.Client.ClientBase.SendRequestAsync[T](RpcRequest request, String route)
   at Nethereum.Contracts.FunctionBase.EstimateGasFromEncAsync(CallInput callInput)
   at NethereumSampleContractWithEvents.Tests.PlaygroundTester.TransferEtherBetweenAccounts_MyPrivateBlockchain() in C:\Progetti\Lab\Blockchain\NethereumSamples\NethereumSampleContractWithEvents.Tests\PlaygroundTester.cs:line 262
--- End of stack trace from previous location where exception was thrown ---

startgeth.bat broken when substituting Geth 1.10.8 executable (fix in comments)

When substituting a more recent geth version the startgeth.bat launcher complains with:

flag provided but not defined: -wsaddr

Looking at the options for geth with the shipped version says (under "API AND CONSOLE OPTIONS"):
--wsaddr value WS-RPC server listening interface (default: "localhost")

Ahh... haha, geth 1.10.8 says the same but for "ws.addr" - so it's just adding a dot. And it's the same for: wsaddr, wsapi, wsorigins - so an updated startgeth.bat would therefore be:

RD /S /Q %~dp0devChain\geth
geth  --datadir=devChain init genesis_clique.json
geth --nodiscover --rpc --datadir=devChain  --rpccorsdomain "*" --mine --rpcapi "eth,web3,personal,net,miner,admin,debug" --ws  --ws.addr "0.0.0.0" --ws.api "eth,web3,personal,net,miner,admin,debug" --ws.origins "*" --allow-insecure-unlock --unlock 0x12890d2cce102216644c59daE5baed380d84830c --password "pass.txt"  --verbosity 0 console  

I also had to add "--allow-secure-unlock" to the above to allow it to run.

Cheers!

Hosting TestChains for internal use

I was wondering if I would want a cryptocurrency to be used internally could I just host the TestChain on a internal server where the whole enterprise can connect to?

Parity POA for MAC. Fix demo-spec.json

Launching parity POA test chain on mac results in the error below. The demo spec json seems to be invalid. I think this is an oversight for mac as the other parity test chains have a different json file.

Spec json is invalid: unknown field gasLimitBoundDivisor, expected one of stepDuration, validators, startStep, validateScoreTransition, validateStepTransition, immediateTransitions, blockReward, blockRewardContractTransition, blockRewardContractAddress, blockRewardContractCode, maximumUncleCountTransition, maximumUncleCount, emptyStepsTransition, maximumEmptySteps, strictEmptyStepsTransition at line 6 column 39

openethereum/parity-ethereum#6916

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.