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
7272STACKS_CORE_EVENT_PORT = 3700
7373STACKS_CORE_EVENT_HOST = 127.0.0.1
7474
75+ # Stacks core event payload body size limit. Defaults to 500MB.
76+ # STACKS_CORE_EVENT_BODY_LIMIT=500000000
77+
7578STACKS_BLOCKCHAIN_API_PORT = 3999
7679STACKS_BLOCKCHAIN_API_HOST = 127.0.0.1
7780
@@ -81,6 +84,9 @@ STACKS_CORE_RPC_PORT=20443
8184# STACKS_CORE_PROXY_HOST=127.0.0.1
8285# STACKS_CORE_PROXY_PORT=20443
8386
87+ # Stacks core RPC proxy body size limit. Defaults to 10MB.
88+ # STACKS_CORE_PROXY_BODY_LIMIT=10000000
89+
8490# Configure a path to a file containing additional stacks-node `POST /v2/tranascation` URLs for the /v2 proxy to mutlicast.
8591# The file should be a newline-delimited list of URLs.
8692# 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<
254254 } ) ;
255255 }
256256
257- const maxBodySize = 10_000_000 ; // 10 MB max POST body size
258257 fastify . addContentTypeParser (
259258 'application/octet-stream' ,
260- { parseAs : 'buffer' , bodyLimit : maxBodySize } ,
259+ {
260+ parseAs : 'buffer' ,
261+ bodyLimit : parseInt ( process . env [ 'STACKS_CORE_PROXY_BODY_LIMIT' ] ?? '10000000' ) ,
262+ } ,
261263 ( _req , body , done ) => {
262264 done ( null , body ) ;
263265 }
Original file line number Diff line number Diff line change @@ -784,8 +784,6 @@ export async function startEventServer(opts: {
784784 eventHost = hostname ;
785785 }
786786
787- const bodyLimit = 1_000_000 * 500 ; // 500MB body limit
788-
789787 const reqLogSerializer = ( req : FastifyRequest ) => ( {
790788 method : req . method ,
791789 url : req . url ,
@@ -812,7 +810,7 @@ export async function startEventServer(opts: {
812810 } ;
813811
814812 const app = Fastify ( {
815- bodyLimit,
813+ bodyLimit : parseInt ( process . env [ 'STACKS_CORE_EVENT_BODY_LIMIT' ] ?? '500000000' ) ,
816814 trustProxy : true ,
817815 logger : loggerOpts ,
818816 ignoreTrailingSlash : true ,
You can’t perform that action at this time.
0 commit comments