aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

error: relation "subscription" does not exist #146

Closed chaishiqi closed 2 years ago

chaishiqi commented 2 years ago

I have downloaded the image auroraisnear/relayer-endpoint:mainnet by dockerhub. When running with docker-compose,some problem occured like below:

/srv/aurora/relayer/node_modules/pg-protocol/dist/parser.js:287
        const message = name === 'notice' ? new messages_1.NoticeMessage(length, messageValue) : new messages_1.DatabaseError(messageValue, length, name);
                                                                                                 ^

error: relation "subscription" does not exist
    at Parser.parseErrorMessage (/srv/aurora/relayer/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/srv/aurora/relayer/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/srv/aurora/relayer/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/srv/aurora/relayer/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:199:23) 

how to resolve it?

0x3bfc commented 2 years ago

From CHANGELOG.md

New table to handle subscriptions. To update your existing schema, execute:

CREATE TABLE subscription (
    sec_websocket_key varchar COLLATE "default",
    id                varchar COLLATE "default",
    type              varchar COLLATE "default",
    ip                varchar COLLATE "default",
    filter            jsonb NULL
);

CREATE UNIQUE INDEX subscription_sec_websocket_key_type_filter_index_idx ON subscription (sec_websocket_key, type, filter);