GithubHelp home page GithubHelp logo

blockchainsllc / in3-legacy Goto Github PK

View Code? Open in Web Editor NEW
76.0 12.0 17.0 3.26 MB

[Deprecated] Typescript-version of the IN3 client.

Home Page: https://github.com/blockchainsllc/in3

License: Other

TypeScript 99.46% Dockerfile 0.54%
verification incubed ethereum client merkle-proof typescript client-library

in3-legacy's Issues

[Docker] Incubed server can't decode private private key on startup

Tried to run Incubed server using docker-compose.yml from this repo. Unfortunately it fails on startup saying Could not decode the private (see full log below). Tried different key JSON files (generated by geth, parity, myCrypto) with the same result:

incubed-server_1  | no config found (Error: ENOENT: no such file or directory, open 'config.json')! using defaults
incubed-server_1  | Error starting the server : Could not decode the private : ethUtil.sha3(...).replace is not a function { port: 8500,
incubed-server_1  |   chains: 
incubed-server_1  |    { '0x5': 
incubed-server_1  |       { rpcUrl: 'http://localhost:8545',
incubed-server_1  |         privateKey: '/secure/myKey.json',
incubed-server_1  |         minBlockHeight: 6,
incubed-server_1  |         registry: '0x85613723dB1Bc29f332A37EeF10b61F8a4225c7e',
incubed-server_1  |         registryRPC: '',
incubed-server_1  |         privateKeyPassphrase: '123456789' } },
incubed-server_1  |   logging: { colors: true } }
incubed-server_1  | error: Error starting the server Error: Could not decode the private : ethUtil.sha3(...).replace is not a function port=8500, rpcUrl=http://localhost:8545, privateKey=/secure/myKey.json, minBlockHeight=6, registry=0x85613723dB1Bc29f332A37EeF10b61F8a4225c7e, registryRPC=, privateKeyPassphrase=123456789, colors=true
in3-server_incubed-server_1 exited with code 1

make in3-ts public

  • add wiki
  • add at least README.md to document the usage
  • add browserify to bundle for browser
  • split server and client

implement all opcodes with proofs and values for 'eth_call'

  • BALANCE
  • EXTCODESIZE
  • EXTCODECOPY
  • BLOCKHASH
  • COINBASE ( since we are currently not using a real block!)
  • TIMESTAMP
  • NUMBER
  • DIFFICULTY
  • GASLIMIT
    // and we need to check if the target contract exists (even though it would most likely fail if not)
  • CALL
  • CALLCODE
  • DELEGATECALL
  • STATIONCALL

CodeCache in client.

Since the client will most likely use the same contracts the code is immutable, it makes sense to cache the contract code instead of getting them from the server in each eth_call request.
But then the client must check the proof for codehashes and ask for the code if needed.

In3 examples don't work.

Steps to reproduce

I am trying to create a web app using the instructions from here:
https://in3.readthedocs.io/en/latest/api-ts.html
and following the examples from here:
https://github.com/slockit/in3/blob/master/examples/src/in3DirectAPI.ts
and I can't get anything to log out.

my versions of in3 and web3 are:

   "web3": "^1.2.9"
    "in3": "^2.1.3",

And I'm using a normal NodeJS server with Express.
This is all I get:

UnhandledPromiseRejectionWarning: Error: tried eth_getBlockByNumber("0x0",false) to https://in3-v2.slock.it/mainnet/nd-2 but failed and can not recover (No nodes found that fullfill the filter criteria ) from wrong response  : Error: No nodes found that fullfill the filter criteria

And this is after a day of trying to request different hashes by blocks, numbers, etc.. The previous error is by copying the code from : https://github.com/slockit/in3/blob/master/examples/src/in3DirectAPI.ts

Expected behavior

Anything should login when I try to get information with the hash given in the test.

Actual behavior

I get errors.

Screenshot 2020-07-06 at 21 02 17

System configuration

MacOS 10.15.1

Incubed version

"in3": "^2.1.3",

Request

Incubed Configuration

Chain

implement filters in the Client

This should create a id inside the Client and triggers a request
whenever eth_getFilterChanges is called.

Here we should support

  • eth_newFilter
    -> call eth_getLogs with the last checked blockNumber

  • eth_newBlockFilter
    -> call eth_getBlockNumber and the fetch all blocks after the last checked blockNumber

  • eth_newPendingTransactionFilter ( not supported )

  • tests implemented

404 for link in README

was very excited to read: "Java-Implementation of a native-wrapper" but then clicked on in and got a 404 :-(

data in client.ts should be language agnostic

currently this tightly couples to typescript. I want to use it e.g. for native android - using ts would be a mistake there. So it would be great if the data defined in client.ts could live e.g. in a json - ideally in a separate repository.

implement eth_getLogs

in order to proof, we can do the following:

we should include all blockheaders (and let them sign) + the transactionreceipt and its merkle-proof of the tx containing logs for the given filter.
Buf of course we are not able to proof a not existence of a log, except if we would deliver all blockheaders in the search range. But this could be a lot! But maybe it would be enough to sign only the last one, since the others can be verified through the parentHash.

docker image removed

trying to follow the documentation here: https://in3.readthedocs.io/en/latest/getting_started.html#registering-a-own-in3-node

I am getting:

✓ ~/g/t/test docker-compose -f dockcker-compose.yml  up -d
Creating network "test_default" with the default driver
Pulling incubed-server (slockit/in3-server:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling incubed-server (slockit/in3-server:latest)...
ERROR: pull access denied for slockit/in3-server, repository does not exist or may require 'docker login'

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.