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.local
to.env
and.env.test.local
to.env.test
):npm run init
-
Create a free BitGo test account
3.1. Create a BitGo test organization and use it's
Enterprise ID
populateBITGO_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 forTETH
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
-
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_ID
in.env
and.env.test
-
And lastly using the output under MERGED User Keychain Data:
private key
: use this to populateBITGO_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>'
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 --help
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
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
You can run unit tests with the following command:
npm run test
Or 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:e2e
NOTE: This with consume Ether from your BitGo test fee address.