Playground for BitGo techniques and examples
For a list of available commands run:
npm run help-
Install dependencies:
npm i
-
Init project (will just copy
.env.localto.envand.env.test.localto.env.test):npm run init
-
Create a free BitGo test account
3.1. Create a BitGo test organization and use it's
Enterprise IDpopulateBITGO_ENTERPRISEin.envand.env.test.3.2. Create an BitGo access token and use it to populate
BITGO_ACCESS_TOKENin.envand.env.test.
IMPORTANT: you must set a spending limit forTETHwhen creating an access token.3.4. Find out what the
Ethereum Fee Addressfor 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
-
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) -
Next create a wallet for testing and local tranaactions using the following command:
node src/index.js wallet create -l '<WHATEVER NAME YOU LIKE>' -
Then using the output under Wallet:
id: use this to populateBITGO_WALLET_IDin.envand.env.test
-
And lastly using the output under MERGED User Keychain Data:
private key: use this to populateBITGO_WALLET_PRVin.envand.env.testaddress: 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>'
On the Kovan network you can get ether from the Kovan Faucet
Install the Metamask chrome extension and create an Ethereum account.
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 --helpCommands 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 --helpCommands 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 --helpYou can run unit tests with the following command:
npm run testOr in watch mode:
npm run test:watch-
First you have followed the steps in End to End Testing Setup.
-
Then run the following command:
npm run test:e2eNOTE: This with consume Ether from your BitGo test fee address.