Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
added Dockerfile
  • Loading branch information
rotarur committed Sep 26, 2023
1 parent d8a3788 commit 33596c6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.18 AS builder

RUN mkdir src/app
WORKDIR /src/app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/ipfs-mgm cmd/cli/ipfs-mgm.go

FROM golang:1.18-alpine
COPY --from=builder /bin/ipfs-mgm /bin/ipfs-mgm
ENTRYPOINT [ "/bin/ipfs-mgm" ]
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,59 @@ Script to manage the IPFS files. It can be used to sync the CID's between two no

## Install

### Manually

```bash
go install cmd/cli/ipfs-mgm.go
```

## Usage
Transfer all files from one IPFS node to another:
#### View help:

```bash
ipfs-mgm
```

or

```bash
ipfs-mgm --help
```

##### View subcommand help:

```bash
ipfs-mgm sync --help
```

#### Transfer all files from one IPFS node to another:

```bash
ipfs-mgm sync -s <SOURCE URL> -d <DESTINATION URL>
```

Transfer only specific files from one IPFS node to another:
#### Transfer only specific files from one IPFS node to another:

```bash
ipfs-mgm sync -s <SOURCE URL> -d <DESTINATION URL> -f <FILE>
```

In this case, <FILE> has to be a file with one IPFS hash per line for each file that should be synced from the `-s` node to the `-d` node.

*Example*:

```text
QmZaHasmzsb1ReQHpCLUoXqqWchTgBrtRvbg7TqsUZXSuU
bafkreib47hfjivabsgaly3mupfqjvdywygfwnnoizlwg7wj2we3yh4t6fe
QmbyzKCFE6d22vnRVekN2Z5PT8Ha1g3TSku8UH5KBp2cTY
QmfNueFQg19hyBtCRUPJRpxVtdwtp8cgWpuRoQpRP3n9st
```

## Docker

- TO BE ADDED

## TODO:

- [ ] Implement assync calls by creating a worker queue in batches
- [ ] Add directory support for sync operation

0 comments on commit 33596c6

Please sign in to comment.