File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ PG_APPLICATION_NAME=stacks-blockchain-api
72
72
STACKS_CORE_EVENT_PORT = 3700
73
73
STACKS_CORE_EVENT_HOST = 127.0.0.1
74
74
75
+ # Stacks core event payload body size limit. Defaults to 500MB.
76
+ # STACKS_CORE_EVENT_BODY_LIMIT=500000000
77
+
75
78
STACKS_BLOCKCHAIN_API_PORT = 3999
76
79
STACKS_BLOCKCHAIN_API_HOST = 127.0.0.1
77
80
@@ -81,6 +84,9 @@ STACKS_CORE_RPC_PORT=20443
81
84
# STACKS_CORE_PROXY_HOST=127.0.0.1
82
85
# STACKS_CORE_PROXY_PORT=20443
83
86
87
+ # Stacks core RPC proxy body size limit. Defaults to 10MB.
88
+ # STACKS_CORE_PROXY_BODY_LIMIT=10000000
89
+
84
90
# Configure a path to a file containing additional stacks-node `POST /v2/tranascation` URLs for the /v2 proxy to mutlicast.
85
91
# The file should be a newline-delimited list of URLs.
86
92
# STACKS_API_EXTRA_TX_ENDPOINTS_FILE=./config/extra-tx-post-endpoints.txt
Original file line number Diff line number Diff line change @@ -254,10 +254,12 @@ export const CoreNodeRpcProxyRouter: FastifyPluginAsync<
254
254
} ) ;
255
255
}
256
256
257
- const maxBodySize = 10_000_000 ; // 10 MB max POST body size
258
257
fastify . addContentTypeParser (
259
258
'application/octet-stream' ,
260
- { parseAs : 'buffer' , bodyLimit : maxBodySize } ,
259
+ {
260
+ parseAs : 'buffer' ,
261
+ bodyLimit : parseInt ( process . env [ 'STACKS_CORE_PROXY_BODY_LIMIT' ] ?? '10000000' ) ,
262
+ } ,
261
263
( _req , body , done ) => {
262
264
done ( null , body ) ;
263
265
}
Original file line number Diff line number Diff line change @@ -784,8 +784,6 @@ export async function startEventServer(opts: {
784
784
eventHost = hostname ;
785
785
}
786
786
787
- const bodyLimit = 1_000_000 * 500 ; // 500MB body limit
788
-
789
787
const reqLogSerializer = ( req : FastifyRequest ) => ( {
790
788
method : req . method ,
791
789
url : req . url ,
@@ -812,7 +810,7 @@ export async function startEventServer(opts: {
812
810
} ;
813
811
814
812
const app = Fastify ( {
815
- bodyLimit,
813
+ bodyLimit : parseInt ( process . env [ 'STACKS_CORE_EVENT_BODY_LIMIT' ] ?? '500000000' ) ,
816
814
trustProxy : true ,
817
815
logger : loggerOpts ,
818
816
ignoreTrailingSlash : true ,
You can’t perform that action at this time.
0 commit comments