Giter VIP home page Giter VIP logo

bitgo-playground's Introduction

BitGo :: Playground

Playground for BitGo techniques and examples

Available Commands

For a list of available commands run:

npm run help

CLI Setup

  1. Install dependencies:

    npm i
  2. Init project (will just copy .env.local to .env and .env.test.local to .env.test):

    npm run init
  3. Create a free BitGo test account

    3.1. Create a BitGo test organization and use it's Enterprise ID populate BITGO_ENTERPRISE in .env and .env.test.

    3.2. Create an BitGo access token and use it to populate BITGO_ACCESS_TOKEN in .env and .env.test.
    IMPORTANT: you must set a spending limit for TETH when creating an access token.

    3.4. Find out what the Ethereum Fee Address for your account is.
    One way to do this is:

    • Click Wallets > Create Wallet > Choose Ethereum > and follow the steps.
    • You will get an error that looks something like:
      insufficient funds in fee address:
      0xabc123def456ghi789abc123def456ghi789abc1
      
    • Copy that address
  4. Then on the Kovan network, transfer some Ether to your fee address (eg. 0.5 Ether will be enough for a day of regular playing around with this CLI)

  5. Next create a wallet for testing and local tranaactions using the following command:

    node src/index.js wallet create -l '<WHATEVER NAME YOU LIKE>'
  6. Then using the output under Wallet:

    • id : use this to populate BITGO_WALLET_ID in .env and .env.test
  7. And lastly using the output under MERGED User Keychain Data:

    • private key : use this to populate BITGO_WALLET_PRV in .env and .env.test
    • address : transfer some Ether to this address

    You can use the following command to check that the wallet balance after your transfer:

    node src/index.js wallet view '<WALLET ID>'

Where to get Ether?

On the Kovan network you can get ether from the Kovan Faucet

How to send Ether?

Install the Metamask chrome extension and create an Ethereum account.

CLI Usage

seed

Commands for generating/regenerating seed for use with BitGo keychain create: BitGo docs

For all available seed commands run:

node src/index.js seed gen --help

keychains

Commands for creating/recreating, storing and listing keychains, which are required when creating BitGo wallets: BitGo docs

For all available keychain commands run:

node src/index.js keychain create --help
node src/index.js keychain list --help

wallet

Commands for creating/recovering and listing BitGo wallets:

For all available wallet commands run:

node src/index.js wallet create --help
node src/index.js wallet list --help
node src/index.js wallet view --help
node src/index.js wallet transact --help

Testing

You can run unit tests with the following command:

npm run test

Or in watch mode:

npm run test:watch

End to End Testing

  1. First you have followed the steps in End to End Testing Setup.

  2. Then run the following command:

npm run test:e2e

NOTE: This with consume Ether from your BitGo test fee address.

bitgo-playground's People

Contributors

neilrussell6 avatar yesitsdave avatar

Watchers

James Cloos avatar Cameron Olivier 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.