Coder Social home page Coder Social logo

bridge's Introduction

bridge

bridge is a fork of MyEtherWallet that allows you to manage various aspects of your Urbit ships, such as launching, transferring, issuing, and voting through the Urbit constitution, a PKI and identity system implemented as an Ethereum smart contract.

Development

Overview

Running bridge in development involves starting up an RPC-enabled Ethereum node (ganache) and deploying the Urbit constitution smart contracts (truffle) to that test network.

To run bridge, build the application and open the generated dist/index.html in a browser.

Dependencies

  • node.js
  • truffle
  • ganache-cli
  • urbit/constitution
  • urbit/constitution-js

Suggested Workflow

You'll need to clone the following three respositories:

You’ll also need 3 terminal windows open for the following processes:

  • ganache (run local Ethereum node)
  • truffle (compile and deploy contracts)
  • npm (build bridge)

Install & Run

Install truffle & ganache

  • npm install -g truffle
  • npm install -g ganache-cli

Clone constitution

  • git clone https://github.com/urbit/constitution
  • cd constitution
  • npm install

Clone bridge

  • git clone https://github.com/urbit/bridge
  • cd bridge
  • npm install

Clone constitution-js

  • git clone https://github.com/urbit/constitution-js
  • npm install

Link constitution-js

  • cd constitution-js
  • npm link
  • cd bridge
  • npm link ../constitution-js

Launch node & deploy contracts

  • ganache-cli -m "benefit crew supreme gesture quantum web media hazard theory mercy wing kitten" (in its own terminal window)
  • cd constitution
  • truffle deploy

Launch bridge

  • npm run dev
  • open bridge/dist/index.html in a browser (tested on Chrome)

In order to test with Ledger or Metamask, you must run a server:

  • cd bridge
  • python ./dist/bin/serve.py

Useful addresses

  • Constitution owner (allowed to create galaxies): 0x6deffb0cafdb11d175f123f6891aa64f01c24f7d
  • Test pool: 0x0724ee9912836c2563eee031a739dda6dd775333

Running bridge locally

Unlocking

To unlock the test wallet, choose "Mnemonic" as your method and enter the mnemonic benefit crew supreme gesture quantum web media hazard theory mercy wing kitten

Connecting

To connect to your test network, click the Node indicator in the header (defaults to ETH). Click through the wizard to set up a custom node, using the placeholders for each field.

Online mode

The "State" screen of bridge will show a list of ships that you own, along with actions available for that Ship. It will also allow you to connect to a Pool, which is an exchange for exchanging Stars for Spark Tokens and vice versa. If a Pool is connected, you will see your address' Spark balance.


Below each ship, you will see a list of actions that corresponds to that ship's type (Galaxy, Star, Planet) and state (Locked or Living). In the default online mode clicking on an action will take you to a transaction screen, where you will be asked to provide additional information for that transaction. For example, if you'd like to launch a child ship, say a planet from your star, then you will be asked which address the new ship should belong to and how long (in seconds) the ship should be locked before it can be started.

Once you've filled out the appropriate fields, you will be able to "Create" a transaction. This does not send the transaction to the blockchain, but merely creates and signs the transaction. The display will show both the signed and unsigned transactions for approval. Once you've created a transaction, you can press "Send," which will send the transaction to the Ethereum node to which your wallet is connected and you'll be shown a confirmation (or warning) dialogue, giving you the hash of the transaction.

When you're done, you can navigate back to the State screen to execute other transactions.


Offline Mode

If you'd prefer to construct your transactions offline, click on the node indicator in the header and select "Offline." This will disconnect Wallet from the node.

In offline mode, all transactions are listed and available. The transaction screens are identical, execept that nonce, gasLimit and gasPrice have to be entered manually (because these estimations require a node). Once you've filled the transaction fields, clicking "Create" will create and sign your transaction. At this point, you should copy and paste your transaction into another client to send to a node.

In offline mode, there is no validation of your transaction parameters, and there is no way to submit a transaction directly to a node. If you select this mode, you should have another way to submit transactions to the chain and you should independently confirm that your transaction is valid. For example, if you create a "Launch Child" transaction offline, please make sure that you own the parent ship. Refer to the constitution for the constraints on each transaction.

bridge's People

Contributors

tayvano avatar kvhnuke avatar ugilio avatar jzu avatar sekisanchi avatar bencalder avatar h3ll0fr13nd avatar zwilla avatar kevinmonahan avatar vvisigoth avatar protonotarios avatar egzumer avatar dternyak avatar 3sggpq8h avatar vupham26 avatar mrstormlars avatar wabwabfhe avatar btceth avatar yginting avatar dennisahlqvist avatar ercchy avatar karelbilek avatar tobymimo avatar crptm avatar sgelder avatar nogo10 avatar huhnsolo avatar guytp avatar spolrot avatar smokyish avatar

Watchers

Alex Kravets avatar

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.