Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in3/web3 example in README #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,23 @@ npm install --save in3

// import in3-Module
import In3Client from 'in3'
import * as web3 from 'web3'
const Web3 = require('web3');

// use the In3Client as Http-Provider
const web3 = new Web3(new In3Client({
proof : 'standard',
signatureCount: 1,
requestCount : 2,
chainId : 'mainnet'
proof: 'standard',
signatureCount: 1,
requestCount: 2,
chainId: 'mainnet'
}).createWeb3Provider())

// use the web3
const block = await web.eth.getBlockByNumber('latest')
async function main() {
const block = await web3.eth.getBlock('latest');
console.log(block);
}

main();
...


Expand Down Expand Up @@ -322,4 +327,4 @@ services:
- --auto-update=none # do not automatically update the client
- --pruning=archive
- --pruning-memory=30000 # limit storage
```
```