• Stars
    star
    206
  • Rank 190,504 (Top 4 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Independent bridge to link any Ethereum network with the Provable engine

Description

This tool enables any non-public blockchain instance to interact with the Oraclize service.

Please note that at this point this tool is still experimental and subject to change without notice.

Requirements

  • node version >= 5.0.0 (& npm)

Note

(on Ubuntu)

run sudo apt-get install build-essential -y

You should run the following commands from within the ethereum-bridge folder.

Install

via git

git clone https://github.com/oraclize/ethereum-bridge.git
cd ethereum-bridge
npm install

via npm

npm install -g ethereum-bridge

How to use

You have 2 options:

  • active mode (deploy and query contracts using one account on your main node) [DEFAULT]
  • broadcast mode (deploy and query contracts using a local account (the node will be used only to broadcast the txs))

After you have correctly deployed the address resolver and the connector on your blockchain you can load the previous instance using the --oar flag (with the latest oar address generated) or using --instance latest

if you are not using the deterministic OAR you also need to update your contract constructor with the new address resolver generated

see also optional flags

Active mode

ethereum-bridge -H localhost:8545 -a 1

(deploy contracts using the account 1 found on the localhost:8545 node)

Broadcast mode

Generate a new local address:

ethereum-bridge -H localhost:8545 --broadcast --new

(generate a new address locally and deploy contracts (txs broadcasted to localhost:8545 node))

or if you already have one or more account in your keys.json file:

ethereum-bridge -H localhost:8545 --broadcast -a 0

(load the first account in your keys.json file (index n.0) and deploy contracts (txs broadcasted to localhost:8545 node))

Add a custom address resolver

Add OAR = OraclizeAddrResolverI(EnterYourOarCustomAddress); to your contract constructor, example:

Where EnterYourOarCustomAddress is the address resolver generated when you have run the script

contract test() {
    ...

    function test() {
      // this is the constructor
      OAR = OraclizeAddrResolverI(0xf0f20d1a90c618163d762f9f09baa003a60adeff);
    }

    ...
}

Note: The address chosen will be used to deploy all the Oraclize contracts, make sure to not deploy contracts that use Oraclize on the same address.

How to update the bridge

If a new version is detected you can run npm run update to automatically donwload and install the latest version from github.

Optional flags

  • optional:
    • --broadcast --new : generate a new local address (private key automatically saved in ./config/instance/keys.json), and deploy contracts using the new address
    • --broadcast : enable offline tx signing (your node will be used to broadcast the raw transaction) the broadcast mode will load your local keys.json file
    • -a : change the default account used to deploy and call the transactions (account index and hex address are allowed) i.e:
      • -a 0 : use account 0 on localhost:8545
      • -a 0x123456 --broadcast : load and use account 0x123456 (public-key) in your keys.json file (broadcast mode)
      • -a 0 --broadcast : use account at index n. 0 in your keys.json file (broadcast mode)
    • --instance : load a previous configuration file (filename) you can also use 'latest' to load the latest confiuration file, i.e. --instance oracle_instance_1483441110.json or --instance latest
    • --from --to : load and process logs starting --from (fromBlock) and --to (toBlock) ('latest' is not allowed) i.e. --from 27384 --to 27387
    • --oar : to specify the OAR address already deployed i.e. --oar 0xEnterYourOarCustomAddress
    • -H : change the default node (localhost:8545)
    • -p : change the default PORT (8545) on localhost
    • --url : change the default node with an url (http://localhost:8545)
    • --key : change the default key path (./config/instance/keys.json) i.e. --key /home/user/keys.json
    • --gas : change the default gas limit (3000000) used to deploy contracts
    • --resume : resume all skipped queries
    • --skip : skip all pending queries
    • --dev : skip contract myid check and pending queries (useful for local testing)
    • --disable-deterministic-oar : Deploy the address resolver (OAR) with your main account (note: you need to update your contract with the new generated address)
    • --price-usd : set the USD base price
    • --price-update-interval : set the baseprice update interval time (in seconds), ETH price will be fetched from the Oraclize HTTP API
    • --random-ds-update-interval : set the random ds hash list update interval time (in seconds)
    • --disable-price : skip datasource pricing and base price connector update (only on new instances)
    • --disable-reorg : disable re-org block listen
    • --update-ds : update datasource pricing only (pricing (if found) will be loaded from your local instance file, otherwise will be fetched from the remote oraclize API)
    • --loglevel : change the default log level (available: 'error', 'warn', 'info', 'verbose', 'debug', 'stats') default: 'info'
    • --non-interactive : disable the interactive mode
    • --no-hints : disable logs hints
    • --gasprice : set custom gas price

More Repositories

1

ethereum-api

Provable API for Ethereum smart contracts
Solidity
802
star
2

ethereum-examples

Code examples showing how to use the Provable API on Ethereum
Solidity
449
star
3

ethereum-keys-sgx

An ethereum key pair generator & transaction signer/sender using Intel SGX & Rust.
Rust
37
star
4

dapp-proof-of-identity

Porvable's Proof-of-Identity Dapp + eWallet
JavaScript
33
star
5

eos-examples

Code examples showing how to use the Provable API on EOSIO
C++
33
star
6

proof-verification-tool

Tool to verify the proofs generated by Provable
JavaScript
30
star
7

eos-api

Provable API for EOS contracts
C++
29
star
8

ptokens.js-v1

Library to simplify the interaction with pTokens
JavaScript
26
star
9

dapp-stackexchange-bounty

An incentive mechanism to make StackExchange sites flourish
JavaScript
21
star
10

provable-starter-kit

A Provable & OpenZeppelin starter-kit for building data-rich smart-contracts!
Solidity
20
star
11

truffle-starter

With the Provable oracle in this Truffle box, you can create data-rich smart-contracts in seconds!
Solidity
20
star
12

ptokens-core

The core component which makes pTokens bridges work
Rust
18
star
13

dapp-proof-of-identity-old

A smart contract to link your real identity to an Ethereum address
JavaScript
15
star
14

encrypted-queries

Privacy-enabling tools for onchain Provable querying
Python
15
star
15

fabric-api

Provable API for Hyperledger Fabric Chaincodes
Go
12
star
16

aragon-staking-manager

An Aragon app that allows to lock for a customizable amount of time, a quantity of ERC20 tokens in exchange for organization's tokens.
JavaScript
10
star
17

corda-api

Provable API for the R3 Corda platform
JavaScript
9
star
18

oraclize-lib

Oraclize node.js library
JavaScript
9
star
19

hack-ethams-hexagons-protocol

Solidity
9
star
20

fabric-examples

Code examples showing how to use the Provable API on Hyperledger Fabric
Shell
7
star
21

rsk-api

Provable API for Rootstock smart contracts
Solidity
6
star
22

random-datasource

Resources around the Provable random-datasource
C
6
star
23

android-proof

Java
5
star
24

dapp-youtube-escrow

Dapp to get youtubers' sponsors to pay only for successful videos
HTML
4
star
25

melonport

3
star
26

ptokens.js

New ptokens.js implementation supporting host-to-host swaps
TypeScript
2
star
27

portals-nft-examples

Repository containing pNetwork Portals smart contracts.
JavaScript
2
star
28

ethereum-studio-examples

Solidity examples for the Ethereum Studio c9-based IDE
2
star
29

segwit-computation

Java
2
star
30

ptokens-erc20-vault

The pToken pERC20-on-EOS smart-contract & management CLI.
JavaScript
2
star
31

trufflecon2018-demo

Material for the Oraclize demo at TruffleCon 2018
JavaScript
2
star
32

ptokens-erc777-smart-contract

The ETH smart contract for the Provable Token!
JavaScript
2
star
33

offchain-network-monitor

Web-based client side offchain network monitor to indipendently verify Provable's honesty.
JavaScript
1
star
34

steroids

An Aragon app that allows to lock for a customizable amount of time, a quantity of UniV2 tokens in exchange for organization's tokens.
JavaScript
1
star
35

token-swap

A simple smart-contract to swap a token.
JavaScript
1
star
36

bitcoin-network-monitor

JavaScript
1
star
37

rootstock-bridge

Independent bridge to link any Rootstock network with the Oraclize engine
JavaScript
1
star
38

aragon-voting-rewards

An Aragon app that allows to get rewards in base of how many votes you made in a certain amount of time
JavaScript
1
star
39

ptokens-vanilla-apps

Rust
1
star
40

ptokens-bridge

Docker Compose orchestration for ptokens-bridges.
Shell
1
star
41

ptokens-jsonrpc-spec

OpenRPC Specification for the pTokens bridges RPC API
JavaScript
1
star