Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change ipfs default to remote mode and remove bundled ceramic-one #3261

Merged
merged 4 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Dockerfile.daemon
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ FROM node:20 as ceramic

RUN apt-get update && apt-get install -y netcat-traditional gettext-base jq

COPY ci-scripts/install-rust-ceramic.sh ./

ARG RUST_CERAMIC_VERSION=latest
RUN ./install-rust-ceramic.sh ${RUST_CERAMIC_VERSION}

WORKDIR /js-ceramic

Expand All @@ -25,14 +21,11 @@ ARG GIT_COMMIT_HASH=docker

RUN lerna run build

ENV CERAMIC_ONE_PATH=/usr/local/bin/ceramic-one CERAMIC_ONE_STORE_DIR=~/.ceramic-one

EXPOSE 7007

ENTRYPOINT ["./packages/cli/bin/ceramic.js", "daemon"]

FROM ceramic as composedb

ARG COMPOSEDB_VERSION=latest
ENV CERAMIC_ONE_PATH=/usr/local/bin/ceramic-one CERAMIC_ONE_STORE_DIR=~/.ceramic-one
RUN npm install --location=global @composedb/cli@${COMPOSEDB_VERSION}
2 changes: 1 addition & 1 deletion packages/cli/src/ceramic-cli-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const generateDefaultDaemonConfig = () => {
'auth-method': AnchorServiceAuthMethods.DID,
},
'http-api': { 'cors-allowed-origins': [new RegExp('.*')], 'admin-dids': [] },
ipfs: { mode: IpfsMode.BUNDLED },
ipfs: { mode: IpfsMode.REMOTE, host: 'http://localhost:5101' },
logger: { 'log-level': LogLevel.important, 'log-to-files': false },
metrics: {
'metrics-exporter-enabled': false,
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/src/ceramic-daemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,14 @@ export class CeramicDaemon {
ceramicConfig.loggerProvider.getDiagnosticsLogger(),
opts.ipfs?.host
)
const ipfsId = await ipfs.id()
let ipfsId
try {
ipfsId = await ipfs.id()
} catch (err) {
throw new Error(
`Error connecting to p2p node. Make sure ceramic-one is running or use --ipfs-api modify the expected http location (currently ${opts.ipfs?.host}): ${err}`
dav1do marked this conversation as resolved.
Show resolved Hide resolved
)
}

// we need to change the values before processing the config, so we keep track to log the warning after we have logging set up
const desiredIpfsClient = EnvironmentUtils.useRustCeramic() ? 'ceramic-one' : 'kubo'
Expand Down
7 changes: 2 additions & 5 deletions packages/cli/src/ipfs-connection-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ export class IpfsConnectionFactory {
return ipfsApi
} else {
if (EnvironmentUtils.useRustCeramic()) {
return ipfs.createIPFS(
{
rust: ipfs.RustIpfs.defaultOptions(network),
},
false
throw new Error(
`Running ceramic-one in bundled mode is not supported. Pass --ipfs-api to connect to an external ceramic-one node.`
)
} else {
return this.createGoIPFS()
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-daemon/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './create-ipfs.js'
export * from './ipfs-daemon.js'
export * from './healthcheck-server.js'
export * from './rust-ipfs.js'