GithubHelp home page GithubHelp logo

dispatchlabs / disgo Goto Github PK

View Code? Open in Web Editor NEW
32.0 11.0 12.0 49.94 MB

Go Dispatch client

Go 34.60% Shell 16.38% C++ 6.40% Makefile 3.12% Roff 25.07% M4 0.53% C 11.99% Python 0.62% Assembly 0.67% Java 0.62%
dispatch golang blockchain distributed-systems dlt

disgo's Introduction

 

Go Version 1.10.3 Build status

Overview

Disgo (dispatch + go) is the first client implementation of the Dispatch protocol. Dispatch enables the Zero-Knowledge Analytics of distributed data without comprimising data ownership, privacy, or security.

Come talk with us!

If you have any questions or just want to get to know us better, come say hi in our discord channel (https://Dispatchlabs.io/discord)

Download

With Go installed, enter either of the following commands into your terminal:

go get github.com/dispatchlabs/disgo
or
git clone http://github.com/dispatchlabs/disgo (into your GOPATH)

If you have yet to install Go, visit our tutorial or download straight from the Golang website.

How to run a Disgo node

Disgo is a full dispatch node, and you can run it right out of the box. Simply run the following commands in your terminal:

cd $GOPATH/src/github.com/dispatchlabs/disgo
go get ./...
go run main.go

Using the protocol (Dancing the Disgo 🕺)

Configuration

The disgo package relies on the configuration loaded by commons

Contributing

We would love your help developing the protocol! It's a big project and we're a small team, so all contributions are encouraged. For more information on how to get a developer environment set up, please check out our dev-tools repo.

License

The Disgo library is free software: you can redistribute it and/or modify it under the terms of version 3 of the GNU General Public License as published by the Free Software Foundation.

The Disgo library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

disgo's People

Contributors

avery-h avatar brianosaurus avatar chrismcgregor avatar colinlowenberg avatar davedispatch avatar dlhdesign avatar gregmcgregor avatar muhalabdullah avatar restevens402 avatar sgehrman avatar yefim avatar zanewithspoon 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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

disgo's Issues

Proxy to Delegates

Localhost requests to bookkeeper requiring delegates should be proxied to random delegate.

link: combining dwarf failed: Unknown load command 0x32 (50)

Not sure how this machine is different than a machine where the command worked, but here is an error I am getting.

imac5k2015:~ arsen$ go get github.com/dispatchlabs/disgo
# github.com/dispatchlabs/disgo
/usr/local/go/pkg/tool/darwin_amd64/link: /usr/local/go/pkg/tool/darwin_amd64/link: combining dwarf failed: Unknown load command 0x32 (50)

imac5k2015:~ arsen$ 

"host":"10.138.0.17","port":1973

Transaction.send result: {"status":"Pending","humanReadableStatus":"Pending","created":"2019-01-29T22:44:02.993512035Z","_delegateInfo":{"address":"222c024a8b4e1c2e67c4cb54eecaa287f4bdbdd4","grpcEndpoint":{"host":"10.138.0.17","port":1973},"httpEndpoint":{"host":"35.203.143.69","port":1975},"localHttpApiPort":0,"type":"Delegate","statusTime":"0001-01-01T00:00:00Z"}}
2019-01-29T22:44:03.028967+00:00 app[web.1]: GET: {"path":"/v1/transactions/8ebee977bfa785d4220599ac52eda7a7f3f2e760c4fcb03c82b58d6fdd96d850","hostname":"35.203.143.69","port":1975,"headers":{"Content-Type":"application/json"},"method":"GET"}
2019-01-29T22:44:03.162467+00:00 app[web.1]: error:  { hash: '8ebee977bfa785d4220599ac52eda7a7f3f2e760c4fcb03c82b58d6fdd96d850',
2019-01-29T22:44:03.162470+00:00 app[web.1]:   type: 2,
2019-01-29T22:44:03.162472+00:00 app[web.1]:   from: 'a26e3ce9000c70452e968cdc8947fe3fa7b162dd',
2019-01-29T22:44:03.162474+00:00 app[web.1]:   to: 'b3edf9e5eb04f8f0dc42b57bd266c3d652527ad2',
2019-01-29T22:44:03.162512+00:00 app[web.1]:   abi: '5b7b22636f6e7374616e74223a747275...27d5d',
2019-01-29T22:44:03.162514+00:00 app[web.1]:   method: 'balanceOf',
2019-01-29T22:44:03.162515+00:00 app[web.1]:   params: '["a26e3ce9000c70452e968cdc8947fe3fa7b162dd"]',
2019-01-29T22:44:03.162517+00:00 app[web.1]:   time: 1548801842512,
2019-01-29T22:44:03.162519+00:00 app[web.1]:   signature: '58b35472dd828338695cf8750e19abee33de8222c19f54094fd1fa43a49c4535502a9c9150e74651ce12352feaaaffcc535dbdfeab53ff63b5e7f79c8cf5935201',
2019-01-29T22:44:03.162520+00:00 app[web.1]:   hertz: '0',
2019-01-29T22:44:03.162521+00:00 app[web.1]:   receipt: 
2019-01-29T22:44:03.162523+00:00 app[web.1]:    { transactionHash: '8ebee977bfa785d4220599ac52eda7a7f3f2e760c4fcb03c82b58d6fdd96d850',
2019-01-29T22:44:03.162524+00:00 app[web.1]:      status: 'CouldNotReachConsensus',
2019-01-29T22:44:03.162526+00:00 app[web.1]:      created: '2019-01-29T22:44:02.62356945Z' } }

unable to connect to seed node

Arsens-MacBook-Pro:disgo arsenyeremin$ go run main.go
/Users/arsenyeremin/go/src/github.com/dispatchlabs/disgo/
time="2018-10-20T11:38:23-07:00" level=info msg="[generated default config file ./config/config.json]" method="main/disgo/commons/types.GetConfig.func1()"
time="2018-10-20T11:38:23-07:00" level=info msg="[node configuration: {\"httpEndpoint\":{\"host\":\"0.0.0.0\",\"port\":1975},\"grpcEndpoint\":{\"host\":\"127.0.0.1\",\"port\":1973},\"grpcTimeout\":5,\"localHttpApiPort\":1971,\"seeds\":[{\"address\":\"9aa050c8ecc7bf9e7de03494c43776e65fd5328e\",\"grpcEndpoint\":{\"host\":\"seed.dispatchlabs.io\",\"port\":1973},\"httpEndpoint\":{\"host\":\"seed.dispatchlabs.io\",\"port\":1975},\"type\":\"Seed\",\"statusTime\":\"0001-01-01T00:00:00Z\"}],\"delegateAddresses\":null,\"useQuantumEntropy\":false,\"isBookkeeper\":true,\"genesisTransaction\":\"{\\\"hash\\\":\\\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\\\",\\\"type\\\":0,\\\"from\\\":\\\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\\\",\\\"to\\\":\\\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\\\",\\\"value\\\":10000000,\\\"data\\\":\\\"\\\",\\\"time\\\":0,\\\"signature\\\":\\\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\\\",\\\"hertz\\\":0,\\\"fromName\\\":\\\"\\\",\\\"toName\\\":\\\"\\\"}\"}]" method="main/disgo/commons/types.GetConfig.func1()"
{
   "httpEndpoint": {
      "host": "0.0.0.0",
      "port": 1975
   },
   "grpcEndpoint": {
      "host": "127.0.0.1",
      "port": 1973
   },
   "grpcTimeout": 5,
   "localHttpApiPort": 1971,
   "seeds": [
      {
         "address": "9aa050c8ecc7bf9e7de03494c43776e65fd5328e",
         "grpcEndpoint": {
            "host": "seed.dispatchlabs.io",
            "port": 1973
         },
         "httpEndpoint": {
            "host": "seed.dispatchlabs.io",
            "port": 1975
         },
         "type": "Seed",
         "statusTime": "0001-01-01T00:00:00Z"
      }
   ],
   "delegateAddresses": null,
   "useQuantumEntropy": false,
   "isBookkeeper": true,
   "genesisTransaction": "{\"hash\":\"a48ff2bd1fb99d9170e2bae2f4ed94ed79dbc8c1002986f8054a369655e29276\",\"type\":0,\"from\":\"e6098cc0d5c20c6c31c4d69f0201a02975264e94\",\"to\":\"3ed25f42484d517cdfc72cafb7ebc9e8baa52c2c\",\"value\":10000000,\"data\":\"\",\"time\":0,\"signature\":\"03c1fdb91cd10aa441e0025dd21def5ebe045762c1eeea0f6a3f7e63b27deb9c40e08b656a744f6c69c55f7cb41751eebd49c1eedfbd10b861834f0352c510b200\",\"hertz\":0,\"fromName\":\"\",\"toName\":\"\"}"
}time="2018-10-20T11:38:23-07:00" level=info msg="[generating keys]" method="main/disgo/bootstrap.loadKeys()"
time="2018-10-20T11:38:23-07:00" level=info msg="[booting Disgo v2.2.0...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[opening DB...]" method="main/disgo/commons/services.DbService.openDb()"
2018/10/20 11:38:23 Replaying from value pointer: {Fid:0 Len:0 Offset:0}
2018/10/20 11:38:23 Iterating file id: 0
2018/10/20 11:38:23 Iteration took: 20.314µs
time="2018-10-20T11:38:23-07:00" level=info msg="[starting DbService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[starting DVMService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[starting DisGoverService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[running]" method="main/disgo/dvm.DVMService.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[starting DAPoSService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[starting LocalAPIService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[starting HttpService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[starting GrpcService...]" method="main/disgo/bootstrap.Server.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[listening on http://127.0.0.1:1971]" method="main/disgo/commons/services.HttpService.Go.func2()"
time="2018-10-20T11:38:23-07:00" level=info msg="[running, waiting for delegates sync]" method="main/disgo/localapi.LocalAPIService.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[listening on http://:1975]" method="main/disgo/commons/services.HttpService.Go.func1()"
time="2018-10-20T11:38:23-07:00" level=info msg="[running, waiting for delegates sync]" method="main/disgo/dapos.DAPoSService.Go()"
time="2018-10-20T11:38:23-07:00" level=info msg="[listening on 1973]" method="main/disgo/commons/services.GrpcService.Go()"
time="2018-10-20T11:38:23-07:00" level=warning msg="[attempted update by a non-authorized seed node]" method="main/disgo/disgover.DisGoverService.verifySeedNode()"
time="2018-10-20T11:38:23-07:00" level=error msg="[you are not an authorized seed node]" method="main/disgo/disgover.DisGoverService.Go()"
time="2018-10-20T11:38:24-07:00" level=fatal msg="[unable to connect to seed node (seed.dispatchlabs.io:1973)...please try again later]" method="main/disgo/disgover.DisGoverService.Go()"
exit status 1
Arsens-MacBook-Pro:disgo arsenyeremin$ 

Concern Regarding Code Quality of Badger

My Posts will be deleted on badger repository. So posting it here, since you guys use badger.

Badger team did changes on May 9th to introduce move keys.
dgraph-io/badger@7af0076

There were many bugs, issues related to same thing which were fixed over months. The last fix was done a week back. The issues ranged from badger being stuck in recursive loop during get to badger not returning data which was inserted.

dgraph-io/badger@d1185f0
dgraph-io/badger@af99e5f
dgraph-io/badger@d055ef4
dgraph-io/badger@3340933
dgraph-io/badger@2e3a32f

@manishrjain How do you plan to address the code quality of badger.

Prompt to create github issue on unhandled error

The idea is if an error has not been handled in code, prompt user to submit the error code and callstack to github. This could be a setting only for alpha/beta releases.
Example:

f, err := os.Open("filename.ext")
if err != nil && reportError() {
    openbrowser("https://github.com/dispatchlabs/disgo/issues/new?title=Missing fil%20to%20invalid%20chain%3A%20%5Bunknown%2C%200%5D&body=%60%60%60%20%0AError%3A%20Launcher%20co")
}

func openbrowser(url string) {
	var err error

	switch runtime.GOOS {
	case "linux":
		err = exec.Command("xdg-open", url).Start()
	case "windows":
		err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
	case "darwin":
		err = exec.Command("open", url).Start()
	default:
		err = fmt.Errorf("unsupported platform")
	}
	if err != nil {
		log.Fatal(err)
	}

}
func reportError() bool {
	var response string
	_, err := fmt.Scanln(&response)
	if err != nil {
		log.Fatal(err)
	}
	okayResponses := []string{"y", "Y", "yes", "Yes", "YES"}
	nokayResponses := []string{"n", "N", "no", "No", "NO"}
	if containsString(okayResponses, response) {
		return true
	} else if containsString(nokayResponses, response) {
		return false
	} else {
		fmt.Println("Report error? Type yes or no and then press enter:")
		return reportError()
	}
}

CouldNotReachConsensus

DEVNET

{"status":"Pending","humanReadableStatus":"Pending","created":"2019-01-29T06:48:58.391870446Z","_delegateInfo":{"address":"b5e76c1d2b2ff6dc654c5a35c38e307a32a33f78","grpcEndpoint":{"host":"10.138.0.16","port":1973},"httpEndpoint":{"host":"35.233.197.138","port":1975},"localHttpApiPort":0,"type":"Delegate","statusTime":"0001-01-01T00:00:00Z"}}
29b1g
2019-01-28 22:48:58-08:00GET: {"path":"/v1/transactions/590ed12307e7ed3447fb62040def01adddc53e5b9dc33c98bca5d61158904122","hostname":"35.233.197.138","port":1975,"headers":{"Content-Type":"application/json"},"method":"GET"}
29b1g
2019-01-28 22:48:58-08:00error: { hash: '590ed12307e7ed3447fb62040def01adddc53e5b9dc33c98bca5d61158904122',
29b1g
2019-01-28 22:48:58-08:00 type: 2,
29b1g
2019-01-28 22:48:58-08:00 from: 'a26e3ce9000c70452e968cdc8947fe3fa7b162dd',
29b1g
2019-01-28 22:48:58-08:00 to: 'b3edf9e5eb04f8f0dc42b57bd266c3d652527ad2',
2019-01-28 22:48:58-08:00 method: 'balanceOf',
29b1g
2019-01-28 22:48:58-08:00 params: '["a26e3ce9000c70452e968cdc8947fe3fa7b162dd"]',
29b1g
2019-01-28 22:48:58-08:00 time: 1548744537709,
29b1g
2019-01-28 22:48:58-08:00 signature: '1bd2e1bfaf3a33049507610ac2f5856b26d7499478991aa0735dcd9440694fc22b2a9b8edfaeba3b086e3f71597d339a1589e37e8c1ee88e3464a753c053a0b301',
29b1g
2019-01-28 22:48:58-08:00 hertz: '0',
29b1g
2019-01-28 22:48:58-08:00 receipt:
29b1g
2019-01-28 22:48:58-08:00 { transactionHash: '590ed12307e7ed3447fb62040def01adddc53e5b9dc33c98bca5d61158904122',
29b1g
2019-01-28 22:48:58-08:00 status: 'CouldNotReachConsensus',
29b1g
2019-01-28 22:48:58-08:00 created: '2019-01-29T06:48:58.062318976Z' } }

And also

{"host":"35.233.197.138","port":1975},"localHttpApiPort":0,"type":"Delegate","statusTime":"0001-01-01T00:00:00Z"}}
29b1g
2019-01-28 22:50:39-08:00GET: {"path":"/v1/transactions/53eac1b595a2c9a396f478d40df66e9ea7b3437fcb0d237be892dbf7519634fe","hostname":"35.233.197.138","port":1975,"headers":{"Content-Type":"application/json"},"method":"GET"}
29b1g
2019-01-28 22:50:39-08:00error: { hash: '53eac1b595a2c9a396f478d40df66e9ea7b3437fcb0d237be892dbf7519634fe',
29b1g
2019-01-28 22:50:39-08:00 type: 2,
29b1g
2019-01-28 22:50:39-08:00 from: 'a26e3ce9000c70452e968cdc8947fe3fa7b162dd',
29b1g
2019-01-28 22:50:39-08:00 to: 'b3edf9e5eb04f8f0dc42b57bd266c3d652527ad2',
29b1g
2019-01-28 22:50:39-08:00 abi: '5b7b2...6d',
29b1g
2019-01-28 22:50:39-08:00 method: 'returnTokens',
29b1g
2019-01-28 22:50:39-08:00 params: '["daa9269b8d8a165a74df9b4d2b898ee867a770e7",600]',
29b1g
2019-01-28 22:50:39-08:00 time: 1548744638542,
29b1g
2019-01-28 22:50:39-08:00 signature: 'c4cef9eb573f4dba8391780ed7d9a2aef097321190ee451079ea8e8089dff5ef40635be21cbf7c0d3864e152dbff90c0dde820db97d8446e333027054deeef7500',
29b1g
2019-01-28 22:50:39-08:00 hertz: '0',
29b1g
2019-01-28 22:50:39-08:00 receipt:
29b1g
2019-01-28 22:50:39-08:00 { transactionHash: '53eac1b595a2c9a396f478d40df66e9ea7b3437fcb0d237be892dbf7519634fe',
29b1g
2019-01-28 22:50:39-08:00 status: 'CouldNotReachConsensus',
29b1g
2019-01-28 22:50:39-08:00 created: '2019-01-29T06:50:38.764751346Z' } }

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.