Git Product home page Git Product logo

kaleido-examples's Introduction

Kaleido Connection Examples

Welcome to Kaleido Connection Examples! The Kaleido team created this repository because connecting to nodes in a Kaleido network is a bit different from connecting to nodes in the public Ethereum network: Kaleido requires basic authentication credentials!

This project is organized into folders by language, framework, occasionally node type, and communication protocol.

Each project executes a consistent scenario: fetching the latest block. This consistent experience makes understanding each language and framework trivial when one understands a single language/framework/protocol scenario.

Contributing

Contributions are welcome and encouraged! If we do not already have an example for your framework or language. Just make sure to follow the scheme described above!

kaleido-examples's People

Contributors

dbryan0516 avatar nickgaski avatar panghalamit avatar vdamle avatar

Stargazers

 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

kaleido-examples's Issues

Nethereum Rework HTTP

Need to rework the nethereum example to get last block instead of an account balance

Not able to use web sockets with web3 js.

let nodeUrl = "wss://" + USER + ":" + PASS + "@" + WSS_ENDPOINT;

// let provider = new Web3.providers.WebsocketProvider(nodeUrl);
let web3 = new Web3(new Web3.providers.WebsocketProvider(nodeUrl))
// Now you can call web3 functions, so we'll just test the connection by getting the latest block in the chain.

web3.eth.getBlock("latest").then((latestBlock) => {
console.log("Latest Block Via Websocket Provider: ");
console.log(latestBlock);

}).catch((er)=>{
console.log("error",er)
})

This code snippet results in following error:-

http_outgoing.js:494
throw new TypeError('The header content contains invalid characters');
^

TypeError: The header content contains invalid characters
at validateHeader (_http_outgoing.js:494:11)
at ClientRequest.setHeader (_http_outgoing.js:498:3)
at new ClientRequest (_http_client.js:173:14)
at Object.request (http.js:38:10)
at Object.request (https.js:239:15)
at WebSocketClient.connect (/home/himanshu/kafkaTest/web3Listener/node_modules/websocket/lib/WebSocketClient.js:241:56)
at new W3CWebSocket (/home/himanshu/kafkaTest/web3Listener/node_modules/websocket/lib/W3CWebSocket.js:62:18)
at ProvidersModuleFactory.createWebsocketProvider (/home/himanshu/kafkaTest/web3Listener/node_modules/web3-providers/dist/web3-providers.cjs.js:1254:22)
at new WebsocketProvider (/home/himanshu/kafkaTest/web3Listener/node_modules/web3-providers/dist/web3-providers.cjs.js:1295:39)
at Object. (/home/himanshu/kafkaTest/web3Listener/index.js:98:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)

Same code snippet runs when i replace kaleido url with rinkeby websocket url of infura.

Please Help!!!

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.