Skip to content

Commit 299d45b

Browse files
authored
Merge pull request #1335 from hirosystems/beta
release v6.0.0
2 parents 499065f + 62990bf commit 299d45b

File tree

153 files changed

+31800
-29720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+31800
-29720
lines changed

.env

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ PG_APPLICATION_NAME=stacks-blockchain-api
3535
# See https://node-postgres.com/api/pool
3636
# PG_CONNECTION_POOL_MAX=10
3737

38-
# Enable to have stacks-node events streamed to a file while the application is running
39-
# STACKS_EXPORT_EVENTS_FILE=/tmp/stacks-events.tsv
40-
4138
# If specified, controls the Stacks Blockchain API mode. The possible values are:
4239
# * `readonly`: Runs the API endpoints without an Event Server that listens to events from a node and
4340
# writes them to the local database. The API will only read data from the PG database

.gitpod.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM blockstack/stacks-blockchain:2.05.0.0.0-stretch as corenode
1+
FROM blockstack/stacks-blockchain:2.05.0.3.0-stretch as corenode
22

33
FROM gitpod/workspace-postgres
44

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-exact=true

.vscode/launch.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,48 @@
206206
"preLaunchTask": "stacks-node:deploy-dev",
207207
"postDebugTask": "stacks-node:stop-dev"
208208
},
209+
{
210+
"type": "node",
211+
"request": "launch",
212+
"name": "Jest: rosetta-cli-data",
213+
"program": "${workspaceFolder}/node_modules/.bin/jest",
214+
"args": [
215+
"--testTimeout=3600000",
216+
"--runInBand",
217+
"--no-cache",
218+
"--config",
219+
"${workspaceRoot}/jest.config.rosetta-cli-data.js"
220+
],
221+
"outputCapture": "std",
222+
"console": "integratedTerminal",
223+
"preLaunchTask": "stacks-node:deploy-dev",
224+
"postDebugTask": "stacks-node:stop-dev",
225+
"env": {
226+
"NODE_ENV": "development",
227+
"STACKS_CHAIN_ID": "0x80000000"
228+
}
229+
},
230+
{
231+
"type": "node",
232+
"request": "launch",
233+
"name": "Jest: rosetta-cli-construction",
234+
"program": "${workspaceFolder}/node_modules/.bin/jest",
235+
"args": [
236+
"--testTimeout=3600000",
237+
"--runInBand",
238+
"--no-cache",
239+
"--config",
240+
"${workspaceRoot}/jest.config.rosetta-cli-construction.js"
241+
],
242+
"outputCapture": "std",
243+
"console": "integratedTerminal",
244+
"preLaunchTask": "stacks-node:deploy-dev",
245+
"postDebugTask": "stacks-node:stop-dev",
246+
"env": {
247+
"NODE_ENV": "development",
248+
"STACKS_CHAIN_ID": "0x80000000"
249+
}
250+
},
209251
{
210252
"type": "node",
211253
"request": "launch",

CHANGELOG.md

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,107 @@
1-
## [5.0.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v5.0.0...v5.0.1) (2022-09-20)
1+
## [6.0.0-beta.10](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.9...v6.0.0-beta.10) (2022-10-06)
2+
3+
4+
### Reverts
5+
6+
* Revert "chore!: remove deprecated `/nft_events` endpoint (#1329)" (#1343) ([c537ee4](https://github.com/hirosystems/stacks-blockchain-api/commit/c537ee4c6f333c0a43c9e9e1ca1e073f03c58fc5)), closes [#1329](https://github.com/hirosystems/stacks-blockchain-api/issues/1329) [#1343](https://github.com/hirosystems/stacks-blockchain-api/issues/1343)
7+
8+
## [6.0.0-beta.9](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.8...v6.0.0-beta.9) (2022-09-30)
9+
10+
11+
### Bug Fixes
12+
13+
* support multiple BNS name events in the same transaction ([#1337](https://github.com/hirosystems/stacks-blockchain-api/issues/1337)) ([1edb256](https://github.com/hirosystems/stacks-blockchain-api/commit/1edb25697df689dbf1da5d412f5d40e4aac024f3))
14+
15+
## [6.0.0-beta.8](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.7...v6.0.0-beta.8) (2022-09-29)
16+
17+
18+
### Bug Fixes
19+
20+
* add owner index on subdomains table ([#1323](https://github.com/hirosystems/stacks-blockchain-api/issues/1323)) ([c9c6d05](https://github.com/hirosystems/stacks-blockchain-api/commit/c9c6d053fd8896187a26a788aaaa56fb48285e61))
221

22+
## [6.0.0-beta.7](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.6...v6.0.0-beta.7) (2022-09-28)
23+
24+
25+
### ⚠ BREAKING CHANGES
26+
27+
* remove deprecated `/nft_events` endpoint (#1329)
328

429
### Bug Fixes
530

31+
* event_observer_requests json writes ([#1334](https://github.com/hirosystems/stacks-blockchain-api/issues/1334)) ([465aa0b](https://github.com/hirosystems/stacks-blockchain-api/commit/465aa0b42ca3dda57d06f6c0756b03d591e7f027))
32+
33+
34+
### Miscellaneous Chores
35+
36+
* remove deprecated `/nft_events` endpoint ([#1329](https://github.com/hirosystems/stacks-blockchain-api/issues/1329)) ([65bb4e5](https://github.com/hirosystems/stacks-blockchain-api/commit/65bb4e55fabf21a70183d2b16c8bc1f6f742d04e))
37+
38+
## [6.0.0-beta.6](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.5...v6.0.0-beta.6) (2022-09-23)
39+
40+
41+
### Features
42+
43+
* add token_type metadata for rosetta ft operations ([#1332](https://github.com/hirosystems/stacks-blockchain-api/issues/1332)) ([09af27b](https://github.com/hirosystems/stacks-blockchain-api/commit/09af27b24be8e30a840707707b79d65cd45f2351))
44+
45+
## [6.0.0-beta.5](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.4...v6.0.0-beta.5) (2022-09-22)
46+
47+
48+
### Features
49+
50+
* add owner index to subdomains table ([#1331](https://github.com/hirosystems/stacks-blockchain-api/issues/1331)) ([a6c5e12](https://github.com/hirosystems/stacks-blockchain-api/commit/a6c5e12faa256633a7c9ae4c7cf8524013d187d6))
51+
52+
## [6.0.0-beta.4](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.3...v6.0.0-beta.4) (2022-09-22)
53+
54+
55+
### Bug Fixes
56+
57+
* upgrade stacks node versions to 2.05.0.3.0 ([#1328](https://github.com/hirosystems/stacks-blockchain-api/issues/1328)) ([e30636e](https://github.com/hirosystems/stacks-blockchain-api/commit/e30636e30f716a7335792914a142fa54f423dc9a))
58+
59+
## [6.0.0-beta.3](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.2...v6.0.0-beta.3) (2022-09-21)
60+
61+
62+
### Bug Fixes
63+
64+
* refresh materialized views concurrently in new pg format ([#1324](https://github.com/hirosystems/stacks-blockchain-api/issues/1324)) ([20b284f](https://github.com/hirosystems/stacks-blockchain-api/commit/20b284fa381041fb842bf61d8a184be6ea84810f))
65+
* retry pg connection on new library code ([#1326](https://github.com/hirosystems/stacks-blockchain-api/issues/1326)) ([35db939](https://github.com/hirosystems/stacks-blockchain-api/commit/35db939199a2d826e7ee4dbe31af48cc42364ea2))
66+
67+
## [6.0.0-beta.2](https://github.com/hirosystems/stacks-blockchain-api/compare/v6.0.0-beta.1...v6.0.0-beta.2) (2022-09-13)
68+
69+
70+
### Bug Fixes
71+
72+
* remove live tsv append ([#1315](https://github.com/hirosystems/stacks-blockchain-api/issues/1315)) ([e2a1247](https://github.com/hirosystems/stacks-blockchain-api/commit/e2a124710f955d9d32ff5a928af7da08823689d4))
73+
74+
## [6.0.0-beta.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v5.0.0...v6.0.0-beta.1) (2022-09-13)
75+
76+
77+
### ⚠ BREAKING CHANGES
78+
79+
* mark breaking change
80+
81+
### Features
82+
83+
* add `transaction_count` for `microblocks_accepted` in block ([#1162](https://github.com/hirosystems/stacks-blockchain-api/issues/1162)) ([78d7d9c](https://github.com/hirosystems/stacks-blockchain-api/commit/78d7d9c9f72db8ce6c59e0ea59a2579aceec014e))
84+
* add API version in response header ([#1216](https://github.com/hirosystems/stacks-blockchain-api/issues/1216)) ([1e998db](https://github.com/hirosystems/stacks-blockchain-api/commit/1e998db7d1c87c064376cb950d05b073d9d3f076))
85+
* mark breaking change ([669fd0d](https://github.com/hirosystems/stacks-blockchain-api/commit/669fd0d8c00b8ca9224c9b5411a070b32c3b0529))
86+
* mempool stats endpoint and prometheus metrics ([#1241](https://github.com/hirosystems/stacks-blockchain-api/issues/1241)) ([9482238](https://github.com/hirosystems/stacks-blockchain-api/commit/9482238599549fd651c8c87b545c175d8a219521))
87+
* refactor pg classes, switch to postgres.js ([#1148](https://github.com/hirosystems/stacks-blockchain-api/issues/1148)) ([3ff4177](https://github.com/hirosystems/stacks-blockchain-api/commit/3ff41779f844c611fbd95429aeefbdb085a59026)), closes [#1168](https://github.com/hirosystems/stacks-blockchain-api/issues/1168)
88+
* send nft updates through websocket channels ([#1218](https://github.com/hirosystems/stacks-blockchain-api/issues/1218)) ([920a7b8](https://github.com/hirosystems/stacks-blockchain-api/commit/920a7b892a39f0f1e76363211573d935ae2c75da))
89+
90+
### Bug Fixes
91+
92+
* consolidate db migrations ([#1314](https://github.com/hirosystems/stacks-blockchain-api/issues/1314)) ([d6bdf9f](https://github.com/hirosystems/stacks-blockchain-api/commit/d6bdf9faff905d5e208e61b04c34321e954a2fb1))
93+
* included query params in redirecting to prefix 0x in tx endpoint ([#1205](https://github.com/hirosystems/stacks-blockchain-api/issues/1205)) ([664cce7](https://github.com/hirosystems/stacks-blockchain-api/commit/664cce744d1aecc0b3226ae07ac81e5d0cd13871))
94+
* incorrect websocket/socket.io transaction updates ([#1197](https://github.com/hirosystems/stacks-blockchain-api/issues/1197)) ([8ee1da8](https://github.com/hirosystems/stacks-blockchain-api/commit/8ee1da840bfa3fcecac79e09e375b720cd0ccc04))
95+
* mobx breakage by locking package dependencies ([#1206](https://github.com/hirosystems/stacks-blockchain-api/issues/1206)) ([5f8bc9f](https://github.com/hirosystems/stacks-blockchain-api/commit/5f8bc9fd4f45877eedbfbce29c7feb5905ba8836))
96+
* optimize `getMicroblocks` query ([#1179](https://github.com/hirosystems/stacks-blockchain-api/issues/1179)) ([7691109](https://github.com/hirosystems/stacks-blockchain-api/commit/769110926eb7b7c9a4d2754af8ce6f1213e2c56f))
97+
* optimize block endpoint ([#1190](https://github.com/hirosystems/stacks-blockchain-api/issues/1190)) ([943e2d1](https://github.com/hirosystems/stacks-blockchain-api/commit/943e2d1c555473f7f0fb61959ed89185e89ed062))
98+
* remove duplicate txs in microblock responses ([#1167](https://github.com/hirosystems/stacks-blockchain-api/issues/1167)) ([15c0c11](https://github.com/hirosystems/stacks-blockchain-api/commit/15c0c1124a2c91756389274c8a6ebfa8aa44228b))
99+
* tests ([1c1fd16](https://github.com/hirosystems/stacks-blockchain-api/commit/1c1fd1619c8ea97c2636082203fb678f06493786))
100+
* upsert nft and ft metadata ([#1193](https://github.com/hirosystems/stacks-blockchain-api/issues/1193)) ([c4eec5d](https://github.com/hirosystems/stacks-blockchain-api/commit/c4eec5d060666b660c48d326e74b4f989b9ee21d))
101+
102+
## [5.0.1](https://github.com/hirosystems/stacks-blockchain-api/compare/v5.0.0...v5.0.1) (2022-09-20)
103+
104+
6105
* add owner index on subdomains table ([#1323](https://github.com/hirosystems/stacks-blockchain-api/issues/1323)) ([c9c6d05](https://github.com/hirosystems/stacks-blockchain-api/commit/c9c6d053fd8896187a26a788aaaa56fb48285e61))
7106

8107
## [5.0.0](https://github.com/hirosystems/stacks-blockchain-api/compare/v4.1.2...v5.0.0) (2022-09-07)

client/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-exact=true

client/README.md

Lines changed: 112 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -287,61 +287,77 @@ Sent every time a transaction is sent or received by a specific Stacks address.
287287
Example message if subscribed to updates for an address `SP3C5SSYVKPAWTR8Y63CVYBR65GD3MG7K80526D1Q`:
288288
```json
289289
{
290-
"tx_id": "0x1f9e737dfbebcb57f0879a44518c1cc909be0ceb8ab0bc9b38ce63e3b6847917",
291-
"nonce": 6,
292-
"fee_rate": "277600",
293-
"sender_address": "SP3C5SSYVKPAWTR8Y63CVYBR65GD3MG7K80526D1Q",
294-
"sponsored": false,
295-
"post_condition_mode": "deny",
296-
"post_conditions": [
297-
{
298-
"type": "stx",
299-
"condition_code": "sent_less_than_or_equal_to",
300-
"amount": "25000000",
301-
"principal": {
302-
"type_id": "principal_standard",
303-
"address": "SP3C5SSYVKPAWTR8Y63CVYBR65GD3MG7K80526D1Q"
304-
}
305-
},
306-
{
307-
"type": "non_fungible",
308-
"condition_code": "not_sent",
309-
"principal": {
310-
"type_id": "principal_contract",
311-
"contract_name": "stacks-skaters",
312-
"address": "SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG"
313-
},
314-
"asset": {
315-
"contract_name": "stacks-skaters",
316-
"asset_name": "stacks-skaters",
317-
"contract_address": "SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG"
318-
},
319-
"asset_value": {
320-
"hex": "0x0100000000000000000000000000000000",
321-
"repr": "u0"
290+
"tx": {
291+
"tx_id": "0x0c818b9af6356a2eb4d64ee1b2490193d97a82392c02e7264e006ae5979aa726",
292+
"nonce": 32,
293+
"fee_rate": "3000",
294+
"sender_address": "SP3BK1NNSWN719Z6KDW05RBGVS940YCN6X84STYPR",
295+
"sponsored": false,
296+
"post_condition_mode": "deny",
297+
"post_conditions": [
298+
{
299+
"type": "stx",
300+
"condition_code": "sent_equal_to",
301+
"amount": "4375722",
302+
"principal": {
303+
"type_id": "principal_contract",
304+
"contract_name": "newyorkcitycoin-core-v1",
305+
"address": "SP2H8PY27SEZ03MWRKS5XABZYQN17ETGQS3527SA5"
306+
}
322307
}
308+
],
309+
"anchor_mode": "any",
310+
"is_unanchored": false,
311+
"block_hash": "0xe2a811451fed35331cf462a9107e3453fdebba1682dfad83cbbcdc603f644ed3",
312+
"parent_block_hash": "0x6d8653da23188d4d78ab9b6448229be68abe1bca001f8c574c094289107bce15",
313+
"block_height": 58775,
314+
"burn_block_time": 1651720813,
315+
"burn_block_time_iso": "2022-05-05T03:20:13.000Z",
316+
"parent_burn_block_time": 1651720368,
317+
"parent_burn_block_time_iso": "2022-05-05T03:12:48.000Z",
318+
"canonical": true,
319+
"tx_index": 36,
320+
"tx_status": "success",
321+
"tx_result": {
322+
"hex": "0x0703",
323+
"repr": "(ok true)"
323324
},
325+
"microblock_hash": "",
326+
"microblock_sequence": 2147483647,
327+
"microblock_canonical": true,
328+
"event_count": 1,
329+
"events": [],
330+
"execution_cost_read_count": 15,
331+
"execution_cost_read_length": 31147,
332+
"execution_cost_runtime": 81975,
333+
"execution_cost_write_count": 2,
334+
"execution_cost_write_length": 123,
335+
"tx_type": "contract_call",
336+
"contract_call": {
337+
"contract_id": "SP2H8PY27SEZ03MWRKS5XABZYQN17ETGQS3527SA5.newyorkcitycoin-core-v1",
338+
"function_name": "claim-stacking-reward",
339+
"function_signature": "(define-public (claim-stacking-reward (targetCycle uint)))",
340+
"function_args": [
341+
{
342+
"hex": "0x0100000000000000000000000000000008",
343+
"repr": "u8",
344+
"name": "targetCycle",
345+
"type": "uint"
346+
}
347+
]
348+
}
349+
},
350+
"stx_sent": "3000",
351+
"stx_received": "4375722",
352+
"stx_transfers": [
324353
{
325-
"type": "stx",
326-
"condition_code": "sent_less_than_or_equal_to",
327-
"amount": "20000000",
328-
"principal": {
329-
"type_id": "principal_contract",
330-
"contract_name": "stacks-skaters",
331-
"address": "SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG"
332-
}
354+
"amount": "4375722",
355+
"sender": "SP2H8PY27SEZ03MWRKS5XABZYQN17ETGQS3527SA5.newyorkcitycoin-core-v1",
356+
"recipient": "SP3BK1NNSWN719Z6KDW05RBGVS940YCN6X84STYPR"
333357
}
334358
],
335-
"anchor_mode": "any",
336-
"tx_status": "pending",
337-
"receipt_time": 1637172946,
338-
"receipt_time_iso": "2021-11-17T18:15:46.000Z",
339-
"tx_type": "contract_call",
340-
"contract_call": {
341-
"contract_id": "SPJW1XE278YMCEYMXB8ZFGJMH8ZVAAEDP2S2PJYG.stacks-skaters",
342-
"function_name": "mint",
343-
"function_signature": ""
344-
}
359+
"ft_transfers": [],
360+
"nft_transfers": []
345361
}
346362
```
347363
Subscribe via WebSockets:
@@ -399,6 +415,52 @@ Subscribe via Socket.io:
399415
sc.subscribeAddressStxBalance('SP3C5SSYVKPAWTR8Y63CVYBR65GD3MG7K80526D1Q');
400416
```
401417

418+
### NFT event updates
419+
420+
Sent every time an NFT event occurs. You can subscribe to all events or events scoped to a single
421+
collection or a single asset.
422+
423+
```json
424+
{
425+
"asset_event_type": "transfer",
426+
"asset_identifier": "SP176ZMV706NZGDDX8VSQRGMB7QN33BBDVZ6BMNHD.project-indigo-act1::Project-Indigo-Act1",
427+
"value": {
428+
"hex": "0x0100000000000000000000000000000095",
429+
"repr": "u149"
430+
},
431+
"tx_id": "0xfb4bfc274007825dfd2d8f6c3f429407016779e9954775f82129108282d4c4ce",
432+
"tx_index": 0,
433+
"sender": null,
434+
"recipient": "SP3BK1NNSWN719Z6KDW05RBGVS940YCN6X84STYPR",
435+
"block_height": 45231,
436+
"event_index": 0,
437+
}
438+
```
439+
Subscribe via WebSockets:
440+
```js
441+
client.subscribeNftEventUpdates(event => {});
442+
client.subscribeNftAssetEventUpdates(
443+
'SP176ZMV706NZGDDX8VSQRGMB7QN33BBDVZ6BMNHD.project-indigo-act1::Project-Indigo-Act1',
444+
'0x0100000000000000000000000000000095',
445+
event => {}
446+
);
447+
client.subscribeNftCollectionEventUpdates(
448+
'SP176ZMV706NZGDDX8VSQRGMB7QN33BBDVZ6BMNHD.project-indigo-act1::Project-Indigo-Act1',
449+
event => {}
450+
);
451+
```
452+
Subscribe via Socket.io:
453+
```js
454+
sc.subscribeNftEventUpdates();
455+
sc.subscribeNftAssetEventUpdates(
456+
'SP176ZMV706NZGDDX8VSQRGMB7QN33BBDVZ6BMNHD.project-indigo-act1::Project-Indigo-Act1',
457+
'0x0100000000000000000000000000000095',
458+
);
459+
sc.subscribeNftCollectionEventUpdates(
460+
'SP176ZMV706NZGDDX8VSQRGMB7QN33BBDVZ6BMNHD.project-indigo-act1::Project-Indigo-Act1',
461+
);
462+
```
463+
402464
## Known Issues
403465

404466
- The TypeScript definitions for several objects involving type unions, including transactions, are incorrectly specified as only `object`.

0 commit comments

Comments
 (0)