Skip to content

Commit

Permalink
fix(SOLNENG-27): update solana fb nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
MnrGreg committed Aug 27, 2024
1 parent 980e70e commit dc091d0
Show file tree
Hide file tree
Showing 5 changed files with 418 additions and 173 deletions.
12 changes: 6 additions & 6 deletions solana-staking/fireblocks/nodejs/.env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Blockdaemon Stake
SOLANA_VALIDATOR_ADDRESS=HiFjzpR7e5Kv2tdU9jtE4FbH1X8Z9Syia3Uadadx18b5 # Blockdaemon Solana Testnet vote account = HiFjzpR7e5Kv2tdU9jtE4FbH1X8Z9Syia3Uadadx18b5
SOLANA_VOTE_ACCOUNT=FQwewNXahV7MiZcLpY6p1xhUs2acVGQ3U5Xxc7FzV571 # Blockdaemon Solana Mainnet vote account = FQwewNXahV7MiZcLpY6p1xhUs2acVGQ3U5Xxc7FzV571
BLOCKDAEMON_API_KEY=
BLOCKDAEMON_STAKE_API_KEY=
SOLANA_NETWORK=testnet # mainnet | testnet | devnet
PLAN_ID= # Optional. If provided, will use a specific validator plan.
SOLANA_NETWORK=mainnet # mainnet | Fireblocks testnet = devnet. DevNet is not supported by Staking API
SOLANA_STAKE_AMOUNT=1 # Amount of SOL to stake to the validator.
PLAN_ID= # Optional. If provided, will use a specific validator plan.

# Fireblocks
FIREBLOCKS_BASE_PATH="https=//sandbox-api.fireblocks.io/v1"
FIREBLOCKS_BASE_PATH="https://api.fireblocks.io/v1"
FIREBLOCKS_API_KEY="my-api-key"
FIREBLOCKS_SECRET_KEY="my-secret-key"
FIREBLOCKS_DELEGATOR_PUBLICKEY=""
FIREBLOCKS_SECRET_KEY="/Users/johndoe/my-secret-key"
FIREBLOCKS_VAULT_ACCOUNT_ID="0"
19 changes: 3 additions & 16 deletions solana-staking/fireblocks/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,16 @@ sequenceDiagram
cd solana-staking/fireblocks/nodejs/
cp .env.example .env
```
- update .env with API keys
- update .env with API keys, Fireblocks Vault ID

### Step 2. Install package dependancies
```shell
npm install
```

### Step 3. Launch solana-stake-fb.ts to auto-create the Builder Vault wallet address on first run
### Step 3. Launch solana-stake-fb.ts to generate the Stake Intent request, sign the request with Fireblocks and broadcast the transaction
```shell
npm run start solana-stake-fb.ts
```
- note, on first run this step will fail as the wallet address has no funds
- copy the new Solana wallet address and fund the account

### Step 4. Fund the new Solana wallet address with 2 SOL using faucets below
- https://solfaucet.com
- https://faucet.triangleplatform.com/solana/testnet
- https://faucet.quicknode.com/solana/testnet
- https://solfate.com/faucet

### Step 5. Launch solana-stake-fb.ts to generate the Stake Intent request, sign the request with BuilderVault and broadcast the transaction
```shell
npm run start solana-stake-fb.ts
```
- [optional] view the signed transaction contents with inspector: https://explorer.solana.com/tx/inspector?cluster=testnet
- [optional] view the signed transaction contents with inspector: https://explorer.solana.com/tx/inspector
- observe the confirmed transaction through the generated blockexplorer link
Loading

0 comments on commit dc091d0

Please sign in to comment.