sCrypt-Inc / boilerplate

sCrypt project boilerplate
326 stars 87 forks source link

helloworld contract deploy fail #314

Closed 86chenjie closed 9 months ago

86chenjie commented 10 months ago

https://docs.scrypt.io/tutorials/hello-world/ follow doc link above, error is below: `(base) jeff@jeffdeMacBook-Pro helloworld % npx ts-node deploy.ts /Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/index.js:901 error = new Error(message); ^ Error: Internal Server Error at Request.callback (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/index.js:901:17) at fn (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/index.js:1166:18) at IncomingMessage. (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/parsers/json.js:19:7) at IncomingMessage.emit (node:events:529:35) at IncomingMessage.emit (node:domain:489:12) at endReadableNT (node:internal/streams/readable:1400:12) at processTicksAndRejections (node:internal/process/task_queues:82:21) { status: 500, response: <ref *1> Response { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 500, statusMessage: 'Internal Server Error', client: [TLSSocket], _consuming: false, _dumped: false, req: [ClientRequest], text: '',

  [Symbol(kHeaders)]: [Object],
  [Symbol(kHeadersCount)]: 20,
  [Symbol(kTrailers)]: null,
  [Symbol(kTrailersCount)]: 0
},
request: Request {
  _events: [Object: null prototype],
  _eventsCount: 1,
  _maxListeners: undefined,
  _enableHttp2: false,
  _agent: false,
  _formData: null,
  method: 'GET',
  url: 'https://api.whatsonchain.com/v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/unspent',
  _header: {},
  header: {},
  writable: true,
  _redirects: 0,
  _maxRedirects: 5,
  cookies: '',
  qs: {},
  _query: [],
  qsRaw: [],
  _redirectList: [],
  _streamRequest: false,
  _lookup: undefined,
  req: [ClientRequest],
  protocol: 'https:',
  host: 'api.whatsonchain.com',
  _endCalled: true,
  _callback: [Function (anonymous)],
  _fullfilledPromise: [Promise],
  res: [IncomingMessage],
  _resBuffered: true,
  response: [Circular *1],
  called: true,
  [Symbol(kCapture)]: false
},
req: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 3,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: false,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  strictContentLength: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [TLSSocket],
  _header: 'GET /v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/unspent HTTP/1.1\r\n' +
    'Host: api.whatsonchain.com\r\n' +
    'Accept-Encoding: gzip, deflate\r\n' +
    'Connection: close\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  joinDuplicateHeaders: undefined,
  path: '/v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/unspent',
  _ended: true,
  res: [IncomingMessage],
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'api.whatsonchain.com',
  protocol: 'https:',
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
text: '',
files: undefined,
buffered: true,
headers: {
  date: 'Mon, 01 Jan 2024 10:57:29 GMT',
  'content-type': 'application/json; charset=UTF-8',
  'content-length': '0',
  connection: 'close',
  'referrer-policy': 'origin',
  vary: 'Origin',
  'x-content-type-options': 'nosniff',
  'cf-cache-status': 'DYNAMIC',
  server: 'cloudflare',
  'cf-ray': '83ea3dda2d0615e7-SJC'
},
header: {
  date: 'Mon, 01 Jan 2024 10:57:29 GMT',
  'content-type': 'application/json; charset=UTF-8',
  'content-length': '0',
  connection: 'close',
  'referrer-policy': 'origin',
  vary: 'Origin',
  'x-content-type-options': 'nosniff',
  'cf-cache-status': 'DYNAMIC',
  server: 'cloudflare',
  'cf-ray': '83ea3dda2d0615e7-SJC'
},
statusCode: 500,
status: 500,
statusType: 5,
info: false,
ok: false,
redirect: false,
clientError: false,
serverError: true,
error: Error: cannot GET /v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/unspent (500)
    at Response.toError (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/response.js:110:17)
    at Response._setStatusProperties (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/response-base.js:107:48)
    at new Response (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/response.js:41:8)
    at Request._emitResponse (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/index.js:953:20)
    at fn (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/index.js:1166:38)
    at IncomingMessage.<anonymous> (/Users/jeff/Workspace/scrypt/helloworld/node_modules/superagent/src/node/parsers/json.js:19:7)
    at IncomingMessage.emit (node:events:529:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  status: 500,
  text: '',
  method: 'GET',
  path: '/v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/unspent'
},
created: false,
accepted: false,
noContent: false,
badRequest: false,
unauthorized: false,
notAcceptable: false,
forbidden: false,
notFound: false,
unprocessableEntity: false,
type: 'application/json',
charset: 'UTF-8',
links: {},
setEncoding: [Function: bound ],
redirects: [],
_body: '',
pipe: [Function (anonymous)],
[Symbol(kCapture)]: false

} } (base) jeff@jeffdeMacBook-Pro helloworld % `

from log, access for "https://api.whatsonchain.com/v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/unspent" fail. but "https://api.whatsonchain.com/v1/bsv/test/address/mzuphPYBcDannfABd93B4cANLwRw9a3BqQ/confirmed/unspent" is ok.

yusufidimaina9989 commented 10 months ago

@86chenjie what is the problem ? because it works for me

gitzhou commented 9 months ago

All the steps in this tutorial work well on my side:

CleanShot-2024-01-27-04-58-49 CleanShot-2024-01-27-04-58-59 CleanShot-2024-01-27-04-59-58 CleanShot-2024-01-27-05-00-15 CleanShot-2024-01-27-05-00-26

gitzhou commented 9 months ago

please retry, if you still get errors, post things that describe what you did and at which step you got these errors.